PageSourceSearch

https://app.briefhq.ai/_next/static/chunks/07opscdkb5i8m.js?dpl=510c98eb188242c92d59b4591a558c5f6c90e109

js briefhq.ai collected 2026-09-28 23:57:37 UTC 175,030 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8464886,e=>{"use strict";e.s([],42140),e.i(42140);var t,n,r,o,i,s=e.i(8758020),l=e.i(5594262),a=e.i(2421683),c=e.i(8705199);let h=s.createContext(void 0);function d(){let e=s.useContext(h);if(void 0===e)throw Error((0,c.f)(53));return e}var p=e.i(317608);let f=((t={}).scrollAreaCornerHeight="--scroll-area-corner-height",t.scrollAreaCornerWidth="--scroll-area-corner-width",t);function u(e,t,n){if(!e)return 0;let r=getComputedStyle(e),o="x"===n?"Inline":"Block";return"x"===n&&"margin"===t?2*parseFloat(r[`${t}InlineStart`]):parseFloat(r[`${t}${o}Start`])+parseFloat(r[`${t}${o}End`])}let m=((n={}).orientation="data-orientation",n.hovering="data-hovering",n.scrolling="data-scrolling",n.hasOverflowX="data-has-overflow-x",n.hasOverflowY="data-has-overflow-y",n.overflowXStart="data-overflow-x-start",n.overflowXEnd="data-overflow-x-end",n.overflowYStart="data-overflow-y-start",n.overflowYEnd="data-overflow-y-end",n);var g=e.i(6072556),y=e.i(4630363);let v=((r={}).scrolling="data-scrolling",r.hasOverflowX="data-has-overflow-x",r.hasOverflowY="data-has-overflow-y",r.overflowXStart="data-overflow-x-start",r.overflowXEnd="data-overflow-x-end",r.overflowYStart="data-overflow-y-start",r.overflowYEnd="data-overflow-y-end",r),w={hasOverflowX:e=>e?{[v.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[v.hasOverflowY]:""}:null,overflowXStart:e=>e?{[v.overflowXStart]:""}:null,overflowXEnd:e=>e?{[v.overflowXEnd]:""}:null,overflowYStart:e=>e?{[v.overflowYStart]:""}:null,overflowYEnd:e=>e?{[v.overflowYEnd]:""}:null,cornerHidden:()=>null};var b=e.i(2546543),S=e.i(3912379),k=e.i(5188292);let C={x:0,y:0},x={width:0,height:0},M={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},N={x:!0,y:!0,corner:!0},O=s.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:o,style:i,...c}=e,{xStart:d,xEnd:v,yStart:O,yEnd:D}=function(e){if("number"==typeof e){let t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}(o),T=(0,y.f)(),E=(0,a.e)(),A=(0,a.e)(),{nonce:R,disableStyleElements:I}=(0,S.f)(),[P,V]=s.useState(!1),[B,z]=s.useState(!1),[$,F]=s.useState(!1),[W,L]=s.useState(!1),[J,H]=s.useState(!1),[K,q]=s.useState(x),[_,j]=s.useState(x),[X,Y]=s.useState(M),[U,G]=s.useState(N),Z=s.useRef(null),Q=s.useRef(null),ee=s.useRef(null),et=s.useRef(null),en=s.useRef(null),er=s.useRef(null),eo=s.useRef(null),ei=s.useRef(!1),es=s.useRef(0),el=s.useRef(0),ea=s.useRef(0),ec=s.useRef(0),eh=s.useRef("vertical"),ed=s.useRef(C),ep=(0,l.f)(e=>{let t=e.x-ed.current.x,n=e.y-ed.current.y;ed.current=e,0!==n&&(F(!0),E.start(500,()=>{F(!1)})),0!==t&&(z(!0),A.start(500,()=>{z(!1)}))}),ef=(0,l.f)(e=>{0===e.button&&(ei.current=!0,es.current=e.clientY,el.current=e.clientX,eh.current=e.currentTarget.getAttribute(m.orientation),Q.current&&(ea.current=Q.current.scrollTop,ec.current=Q.current.scrollLeft),en.current&&"vertical"===eh.current&&en.current.setPointerCapture(e.pointerId),er.current&&"horizontal"===eh.current&&er.current.setPointerCapture(e.pointerId))}),eu=(0,l.f)(e=>{if(!ei.current)return;let t=e.clientY-es.current,n=e.clientX-el.current;if(Q.current){let r=Q.current.scrollHeight,o=Q.current.clientHeight,i=Q.current.scrollWidth,s=Q.current.clientWidth;if(en.current&&ee.current&&"vertical"===eh.current){let n=u(ee.current,"padding","y"),i=u(en.current,"margin","y"),s=en.current.offsetHeight,l=ee.current.offsetHeight-s-n-i;Q.current.scrollTop=ea.current+t/l*(r-o),e.preventDefault(),F(!0),E.start(500,()=>{F(!1)})}if(er.current&&et.current&&"horizontal"===eh.current){let t=u(et.current,"padding","x"),r=u(er.current,"margin","x"),o=er.current.offsetWidth,l=et.current.offsetWidth-o-t-r;Q.current.scrollLeft=ec.current+n/l*(i-s),e.preventDefault(),z(!0),A.start(500,()=>{z(!1)})}}}),em=(0,l.f)(e=>{ei.current=!1,en.current&&"vertical"===eh.current&&en.current.hasPointerCapture(e.pointerId)&&en.current.releasePointerCapture(e.pointerId),er.current&&"horizontal"===eh.current&&er.current.hasPointerCapture(e.pointerId)&&er.current.releasePointerCapture(e.pointerId)});function eg(e){L("touch"===e.pointerType)}function ey(e){eg(e),"touch"!==e.pointerType&&V((0,b.I)(Z.current,e.target))}let ev=s.useMemo(()=>({scrolling:B||$,hasOverflowX:!U.x,hasOverflowY:!U.y,overflowXStart:X.xStart,overflowXEnd:X.xEnd,overflowYStart:X.yStart,overflowYEnd:X.yEnd,cornerHidden:U.corner}),[B,$,U.x,U.y,U.corner,X]),ew={role:"presentation",onPointerEnter:ey,onPointerMove:ey,onPointerDown:eg,onPointerLeave(){V(!1)},style:{position:"relative",[f.scrollAreaCornerHeight]:`${K.height}px`,[f.scrollAreaCornerWidth]:`${K.width}px`}},eb=(0,p.f)("div",e,{state:ev,ref:[t,Z],props:[ew,c],stateAttributesMapping:w}),eS=s.useMemo(()=>({handlePointerDown:ef,handlePointerMove:eu,handlePointerUp:em,handleScroll:ep,cornerSize:K,setCornerSize:q,thumbSize:_,setThumbSize:j,hasMeasuredScrollbar:J,setHasMeasuredScrollbar:H,touchModality:W,cornerRef:eo,scrollingX:B,setScrollingX:z,scrollingY:$,setScrollingY:F,hovering:P,setHovering:V,viewportRef:Q,rootRef:Z,scrollbarYRef:ee,scrollbarXRef:et,thumbYRef:en,thumbXRef:er,rootId:T,hiddenState:U,setHiddenState:G,overflowEdges:X,setOverflowEdges:Y,viewportState:ev,overflowEdgeThreshold:{xStart:d,xEnd:v,yStart:O,yEnd:D}}),[ef,eu,em,ep,K,_,J,W,B,z,$,F,P,V,T,U,X,ev,d,v,O,D]);return(0,k.jsxs)(h.Provider,{value:eS,children:[!I&&g.f.getElement(R),eb]})});var D=e.i(3288866),T=e.i(4351296);let E=s.createContext(void 0);var A=e.i(9945844),R=e.i(966742);let I=((o={}).scrollAreaOverflowXStart="--scroll-area-overflow-x-start",o.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",o.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",o.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",o);var P=e.i(6400108);let V=!1,B=s.forwardRef(function(e,t){let{render:n,className:r,style:o,...i}=e,{viewportRef:c,scrollbarYRef:h,scrollbarXRef:f,thumbYRef:m,thumbXRef:y,cornerRef:v,cornerSize:b,setCornerSize:S,setThumbSize:C,rootId:x,setHiddenState:M,hiddenState:N,setHasMeasuredScrollbar:O,handleScroll:B,setHovering:z,setOverflowEdges:$,overflowEdges:F,overflowEdgeThreshold:W,scrollingX:L,scrollingY:J}=d(),H=(0,A.f)(),K=s.useRef(!0),q=s.useRef([0/0,0/0,0/0,0/0]),_=(0,a.e)(),j=(0,a.e)(),X=(0,l.f)(()=>{var e;let t,n,r=c.current,o=h.current,i=f.current,s=m.current,l=y.current,a=v.current;if(!r)return;let d=r.scrollHeight,p=r.scrollWidth,g=r.clientHeight,w=r.clientWidth,k=r.scrollTop,x=r.scrollLeft,N=q.current,D=Number.isNaN(N[0]);
1if(N[0]=g,N[1]=d,N[2]=w,N[3]=p,D&&O(!0),0===d||0===p)return;let T=(t=(e=r).clientHeight>=e.scrollHeight,{y:t,x:n=e.clientWidth>=e.scrollWidth,corner:t||n}),E=T.y,A=T.x,V=w/p,B=g/d,z=Math.max(0,p-w),F=Math.max(0,d-g),L=0,J=0;if(!A){let e=0;e="rtl"===H?(0,R.f)(-x,0,z):(0,R.f)(x,0,z),L=(0,P.k)(e,z),J=z-L}let K=E?0:(0,R.f)(k,0,F),_=E?0:(0,P.k)(K,F),j=E?0:F-_,X=A?0:w,Y=E?0:g,U=0,G=0;A||E||(U=o?.offsetWidth||0,G=i?.offsetHeight||0);let Z=0===b.width&&0===b.height,Q=Z?U:0,ee=Z?G:0,et=u(i,"padding","x"),en=u(o,"padding","y"),er=u(l,"margin","x"),eo=u(s,"margin","y"),ei=X-et-er,es=Y-en-eo,el=i?Math.min(i.offsetWidth-Q,ei):ei,ea=o?Math.min(o.offsetHeight-ee,es):es,ec=Math.max(16,el*V),eh=Math.max(16,ea*B);if(C(e=>e.height===eh&&e.width===ec?e:{width:ec,height:eh}),o&&s){let e=o.offsetHeight-eh-en-eo,t=d-g,n=Math.min(e,Math.max(0,(0===t?0:k/t)*e));s.style.transform=`translate3d(0,${n}px,0)`}if(i&&l){let e=i.offsetWidth-ec-et-er,t=p-w,n=0===t?0:x/t,r="rtl"===H?(0,R.f)(n*e,-e,0):(0,R.f)(n*e,0,e);l.style.transform=`translate3d(${r}px,0,0)`}for(let[e,t]of[[I.scrollAreaOverflowXStart,L],[I.scrollAreaOverflowXEnd,J],[I.scrollAreaOverflowYStart,_],[I.scrollAreaOverflowYEnd,j]])r.style.setProperty(e,`${t}px`);a&&(A||E?S({width:0,height:0}):A||E||S({width:U,height:G})),M(e=>{var t,n;return t=e,n=T,t.y===n.y&&t.x===n.x&&t.corner===n.corner?t:n});let ed={xStart:!A&&L>W.xStart,xEnd:!A&&J>W.xEnd,yStart:!E&&_>W.yStart,yEnd:!E&&j>W.yEnd};$(e=>e.xStart===ed.xStart&&e.xEnd===ed.xEnd&&e.yStart===ed.yStart&&e.yEnd===ed.yEnd?e:ed)});function Y(){K.current=!1}(0,D.f)(()=>{c.current&&(V||T.f.engine.webkit||("u">typeof CSS&&"registerProperty"in CSS&&[I.scrollAreaOverflowXStart,I.scrollAreaOverflowXEnd,I.scrollAreaOverflowYStart,I.scrollAreaOverflowYEnd].forEac
1h(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),V=!0))},[c]),(0,D.f)(()=>{queueMicrotask(X)},[X,N,H,W.xStart,W.xEnd,W.yStart,W.yEnd]),(0,D.f)(()=>{c.current?.matches(":hover")&&z(!0)},[c,z]),(0,D.f)(()=>{let e=c.current;if("u"<typeof ResizeObserver||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=q.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}X()});return n.observe(e),j.start(0,()=>{let t=e.getAnimations({subtree:!0});0!==t.length&&Promise.allSettled(t.map(e=>e.finished)).then(X).catch(()=>{})}),()=>{n.disconnect(),j.clear()}},[X,c,j]);let U={role:"presentation",...x&&{"data-id":`${x}-viewport`},tabIndex:N.x&&N.y?-1:0,className:g.f.className,style:{overflow:"scroll"},onScroll(){c.current&&(X(),K.current||B({x:c.current.scrollLeft,y:c.current.scrollTop}),_.start(100,()=>{K.current=!0}))},onWheel:Y,onTouchMove:Y,onPointerMove:Y,onPointerEnter:Y,onKeyDown:Y},G=s.useMemo(()=>({scrolling:L||J,hasOverflowX:!N.x,hasOverflowY:!N.y,overflowXStart:F.xStart,overflowXEnd:F.xEnd,overflowYStart:F.yStart,overflowYEnd:F.yEnd,cornerHidden:N.corner}),[L,J,N.x,N.y,N.corner,F]),Z=(0,p.f)("div",e,{ref:[t,c],state:G,props:[U,i],stateAttributesMapping:w}),Q=s.useMemo(()=>({computeThumbPosition:X}),[X]);return(0,k.jsx)(E.Provider,{value:Q,children:Z})});var z=e.i(2541527);let $=s.createContext(void 0),F=((i={}).scrollAreaThumbHeight="--scroll-area-thumb-height",i.scrollAreaThumbWidth="--scroll-area-thumb-width",i),W=s.forwardRef(function(e,t){let{render:n,className:r,orientation:o="vertical",keepMounted:i=!1,style:l,...a}=e,{hovering:c,scrollingX:h,scrollingY:m,hiddenState:g,overflowEdges:y,scrollbarYRef:v,scrollbarXRef:S,viewportRef:C,thumbYRef:x,thumbXRef:M,handlePointerDown:N,handlePointerUp:O,handleScroll:D,rootId:T,thumbSize:E,hasMeasuredScrollbar:R}=d(),I={hovering:c,scrolling:{horizontal:h,vertical:m}[o],orientation:o,hasOverflowX:!g.x,hasOverflowY:!g.y,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:g.corner},P=(0,A.f)(),V=!R&&!i,B="vertical"===o?g.y:g.x,W=i||!B;s.useEffect(()=>{if(!W)return;let e=C.current,t="vertical"===o?v.current:S.current;if(t)return(0,z.f)(t,"wheel",function(n){if(!e||!t||n.ctrlKey)return;let r="horizontal"===o,i=r?"scrollLeft":"scrollTop",s=r?n.deltaX:n.deltaY;if(0===s)return;let l=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,a=r&&"rtl"===P?-l:0,c=r&&"rtl"===P?0:l,h=e[i];h<=a&&s<0||h>=c&&s>0||(n.preventDefault(),e[i]=Math.min(c,Math.max(a,h+s)),D({x:e.scrollLeft,y:e.scrollTop}))},{passive:!1})},[P,D,o,S,v,W,C]);let L={...T&&{"data-id":`${T}-scrollbar`},onPointerDown(e){if(0!==e.button)return;let t=(0,b.Z)(e.nativeEvent),n="vertical"===o?x.current:M.current;if(!(n&&(0,b.I)(n,t))&&C.current){if(x.current&&v.current&&"vertical"===o){let t=u(x.current,"margin","y"),n=u(v.current,"padding","y"),r=x.current.offsetHeight,o=v.current.getBoundingClientRect(),i=e.clientY-o.top-r/2-n+t/2,s=C.current.scrollHeight,l=C.current.clientHeight,a=v.current.offsetHeight-r-n-t;C.current.scrollTop=i/a*(s-l)}if(M.current&&S.current&&"horizontal"===o){let t,n=u(M.current,"margin","x"),r=u(S.current,"padding","x"),o=M.current.offsetWidth,i=S.current.getBoundingClientRect(),s=e.clientX-i.left-o/2-r+n/2,l=C.current.scrollWidth,a=C.current.clientWidth,c=s/(S.current.offsetWidth-o-r-n);"rtl"===P?(t=(1-c)*(l-a),C.current.scrollLeft<=0&&(t=-t)):t=c*(l-a),C.current.scrollLeft=t}D({x:C.current.scrollLeft,y:C.current.scrollTop}),N(e)}},onPointerUp:O,onPointerCancel:O,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:V?"hidden":void 0,..."vertical"===o&&{top:0,bottom:`var(${f.scrollAreaCornerHeight})`,insetInlineEnd:0,[F.scrollAreaThumbHeight]:`${E.height}px`},..."horizontal"===o&&{insetInlineStart:0,insetInlineEnd:`var(${f.scrollAreaCornerWidth})`,bottom:0,[F.scrollAreaThumbWidth]:`${E.width}px`}}},J=(0,p.f)("div",e,{ref:[t,"vertical"===o?v:S],state:I,props:[L,a],stateAttributesMapping:w}),H=s.useMemo(()=>({orientation:o}),[o]);return W?(0,k.jsx)($.Provider,{value:H,children:J}):null}),L=s.forwardRef(function(e,t){let{render:n,className:r,style:o,...i}=e,{computeThumbPosition:l}=function(){let e=s.useContext(E);if(void 0===e)throw Error((0,c.f)(55));return e}(),{hasMeasuredScrollbar:a,viewportState:h}=d(),f=s.useRef(null),u=s.useRef(a);return(0,D.f)(()=>
1{if("u"<typeof ResizeObserver)return;let e=!1,t=new ResizeObserver(()=>{(e||(e=!0,u.current))&&l()});return f.current&&t.observe(f.current),()=>{t.disconnect()}},[l]),(0,p.f)("div",e,{ref:[t,f],state:h,stateAttributesMapping:w,props:[{role:"presentation",style:{minWidth:"fit-content"}},i]})}),J=s.forwardRef(function(e,t){let{render:n,className:r,style:o,...i}=e,{thumbYRef:l,thumbXRef:a,handlePointerDown:h,handlePointerMove:f,handlePointerUp:u,setScrollingX:m,setScrollingY:g,scrollingX:y,scrollingY:v,hasMeasuredScrollbar:w}=d(),{orientation:b}=function(){let e=s.useContext($);if(void 0===e)throw Error((0,c.f)(54));return e}();function S(e){"vertical"===b&&g(!1),"horizontal"===b&&m(!1),u(e)}return(0,p.f)("div",e,{ref:[t,"vertical"===b?l:a],state:{scrolling:"horizontal"===b?y:v,orientation:b},props:[{onPointerDown:h,onPointerMove:f,onPointerUp:S,onPointerCancel:S,style:{visibility:w?void 0:"hidden",..."vertical"===b&&{height:`var(${F.scrollAreaThumbHeight})`},..."horizontal"===b&&{width:`var(${F.scrollAreaThumbWidth})`}}},i]})}),H=s.forwardRef(function(e,t){let{render:n,className:r,style:o,...i}=e,{cornerRef:s,cornerSize:l,hiddenState:a}=d(),c=(0,p.f)("div",e,{ref:[t,s],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:l.width,height:l.height}},i]});return a.corner?null:c});e.s(["Content",0,L,"Corner",0,H,"Root",0,O,"Scrollbar",0,W,"Thumb",0,J,"Viewport",0,B],446420);var K=e.i(446420);e.s(["f",0,K],8464886)},6445794,9605842,8111092,e=>{"use strict";var t=e.i(5558497);class n{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 r{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&r.empty)return r.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?o:0);if(a>e)break;let c=this.ranges[l+i],h=this.ranges[l+s],d=a+c;if(e<=d){let i=c?e==a?-1:e==d?1:t:t,s=a+o+(i<0?0:h);if(r)return s;let p=e==(t<0?a:d)?null:l/3+(e-a)*65536,f=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(f|=8),new n(s,f,p)}o+=h-c}return r?e+o:new n(e+o,0,null)}touches(e,t){let n=0,r=65535&t,o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+o];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),l=i+(this.inverted?0:o),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),o+=c-a}}invert(){return new r(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?r.empty:new r(e<0?[0,-e,0]:[0,0,e])}}r.empty=new r([]);class o{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new o(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=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 o;return e.appendMappingInverted(this),e}
1map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let o=0;for(let n=this.from;n<this.to;n++){let r=this._maps[n].mapResult(e,t);if(null!=r.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(r.recover);continue}}o|=r.delInfo,e=r.pos}return r?e:new n(e,o,null)}}let i=Object.create(null);class s{getMap(){return r.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=i[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in i)throw RangeError("Duplicate use of step JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t}}class l{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new l(e,null)}static fail(e){return new l(null,e)}static fromReplace(e,n,r,o){try{return l.ok(e.replace(n,r,o))}catch(e){if(e instanceof t.A)return l.fail(e.message);throw e}}}function a(e,n,r){let o=[];for(let t=0;t<e.childCount;t++){let i=e.child(t);i.content.size&&(i=i.copy(a(i.content,n,i))),i.isInline&&(i=n(i,r,t)),o.push(i)}return t.y.fromArray(o)}class c extends s{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new t.k(a(n.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,o),n.openStart,n.openEnd);return l.fromReplace(e,this.from,this.to,i)}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 c(t.pos,n.pos,this.mark)}merge(e){return e instanceof c&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new c(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 c(t.from,t.to,e.markFromJSON(t.mark))}}s.jsonID("addMark",c);class h extends s{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let n=e.slice(this.from,this.to),r=new t.k(a(n.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),n.openStart,n.openEnd);return l.fromReplace(e,this.from,this.to,r)}invert(){return new c(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:"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 h(t.from,t.to,e.markFromJSON(t.mark))}}s.jsonID("removeMark",h);class d extends s{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let n=e.nodeAt(this.pos);if(!n)return l.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return l.fromReplace(e,this.pos,this.pos+1,new t.k(t.y.from(r),0,+!n.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;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new d(this.pos,t.marks[n]);return new d(this.pos,this.mark)}}return new p(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new d(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new d(t.pos,e.markFromJSON(t.mark))}}s.jsonID("addNodeMark",d);class p extends s{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let n=e.nodeAt(this.pos);if(!n)return l.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return l.fromReplace(e,this.pos,this.pos+1,new t.k(t.y.from(r),0,+!n.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new d(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new p(t.pos,this.mark)}
vendor: 4,039 bytes, line 1
1toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new p(t.pos,e.markFromJSON(t.mark))}}s.jsonID("removeNodeMark",p);class f extends s{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&m(e,this.from,this.to)?l.fail("Structure replace would overwrite content"):l.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new r([this.from,this.to-this.from,this.slice.size])}invert(e){return new f(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&f.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new f(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof f)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let n=this.slice.size+e.slice.size==0?t.k.empty:new t.k(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new f(e.from,this.to,n,this.structure)}{let n=this.slice.size+e.slice.size==0?t.k.empty:new t.k(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new f(this.from,this.to+(e.to-e.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new f(n.from,n.to,t.k.fromJSON(e,n.slice),!!n.structure)}}f.MAP_BIAS=1,s.jsonID("replace",f);class u extends s{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(m(e,this.from,this.gapFrom)||m(e,this.gapTo,this.to)))return l.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return l.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?l.fromReplace(e,this.from,this.to,n):l.fail("Content does not fit in gap")}getMap(){return new r([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new u(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new u(t.pos,n.pos,r,o,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,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new u(n.from,n.to,n.gapFrom,n.gapTo,t.k.fromJSON(e,n.slice),n.insert,!!n.structure)}}function m(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function g(e,n,r,o=r.contentMatch,i=!0){let s=e.doc.nodeAt(n),l=[],a=n+1;for(let n=0;n<s.childCount;n++){let c=s.child(n),d=a+c.nodeSize,p=o.matchType(c.type);if(p){o=p;for(let t=0;t<c.marks.length;
1t++)r.allowsMarkType(c.marks[t].type)||e.step(new h(a,d,c.marks[t]));if(i&&c.isText&&"pre"!=r.whitespace){let e,n=/\r?\n|\r/g,o;for(;e=n.exec(c.text);)o||(o=new t.k(t.y.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),l.push(new f(a+e.index,a+e.index+e[0].length,o))}}else l.push(new f(a,d,t.k.empty));a=d}if(!o.validEnd){let n=o.fillBefore(t.y.empty,!0);e.replace(a,a,new t.k(n,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function y(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(s,l,t))return n;if(0==n||i.type.spec.isolating||!((0==s||i.canReplace(s,i.childCount))&&(l==i.childCount||i.canReplace(0,l))))break;s&&(r=1),l<i.childCount&&(o=1)}return null}function v(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<o;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return i?o.map(w).concat({type:t,attrs:n}).concat(i.map(w)):null}function w(e){return{type:e,attrs:null}}function b(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function S(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function k(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,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(i+1,n.childCount)||!a.type.validContent(s))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function C(e,t){let n=e.resolve(t),r=n.index();return x(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function x(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 o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function M(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,s=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),s++,i=r.node(e).maybeChild(s)):(o=r.node(e).maybeChild(s-1),i=r.node(e+1)),o&&!o.isTextblock&&x(o,i)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function N(e,n,r=n,o=t.k.empty){if(n==r&&!o.size)return null;let i=e.resolve(n),s=e.resolve(r);return O(i,s,o)?new f(n,r,o):new D(i,s,o).fit()}function O(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}s.jsonID("replaceAround",u);class D{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=t.y.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 n=e.depth;n>0;n--)this.placed=t.y.from(e.node(n).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(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&1==i.childCount;)i=i.firstChild.content,s--,l--;let a=new t.k(i,s,l);return e>-1?new u(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new f(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let n=1;n<=2;n++)for(let r=1==n?e:this.unplaced.openStart;r>=0;r--){let e=null,o=(r?(e=A(this.unplaced.content,r-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:s,match:l}=this.frontier[i],a,c=null;if(1==n&&(o?l.matchType(o.type)||(c=l.fillBefore(t.y.from(o),!1)):e&&s.compatibleContent(e.type)))return{sliceDepth:r,frontierDepth:i,parent:e,inject:c};
1if(2==n&&o&&(a=l.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:i,parent:e,wrap:a};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=A(e,n);return!!o.childCount&&!o.firstChild.isLeaf&&(this.unplaced=new t.k(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=A(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new t.k(T(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new t.k(T(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,c=0,h=[],{match:d,type:p}=this.frontier[n];if(o){for(let e=0;e<o.childCount;e++)h.push(o.child(e));d=d.matchFragment(o)}let f=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let e=l.child(c),n=d.matchType(e.type);if(!n)break;(++c>1||0==a||e.content.size)&&(d=n,h.push(function e(n,r,o){if(r<=0)return n;let i=n.content;return r>1&&(i=i.replaceChild(0,e(i.firstChild,r-1,1==i.childCount?o-1:0))),r>0&&(i=n.type.contentMatch.fillBefore(i).append(i),o<=0&&(i=i.append(n.type.contentMatch.matchFragment(i).fillBefore(t.y.empty,!0)))),n.copy(i)}(e.mark(p.allowedMarks(e.marks)),1==c?a:0,c==l.childCount?f:-1)))}let u=c==l.childCount;u||(f=-1),this.placed=E(this.placed,n,t.y.from(h)),this.frontier[n].match=d,u&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=u?0==e?t.k.empty:new t.k(T(s.content,e-1,1),e-1,f<0?s.openEnd:e-1):new t.k(T(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!R(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&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],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=R(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=R(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?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=E(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,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=E(this.placed,this.depth,t.y.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(t.y.empty,!0);e.childCount&&(this.placed=E(this.placed,this.frontier.length,e))}}function T(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(T(e.firstChild.content,t-1,n)))}function E(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(E(e.lastChild.content,t-1,n)))}function A(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function R(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?l:null}function I(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let r=e.start(o);if(r<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(r==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==r-1)&&n.push(o)}return n}class P extends s{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return l.fail("No node at attribute step's position");let r=Object.create(null);for(let e in n.attrs)r[e]=n.attrs[e];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return l.fromReplace(e,this.pos,this.pos+1,new t.k(t.y.from(o),0,+!n.isLeaf))}getMap(){return r.empty}invert(e){return new P(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 P(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 P(t.pos,t.attr,t.value)}}s.jsonID("attr",P);class V extends s{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 l.ok(n)}getMap(){return r.empty}invert(e){return new V(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 V(t.attr,t.value)}}s.jsonID("docAttr",V);
1let B=class extends Error{};(B=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),B.prototype.constructor=B,B.prototype.name="TransformError";class z{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new o}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new B(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}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,n=e,r=t.k.empty){let o=N(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new t.k(t.y.from(r),0,0))}delete(e,n){return this.replace(e,n,t.k.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,n,r){return!function(e,n,r,o){if(!o.size)return e.deleteRange(n,r);let i=e.doc.resolve(n),s=e.doc.resolve(r);if(O(i,s,o))return e.step(new f(n,r,o));let l=I(i,s);0==l[l.length-1]&&l.pop();let a=-(i.depth+1);l.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?a=e:i.before(e)==t&&l.splice(1,0,-e)}let c=l.indexOf(a),h=[],d=o.openStart;for(let e=o.content,t=0;;t++){let n=e.firstChild;if(h.push(n),t==o.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){var p;let t=h[e],n=(p=t.type).spec.defining||p.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(a)-1)))d=e;else if(n||!t.type.isTextblock)break}for(let n=o.openStart;n>=0;n--){let a=(n+d+1)%(o.openStart+1),p=h[a];if(p)for(let n=0;n<l.length;n++){let h=l[(n+c)%l.length],d=!0;h<0&&(d=!1,h=-h);let f=i.node(h-1),u=i.index(h-1);if(f.canReplaceWith(u,u,p.type,p.marks))return e.replace(i.before(h),d?s.after(h):r,new t.k(function e(n,r,o,i,s){if(r<o){let t=n.firstChild;n=n.replaceChild(0,t.copy(e(t.content,r+1,o,i,t)))}if(r>i){let e=s.contentMatchAt(0),r=e.fillBefore(n).append(n);n=r.append(e.matchFragment(r).fillBefore(t.y.empty,!0))}return n}(o.content,0,o.openStart,a),a,o.openEnd))}}let u=e.steps.length;for(let t=l.length-1;t>=0&&(e.replace(n,r,o),!(e.steps.length>u));t--){let e=l[t];e<0||(n=i.before(e),r=s.after(e))}}(this,e,n,r),this}replaceRangeWith(e,n,r){var o=e,i=n;if(!r.isInline&&o==i&&this.doc.resolve(o).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(t<r.node(e).childCount)break}return null}(this.doc,o,r.type);null!=e&&(o=i=e)}return this.replaceRange(o,i,new t.k(t.y.from(r),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let i=r.sharedDepth(n),s=!1;for(let e=r.depth;e>i;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=o.depth;e>i;e--)o.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let i=I(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,n){return!function(e,n,r){let{$from:o,$to:i,depth:s}=n,l=o.before(s+1),a=i.after(s+1),c=l,h=a,d=t.y.empty,p=0;for(let e=s,n=!1;e>r;e--)n||o.index(e)>
10?(n=!0,d=t.y.from(o.node(e).copy(d)),p++):c--;let f=t.y.empty,m=0;for(let e=s,n=!1;e>r;e--)n||i.after(e+1)<i.end(e)?(n=!0,f=t.y.from(i.node(e).copy(f)),m++):h++;e.step(new u(c,h,l,a,new t.k(d.append(f),p,m),d.size-p,!0))}(this,e,n),this}join(e,n=1){return!function(e,n,r){let o=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(n-r),l=s.node().type;if(i&&l.inlineContent){let e="pre"==l.whitespace,t=!!l.contentMatch.matchType(i);e&&!t?o=!1:!e&&t&&(o=!0)}let a=e.steps.length;if(!1===o){let t=e.doc.resolve(n+r);S(e,t.node(),t.before(),a)}l.inlineContent&&g(e,n+r-1,l,s.node().contentMatchAt(s.index()),null==o);let c=e.mapping.slice(a),h=c.map(n-r);if(e.step(new f(h,c.map(n+r,-1),t.k.empty,!0)),!0===o){let t=e.doc.resolve(h);b(e,t.node(),t.before(),e.steps.length)}}(this,e,n),this}wrap(e,n){return!function(e,n,r){let o=t.y.empty;for(let e=r.length-1;e>=0;e--){if(o.size){let t=r[e].type.contentMatch.matchFragment(o);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=t.y.from(r[e].type.create(r[e].attrs,o))}let i=n.start,s=n.end;e.step(new u(i,s,i,s,new t.k(o,0,0),r.length,!0))}(this,e,n),this}setBlockType(e,n=e,r,o=null){var i=this;if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=i.steps.length;return i.doc.nodesBetween(e,n,(e,n)=>{var l,a,c;let h,d,p="function"==typeof o?o(e):o;if(e.isTextblock&&!e.hasMarkup(r,p)&&(l=i.doc,a=i.mapping.slice(s).map(n),c=r,d=(h=l.resolve(a)).index(),h.parent.canReplaceWith(d,d+1,c))){let o=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&S(i,e,n,s),g(i,i.mapping.slice(s).map(n,1),r,void 0,null===o);let l=i.mapping.slice(s),a=l.map(n,1),c=l.map(n+e.nodeSize,1);return i.step(new u(a,c,a+1,c-1,new t.k(t.y.from(r.create(p,null,e.marks)),0,0),1,!0)),!0===o&&b(i,e,n,s),!1}}),this}setNodeMarkup(e,n,r=null,o){return!function(e,n,r,o,i){let s=e.doc.nodeAt(n);if(!s)throw RangeError("No node at given position");r||(r=s.type);let l=r.create(o,null,i||s.marks);if(s.isLeaf)return e.replaceWith(n,n+s.nodeSize,l);if(!r.validContent(s.content))throw RangeError("Invalid content for node type "+r.name);e.step(new u(n,n+s.nodeSize,n+1,n+s.nodeSize-1,new t.k(t.y.from(l),0,0),1,!0))}(this,e,n,r,o),this}setNodeAttribute(e,t,n){return this.step(new P(e,t,n)),this}setDocAttribute(e,t){return this.step(new V(e,t)),this}addNodeMark(e,t){return this.step(new d(e,t)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw RangeError("No node at position "+e);if(n instanceof t.H)n.isInSet(r.marks)&&this.step(new p(e,n));else{let t=r.marks,o,i=[];for(;o=n.isInSet(t);)i.push(new p(e,o)),t=o.removeFromSet(t);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,n=1,r){return!function(e,n,r=1,o){let i=e.doc.resolve(n),s=t.y.empty,l=t.y.empty;for(let e=i.depth,n=i.depth-r,a=r-1;e>n;e--,a--){s=t.y.from(i.node(e).copy(s));let n=o&&o[a];l=t.y.from(n?n.type.create(n.attrs,l):i.node(e).copy(l))}e.step(new f(n,n,new t.k(s.append(l),r,r),!0))}(this,e,n,r),this}addMark(e,t,n){var r;let o,i,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,d)=>{if(!r.isInline)return;let p=r.marks;if(!n.isInSet(p)&&d.type.allowsMarkType(n.type)){let d=Math.max(a,e),f=Math.min(a+r.nodeSize,t),u=n.addToSet(p);for(let e=0;e<p.length;e++)p[e].isInSet(u)||(o&&o.to==d&&o.mark.eq(p[e])?o.to=f:s.push(o=new h(d,f,p[e])));i&&i.to==d?i.to=f:l.push(i=new c(d,f,n))}}),s.forEach(e=>r.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,n,r){var o;let i,s;return o=this,i=[],s=0,o.doc.nodesBetween(e,n,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(r instanceof t.M){let e=o.marks,t;for(;t=r.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let t=Math.min(l+o.nodeSize,n);for(let n=0;n<a.length;n++){let r=a[n],o;for(let e=0;e<i.length;e++){let t=i[e];t.step==s-1&&r.eq(i[e].style)&&(o=t)}o?(o.to=t,o.step=s):i.push({style:r,from:Math.max(l,e),to:t,step:s})}}}
1),i.forEach(e=>o.step(new h(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return g(this,e,t,n),this}}e.s(["x",0,c,"l",0,o,"u",0,h,"w",0,u,"z",0,f,"h",0,z,"n",0,C,"J",0,k,"s",0,function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);l=e&&s.canReplaceWith(i,i,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null},"H",0,v,"y",0,M,"j",0,y,"e",0,N],9605842);let $=Object.create(null);class F{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new W(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<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=t.k.empty){let r=n.content.lastChild,o=null;for(let e=0;e<n.openEnd;e++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],h=e.mapping.slice(i);e.replaceRange(h.map(a.pos),h.map(c.pos),l?t.k.empty:n),0==l&&U(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],l=e.mapping.slice(n),a=l.map(i.pos),c=l.map(s.pos);o?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),U(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new H(e):Y(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?Y(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Y(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}
vendor: 6,586 bytes, line 1
1static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new j(e.node(0))}static atStart(e){return Y(e,e,0,0,1)||new j(e)}static atEnd(e){return Y(e,e,e.content.size,e.childCount,-1)||new j(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=$[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in $)throw RangeError("Duplicate use of selection JSON ID "+e);return $[e]=t,t.prototype.jsonID=e,t}getBookmark(){return H.between(this.$anchor,this.$head).getBookmark()}}F.prototype.visible=!0;class W{constructor(e,t){this.$from=e,this.$to=t}}let L=!1;function J(e){L||e.parent.inlineContent||(L=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class H extends F{constructor(e,t=e){J(e),J(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 F.near(n);let r=e.resolve(t.map(this.anchor));return new H(r.parent.inlineContent?r:n,n)}replace(e,n=t.k.empty){if(super.replace(e,n),n==t.k.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof H&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new K(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 H(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=F.findFrom(t,n,!0)||F.findFrom(t,-n,!0);if(!e)return F.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(F.findFrom(e,-n,!0)||F.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new H(e,t)}}F.jsonID("text",H);class K{constructor(e,t){this.anchor=e,this.head=t}map(e){return new K(e.map(this.anchor),e.map(this.head))}resolve(e){return H.between(e.resolve(this.anchor),e.resolve(this.head))}}class q extends F{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?F.near(o):new q(o)}content(){return new t.k(t.y.from(this.node),0,0)}eq(e){return e instanceof q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new _(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new q(e.resolve(t.anchor))}static create(e,t){return new q(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}q.prototype.visible=!1,F.jsonID("node",q);class _{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new K(n,n):new _(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&q.isSelectable(n)?new q(t):F.near(t)}}class j extends F{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=t.k.empty){if(n==t.k.empty){e.delete(0,e.doc.content.size);let t=F.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new j(e)}map(e){return new j(e)}eq(e){return e instanceof j}getBookmark(){return X}}F.jsonID("all",j);let X={map(){return this},resolve:e=>new j(e)};function Y(e,t,n,r,o,i=!1){if(t.inlineContent)return H.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&q.isSelectable(r))return q.create(e,n-(o<0?r.nodeSize:0))}else{let t=Y(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function U(e,t,n){let r,o=e.steps.length-1;if(o<t)return;let i=e.steps[o];(i instanceof f||i instanceof u)&&(e.mapping.maps[o].forEach((e,t,n,o)=>{null==r&&(r=o)}),e.setSelection(F.near(e.doc.resolve(r),n)))}class G extends z{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.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return t.H.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,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||t.H.none))),r.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),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(F.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 Z(e,t){return t&&e?e.bind(t):e}class Q{constructor(e,t,n){this.name=e,this.init=Z(t.init,n),this.apply=Z(t.apply,n)}}let ee=[new Q("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Q("selection",{init:(e,t)=>
1e.selection||F.atStart(t.doc),apply:e=>e.selection}),new Q("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Q("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class et{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ee.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 Q(e.key,e.spec.state,e))})}}let en=Object.create(null);function er(e){return e in en?e+"$"+ ++en[e]:(en[e]=0,e+"$")}e.s(["i",0,j,"j",0,class e{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;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let l=r?r[i].n:0,a=r?r[i].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let o=r[e];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new G(this)}static create(t){let n=new et(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new et(this.schema,t.plugins),r=n.fields,o=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;o[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,o)}return o}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.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],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(n,r,o){if(!r)throw RangeError("Invalid input for EditorState.fromJSON");if(!n.schema)throw RangeError("Required config field 'schema' missing");let i=new et(n.schema,n.plugins),s=new e(i);return i.fields.forEach(e=>{if("doc"==e.name)s.doc=t.$.fromJSON(n.schema,r.doc);else if("selection"==e.name)s.selection=F.fromJSON(s.doc,r.selection);else if("storedMarks"==e.name)r.storedMarks&&(s.storedMarks=r.storedMarks.map(n.schema.markFromJSON));else{if(o)for(let t in o){let i=o[t],l=i.spec.state;if(i.key==e.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(r,t)){s[e.name]=l.fromJSON.call(i,n,r[t],s);return}}s[e.name]=e.init(n,s)}}),s}},"C",0,q,"x",0,class{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.key=e.key?e.key.key:er("plugin")}getState(e){return e[this.key]}},"p",0,class{constructor(e="key"){this.key=er(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},"e",0,F,"D",0,W,"k",0,H],8111092);let eo=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function ei(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let es=(e,n,r)=>{let o=ei(e,r);if(!o)return!1;let i=eh(o);if(!i){let t=o.blockRange(),r=t&&y(t);return null!=r&&(n&&n(e.tr.lift(t,r).scrollIntoView()),!0)}let s=i.nodeBefore;if(eb(e,i,n,-1))return!0;
1if(0==o.parent.content.size&&(ea(s,"end")||q.isSelectable(s)))for(let r=o.depth;;r--){let l=N(e.doc,o.before(r),o.after(r),t.k.empty);if(l&&l.slice.size<l.to-l.from){if(n){let t=e.tr.step(l);t.setSelection(ea(s,"end")?F.findFrom(t.doc.resolve(t.mapping.map(i.pos,-1)),-1):q.create(t.doc,i.pos-s.nodeSize)),n(t.scrollIntoView())}return!0}if(1==r||o.node(r-1).childCount>1)break}return!!s.isAtom&&i.depth==o.depth-1&&(n&&n(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0)};function el(e,n,r){let o=n.nodeBefore,i=n.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let e=o.lastChild;if(!e)return!1;o=e}let s=n.nodeAfter,l=n.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let e=s.firstChild;if(!e)return!1;s=e}let a=N(e.doc,i,l,t.k.empty);if(!a||a.from!=i||a instanceof f&&a.slice.size>=l-i)return!1;if(r){let t=e.tr.step(a);t.setSelection(H.create(t.doc,i)),r(t.scrollIntoView())}return!0}function ea(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 ec=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=eh(r)}let s=i&&i.nodeBefore;return!!s&&!!q.isSelectable(s)&&(t&&t(e.tr.setSelection(q.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function eh(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 ed(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let ep=(e,n,r)=>{let o=ed(e,r);if(!o)return!1;let i=eu(o);if(!i)return!1;let s=i.nodeAfter;if(eb(e,i,n,1))return!0;if(0==o.parent.content.size&&(ea(s,"start")||q.isSelectable(s))){let r=N(e.doc,o.before(),o.after(),t.k.empty);if(r&&r.slice.size<r.to-r.from){if(n){let t=e.tr.step(r);t.setSelection(ea(s,"start")?F.findFrom(t.doc.resolve(t.mapping.map(i.pos)),1):q.create(t.doc,t.mapping.map(i.pos))),n(t.scrollIntoView())}return!0}}return!!s.isAtom&&i.depth==o.depth-1&&(n&&n(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0)},ef=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=eu(r)}let s=i&&i.nodeAfter;return!!s&&!!q.isSelectable(s)&&(t&&t(e.tr.setSelection(q.create(e.doc,i.pos)).scrollIntoView()),!0)};function eu(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}let em=(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 eg(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let ey=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=eg(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(F.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},ev=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof j||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=eg(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(H.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},ew=(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 r=n.before();if(k(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&y(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function eb(e,n,r,o){let i,s,l,a=n.nodeBefore,c=n.nodeAfter,h,d,p=a.type.spec.isolating||c.type.spec.isolating;if(!p&&(i=n.nodeBefore,s=n.nodeAfter,l=n.index(),i&&s&&i.type.compatibleContent(s.type)&&(!i.content.size&&n.parent.canReplace(l-1,l)?(r&&r(e.tr.delete(n.pos-i.nodeSize,n.pos).scrollIntoView()),!0):!!n.parent.canReplace(l,l+1)&&!!(s.isTextblock||C(e.doc,n.pos))&&(r&&r(e.tr.join(n.pos).scrollIntoView()),!0))))return!0;let f=!p&&n.parent.canReplace(n.index(),n.index()+1);if(f&&(h=(d=a.contentMatchAt(a.childCount)).findWrapping(c.type))&&d.matchType(h[0]||c.type).validEnd){if(r){let o=n.pos+c.nodeSize,i=t.y.empty;for(let e=h.length-1;e>=0;e--)i=t.y.from(h[e].create(null,i));i=t.y.from(a.copy(i));let s=e.tr.step(new u(n.pos-1,o,n.pos,o,new t.k(i,1,0),h.length,!0)),l=s.doc.resolve(o+2*h.length);l.nodeAfter&&l.nodeAfter.type==a.type&&C(s.doc,l.pos)&&s.join(l.pos),r(s.scrollIntoView())}return!0}let m=c.type.spec.isolating||o>0&&p?null:F.findFrom(n,1),g=m&&m.$from.blockRange(m.$to),v=g&&y(g);if(null!=v&&v>=n.depth)return r&&r(e.tr.lift(g,v).scrollIntoView()),!0;if(f&&ea(c,"start",!0)&&ea(a,"end")){let o=a,i=[];for(;i.push(o),!o.isTextblock;)o=o.lastChild;let s=c,l=1;for(;!s.isTextblock;s=s.firstChild)l++;
1if(o.canReplace(o.childCount,o.childCount,s.content)){if(r){let o=t.y.empty;for(let e=i.length-1;e>=0;e--)o=t.y.from(i[e].copy(o));r(e.tr.step(new u(n.pos-i.length,n.pos+c.nodeSize,n.pos+l,n.pos+c.nodeSize-l,new t.k(o,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function eS(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(H.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}let ek=eS(-1),eC=eS(1);function ex(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let eM=ex(eo,es,ec),eN=ex(eo,ep,ef),eO={Enter:ex(em,ev,ew,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof q&&e.selection.node.isBlock)return!!n.parentOffset&&!!k(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],i,s,l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),s=eg(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));o.unshift(t||(l&&s?{type:s}:null)),i=e;break}if(1==e)return!1;o.unshift(null)}let c=e.tr;(e.selection instanceof H||e.selection instanceof j)&&c.deleteSelection();let h=c.mapping.map(n.pos),d=k(c.doc,h,o.length,o);if(d||(o[0]=s?{type:s}:null,d=k(c.doc,h,o.length,o)),!d)return!1;if(c.split(h,o.length,o),!l&&a&&n.node(i).type!=s){let e=c.mapping.map(n.before(i)),t=c.doc.resolve(e);s&&n.node(i-1).canReplaceWith(t.index(),t.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(i)),s)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":ey,Backspace:eM,"Mod-Backspace":eM,"Shift-Backspace":eM,Delete:eN,"Mod-Delete":eN,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new j(e.doc))),!0)},eD={"Ctrl-h":eO.Backspace,"Alt-Backspace":eO["Mod-Backspace"],"Ctrl-d":eO.Delete,"Ctrl-Alt-Backspace":eO["Mod-Delete"],"Alt-Delete":eO["Mod-Delete"],"Alt-d":eO["Mod-Delete"],"Ctrl-a":ek,"Ctrl-e":eC};for(let e in eO)eD[e]=eO[e];let eT=("u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&!!os.platform&&"darwin"==os.platform())?eD:eO;e.s(["v",0,eT,"J",0,ex,"a",0,ev,"b",0,eo,"A",0,ey,"I",0,es,"W",0,(e,t)=>{let n=e.selection,r;if(n instanceof q){if(n.node.isTextblock||!C(e.doc,n.to))return!1;r=n.to}else if(null==(r=M(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},"$",0,ep,"_",0,(e,t,n)=>{let r=ei(e,n);if(!r)return!1;let o=eh(r);return!!o&&el(e,o,t)},"U",0,(e,t,n)=>{let r=ed(e,n);if(!r)return!1;let o=eu(r);return!!o&&el(e,o,t)},"w",0,(e,t)=>{let n=e.selection,r=n instanceof q,o;if(r){if(n.node.isTextblock||!C(e.doc,n.from))return!1;o=n.from}else if(null==(o=M(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(o);r&&n.setSelection(q.create(n.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},"M",0,(e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&y(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},"N",0,ew,"V",0,em,"n",0,ec,"O",0,ef,"X",0,(e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return 0!=i&&(o=n.before(i),t&&t(e.tr.setSelection(q.create(e.doc,o))),!0)},"m",0,eC,"x",0,ek,"s",0,function(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,(r,i)=>{if(o)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}},"r",0,function(e,t=null,n){let r=!1!==(n&&n.removeWhenPresent),o=!1!==(n&&n.enterInlineAtoms),i=!(n&&n.includeWhitespace);return function(n,s){let{empty:l,$cursor:a,ranges:c}=n.selection;if(l&&!a||!function(e,t,n,r){for(let o=0;o<t.length;o++){let{$from:i,$to:s}=t[o],l=0==i.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,s.pos,(e,t)=>{if(l||!r&&e.isAtom&&e.isInline&&t>=i.pos&&t+e.nodeSize<=s.pos)return!1;l=e.inlineContent&&e.type.allowsMarkType(n)}),l)return!0}return!1}(n.doc,c,e,o))return!1;if(s)if(a)s(e.isInSet(n.storedMarks||a.marks())?n.tr.removeStoredMark(e):n.tr.addStoredMark(e.create(t)));else{let l,a=n.tr;o||(c=function(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:o}=e[n];r.doc.nodesBetween(r.pos,o.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=o.pos)return n+1>r.pos&&t.push(new W(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1}),r.pos<o.pos&&t.push(new W(r,o))}return t}(c)),l=r?!c.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!c.every(t=>{let n=!1;return a.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,o,i)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!i&&i.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-o),Math.min(r.nodeSize,t.$to.pos-o))))}),!n});for(let n=0;n<c.length;n++){let{$from:r,$to:o}=c[n];if(l){let n=r.pos,s=o.pos,l=r.nodeAfter,c=o.nodeBefore,h=i&&l&&l.isText?/^\s*/.exec(l.text)[0].length:0,d=i&&c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+h<s&&(n+=h,s-=d),a.addMark(n,s,e.create(t))}else a.removeMark(r.pos,o.pos,e)}s(a.scrollIntoView())}return!0}},"K",0,function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&v(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}],6445794)},4819644,e=>{"use strict";var t=function(){};t.prototype.append=function(e){return e.length?(e=t.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},t.prototype.prepend=function(e){return e.length?t.from(e).append(this):this},t.prototype.appendInner=function(e){return new r(this,e)},t.prototype.slice=function(e,n){return(void 0===e&&(e=0),void 0===n&&(n=this.length),e>=n)?t.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},t.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},t.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},t.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},t.from=function(e){return e instanceof t?e:e&&e.length?new n(e):t.empty};var n=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(t);t.empty=new n([]);var r=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;if(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r)||n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;if(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o)||n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(t),o=e.i(9605842),i=e.i(8111092);class s{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,o,i;if(0==this.eventCount)return null;let a=this.items.length;for(;;a--)if(this.items.get(a-1).selection){--a;break}t&&(r=(n=this.remapping(a,this.items.length)).maps.length);let c=e.tr,h=[],d=[];
1return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(a,t+1)).maps.length),r--,d.push(e);return}if(n){d.push(new l(e.map));let t=e.step.map(n.slice(r)),o;t&&c.maybeStep(t).doc&&(o=c.mapping.maps[c.mapping.maps.length-1],h.push(new l(o,void 0,void 0,h.length+d.length))),r--,o&&n.appendMap(o,r)}else c.maybeStep(e.step);if(e.selection)return o=n?e.selection.map(n.slice(r)):e.selection,i=new s(this.items.slice(0,a).append(d.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:i,transform:c,selection:o}}addTransform(e,t,n,r){var o,i;let a,h=[],d=this.eventCount,p=this.items,f=!r&&p.length?p.get(p.length-1):null;for(let n=0;n<e.steps.length;n++){let o=e.steps[n].invert(e.docs[n]),i=new l(e.mapping.maps[n],o,t),s;(s=f&&f.merge(i))&&(i=s,n?h.pop():p=p.slice(0,p.length-1)),h.push(i),t&&(d++,t=void 0),r||(f=i)}let u=d-n.depth;return u>c&&(o=p,i=u,o.forEach((e,t)=>{if(e.selection&&0==i--)return a=t,!1}),p=o.slice(a),d-=u),new s(p.append(h),d)}remapping(e,t){let n=new o.l;return this.items.forEach((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}addMaps(e){return 0==this.eventCount?this:new s(this.items.append(e.map(e=>new l(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(e=>{e.selection&&a--},r);let c=t;this.items.forEach(t=>{let r=o.getMirror(--c);if(null==r)return;i=Math.min(i,r);let s=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),h=t.selection&&t.selection.map(o.slice(c+1,r));h&&a++,n.push(new l(s,i,h))}else n.push(new l(s))},r);let h=[];for(let e=t;e<i;e++)h.push(new l(o.maps[e]));let d=new s(this.items.slice(0,r).append(h).append(n),a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((t,s)=>{if(s>=e)o.push(t),t.selection&&i++;else if(t.step){let e=t.step.map(n.slice(r)),s=e&&e.getMap();if(r--,s&&n.appendMap(s,r),e){let a=t.selection&&t.selection.map(n.slice(r));a&&i++;let c=new l(s.invert(),e,a),h,d=o.length-1;(h=o.length&&o[d].merge(c))?o[d]=h:o.push(c)}}else t.map&&r--},this.items.length,0),new s(t.from(o.reverse()),i)}}s.empty=new s(t.empty,0);class l{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new l(t.getMap().invert(),t,this.selection)}}}class a{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}let c=20;function h(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,o)=>t.push(r,o));return t}function d(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let p=!1,f=null;function u(e){let t=e.plugins;if(f!=t){p=!1,f=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){p=!0;break}}return p}let m=new i.p("history"),g=new i.p("closeHistory");function y(e,t){return(n,r)=>{let o=m.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=u(t),o=m.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),c=new a(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(m,{redo:n,historyState:c})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}let v=y(!1,!0),w=y(!0,!0);y(!1,!1),y(!0,!1),e.s(["c",0,function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new i.x({key:m,state:{init:()=>new a(s.empty,s.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let o=n.getMeta(m),i;if(o)return o.historyState;n.getMeta(g)&&(e=new a(e.done,e.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(l&&l.getMeta(m))if(l.getMeta(m).redo)return new a(e.done.addTransform(n,void 0,r,u(t)),e.undone,h(n.mapping.maps),e.prevTime,e.prevComposition);else return new a(e.done,e.undone.addTransform(n,void 0,r,u(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))if(i=n.getMeta("rebased"))return new a(e.done.rebased(n,i),e.undone.rebased(n,i),d(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new a(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),d(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!l&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;
1return e.mapping.maps[0].forEach((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges)),c=l?d(e.prevRanges,n.mapping):h(n.mapping.maps);return new a(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,u(t)),s.empty,c,n.time,null==o?e.prevComposition:o)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?v:"historyRedo"==n?w:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})},"b",0,w,"j",0,v],4819644)},9202008,e=>{"use strict";var t=e.i(3260861),n=e.i(8111092);let r="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),o="u">typeof navigator&&/Win/.test(navigator.platform);function i(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 s(e){let n=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,o,i,s=e.split(/-(?!$)/),l=s[s.length-1];"Space"==l&&(l=" ");for(let e=0;e<s.length-1;e++){let l=s[e];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))r?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+l)}return t&&(l="Alt-"+l),n&&(l="Ctrl-"+l),i&&(l="Meta-"+l),o&&(l="Shift-"+l),l}(n)]=e[n];return t}(e);return function(e,r){let s=(0,t.R)(r),l,a=n[i(s,r)];if(a&&a(e.state,e.dispatch,e))return!0;if(1==s.length&&" "!=s){if(r.shiftKey){let t=n[i(s,r,!1)];if(t&&t(e.state,e.dispatch,e))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(o&&r.ctrlKey&&r.altKey)&&(l=t.j[r.keyCode])&&l!=s){let t=n[i(l,r)];if(t&&t(e.state,e.dispatch,e))return!0}}return!1}}e.s(["v",0,s,"w",0,function(e){return new n.x({props:{handleKeyDown:s(e)}})}])},9864616,e=>{"use strict";var t=e.i(8111092),n=e.i(5558497),r=e.i(9605842);let o=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},i=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},s=null,l=function(e,t,n){let r=s||(s=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},a=function(){s=null},c=function(e,t,n,r){return n&&(d(e,t,n,r,-1)||d(e,t,n,r,1))},h=/^(img|br|input|textarea|hr)$/i;function d(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:p(e))){let n=e.parentNode;if(!n||1!=n.nodeType||f(e)||h.test(e.nodeName)||"false"==e.contentEditable)return!1;t=o(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(s=n.pmViewDesc)||!s.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?p(e):0}}}function p(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function f(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)}let u=function(e){return e.focusNode&&c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function m(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let g="u">typeof navigator?navigator:null,y="u">typeof document?document:null,v=g&&g.userAgent||"",w=/Edge\/(\d+)/.exec(v),b=/MSIE \d/.exec(v),S=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(v),k=!!(b||S||w),C=b?document.documentMode:S?+S[1]:w?+w[1]:0,x=!k&&/gecko\/(\d+)/i.test(v);x&&(/Firefox\/(\d+)/.exec(v)||[0,0])[1];let M=!k&&/Chrome\/(\d+)/.exec(v),N=!!M,O=M?+M[1]:0,D=!k&&!!g&&/Apple Computer/.test(g.vendor),T=D&&(/Mobile\/\w+/.test(v)||!!g&&g.maxTouchPoints>2),E=T||!!g&&/Mac/.test(g.platform),A=!!g&&/Win/.test(g.platform),R=/Android \d/.test(v),I=!!y&&"webkitFontSmoothing"in y.documentElement.style,P=I?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function V(e,t){return"number"==typeof e?e:e[t]}function B(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let l=n||e.dom;l;){if(1!=l.nodeType){l=i(l);continue}let e=l,n=e==s.body,a=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}
vendor: 12,006 bytes, line 1
1(s):function(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}}(e),c=0,h=0;if(t.top<a.top+V(r,"top")?h=-(a.top-t.top+V(o,"top")):t.bottom>a.bottom-V(r,"bottom")&&(h=t.bottom-t.top>a.bottom-a.top?t.top+V(o,"top")-a.top:t.bottom-a.bottom+V(o,"bottom")),t.left<a.left+V(r,"left")?c=-(a.left-t.left+V(o,"left")):t.right>a.right-V(r,"right")&&(c=t.right-a.right+V(o,"right")),c||h)if(n)s.defaultView.scrollBy(c,h);else{let n=e.scrollLeft,r=e.scrollTop;h&&(e.scrollTop+=h),c&&(e.scrollLeft+=c);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let d=n?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(d))break;l="absolute"==d?l.offsetParent:i(l)}}function z(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=i(r));return t}function $(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let F=null;function W(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function L(e){return e.top<e.bottom||e.left<e.right}function J(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(L(e))return e}return Array.prototype.find.call(n,L)||e.getBoundingClientRect()}let H=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function K(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=I||x;if(3==r.nodeType)if(s&&(H.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let e=J(l(r,o,o),n);if(x&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=J(l(r,o-1,o-1),-1);if(t.top==e.top){let n=J(l(r,o,o+1),-1);if(n.top!=e.top)return q(n,n.left<t.left)}}return e}else{let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,q(J(l(r,e,t),i),i<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==p(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return _(e.getBoundingClientRect(),!1)}if(null==i&&o<p(r)){let e=r.childNodes[o];if(1==e.nodeType)return _(e.getBoundingClientRect(),!0)}return _(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==p(r))){let e=r.childNodes[o-1],t=3==e.nodeType?l(e,p(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return q(J(t,1),!1)}if(null==i&&o<p(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?l(e,0,+!s):1==e.nodeType?e:null:null;if(t)return q(J(t,-1),!0)}return q(J(3==r.nodeType?l(r):r,-n),n>=0)}function q(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function _(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function j(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}let X=/[\u0590-\u08ac]/,Y=null,U=null,G=!1;class Z{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.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(e,t,n){let r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>o(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o=this.getDesc(r),i;if(o&&(!t||o.node))if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=this.children[n],i=t+o.size;if(i>e||o instanceof ei){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Q&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?o(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?o(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let s=n,l=0;;l++){let n=this.children[l],a=s+n.size;if(-1==r&&e<=a){let i=s+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=o(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||l==this.children.length-1)){t=a;for(let e=l+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=o(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}s=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let o=0,l=0;o<this.children.length;o++){let a=this.children[o],c=l+a.size;if(i>l&&s<c)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=c}let l=this.domFromPos(e,e?-1:1),a=t==e?l:this.domFromPos(t,t?-1:1),h=n.root.getSelection(),d=n.domSelectionRange(),p=!1;if((x||D)&&e==t){let{node:e,offset:t}=l;if(3==e.nodeType){if((p=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(l=a={node:n.parentNode,offset:o(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];p=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(x&&d.focusNode&&d.focusNode!=a.node&&1==d.focusNode.nodeType){let e=d.focusNode.childNodes[d.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||p&&D)&&c(l.node,l.offset,d.anchorNode,d.anchorOffset)&&c(a.node,a.offset,d.focusNode,d.focusOffset))return;let f=!1;if((h.extend||e==t)&&!(p&&x)){h.collapse(l.node,l.offset);try{e!=t&&h.extend(a.node,a.offset),f=!0}catch(e){}}if(!f){if(e>t){let e=l;l=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(l.node,l.offset),h.removeAllRanges(),h.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s){this.dirty=e==n||t==i?2:1,e==r&&t==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(e-r,t-r);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Q extends Z{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ee extends Z{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class et extends Z{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(e,t,r,o){let i=o.nodeViews[t.type.name],s=i&&i(t,o,r);return s&&s.dom||(s=n.h.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new et(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=et.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=eg(o,t,i,n)),e>0&&(o=eg(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class en extends Z{constructor(e,t,n,r,o,i,s,l,a){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,r,o,i,s){let l=i.nodeViews[t.type.name],a,c=l&&l(t,i,(
1)=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,r,o),h=c&&c.dom,d=c&&c.contentDOM;if(t.isText)if(h){if(3!=h.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(t.text);else if(!h){let e=n.h.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:h,contentDOM:d}=e)}d||t.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let p=h;return(h=ed(h,r,t),c)?a=new es(e,t,r,o,h,d||null,p,c,i,s+1):t.isText?new eo(e,t,r,o,h,p,i):new en(e,t,r,o,h,d||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>n.y.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ep(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new eu(this,s&&s.node,e);(function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let h,d,p,f;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(h?(d||(d=[h])).push(e):h=e)}if(h)if(d){d.sort(em);for(let e=0;e<d.length;e++)n(d[e],c,!!a)}else n(h,c,!!a);if(a)f=-1,p=a,a=null;else if(c<e.childCount)f=c,p=e.child(c++);else break;for(let e=0;e<l.length;e++)l[e].to<=i&&l.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let u=i+p.nodeSize;if(p.isText){let e=u;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<u&&(a=p.cut(e-i),p=p.cut(0,e-i),u=e,f=-1)}else for(;s<o.length&&o[s].to<u;)s++;let m=p.isInline&&!p.isLeaf?l.filter(e=>!e.inline):l.slice();r(p,m,t.forChild(i,p),f),i=u}})(this.node,this.innerDeco,(t,i,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,r,e,i):t.type.side>=0&&!s&&a.syncToMarks(i==this.node.childCount?n.H.none:this.node.child(i).marks,r,e,i),a.placeWidget(t,e,o)},(t,n,s,c)=>{let h;a.syncToMarks(t.marks,r,e,c),a.findNodeMatch(t,n,s,c)||l&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(h=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,n,s,h,e)||a.updateNextNode(t,n,s,e,c,o)||a.addNode(t,n,s,e,o),o+=t.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),function e(t,n,r){let o=t.firstChild,i=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=o;)o=ef(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(a,o);if(l instanceof et){let n=o?o.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),o=n?n.nextSibling:t.firstChild}}for(;o;)o=ef(o),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),T&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof t.k)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,t=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;a+=t.text}if(i>=n){if(i>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,r-n,o-n);return t<0?null:{node:i,pos:t,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;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 i=new ee(this,o,t,r);e.input.compositionNodes.push(i),this.children=eg(this.children,n,n+r.length,e,i)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ep(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=eh(this.dom,this.nodeDOM,ec(this.outerDeco,this.node,t),ec(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function er(e,t,n,r,o){ed(r,t,e);let i=new en(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class eo extends en{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0
1)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new eo(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ei extends Z{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class es extends en{constructor(e,t,n,r,o,i,s,l,a,c){super(e,t,n,r,o,i,s,a,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let el=function(e){e&&(this.nodeName=e)};el.prototype=Object.create(null);let ea=[new el];function ec(e,t,n){if(0==e.length)return ea;let r=n?ea[0]:new el,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s)for(let e in s.nodeName&&o.push(r=new el(s.nodeName)),s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new el(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}return o}function eh(e,t,n,r){if(n==ea&&r==ea)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||((t=document.createElement(i.nodeName)).pmIsDeco=!0,t.appendChild(o),s=ea[0]),o=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(o,s||ea[0],i)}return o}function ed(e,t,n){return eh(e,e,ea,ec(t,n,1!=e.nodeType))}function ep(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 ef(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class eu{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];t:for(;o>0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof et)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break t;else r=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){o=t;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=et.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let o=-1,i;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof en){let a=this.preMatch.matched.get(l);if(null!=a&&a!=o)return!1;
1let c=l.dom,h,d=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&ep(t,l.outerDeco));if(!d&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(h=this.recreateWrapper(l,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=2,h.updateChildren(r,i+1),h.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ep(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=en.create(this.top,t,n,r,o,i);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,o){let i=en.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Q(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof et;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof eo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((D||N)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new ei(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function em(e,t){return e.type.side-t.type.side}function eg(e,t,n,r,o){let i=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,h=l+=a.size;c>=n||h<=t?i.push(a):(c<t&&i.push(a.slice(0,t-c,r)),o&&(i.push(o),o=void 0),h>n&&i.push(a.slice(n-c,a.size,r)))}return i}function ey(e,n=null){let r=e.domSelectionRange(),i=e.state.doc;if(!r.focusNode)return null;let s=e.docView.nearestDesc(r.focusNode),l=s&&0==s.size,a=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(a<0)return null;let c=i.resolve(a),h,d;if(u(r)){for(h=a;s&&!s.node;)s=s.parent;let e=s.node;if(s&&e.isAtom&&t.C.isSelectable(e)&&s.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==p(e);r||i;){if(e==n)return!0;let t=o(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==p(e)}}(r.focusNode,r.focusOffset,s.dom))){let e=s.posBefore;d=new t.C(a==e?c:i.resolve(e))}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let t=a,n=a;for(let o=0;o<r.rangeCount;o++){let i=r.getRangeAt(o);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),n=Math.max(n,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[h,a]=n==e.state.selection.anchor?[n,t]:[t,n],c=i.resolve(a)}else h=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(h<0)return null}let f=i.resolve(h);if(!d){let t="pointer"==n||e.state.selection.head<c.pos&&!l?1:-1;d=eN(e,f,c,t)}return d}function ev(e){return e.editable?e.hasFocus():eD(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ew(e,n=!1){let r=e.state.selection;if(ex(e,r),!ev(e))return;let i=e.input.mouseDown;if(!n&&N&&i){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&c(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&i.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,o(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&k&&C<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var s;let o,i,l,a,{anchor:c,head:h}=r,d,p;eb&&!(r instanceof t.k)&&(r.$from.parent.inlineContent||(d=eS(e,r.from)),r.empty||r.$from.parent.inlineContent||(p=eS(e,r.to))),e.docView.setSelection(c,h,e,n),eb&&(d&&eC(d),p&&eC(p)),r.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((o=(s=e).dom.ownerDocument).removeEventListener("selectionchange",s.input.hide
1SelectionGuard),l=(i=s.domSelectionRange()).anchorNode,a=i.anchorOffset,o.addEventListener("selectionchange",s.input.hideSelectionGuard=()=>{(i.anchorNode!=l||i.anchorOffset!=a)&&(o.removeEventListener("selectionchange",s.input.hideSelectionGuard),setTimeout(()=>{(!ev(s)||s.state.selection.visible)&&s.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}let eb=D||N&&O<63;function eS(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(D&&o&&"false"==o.contentEditable)return ek(o);if((!o||"false"==o.contentEditable)&&(!i||"false"==i.contentEditable)){if(o)return ek(o);else if(i)return ek(i)}}function ek(e){return e.contentEditable="true",D&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function eC(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ex(e,n){if(n instanceof t.C){let t=e.docView.descAt(n.from);t!=e.lastSelectedViewDesc&&(eM(e),t&&t.selectNode(),e.lastSelectedViewDesc=t)}else eM(e)}function eM(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function eN(e,n,r,o){return e.someProp("createSelectionBetween",t=>t(e,n,r))||t.k.between(n,r,o)}function eO(e){return(!e.editable||!!e.hasFocus())&&eD(e)}function eD(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function eT(e,n){let{$anchor:r,$head:o}=e.selection,i=n>0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?e.doc.resolve(n>0?i.after():i.before()):null:i;return s&&t.e.findFrom(s,n)}function eE(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function eA(e,n,r){let o=e.state.selection;if(o instanceof t.k){if(r.indexOf("s")>-1){let{$head:r}=o,i=r.textOffset?null:n<0?r.nodeBefore:r.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(r.pos+i.nodeSize*(n<0?-1:1));return eE(e,new t.k(o.$anchor,s))}else if(!o.empty)return!1;else if(e.endOfTextblock(n>0?"forward":"backward")){let r=eT(e.state,n);return!!r&&r instanceof t.C&&eE(e,r)}else if(!(E&&r.indexOf("m")>-1)){let r=o.$head,i=r.textOffset?null:n<0?r.nodeBefore:r.nodeAfter,s;if(!i||i.isText)return!1;let l=n<0?r.pos-i.nodeSize:r.pos;return!!(i.isAtom||(s=e.docView.descAt(l))&&!s.contentDOM)&&(t.C.isSelectable(i)?eE(e,new t.C(n<0?e.state.doc.resolve(r.pos-i.nodeSize):r)):!!I&&eE(e,new t.k(e.state.doc.resolve(n<0?l:l+i.nodeSize))))}}else{if(o instanceof t.C&&o.node.isInline)return eE(e,new t.k(n>0?o.$to:o.$from));let r=eT(e.state,n);return!!r&&eE(e,r)}}function eR(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function eI(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function eP(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,l=!1;for(x&&1==n.nodeType&&r<eR(n)&&eI(n.childNodes[r],-1)&&(l=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(eI(e,-1))i=n,s=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(eV(n))break;else{let t=n.previousSibling;for(;t&&eI(t,-1);)i=n.parentNode,s=o(t),t=t.previousSibling;if(t)r=eR(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}l?eB(e,n,r):i&&eB(e,i,s)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,s=r.focusOffset;if(!i)return;let l=eR(i);for(;;)if(s<l){if(1!=i.nodeType)break;if(eI(i.childNodes[s],1))t=i,n=++s;else break}else if(eV(i))break;else{let r=i.nextSibling;for(;r&&eI(r,1);)t=r.parentNode,n=o(r)+1,r=r.nextSibling;if(r)s=0,l=eR(i=r);else{if((i=i.parentNode)==e.dom)break;s=l=0}}t&&eB(e,t,n)}(e)}function eV(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function eB(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!f(e);)t=o(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];
vendor: 4,474 bytes, line 1
1if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!f(e);)t=o(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(u(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&ew(e)},50)}function ez(e,t){let n=e.state.doc.resolve(t);if(!(N||A)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function e$(e,n,r){let o=e.state.selection;if(o instanceof t.k&&!o.empty||r.indexOf("s")>-1||E&&r.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||e.endOfTextblock(n<0?"up":"down")){let r=eT(e.state,n);if(r&&r instanceof t.C)return eE(e,r)}if(!i.parent.inlineContent){let r=n<0?i:s,l=o instanceof t.i?t.e.near(r,n):t.e.findFrom(r,n);return!!l&&eE(e,l)}return!1}function eF(e,n){if(!(e.state.selection instanceof t.k))return!0;let{$head:r,$anchor:o,empty:i}=e.state.selection;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(n>0?"forward":"backward"))return!0;let s=!r.textOffset&&(n<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){let t=e.state.tr;return n<0?t.delete(r.pos-s.nodeSize,r.pos):t.delete(r.pos,r.pos+s.nodeSize),e.dispatch(t),!0}return!1}function eW(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function eL(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let r=[],{content:o,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&1==o.childCount&&1==o.firstChild.childCount;){i--,s--;let e=o.firstChild;r.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),o=e.content}let l=e.someProp("clipboardSerializer")||n.h.fromSchema(e.state.schema),a=eY(),c=a.createElement("div");c.appendChild(l.serializeFragment(o,{document:a}));let h=c.firstChild,d,p=0;for(;h&&1==h.nodeType&&(d=ej[h.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=a.createElement(d[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),p++}h=c.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:c,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function eJ(e,t,r,o,i){let s,l,a=i.parent.type.spec.code;if(!r&&!t)return null;let c=!!t&&(o||a||!r);if(c){if(e.someProp("transformPastedText",n=>{t=n(t,a||o,e)}),a)return l=new n.k(n.y.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let r=e.someProp("clipboardTextParser",n=>n(t,i,o,e));if(r)l=r;else{let r=i.marks(),{schema:o}=e.state,l=n.h.fromSchema(o);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(o.text(e,r)))})}}else e.someProp("transformPastedHTML",t=>{r=t(r,e)}),s=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let o=eY().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e),s;if((s=i&&ej[i[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),o.innerHTML=(t=e,(n=window.trustedTypes)?(eU||(eU=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),eU.createHTML(t)):t),s)for(let e=0;e<s.length;e++)o=o.querySelector(s[e])||o;return o}(r),I&&function(e){let t=e.querySelectorAll(N?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(s);let h=s&&s.querySelector("[data-pm-slice]"),d=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=s.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;s=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||n.p.fromSc
1hema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||eH.test(e.parentNode.nodeName)?null:{ignore:!0}})),d)l=function(e,t){if(!e.size)return e;let r=e.content.firstChild.type.schema,o;try{o=JSON.parse(t)}catch(t){return e}let{content:i,openStart:s,openEnd:l}=e;for(let e=o.length-2;e>=0;e-=2){let t=r.nodes[o[e]];if(!t||t.hasRequiredAttrs())break;i=n.y.from(t.create(o[e+1],i)),s++,l++}return new n.k(i,s,l)}(e_(l,+d[1],+d[2]),d[4]);else if((l=n.k.maxOpen(function(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(e=>{if(!s)return;let t=o.findWrapping(e.type),r;if(!t)return s=null;if(r=s.length&&i.length&&function e(t,r,o,i,s){if(s<t.length&&s<r.length&&t[s]==r[s]){let l=e(t,r,o,i.lastChild,s+1);if(l)return i.copy(i.content.replaceChild(i.childCount-1,l));if(i.contentMatchAt(i.childCount).matchType(s==t.length-1?o.type:t[s+1]))return i.copy(i.content.append(n.y.from(eK(o,t,s+1))))}}(t,i,e,s[s.length-1],0))s[s.length-1]=r;else{s.length&&(s[s.length-1]=function e(t,r){if(0==r)return t;let o=t.content.replaceChild(t.childCount-1,e(t.lastChild,r-1)),i=t.contentMatchAt(t.childCount).fillBefore(n.y.empty,!0);return t.copy(o.append(i))}(s[s.length-1],i.length));let r=eK(e,t);s.push(r),o=o.matchType(r.type),i=t}}),s)return n.y.from(s)}return e}(l.content,i),!0)).openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=e_(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,c)}),l}let eH=/^(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 eK(e,t,r=0){for(let o=t.length-1;o>=r;o--)e=t[o].create(null,n.y.from(e));return e}function eq(e,t,r,o,i,s){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(s=0),i<o-1&&(a=eq(a,t,r,o,i+1,s)),i>=r&&(a=t<0?l.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(n.y.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function e_(e,t,r){return t<e.openStart&&(e=new n.k(eq(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),r<e.openEnd&&(e=new n.k(eq(e.content,1,r,e.openEnd,0,0),e.openStart,r)),e}let ej={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},eX=null;function eY(){return eX||(eX=document.implementation.createHTMLDocument("title"))}let eU=null,eG={},eZ={},eQ={touchstart:!0,touchmove:!0};class e0{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function e1(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function e2(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>e3(e,t))})}function e3(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function e5(e){return{left:e.clientX,top:e.clientY}}function e4(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)))return!0;return!1}function e6(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function e8(e,n,r){let o=e.state.doc;if(-1==n)return o.inlineContent?t.k.create(o,0,o.content.size):null;let i=o.resolve(n);for(let e=i.depth+1;e>0;e--){let n=e>i.depth?i.nodeAfter:i.node(e),s=i.before(e);if(n.inlineContent)return t.k.create(o,s+1,s+1+n.content.size);if(r&&t.C.isSelectable(n))return t.C.create(o,s)}return null}eZ.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!tn(e))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!R||!N||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!T||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,o=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&
1(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||E&&72==r&&"c"==o)return eF(e,-1)||eP(e,-1);if(46==r&&!t.shiftKey||E&&68==r&&"c"==o)return eF(e,1)||eP(e,1);if(13==r||27==r)return!0;if(37==r||E&&66==r&&"c"==o){let t=37==r?"ltr"==ez(e,e.state.selection.from)?-1:1:-1;return eA(e,t,o)||eP(e,t)}if(39==r||E&&70==r&&"c"==o){let t=39==r?"ltr"==ez(e,e.state.selection.from)?1:-1:1;return eA(e,t,o)||eP(e,t)}else if(38==r||E&&80==r&&"c"==o)return e$(e,-1,o)||eP(e,-1);else if(40==r||E&&78==r&&"c"==o)return function(e){if(!D||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;eW(e,n,"true"),setTimeout(()=>eW(e,n,"false"),20)}return!1}(e)||e$(e,1,o)||eP(e,1);else if(o==(E?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():e1(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,m(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},eZ.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},eZ.keypress=(e,n)=>{if(tn(e)||!n.charCode||n.ctrlKey&&!n.altKey||E&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof t.k)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,r.$from.pos,r.$to.pos,t,o))||e.dispatch(o()),n.preventDefault()}};let e9=E?"metaKey":"ctrlKey";eG.mousedown=(e,n)=>{var r;let o,i;e.input.shiftKey=n.shiftKey;let s=ts(e),l=Date.now(),a="singleClick";l-e.input.lastClick.time<500&&(o=(r=e.input.lastClick).x-n.clientX)*o+(i=r.y-n.clientY)*i<100&&!n[e9]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:l,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let c=e.posAtCoords(e5(n));c&&("singleClick"==a?e.input.mouseDown=new te(e,c,n,!!s):("doubleClick"==a?function(e,t,n,r){return e4(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,n,r,o){return e4(e,"handleTripleClickOn",n,r,o)||e.someProp("handleTripleClick",t=>t(e,n,o))||function(e,n,r){if(0!=r.button)return!1;let o=e8(e,n,!0),i=e.state.doc;return!!o&&(e6(e,o,"pointer"),o instanceof t.k&&i.eq(e.state.doc)&&(e.input.mouseDown=new tt(e,o)),!0)}(e,r,o)})(e,c.pos,c.inside,n)?n.preventDefault():e1(e,"pointer"))};class e7{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){0==e.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class te extends e7{constructor(e,n,r,o){let i,s;if(super(e),this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[e9],this.allowDefault=r.shiftKey,n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let t=e.state.doc.resolve(n.pos);i=t.parent,s=t.depth?t.before():0}const l=o?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:c}=e.state;0==r.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||c instanceof t.C&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&x&&!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()),e1(e,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||ew(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;if(this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(e5(e))),this.updateAllowDefault(e),this.allowDefault||!n)e1(this.view,"pointer");else{var r,o,i,s;(r=this.view,o=n.pos,i=n.inside,s=this.selectNode,e4(r,"handleClickOn",o,i,e)||r.someProp("handleClick",t=>t(r,o,e))||(s?function(e,n){if(-1==n)return!1;let r=e.state.selection,o,i;r instanceof t.C&&(o=r.node);let s=e.state.doc.resolve(n);for(let e=s.depth+1;e>0;e--){let n=e>s.depth?s.nodeAfter:s.node(e);if(t.C.isSelectable(n)){i=o&&r.$from.depth>0&&e>=r.$from.depth&&s.before(r.$from.depth+1)==r.$from.pos?s.before(r.$from.depth):s.before(e);break}}
1return null!=i&&(e6(e,t.C.create(e.state.doc,i),"pointer"),!0)}(r,i):function(e,n){if(-1==n)return!1;let r=e.state.doc.resolve(n),o=r.nodeAfter;return!!(o&&o.isAtom&&t.C.isSelectable(o))&&(e6(e,new t.C(r),"pointer"),!0)}(r,i)))?e.preventDefault():0==e.button&&(this.flushed||D&&this.mightDrag&&!this.mightDrag.node.isAtom||N&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to)))?(e6(this.view,t.e.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):e1(this.view,"pointer")}}move(e){this.updateAllowDefault(e),e1(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class tt extends e7{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),e1(this.view,"pointer");let n=this.view.posAtCoords(e5(e)),r=n&&e8(this.view,n.inside,!1);if(!r)return;let{doc:o}=this.view.state,i=this.startSelection,[s,l]=r.from<i.from?[i.to,r.from]:[i.from,r.to];e6(this.view,t.k.create(o,s,l),"pointer")}}function tn(e,t){return!!e.composing||!!(D&&500>Math.abs(Date.now()-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}eG.touchstart=e=>{e.input.lastTouch=Date.now(),ts(e),e1(e,"pointer")},eG.touchmove=e=>{e.input.lastTouch=Date.now(),e1(e,"pointer")},eG.contextmenu=e=>ts(e);let tr=R?5e3:-1;function to(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ts(e),t))}function ti(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ts(e,t=!1){if(!R||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ti(e),t||e.docView&&e.docView.dirty){let n=ey(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}eZ.compositionstart=eZ.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:n}=e,r=n.selection.$to;if(n.selection instanceof t.k&&(n.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||N&&A&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||r.marks(),ts(e,!0),e.markCursor=null;else if(ts(e,!n.selection.empty),x&&n.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}to(e,tr)},eZ.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,to(e,20))};let tl=k&&C<15||T&&P<604;function ta(e,t,r,o,i){let s=eJ(e,t,r,o,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,s||n.k.empty)))return!0;if(!s)return!1;let l=0==s.openStart&&0==s.openEnd&&1==s.content.childCount?s.content.firstChild:null,a=l?e.state.tr.replaceSelectionWith(l,o):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tc(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;
1let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}eG.copy=eZ.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let o=tl?null:t.clipboardData,{dom:i,text:s}=eL(e,n.content());o?(t.preventDefault(),o.clearData(),o.setData("text/html",i.innerHTML),o.setData("text/plain",s)):function(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(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,i),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},eZ.paste=(e,t)=>{if(e.composing&&!R)return;let n=tl?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&ta(e,tc(n),n.getData("text/html"),r,t)?t.preventDefault():function(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();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ta(e,r.value,null,o,t):ta(e,r.textContent,r.innerHTML,o,t)},50)}(e,t)};class th{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let td=E?"altKey":"ctrlKey";function tp(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[td]}for(let e in eG.dragstart=(e,n)=>{let r,o=e.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(e5(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof t.C?i.to-1:i.to));else if(o&&o.mightDrag)r=t.C.create(e.state.doc,o.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let o=e.docView.nearestDesc(n.target,!0);o&&o.node.type.spec.draggable&&o!=e.docView&&(r=t.C.create(e.state.doc,o.posBefore))}let l=(r||e.state.selection).content(),{dom:a,text:c,slice:h}=eL(e,l);n.dataTransfer.files.length&&N&&!(O>120)||n.dataTransfer.clearData(),n.dataTransfer.setData(tl?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",tl||n.dataTransfer.setData("text/plain",c),e.dragging=new th(h,tp(e,n),r)},eG.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},eZ.dragover=eZ.dragenter=(e,t)=>t.preventDefault(),eZ.drop=(e,o)=>{try{!function(e,o,i){if(!o.dataTransfer)return;let s=e.posAtCoords(e5(o));if(!s)return;let l=e.state.doc.resolve(s.pos),a=i&&i.slice;a?e.someProp("transformPasted",t=>{a=t(a,e,!1)}):a=eJ(e,tc(o.dataTransfer),tl?null:o.dataTransfer.getData("text/html"),!1,l);let c=!!(i&&tp(e,o));if(e.someProp("handleDrop",t=>t(e,o,a||n.k.empty,c)))return o.preventDefault();if(!a)return;o.preventDefault();let h=a?(0,r.s)(e.state.doc,l.pos,a):l.pos;null==h&&(h=l.pos);let d=e.state.tr;if(c){let{node:e}=i;e?e.replace(d):d.deleteSelection()}let p=d.mapping.map(h),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,u=d.doc;
vendor: 4,233 bytes, line 1
1if(f?d.replaceRangeWith(p,p,a.content.firstChild):d.replaceRange(p,p,a),d.doc.eq(u))return;let m=d.doc.resolve(p);if(f&&t.C.isSelectable(a.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new t.C(m));else{let t=d.mapping.map(h);d.mapping.maps[d.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),d.setSelection(eN(e,m,d.doc.resolve(t)))}e.focus(),e.dispatch(d.setMeta("uiEvent","drop"))}(e,o,e.dragging)}finally{e.dragging=null}},eG.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())&&ew(e)},20))},eG.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},eG.beforeinput=(e,t)=>{if(N&&R&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,m(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},eZ)eG[e]=eZ[e];function tf(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 tu{constructor(e,t){this.toDOM=e,this.spec=t||tw,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new ty(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof tu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&tf(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tm{constructor(e,t){this.attrs=e,this.spec=t||tw}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new ty(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof tm&&tf(this.attrs,e.attrs)&&tf(this.spec,e.spec)}static is(e){return e.type instanceof tm}destroy(){}}class tg{constructor(e,t){this.attrs=e,this.spec=t||tw}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new ty(o.pos-n,i.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),o;return r==t.from&&!(o=e.child(n)).isText&&r+o.nodeSize==t.to}eq(e){return this==e||e instanceof tg&&tf(this.attrs,e.attrs)&&tf(this.spec,e.spec)}destroy(){}}class ty{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new ty(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new ty(e,e,new tu(t,n))}static inline(e,t,n,r){return new ty(e,t,new tm(n,r))}static node(e,t,n,r){return new ty(e,t,new tg(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof tm}get widget(){return this.type instanceof tu}}let tv=[],tw={};class tb{constructor(e,t){this.local=e.length?e:tv,this.children=t.length?t:tv}static create(e,t){return t.length?tN(t,e,0,tw):tS}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==tS||0==e.maps.length?this:this.mapInner(e,t,0,0,n||tw)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let l=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,o,i)=>{let s=i-o-(n-e);for(let o=0;o<l.length;o+=3){let i=l[o+1];if(i<0||e>i+t-r)continue;let a=l[o]+t-r;n>=a?l[o+1]=e<=a?-2:-1:e>=t&&s&&(l[o]+=s,l[o+1]+=s)}
vendor: 4,146 bytes, line 1
1r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+i),h=c-o;if(h<0||h>=r.content.size){a=!0;continue}let d=n.map(e[t+1]+i,-1)-o,{index:p,offset:f}=r.content.findIndex(h),u=r.maybeChild(p);if(u&&f==h&&f+u.nodeSize==d){let r=l[t+2].mapInner(n,u,c+1,e[t]+i+1,s);r!=tS?(l[t]=h,l[t+1]=d,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=tN(function(e,t,n,r,o,i,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,i){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,o,i);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+i+1)}(e[l+2],t[l]+i+1);return n}(l,e,t,n,o,i,s),r,0,s);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new tb(t.sort(tO),l)}(this.children,i||[],e,t,n,r,o):i?new tb(i.sort(tO),tv):tS}add(e,t){return t.length?this==tS?tb.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach((e,i)=>{let s=i+n,l;if(l=tx(t,e,s)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,l,s+1):r.splice(o,0,i,i+e.nodeSize,tN(l,e,s+1,tw)),o+=3}});let i=tC(o?tM(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new tb(i.length?this.local.concat(i).sort(tO):this.local,r||this.children)}remove(e){return 0==e.length||this==tS?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>i&&n.to<s&&(e[t]=null,(o||(o=[])).push(n));if(!o)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(o,i+1);l!=tS?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,o;n<e.length;n++)if(o=e[n])for(let e=0;e<r.length;e++)r[e].eq(o,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new tb(r,n):tS}forChild(e,t){let n,r;if(this==tS)return this;if(t.isLeaf)return tb.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof tm){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new tb(r.sort(tO),tv);return n?new tk([e,n]):e}return n||tS}eq(e){if(this==e)return!0;if(!(e instanceof tb)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tD(this.localsInner(e))}localsInner(e){if(this==tS)return tv;if(e.inlineContent||!this.local.some(tm.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof tm||t.push(this.local[e]);return t}forEachSet(e){e(this)}}tb.empty=new tb([],[]),tb.removeOverlap=tD;let tS=tb.empty;class tk{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,tw));return tk.from(n)}forChild(e,t){if(t.isLeaf)return tb.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=tS&&(o instanceof tk?n=n.concat(o.members):n.push(o))}return tk.from(n)}eq(e){if(!(e instanceof tk)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?tD(n?t:t.sort(tO)):tv}static from(e){switch(e.length){case 0:return tS;case 1:return e[0];default:return new tk(e.every(e=>e instanceof tb)?e:e.reduce((e,t)=>
vendor: 5,296 bytes, line 1
1e.concat(t instanceof tb?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function tC(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new ty(o.from+t,o.to+t,o.type))}return n}function tx(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t=0,i;t<e.length;t++)(i=e[t])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),e[t]=null);return o}function tM(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function tN(e,t,n,r){let o=[],i=!1;t.forEach((t,s)=>{let l=tx(e,t,s+n);if(l){i=!0;let e=tN(l,t,n+s+1,r);e!=tS&&o.push(s,s+t.nodeSize,e)}});let s=tC(i?tM(e):e,-n).sort(tO);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new tb(s,o):tS}function tO(e,t){return e.from-t.from||e.to-t.to}function tD(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),tT(t,o+1,i.copy(r.to,i.to)));continue}i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),tT(t,o,r.copy(i.from,r.to)));break}}return t}function tT(e,t,n){for(;t<e.length&&tO(n,e[t])>0;)t++;e.splice(t,0,n)}function tE(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=tS&&t.push(r)}),e.cursorWrapper&&t.push(tb.create(e.state.doc,[e.cursorWrapper.deco])),tk.from(t)}let tA={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tR=k&&C<=11;class tI{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tP{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tI,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);k&&C<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():D&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),tR&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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,tA)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);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(eO(this.view)){if(this.suppressingSelectionUpdates)return ew(this.view);if(k&&C<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=i(n))t.add(n);for(let r=e.anchorNode;r;r=i(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let o=n.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&eO(n)&&!this.ignoreSelectionChange(o),s=-1,l=-1,a=!1,c=[];if(n.editable)for(let e=0;e<r.length;e++){let t=this.registerMutation(r[e],c);t&&(s=s<0?t.from:Math.min(t.from,s),l=l<0?t.to:Math.max(t.to,l),t.typeOver&&(a=!0))}if(c.some(e=>"BR"==e.nodeName)&&(8==n.input.lastKeyCode||46==n.input.lastKeyCode||N&&(n.composing||n.input.compositionEndedAt>Date.now()-50)&&r.some(e=>
1"childList"==e.type&&e.removedNodes.length))){for(let e of c)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(x&&c.length){let e=c.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:t}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!t||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(n,t)!=e)&&r.remove()}}}let h=null;s<0&&i&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&u(o)&&(h=ey(n))&&h.eq(t.e.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,ew(n),this.currentSelection.set(o),n.scrollToSelection()):(s>-1||i)&&(s>-1&&(n.docView.markDirty(s,l),e=n,!tV.has(e)&&(tV.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=x,tB||(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."),tB=!0))),n.input.badSafariComposition&&(n.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let i of t)if((null==(n=i.parentNode)?void 0:n.nodeName)=="TR"){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(i,n.firstChild),r==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(n,c)),this.handleDOMChange(s,l,a,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(o)||ew(n),this.currentSelection.set(o))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(k&&C<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let s=r&&r.parentNode==e.target?o(r)+1:0,l=n.localPosFromDOM(e.target,s,-1),a=i&&i.parentNode==e.target?o(i):e.target.childNodes.length;return{from:l,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let tV=new WeakMap,tB=!1;function tz(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return c(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function t$(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(D&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||D&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let tF=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function tW(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:eN(e,t.resolve(n.anchor),t.resolve(n.head))}function tL(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class tJ{constructor(e,r){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 e0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(tj),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=tq(this),tK(this),this.nodeViews=t_(this),this.docView=er(this.state.doc,tH(this),tE(this),this.dom,this),this.domObserver=new tP(this,(e,r,o,i)=>(function(e,r,o,i,s){let l,a,c,h=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,r<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ey(e,t);
1if(n&&!e.state.selection.eq(n)){if(N&&R&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,m(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),h&&r.setMeta("composition",h),e.dispatch(r)}return}let d=e.state.doc.resolve(r),p=d.sharedDepth(o);r=d.before(p+1),o=e.state.doc.resolve(o).after(p+1);let f=e.state.selection,g=function(e,t,r){let o,{node:i,fromOffset:s,toOffset:l,from:a,to:c}=e.docView.parseRange(t,r),h=e.domSelectionRange(),d=h.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(o=[{node:d,offset:h.anchorOffset}],u(h)||o.push({node:h.focusNode,offset:h.focusOffset})),N&&8===e.input.lastKeyCode)for(let e=l;e>s;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){l=e;break}if(!n||n.size)break}let p=e.state.doc,f=e.someProp("domParser")||n.p.fromSchema(e.state.schema),m=p.resolve(a),g=null,y=f.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:s,to:l,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:o,ruleFromNode:t$,context:m});if(o&&null!=o[0].pos){let e=o[0].pos,t=o[1]&&o[1].pos;null==t&&(t=e),g={anchor:e+a,head:t+a}}return{doc:y,sel:g,from:a,to:c}}(e,r,o),y=e.state.doc,v=y.slice(g.from,g.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,a="end"):(l=e.state.selection.from,a="start"),e.input.lastKeyCode=null;let w=function(e,t,n,r,o){let i=e.findDiffStart(t,n),s=n+e.size,l=n+t.size;if(null==i)return null;let{a:a,b:c}=e.findDiffEnd(t,s,l);if("end"==o){let e=Math.max(0,i-Math.min(a,c));r-=a+e-i}if(a<i&&s<l){let e=r<=i&&r>=a?i-r:0;i-=e,c=i+(c-a),a=i}else if(c<i){let e=r<=i&&r>=c?i-r:0;i-=e,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}(v.content,g.doc.content,g.from,l,a);if(w&&e.input.domChangeCount++,(T&&e.input.lastIOSEnter>Date.now()-225||R)&&s.some(e=>1==e.nodeType&&!tF.test(e.nodeName))&&(!w||w.endA>=w.endB)&&e.someProp("handleKeyDown",t=>t(e,m(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!w)if(i&&f instanceof t.k&&!f.empty&&f.$head.sameParent(f.$anchor)&&!e.composing&&!(g.sel&&g.sel.anchor!=g.sel.head))w={start:f.from,endA:f.to,endB:f.to};else{if(g.sel){let t=tW(e,e.state.doc,g.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);h&&n.setMeta("composition",h),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&w.start==w.endB&&e.state.selection instanceof t.k&&(w.start>e.state.selection.from&&w.start<=e.state.selection.from+2&&e.state.selection.from>=g.from?w.start=e.state.selection.from:w.endA<e.state.selection.to&&w.endA>=e.state.selection.to-2&&e.state.selection.to<=g.to&&(w.endB+=e.state.selection.to-w.endA,w.endA=e.state.selection.to)),k&&C<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>g.from&&"  "==g.doc.textBetween(w.start-g.from-1,w.start-g.from+1)&&(w.start--,w.endA--,w.endB--);let b=g.doc.resolveNoCache(w.start-g.from),S=g.doc.resolveNoCache(w.endB-g.from),x=y.resolve(w.start),M=b.sameParent(S)&&b.parent.inlineContent&&x.end()>=w.endA;if((T&&e.input.lastIOSEnter>Date.now()-225&&(!M||s.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!M&&b.pos<g.doc.content.size&&(!b.sameParent(S)||!b.parent.inlineContent)&&b.pos<S.pos&&!/\S/.test(g.doc.textBetween(b.pos,S.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,m(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>w.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||tL(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(tL(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||tL(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(y,w.start,w.endA,b,S)&&e.someProp("handleKeyDown",t=>t(e,m(8,"Backspace")))){R&&N&&e.domObserver.suppressSelectionUpdates();return}N&&w.endB==w.start&&(e.input.lastChromeDelete=Date.now()),R&&!M&&b.start()!=S.start()&&0==S.parentOffset&&b.depth==S.depth&&g.sel&&g.sel.anchor==g.sel.head&&g.sel.head==w.endA&&(w.endB-=2,S=g.doc.resolveNoCache(w.endB-g.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,m(13,"Enter"))})},20));let O=w.start,D=w.endA,E=t=>{let n=t||e.state.tr.replace(O,D,g.doc.slice(w.start-g.from,w.endB-g.from));if(g.sel){let t=tW(e,n.doc,g.sel);
vendor: 4,586 bytes, line 1
1t&&!(N&&e.composing&&t.empty&&(w.start!=w.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==O||t.head==n.mapping.map(D)-1)||k&&t.empty&&t.head==O)&&n.setSelection(t)}return h&&n.setMeta("composition",h),n.scrollIntoView()};if(M)if(b.pos==S.pos){k&&C<=11&&0==b.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ew(e),20));let t=E(e.state.tr.delete(O,D)),n=y.resolve(w.start).marksAcross(y.resolve(w.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(w.endA==w.endB&&(c=function(e,t){let r=e.firstChild.marks,o=t.firstChild.marks,i=r,s=o,l,a,c;for(let e=0;e<o.length;e++)i=o[e].removeFromSet(i);for(let e=0;e<r.length;e++)s=r[e].removeFromSet(s);if(1==i.length&&0==s.length)a=i[0],l="add",c=e=>e.mark(a.addToSet(e.marks));else{if(0!=i.length||1!=s.length)return null;a=s[0],l="remove",c=e=>e.mark(a.removeFromSet(e.marks))}let h=[];for(let e=0;e<t.childCount;e++)h.push(c(t.child(e)));if(n.y.from(h).eq(e))return{mark:a,type:l}}(b.parent.content.cut(b.parentOffset,S.parentOffset),x.parent.content.cut(x.parentOffset,w.endA-x.start())))){let t=E(e.state.tr);"add"==c.type?t.addMark(O,D,c.mark):t.removeMark(O,D,c.mark),e.dispatch(t)}else if(b.parent.child(b.index()).isText&&b.index()==S.index()-!S.textOffset){let t=b.parent.textBetween(b.parentOffset,S.parentOffset),n=()=>E(e.state.tr.insertText(t,O,D));e.someProp("handleTextInput",r=>r(e,O,D,t,n))||e.dispatch(n())}else e.dispatch(E());else e.dispatch(E())})(this,e,r,o,i)),this.domObserver.start(),function(e){for(let t in eG){let n=eG[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||e3(e,t)||!e.editable&&t.type in eZ||n(e,t)},eQ[t]?{passive:!0}:void 0)}D&&e.dom.addEventListener("input",()=>null),e2(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&e2(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tj),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,i;let s=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(ti(this),a=!0),this.state=e;let h=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(h||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=t_(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,l=!0)}(h||t.handleDOMEvents!=this._props.handleDOMEvents)&&e2(this),this.editable=tq(this),tK(this);let d=tE(this),u=tH(this),m=s.plugins==e.plugins||s.doc.eq(e.doc)?e.scrollToSelection>s.scrollToSelection?"to selection":"preserve":"reset",g=l||!this.docView.matchesNode(e.doc,u,d);(g||!e.selection.eq(s.selection))&&(a=!0);let y="preserve"==m&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:z(e.dom)}}(this);if(a){let t,n,a;this.domObserver.stop();let h=g&&(k||N)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&(r=s.selection,i=e.selection,a=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(a)!=i.$anchor.start(a));if(g){let t=N?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=p(e=e.childNodes[t-1])}else{if(!e.parentNode||f(e))return null;t=o(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||f(e))return null;t=o(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);
1if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(l||!this.docView.update(e.doc,u,d,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=er(e.doc,u,d,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(h=!0)}let m=this.input.mouseDown;h||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),c(t.node,t.offset,n.anchorNode,n.anchorOffset))&&m.delaySelUpdate())?ew(this,h):(ex(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),(null==(n=this.dragging)?void 0:n.node)&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),"reset"==m?this.dom.scrollTop=0:"to selection"==m?this.scrollToSelection():y&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;$(n,0==r?0:r-t)}(y)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof t.C){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&B(this,t.getBoundingClientRect(),e)}else B(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,n){let r=e.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let e=r.from+(this.state.doc.content.size-n.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==r.node&&(o=e)}this.dragging=new th(e.slice,e.move,o<0?void 0:t.C.create(this.state.doc,o))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n].props[e];if(null!=o&&(r=t?t(o):o))return r}let o=this.state.plugins;if(o)for(let n=0;n<o.length;n++){let i=o[n].props[e];if(null!=i&&(r=t?t(i):i))return r}}hasFocus(){if(k){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(F)return e.focus(F);let t=z(e);e.focus(null==F?{get preventScroll(){return F={preventScroll:!0},!0}}:void 0),F||(F=!1,$(t,0))}(this.dom),ew(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,o,s=e.dom.ownerDocument,a,c=0,h=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(p(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(p(r.startContainer),r.startOffset)}}}(s,t.left,t.top);h&&({node:a,offset:c}=h);let d=(e.root.elementFromPoint?e.root:s).elementFromPoint(t.left,t.top);if(!d||!e.dom.contains(1!=d.nodeType?d.parentNode:d)){let n=e.dom.getBoundingClientRect();if(!W(t,n)||!(d=function e(t,n,r){let o=t.childNodes.length;if(o&&r.top<r.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2)),s=i;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let o=0;o<t.length;o++){let i=t[o];if(W(n,i))return e(r,n,i)}}if((s=(s+1)%o)==i)break}return t}(e.dom,t,n)))return null}if(D)for(let e=d;a&&e;e=i(e))e.draggable&&(a=void 0);if(d=(r=(n=d).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,a){let n;if(x&&1==a.nodeType&&(c=Math.min(c,a.childNodes.length))<a.childNodes.length){let e=a.childNodes[c],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&c++}I&&c&&1==a.nodeType&&1==(n=a.childNodes[c-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&c--,a==e.dom&&c==a.childNodes.length-1&&1==a.lastChild.nodeType&&t.top>
1a.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:(0==c||1!=a.nodeType||"BR"!=a.childNodes[c-1].nodeName)&&(o=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!i&&s.left>r.left||s.top>r.top?o=t.posBefore:(!i&&s.right<r.left||s.bottom<r.top)&&(o=t.posAfter),i=!0),!t.contentDOM&&o<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,a,c,t))}null==o&&(o=function(e,t,n){let{node:r,offset:o}=function e(t,n){let r,o,i,s=2e8,a,c=0,h=n.top,d=n.top;for(let e=t.firstChild,p=0;e;e=e.nextSibling,p++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=l(e).getClientRects()}for(let l=0;l<t.length;l++){let f=t[l];if(f.top<=h&&f.bottom>=d){h=Math.max(f.bottom,h),d=Math.min(f.top,d);let t=f.left>n.left?f.left-n.left:f.right<n.left?n.left-f.right:0;if(t<s){i=e,s=t,a=t&&3==i.nodeType?{left:f.right<n.left?f.right:f.left,top:n.top}:n,1==e.nodeType&&t&&(c=p+ +(n.left>=(f.left+f.right)/2));continue}}else f.top>n.top&&!r&&f.left<=n.left&&f.right>=n.left&&(r=e,o={left:Math.max(f.left,Math.min(f.right,n.left)),top:f.top});!i&&(n.left>=f.right&&n.top>=f.top||n.left>=f.left&&n.top>=f.bottom)&&(c=p+1)}}return(!i&&r&&(i=r,a=o,s=0),i&&3==i.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange(),o;for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=J(r,1);if(n.top!=n.bottom&&W(t,n)){o={node:e,offset:i+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),o||{node:e,offset:0}}(i,a):!i||s&&1==i.nodeType?{node:t,offset:c}:e(i,a)}(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,d,t));let f=e.docView.nearestDesc(d,!0);return{pos:o,inside:f?f.posAtStart-f.border:-1}}(this,e)}coordsAtPos(e,t=1){return K(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,o;return Y==t&&U==n?G:(Y=t,U=n,G="up"==n||"down"==n?(r=t.selection,o="up"==n?r.$from:r.$to,j(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=K(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=l(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>(o.bottom-r.top)*2:o.bottom-r.bottom>(r.bottom-o.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=o==r.parent.content.size,s=e.domSelection();return s?X.test(r.parent.textContent)&&s.modify?j(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:d}=e.domSelectionRange(),p=h&&!c.contains(1==h.nodeType?h:h.parentNode)||t==h&&o==d;try{s.collapse(i,l),t&&(t!=i||o!=l)&&s.extend&&s.extend(t,o)}catch(e){}return null!=a&&(s.caretBidiLevel=a),p}):"left"==n||"backward"==n?!o:i:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return ta(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ta(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return eL(this,e)}destroy(){if(this.docView){for(let e in this.input.mouseDown&&this.input.mouseDown.done(),this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,a()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!e3(this,e)&&eG[e.type]&&(this.editable||!(e.type in eZ))&&eG[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?D&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return tz(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?tz(e,n):null}
1(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function tH(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[ty.node(0,e.state.doc.content.size,t)]}function tK(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:ty.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function tq(e){return!e.someProp("editable",t=>!1===t(e.state))}function t_(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function tj(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}tJ.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},e.s(["G",0,ty,"q",0,tb,"j",0,tJ])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.