"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[445],{878:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]])},9201:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]])},4113:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])},9021:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]])},8701:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]])},2921:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]])},3243:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]])},5814:(t,e,n)=>{n.d(e,{A:()=>r});let r=(0,n(7401).A)("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]])},3027:(t,e,n)=>{var r=n(2115),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=r.useState,o=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function h(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=s({inst:{value:n,getSnapshot:e}}),i=r[0].inst,c=r[1];return l(function(){i.value=n,i.getSnapshot=e,h(i)&&c({inst:i})},[t,n,e]),o(function(){return h(i)&&c({inst:i}),t(function(){h(i)&&c({inst:i})})},[t]),a(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},4564:(t,e,n)=>{var r=n(2115),i=n(4236),s="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=i.useSyncExternalStore,l=r.useRef,a=r.useEffect,h=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var p=l(null);if(null===p.current){var d={hasValue:!1,value:null};p.current=d}else d=p.current;var u=o(t,(p=h(function(){function t(t){if(!a){if(a=!0,o=t,t=r(t),void 0!==i&&d.hasValue){var e=d.value;if(i(e,t))return l=e}return l=t}if(e=l,s(o,t))return e;var n=r(t);return void 0!==i&&i(e,n)?(o=t,e):(o=t,l=n)}var o,l,a=!1,h=void 0===n?null:n;return[function(){return t(e())},null===h?void 0:function(){return t(h())}]},[e,n,r,i]))[0],p[1]);return a(function(){d.hasValue=!0,d.value=u},[u]),c(u),u}},4236:(t,e,n)=>{t.exports=n(3027)},8010:(t,e,n)=>{t.exports=n(4564)},53:(t,e,n)=>{n.d(e,{N_:()=>tU,Ay:()=>tW});var r=n(9346);let i="numeric",s="ascii",o="alpha",l="asciinumeric",a="alphanumeric",h="domain",c="emoji",p="whitespace";function d(t,e,n){for(let r in e[i]&&(e[l]=!0,e[a]=!0),e[s]&&(e[l]=!0,e[o]=!0),e[l]&&(e[a]=!0),e[o]&&(e[a]=!0),e[a]&&(e[h]=!0),e[c]&&(e[h]=!0),e){let e=(r in n||(n[r]=[]),n[r]);0>e.indexOf(t)&&e.push(t)}}function u(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}u.groups={},u.prototype={accepts(){return!!this.t},go(t){let e=this.j[t];if(e)return e;for(let e=0;e=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&d(e,n,r)),i.t=e),this.j[t]=i,i}};let f=(t,e,n,r,i)=>t.ta(e,n,r,i),m=(t,e,n,r,i)=>t.tr(e,n,r,i),g=(t,e,n,r,i)=>t.ts(e,n,r,i),y=(t,e,n,r,i)=>t.tt(e,n,r,i),k="WORD",w="UWORD",v="ASCIINUMERICAL",b="ALPHANUMERICAL",x="LOCALHOST",S="UTLD",C="SCHEME",M="SLASH_SCHEME",T="OPENBRACE",A="CLOSEBRACE",E="OPENBRACKET",O="CLOSEBRACKET",I="OPENPAREN",N="CLOSEPAREN",L="OPENANGLEBRACKET",R="CLOSEANGLEBRACKET",z="FULLWIDTHLEFTPAREN",j="FULLWIDTHRIGHTPAREN",F="LEFTCORNERBRACKET",$="RIGHTCORNERBRACKET",P="LEFTWHITECORNERBRACKET",D="RIGHTWHITECORNERBRACKET",B="FULLWIDTHLESSTHAN",J="FULLWIDTHGREATERTHAN",H="AMPERSAND",K="APOSTROPHE",_="ASTERISK",U="BACKSLASH",W="BACKTICK",V="CARET",q="COLON",G="COMMA",Y="DOLLAR",X="EQUALS",Q="EXCLAMATION",Z="HYPHEN",tt="PERCENT",te="PIPE",tn="PLUS",tr="POUND",ti="QUERY",ts="QUOTE",to="FULLWIDTHMIDDLEDOT",tl="SEMI",ta="SLASH",th="TILDE",tc="UNDERSCORE",tp="EMOJI";var td=Object.freeze({__proto__:null,ALPHANUMERICAL:b,AMPERSAND:H,APOSTROPHE:K,ASCIINUMERICAL:v,ASTERISK:_,AT:"AT",BACKSLASH:U,BACKTICK:W,CARET:V,CLOSEANGLEBRACKET:R,CLOSEBRACE:A,CLOSEBRACKET:O,CLOSEPAREN:N,COLON:q,COMMA:G,DOLLAR:Y,DOT:"DOT",EMOJI:tp,EQUALS:X,EXCLAMATION:Q,FULLWIDTHGREATERTHAN:J,FULLWIDTHLEFTPAREN:z,FULLWIDTHLESSTHAN:B,FULLWIDTHMIDDLEDOT:to,FULLWIDTHRIGHTPAREN:j,HYPHEN:Z,LEFTCORNERBRACKET:F,LEFTWHITECORNERBRACKET:P,LOCALHOST:x,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:L,OPENBRACE:T,OPENBRACKET:E,OPENPAREN:I,PERCENT:tt,PIPE:te,PLUS:tn,POUND:tr,QUERY:ti,QUOTE:ts,RIGHTCORNERBRACKET:$,RIGHTWHITECORNERBRACKET:D,SCHEME:C,SEMI:tl,SLASH:ta,SLASH_SCHEME:M,SYM:"SYM",TILDE:th,TLD:"TLD",UNDERSCORE:tc,UTLD:S,UWORD:w,WORD:k,WS:"WS"});let tu=/[a-z]/,tf=/\p{L}/u,tm=/\p{Emoji}/u,tg=/\d/,ty=/\s/,tk=null,tw=null;function tv(t,e){let n=function(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}(e.replace(/[A-Z]/g,t=>t.toLowerCase())),r=n.length,i=[],s=0,o=0;for(;o=0&&(p+=n[o].length,d++),h+=n[o].length,s+=n[o].length,o++;s-=p,o-=d,h-=p,i.push({t:c.t,v:e.slice(s-h,s),s:s-h,e:s})}return i}function tb(t,e,n,r,i){let s;let o=e.length;for(let n=0;n=0;)i++;if(i>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+i),10);e>0;e--)n.pop();r+=i}else n.push(t[r]),r++}return e}let tS={defaultProtocol:"http",events:null,format:tM,formatHref:tM,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function tC(t,e=null){let n=Object.assign({},tS);t&&(n=Object.assign(n,t instanceof tC?t.o:t));let r=n.ignoreTags,i=[];for(let t=0;tt,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=null!=e,i=this.o[t];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:tS[t])&&r&&(i=i(e,n)):"function"==typeof i&&r&&(i=i(e,n.t,n))),i},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},tT.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=tS.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",e,this),r=t.get("tagName",e,this),i=this.toFormattedString(t),s={},o=t.get("className",e,this),l=t.get("target",e,this),a=t.get("rel",e,this),h=t.getObj("attributes",e,this),c=t.getObj("events",e,this);return s.href=n,o&&(s.class=o),l&&(s.target=l),a&&(s.rel=a),h&&Object.assign(s,h),{tagName:r,attributes:s,content:i,eventListeners:c}}};let tE=tA("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),tO=tA("text"),tI=tA("nl"),tN=tA("url",{isLink:!0,toHref(t=tS.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==x&&t[1].t===q}}),tL=t=>new u(t);function tR(t,e,n){let r=n[0].s,i=n[n.length-1].e;return new t(e.slice(r,i),n)}let tz="undefined"!=typeof console&&console&&console.warn||(()=>{}),tj={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tF(t,e=!1){if(tj.initialized&&tz(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" 3. "-" cannot repeat`);tj.customSchemes.push([t,e])}function t$(t){return tj.initialized||function(){tj.scanner=function(t=[]){let e={};u.groups=e;let n=new u;null==tk&&(tk=tx("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==tw&&(tw=tx("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),y(n,"'",K),y(n,"{",T),y(n,"}",A),y(n,"[",E),y(n,"]",O),y(n,"(",I),y(n,")",N),y(n,"<",L),y(n,">",R),y(n,"(",z),y(n,")",j),y(n,"「",F),y(n,"」",$),y(n,"『",P),y(n,"』",D),y(n,"<",B),y(n,">",J),y(n,"&",H),y(n,"*",_),y(n,"@","AT"),y(n,"`",W),y(n,"^",V),y(n,":",q),y(n,",",G),y(n,"$",Y),y(n,".","DOT"),y(n,"=",X),y(n,"!",Q),y(n,"-",Z),y(n,"%",tt),y(n,"|",te),y(n,"+",tn),y(n,"#",tr),y(n,"?",ti),y(n,'"',ts),y(n,"/",ta),y(n,";",tl),y(n,"~",th),y(n,"_",tc),y(n,"\\",U),y(n,"・",to);let r=m(n,tg,"NUM",{[i]:!0});m(r,tg,r);let f=m(r,tu,v,{[l]:!0}),tv=m(r,tf,b,{[a]:!0}),tS=m(n,tu,k,{[s]:!0});m(tS,tg,f),m(tS,tu,tS),m(f,tg,f),m(f,tu,f);let tC=m(n,tf,w,{[o]:!0});m(tC,tu),m(tC,tg,tv),m(tC,tf,tC),m(tv,tg,tv),m(tv,tu),m(tv,tf,tv);let tM=y(n,"\n","NL",{[p]:!0}),tT=y(n,"\r","WS",{[p]:!0}),tA=m(n,ty,"WS",{[p]:!0});y(n,"",tA),y(tT,"\n",tM),y(tT,"",tA),m(tT,ty,tA),y(tA,"\r"),y(tA,"\n"),m(tA,ty,tA),y(tA,"",tA);let tE=m(n,tm,tp,{[c]:!0});y(tE,"#"),m(tE,tm,tE),y(tE,"️",tE);let tO=y(tE,"‍");y(tO,"#"),m(tO,tm,tE);let tI=[[tu,tS],[tg,f]],tN=[[tu,null],[tf,tC],[tg,tv]];for(let t=0;tt[0]>e[0]?1:-1);for(let e=0;e=0?o[h]=!0:tu.test(r)?tg.test(r)?o[l]=!0:o[s]=!0:o[i]=!0,g(n,r,r,o)}return g(n,"localhost",x,{ascii:!0}),n.jd=new u("SYM"),{start:n,tokens:Object.assign({groups:e},td)}}(tj.customSchemes);for(let t=0;t=0&&d++,i++,c++;if(d<0)(i-=c)0&&(s.push(tR(tO,e,o)),o=[]),i-=d,c-=d;let t=p.t,r=n.slice(i-c,i);s.push(tR(t,e,r))}}return o.length>0&&s.push(tR(tO,e,o)),s}(tj.parser.start,t,tv(tj.scanner.start,t))}function tP(t,e=null,n=null){if(e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new tC(n),i=t$(t),s=[];for(let t=0;t{let e="string"==typeof t?t:t.scheme;e&&n.push(e)}),!t||t.replace(tK,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var tU=r.CU.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if("string"==typeof t){tF(t);return}tF(t.scheme,t.optionalSlashes)})},onDestroy(){u.groups={},tj.scanner=null,tj.parser=null,tj.tokenQueue=[],tj.pluginQueue=[],tj.customSchemes=[],tj.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!t_(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{let e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;let r=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!!(e&&this.options.isAllowedUri(e,{defaultValidate:t=>!!t_(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!t_(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,r.KV)(this.options.HTMLAttributes,t),0]:["a",(0,r.KV)(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,i,s;let o=null!=(r=null==(n=t.attrs)?void 0:n.href)?r:"",l=null!=(s=null==(i=t.attrs)?void 0:i.title)?s:"",a=e.renderChildren(t);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!t_(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{let{href:n}=t||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:t=>!!t_(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,r.Zc)({find:t=>{let e=[];if(t){let{protocols:n,defaultProtocol:r}=this.options,i=tP(t).filter(t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!t_(t,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(t=>{this.options.shouldAutoLink(t.value)&&e.push({text:t.value,data:{href:t.href},index:t.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:null==(e=t.data)?void 0:e.href}}})]},addProseMirrorPlugins(){var t,e,n;let i=[],{protocols:s,defaultProtocol:o}=this.options;return this.options.autolink&&i.push((t={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:t=>this.options.isAllowedUri(t,{defaultValidate:t=>!!t_(t,s),protocols:s,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new tD.k_({key:new tD.hs("autolink"),appendTransaction:(e,n,i)=>{let s=e.some(t=>t.docChanged)&&!n.doc.eq(i.doc),o=e.some(t=>t.getMeta("preventAutolink"));if(!s||o)return;let{tr:l}=i,a=(0,r.T7)(n.doc,[...e]);if((0,r.FF)(a).forEach(({newRange:e})=>{let n,s;let o=(0,r.Nx)(i.doc,e,t=>t.isTextblock);if(o.length>1)n=o[0],s=i.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(o.length){let t=i.doc.textBetween(e.from,e.to," "," ");if(!tH.test(t))return;n=o[0],s=i.doc.textBetween(n.pos,e.to,void 0," ")}if(n&&s){let e=s.split(tJ).filter(Boolean);if(e.length<=0)return!1;let o=e[e.length-1],a=n.pos+s.lastIndexOf(o);if(!o)return!1;let h=t$(o).map(e=>e.toObject(t.defaultProtocol));if(!(1===h.length?h[0].isLink:3===h.length&&!!h[1].isLink&&["()","[]"].includes(h[0].value+h[2].value)))return!1;h.filter(t=>t.isLink).map(t=>({...t,from:a+t.start+1,to:a+t.end+1})).filter(t=>!i.schema.marks.code||!i.doc.rangeHasMark(t.from,t.to,i.schema.marks.code)).filter(e=>t.validate(e.value)).filter(e=>t.shouldAutoLink(e.value)).forEach(e=>{(0,r.hO)(e.from,e.to,i.doc).some(e=>e.mark.type===t.type)||l.addMark(e.from,e.to,t.type.create({href:e.href}))})}}),l.steps.length)return l}}))),i.push((e={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new tD.k_({key:new tD.hs("handleClickLink"),props:{handleClick:(t,n,i)=>{var s,o;if(0!==i.button||!t.editable)return!1;let l=null;if(i.target instanceof HTMLAnchorElement)l=i.target;else{let t=i.target;if(!t)return!1;let n=e.editor.view.dom;(l=t.closest("a"))&&!n.contains(l)&&(l=null)}if(!l)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=(0,r.gu)(t.state,e.type.name),i=null!=(s=l.href)?s:n.href,h=null!=(o=l.target)?o:n.target;i&&(window.open(i,h),a=!0)}return a}}}))),this.options.linkOnPaste&&i.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new tD.k_({key:new tD.hs("handlePasteLink"),props:{handlePaste:(t,e,r)=>{let{shouldAutoLink:i}=n,{state:s}=t,{selection:o}=s,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(t=>{a+=t.textContent});let h=tP(a,{defaultProtocol:n.defaultProtocol}).find(t=>t.isLink&&t.value===a);return!!(a&&h&&(void 0===i||i(h.value)))&&n.editor.commands.setMark(n.type,{href:h.href})}}}))),i}}),tW=tU},9372:(t,e,n)=>{n.d(e,{$Z:()=>H,hG:()=>q});var r=n(2115),i=n(7650),s=n(4236),o=n(5155),l=n(9346);let{getOwnPropertyNames:a,getOwnPropertySymbols:h}=Object,{hasOwnProperty:c}=Object.prototype;function p(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function d(t){return function(e,n,r){if(!e||!n||"object"!=typeof e||"object"!=typeof n)return t(e,n,r);let{cache:i}=r,s=i.get(e),o=i.get(n);if(s&&o)return s===n&&o===e;i.set(e,n),i.set(n,e);let l=t(e,n,r);return i.delete(e),i.delete(n),l}}function u(t){return a(t).concat(h(t))}let f=Object.hasOwn||((t,e)=>c.call(t,e));function m(t,e){return t===e||!t&&!e&&t!=t&&e!=e}let{getOwnPropertyDescriptor:g,keys:y}=Object;function k(t,e){return t.byteLength===e.byteLength&&I(new Uint8Array(t),new Uint8Array(e))}function w(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function v(t,e){return t.byteLength===e.byteLength&&I(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function b(t,e){return m(t.getTime(),e.getTime())}function x(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function S(t,e){return t===e}function C(t,e,n){let r,i;let s=t.size;if(s!==e.size)return!1;if(!s)return!0;let o=Array(s),l=t.entries(),a=0;for(;(r=l.next())&&!r.done;){let s=e.entries(),l=!1,h=0;for(;(i=s.next())&&!i.done;){if(o[h]){h++;continue}let s=r.value,c=i.value;if(n.equals(s[0],c[0],a,h,t,e,n)&&n.equals(s[1],c[1],s[0],c[0],t,e,n)){l=o[h]=!0;break}h++}if(!l)return!1;a++}return!0}function M(t,e,n){let r=y(t),i=r.length;if(y(e).length!==i)return!1;for(;i-- >0;)if(!L(t,e,n,r[i]))return!1;return!0}function T(t,e,n){let r,i,s;let o=u(t),l=o.length;if(u(e).length!==l)return!1;for(;l-- >0;)if(!L(t,e,n,r=o[l])||(i=g(t,r),s=g(e,r),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable)))return!1;return!0}function A(t,e){return m(t.valueOf(),e.valueOf())}function E(t,e){return t.source===e.source&&t.flags===e.flags}function O(t,e,n){let r,i;let s=t.size;if(s!==e.size)return!1;if(!s)return!0;let o=Array(s),l=t.values();for(;(r=l.next())&&!r.done;){let s=e.values(),l=!1,a=0;for(;(i=s.next())&&!i.done;){if(!o[a]&&n.equals(r.value,i.value,r.value,i.value,t,e,n)){l=o[a]=!0;break}a++}if(!l)return!1}return!0}function I(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function N(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function L(t,e,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!t.$$typeof||!!e.$$typeof)||f(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}let R={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},z=Object.prototype.toString,j=F();function F(t={}){let{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,s=function({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:h,areRegExpsEqual:c,areSetsEqual:p,areTypedArraysEqual:d,areUrlsEqual:u,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;let k=typeof m;if(k!==typeof g)return!1;if("object"!==k)return"number"===k?l(m,g,y):"function"===k&&s(m,g,y);let w=m.constructor;if(w!==g.constructor)return!1;if(w===Object)return a(m,g,y);if(Array.isArray(m))return e(m,g,y);if(w===Date)return r(m,g,y);if(w===RegExp)return c(m,g,y);if(w===Map)return o(m,g,y);if(w===Set)return p(m,g,y);let v=z.call(m);if("[object Date]"===v)return r(m,g,y);if("[object RegExp]"===v)return c(m,g,y);if("[object Map]"===v)return o(m,g,y);if("[object Set]"===v)return p(m,g,y);if("[object Object]"===v)return"function"!=typeof m.then&&"function"!=typeof g.then&&a(m,g,y);if("[object URL]"===v)return u(m,g,y);if("[object Error]"===v)return i(m,g,y);if("[object Arguments]"===v)return a(m,g,y);if(R[v])return d(m,g,y);if("[object ArrayBuffer]"===v)return t(m,g,y);if("[object DataView]"===v)return n(m,g,y);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return h(m,g,y);if(f){let t=f[v];if(!t){let e=null!=m?m[Symbol.toStringTag]:void 0;e&&(t=f[e])}if(t)return t(m,g,y)}return!1}}(function({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:k,areArraysEqual:n?T:w,areDataViewsEqual:v,areDatesEqual:b,areErrorsEqual:x,areFunctionsEqual:S,areMapsEqual:n?p(C,T):C,areNumbersEqual:m,areObjectsEqual:n?T:M,arePrimitiveWrappersEqual:A,areRegExpsEqual:E,areSetsEqual:n?p(O,T):O,areTypedArraysEqual:n?p(I,T):I,areUrlsEqual:N,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){let t=d(r.areArraysEqual),e=d(r.areMapsEqual),n=d(r.areObjectsEqual),i=d(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:t,areMapsEqual:e,areObjectsEqual:n,areSetsEqual:i})}return r}(t)),o=n?n(s):function(t,e,n,r,i,o,l){return s(t,e,l)};return function({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(s,o){let{cache:l=t?new WeakMap:void 0,meta:a}=n();return e(s,o,{cache:l,equals:r,meta:a,strict:i})};if(t)return function(t,n){return e(t,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let s={cache:void 0,equals:r,meta:void 0,strict:i};return function(t,n){return e(t,n,s)}}({circular:e,comparator:s,createState:r,equals:o,strict:i})}F({strict:!0}),F({circular:!0}),F({circular:!0,strict:!0}),F({createInternalComparator:()=>m}),F({strict:!0,createInternalComparator:()=>m}),F({circular:!0,createInternalComparator:()=>m}),F({circular:!0,createInternalComparator:()=>m,strict:!0});var $=n(8010),P=(...t)=>e=>{t.forEach(t=>{"function"==typeof t?t(e):t&&(t.current=e)})},D=({contentComponent:t})=>{let e=(0,s.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot);return(0,o.jsx)(o.Fragment,{children:Object.values(e)})},B=class extends r.Component{constructor(t){var e;super(t),this.editorContentRef=r.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(e=t.editor)?void 0:e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;let e=this.props.editor;if(e&&!e.isDestroyed&&(null==(t=e.view.dom)?void 0:t.parentNode)){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=function(){let t=new Set,e={};return{subscribe:e=>(t.add(e),()=>{t.delete(e)}),getSnapshot:()=>e,getServerSnapshot:()=>e,setRenderer(n,r){e={...e,[n]:i.createPortal(r.reactElement,r.element,n)},t.forEach(t=>t())},removeRenderer(n){let r={...e};delete r[n],e=r,t.forEach(t=>t())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(t=>t.hasContentComponentInitialized?t:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;let e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!(null==(t=e.view.dom)?void 0:t.parentNode))return;let n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){let{editor:t,innerRef:e,...n}=this.props;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:P(e,this.editorContentRef),...n}),(null==t?void 0:t.contentComponent)&&(0,o.jsx)(D,{contentComponent:t.contentComponent})]})}},J=(0,r.forwardRef)((t,e)=>{let n=r.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[t.editor]);return r.createElement(B,{key:n,innerRef:e,...t})}),H=r.memo(J),K="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,_=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let t=()=>{this.transactionNumber+=1,this.subscribers.forEach(t=>t())},e=this.editor;return e.on("transaction",t),()=>{e.off("transaction",t)}}}},U="undefined"==typeof window,W=U||!!("undefined"!=typeof window&&window.next),V=class t{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?U||W?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){let t={...this.options.current,onBeforeCreate:(...t)=>{var e,n;return null==(n=(e=this.options.current).onBeforeCreate)?void 0:n.call(e,...t)},onBlur:(...t)=>{var e,n;return null==(n=(e=this.options.current).onBlur)?void 0:n.call(e,...t)},onCreate:(...t)=>{var e,n;return null==(n=(e=this.options.current).onCreate)?void 0:n.call(e,...t)},onDestroy:(...t)=>{var e,n;return null==(n=(e=this.options.current).onDestroy)?void 0:n.call(e,...t)},onFocus:(...t)=>{var e,n;return null==(n=(e=this.options.current).onFocus)?void 0:n.call(e,...t)},onSelectionUpdate:(...t)=>{var e,n;return null==(n=(e=this.options.current).onSelectionUpdate)?void 0:n.call(e,...t)},onTransaction:(...t)=>{var e,n;return null==(n=(e=this.options.current).onTransaction)?void 0:n.call(e,...t)},onUpdate:(...t)=>{var e,n;return null==(n=(e=this.options.current).onUpdate)?void 0:n.call(e,...t)},onContentError:(...t)=>{var e,n;return null==(n=(e=this.options.current).onContentError)?void 0:n.call(e,...t)},onDrop:(...t)=>{var e,n;return null==(n=(e=this.options.current).onDrop)?void 0:n.call(e,...t)},onPaste:(...t)=>{var e,n;return null==(n=(e=this.options.current).onPaste)?void 0:n.call(e,...t)},onDelete:(...t)=>{var e,n;return null==(n=(e=this.options.current).onDelete)?void 0:n.call(e,...t)}};return new l.KE(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,e){return Object.keys(t).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&t.extensions&&e.extensions?t.extensions.length===e.extensions.length&&t.extensions.every((t,n)=>{var r;return t===(null==(r=e.extensions)?void 0:r[n])}):t[n]===e[n]))}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?t.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((e,n)=>e===t[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){let t=this.instanceId,e=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){e&&e.setOptions(this.options.current);return}e&&!e.isDestroyed&&(e.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function q(t={},e=[]){let n=(0,r.useRef)(t);n.current=t;let[i]=(0,r.useState)(()=>new V(n)),o=(0,s.useSyncExternalStore)(i.subscribe,i.getEditor,i.getServerSnapshot);return(0,r.useDebugValue)(o),(0,r.useEffect)(i.onRender(e)),function(t){var e;let[n]=(0,r.useState)(()=>new _(t.editor)),i=(0,$.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,null!=(e=t.equalityFn)?e:j);K(()=>n.watch(t.editor),[t.editor,n]),(0,r.useDebugValue)(i)}({editor:o,selector:({transactionNumber:e})=>!1===t.shouldRerenderOnTransaction||void 0===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===e?0:e+1}),o}var G=(0,r.createContext)({editor:null}),Y=(G.Consumer,(0,r.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}})),X=()=>(0,r.useContext)(Y);function Q(t){return!!("function"==typeof t&&t.prototype&&t.prototype.isReactComponent)}function Z(t){return!!("object"==typeof t&&t.$$typeof&&("Symbol(react.forward_ref)"===t.$$typeof.toString()||"react.forward_ref"===t.$$typeof.description))}r.forwardRef((t,e)=>{let{onDragStart:n}=X(),r=t.as||"div";return(0,o.jsx)(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})}),r.createContext({markViewContentRef:()=>{}});var tt=(l.Db,l.Yv,(0,r.createContext)({get editor(){throw Error("useTiptap must be used within a provider")}}));tt.displayName="TiptapContext";var te=()=>(0,r.useContext)(tt);function tn({editor:t,instance:e,children:n}){let i=null!=t?t:e;if(!i)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let s=(0,r.useMemo)(()=>({editor:i}),[i]),l=(0,r.useMemo)(()=>({editor:i}),[i]);return(0,o.jsx)(G.Provider,{value:l,children:(0,o.jsx)(tt.Provider,{value:s,children:n})})}function tr({...t}){let{editor:e}=te();return(0,o.jsx)(H,{editor:e,...t})}tn.displayName="Tiptap",tr.displayName="Tiptap.Content",Object.assign(tn,{Content:tr})},9448:(t,e,n)=>{n.d(e,{A:()=>tH});var r=n(9346),i=(t,e)=>{if("slot"===t)return 0;if(t instanceof Function)return t(e);let{children:n,...r}=null!=e?e:{};if("svg"===t)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},s=/^\s*>\s$/,o=r.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return i("blockquote",{...(0,r.KV)(this.options.HTMLAttributes,t),children:i("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";let n=[];return t.content.forEach(t=>{let r=e.renderChildren([t]).split("\n").map(t=>""===t.trim()?">":`> ${t}`);n.push(r.join("\n"))}),n.join(` > `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,r.tG)({find:s,type:this.type})]}}),l=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,a=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,h=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,c=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,p=r.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return i("strong",{...(0,r.KV)(this.options.HTMLAttributes,t),children:i("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,r.OX)({find:l,type:this.type}),(0,r.OX)({find:h,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:a,type:this.type}),(0,r.Zc)({find:c,type:this.type})]}}),d=/(^|[^`])`([^`]+)`(?!`)$/,u=/(^|[^`])`([^`]+)`(?!`)/g,f=r.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",(0,r.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,r.OX)({find:d,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:u,type:this.type})]}}),m=n(5526),g=/^```([a-z]+)?[\s\n]$/,y=/^~~~([a-z]+)?[\s\n]$/,k=r.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;return n&&[...(null==(e=t.firstElementChild)?void 0:e.classList)||[]].filter(t=>t.startsWith(n)).map(t=>t.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",(0,r.KV)(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return(null==(n=t.raw)?void 0:n.startsWith("```"))===!1&&"indented"!==t.codeBlockStyle?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r=(null==(n=t.attrs)?void 0:n.language)||"";return t.content?[`\`\`\`${r}`,e.renderChildren(t.content),"```"].join("\n"):`\`\`\`${r} \`\`\``},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!!t&&e.parent.type.name===this.name&&(!!n||!e.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=null!=(e=this.options.tabSize)?e:4,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;let l=" ".repeat(n);return o?t.commands.insertContent(l):t.commands.command(({tr:t})=>{let{from:e,to:n}=i,s=r.doc.textBetween(e,n,"\n","\n").split("\n").map(t=>l+t).join("\n");return t.replaceWith(e,n,r.schema.text(s)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=null!=(e=this.options.tabSize)?e:4,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type===this.type&&(o?t.commands.command(({tr:t})=>{var e;let{pos:i}=s,o=s.start(),l=s.end(),a=r.doc.textBetween(o,l,"\n","\n").split("\n"),h=0,c=0,p=i-o;for(let t=0;t=p){h=t;break}c+=a[t].length+1}let d=Math.min(((null==(e=a[h].match(/^ */))?void 0:e[0])||"").length,n);if(0===d)return!0;let u=o;for(let t=0;t{let{from:e,to:s}=i,o=r.doc.textBetween(e,s,"\n","\n").split("\n").map(t=>{var e;let r=Math.min(((null==(e=t.match(/^ */))?void 0:e[0])||"").length,n);return t.slice(r)}).join("\n");return t.replaceWith(e,s,r.schema.text(o)),!0}))},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith("\n\n");return!!s&&!!o&&t.chain().command(({tr:t})=>(t.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return void 0!==o&&(r.nodeAt(o)?t.commands.command(({tr:t})=>(t.setSelection(m.LN.near(r.resolve(o))),!0)):t.commands.exitCode())}}},addInputRules(){return[(0,r.JJ)({find:g,type:this.type,getAttributes:t=>({language:t[1]})}),(0,r.JJ)({find:y,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new m.k_({key:new m.hs("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=null==i?void 0:i.mode;if(!n||!s)return!1;let{tr:o,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,"\n"));return o.replaceSelectionWith(this.type.create({language:s},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(m.U3.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),w=r.bP.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n\n"):""}),v=r.bP.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",(0,r.KV)(this.options.HTMLAttributes,t)]},renderText:()=>"\n",renderMarkdown:()=>` `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:i}=n;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:o}=r.extensionManager,l=i||t.$to.parentOffset&&t.$from.marks();return e().insertContent({type:this.name}).command(({tr:t,dispatch:e})=>{if(e&&l&&s){let e=l.filter(t=>o.includes(t.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),b=r.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){let n=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0];return[`h${n}`,(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;let r=(null==(n=t.attrs)?void 0:n.level)?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>(0,r.JJ)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),x=r.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",(0,r.KV)(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!(0,r.AB)(e,e.schema.nodes[this.name]))return!1;let{selection:n}=e,{$to:i}=n,s=t();return(0,r.BQ)(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:t,tr:e,dispatch:n})=>{if(n){let{$to:n}=e.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?e.setSelection(m.U3.create(e.doc,n.pos+1)):n.nodeAfter.isBlock?e.setSelection(m.nh.create(e.doc,n.pos)):e.setSelection(m.U3.create(e.doc,n.pos));else{let i=t.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,s=null==i?void 0:i.create();s&&(e.insert(r,s),e.setSelection(m.U3.create(e.doc,r+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,r.jT)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),S=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,C=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,M=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,T=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,A=r.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",(0,r.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,r.OX)({find:S,type:this.type}),(0,r.OX)({find:M,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:C,type:this.type}),(0,r.Zc)({find:T,type:this.type})]}}),E=n(53),O=Object.defineProperty,I="textStyle",N=/^\s*([-+*])\s$/,L=r.bP.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",(0,r.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>"list"!==t.type||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(I)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=(0,r.tG)({find:N,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.tG)({find:N,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(I),editor:this.editor})),[t]}}),R=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,r.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if("list_item"!==t.type)return[];let n=[];if(t.tokens&&t.tokens.length>0){if(t.tokens.some(t=>"paragraph"===t.type))n=e.parseChildren(t.tokens);else{let r=t.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(r.tokens)}],t.tokens.length>1){let r=t.tokens.slice(1),i=e.parseChildren(r);n.push(...i)}}else n=e.parseChildren(t.tokens)}}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>(0,r.kj)(t,e,t=>{var e,n;if("bulletList"===t.parentType)return"- ";if("orderedList"===t.parentType){let r=(null==(n=null==(e=t.meta)?void 0:e.parentAttrs)?void 0:n.start)||1;return`${r+t.index}. `}return"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((t,e)=>{for(var n in e)O(t,n,{get:e[n],enumerable:!0})})({},{findListItemPos:()=>z,getNextListDepth:()=>j,handleBackspace:()=>D,handleDelete:()=>H,hasListBefore:()=>F,hasListItemAfter:()=>K,hasListItemBefore:()=>$,listItemHasSubList:()=>P,nextListIsDeeper:()=>B,nextListIsHigher:()=>J});var z=(t,e)=>{let{$from:n}=e.selection,i=(0,r.Pg)(t,e.schema),s=n.depth,o=n.pos,l=null;for(;s>0&&null===l;)n.node(s).type===i?l=s:(s-=1,o-=1);return null===l?null:{$pos:e.doc.resolve(o),depth:l}},j=(t,e)=>{let n=z(t,e);if(!n)return!1;let[,i]=(0,r.fl)(e,t,n.$pos.pos+4);return i},F=(t,e,n)=>{let{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!!(s&&n.includes(s.type.name))},$=(t,e)=>{var n;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===t},P=(t,e,n)=>{if(!n)return!1;let i=(0,r.Pg)(t,e.schema),s=!1;return n.descendants(t=>{t.type===i&&(s=!0)}),s},D=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!(0,r.rU)(t.state,e)&&F(t.state,e,n)){let{$anchor:n}=t.state.selection,r=t.state.doc.resolve(n.before()-1),i=[];r.node().descendants((t,n)=>{t.type.name===e&&i.push({node:t,pos:n})});let s=i.at(-1);if(!s)return!1;let o=t.state.doc.resolve(r.start()+s.pos+1);return t.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!(0,r.rU)(t.state,e)||!(0,r.J_)(t.state))return!1;let i=z(e,t.state);if(!i)return!1;let s=t.state.doc.resolve(i.$pos.pos-2).node(i.depth),o=P(e,t.state,s);return $(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},B=(t,e)=>{let n=j(t,e),r=z(t,e);return!!r&&!!n&&n>r.depth},J=(t,e)=>{let n=j(t,e),r=z(t,e);return!!r&&!!n&&n{if(!(0,r.rU)(t.state,e)||!(0,r.QN)(t.state,e))return!1;let{selection:n}=t.state,{$from:i,$to:s}=n;return!(!n.empty&&i.sameParent(s))&&(B(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():J(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},K=(t,e)=>{var n;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===t},_=r.YY.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==t.state.schema.nodes[n]&&H(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==t.state.schema.nodes[n]&&H(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==t.state.schema.nodes[n]&&D(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==t.state.schema.nodes[n]&&D(t,n,r)&&(e=!0)}),e}}}}),U=/^(\s*)(\d+)\.\s+(.*)$/,W=/^\s/,V="textStyle",q=/^(\d+)\.\s$/,G=r.bP.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return 1===e?["ol",(0,r.KV)(this.options.HTMLAttributes,n),0]:["ol",(0,r.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if("list"!==t.type||!t.ordered)return[];let n=t.start||1,r=t.items?function(t,e){return t.map(t=>{if("list_item"!==t.type)return e.parseChildren([t])[0];let n=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(t=>{if("paragraph"===t.type||"list"===t.type||"blockquote"===t.type||"code"===t.type)n.push(...e.parseChildren([t]));else if("text"===t.type&&t.tokens){let r=e.parseChildren([t]);n.push({type:"paragraph",content:r})}else{let r=e.parseChildren([t]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})}(t.items,e):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{let e=t.match(/^(\s*)(\d+)\.\s+/),n=null==e?void 0:e.index;return void 0!==n?n:-1},tokenize:(t,e,n)=>{var r;let i=t.split("\n"),[s,o]=function(t){let e=[],n=0,r=0;for(;nn;)u.push(e[d]),d+=1;if(u.length>0){let e=Math.min(...u.map(t=>t.indent)),n=t(u,e,r);c.push({type:"list",ordered:!0,start:u[0].number,items:n,raw:u.map(t=>t.raw).join("\n")})}s.push({type:"list_item",raw:l.raw,tokens:c}),o=d}else o+=1}return s}(s,0,n);if(0!==l.length)return{type:"list",ordered:!0,start:(null==(r=s[0])?void 0:r.number)||1,items:l,raw:i.slice(0,o).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(V)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=(0,r.tG)({find:q,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.tG)({find:q,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(V)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),Y=/^\s*(\[([( |x])?\])\s$/,X=r.bP.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return""===e||"true"===e},renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",(0,r.KV)(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;let i=(null==(n=t.attrs)?void 0:n.checked)?"x":" ",s=`- [${i}] `;return(0,r.kj)(t,e,s)},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:i})=>{let s=document.createElement("li"),o=document.createElement("label"),l=document.createElement("span"),a=document.createElement("input"),h=document.createElement("div"),c=t=>{var e,n;a.ariaLabel=(null==(n=null==(e=this.options.a11y)?void 0:e.checkboxLabel)?void 0:n.call(e,t,a.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`};c(t),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",t=>t.preventDefault()),a.addEventListener("change",e=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:r}=e.target;i.isEditable&&"function"==typeof n&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:t})=>{let e=n();if("number"!=typeof e)return!1;let i=t.doc.nodeAt(e);return t.setNodeMarkup(e,void 0,{...null==i?void 0:i.attrs,checked:r}),!0}).run(),i.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(t,r)||(a.checked=!a.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([t,e])=>{s.setAttribute(t,e)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,o.append(a,l),s.append(o,h),Object.entries(e).forEach(([t,e])=>{s.setAttribute(t,e)});let p=new Set(Object.keys(e));return{dom:s,contentDOM:h,update:t=>{if(t.type!==this.type)return!1;s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,c(t);let e=i.extensionManager.attributes,n=(0,r.zU)(t,e),o=new Set(Object.keys(n)),l=this.options.HTMLAttributes;return p.forEach(t=>{o.has(t)||(t in l?s.setAttribute(t,l[t]):s.removeAttribute(t))}),Object.entries(n).forEach(([t,e])=>{null==e?t in l?s.setAttribute(t,l[t]):s.removeAttribute(t):s.setAttribute(t,e)}),p=o,!0}}}},addInputRules(){return[(0,r.tG)({find:Y,type:this.type,getAttributes:t=>({checked:"x"===t[t.length-1]})})]}}),Q=r.bP.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",(0,r.KV)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;let n=null==(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:e.index;return void 0!==n?n:-1},tokenize(t,e,n){let i=t=>{let e=(0,r.Dd)(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:t=>({indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}),createToken:(t,e)=>({type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}),customNestedParser:i},n);return e?[{type:"taskList",raw:e.raw,items:e.items}]:n.blockTokens(t)},s=(0,r.Dd)(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:t=>({indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}),createToken:(t,e)=>({type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}),customNestedParser:i},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});r.YY.create({name:"listKit",addExtensions(){let t=[];return!1!==this.options.bulletList&&t.push(L.configure(this.options.bulletList)),!1!==this.options.listItem&&t.push(R.configure(this.options.listItem)),!1!==this.options.listKeymap&&t.push(_.configure(this.options.listKeymap)),!1!==this.options.orderedList&&t.push(G.configure(this.options.orderedList)),!1!==this.options.taskItem&&t.push(X.configure(this.options.taskItem)),!1!==this.options.taskList&&t.push(Q.configure(this.options.taskList)),t}});var Z=" ",tt=r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",(0,r.KV)(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{let n=t.tokens||[];if(1===n.length&&"image"===n[0].type)return e.parseChildren([n[0]]);let r=e.parseInline(n);return 1===r.length&&"text"===r[0].type&&(r[0].text===Z||"\xa0"===r[0].text)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e)=>{if(!t)return"";let n=Array.isArray(t.content)?t.content:[];return 0===n.length?Z:e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),te=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tn=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tr=r.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",(0,r.KV)(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,r.OX)({find:te,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:tn,type:this.type})]}}),ti=r.bP.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),ts=r.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",(0,r.KV)(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:(t,e)=>`++${e.renderChildren(t)}++`,markdownTokenizer:{name:"underline",level:"inline",start:t=>t.indexOf("++"),tokenize(t,e,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),to=n(2093);class tl{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,s=this.editorView.dom,o=s.getBoundingClientRect(),l=o.width/s.offsetWidth,a=o.height/s.offsetHeight;if(r){let t=n.nodeBefore,e=n.nodeAfter;if(t||e){let n=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(n){let r=n.getBoundingClientRect(),s=t?r.bottom:r.top;t&&e&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let o=this.width/2*a;i={left:r.left,right:r.right,top:s-o,bottom:s+o}}}}if(!i){let t=this.editorView.coordsAtPos(this.cursorPos),e=this.width/2*l;i={left:t.left-e,right:t.left+e,top:t.top,bottom:t.bottom}}let h=this.editorView.dom.offsetParent;if(!this.element&&(this.element=h.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),h&&(h!=document.body||"static"!=getComputedStyle(h).position)){let n=h.getBoundingClientRect(),r=n.width/h.offsetWidth,i=n.height/h.offsetHeight;t=n.left-h.scrollLeft*r,e=n.top-h.scrollTop*i}else t=-pageXOffset,e=-pageYOffset;this.element.style.left=(i.left-t)/l+"px",this.element.style.top=(i.top-e)/a+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,to.Um)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}var ta=n(7296),th=n(4936),tc=n(8836);class tp extends m.LN{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return tp.valid(n)?new tp(n):m.LN.near(n)}content(){return tc.Ji.empty}eq(t){return t instanceof tp&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new tp(t.resolve(e.pos))}getBookmark(){return new td(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||tu(t.type))return!0;if(t.inlineContent)return!1}}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||tu(t.type))return!0;if(t.inlineContent)return!1}}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&tp.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let s=t.node(n);if(e>0?t.indexAfter(n)0){i=s.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let o=t.doc.resolve(r);if(tp.valid(o))return o}for(;;){let s=e>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!m.nh.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue t}break}i=s,r+=e;let o=t.doc.resolve(r);if(tp.valid(o))return o}return null}}}tp.prototype.visible=!1,tp.findFrom=tp.findGapCursorFrom,m.LN.jsonID("gapcursor",tp);class td{constructor(t){this.pos=t}map(t){return new td(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return tp.valid(e)?new tp(e):m.LN.near(e)}}function tu(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}let tf=(0,th.K)({ArrowLeft:tm("horiz",-1),ArrowRight:tm("horiz",1),ArrowUp:tm("vert",-1),ArrowDown:tm("vert",1)});function tm(t,e){let n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let s=t.selection,o=e>0?s.$to:s.$from,l=s.empty;if(s instanceof m.U3){if(!i.endOfTextblock(n)||0==o.depth)return!1;l=!1,o=t.doc.resolve(e>0?o.after():o.before())}let a=tp.findGapCursorFrom(o,e,l);return!!a&&(r&&r(t.tr.setSelection(new tp(a))),!0)}}function tg(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!tp.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&m.nh.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new tp(r))),!0)}function ty(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof tp))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=tc.FK.empty;for(let t=r.length-1;t>=0;t--)i=tc.FK.from(r[t].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new tc.Ji(i,0,0));return s.setSelection(m.U3.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function tk(t){if(!(t.selection instanceof tp))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ta.zF.create(t.doc,[ta.NZ.widget(t.selection.head,e,{key:"gapcursor"})])}var tw=function(){};tw.prototype.append=function(t){return t.length?(t=tw.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},tw.prototype.prepend=function(t){return t.length?tw.from(t).append(this):this},tw.prototype.appendInner=function(t){return new tb(this,t)},tw.prototype.slice=function(t,e){return(void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e)?tw.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},tw.prototype.get=function(t){if(!(t<0)&&!(t>=this.length))return this.getInner(t)},tw.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},tw.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},tw.from=function(t){return t instanceof tw?t:t&&t.length?new tv(t):tw.empty};var tv=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(tw);tw.empty=new tv([]);var tb=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(tw);class tx{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){let n,r,i,s;if(0==this.eventCount)return null;let o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}e&&(r=(n=this.remapping(o,this.items.length)).maps.length);let l=t.tr,a=[],h=[];return this.items.forEach((t,e)=>{if(!t.step){n||(r=(n=this.remapping(o,e+1)).maps.length),r--,h.push(t);return}if(n){h.push(new tS(t.map));let e=t.step.map(n.slice(r)),i;e&&l.maybeStep(e).doc&&(i=l.mapping.maps[l.mapping.maps.length-1],a.push(new tS(i,void 0,void 0,a.length+h.length))),r--,i&&n.appendMap(i,r)}else l.maybeStep(t.step);if(t.selection)return i=n?t.selection.map(n.slice(r)):t.selection,s=new tx(this.items.slice(0,o).append(h.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:l,selection:i}}addTransform(t,e,n,r){var i,s;let o,l=[],a=this.eventCount,h=this.items,c=!r&&h.length?h.get(h.length-1):null;for(let n=0;ntM&&(i=h,s=p,i.forEach((t,e)=>{if(t.selection&&0==s--)return o=e,!1}),h=i.slice(o),a-=p),new tx(h.append(l),a)}remapping(t,e){let n=new to.X9;return this.items.forEach((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)},t,e),n}addMaps(t){return 0==this.eventCount?this:new tx(this.items.append(t.map(t=>new tS(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,s=t.steps.length,o=this.eventCount;this.items.forEach(t=>{t.selection&&o--},r);let l=e;this.items.forEach(e=>{let r=i.getMirror(--l);if(null==r)return;s=Math.min(s,r);let a=i.maps[r];if(e.step){let s=t.steps[r].invert(t.docs[r]),h=e.selection&&e.selection.map(i.slice(l+1,r));h&&o++,n.push(new tS(a,s,h))}else n.push(new tS(a))},r);let a=[];for(let t=e;t500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let t=0;return this.items.forEach(e=>{!e.step&&t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach((s,o)=>{if(o>=t)r.push(s),s.selection&&i++;else if(s.step){let t=s.step.map(e.slice(n)),o=t&&t.getMap();if(n--,o&&e.appendMap(o,n),t){let l=s.selection&&s.selection.map(e.slice(n));l&&i++;let a=new tS(o.invert(),t,l),h,c=r.length-1;(h=r.length&&r[c].merge(a))?r[c]=h:r.push(a)}}else s.map&&n--},this.items.length,0),new tx(tw.from(r.reverse()),i)}}tx.empty=new tx(tw.empty,0);class tS{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new tS(e.getMap().invert(),e,this.selection)}}}class tC{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let tM=20;function tT(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach((t,n,r,i)=>e.push(r,i));return e}function tA(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=tN.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let s=function(t,e,n){let r=tI(e),i=tN.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),a=new tC(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(tN,{redo:n,historyState:a})}(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}let tz=tR(!1,!0),tj=tR(!0,!0);tR(!1,!1),tR(!0,!1),r.YY.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(t=>""!==t).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=t=>{let e=(null==t?void 0:t.node)||this.editor.state.doc;if("textSize"===((null==t?void 0:t.mode)||this.options.mode)){let t=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(t)}return e.nodeSize},this.storage.words=t=>{let e=(null==t?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new m.k_({key:new m.hs("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;let i=this.options.limit;if(null==i||0===i){t=!0;return}let s=this.storage.characters({node:r.doc});if(s>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let e=r.tr.deleteRange(0,s-i);return t=!0,e}t=!0},filterTransaction:(t,e)=>{let n=this.options.limit;if(!t.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:e.doc}),i=this.storage.characters({node:t.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!t.getMeta("paste"))return!1;let s=t.selection.$head.pos;return t.deleteRange(s-(i-n),s),!(this.storage.characters({node:t.doc})>n)}})]}});var tF=r.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(t={}){return new m.k_({view:e=>new tl(e,t)})}(this.options)]}});r.YY.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new m.k_({key:new m.hs("focus"),props:{decorations:({doc:t,selection:e})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return ta.zF.create(t,[]);let o=0;"deepest"===this.options.mode&&t.descendants((t,e)=>{if(!t.isText){if(!(i>=e&&i<=e+t.nodeSize-1))return!1;o+=1}});let l=0;return t.descendants((t,e)=>!t.isText&&!!(i>=e&&i<=e+t.nodeSize-1)&&((l+=1,"deepest"===this.options.mode&&o-l>0||"shallowest"===this.options.mode&&l>1)?"deepest"===this.options.mode:void s.push(ta.NZ.node(e,e+t.nodeSize,{class:this.options.className})))),ta.zF.create(t,s)}}})]}});var t$=r.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new m.k_({props:{decorations:tk,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&tp.valid(n)?new tp(n):null,handleClick:tg,handleKeyDown:tf,handleDOMEvents:{beforeinput:ty}}})],extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!=(e=(0,r.gk)((0,r.iI)(t,"allowGapCursor",n)))?e:null}}}),tP="placeholder";function tD({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(null==e?void 0:e.type)===t}r.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:tP,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){let t=this.options.dataAttribute?`data-${this.options.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${tP}`;return[new m.k_({key:new m.hs("placeholder"),props:{decorations:({doc:e,selection:n})=>{let i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:s}=n,o=[];if(!i)return null;let l=this.editor.isEmpty;return e.descendants((e,n)=>{let i=s>=n&&s<=n+e.nodeSize,a=!e.isLeaf&&(0,r.Op)(e);if((i||!this.options.showOnlyCurrent)&&a){let r=[this.options.emptyNodeClass];l&&r.push(this.options.emptyEditorClass);let s=ta.NZ.node(n,n+e.nodeSize,{class:r.join(" "),[t]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:n,hasAnchor:i}):this.options.placeholder});o.push(s)}return this.options.includeChildren}),ta.zF.create(e,o)}}})]}}),r.YY.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:t,options:e}=this;return[new m.k_({key:new m.hs("selection"),props:{decorations:n=>n.selection.empty||t.isFocused||!t.isEditable||(0,r.BQ)(n.selection)||t.view.dragging?null:ta.zF.create(n.doc,[ta.NZ.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});var tB=r.YY.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var t;let e=new m.hs(this.name),n=this.options.node||(null==(t=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(n).includes(t.name));return[new m.k_({key:e,appendTransaction:(t,r,i)=>{let{doc:s,tr:o,schema:l}=i,a=e.getState(i),h=s.content.size,c=l.nodes[n];if(a)return o.insert(h,c.create())},state:{init:(t,e)=>!tD({node:e.tr.doc.lastChild,types:r}),apply:(t,e)=>!t.docChanged||t.getMeta("__uniqueIDTransaction")?e:!tD({node:t.doc.lastChild,types:r})}})]}}),tJ=r.YY.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>tz(t,e),redo:()=>({state:t,dispatch:e})=>tj(t,e)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new m.k_({key:tN,state:{init:()=>new tC(tx.empty,tx.empty,null,0,-1),apply:(e,n,r)=>(function(t,e,n,r){let i=n.getMeta(tN),s;if(i)return i.historyState;n.getMeta(tL)&&(t=new tC(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(o&&o.getMeta(tN))return o.getMeta(tN).redo?new tC(t.done.addTransform(n,void 0,r,tI(e)),t.undone,tT(n.mapping.maps),t.prevTime,t.prevComposition):new tC(t.done,t.undone.addTransform(n,void 0,r,tI(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))return(s=n.getMeta("rebased"))?new tC(t.done.rebased(n,s),t.undone.rebased(n,s),tA(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new tC(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),tA(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),s=0==t.prevTime||!o&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((t,r)=>{for(let i=0;i=e[i]&&(n=!0)}),n}(n,t.prevRanges)),l=o?tA(t.prevRanges,n.mapping):tT(n.mapping.maps);return new tC(t.done.addTransform(n,s?e.selection.getBookmark():void 0,r,tI(e)),tx.empty,l,n.time,null==i?t.prevComposition:i)}})(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?tz:"historyRedo"==n?tj:null;return!!r&&!!t.editable&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),tH=r.YY.create({name:"starterKit",addExtensions(){var t,e,n,r;let i=[];return!1!==this.options.bold&&i.push(p.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(o.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(L.configure(this.options.bulletList)),!1!==this.options.code&&i.push(f.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(k.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(w.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(tF.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(t$.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(v.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(b.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(tJ.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(x.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(A.configure(this.options.italic)),!1!==this.options.listItem&&i.push(R.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(_.configure(null==(t=this.options)?void 0:t.listKeymap)),!1!==this.options.link&&i.push(E.N_.configure(null==(e=this.options)?void 0:e.link)),!1!==this.options.orderedList&&i.push(G.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(tt.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(tr.configure(this.options.strike)),!1!==this.options.text&&i.push(ti.configure(this.options.text)),!1!==this.options.underline&&i.push(ts.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(tB.configure(null==(r=this.options)?void 0:r.trailingNode)),i}})},3221:(t,e,n)=>{n.d(e,{$f:()=>I,G2:()=>w,I$:()=>C,Im:()=>L,Qv:()=>a,Sd:()=>y,Z1:()=>M,_G:()=>c,_e:()=>u,bh:()=>v,eB:()=>h,eT:()=>g,ec:()=>N,hy:()=>A,ic:()=>o,iz:()=>T,pC:()=>x,yY:()=>b,y_:()=>R});var r=n(2093),i=n(8836),s=n(5526);let o=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function l(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("backward",t):!(n.parentOffset>0))?n:null}let a=(t,e,n)=>{let o=l(t,n);if(!o)return!1;let a=f(o);if(!a){let n=o.blockRange(),i=n&&(0,r.jP)(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let h=a.nodeBefore;if(E(t,a,e,-1))return!0;if(0==o.parent.content.size&&(d(h,"end")||s.nh.isSelectable(h)))for(let n=o.depth;;n--){let l=(0,r.$L)(t.doc,o.before(n),o.after(n),i.Ji.empty);if(l&&l.slice.size1)break}return!!h.isAtom&&a.depth==o.depth-1&&(e&&e(t.tr.delete(a.pos-h.nodeSize,a.pos).scrollIntoView()),!0)},h=(t,e,n)=>{let r=l(t,n);if(!r)return!1;let i=f(r);return!!i&&p(t,i,e)},c=(t,e,n)=>{let r=m(t,n);if(!r)return!1;let i=k(r);return!!i&&p(t,i,e)};function p(t,e,n){let o=e.nodeBefore,l=e.pos-1;for(;!o.isTextblock;l--){if(o.type.spec.isolating)return!1;let t=o.lastChild;if(!t)return!1;o=t}let a=e.nodeAfter,h=e.pos+1;for(;!a.isTextblock;h++){if(a.type.spec.isolating)return!1;let t=a.firstChild;if(!t)return!1;a=t}let c=(0,r.$L)(t.doc,l,h,i.Ji.empty);if(!c||c.from!=l||c instanceof r.Ln&&c.slice.size>=h-l)return!1;if(n){let e=t.tr.step(c);e.setSelection(s.U3.create(e.doc,l)),n(e.scrollIntoView())}return!0}function d(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let u=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=f(r)}let l=o&&o.nodeBefore;return!!(l&&s.nh.isSelectable(l))&&(e&&e(t.tr.setSelection(s.nh.create(t.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function f(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function m(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("forward",t):!(n.parentOffset{let o=m(t,n);if(!o)return!1;let l=k(o);if(!l)return!1;let a=l.nodeAfter;if(E(t,l,e,1))return!0;if(0==o.parent.content.size&&(d(a,"start")||s.nh.isSelectable(a))){let n=(0,r.$L)(t.doc,o.before(),o.after(),i.Ji.empty);if(n&&n.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,i=n instanceof s.nh,o;if(i){if(n.node.isTextblock||!(0,r.n9)(t.doc,n.from))return!1;o=n.from}else if(null==(o=(0,r.N0)(t.doc,n.from,-1)))return!1;if(e){let n=t.tr.join(o);i&&n.setSelection(s.nh.create(n.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(n.scrollIntoView())}return!0},v=(t,e)=>{let n=t.selection,i;if(n instanceof s.nh){if(n.node.isTextblock||!(0,r.n9)(t.doc,n.to))return!1;i=n.to}else if(null==(i=(0,r.N0)(t.doc,n.to,1)))return!1;return e&&e(t.tr.join(i).scrollIntoView()),!0},b=(t,e)=>{let{$from:n,$to:i}=t.selection,s=n.blockRange(i),o=s&&(0,r.jP)(s);return null!=o&&(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)},x=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!!(n.parent.type.spec.code&&n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function S(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),l=S(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,l.createAndFill());i.setSelection(s.LN.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0},M=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof s.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=S(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.zy)(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),s=i&&(0,r.jP)(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},A=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),e&&e(t.tr.setSelection(s.nh.create(t.doc,i))),!0)};function E(t,e,n,o){let l,a,h,c=e.nodeBefore,p=e.nodeAfter,u,f,m=c.type.spec.isolating||p.type.spec.isolating;if(!m&&(l=e.nodeBefore,a=e.nodeAfter,h=e.index(),l&&a&&l.type.compatibleContent(a.type)&&(!l.content.size&&e.parent.canReplace(h-1,h)?(n&&n(t.tr.delete(e.pos-l.nodeSize,e.pos).scrollIntoView()),!0):!!(e.parent.canReplace(h,h+1)&&(a.isTextblock||(0,r.n9)(t.doc,e.pos)))&&(n&&n(t.tr.join(e.pos).scrollIntoView()),!0))))return!0;let g=!m&&e.parent.canReplace(e.index(),e.index()+1);if(g&&(u=(f=c.contentMatchAt(c.childCount)).findWrapping(p.type))&&f.matchType(u[0]||p.type).validEnd){if(n){let s=e.pos+p.nodeSize,o=i.FK.empty;for(let t=u.length-1;t>=0;t--)o=i.FK.from(u[t].create(null,o));o=i.FK.from(c.copy(o));let l=t.tr.step(new r.Wg(e.pos-1,s,e.pos,s,new i.Ji(o,1,0),u.length,!0)),a=l.doc.resolve(s+2*u.length);a.nodeAfter&&a.nodeAfter.type==c.type&&(0,r.n9)(l.doc,a.pos)&&l.join(a.pos),n(l.scrollIntoView())}return!0}let y=p.type.spec.isolating||o>0&&m?null:s.LN.findFrom(e,1),k=y&&y.$from.blockRange(y.$to),w=k&&(0,r.jP)(k);if(null!=w&&w>=e.depth)return n&&n(t.tr.lift(k,w).scrollIntoView()),!0;if(g&&d(p,"start",!0)&&d(c,"end")){let s=c,o=[];for(;o.push(s),!s.isTextblock;)s=s.lastChild;let l=p,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(s.canReplace(s.childCount,s.childCount,l.content)){if(n){let s=i.FK.empty;for(let t=o.length-1;t>=0;t--)s=i.FK.from(o[t].copy(s));n(t.tr.step(new r.Wg(e.pos-o.length,e.pos+p.nodeSize,e.pos+a,e.pos+p.nodeSize-a,new i.Ji(s,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function O(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(e.tr.setSelection(s.U3.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}let I=O(-1),N=O(1);function L(t,e=null){return function(n,i){let{$from:s,$to:o}=n.selection,l=s.blockRange(o),a=l&&(0,r.oM)(l,t,e);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function R(t,e=null){return function(n,r){let i=!1;for(let r=0;r{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(t,e))){if(r.type==t)i=!0;else{let e=n.doc.resolve(s),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r{let{$from:n,$to:i}=t.selection;if(t.selection instanceof s.nh&&t.selection.node.isBlock)return!!(n.parentOffset&&(0,r.zy)(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],l,a,h=!1,c=!1;for(let t=n.depth;;t--){if(n.node(t).isBlock){let e;h=n.end(t)==n.pos+(n.depth-t),c=n.start(t)==n.pos-(n.depth-t),a=S(n.node(t-1).contentMatchAt(n.indexAfter(t-1))),o.unshift(e||(h&&a?{type:a}:null)),l=t;break}if(1==t)return!1;o.unshift(null)}let p=t.tr;(t.selection instanceof s.U3||t.selection instanceof s.i5)&&p.deleteSelection();let d=p.mapping.map(n.pos),u=(0,r.zy)(p.doc,d,o.length,o);if(u||(o[0]=a?{type:a}:null,u=(0,r.zy)(p.doc,d,o.length,o)),!u)return!1;if(p.split(d,o.length,o),!h&&c&&n.node(l).type!=a){let t=p.mapping.map(n.before(l)),e=p.doc.resolve(t);a&&n.node(l-1).canReplaceWith(e.index(),e.index()+1,a)&&p.setNodeMarkup(p.mapping.map(n.before(l)),a)}return e&&e(p.scrollIntoView()),!0}),"Mod-Enter":C,Backspace:j,"Mod-Backspace":j,"Shift-Backspace":j,Delete:F,"Mod-Delete":F,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new s.i5(t.doc))),!0)},P={"Ctrl-h":$.Backspace,"Alt-Backspace":$["Mod-Backspace"],"Ctrl-d":$.Delete,"Ctrl-Alt-Backspace":$["Mod-Delete"],"Alt-Delete":$["Mod-Delete"],"Alt-d":$["Mod-Delete"],"Ctrl-a":I,"Ctrl-e":N};for(let t in $)P[t]=$[t];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform()},4936:(t,e,n)=>{n.d(e,{K:()=>f,w:()=>u});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=0;l<10;l++)r[48+l]=r[96+l]=String(l);for(var l=1;l<=24;l++)r[l+111]="F"+l;for(var l=65;l<=90;l++)r[l]=String.fromCharCode(l+32),i[l]=String.fromCharCode(l);for(var a in r)i.hasOwnProperty(a)||(i[a]=r[a]);var h=n(5526);let c="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),p="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function d(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function u(t){return new h.k_({props:{handleKeyDown:f(t)}})}function f(t){let e=function(t){let e=Object.create(null);for(let n in t)e[function(t){let e,n,r,i,s=t.split(/-(?!$)/),o=s[s.length-1];"Space"==o&&(o=" ");for(let t=0;t{function r(t){this.content=t}n.d(e,{S4:()=>B,ZF:()=>G,FK:()=>i,CU:()=>a,sX:()=>$,bP:()=>S,u$:()=>b,vI:()=>h,Sj:()=>P,Ji:()=>c}),r.prototype={constructor:r,find:function(t){for(var e=0;e>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;et&&!1!==n(l,r+o,i||null,s)&&l.content.size){let i=o+1;l.nodesBetween(Math.max(0,t-i),Math.min(l.content.size,e-i),n,r+i)}o=a}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",s=!0;return this.nodesBetween(t,e,(o,l)=>{let a=o.isText?o.text.slice(Math.max(t,l)-l,e-l):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&n&&(s?s=!1:i+=n),i+=a},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),s=1);st)for(let i=0,s=0;st&&((se)&&(o=o.isText?o.cut(Math.max(0,t-s),Math.min(o.text.length,e-s)):o.cut(Math.max(0,t-s-1),Math.min(o.content.size,e-s-1))),n.push(o),r+=o.nodeSize),s=l}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),s=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,s)}addToStart(t){return new i([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,n=0;;e++){let r=n+this.child(e).nodeSize;if(r>=t){if(r==t)return o(e+1,r);return o(e,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank),e}}a.none=[];class h extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:s,offset:o}=e.findIndex(n),l=e.maybeChild(s);if(o==n||l.isText)return i&&!i.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));let a=t(l.content,n-o-1,r,l);return a&&e.replaceChild(s,l.copy(a))}(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(function t(e,n,r){let{index:i,offset:s}=e.findIndex(n),o=e.maybeChild(i),{index:l,offset:a}=e.findIndex(r);if(s==n||o.isText){if(a!=r&&!e.child(l).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return e.replaceChild(i,o.copy(t(o.content,n-s-1,r-s-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return c.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new c(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new c(t,n,r)}}function p(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function d(t,e,n){let r=t.node(n);return p(r,e.node(n)),r}function u(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function f(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(u(t.nodeAfter,r),s++));for(let t=s;tn&&u(m(d(t,e,n+1),g(t,e,n+1)),r),f(e,null,n,r),new i(r)}c.empty=new c(i.empty,0,0);class y{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new b(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:s}=e.content.findIndex(i),o=i-s;if(n.push(e,t,r+s),!o||(e=e.child(t)).isText)break;i=o-1,r+=s+1}return new y(e,n,i)}static resolveCached(t,e){let n=v.get(t);if(n)for(let t=0;tt.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return function t(e,n,r,s){let o=e.index(s),l=e.node(s);if(o==n.index(s)&&s=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(l,function t(e,n,r,s,o){let l=e.depth>o&&d(e,n,o+1),a=s.depth>o&&d(r,s,o+1),h=[];return f(null,e,o,h),l&&a&&n.index(o)==r.index(o)?(p(l,a),u(m(l,t(e,n,r,s,o+1)),h)):(l&&u(m(l,g(e,n,o+1)),h),f(n,r,o,h),a&&u(m(a,g(r,s,o+1)),h)),f(s,null,o,h),new i(h)}(e,t,o,n,s))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(nt&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),M(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,s=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,s),l=o&&o.matchFragment(this.content,e);if(!l||!l.validEnd)return!1;for(let t=r;tt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){let n;if(!e)throw RangeError("Invalid input for Node.fromJSON");if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content),s=t.nodeType(e.type).create(e.attrs,r,n);return s.type.checkAttrs(s.attrs),s}}S.prototype.text=void 0;class C extends S{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):M(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new C(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new C(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function M(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class T{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new A(t,e);if(null==i.next)return T.empty;let s=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.isInGroup(e)&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}}(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=E(t),r=n;return t.eat(",")&&(r="}"!=t.next?E(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let o=(n=function(t){let e=[[]];return i(function t(e,s){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,s)),[]);if("seq"==e.type)for(let r=0;;r++){let o=t(e.exprs[r],s);if(r==e.exprs.length-1)return o;i(o,s=n())}else if("star"==e.type){let o=n();return r(s,o),i(t(e.expr,o),o),[r(o)]}else if("plus"==e.type){let o=n();return i(t(e.expr,s),o),i(t(e.expr,o),o),[r(o)]}else if("opt"==e.type)return[r(s)].concat(t(e.expr,s));else if("range"==e.type){let o=s;for(let r=0;rt.to=e)}}(s),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let s=r[e.join(",")]=new T(e.indexOf(n.length-1)>-1);for(let e=0;et.createAndFill()));for(let t=0;t=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n"+t.indexOf(e.next[n].next);return r}).join("\n")}}T.empty=new T(!0);class A{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function E(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function O(t,e){return e-t}function I(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:L(this.attrs,t)}create(t=null,e,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new S(this,this.computeAttrs(t),i.from(e),a.setFrom(n))}createChecked(t=null,e,n){return e=i.from(e),this.checkContent(e),new S(this,this.computeAttrs(t),e,a.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),s=r&&r.fillBefore(i.empty,!0);return s?new S(this,t,e.append(s),a.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;en[t]=new j(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class F{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(t,e,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class ${constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=z(t,r.attrs),this.excluded=null;let i=N(this.attrs);this.instance=i?new a(this,i):null}create(t=null){return!t&&this.instance?this.instance:new a(this,L(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new $(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e-1}}class P{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=r.from(t.nodes),e.marks=r.from(t.marks||{}),this.nodes=j.compile(this.spec.nodes,this),this.marks=$.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=n[r]||(n[r]=T.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?D(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:D(this,n.split(" "))}this.nodeFromJSON=t=>S.fromJSON(this,t),this.markFromJSON=t=>a.fromJSON(this,t),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof j){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new C(n,n.defaultAttrs,t,a.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function D(t,e){let n=[];for(let r=0;r-1)&&n.push(o=r)}if(!o)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class B{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(null!=t.tag)this.tags.push(t);else if(null!=t.style){let e=/[^=]*/.exec(t.style)[0];0>n.indexOf(e)&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new W(this,e,!1);return n.addAll(t,a.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new W(this,e,!0);return n.addAll(t,a.none,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;it.length)||61==s.charCodeAt(t.length)&&s.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=V(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=V(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new B(t,B.schemaRules(t)))}}let J={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},H={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},K={ol:!0,ul:!0};function _(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class U{constructor(t,e,n,r,i,s){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=a.none,this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!J.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class W{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=e.topNode,i,s=_(null,e.preserveWhitespace,0)|(n?4:0);i=r?new U(r.type,r.attrs,a.none,!0,e.topMatch||r.type.contentMatch,s):n?new U(null,null,a.none,!0,null,s):new U(t.schema.topNodeType,null,a.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===i||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i){if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let t=n.split(/\r?\n|\r/);for(let n=0;n!n.clearMark(t)):e.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)t=n;else break}}return e}addElementByRule(t,e,n,r){let i,s;if(e.node){if((s=this.parser.schema.nodes[e.node]).isLeaf)this.insertNode(s.create(e.attrs),n,"BR"==t.nodeName)||this.leafFallback(t,n);else{let t=this.enter(s,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n,!1));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}i&&this.sync(o)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let s=n?t.childNodes[n]:t.firstChild,o=null==r?null:t.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(s,e);this.findAtPoint(t,i)}findPlace(t,e,n){let r,i;for(let e=this.open,s=0;e>=0;e--){let o=this.nodes[e],l=o.findWrapping(t);if(l&&(!r||r.length>l.length+s)&&(r=l,i=o,!l.length))break;if(o.solid){if(n)break;s+=2}}if(!r)return null;this.sync(i);for(let t=0;t(s.type?!s.type.allowsMarkType(e.type):!q(e.type,t))||(l=e.addToSet(l),!1)),this.nodes.push(new U(t,e,l,r,null,o)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=1)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),s=(t,o)=>{for(;t>=0;t--){let l=e[t];if(""==l){if(t==e.length-1||0==t)continue;for(;o>=i;o--)if(s(t-1,o))return!0;return!1}{let t=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!t||t.name!=l&&!t.isInGroup(l))return!1;o--}}return!0};return s(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}}function V(t){let e={};for(let n in t)e[n]=t[n];return e}function q(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=t=>{s.push(t);for(let n=0;ns.indexOf(i)&&o(i))return!0}};if(o(i.contentMatch))return!0}}class G{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=X(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,s=0;for(;n=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Z(X(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return Z(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new G(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Y(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Y(t.marks)}}function Y(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function X(t){return t.document||window.document}let Q=new WeakMap;function Z(t,e,n,r){let i,s,o;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let l=e[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(s=Q.get(r))&&Q.set(r,(o=null,function t(e){if(e&&"object"==typeof e){if(Array.isArray(e)){if("string"==typeof e[0])o||(o=[]),o.push(e);else for(let n=0;n-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let h=l.indexOf(" ");h>0&&(n=l.slice(0,h),l=l.slice(h+1));let c=n?t.createElementNS(n,l):t.createElement(l),p=e[1],d=1;if(p&&"object"==typeof p&&null==p.nodeType&&!Array.isArray(p)){for(let t in d=2,p)if(null!=p[t]){let e=t.indexOf(" ");e>0?c.setAttributeNS(t.slice(0,e),t.slice(e+1),p[t]):"style"==t&&c.style?c.style.cssText=p[t]:c.setAttribute(t,p[t])}}for(let s=d;sd)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:e,contentDOM:s}=Z(t,o,n,r);if(c.appendChild(e),s){if(i)throw RangeError("Multiple content holes");i=s}}}return{dom:c,contentDOM:i}}},4199:(t,e,n)=>{n.d(e,{$B:()=>l,Sd:()=>s,T2:()=>o});var r=n(2093),i=n(8836);function s(t,e=null){return function(n,s){let{$from:o,$to:l}=n.selection,a=o.blockRange(l);if(!a)return!1;let h=s?n.tr:null;return!!function(t,e,n,s=null){let o=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&0==e.startIndex){if(0==e.$from.index(e.depth-1))return!1;let t=a.resolve(e.start-2);l=new i.u$(t,t,e.depth),e.endIndex=0;t--)l=i.FK.from(n[t].type.create(n[t].attrs,l));t.step(new r.Wg(e.start-(s?2:0),e.end,e.start,e.end,new i.Ji(l,0,0),n.length,!0));let a=0;for(let t=0;te.childCount>0&&e.firstChild.type==t);return!!l&&(!n||(s.node(l.depth-1).type==t?function(t,e,n,s){let o=t.tr,l=s.end,a=s.$to.end(s.depth);lr;e--)t-=o.child(e).nodeSize,s.delete(t-1,t+1);let l=s.doc.resolve(n.start),a=l.nodeAfter;if(s.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let h=0==n.startIndex,c=n.endIndex==o.childCount,p=l.node(-1),d=l.index(-1);if(!p.canReplace(d+(h?0:1),d+1,a.content.append(c?i.FK.empty:i.FK.from(o))))return!1;let u=l.pos,f=u+a.nodeSize;return s.step(new r.Wg(u-(h?1:0),f+(c?1:0),u+1,f-1,new i.Ji((h?i.FK.empty:i.FK.from(o.copy(i.FK.empty))).append(c?i.FK.empty:i.FK.from(o.copy(i.FK.empty))),h?0:1,c?0:1),h?0:1)),e(s.scrollIntoView()),!0}(e,n,l)))}}function l(t){return function(e,n){let{$from:s,$to:o}=e.selection,l=s.blockRange(o,e=>e.childCount>0&&e.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let h=l.parent,c=h.child(a-1);if(c.type!=t)return!1;if(n){let s=c.lastChild&&c.lastChild.type==h.type,o=i.FK.from(s?t.create():null),a=new i.Ji(i.FK.from(t.create(null,i.FK.from(h.type.create(null,o)))),s?3:1,0),p=l.start,d=l.end;n(e.tr.step(new r.Wg(p-(s?3:1),d,p,d,a,1,!0)).scrollIntoView())}return!0}}},5526:(t,e,n)=>{n.d(e,{$t:()=>S,LN:()=>o,U3:()=>c,hs:()=>A,i5:()=>f,k_:()=>C,nh:()=>d});var r=n(8836),i=n(2093);let s=Object.create(null);class o{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new l(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;r--){let i=e<0?g(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):g(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new f(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new f(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new f(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=s[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in s)throw RangeError("Duplicate use of selection JSON ID "+t);return s[t]=e,e.prototype.jsonID=t,e}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}o.prototype.visible=!0;class l{constructor(t,e){this.$from=t,this.$to=e}}let a=!1;function h(t){a||t.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class c extends o{constructor(t,e=t){h(t),h(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return o.near(n);let r=t.resolve(e.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,e=r.Ji.empty){if(super.replace(t,e),e==r.Ji.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof c&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new p(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new c(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if((!n||r)&&(n=r>=0?1:-1),!e.parent.inlineContent){let t=o.findFrom(e,n,!0)||o.findFrom(e,-n,!0);if(!t)return o.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(o.findFrom(t,-n,!0)||o.findFrom(t,n,!0)).$anchor).posnew f(t)};function g(t,e,n,r,i,s=!1){if(e.inlineContent)return c.create(t,n);for(let o=r-(i>0?0:1);i>0?o=0;o+=i){let r=e.child(o);if(r.isAtom){if(!s&&d.isSelectable(r))return d.create(t,n-(i<0?r.nodeSize:0))}else{let e=g(t,r,n+i,i<0?r.childCount:0,i,s);if(e)return e}n+=r.nodeSize*i}return null}function y(t,e,n){let r,s=t.steps.length-1;if(s{null==r&&(r=i)}),t.setSelection(o.near(t.doc.resolve(r),n)))}class k extends i.dL{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.selection.to!=e+t.length||this.setSelection(o.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function w(t,e){return e&&t?t.bind(e):t}class v{constructor(t,e,n){this.name=t,this.init=w(e.init,n),this.apply=w(e.apply,n)}}let b=[new v("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new v("selection",{init:(t,e)=>t.selection||o.atStart(e.doc),apply:t=>t.selection}),new v("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new v("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class x{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=b.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new v(t.key,t.spec.state,t))})}}class S{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new x(t.schema,t.plugins),s=new S(i);return i.fields.forEach(i=>{if("doc"==i.name)s.doc=r.bP.fromJSON(t.schema,e.doc);else if("selection"==i.name)s.selection=o.fromJSON(s.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(s.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let r in n){let o=n[r],l=o.spec.state;if(o.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(e,r)){s[i.name]=l.fromJSON.call(o,t,e[r],s);return}}s[i.name]=i.init(t,s)}}),s}}class C{constructor(t){this.spec=t,this.props={},t.props&&function t(e,n,r){for(let i in e){let s=e[i];s instanceof Function?s=s.bind(n):"handleDOMEvents"==i&&(s=t(s,n,{})),r[i]=s}return r}(t.props,this,this.props),this.key=t.key?t.key.key:T("plugin")}getState(t){return t[this.key]}}let M=Object.create(null);function T(t){return t in M?t+"$"+ ++M[t]:(M[t]=0,t+"$")}class A{constructor(t="key"){this.key=T(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},2093:(t,e,n)=>{n.d(e,{$L:()=>O,Ln:()=>m,N0:()=>A,Um:()=>E,Wg:()=>g,X9:()=>o,Ys:()=>d,dL:()=>B,jP:()=>w,n9:()=>M,oM:()=>v,zy:()=>C});var r=n(8836);class i{constructor(t,e,n){this.pos=t,this.delInfo=e,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 s{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&s.empty)return s.empty}recover(t){let e=0,n=65535&t;if(!this.inverted)for(let t=0;tt)break;let h=this.ranges[l+s],c=this.ranges[l+o],p=a+h;if(t<=p){let s=h?t==a?-1:t==p?1:e:e,o=a+r+(s<0?0:c);if(n)return o;let d=t==(e<0?a:p)?null:l/3+(t-a)*65536,u=t==a?2:t==p?1:4;return(e<0?t!=a:t!=p)&&(u|=8),new i(o,u,d)}r+=c-h}return n?t+r:new i(t+r,0,null)}touches(t,e){let n=0,r=65535&e,i=this.inverted?2:1,s=this.inverted?1:2;for(let e=0;et)break;let l=this.ranges[e+i];if(t<=o+l&&e==3*r)return!0;n+=this.ranges[e+s]-l}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t._maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new o;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;nn&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,s)}invert(){return new d(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}a.jsonID("addMark",p);class d extends a{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new r.Ji(c(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new d(e.pos,n.pos,this.mark)}merge(t){return t instanceof d&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new d(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new d(e.from,e.to,t.markFromJSON(e.mark))}}a.jsonID("removeMark",d);class u extends a{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;nn.pos?null:new g(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(e.from,e.to,e.gapFrom,e.gapTo,r.Ji.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let t=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function k(t,e,n,i=n.contentMatch,s=!0){let o=t.doc.nodeAt(e),l=[],a=e+1;for(let e=0;e=0;e--)t.step(l[e])}function w(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,r=0,i=0;;--n){let s=t.$from.node(n),o=t.$from.index(n)+r,l=t.$to.indexAfter(n)-i;if(n{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let i=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(i,i+1,e.type.schema.linebreakReplacement.create())}}})}function S(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+s);t.replaceWith(i,i+1,e.type.schema.text("\n"))}})}function C(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let t=i.depth-1,e=n-2;t>s;t--,e--){let n=i.node(t),s=i.index(t);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(s,n.childCount),l=r&&r[e+1];l&&(o=o.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[e]||n;if(!n.canReplace(s+1,n.childCount)||!a.type.validContent(o))return!1}let l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function M(t,e){let n=t.resolve(e),r=n.index();return T(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function T(t,e){return!!(t&&e&&!t.isLeaf&&function(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(i=r.node(t+1),o++,s=r.node(t).maybeChild(o)):(i=r.node(t).maybeChild(o-1),s=r.node(t+1)),i&&!i.isTextblock&&T(i,s)&&r.node(t).canReplace(o,o+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function E(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,s=r.index(e)+(n>0?1:0),o=r.node(e),l=!1;if(1==t)l=o.canReplace(s,s,i);else{let t=o.contentMatchAt(s).findWrapping(i.firstChild.type);l=t&&o.canReplaceWith(s,s,t[0])}if(l)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}function O(t,e,n=e,i=r.Ji.empty){if(e==n&&!i.size)return null;let s=t.resolve(e),o=t.resolve(n);return I(s,o,i)?new m(e,n,i):new N(s,o,i).fit()}function I(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}a.jsonID("replaceAround",g);class N{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.FK.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&1==s.childCount;)s=s.firstChild.content,o--,l--;let a=new r.Ji(s,o,l);return t>-1?new g(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t=null,i=(n?(t=z(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let s=this.depth;s>=0;s--){let{type:o,match:l}=this.frontier[s],a,h=null;if(1==e&&(i?l.matchType(i.type)||(h=l.fillBefore(r.FK.from(i),!1)):t&&o.compatibleContent(t.type)))return{sliceDepth:n,frontierDepth:s,parent:t,inject:h};if(2==e&&i&&(a=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:s,parent:t,wrap:a};if(t&&l.matchType(t.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=z(t,e);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.Ji(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=z(t,e);if(i.childCount<=1&&e>0){let s=t.size-e<=e+i.size;this.unplaced=new r.Ji(L(t,e-1,1),e-1,s?e-1:n)}else this.unplaced=new r.Ji(L(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:s}){for(;this.depth>e;)this.closeFrontierNode();if(s)for(let t=0;t1||0==a||t.content.size)&&(p=e,c.push(function t(e,n,i){if(n<=0)return e;let s=e.content;return n>1&&(s=s.replaceChild(0,t(s.firstChild,n-1,1==s.childCount?i-1:0))),n>0&&(s=e.type.contentMatch.fillBefore(s).append(s),i<=0&&(s=s.append(e.type.contentMatch.matchFragment(s).fillBefore(r.FK.empty,!0)))),e.copy(s)}(t.mark(d.allowedMarks(t.marks)),1==h?a:0,h==l.childCount?u:-1)))}let f=h==l.childCount;f||(u=-1),this.placed=R(this.placed,e,r.FK.from(c)),this.frontier[e].match=p,f&&u<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=l;t1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){n:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e=0;n--){let{match:e,type:r}=this.frontier[n],i=j(t,n,r,e,!0);if(!i||i.childCount)continue n}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=R(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=R(this.placed,this.depth,r.FK.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.FK.empty,!0);t.childCount&&(this.placed=R(this.placed,this.frontier.length,t))}}function L(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(L(t.firstChild.content,e-1,n)))}function R(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(R(t.lastChild.content,e-1,n)))}function z(t,e){for(let n=0;n=0;i--){let r=t.start(i);if(re.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class $ extends a{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,e.isLeaf?0:1))}getMap(){return s.empty}invert(t){return new $(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new $(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new $(e.pos,e.attr,e.value)}}a.jsonID("attr",$);class P extends a{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return h.ok(n)}getMap(){return s.empty}invert(t){return new P(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new P(e.attr,e.value)}}a.jsonID("docAttr",P);let D=class extends Error{};(D=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype),D.prototype.constructor=D,D.prototype.name="TransformError";class B{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new o}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new D(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,e=-1e9;for(let n=0;n{t=Math.min(t,i),e=Math.max(e,s)})}return 1e9==t?null:{from:t,to:e}}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=r.Ji.empty){let i=O(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new r.Ji(r.FK.from(n),0,0))}delete(t,e){return this.replace(t,e,r.Ji.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return!function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let s=t.doc.resolve(e),o=t.doc.resolve(n);if(I(s,o,i))return t.step(new m(e,n,i));let l=F(s,o);0==l[l.length-1]&&l.pop();let a=-(s.depth+1);l.unshift(a);for(let t=s.depth,e=s.pos-1;t>0;t--,e--){let n=s.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(t)>-1?a=t:s.before(t)==e&&l.splice(1,0,-t)}let h=l.indexOf(a),c=[],p=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==i.openStart)break;t=n.content}for(let t=p-1;t>=0;t--){var d;let e=c[t],n=(d=e.type).spec.defining||d.spec.definingForContent;if(n&&!e.sameMarkup(s.node(Math.abs(a)-1)))p=t;else if(n||!e.type.isTextblock)break}for(let e=i.openStart;e>=0;e--){let a=(e+p+1)%(i.openStart+1),d=c[a];if(d)for(let e=0;es){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.FK.empty,!0))}return e}(i.content,0,i.openStart,a),a,i.openEnd))}}let u=t.steps.length;for(let r=l.length-1;r>=0&&(t.replace(e,n,i),!(t.steps.length>u));r--){let t=l[r];t<0||(e=s.before(t),n=o.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return!function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return t.delete(r.before(n),i.after(n))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return!function(t,e,n){let{$from:i,$to:s,depth:o}=e,l=i.before(o+1),a=s.after(o+1),h=l,c=a,p=r.FK.empty,d=0;for(let t=o,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,p=r.FK.from(i.node(t).copy(p)),d++):h--;let u=r.FK.empty,f=0;for(let t=o,e=!1;t>n;t--)e||s.after(t+1)=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[t].type.create(n[t].attrs,i))}let s=e.start,o=e.end;t.step(new g(s,o,s,o,new r.Ji(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return!function(t,e,n,i,s){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{var l,a;let h,c,p="function"==typeof s?s(e):s;if(e.isTextblock&&!e.hasMarkup(i,p)&&(l=t.doc,a=t.mapping.slice(o).map(n),c=(h=l.resolve(a)).index(),h.parent.canReplaceWith(c,c+1,i))){let s=null;if(i.schema.linebreakReplacement){let t="pre"==i.whitespace,e=!!i.contentMatch.matchType(i.schema.linebreakReplacement);t&&!e?s=!1:!t&&e&&(s=!0)}!1===s&&S(t,e,n,o),k(t,t.mapping.slice(o).map(n,1),i,void 0,null===s);let l=t.mapping.slice(o),a=l.map(n,1),h=l.map(n+e.nodeSize,1);return t.step(new g(a,h,a+1,h-1,new r.Ji(r.FK.from(i.create(p,null,e.marks)),0,0),1,!0)),!0===s&&x(t,e,n,o),!1}})}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return!function(t,e,n,i,s){let o=t.doc.nodeAt(e);if(!o)throw RangeError("No node at given position");n||(n=o.type);let l=n.create(i,null,s||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,l);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);t.step(new g(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new r.Ji(r.FK.from(l),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new $(t,e,n)),this}setDocAttribute(t,e){return this.step(new P(t,e)),this}addNodeMark(t,e){return this.step(new u(t,e)),this}removeNodeMark(t,e){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(e instanceof r.CU)e.isInSet(n.marks)&&this.step(new f(t,e));else{let r=n.marks,i,s=[];for(;i=e.isInSet(r);)s.push(new f(t,i)),r=i.removeFromSet(r);for(let t=s.length-1;t>=0;t--)this.step(s[t])}return this}split(t,e=1,n){return!function(t,e,n=1,i){let s=t.doc.resolve(e),o=r.FK.empty,l=r.FK.empty;for(let t=s.depth,e=s.depth-n,a=n-1;t>e;t--,a--){o=r.FK.from(s.node(t).copy(o));let e=i&&i[a];l=r.FK.from(e?e.type.create(e.attrs,l):s.node(t).copy(l))}t.step(new m(e,e,new r.Ji(o.append(l),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){var r;let i,s,o,l;return r=this,o=[],l=[],r.doc.nodesBetween(t,e,(r,a,h)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){let h=Math.max(a,t),u=Math.min(a+r.nodeSize,e),f=n.addToSet(c);for(let t=0;tr.step(t)),l.forEach(t=>r.step(t)),this}removeMark(t,e,n){var i;let s,o;return i=this,s=[],o=0,i.doc.nodesBetween(t,e,(i,l)=>{if(!i.isInline)return;o++;let a=null;if(n instanceof r.sX){let t=i.marks,e;for(;e=n.isInSet(t);)(a||(a=[])).push(e),t=e.removeFromSet(t)}else n?n.isInSet(i.marks)&&(a=[n]):a=i.marks;if(a&&a.length){let n=Math.min(l+i.nodeSize,e);for(let e=0;ei.step(new d(t.from,t.to,t.style))),this}clearIncompatible(t,e,n){return k(this,t,e,n),this}}}}]);