@zipify/wysiwyg 1.0.0-dev.6 → 1.0.0-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/webpack/lib.config.js +8 -4
- package/dist/wysiwyg.js +1 -1
- package/example/ExampleApp.vue +8 -1
- package/lib/Wysiwyg.vue +10 -15
- package/lib/composables/useEditor.js +1 -2
- package/lib/composables/useToolbar.js +7 -18
- package/package.json +3 -4
- package/lib/composables/__tests__/useToolbar.test.js +0 -56
package/dist/wysiwyg.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see wysiwyg.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={3700:(t,e,n)=>{var r={"./alignment-center.svg":8274,"./alignment-justify.svg":8768,"./alignment-left.svg":2449,"./alignment-right.svg":2515,"./arrow.svg":548,"./background-color.svg":1881,"./case-style.svg":9464,"./font-color.svg":9747,"./italic.svg":9441,"./line-height.svg":4140,"./list-circle.svg":1304,"./list-decimal.svg":2412,"./list-disc.svg":4311,"./list-latin.svg":1477,"./list-roman.svg":5400,"./list-square.svg":2807,"./remove-format.svg":6495,"./reset-styles.svg":7522,"./strike-through.svg":9976,"./superscript.svg":9857,"./underline.svg":6031};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=3700},1807:t=>{var e=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=e},9662:(t,e,n)=>{var r=n(614),o=n(6330),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},6077:(t,e,n)=>{var r=n(614),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},1223:(t,e,n)=>{var r=n(5112),o=n(30),i=n(3070).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},1530:(t,e,n)=>{"use strict";var r=n(8710).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},5787:(t,e,n)=>{var r=n(7976),o=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw o("Incorrect invocation")}},9670:(t,e,n)=>{var r=n(111),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},7556:(t,e,n)=>{var r=n(7293);t.exports=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},8533:(t,e,n)=>{"use strict";var r=n(2092).forEach,o=n(9341)("forEach");t.exports=o?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},1318:(t,e,n)=>{var r=n(5656),o=n(1400),i=n(6244),s=function(t){return function(e,n,s){var a,l=r(e),c=i(l),u=o(s,c);if(t&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},2092:(t,e,n)=>{var r=n(9974),o=n(1702),i=n(8361),s=n(7908),a=n(6244),l=n(5417),c=o([].push),u=function(t){var e=1==t,n=2==t,o=3==t,u=4==t,d=6==t,p=7==t,h=5==t||d;return function(f,m,v,g){for(var y,b,w=s(f),x=i(w),S=r(m,v),O=a(x),k=0,E=g||l,C=e?E(f,O):n||p?E(f,0):void 0;O>k;k++)if((h||k in x)&&(b=S(y=x[k],k,w),t))if(e)C[k]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return k;case 2:c(C,y)}else switch(t){case 4:return!1;case 7:c(C,y)}return d?-1:o||u?u:C}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},1194:(t,e,n)=>{var r=n(7293),o=n(5112),i=n(7392),s=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:(t,e,n)=>{"use strict";var r=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},3671:(t,e,n)=>{var r=n(9662),o=n(7908),i=n(8361),s=n(6244),a=TypeError,l=function(t){return function(e,n,l,c){r(n);var u=o(e),d=i(u),p=s(u),h=t?p-1:0,f=t?-1:1;if(l<2)for(;;){if(h in d){c=d[h],h+=f;break}if(h+=f,t?h<0:p<=h)throw a("Reduce of empty array with no initial value")}for(;t?h>=0:p>h;h+=f)h in d&&(c=n(c,d[h],h,u));return c}};t.exports={left:l(!1),right:l(!0)}},1589:(t,e,n)=>{var r=n(1400),o=n(6244),i=n(6135),s=Array,a=Math.max;t.exports=function(t,e,n){for(var l=o(t),c=r(e,l),u=r(void 0===n?l:n,l),d=s(a(u-c,0)),p=0;c<u;c++,p++)i(d,p,t[c]);return d.length=p,d}},7475:(t,e,n)=>{var r=n(3157),o=n(4411),i=n(111),s=n(5112)("species"),a=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,(o(e)&&(e===a||r(e.prototype))||i(e)&&null===(e=e[s]))&&(e=void 0)),void 0===e?a:e}},5417:(t,e,n)=>{var r=n(7475);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},7072:(t,e,n)=>{var r=n(5112)("iterator"),o=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){o=!0}};s[r]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},4326:(t,e,n)=>{var r=n(1702),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,n)=>{var r=n(1694),o=n(614),i=n(4326),s=n(5112)("toStringTag"),a=Object,l="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:l?i(e):"Object"==(r=i(e))&&o(e.callee)?"Arguments":r}},9320:(t,e,n)=>{"use strict";var r=n(1702),o=n(9190),i=n(2423).getWeakData,s=n(9670),a=n(111),l=n(5787),c=n(408),u=n(2092),d=n(2597),p=n(9909),h=p.set,f=p.getterFor,m=u.find,v=u.findIndex,g=r([].splice),y=0,b=function(t){return t.frozen||(t.frozen=new w)},w=function(){this.entries=[]},x=function(t,e){return m(t.entries,(function(t){return t[0]===e}))};w.prototype={get:function(t){var e=x(this,t);if(e)return e[1]},has:function(t){return!!x(this,t)},set:function(t,e){var n=x(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=v(this.entries,(function(e){return e[0]===t}));return~e&&g(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var u=t((function(t,o){l(t,p),h(t,{type:e,id:y++,frozen:void 0}),null!=o&&c(o,t[r],{that:t,AS_ENTRIES:n})})),p=u.prototype,m=f(e),v=function(t,e,n){var r=m(t),o=i(s(e),!0);return!0===o?b(r).set(e,n):o[r.id]=n,t};return o(p,{delete:function(t){var e=m(this);if(!a(t))return!1;var n=i(t);return!0===n?b(e).delete(t):n&&d(n,e.id)&&delete n[e.id]},has:function(t){var e=m(this);if(!a(t))return!1;var n=i(t);return!0===n?b(e).has(t):n&&d(n,e.id)}}),o(p,n?{get:function(t){var e=m(this);if(a(t)){var n=i(t);return!0===n?b(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return v(this,t,e)}}:{add:function(t){return v(this,t,!0)}}),u}}},7710:(t,e,n)=>{"use strict";var r=n(2109),o=n(7854),i=n(1702),s=n(4705),a=n(8052),l=n(2423),c=n(408),u=n(5787),d=n(614),p=n(111),h=n(7293),f=n(7072),m=n(8003),v=n(9587);t.exports=function(t,e,n){var g=-1!==t.indexOf("Map"),y=-1!==t.indexOf("Weak"),b=g?"set":"add",w=o[t],x=w&&w.prototype,S=w,O={},k=function(t){var e=i(x[t]);a(x,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return y&&!p(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(s(t,!d(w)||!(y||x.forEach&&!h((function(){(new w).entries().next()})))))S=n.getConstructor(e,t,g,b),l.enable();else if(s(t,!0)){var E=new S,C=E[b](y?{}:-0,1)!=E,M=h((function(){E.has(1)})),T=f((function(t){new w(t)})),A=!y&&h((function(){for(var t=new w,e=5;e--;)t[b](e,e);return!t.has(-0)}));T||((S=e((function(t,e){u(t,x);var n=v(new w,t,S);return null!=e&&c(e,n[b],{that:n,AS_ENTRIES:g}),n}))).prototype=x,x.constructor=S),(M||A)&&(k("delete"),k("has"),g&&k("get")),(A||C)&&k(b),y&&x.clear&&delete x.clear}return O[t]=S,r({global:!0,constructor:!0,forced:S!=w},O),m(S,t),y||n.setStrong(S,t,g),S}},9920:(t,e,n)=>{var r=n(2597),o=n(3887),i=n(1236),s=n(3070);t.exports=function(t,e,n){for(var a=o(e),l=s.f,c=i.f,u=0;u<a.length;u++){var d=a[u];r(t,d)||n&&r(n,d)||l(t,d,c(e,d))}}},8544:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4994:(t,e,n)=>{"use strict";var r=n(3383).IteratorPrototype,o=n(30),i=n(9114),s=n(8003),a=n(7497),l=function(){return this};t.exports=function(t,e,n,c){var u=e+" Iterator";return t.prototype=o(r,{next:i(+!c,n)}),s(t,u,!1,!0),a[u]=l,t}},8880:(t,e,n)=>{var r=n(9781),o=n(3070),i=n(9114);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:(t,e,n)=>{"use strict";var r=n(4948),o=n(3070),i=n(9114);t.exports=function(t,e,n){var s=r(e);s in t?o.f(t,s,i(0,n)):t[s]=n}},8052:(t,e,n)=>{var r=n(614),o=n(3070),i=n(6339),s=n(3072);t.exports=function(t,e,n,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&i(n,c,a),a.global)l?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},9190:(t,e,n)=>{var r=n(8052);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},3072:(t,e,n)=>{var r=n(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},654:(t,e,n)=>{"use strict";var r=n(2109),o=n(6916),i=n(1913),s=n(6530),a=n(614),l=n(4994),c=n(9518),u=n(7674),d=n(8003),p=n(8880),h=n(8052),f=n(5112),m=n(7497),v=n(3383),g=s.PROPER,y=s.CONFIGURABLE,b=v.IteratorPrototype,w=v.BUGGY_SAFARI_ITERATORS,x=f("iterator"),S="keys",O="values",k="entries",E=function(){return this};t.exports=function(t,e,n,s,f,v,C){l(n,e,s);var M,T,A,N=function(t){if(t===f&&z)return z;if(!w&&t in R)return R[t];switch(t){case S:case O:case k:return function(){return new n(this,t)}}return function(){return new n(this)}},D=e+" Iterator",_=!1,R=t.prototype,I=R[x]||R["@@iterator"]||f&&R[f],z=!w&&I||N(f),L="Array"==e&&R.entries||I;if(L&&(M=c(L.call(new t)))!==Object.prototype&&M.next&&(i||c(M)===b||(u?u(M,b):a(M[x])||h(M,x,E)),d(M,D,!0,!0),i&&(m[D]=E)),g&&f==O&&I&&I.name!==O&&(!i&&y?p(R,"name",O):(_=!0,z=function(){return o(I,this)})),f)if(T={values:N(O),keys:v?z:N(S),entries:N(k)},C)for(A in T)(w||_||!(A in R))&&h(R,A,T[A]);else r({target:e,proto:!0,forced:w||_},T);return i&&!C||R[x]===z||h(R,x,z,{name:f}),m[e]=z,T}},9781:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,n)=>{var r=n(7854),o=n(111),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},8324:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(t,e,n)=>{var r=n(317)("span").classList,o=r&&r.constructor&&r.constructor.prototype;t.exports=o===Object.prototype?void 0:o},5268:(t,e,n)=>{var r=n(4326),o=n(7854);t.exports="process"==r(o.process)},8113:(t,e,n)=>{var r=n(5005);t.exports=r("navigator","userAgent")||""},7392:(t,e,n)=>{var r,o,i=n(7854),s=n(8113),a=i.process,l=i.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,n)=>{var r=n(7854),o=n(1236).f,i=n(8880),s=n(8052),a=n(3072),l=n(9920),c=n(4705);t.exports=function(t,e){var n,u,d,p,h,f=t.target,m=t.global,v=t.stat;if(n=m?r:v?r[f]||a(f,{}):(r[f]||{}).prototype)for(u in e){if(p=e[u],d=t.dontCallGetSet?(h=o(n,u))&&h.value:n[u],!c(m?u:f+(v?".":"#")+u,t.forced)&&void 0!==d){if(typeof p==typeof d)continue;l(p,d)}(t.sham||d&&d.sham)&&i(p,"sham",!0),s(n,u,p,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:(t,e,n)=>{"use strict";n(4916);var r=n(1702),o=n(8052),i=n(2261),s=n(7293),a=n(5112),l=n(8880),c=a("species"),u=RegExp.prototype;t.exports=function(t,e,n,d){var p=a(t),h=!s((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),f=h&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!h||!f||n){var m=r(/./[p]),v=e(p,""[t],(function(t,e,n,o,s){var a=r(t),l=e.exec;return l===i||l===u.exec?h&&!s?{done:!0,value:m(e,n,o)}:{done:!0,value:a(n,e,o)}:{done:!1}}));o(String.prototype,t,v[0]),o(u,p,v[1])}d&&l(u[p],"sham",!0)}},6677:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:(t,e,n)=>{var r=n(4374),o=Function.prototype,i=o.apply,s=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},9974:(t,e,n)=>{var r=n(1702),o=n(9662),i=n(4374),s=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}},4374:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,e,n)=>{var r=n(4374),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,e,n)=>{var r=n(9781),o=n(2597),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),l=a&&"something"===function(){}.name,c=a&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},1702:(t,e,n)=>{var r=n(4374),o=Function.prototype,i=o.bind,s=o.call,a=r&&i.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},5005:(t,e,n)=>{var r=n(7854),o=n(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},1246:(t,e,n)=>{var r=n(648),o=n(8173),i=n(7497),s=n(5112)("iterator");t.exports=function(t){if(null!=t)return o(t,s)||o(t,"@@iterator")||i[r(t)]}},8554:(t,e,n)=>{var r=n(6916),o=n(9662),i=n(9670),s=n(6330),a=n(1246),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?a(t):e;if(o(n))return i(r(n,t));throw l(s(t)+" is not iterable")}},8173:(t,e,n)=>{var r=n(9662);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},647:(t,e,n)=>{var r=n(1702),o=n(7908),i=Math.floor,s=r("".charAt),a=r("".replace),l=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,d,p){var h=n+t.length,f=r.length,m=u;return void 0!==d&&(d=o(d),m=c),a(p,m,(function(o,a){var c;switch(s(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,n);case"'":return l(e,h);case"<":c=d[l(a,1,-1)];break;default:var u=+a;if(0===u)return o;if(u>f){var p=i(u/10);return 0===p?o:p<=f?void 0===r[p-1]?s(a,1):r[p-1]+s(a,1):o}c=r[u-1]}return void 0===c?"":c}))}},7854:(t,e,n)=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:(t,e,n)=>{var r=n(1702),o=n(7908),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},490:(t,e,n)=>{var r=n(5005);t.exports=r("document","documentElement")},4664:(t,e,n)=>{var r=n(9781),o=n(7293),i=n(317);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,n)=>{var r=n(1702),o=n(7293),i=n(4326),s=Object,a=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},9587:(t,e,n)=>{var r=n(614),o=n(111),i=n(7674);t.exports=function(t,e,n){var s,a;return i&&r(s=e.constructor)&&s!==n&&o(a=s.prototype)&&a!==n.prototype&&i(t,a),t}},2788:(t,e,n)=>{var r=n(1702),o=n(614),i=n(5465),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},2423:(t,e,n)=>{var r=n(2109),o=n(1702),i=n(3501),s=n(111),a=n(2597),l=n(3070).f,c=n(8006),u=n(1156),d=n(2050),p=n(9711),h=n(6677),f=!1,m=p("meta"),v=0,g=function(t){l(t,m,{value:{objectID:"O"+v++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},f=!0;var t=c.f,e=o([].splice),n={};n[m]=1,t(n).length&&(c.f=function(n){for(var r=t(n),o=0,i=r.length;o<i;o++)if(r[o]===m){e(r,o,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(t,e){if(!s(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,m)){if(!d(t))return"F";if(!e)return"E";g(t)}return t[m].objectID},getWeakData:function(t,e){if(!a(t,m)){if(!d(t))return!0;if(!e)return!1;g(t)}return t[m].weakData},onFreeze:function(t){return h&&f&&d(t)&&!a(t,m)&&g(t),t}};i[m]=!0},9909:(t,e,n)=>{var r,o,i,s=n(8536),a=n(7854),l=n(1702),c=n(111),u=n(8880),d=n(2597),p=n(5465),h=n(6200),f=n(3501),m="Object already initialized",v=a.TypeError,g=a.WeakMap;if(s||p.state){var y=p.state||(p.state=new g),b=l(y.get),w=l(y.has),x=l(y.set);r=function(t,e){if(w(y,t))throw new v(m);return e.facade=t,x(y,t,e),e},o=function(t){return b(y,t)||{}},i=function(t){return w(y,t)}}else{var S=h("state");f[S]=!0,r=function(t,e){if(d(t,S))throw new v(m);return e.facade=t,u(t,S,e),e},o=function(t){return d(t,S)?t[S]:{}},i=function(t){return d(t,S)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},7659:(t,e,n)=>{var r=n(5112),o=n(7497),i=r("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||s[i]===t)}},3157:(t,e,n)=>{var r=n(4326);t.exports=Array.isArray||function(t){return"Array"==r(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,e,n)=>{var r=n(1702),o=n(7293),i=n(614),s=n(648),a=n(5005),l=n(2788),c=function(){},u=[],d=a("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=r(p.exec),f=!p.exec(c),m=function(t){if(!i(t))return!1;try{return d(c,u,t),!0}catch(t){return!1}},v=function(t){if(!i(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!h(p,l(t))}catch(t){return!0}};v.sham=!0,t.exports=!d||o((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?v:m},4705:(t,e,n)=>{var r=n(7293),o=n(614),i=/#|\.prototype\./,s=function(t,e){var n=l[a(t)];return n==u||n!=c&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";t.exports=s},111:(t,e,n)=>{var r=n(614);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},1913:t=>{t.exports=!1},2190:(t,e,n)=>{var r=n(5005),o=n(614),i=n(7976),s=n(3307),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},408:(t,e,n)=>{var r=n(9974),o=n(6916),i=n(9670),s=n(6330),a=n(7659),l=n(6244),c=n(7976),u=n(8554),d=n(1246),p=n(9212),h=TypeError,f=function(t,e){this.stopped=t,this.result=e},m=f.prototype;t.exports=function(t,e,n){var v,g,y,b,w,x,S,O=n&&n.that,k=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_ITERATOR),C=!(!n||!n.INTERRUPTED),M=r(e,O),T=function(t){return v&&p(v,"normal",t),new f(!0,t)},A=function(t){return k?(i(t),C?M(t[0],t[1],T):M(t[0],t[1])):C?M(t,T):M(t)};if(E)v=t;else{if(!(g=d(t)))throw h(s(t)+" is not iterable");if(a(g)){for(y=0,b=l(t);b>y;y++)if((w=A(t[y]))&&c(m,w))return w;return new f(!1)}v=u(t,g)}for(x=v.next;!(S=o(x,v)).done;){try{w=A(S.value)}catch(t){p(v,"throw",t)}if("object"==typeof w&&w&&c(m,w))return w}return new f(!1)}},9212:(t,e,n)=>{var r=n(6916),o=n(9670),i=n(8173);t.exports=function(t,e,n){var s,a;o(t);try{if(!(s=i(t,"return"))){if("throw"===e)throw n;return n}s=r(s,t)}catch(t){a=!0,s=t}if("throw"===e)throw n;if(a)throw s;return o(s),n}},3383:(t,e,n)=>{"use strict";var r,o,i,s=n(7293),a=n(614),l=n(30),c=n(9518),u=n(8052),d=n(5112),p=n(1913),h=d("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):f=!0),null==r||s((function(){var t={};return r[h].call(t)!==t}))?r={}:p&&(r=l(r)),a(r[h])||u(r,h,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},7497:t=>{t.exports={}},6244:(t,e,n)=>{var r=n(7466);t.exports=function(t){return r(t.length)}},6339:(t,e,n)=>{var r=n(7293),o=n(614),i=n(2597),s=n(9781),a=n(6530).CONFIGURABLE,l=n(2788),c=n(9909),u=c.enforce,d=c.get,p=Object.defineProperty,h=s&&!r((function(){return 8!==p((function(){}),"length",{value:8}).length})),f=String(String).split("String"),m=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&(s?p(t,"name",{value:e,configurable:!0}):t.name=e),h&&n&&i(n,"arity")&&t.length!==n.arity&&p(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=u(t);return i(r,"source")||(r.source=f.join("string"==typeof e?e:"")),t};Function.prototype.toString=m((function(){return o(this)&&d(this).source||l(this)}),"toString")},4758:t=>{var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},133:(t,e,n)=>{var r=n(7392),o=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:(t,e,n)=>{var r=n(7854),o=n(614),i=n(2788),s=r.WeakMap;t.exports=o(s)&&/native code/.test(i(s))},3009:(t,e,n)=>{var r=n(7854),o=n(7293),i=n(1702),s=n(1340),a=n(3111).trim,l=n(1361),c=r.parseInt,u=r.Symbol,d=u&&u.iterator,p=/^[+-]?0x/i,h=i(p.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||d&&!o((function(){c(Object(d))}));t.exports=f?function(t,e){var n=a(s(t));return c(n,e>>>0||(h(p,n)?16:10))}:c},1574:(t,e,n)=>{"use strict";var r=n(9781),o=n(1702),i=n(6916),s=n(7293),a=n(1956),l=n(5181),c=n(5296),u=n(7908),d=n(8361),p=Object.assign,h=Object.defineProperty,f=o([].concat);t.exports=!p||s((function(){if(r&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=p({},t)[n]||a(p({},e)).join("")!=o}))?function(t,e){for(var n=u(t),o=arguments.length,s=1,p=l.f,h=c.f;o>s;)for(var m,v=d(arguments[s++]),g=p?f(a(v),p(v)):a(v),y=g.length,b=0;y>b;)m=g[b++],r&&!i(h,v,m)||(n[m]=v[m]);return n}:p},30:(t,e,n)=>{var r,o=n(9670),i=n(6048),s=n(748),a=n(3501),l=n(490),c=n(317),u=n(6200)("IE_PROTO"),d=function(){},p=function(t){return"<script>"+t+"<\/script>"},h=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},f=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;f="undefined"!=typeof document?document.domain&&r?h(r):((e=c("iframe")).style.display="none",l.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):h(r);for(var n=s.length;n--;)delete f.prototype[s[n]];return f()};a[u]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(d.prototype=o(t),n=new d,d.prototype=null,n[u]=t):n=f(),void 0===e?n:i.f(n,e)}},6048:(t,e,n)=>{var r=n(9781),o=n(3353),i=n(3070),s=n(9670),a=n(5656),l=n(1956);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=l(e),c=o.length,u=0;c>u;)i.f(t,n=o[u++],r[n]);return t}},3070:(t,e,n)=>{var r=n(9781),o=n(4664),i=n(3353),s=n(9670),a=n(4948),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor;e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&"writable"in n&&!n.writable){var r=u(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:(t,e,n)=>{var r=n(9781),o=n(6916),i=n(5296),s=n(9114),a=n(5656),l=n(4948),c=n(2597),u=n(4664),d=Object.getOwnPropertyDescriptor;e.f=r?d:function(t,e){if(t=a(t),e=l(e),u)try{return d(t,e)}catch(t){}if(c(t,e))return s(!o(i.f,t,e),t[e])}},1156:(t,e,n)=>{var r=n(4326),o=n(5656),i=n(8006).f,s=n(1589),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"==r(t)?function(t){try{return i(t)}catch(t){return s(a)}}(t):i(o(t))}},8006:(t,e,n)=>{var r=n(6324),o=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},9518:(t,e,n)=>{var r=n(2597),o=n(614),i=n(7908),s=n(6200),a=n(8544),l=s("IE_PROTO"),c=Object,u=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=i(t);if(r(e,l))return e[l];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof c?u:null}},2050:(t,e,n)=>{var r=n(7293),o=n(111),i=n(4326),s=n(7556),a=Object.isExtensible,l=r((function(){a(1)}));t.exports=l||s?function(t){return!!o(t)&&(!s||"ArrayBuffer"!=i(t))&&(!a||a(t))}:a},7976:(t,e,n)=>{var r=n(1702);t.exports=r({}.isPrototypeOf)},6324:(t,e,n)=>{var r=n(1702),o=n(2597),i=n(5656),s=n(1318).indexOf,a=n(3501),l=r([].push);t.exports=function(t,e){var n,r=i(t),c=0,u=[];for(n in r)!o(a,n)&&o(r,n)&&l(u,n);for(;e.length>c;)o(r,n=e[c++])&&(~s(u,n)||l(u,n));return u}},1956:(t,e,n)=>{var r=n(6324),o=n(748);t.exports=Object.keys||function(t){return r(t,o)}},5296:(t,e)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},7674:(t,e,n)=>{var r=n(1702),o=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},288:(t,e,n)=>{"use strict";var r=n(1694),o=n(648);t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,e,n)=>{var r=n(6916),o=n(614),i=n(111),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},3887:(t,e,n)=>{var r=n(5005),o=n(1702),i=n(8006),s=n(5181),a=n(9670),l=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?l(e,n(t)):e}},7651:(t,e,n)=>{var r=n(6916),o=n(9670),i=n(614),s=n(4326),a=n(2261),l=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var c=r(n,t,e);return null!==c&&o(c),c}if("RegExp"===s(t))return r(a,t,e);throw l("RegExp#exec called on incompatible receiver")}},2261:(t,e,n)=>{"use strict";var r,o,i=n(6916),s=n(1702),a=n(1340),l=n(7066),c=n(2999),u=n(2309),d=n(30),p=n(9909).get,h=n(3350),f=n(7168),m=u("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,g=v,y=s("".charAt),b=s("".indexOf),w=s("".replace),x=s("".slice),S=(o=/b*/g,i(v,r=/a/,"a"),i(v,o,"a"),0!==r.lastIndex||0!==o.lastIndex),O=c.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(S||k||O||h||f)&&(g=function(t){var e,n,r,o,s,c,u,h=this,f=p(h),E=a(t),C=f.raw;if(C)return C.lastIndex=h.lastIndex,e=i(g,C,E),h.lastIndex=C.lastIndex,e;var M=f.groups,T=O&&h.sticky,A=i(l,h),N=h.source,D=0,_=E;if(T&&(A=w(A,"y",""),-1===b(A,"g")&&(A+="g"),_=x(E,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==y(E,h.lastIndex-1))&&(N="(?: "+N+")",_=" "+_,D++),n=new RegExp("^(?:"+N+")",A)),k&&(n=new RegExp("^"+N+"$(?!\\s)",A)),S&&(r=h.lastIndex),o=i(v,T?n:h,_),T?o?(o.input=x(o.input,D),o[0]=x(o[0],D),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:S&&o&&(h.lastIndex=h.global?o.index+o[0].length:r),k&&o&&o.length>1&&i(m,o[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(o[s]=void 0)})),o&&M)for(o.groups=c=d(null),s=0;s<M.length;s++)c[(u=M[s])[0]]=o[u[1]];return o}),t.exports=g},7066:(t,e,n)=>{"use strict";var r=n(9670);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},2999:(t,e,n)=>{var r=n(7293),o=n(7854).RegExp,i=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),s=i||r((function(){return!o("a","y").sticky})),a=i||r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:i}},3350:(t,e,n)=>{var r=n(7293),o=n(7854).RegExp;t.exports=r((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},7168:(t,e,n)=>{var r=n(7293),o=n(7854).RegExp;t.exports=r((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4488:t=>{var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},8003:(t,e,n)=>{var r=n(3070).f,o=n(2597),i=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},6200:(t,e,n)=>{var r=n(2309),o=n(9711),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,n)=>{var r=n(7854),o=n(3072),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},2309:(t,e,n)=>{var r=n(1913),o=n(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.3",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE",source:"https://github.com/zloirock/core-js"})},8710:(t,e,n)=>{var r=n(1702),o=n(9303),i=n(1340),s=n(4488),a=r("".charAt),l=r("".charCodeAt),c=r("".slice),u=function(t){return function(e,n){var r,u,d=i(s(e)),p=o(n),h=d.length;return p<0||p>=h?t?"":void 0:(r=l(d,p))<55296||r>56319||p+1===h||(u=l(d,p+1))<56320||u>57343?t?a(d,p):r:t?c(d,p,p+2):u-56320+(r-55296<<10)+65536}};t.exports={codeAt:u(!1),charAt:u(!0)}},3111:(t,e,n)=>{var r=n(1702),o=n(4488),i=n(1340),s=n(1361),a=r("".replace),l="["+s+"]",c=RegExp("^"+l+l+"*"),u=RegExp(l+l+"*$"),d=function(t){return function(e){var n=i(o(e));return 1&t&&(n=a(n,c,"")),2&t&&(n=a(n,u,"")),n}};t.exports={start:d(1),end:d(2),trim:d(3)}},1400:(t,e,n)=>{var r=n(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},5656:(t,e,n)=>{var r=n(8361),o=n(4488);t.exports=function(t){return r(o(t))}},9303:(t,e,n)=>{var r=n(4758);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},7466:(t,e,n)=>{var r=n(9303),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},7908:(t,e,n)=>{var r=n(4488),o=Object;t.exports=function(t){return o(r(t))}},7593:(t,e,n)=>{var r=n(6916),o=n(111),i=n(2190),s=n(8173),a=n(2140),l=n(5112),c=TypeError,u=l("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,l=s(t,u);if(l){if(void 0===e&&(e="default"),n=r(l,t,e),!o(n)||i(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},4948:(t,e,n)=>{var r=n(7593),o=n(2190);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},1694:(t,e,n)=>{var r={};r[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(r)},1340:(t,e,n)=>{var r=n(648),o=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:(t,e,n)=>{var r=n(1702),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},3307:(t,e,n)=>{var r=n(133);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,e,n)=>{var r=n(9781),o=n(7293);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:(t,e,n)=>{var r=n(7854),o=n(2309),i=n(2597),s=n(9711),a=n(133),l=n(3307),c=o("wks"),u=r.Symbol,d=u&&u.for,p=l?u:u&&u.withoutSetter||s;t.exports=function(t){if(!i(c,t)||!a&&"string"!=typeof c[t]){var e="Symbol."+t;a&&i(u,t)?c[t]=u[t]:c[t]=l&&d?d(e):p(e)}return c[t]}},1361:t=>{t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},7327:(t,e,n)=>{"use strict";var r=n(2109),o=n(2092).filter;r({target:"Array",proto:!0,forced:!n(1194)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},6992:(t,e,n)=>{"use strict";var r=n(5656),o=n(1223),i=n(7497),s=n(9909),a=n(3070).f,l=n(654),c=n(1913),u=n(9781),d="Array Iterator",p=s.set,h=s.getterFor(d);t.exports=l(Array,"Array",(function(t,e){p(this,{type:d,target:r(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var f=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!c&&u&&"values"!==f.name)try{a(f,"name",{value:"values"})}catch(t){}},5827:(t,e,n)=>{"use strict";var r=n(2109),o=n(3671).left,i=n(9341),s=n(7392),a=n(5268);r({target:"Array",proto:!0,forced:!i("reduce")||!a&&s>79&&s<83},{reduce:function(t){var e=arguments.length;return o(this,t,e,e>1?arguments[1]:void 0)}})},8309:(t,e,n)=>{var r=n(9781),o=n(6530).EXISTS,i=n(1702),s=n(3070).f,a=Function.prototype,l=i(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=i(c.exec);r&&!o&&s(a,"name",{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(t){return""}}})},9601:(t,e,n)=>{var r=n(2109),o=n(1574);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},1539:(t,e,n)=>{var r=n(1694),o=n(8052),i=n(288);r||o(Object.prototype,"toString",i,{unsafe:!0})},1058:(t,e,n)=>{var r=n(2109),o=n(3009);r({global:!0,forced:parseInt!=o},{parseInt:o})},4916:(t,e,n)=>{"use strict";var r=n(2109),o=n(2261);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},8783:(t,e,n)=>{"use strict";var r=n(8710).charAt,o=n(1340),i=n(9909),s=n(654),a="String Iterator",l=i.set,c=i.getterFor(a);s(String,"String",(function(t){l(this,{type:a,string:o(t),index:0})}),(function(){var t,e=c(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=r(n,o),e.index+=t.length,{value:t,done:!1})}))},4723:(t,e,n)=>{"use strict";var r=n(6916),o=n(7007),i=n(9670),s=n(7466),a=n(1340),l=n(4488),c=n(8173),u=n(1530),d=n(7651);o("match",(function(t,e,n){return[function(e){var n=l(this),o=null==e?void 0:c(e,t);return o?r(o,e,n):new RegExp(e)[t](a(n))},function(t){var r=i(this),o=a(t),l=n(e,r,o);if(l.done)return l.value;if(!r.global)return d(r,o);var c=r.unicode;r.lastIndex=0;for(var p,h=[],f=0;null!==(p=d(r,o));){var m=a(p[0]);h[f]=m,""===m&&(r.lastIndex=u(o,s(r.lastIndex),c)),f++}return 0===f?null:h}]}))},5306:(t,e,n)=>{"use strict";var r=n(2104),o=n(6916),i=n(1702),s=n(7007),a=n(7293),l=n(9670),c=n(614),u=n(9303),d=n(7466),p=n(1340),h=n(4488),f=n(1530),m=n(8173),v=n(647),g=n(7651),y=n(5112)("replace"),b=Math.max,w=Math.min,x=i([].concat),S=i([].push),O=i("".indexOf),k=i("".slice),E="$0"==="a".replace(/./,"$0"),C=!!/./[y]&&""===/./[y]("a","$0");s("replace",(function(t,e,n){var i=C?"$":"$0";return[function(t,n){var r=h(this),i=null==t?void 0:m(t,y);return i?o(i,t,r,n):o(e,p(r),t,n)},function(t,o){var s=l(this),a=p(t);if("string"==typeof o&&-1===O(o,i)&&-1===O(o,"$<")){var h=n(e,s,a,o);if(h.done)return h.value}var m=c(o);m||(o=p(o));var y=s.global;if(y){var E=s.unicode;s.lastIndex=0}for(var C=[];;){var M=g(s,a);if(null===M)break;if(S(C,M),!y)break;""===p(M[0])&&(s.lastIndex=f(a,d(s.lastIndex),E))}for(var T,A="",N=0,D=0;D<C.length;D++){for(var _=p((M=C[D])[0]),R=b(w(u(M.index),a.length),0),I=[],z=1;z<M.length;z++)S(I,void 0===(T=M[z])?T:String(T));var L=M.groups;if(m){var P=x([_],I,R,a);void 0!==L&&S(P,L);var B=p(r(o,void 0,P))}else B=v(_,a,R,I,L,o);R>=N&&(A+=k(a,N,R)+B,N=R+_.length)}return A+k(a,N)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!E||C)},1202:(t,e,n)=>{"use strict";var r,o=n(7854),i=n(1702),s=n(9190),a=n(2423),l=n(7710),c=n(9320),u=n(111),d=n(2050),p=n(9909).enforce,h=n(8536),f=!o.ActiveXObject&&"ActiveXObject"in o,m=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},v=l("WeakMap",m,c);if(h&&f){r=c.getConstructor(m,"WeakMap",!0),a.enable();var g=v.prototype,y=i(g.delete),b=i(g.has),w=i(g.get),x=i(g.set);s(g,{delete:function(t){if(u(t)&&!d(t)){var e=p(this);return e.frozen||(e.frozen=new r),y(this,t)||e.frozen.delete(t)}return y(this,t)},has:function(t){if(u(t)&&!d(t)){var e=p(this);return e.frozen||(e.frozen=new r),b(this,t)||e.frozen.has(t)}return b(this,t)},get:function(t){if(u(t)&&!d(t)){var e=p(this);return e.frozen||(e.frozen=new r),b(this,t)?w(this,t):e.frozen.get(t)}return w(this,t)},set:function(t,e){if(u(t)&&!d(t)){var n=p(this);n.frozen||(n.frozen=new r),b(this,t)?x(this,t,e):n.frozen.set(t,e)}else x(this,t,e);return this}})}},4129:(t,e,n)=>{n(1202)},4747:(t,e,n)=>{var r=n(7854),o=n(8324),i=n(8509),s=n(8533),a=n(8880),l=function(t){if(t&&t.forEach!==s)try{a(t,"forEach",s)}catch(e){t.forEach=s}};for(var c in o)o[c]&&l(r[c]&&r[c].prototype);l(i)},3948:(t,e,n)=>{var r=n(7854),o=n(8324),i=n(8509),s=n(6992),a=n(8880),l=n(5112),c=l("iterator"),u=l("toStringTag"),d=s.values,p=function(t,e){if(t){if(t[c]!==d)try{a(t,c,d)}catch(e){t[c]=d}if(t[u]||a(t,u,e),o[e])for(var n in s)if(t[n]!==s[n])try{a(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var h in o)p(r[h]&&r[h].prototype,h);p(i,"DOMTokenList")},1296:(t,e,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,f=function(){return u.Date.now()};function m(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==d.call(t)}(t))return NaN;if(m(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=m(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var n=i.test(t);return n||s.test(t)?a(t.slice(2),n?2:8):o.test(t)?NaN:+t}t.exports=function(t,e,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=r,i=o;return r=o=void 0,c=e,s=t.apply(i,n)}function b(t){return c=t,a=setTimeout(x,e),u?y(t):s}function w(t){var n=t-l;return void 0===l||n>=e||n<0||d&&t-c>=i}function x(){var t=f();if(w(t))return S(t);a=setTimeout(x,function(t){var n=e-(t-l);return d?h(n,i-(t-c)):n}(t))}function S(t){return a=void 0,g&&r?y(t):(r=o=void 0,s)}function O(){var t=f(),n=w(t);if(r=arguments,o=this,l=t,n){if(void 0===a)return b(l);if(d)return a=setTimeout(x,e),y(l)}return void 0===a&&(a=setTimeout(x,e)),s}return e=v(e)||0,m(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(v(n.maxWait)||0,e):i,g="trailing"in n?!!n.trailing:g),O.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},O.flush=function(){return void 0===a?s:S(f())},O}},773:(t,e,n)=>{var r,o="__lodash_hash_undefined__",i=/^\[object .+?Constructor\]$/,s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,l=s||a||Function("return this")(),c=Array.prototype,u=Function.prototype,d=Object.prototype,p=l["__core-js_shared__"],h=(r=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",f=u.toString,m=d.hasOwnProperty,v=d.toString,g=RegExp("^"+f.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=c.splice,b=C(l,"Map"),w=C(Object,"create");function x(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function S(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function O(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function k(t,e){for(var n,r,o=t.length;o--;)if((n=t[o][0])===(r=e)||n!=n&&r!=r)return o;return-1}function E(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function C(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){if(!T(t)||h&&h in t)return!1;var e=function(t){var e=T(t)?v.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?g:i;return e.test(function(t){if(null!=t){try{return f.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}(n)?n:void 0}function M(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s),s};return n.cache=new(M.Cache||O),n}function T(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}x.prototype.clear=function(){this.__data__=w?w(null):{}},x.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},x.prototype.get=function(t){var e=this.__data__;if(w){var n=e[t];return n===o?void 0:n}return m.call(e,t)?e[t]:void 0},x.prototype.has=function(t){var e=this.__data__;return w?void 0!==e[t]:m.call(e,t)},x.prototype.set=function(t,e){return this.__data__[t]=w&&void 0===e?o:e,this},S.prototype.clear=function(){this.__data__=[]},S.prototype.delete=function(t){var e=this.__data__,n=k(e,t);return!(n<0||(n==e.length-1?e.pop():y.call(e,n,1),0))},S.prototype.get=function(t){var e=this.__data__,n=k(e,t);return n<0?void 0:e[n][1]},S.prototype.has=function(t){return k(this.__data__,t)>-1},S.prototype.set=function(t,e){var n=this.__data__,r=k(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},O.prototype.clear=function(){this.__data__={hash:new x,map:new(b||S),string:new x}},O.prototype.delete=function(t){return E(this,t).delete(t)},O.prototype.get=function(t){return E(this,t).get(t)},O.prototype.has=function(t){return E(this,t).has(t)},O.prototype.set=function(t,e){return E(this,t).set(t,e),this},M.Cache=O,t.exports=M},3096:(t,e,n)=>{var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function g(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==p.call(t)}(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=s.test(t);return n||a.test(t)?l(t.slice(2),n?2:8):i.test(t)?NaN:+t}t.exports=function(t,e,n){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(r);return v(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(t,e,n){var o,i,s,a,l,c,u=0,d=!1,p=!1,y=!0;if("function"!=typeof t)throw new TypeError(r);function b(e){var n=o,r=i;return o=i=void 0,u=e,a=t.apply(r,n)}function w(t){return u=t,l=setTimeout(S,e),d?b(t):a}function x(t){var n=t-c;return void 0===c||n>=e||n<0||p&&t-u>=s}function S(){var t=m();if(x(t))return O(t);l=setTimeout(S,function(t){var n=e-(t-c);return p?f(n,s-(t-u)):n}(t))}function O(t){return l=void 0,y&&o?b(t):(o=i=void 0,a)}function k(){var t=m(),n=x(t);if(o=arguments,i=this,c=t,n){if(void 0===l)return w(c);if(p)return l=setTimeout(S,e),b(c)}return void 0===l&&(l=setTimeout(S,e)),a}return e=g(e)||0,v(n)&&(d=!!n.leading,s=(p="maxWait"in n)?h(g(n.maxWait)||0,e):s,y="trailing"in n?!!n.trailing:y),k.cancel=function(){void 0!==l&&clearTimeout(l),u=0,o=c=i=l=void 0},k.flush=function(){return void 0===l?a:O(m())},k}(t,e,{leading:o,maxWait:e,trailing:i})}},8274:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm-3 4H8v2h12v-2Zm3 4H5v2h18v-2ZM8 19h12v2H8v-2Z" clip-rule="evenodd"/>\n</svg>\n'},8768:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm0 4H5v2h18v-2Zm0 4H5v2h18v-2ZM5 19h18v2H5v-2Z" clip-rule="evenodd"/>\n</svg>\n'},2449:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm-6 4H5v2h12v-2Zm6 4H5v2h18v-2ZM5 19h12v2H5v-2Z" clip-rule="evenodd"/>\n</svg>\n'},2515:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm0 4H11v2h12v-2Zm0 4H5v2h18v-2Zm-12 4h12v2H11v-2Z" clip-rule="evenodd"/>\n</svg>\n'},548:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m4 6.934 4-5H0l4 5Z" clip-rule="evenodd"/>\n</svg>\n'},1881:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M22 20.62a2.42 2.42 0 0 1-4.84 0c0-1.25 2.42-4.54 2.42-4.54S22 19.37 22 20.62ZM9.92 15.425l1.452-3.951c.071-.182.145-.394.219-.636.074-.242.149-.503.226-.783a17.223 17.223 0 0 0 .454 1.402l1.452 3.968H9.919Zm5.411 4.199c.226-.795.658-1.684 1.184-2.562L12.955 8h-2.269L6 19.93h1.725a.736.736 0 0 0 .474-.157.792.792 0 0 0 .26-.347l.891-2.434h4.941l.891 2.434c.031.079.097.134.148.198Z" clip-rule="evenodd"/>\n</svg>\n'},9464:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M16.64 19.93h-1.715a.75.75 0 0 1-.475-.145.82.82 0 0 1-.268-.359l-.89-2.433H8.35l-.891 2.433a.78.78 0 0 1-.26.347.73.73 0 0 1-.475.157H5L9.686 8h2.269l4.686 11.93Zm-7.72-4.505h3.803l-1.452-3.968a18.048 18.048 0 0 1-.219-.623c-.08-.24-.158-.5-.235-.78-.077.28-.152.542-.227.784a8.742 8.742 0 0 1-.218.635L8.92 15.425Zm14.968 4.505h-.915a.987.987 0 0 1-.454-.087c-.11-.058-.192-.175-.248-.35l-.181-.603a7.005 7.005 0 0 1-.631.507c-.206.146-.42.269-.64.368a3.26 3.26 0 0 1-.7.222c-.248.05-.523.075-.826.075-.357 0-.687-.049-.99-.145a2.134 2.134 0 0 1-.78-.433 1.967 1.967 0 0 1-.507-.718 2.545 2.545 0 0 1-.181-.998c0-.319.084-.634.251-.945.168-.31.447-.59.838-.841.39-.25.91-.458 1.559-.623.649-.165 1.455-.258 2.417-.28v-.495c0-.567-.12-.986-.359-1.259-.239-.272-.587-.408-1.043-.408-.33 0-.605.039-.825.116a3.17 3.17 0 0 0-.574.26 25.11 25.11 0 0 1-.45.26.912.912 0 0 1-.453.115.59.59 0 0 1-.355-.107.843.843 0 0 1-.239-.264l-.371-.652c.973-.891 2.148-1.337 3.523-1.337.494 0 .936.081 1.324.244.387.162.716.387.985.676.27.289.475.634.615 1.036.14.401.21.841.21 1.32v5.346Zm-3.96-1.271c.21 0 .402-.02.578-.058.176-.038.342-.096.5-.173.156-.077.307-.172.453-.285a4.13 4.13 0 0 0 .441-.4v-1.427c-.594.027-1.09.078-1.489.153a3.967 3.967 0 0 0-.961.284c-.242.116-.414.25-.516.404a.894.894 0 0 0-.152.504c0 .357.106.613.317.767.212.154.489.231.83.231Z" clip-rule="evenodd"/>\n</svg>\n'},9747:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="#fff" stroke="#B3B3B3" d="M4.5 4.5h19v19h-19z"/>\n <path fill="#3B3B3B" d="M26 20.7a2.51 2.51 0 0 1-5 0c0-1.31 2.5-4.7 2.5-4.7s2.5 3.39 2.5 4.7Z"/>\n <path fill="#3B3B3B" fill-rule="evenodd" d="M19.64 19.93h-1.715a.75.75 0 0 1-.475-.145.82.82 0 0 1-.268-.359l-.89-2.433h-4.943l-.89 2.433a.78.78 0 0 1-.26.347.73.73 0 0 1-.475.157H8L12.686 8h2.269l4.686 11.93Zm-7.721-4.505h3.803l-1.452-3.968a18.048 18.048 0 0 1-.219-.623c-.08-.24-.158-.5-.235-.78-.077.28-.152.542-.227.784a8.742 8.742 0 0 1-.218.635l-1.452 3.952Z" clip-rule="evenodd"/>\n</svg>\n'},9441:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" d="M18 9V7h-7v2h2.64l-1.22 10H10v2h7v-2h-2.83L15.4 9H18Z"/>\n</svg>\n'},4140:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m5 10 3-3 3 3H9v8h2l-3 3-3-3h2v-8H5Zm8-3h10v2H13V7Zm10 6H13v2h10v-2Zm0 6H13v2h10v-2Z" clip-rule="evenodd"/>\n</svg>\n'},1304:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <rect width="9" height="9" x="9.5" y="9.5" stroke="var(--zw-icon-foreground)" rx="4.5"/>\n</svg>\n'},2412:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" d="M15.108 18.184V19H10.5v-.816h1.842v-5.862c0-.176.006-.354.018-.534l-1.53 1.314a.375.375 0 0 1-.156.084.373.373 0 0 1-.27-.048.318.318 0 0 1-.084-.078l-.336-.462 2.562-2.214h.87v7.8h1.692Zm1.519.156a.8.8 0 0 1 .054-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n'},4311:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <rect width="10" height="10" x="9" y="9" fill="var(--zw-icon-foreground)" rx="5"/>\n</svg>\n'},1477:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" d="M12.086 9.802h.834v11.292h-.834V9.802Zm2.592 8.538a.8.8 0 0 1 .054-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n'},5400:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" d="m13.664 15.808-1.35-3.498a7.11 7.11 0 0 1-.252-.804c-.084.324-.17.594-.258.81l-1.35 3.492h3.21ZM16.088 19h-.9a.387.387 0 0 1-.252-.078.48.48 0 0 1-.144-.198l-.804-2.076H10.13l-.804 2.076a.421.421 0 0 1-.138.192.383.383 0 0 1-.252.084h-.9l3.438-8.598h1.176L16.088 19Zm.7-.66a.8.8 0 0 1 .053-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n'},2807:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" d="M9 9h10v10H9z"/>\n</svg>\n'},6495:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M14.089 6.726a1 1 0 0 1 1.425-.003l6.8 6.882a1 1 0 0 1 .007 1.398L17.2 20.3l-.2.2c-2.2 2.1-5.7 2-7.8-.2l-3.516-3.6a1 1 0 0 1 0-1.399l8.405-8.575Zm1.81 12.674c.1 0 .2 0 .2-.1l4.8-5-6.1-6.2-5 5.1 6.1 6.2Z" clip-rule="evenodd"/>\n</svg>\n'},7522:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" d="M14 9.333V6.666l-3.334 3.333L14 13.333v-2.667c2.206 0 4 1.793 4 4s-1.794 4-4 4c-2.207 0-4-1.793-4-4H8.666A5.332 5.332 0 0 0 14 19.999a5.332 5.332 0 0 0 5.333-5.333A5.332 5.332 0 0 0 14 9.333Z"/>\n</svg>\n'},9976:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m14 12.731.77.27H20v2H8v-2h2.84a2.892 2.892 0 0 1-.46-.71 3.61 3.61 0 0 1-.29-1.52c0-.484.1-.964.29-1.41a3.5 3.5 0 0 1 .83-1.2 4 4 0 0 1 1.35-.84 4.74 4.74 0 0 1 1.83-.32 6 6 0 0 1 2.11.41 5 5 0 0 1 1.68 1l-.46.88a.69.69 0 0 1-.18.22.41.41 0 0 1-.25.07.69.69 0 0 1-.39-.16 5.551 5.551 0 0 0-.56-.36 4.641 4.641 0 0 0-.8-.36 3.44 3.44 0 0 0-1.14-.16 3.16 3.16 0 0 0-1.11.17 2.29 2.29 0 0 0-.8.45 1.87 1.87 0 0 0-.49.67 2.138 2.138 0 0 0-.11.79c-.023.357.08.711.29 1 .206.267.465.489.76.65.338.187.693.34 1.06.46Zm1.99 6.06c.24-.22.427-.49.55-.79.135-.315.2-.657.19-1h1.74a4.58 4.58 0 0 1-.25 1.38 4 4 0 0 1-.91 1.37 4.231 4.231 0 0 1-1.46.92 5.503 5.503 0 0 1-2 .33 6.13 6.13 0 0 1-2.5-.46 5.66 5.66 0 0 1-1.89-1.31l.54-.88a.61.61 0 0 1 .19-.17.45.45 0 0 1 .25-.07.5.5 0 0 1 .28.1c.128.077.251.16.37.25l.46.33c.19.13.391.243.6.34.245.107.5.191.76.25.328.076.664.11 1 .1a3.67 3.67 0 0 0 1.19-.18c.328-.109.63-.282.89-.51Z" clip-rule="evenodd"/>\n</svg>\n'},9857:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" d="M21.985 8.625h-1.75V9.5h2.625v.875h-3.5v-1.75c0-.481.394-.875.875-.875h1.75v-.875H19.36V6h2.625c.481 0 .875.394.875.875v.875a.878.878 0 0 1-.875.875ZM7.88 20h2.327l2.975-4.742h.105L16.262 20h2.328l-4.069-6.361L18.32 7.75h-2.345l-2.687 4.366h-.105L10.48 7.75H8.15l3.78 5.889L7.88 20Z"/>\n</svg>\n'},6031:t=>{"use strict";t.exports='<svg style="width: var(--zw-icon-width); height: var(--zw-icon-height)" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M15.4 16.06a3.3 3.3 0 0 1-1.4.29 3.12 3.12 0 0 1-1.39-.29 2.88 2.88 0 0 1-1.05-.81 3.711 3.711 0 0 1-.65-1.25 5.659 5.659 0 0 1-.22-1.6V7H9v5.41a6.89 6.89 0 0 0 .34 2.22 5.29 5.29 0 0 0 1 1.77c.437.501.975.904 1.58 1.18A5 5 0 0 0 14 18a5 5 0 0 0 2.08-.42 4.61 4.61 0 0 0 1.57-1.18 5.27 5.27 0 0 0 1-1.77 6.89 6.89 0 0 0 .35-2.22V7h-1.69v5.41a5.659 5.659 0 0 1-.22 1.59 3.71 3.71 0 0 1-.69 1.25c-.27.34-.61.617-1 .81ZM20 19H8v2h12v-2Z" clip-rule="evenodd"/>\n</svg>\n'},7061:(t,e,n)=>{var r=n(8698).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,i=n.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),s=new C(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var a=O(s,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=p(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,s),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h={};function f(){}function m(){}function v(){}var g={};u(g,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(M([])));b&&b!==n&&i.call(b,a)&&(g=b);var w=v.prototype=f.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,s,a,l){var c=p(t[o],t,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,l)}))}l(c.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=p(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function M(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:T}}function T(){return{value:void 0,done:!0}}return m.prototype=v,u(w,"constructor",v),u(v,"constructor",m),m.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,l,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new S(d(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},8698:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},4687:(t,e,n)=>{var r=n(7061)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{Wysiwyg:()=>yh});var t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"out-click",rawName:"v-out-click",value:{onOutClick:t.hideToolbar,isDisabled:!t.toolbar.isShow.value},expression:"{ onOutClick: hideToolbar, isDisabled: !toolbar.isShow.value }"}],ref:"wysiwygRef",staticClass:"zw-wysiwyg"},[n("Toolbar",{directives:[{name:"show",rawName:"v-show",value:t.toolbar.isShow.value,expression:"toolbar.isShow.value"}],ref:"toolbarRef",attrs:{editor:t.editor,device:t.device}}),t._v(" "),n("EditorContent",{attrs:{editor:t.editor}})],1)};function e(t){this.content=t}t._withStripped=!0,e.prototype={constructor:e,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,n,r){var o=r&&r!=t?this.remove(r):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(r||t,n):(s[i+1]=n,r&&(s[i]=r)),new e(s)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new e(r)},addToStart:function(t,n){return new e([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new e(r)},addBefore:function(t,n,r){var o=this.remove(n),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,n,r),new e(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=e.from(t)).size?new e(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=e.from(t)).size?new e(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=e.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},get size(){return this.content.length>>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)};const o=e;function i(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o!=s){if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let t=0;o.text[t]==s.text[t];t++)n++;return n}if(o.content.size||s.content.size){let t=i(o.content,s.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function s(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let a=t.child(--o),l=e.child(--i),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;t<e&&a.text[a.text.length-t-1]==l.text[l.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let t=s(a.content,l.content,n-1,r-1);if(t)return t}n-=c,r-=c}else n-=c,r-=c}}class a{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new a(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new a(n,r)}cutByIndex(t,e){return t==e?a.empty:0==t&&e==this.content.length?this:new a(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new a(r,o)}addToStart(t){return new a([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new a(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return i(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return s(this,t,e,n)}findIndex(t,e=-1){if(0==t)return c(0,t);if(t==this.size)return c(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?c(n+1,o):c(n,r);r=o}}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 a.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new a(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return a.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new a(e||t,n)}static from(t){if(!t)return a.empty;if(t instanceof a)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new a([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}a.empty=new a([],0);const l={index:0,offset:0};function c(t,e){return l.index=t,l.offset=e,l}function u(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!u(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!u(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class d{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&u(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return d.none;if(t instanceof d)return[t];let e=t.slice();return e.sort(((t,e)=>t.type.rank-e.type.rank)),e}}d.none=[];class p extends Error{}class h{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=m(this.content,t+this.openStart,e);return n&&new h(n,this.openStart,this.openEnd)}removeBetween(t,e){return new h(f(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 h.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new h(a.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 h(t,n,r)}}function f(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(f(i.content,e-o-1,n-o-1)))}function m(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=m(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function v(t,e,n){if(n.openStart>t.depth)throw new p("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new p("Inconsistent open depths");return g(t,e,n,0)}function g(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=g(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(a.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return S(i,O(t,o,s,e,r))}{let r=t.parent,o=r.content;return S(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return S(i,k(t,e,r))}function y(t,e){if(!e.type.compatibleContent(t.type))throw new p("Cannot join "+e.type.name+" onto "+t.type.name)}function b(t,e,n){let r=t.node(n);return y(r,e.node(n)),r}function w(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 x(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(w(t.nodeAfter,r),i++));for(let t=i;t<s;t++)w(o.child(t),r);e&&e.depth==n&&e.textOffset&&w(e.nodeBefore,r)}function S(t,e){if(!t.type.validContent(e))throw new p("Invalid content for node "+t.type.name);return t.copy(e)}function O(t,e,n,r,o){let i=t.depth>o&&b(t,e,o+1),s=r.depth>o&&b(n,r,o+1),l=[];return x(null,t,o,l),i&&s&&e.index(o)==n.index(o)?(y(i,s),w(S(i,O(t,e,n,r,o+1)),l)):(i&&w(S(i,k(t,e,o+1)),l),x(e,n,o,l),s&&w(S(s,k(n,r,o+1)),l)),x(r,null,o,l),new a(l)}function k(t,e,n){let r=[];return x(null,t,n,r),t.depth>n&&w(S(b(t,e,n+1),k(t,e,n+1)),r),x(e,null,n,r),new a(r)}h.empty=new h(a.empty,0,0);class E{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 new 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 new 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;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return d.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new A(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<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new E(e,n,o)}static resolveCached(t,e){for(let n=0;n<C.length;n++){let r=C[n];if(r.pos==e&&r.doc==t)return r}let n=C[M]=E.resolve(t,e);return M=(M+1)%T,n}}let C=[],M=0,T=12;class A{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const N=Object.create(null);class D{constructor(t,e,n,r=d.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||a.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&u(this.attrs,e||t.defaultAttrs||N)&&d.sameSet(this.marks,n||d.none)}copy(t=null){return t==this.content?this:new D(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new D(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return h.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new h(a,r.depth-i,o.depth-i)}replace(t,e,n){return v(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),!e)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(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return E.resolveCached(this,t)}resolveNoCache(t){return E.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&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()+")"),R(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=a.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let t=d.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!d.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t=>t.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){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=a.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}D.prototype.text=void 0;class _ extends D{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):R(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 _(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new _(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 R(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class I{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new z(t,e);if(null==n.next)return I.empty;let r=L(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);$(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new I(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(V);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}($(t,0))}(function(t){let e=[[]];return o(function t(e,i){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(t(n,i))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(i,s),o(t(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(t(e.expr,i),s),o(t(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(i)].concat(t(e.expr,i));if("range"==e.type){let s=i;for(let r=0;r<e.min;r++){let r=n();o(t(e.expr,s),r),s=r}if(-1==e.max)o(t(e.expr,s),s);else for(let i=e.min;i<e.max;i++){let i=n();r(s,i),o(t(e.expr,s),i),s=i}return[r(s)]}if("name"==e.type)return[r(i,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=t(e.exprs[r],i);if(r==e.exprs.length-1)return s;o(s,i=n())}}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let l=i.matchFragment(t,n);if(l&&(!e||l.validEnd))return a.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r})).join("\n")}}I.empty=new I(!0);class z{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 new SyntaxError(t+" (in content expression '"+this.string+"')")}}function L(t){let e=[];do{e.push(P(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function P(t){let e=[];do{e.push(B(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function B(t){let e=function(t){if(t.eat("(")){let e=L(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&o.push(r)}return 0==o.length&&t.err("No node type or group '"+e+"' found"),o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=j(t,e)}return e}function F(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function j(t,e){let n=F(t),r=n;return t.eat(",")&&(r="}"!=t.next?F(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function V(t,e){return e-t}function $(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(V)}function H(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function W(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function q(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new G(t[n]);return e}class U{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=q(n.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==I.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new D(this,this.computeAttrs(t),a.from(e),d.setFrom(n))}createChecked(t=null,e,n){if(e=a.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new D(this,this.computeAttrs(t),e,d.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=a.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(a.empty,!0);return o?new D(this,t,e.append(o),d.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:d.none:t}static compile(t,e){let n=Object.create(null);t.forEach(((t,r)=>n[t]=new U(t,e,r)));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class G{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class K{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=q(r.attrs),this.excluded=null;let o=H(this.attrs);this.instance=o?new d(this,o):null}create(t=null){return!t&&this.instance?this.instance:new d(this,W(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new K(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class J{constructor(t){this.cached=Object.create(null),this.spec={nodes:o.from(t.nodes),marks:o.from(t.marks||{}),topNode:t.topNode},this.nodes=U.compile(this.spec.nodes,this),this.marks=K.compile(this.spec.marks,this);let e=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let n=this.nodes[t],r=n.spec.content||"",o=n.spec.marks;n.contentMatch=e[r]||(e[r]=I.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?Z(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:Z(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof U))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new _(n,n.defaultAttrs,t,d.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return D.fromJSON(this,t)}markFromJSON(t){return d.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Z(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class X{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&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 rt(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new rt(this,e,!0);return n.addAll(t,e.from,e.to),h.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(ot(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.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<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach((t=>{n(t=it(t)),t.mark=e}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=it(t)),t.node=e}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new X(t,X.schemaRules(t)))}}const Y={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},Q={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tt={ol:!0,ul:!0};function et(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class nt{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=d.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(a.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=a.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(a.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):st(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Y.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class rt{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=et(null,e.preserveWhitespace,0)|(n?4:0);r=o?new nt(o.type,o.attrs,d.none,d.none,!0,e.topMatch||o.type.contentMatch,i):new nt(n?null:t.schema.topNodeType,null,d.none,d.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let e=t.getAttribute("style"),n=e?this.readStyles(function(t){let e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(let t=0;t<n.length;t++)this.addPendingMark(n[t]);if(this.addElement(t),null!=n)for(let t=0;t<n.length;t++)this.removePendingMark(n[t],r)}}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n,r=t.nodeName.toLowerCase();tt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&tt.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:Q.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let e,n=this.top,i=this.needsBlock;if(Y.hasOwnProperty(r))e=!0,n.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),e&&this.sync(n),this.needsBlock=i}else this.addElementByRule(t,o,!1===o.consuming?n:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=d.none;t:for(let n=0;n<t.length;n+=2)for(let r;;){let o=this.parser.matchStyle(t[n],t[n+1],this,r);if(!o)continue t;if(o.ignore)return null;if(e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;r=o}return e}addElementByRule(t,e,n){let r,o,i;e.node?(o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs||null,e.preserveWhitespace)):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)e.type&&!e.type.allowsMarkType(t.marks[r].type)||(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let i=et(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new nt(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}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;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<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-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),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(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}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function ot(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function it(t){let e={};for(let n in t)e[n]=t[n];return e}function st(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class at{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=ct(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=at.renderSpec(ct(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&at.renderSpec(ct(n),r(t,e))}static renderSpec(t,e,n=null){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 r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let o=l;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=at.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new at(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=lt(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return lt(t.marks)}}function lt(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ct(t){return t.document||window.document}const ut=Math.pow(2,16);function dt(t){return 65535&t}class pt{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 ht{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&ht.empty)return ht.empty}recover(t){let e=0,n=dt(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/ut}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(t<=u){let o=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:u)?null:s/3+(t-a)*ut,d=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(d|=8),new pt(o,d,i)}r+=c-l}return n?t+r:new pt(t+r,0,null)}touches(t,e){let n=0,r=dt(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),o+=c-l}}invert(){return new ht(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?ht.empty:new ht(t<0?[0,-t,0]:[0,0,t])}}ht.empty=new ht([]);class ft{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new ft(this.maps,this.mirror,t,e)}copy(){return new ft(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=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 ft;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new pt(t,r,null)}}const mt=Object.create(null);class vt{getMap(){return ht.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=mt[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in mt)throw new RangeError("Duplicate use of step JSON ID "+t);return mt[t]=e,e.prototype.jsonID=t,e}}class gt{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new gt(t,null)}static fail(t){return new gt(null,t)}static fromReplace(t,e,n,r){try{return gt.ok(t.replace(e,n,r))}catch(t){if(t instanceof p)return gt.fail(t.message);throw t}}}function yt(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(yt(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return a.fromArray(r)}class bt extends vt{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=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new h(yt(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return gt.fromReplace(t,this.from,this.to,o)}invert(){return new wt(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 bt(e.pos,n.pos,this.mark)}merge(t){return t instanceof bt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new bt(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 new RangeError("Invalid input for AddMarkStep.fromJSON");return new bt(e.from,e.to,t.markFromJSON(e.mark))}}vt.jsonID("addMark",bt);class wt extends vt{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 h(yt(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return gt.fromReplace(t,this.from,this.to,n)}invert(){return new bt(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 wt(e.pos,n.pos,this.mark)}merge(t){return t instanceof wt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new wt(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 new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wt(e.from,e.to,t.markFromJSON(e.mark))}}vt.jsonID("removeMark",wt);class xt extends vt{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&Ot(t,this.from,this.to)?gt.fail("Structure replace would overwrite content"):gt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new ht([this.from,this.to-this.from,this.slice.size])}invert(t){return new xt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new xt(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof xt)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?h.empty:new h(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new xt(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?h.empty:new h(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new xt(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new xt(e.from,e.to,h.fromJSON(t,e.slice),!!e.structure)}}vt.jsonID("replace",xt);class St extends vt{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(Ot(t,this.from,this.gapFrom)||Ot(t,this.gapTo,this.to)))return gt.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return gt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?gt.fromReplace(t,this.from,this.to,n):gt.fail("Content does not fit in gap")}getMap(){return new ht([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new St(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new St(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new St(e.from,e.to,e.gapFrom,e.gapTo,h.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Ot(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function kt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Et(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!kt(r,o,i))break}return null}function Ct(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(Mt).concat({type:e,attrs:n}).concat(i.map(Mt)):null}function Mt(t){return{type:t,attrs:null}}function Tt(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function At(t,e){let n=t.resolve(e),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function Nt(t,e,n=e,r=h.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Dt(o,i,r)?new xt(e,n,r):new _t(o,i,r).fit()}function Dt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}vt.jsonID("replaceAround",St);class _t{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=a.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=a.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,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new h(o,i,s);return t>-1?new St(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new xt(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=zt(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:l}=this.frontier[n],c=null;if(1==t&&(o?l.matchType(o.type)||(c=l.fillBefore(a.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:n,parent:r,inject:c};if(2==t&&o&&(i=l.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:n,parent:r,wrap:i};if(r&&l.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=zt(t,e);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new h(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),0))}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=zt(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new h(Rt(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new h(Rt(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,l=i.openStart-t,c=0,u=[],{match:d,type:p}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)u.push(r.child(t));d=d.matchFragment(r)}let f=s.size+t-(i.content.size-i.openEnd);for(;c<s.childCount;){let t=s.child(c),e=d.matchType(t.type);if(!e)break;c++,(c>1||0==l||t.content.size)&&(d=e,u.push(Lt(t.mark(p.allowedMarks(t.marks)),1==c?l:0,c==s.childCount?f:-1)))}let m=c==s.childCount;m||(f=-1),this.placed=It(this.placed,e,a.from(u)),this.frontier[e].match=d,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<f;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=m?0==t?h.empty:new h(Rt(i.content,t-1,1),t-1,f<0?i.openEnd:t-1):new h(Rt(i.content,t,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Pt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=Pt(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=Pt(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?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=It(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 r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=It(this.placed,this.depth,a.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(a.empty,!0);t.childCount&&(this.placed=It(this.placed,this.frontier.length,t))}}function Rt(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Rt(t.firstChild.content,e-1,n)))}function It(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(It(t.lastChild.content,e-1,n)))}function zt(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Lt(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Lt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(a.empty,!0)))),t.copy(r)}function Pt(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function Bt(t){return t.spec.defining||t.spec.definingForContent}function Ft(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Ft(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(a.empty,!0))}return t}function jt(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}let Vt=class extends Error{};Vt=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Vt.prototype=Object.create(Error.prototype)).constructor=Vt,Vt.prototype.name="TransformError";const $t=Object.create(null);class Ht{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Wt(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<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=h.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=t.mapping.slice(o);t.replaceRange(c.map(a.pos),c.map(l.pos),s?h.empty:e),0==s&&te(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),te(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Gt(t):Qt(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?Qt(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Qt(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Xt(t.node(0))}static atStart(t){return Qt(t,t,0,0,1)||new Xt(t)}static atEnd(t){return Qt(t,t,t.content.size,t.childCount,-1)||new Xt(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=$t[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in $t)throw new RangeError("Duplicate use of selection JSON ID "+t);return $t[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Gt.between(this.$anchor,this.$head).getBookmark()}}Ht.prototype.visible=!0;class Wt{constructor(t,e){this.$from=t,this.$to=e}}let qt=!1;function Ut(t){qt||t.parent.inlineContent||(qt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Gt extends Ht{constructor(t,e=t){Ut(t),Ut(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 Ht.near(n);let r=t.resolve(e.map(this.anchor));return new Gt(r.parent.inlineContent?r:n,n)}replace(t,e=h.empty){if(super.replace(t,e),e==h.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Gt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Kt(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 new RangeError("Invalid input for TextSelection.fromJSON");return new Gt(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=Ht.findFrom(e,n,!0)||Ht.findFrom(e,-n,!0);if(!t)return Ht.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Ht.findFrom(t,-n,!0)||Ht.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Gt(t,e)}}Ht.jsonID("text",Gt);class Kt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Kt(t.map(this.anchor),t.map(this.head))}resolve(t){return Gt.between(t.resolve(this.anchor),t.resolve(this.head))}}class Jt extends Ht{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?Ht.near(o):new Jt(o)}content(){return new h(a.from(this.node),0,0)}eq(t){return t instanceof Jt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Zt(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Jt(t.resolve(e.anchor))}static create(t,e){return new Jt(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Jt.prototype.visible=!1,Ht.jsonID("node",Jt);class Zt{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new Kt(n,n):new Zt(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Jt.isSelectable(n)?new Jt(e):Ht.near(e)}}class Xt extends Ht{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=h.empty){if(e==h.empty){t.delete(0,t.doc.content.size);let e=Ht.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Xt(t)}map(t){return new Xt(t)}eq(t){return t instanceof Xt}getBookmark(){return Yt}}Ht.jsonID("all",Xt);const Yt={map(){return this},resolve:t=>new Xt(t)};function Qt(t,e,n,r,o,i=!1){if(e.inlineContent)return Gt.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Jt.isSelectable(r))return Jt.create(t,n-(o<0?r.nodeSize:0))}else{let e=Qt(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function te(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof xt||i instanceof St)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(Ht.near(t.doc.resolve(o),n)))}class ee extends class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ft}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Vt(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}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=h.empty){let r=Nt(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new h(a.from(n),0,0))}delete(t,e){return this.replace(t,e,h.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(Dt(o,i,r))return t.step(new xt(e,n,r));let s=jt(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let l=s.indexOf(a),c=[],u=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==r.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){let e=c[t].type,n=Bt(e);if(n&&o.node(l).type!=e)u=t;else if(n||!e.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+u+1)%(r.openStart+1),d=c[a];if(d)for(let e=0;e<s.length;e++){let c=s[(e+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),f=o.index(c-1);if(p.canReplaceWith(f,f,d.type,d.marks))return t.replace(o.before(c),u?i.after(c):n,new h(Ft(r.content,0,r.openStart,a),a,r.openEnd))}}let d=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>d));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=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(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new h(a.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=jt(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),l=o.after(i+1),c=s,u=l,d=a.empty,p=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,d=a.from(r.node(t).copy(d)),p++):c--;let f=a.empty,m=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,f=a.from(o.node(t).copy(f)),m++):u++;t.step(new St(c,u,s,l,new h(d.append(f),p,m),d.size-p,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new xt(e-n,e+n,h.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=a.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=a.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new St(o,i,o,i,new h(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),l=s.map(n,1),c=s.map(n+e.nodeSize,1);return t.step(new St(l,c,l+1,c-1,new h(a.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new St(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new h(a.from(s),0,0),1,!0))}(this,t,e,n,r),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=a.empty,s=a.empty;for(let t=o.depth,e=o.depth-n,l=n-1;t>e;t--,l--){i=a.from(o.node(t).copy(i));let e=r&&r[l];s=a.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new xt(e,e,new h(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),d=Math.min(l+t.nodeSize,n),p=r.addToSet(u);for(let t=0;t<u.length;t++)u[t].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[t])?o.to=d:s.push(o=new wt(c,d,u[t])));i&&i.to==c?i.to=d:a.push(i=new bt(c,d,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof K){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,l=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&l.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,e),to:r,step:i})}}})),o.forEach((e=>t.step(new wt(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let e=0;e<o.childCount;e++){let a=o.child(e),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let e=0;e<a.marks.length;e++)n.allowsMarkType(a.marks[e].type)||t.step(new wt(s,l,a.marks[e]))}else i.push(new xt(s,l,h.empty));s=l}if(!r.validEnd){let e=r.fillBefore(a.empty,!0);t.replace(s,s,new h(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return d.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)||d.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),n=null==n?e:n,!t)return this.deleteRange(e,n);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Ht.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 ne(t,e){return e&&t?t.bind(e):t}class re{constructor(t,e,n){this.name=t,this.init=ne(e.init,n),this.apply=ne(e.apply,n)}}const oe=[new re("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new re("selection",{init:(t,e)=>t.selection||Ht.atStart(e.doc),apply:t=>t.selection}),new re("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new re("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class ie{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=oe.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new 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 re(t.key,t.spec.state,t))}))}}class se{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;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<i?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new se(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}return e}get tr(){return new ee(this)}static create(t){let e=new ie(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new se(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new ie(this.schema,t.plugins),n=e.fields,r=new se(e);for(let e=0;e<n.length;e++){let o=n[e].name;r[o]=this.hasOwnProperty(o)?this[o]:n[e].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((t=>t.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new ie(t.schema,t.plugins),o=new se(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=D.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=Ht.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}})),o}}function ae(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=ae(o,e,{})),n[r]=o}return n}class le{constructor(t){this.spec=t,this.props={},t.props&&ae(t.props,this,this.props),this.key=t.key?t.key.key:ue("plugin")}getState(t){return t[this.key]}}const ce=Object.create(null);function ue(t){return t in ce?t+"$"+ ++ce[t]:(ce[t]=0,t+"$")}class de{constructor(t="key"){this.key=ue(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const pe="undefined"!=typeof navigator?navigator:null,he="undefined"!=typeof document?document:null,fe=pe&&pe.userAgent||"",me=/Edge\/(\d+)/.exec(fe),ve=/MSIE \d/.exec(fe),ge=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(fe),ye=!!(ve||ge||me),be=ve?document.documentMode:ge?+ge[1]:me?+me[1]:0,we=!ye&&/gecko\/(\d+)/i.test(fe);we&&(/Firefox\/(\d+)/.exec(fe)||[0,0])[1];const xe=!ye&&/Chrome\/(\d+)/.exec(fe),Se=!!xe,Oe=xe?+xe[1]:0,ke=!ye&&!!pe&&/Apple Computer/.test(pe.vendor),Ee=ke&&(/Mobile\/\w+/.test(fe)||!!pe&&pe.maxTouchPoints>2),Ce=Ee||!!pe&&/Mac/.test(pe.platform),Me=/Android \d/.test(fe),Te=!!he&&"webkitFontSmoothing"in he.documentElement.style,Ae=Te?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Ne=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},De=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let _e=null;const Re=function(t,e,n){let r=_e||(_e=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},Ie=function(t,e,n,r){return n&&(Le(t,e,n,r,-1)||Le(t,e,n,r,1))},ze=/^(img|br|input|textarea|hr)$/i;function Le(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Pe(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Be(t)||ze.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Ne(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?Pe(t):0}}}function Pe(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Be(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Fe=function(t){let e=t.isCollapsed;return e&&Se&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function je(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Ve(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function $e(t,e){return"number"==typeof t?t:t[e]}function He(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function We(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=De(s)){if(1!=s.nodeType)continue;let t=s,n=t==i.body,a=n?Ve(i):He(t),l=0,c=0;if(e.top<a.top+$e(r,"top")?c=-(a.top-e.top+$e(o,"top")):e.bottom>a.bottom-$e(r,"bottom")&&(c=e.bottom-a.bottom+$e(o,"bottom")),e.left<a.left+$e(r,"left")?l=-(a.left-e.left+$e(o,"left")):e.right>a.right-$e(r,"right")&&(l=e.right-a.right+$e(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let o=t.scrollLeft-n,i=t.scrollTop-r;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}if(n)break}}function qe(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=De(r));return e}function Ue(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Ge=null;function Ke(t,e){let n,r,o=2e8,i=0,s=e.top,a=e.top;for(let l=t.firstChild,c=0;l;l=l.nextSibling,c++){let t;if(1==l.nodeType)t=l.getClientRects();else{if(3!=l.nodeType)continue;t=Re(l).getClientRects()}for(let u=0;u<t.length;u++){let d=t[u];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let t=d.left>e.left?d.left-e.left:d.right<e.left?e.left-d.right:0;if(t<o){n=l,o=t,r=t&&3==n.nodeType?{left:d.right<e.left?d.right:d.left,top:e.top}:e,1==l.nodeType&&t&&(i=c+(e.left>=(d.left+d.right)/2?1:0));continue}}!n&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let n=Ye(r,1);if(n.top!=n.bottom&&Je(e,n))return{node:t,offset:o+(e.left>=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:Ke(n,r)}function Je(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ze(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=t.childNodes[i];if(1==n.nodeType){let t=n.getClientRects();for(let r=0;r<t.length;r++){let o=t[r];if(Je(e,o))return Ze(n,e,o)}}if((i=(i+1)%r)==o)break}return t}function Xe(t,e){let n,r=t.dom.ownerDocument,o=0;if(r.caretPositionFromPoint)try{let t=r.caretPositionFromPoint(e.left,e.top);t&&({offsetNode:n,offset:o}=t)}catch(t){}if(!n&&r.caretRangeFromPoint){let t=r.caretRangeFromPoint(e.left,e.top);t&&({startContainer:n,startOffset:o}=t)}let i,s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top+1);if(!s||!t.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=t.dom.getBoundingClientRect();if(!Je(e,n))return null;if(s=Ze(t.dom,e,n),!s)return null}if(ke)for(let t=s;n&&t;t=De(t))t.draggable&&(n=void 0);if(s=function(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(s,e),n){if(we&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let t,r=n.childNodes[o];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&o++}n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?i=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(i=function(t,e,n,r){let o=-1;for(let n=e;n!=t.dom;){let e=t.docView.nearestDesc(n,!0);if(!e)return null;if(e.node.isBlock&&e.parent){let t=e.dom.getBoundingClientRect();if(t.left>r.left||t.top>r.top)o=e.posBefore;else{if(!(t.right<r.left||t.bottom<r.top))break;o=e.posAfter}}n=e.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,1)}(t,n,o,e))}null==i&&(i=function(t,e,n){let{node:r,offset:o}=Ke(e,n),i=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();i=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function Ye(t,e){let n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}const Qe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tn(t,e,n){let{node:r,offset:o}=t.docView.domFromPos(e,n<0?-1:1),i=Te||we;if(3==r.nodeType){if(!i||!Qe.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let t=o,e=o,i=n<0?1:-1;return n<0&&!o?(e++,i=-1):n>=0&&o==r.nodeValue.length?(t--,i=1):n<0?t--:e++,en(Ye(Re(r,t,e),i),i<0)}{let t=Ye(Re(r,o,o),n);if(we&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let e=Ye(Re(r,o-1,o-1),-1);if(e.top==t.top){let n=Ye(Re(r,o,o+1),-1);if(n.top!=t.top)return en(n,n.left<e.left)}}return t}}if(!t.state.doc.resolve(e).parent.inlineContent){if(o&&(n<0||o==Pe(r))){let t=r.childNodes[o-1];if(1==t.nodeType)return nn(t.getBoundingClientRect(),!1)}if(o<Pe(r)){let t=r.childNodes[o];if(1==t.nodeType)return nn(t.getBoundingClientRect(),!0)}return nn(r.getBoundingClientRect(),n>=0)}if(o&&(n<0||o==Pe(r))){let t=r.childNodes[o-1],e=3==t.nodeType?Re(t,Pe(t)-(i?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return en(Ye(e,1),!1)}if(o<Pe(r)){let t=r.childNodes[o];for(;t.pmViewDesc&&t.pmViewDesc.ignoreForCoords;)t=t.nextSibling;let e=t?3==t.nodeType?Re(t,0,i?0:1):1==t.nodeType?t:null:null;if(e)return en(Ye(e,-1),!0)}return en(Ye(3==r.nodeType?Re(r):r,-n),n>=0)}function en(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function nn(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function rn(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}const on=/[\u0590-\u08ac]/;let sn=null,an=null,ln=!1;class cn{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){let n,r;if(t==this.contentDOM)n=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(t==this.contentDOM)n=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>Ne(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let t=e;t;t=t.parent)if(t==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<o)return r.descAt(t-n-r.border);n=o}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,o=0;for(let e=0;r<this.children.length;r++){let n=this.children[r],i=e+n.size;if(i>t||n instanceof vn){o=t-e;break}e=i}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof un&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;t=r?this.children[r-1]:null,t&&t.dom.parentNode!=this.contentDOM;r--,n=!1);return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?Ne(t.dom)+1:0}}{let t,n=!0;for(;t=r<this.children.length?this.children[r]:null,t&&t.dom.parentNode!=this.contentDOM;r++,n=!1);return t&&n&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?Ne(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,n=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&t<=a){let o=i+n.border;if(t>=o&&e<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,o);t=i;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Ne(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;t<this.children.length;t++){let n=this.children[t];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=Ne(n.dom);break}e+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(1!=e.nodeType||n==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n,r=!1){let o=Math.min(t,e),i=Math.max(t,e);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(t-a-l.border,e-a-l.border,n,r);a=c}let s=this.domFromPos(t,t?-1:1),a=e==t?s:this.domFromPos(e,e?-1:1),l=n.getSelection(),c=!1;if((we||ke)&&t==e){let{node:t,offset:e}=s;if(3==t.nodeType){if(c=!(!e||"\n"!=t.nodeValue[e-1]),c&&e==t.nodeValue.length)for(let e,n=t;n;n=n.parentNode){if(e=n.nextSibling){"BR"==e.nodeName&&(s=a={node:e.parentNode,offset:Ne(e)+1});break}let t=n.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let n=t.childNodes[e-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(we&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let t=l.focusNode.childNodes[l.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||c&&ke)&&Ie(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Ie(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||t==e)&&!c){l.collapse(s.node,s.offset);try{t!=e&&l.extend(a.node,a.offset),u=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!u){if(t>e){let t=s;s=a,a=t}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){let r=n+o.border,s=i-o.border;if(t>=r&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=r||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-r,e-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class un extends cn{constructor(t,e,n,r){let o,i=e.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class dn extends cn{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class pn extends cn{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let o=r.nodeViews[e.type.name],i=o&&o(e,r,n);return i&&i.dom||(i=at.renderSpec(document,e.type.spec.toDOM(e,n))),new pn(t,e,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=0}}slice(t,e,n){let r=pn.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;e<i&&(o=An(o,e,i,n)),t>0&&(o=An(o,0,t,n));for(let t=0;t<o.length;t++)o[t].parent=r;return r.children=o,r}}class hn extends cn{constructor(t,e,n,r,o,i,s,a,l){super(t,[],o,i),this.node=e,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,i&&this.updateChildren(a,l)}static create(t,e,n,r,o,i){let s,a=o.nodeViews[e.type.name],l=a&&a(e,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else c||({dom:c,contentDOM:u}=at.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let d=c;return c=kn(c,n,e),l?s=new gn(t,e,n,r,c,u||null,d,l,o,i+1):e.isText?new mn(t,e,n,r,c,d,o):new hn(t,e,n,r,c,u||null,d,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>a.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&En(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,o=t.composing?this.localCompositionInfo(t,e):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new Mn(this,i&&i.node);!function(t,e,n,r){let o=e.locals(t),i=0;if(0==o.length){for(let n=0;n<t.childCount;n++){let s=t.child(n);r(s,o,e.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==i){let t,e=o[s++];for(;s<o.length&&o[s].to==i;)(t||(t=[e])).push(o[s++]);if(t){t.sort(Tn);for(let e=0;e<t.length;e++)n(t[e],c,!!l)}else n(e,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<t.childCount))break;d=c,u=t.child(c++)}for(let t=0;t<a.length;t++)a[t].to<=i&&a.splice(t--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+u.nodeSize;if(u.isText){let t=p;s<o.length&&o[s].from<t&&(t=o[s].from);for(let e=0;e<a.length;e++)a[e].to<t&&(t=a[e].to);t<p&&(l=u.cut(t-i),u=u.cut(0,t-i),p=t,d=-1)}r(u,u.isInline&&!u.isLeaf?a.filter((t=>!t.inline)):a.slice(),e.forChild(i,u),d),i=p}}(this.node,this.innerDeco,((e,o,i)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?d.none:this.node.child(o).marks,n,t),a.placeWidget(e,t,r)}),((e,i,l,c)=>{let u;a.syncToMarks(e.marks,n,t),a.findNodeMatch(e,i,l,c)||s&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(u=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(e,i,l,u,t)||a.updateNextNode(e,i,l,t,c)||a.addNode(e,i,l,t,r),r+=e.nodeSize})),a.syncToMarks([],n,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),yn(this.contentDOM,this.children,t),Ee&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof Gt)||n<e||r>e+this.node.content.size)return null;let o=t.domSelection(),i=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Pe(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(o.focusNode,o.focusOffset);if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let t=i.nodeValue,o=function(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let e=t.child(o++);if(i+=e.nodeSize,!e.isText)break;l+=e.text}if(i>=n){let t=a<r?l.lastIndexOf(e,r-a-1):-1;if(t>=0&&t+e.length+a>=n)return a+t;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let o=e;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new dn(this,o,e,r);t.input.compositionNodes.push(i),this.children=An(this.children,n,n+r.length,t,i)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node)||(this.updateInner(t,e,n,r),0))}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(En(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Sn(this.dom,this.nodeDOM,xn(this.outerDeco,this.node,e),xn(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function fn(t,e,n,r,o){return kn(r,e,t),new hn(void 0,t,e,n,r,r,r,o,0)}class mn extends hn{constructor(t,e,n,r,o,i,s){super(t,e,n,r,o,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node)||(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,0))}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),o=document.createTextNode(r.text);return new mn(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class vn extends cn{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class gn extends hn{constructor(t,e,n,r,o,i,s,a,l,c){super(t,e,n,r,o,i,s,l,c),this.spec=a}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(t,e,n);return o&&this.updateInner(t,e,n,r),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function yn(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=Cn(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof pn){let e=r?r.previousSibling:t.lastChild;yn(s.contentDOM,s.children,n),r=e?e.nextSibling:t.firstChild}}for(;r;)r=Cn(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const bn=function(t){t&&(this.nodeName=t)};bn.prototype=Object.create(null);const wn=[new bn];function xn(t,e,n){if(0==t.length)return wn;let r=n?wn[0]:new bn,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new bn(s.nodeName));for(let t in s){let i=s[t];null!=i&&(n&&1==o.length&&o.push(r=new bn(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+i:"style"==t?r.style=(r.style?r.style+";":"")+i:"nodeName"!=t&&(r[t]=i))}}}return o}function Sn(t,e,n,r){if(n==wn&&r==wn)return e;let o=e;for(let e=0;e<r.length;e++){let i=r[e],s=n[e];if(e){let e;s&&s.nodeName==i.nodeName&&o!=t&&(e=o.parentNode)&&e.nodeName.toLowerCase()==i.nodeName||(e=document.createElement(i.nodeName),e.pmIsDeco=!0,e.appendChild(o),s=wn[0]),o=e}On(o,s||wn[0],i)}return o}function On(t,e,n){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==o.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<o.length;e++)-1==r.indexOf(o[e])&&t.classList.add(o[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(e.style);)t.style.removeProperty(n[1])}n.style&&(t.style.cssText+=n.style)}}function kn(t,e,n){return Sn(t,t,wn,xn(e,n,1!=t.nodeType))}function En(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Cn(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Mn{constructor(t,e){this.lock=e,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];t:for(;o>0;){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof pn)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n){let r=0,o=this.stack.length>>1,i=Math.min(o,t.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let e=this.index;e<Math.min(this.index+3,this.top.children.length);e++)if(this.top.children[e].matchesMark(t[o])){r=e;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=pn.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(t,e,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(t,e,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,n,r,o){for(let i=this.index;i<this.top.children.length;i++){let s=this.top.children[i];if(s instanceof hn){let a=this.preMatch.matched.get(s);if(null!=a&&a!=o)return!1;let l=s.dom;if((!this.lock||!(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))||t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&En(e,s.outerDeco))&&s.update(t,e,n,r))return this.destroyBetween(this.index,i),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(t,e,n,r,o){this.top.children.splice(this.index++,0,hn.create(this.top,t,e,n,r,o)),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new un(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof pn;)e=t,t=e.children[e.children.length-1];t&&t instanceof mn&&!/\n$/.test(t.node.text)||((ke||Se)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");let r=new vn(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}}function Tn(t,e){return t.type.side-e.type.side}function An(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Nn(t,e=null){let n=t.domSelection(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Fe(n)){for(a=c;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Jt.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==Pe(t);r||o;){if(t==n)return!0;let e=Ne(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==Pe(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new Jt(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}return l||(l=Fn(t,a,c,"pointer"==e||t.state.selection.head<c.pos&&!i?1:-1)),l}function Dn(t){return t.editable?t.hasFocus():Vn(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function _n(t,e=!1){let n=t.state.selection;if(Pn(t,n),Dn(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Se){let e=t.domSelection(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&Ie(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,Ne(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&ye&&be<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!Rn||n instanceof Gt||(n.$from.parent.inlineContent||(r=In(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=In(t,n.to))),t.docView.setSelection(i,s,t.root,e),Rn&&(r&&Ln(r),o&&Ln(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelection(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Dn(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Rn=ke||Se&&Oe<63;function In(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(ke&&o&&"false"==o.contentEditable)return zn(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return zn(o);if(i)return zn(i)}}function zn(t){return t.contentEditable="true",ke&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ln(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Pn(t,e){if(e instanceof Jt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Bn(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Bn(t)}function Bn(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Fn(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||Gt.between(e,n,r)}function jn(t){return(!t.editable||t.root.activeElement==t.dom)&&Vn(t)}function Vn(t){let e=t.domSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function $n(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ht.findFrom(i,e)}function Hn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Wn(t,e,n){let r=t.state.selection;if(!(r instanceof Gt)){if(r instanceof Jt&&r.node.isInline)return Hn(t,new Gt(e>0?r.$to:r.$from));{let n=$n(t.state,e);return!!n&&Hn(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=$n(t.state,e);return!!(n&&n instanceof Jt)&&Hn(t,n)}if(!(Ce&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Jt.isSelectable(i)?Hn(t,new Jt(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Te&&Hn(t,new Gt(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function qn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Un(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Gn(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(we&&1==n.nodeType&&r<qn(n)&&Un(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Un(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Jn(n))break;{let e=n.previousSibling;for(;e&&Un(e);)o=n.parentNode,i=Ne(e),e=e.previousSibling;if(e)n=e,r=qn(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Zn(t,e,n,r):o&&Zn(t,e,o,i)}function Kn(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=qn(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Un(n.childNodes[r]))break;o=n,i=++r}else{if(Jn(n))break;{let e=n.nextSibling;for(;e&&Un(e);)o=e.parentNode,i=Ne(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=qn(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Zn(t,e,o,i)}function Jn(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Zn(t,e,n,r){if(Fe(e)){let t=document.createRange();t.setEnd(n,r),t.setStart(n,r),e.removeAllRanges(),e.addRange(t)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&_n(t)}),50)}function Xn(t,e,n){let r=t.state.selection;if(r instanceof Gt&&!r.empty||n.indexOf("s")>-1)return!1;if(Ce&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=$n(t.state,e);if(n&&n instanceof Jt)return Hn(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Xt?Ht.near(n,e):Ht.findFrom(n,e);return!!s&&Hn(t,s)}return!1}function Yn(t,e){if(!(t.state.selection instanceof Gt))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function Qn(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function tr(t,e){let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||at.fromSchema(t.state.schema),a=ur(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=lr[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(t=>t(e)))||e.content.textBetween(0,e.content.size,"\n\n")}}function er(t,e,n,r,o){let i,s,l=o.parent.type.spec.code;if(!n&&!e)return null;let c=e&&(r||l||!n);if(c){if(t.someProp("transformPastedText",(t=>{e=t(e,l||r)})),l)return e?new h(a.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):h.empty;let n=t.someProp("clipboardTextParser",(t=>t(e,o,r)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=at.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(t=>{n=t(n)})),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=ur().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);if((n=o&&lr[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join("")),r.innerHTML=t,n)for(let t=0;t<n.length;t++)r=r.querySelector(n[t])||r;return r}(n),Te&&function(t){let e=t.querySelectorAll(Se?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let u=i&&i.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let t=+d[3];t>0&&i.firstChild;t--)i=i.firstChild;if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||X.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!c&&!d),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||nr.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(d)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;o=a.from(e.create(n[t+1],o)),i++,s++}return new h(o,i,s)}(ar(s,+d[1],+d[2]),d[4]);else if(s=h.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&or(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=ir(i[i.length-1],r.length));let e=rr(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return a.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=ar(s,t,e)}return t.someProp("transformPasted",(t=>{s=t(s)})),s}const nr=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function rr(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,a.from(t));return t}function or(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=or(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(a.from(rr(n,t,o+1))))}}function ir(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,ir(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(a.empty,!0);return t.copy(n.append(r))}function sr(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return o<r-1&&(l=sr(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,t.childCount>1||i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(a.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function ar(t,e,n){return e<t.openStart&&(t=new h(sr(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new h(sr(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const lr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let cr=null;function ur(){return cr||(cr=document.implementation.createHTMLDocument("title"))}const dr={};let pr={};class hr{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function fr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function mr(t){t.someProp("handleDOMEvents",(e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>vr(t,e))}))}function vr(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function gr(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function yr(t){return{left:t.clientX,top:t.clientY}}function br(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,(e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function wr(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function xr(t,e,n,r){return br(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function Sr(t,e,n,r){return br(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(wr(t,Gt.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(n.inlineContent)wr(t,Gt.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Jt.isSelectable(n))continue;wr(t,Jt.create(r,i),"pointer")}return!0}}(t,n,r)}function Or(t){return Nr(t)}pr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Cr(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Me||!Se||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Ee||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||function(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Ce&&72==n&&"c"==r?Yn(t,-1)||Gn(t):46==n||Ce&&68==n&&"c"==r?Yn(t,1)||Kn(t):13==n||27==n||(37==n||Ce&&66==n&&"c"==r?Wn(t,-1,r)||Gn(t):39==n||Ce&&70==n&&"c"==r?Wn(t,1,r)||Kn(t):38==n||Ce&&80==n&&"c"==r?Xn(t,-1,r)||Gn(t):40==n||Ce&&78==n&&"c"==r?function(t){if(!ke||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelection();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Qn(t,n,"true"),setTimeout((()=>Qn(t,n,"false")),20)}return!1}(t)||Xn(t,1,r)||Kn(t):r==(Ce?"m":"c")&&(66==n||73==n||89==n||90==n))}(t,n)?n.preventDefault():fr(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,je(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},pr.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},pr.keypress=(t,e)=>{let n=e;if(Cr(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ce&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Gt&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const kr=Ce?"metaKey":"ctrlKey";dr.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Or(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[kr]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(yr(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Er(t,s,n,!!r)):("doubleClick"==i?xr:Sr)(t,s.pos,s.inside,n)?n.preventDefault():fr(t,"pointer"))};class Er{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[kr],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Jt&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!we||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),fr(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>_n(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(yr(t))),this.allowDefault||!e?fr(this.view,"pointer"):function(t,e,n,r,o){return br(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Jt&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(Jt.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(wr(t,Jt.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Jt.isSelectable(r))&&(wr(t,new Jt(n),"pointer"),!0)}(t,n))}(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||ke&&this.mightDrag&&!this.mightDrag.node.isAtom||Se&&!(this.view.state.selection instanceof Gt)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(wr(this.view,Ht.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):fr(this.view,"pointer")}move(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),fr(this.view,"pointer"),0==t.buttons&&this.done()}}function Cr(t,e){return!!t.composing||!!(ke&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}dr.touchdown=t=>{Or(t),fr(t,"pointer")},dr.contextmenu=t=>Or(t);const Mr=Me?5e3:-1;function Tr(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Nr(t)),e))}function Ar(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Nr(t,e=!1){if(!(Me&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Ar(t),e||t.docView&&t.docView.dirty){let e=Nn(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}pr.compositionstart=pr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Nr(t,!0),t.markCursor=null;else if(Nr(t),we&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelection();for(let t=e.focusNode,n=e.focusOffset;t&&1==t.nodeType&&0!=n;){let r=n<0?t.lastChild:t.childNodes[n-1];if(!r)break;if(3==r.nodeType){e.collapse(r,r.nodeValue.length);break}t=r,n=-1}}t.input.composing=!0}Tr(t,Mr)},pr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,Tr(t,20))};const Dr=ye&&be<15||Ee&&Ae<604;function _r(t,e,n,r){let o=er(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||h.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}dr.copy=pr.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Dr?null:n.clipboardData,s=r.content(),{dom:a,text:l}=tr(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},pr.paste=(t,e)=>{let n=e;if(t.composing&&!Me)return;let r=Dr?null:n.clipboardData;r&&_r(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?_r(t,r.value,null,e):_r(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Rr{constructor(t,e){this.slice=t,this.move=e}}const Ir=Ce?"altKey":"ctrlKey";dr.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(yr(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Jt?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Jt.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Jt.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=tr(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Dr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Dr||n.dataTransfer.setData("text/plain",l),t.dragging=new Rr(s,!n[Ir])},dr.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},pr.dragover=pr.dragenter=(t,e)=>e.preventDefault(),pr.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(yr(n));if(!o)return;let i=t.state.doc.resolve(o.pos);if(!i)return;let s=r&&r.slice;s?t.someProp("transformPasted",(t=>{s=t(s)})):s=er(t,n.dataTransfer.getData(Dr?"Text":"text/plain"),Dr?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Ir]);if(t.someProp("handleDrop",(e=>e(t,n,s||h.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}(t.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let f=c.doc.resolve(u);if(d&&Jt.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Jt(f));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),c.setSelection(Fn(t,f,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},dr.focus=t=>{t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelection())&&_n(t)}),20))},dr.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},dr.beforeinput=(t,e)=>{if(Se&&Me&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,je(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in pr)dr[t]=pr[t];function zr(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Lr{constructor(t,e){this.toDOM=t,this.spec=e||Vr,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new Fr(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Lr&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&zr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Pr{constructor(t,e){this.attrs=t,this.spec=e||Vr}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Fr(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Pr&&zr(this.attrs,t.attrs)&&zr(this.spec,t.spec)}static is(t){return t.type instanceof Pr}destroy(){}}class Br{constructor(t,e){this.attrs=t,this.spec=e||Vr}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Fr(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof Br&&zr(this.attrs,t.attrs)&&zr(this.spec,t.spec)}destroy(){}}class Fr{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new Fr(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new Fr(t,t,new Lr(e,n))}static inline(t,e,n,r){return new Fr(t,e,new Pr(n,r))}static node(t,e,n,r){return new Fr(t,e,new Br(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Pr}}const jr=[],Vr={};class $r{constructor(t,e){this.local=t.length?t:jr,this.children=e.length?e:jr}static create(t,e){return e.length?Kr(e,t,0,Vr):Hr}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==Hr||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Vr)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice(),l=(t,e,n,r)=>{for(let s=0;s<a.length;s+=3){let l,c=a[s+1];if(c<0||t>c+i)continue;let u=a[s]+i;e>=u?a[s+1]=t<=u?-2:-1:n>=o&&(l=r-n-(e-t))&&(a[s]+=l,a[s+1]+=l)}};for(let t=0;t<n.maps.length;t++)n.maps[t].forEach(l);let c=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){c=!0,a[e+1]=-1;continue}let l=n.map(t[e]+i),u=l-o;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(t[e+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[e+2].mapInner(n,f,l+1,t[e]+i+1,s);r!=Hr?(a[e]=u,a[e+1]=d,a[e+2]=r):(a[e+1]=-2,c=!0)}else c=!0}if(c){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),c=Kr(l,r,0,s);e=c.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<c.children.length;t+=3){let n=c.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,c.children[t],c.children[t+1],c.children[t+2])}}return new $r(e.sort(Jr),a)}(this.children,i||[],t,e,n,r,o):i?new $r(i.sort(Jr),jr):Hr}add(t,e){return e.length?this==Hr?$r.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=Ur(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,Kr(s,t,a+1,Vr)),o+=3}}));let i=qr(o?Gr(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new $r(i.length?this.local.concat(i).sort(Jr):this.local,r||this.children)}remove(t){return 0==t.length||this==Hr?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=Hr?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new $r(r,n):Hr}forChild(t,e){if(this==Hr)return this;if(e.isLeaf)return $r.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof Pr){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new $r(r.sort(Jr),jr);return n?new Wr([t,n]):t}return n||Hr}eq(t){if(this==t)return!0;if(!(t instanceof $r)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Zr(this.localsInner(t))}localsInner(t){if(this==Hr)return jr;if(t.inlineContent||!this.local.some(Pr.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Pr||e.push(this.local[t]);return e}}$r.empty=new $r([],[]),$r.removeOverlap=Zr;const Hr=$r.empty;class Wr{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,Vr)));return Wr.from(n)}forChild(t,e){if(e.isLeaf)return $r.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=Hr&&(o instanceof Wr?n=n.concat(o.members):n.push(o))}return Wr.from(n)}eq(t){if(!(t instanceof Wr)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?Zr(n?e:e.sort(Jr)):jr}static from(t){switch(t.length){case 0:return Hr;case 1:return t[0];default:return new Wr(t)}}}function qr(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Fr(o.from+e,o.to+e,o.type))}return n}function Ur(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function Gr(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Kr(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Ur(t,e,s+n);if(a){i=!0;let t=Kr(a,e,n+s+1,r);t!=Hr&&o.push(s,s+e.nodeSize,t)}}));let s=qr(i?Gr(t):t,-n).sort(Jr);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new $r(s,o):Hr}function Jr(t,e){return t.from-e.from||t.to-e.to}function Zr(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Xr(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Xr(e,o+1,i.copy(r.to,i.to)))}}return e}function Xr(t,e,n){for(;e<t.length&&Jr(n,t[e])>0;)e++;t.splice(e,0,n)}function Yr(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=Hr&&e.push(r)})),t.cursorWrapper&&e.push($r.create(t.state.doc,[t.cursorWrapper.deco])),Wr.from(e)}const Qr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},to=ye&&be<=11;class eo{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class no{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);ye&&be<=11&&t.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),to&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,Qr),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(jn(this.view)){if(this.suppressingSelectionUpdates)return _n(this.view);if(ye&&be<=11&&!this.view.state.selection.empty){let t=this.view.domSelection();if(t.focusNode&&Ie(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(t){if(0==t.rangeCount)return!0;let e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let e=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&jn(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(r=r<0?n.from:Math.min(n.from,r),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(i=!0))}if(we&&s.length>1){let t=s.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}var a;(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),a=this.view,ro||(ro=!0,"normal"==getComputedStyle(a.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."))),this.handleDOMChange(r,o,i,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||_n(this.view),this.currentSelection.set(e))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;n<t.addedNodes.length;n++)e.push(t.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,o=t.nextSibling;if(ye&&be<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:n,nextSibling:i}=t.addedNodes[e];(!n||Array.prototype.indexOf.call(t.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(t.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==t.target?Ne(r)+1:0,s=n.localPosFromDOM(t.target,i,-1),a=o&&o.parentNode==t.target?Ne(o):t.target.childNodes.length;return{from:s,to:n.localPosFromDOM(t.target,a,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let ro=!1;function oo(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(ke&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||ke&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}function io(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Fn(t,e.resolve(n.anchor),e.resolve(n.head))}function so(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}class ao{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new hr,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(ho),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=uo(this),co(this),this.nodeViews=po(this),this.docView=fn(this.state.doc,lo(this),Yr(this),this.dom,this),this.domObserver=new no(this,((t,e,n,r)=>function(t,e,n,r,o){if(e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=Nn(t,e);if(n&&!t.state.selection.eq(n)){let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),t.dispatch(r)}return}let i=t.state.doc.resolve(e),s=i.sharedDepth(n);e=i.before(s+1),n=t.state.doc.resolve(n).after(s+1);let l=t.state.selection,c=function(t,e,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),c=t.domSelection(),u=c.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],Fe(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Se&&8===t.input.lastKeyCode)for(let t=s;t>i;t--){let e=o.childNodes[t-1],n=e.pmViewDesc;if("BR"==e.nodeName&&!n){s=t;break}if(!n||n.size)break}let d=t.state.doc,p=t.someProp("domParser")||X.fromSchema(t.state.schema),h=d.resolve(a),f=null,m=p.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:oo,context:h});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),f={anchor:t+a,head:e+a}}return{doc:m,sel:f,from:a,to:l}}(t,e,n);if(Se&&t.cursorWrapper&&c.sel&&c.sel.anchor==t.cursorWrapper.deco.from){let e=t.cursorWrapper.deco.type.toDOM.nextSibling,n=e&&e.nodeValue?e.nodeValue.length:1;c.sel={anchor:c.sel.anchor+n,head:c.sel.anchor+n}}let u,d,p=t.state.doc,h=p.slice(c.from,c.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(u=t.state.selection.to,d="end"):(u=t.state.selection.from,d="start"),t.input.lastKeyCode=null;let f=function(t,e,n,r,o){let i=t.findDiffStart(e,n);if(null==i)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);return"end"==o&&(r-=s+Math.max(0,i-Math.min(s,a))-i),s<i&&t.size<e.size?(i-=r<=i&&r>=s?i-r:0,a=i+(a-s),s=i):a<i&&(i-=r<=i&&r>=a?i-r:0,s=i+(s-a),a=i),{start:i,endA:s,endB:a}}(h.content,c.doc.content,c.from,u,d);if((Ee&&t.input.lastIOSEnter>Date.now()-225||Me)&&o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",(e=>e(t,je(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!f){if(!(r&&l instanceof Gt&&!l.empty&&l.$head.sameParent(l.$anchor))||t.composing||c.sel&&c.sel.anchor!=c.sel.head){if(c.sel){let e=io(t,t.state.doc,c.sel);e&&!e.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(e))}return}f={start:l.from,endA:l.to,endB:l.to}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof Gt&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),ye&&be<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>c.from&&" "==c.doc.textBetween(f.start-c.from-1,f.start-c.from+1)&&(f.start--,f.endA--,f.endB--);let m,v=c.doc.resolveNoCache(f.start-c.from),g=c.doc.resolveNoCache(f.endB-c.from),y=p.resolve(f.start),b=v.sameParent(g)&&v.parent.inlineContent&&y.end()>=f.endA;if((Ee&&t.input.lastIOSEnter>Date.now()-225&&(!b||o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!b&&v.pos<c.doc.content.size&&(m=Ht.findFrom(c.doc.resolve(v.pos+1),1,!0))&&m.head==g.pos)&&t.someProp("handleKeyDown",(e=>e(t,je(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>f.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||so(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(so(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||so(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(p,f.start,f.endA,v,g)&&t.someProp("handleKeyDown",(e=>e(t,je(8,"Backspace")))))return void(Me&&Se&&t.domObserver.suppressSelectionUpdates());Se&&Me&&f.endB==f.start&&(t.input.lastAndroidDelete=Date.now()),Me&&!b&&v.start()!=g.start()&&0==g.parentOffset&&v.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==f.endA&&(f.endB-=2,g=c.doc.resolveNoCache(f.endB-c.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,je(13,"Enter"))}))}),20));let w,x,S,O=f.start,k=f.endA;if(b)if(v.pos==g.pos)ye&&be<=11&&0==v.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>_n(t)),20)),w=t.state.tr.delete(O,k),x=p.resolve(f.start).marksAcross(p.resolve(f.endA));else if(f.endA==f.endB&&(S=function(t,e){let n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,l=i,c=s;for(let t=0;t<s.length;t++)l=s[t].removeFromSet(l);for(let t=0;t<i.length;t++)c=i[t].removeFromSet(c);if(1==l.length&&0==c.length)r=l[0],n="add",o=t=>t.mark(r.addToSet(t.marks));else{if(0!=l.length||1!=c.length)return null;r=c[0],n="remove",o=t=>t.mark(r.removeFromSet(t.marks))}let u=[];for(let t=0;t<e.childCount;t++)u.push(o(e.child(t)));if(a.from(u).eq(t))return{mark:r,type:n}}(v.parent.content.cut(v.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))w=t.state.tr,"add"==S.type?w.addMark(O,k,S.mark):w.removeMark(O,k,S.mark);else if(v.parent.child(v.index()).isText&&v.index()==g.index()-(g.textOffset?0:1)){let e=v.parent.textBetween(v.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",(n=>n(t,O,k,e))))return;w=t.state.tr.insertText(e,O,k)}if(w||(w=t.state.tr.replace(O,k,c.doc.slice(f.start-c.from,f.endB-c.from))),c.sel){let e=io(t,w.doc,c.sel);e&&!(Se&&Me&&t.composing&&e.empty&&(f.start!=f.endB||t.input.lastAndroidDelete<Date.now()-100)&&(e.head==O||e.head==w.mapping.map(k)-1)||ye&&e.empty&&e.head==O)&&w.setSelection(e)}x&&w.ensureMarks(x),t.dispatch(w.scrollIntoView())}(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in dr){let n=dr[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!gr(t,e)||vr(t,e)||!t.editable&&e.type in pr||n(t,e)})}ke&&t.dom.addEventListener("input",(()=>null)),mr(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&mr(this),this._props=t,t.plugins&&(t.plugins.forEach(ho),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)}setProps(t){let e={};for(let t in this._props)e[t]=this._props[t];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this.state.plugins!=t.plugins)}updateStateInner(t,e){let n=this.state,r=!1,o=!1;if(t.storedMarks&&this.composing&&(Ar(this),o=!0),this.state=t,e){let t=po(this);(function(t,e){let n=0,r=0;for(let r in t){if(t[r]!=e[r])return!0;n++}for(let t in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,r=!0),mr(this)}this.editable=uo(this),co(this);let i=Yr(this),s=lo(this),a=e?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(t.doc,s,i);!l&&t.selection.eq(n.selection)||(o=!0);let c="preserve"==a&&o&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=t.root.elementFromPoint(i,s);if(!r||r==t.dom||!t.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:qe(t.dom)}}(this);if(o){this.domObserver.stop();let e=l&&(ye||Se)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(l){let n=Se?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(t.doc,s,i,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=fn(t.doc,s,i,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelection();return Ie(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?_n(this,e):(Pn(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(t.selection instanceof Jt){let n=this.docView.domAfterPos(t.selection.from);1==n.nodeType&&We(this,n.getBoundingClientRect(),e)}else We(this,this.coordsAtPos(t.selection.head,1),e)}else c&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Ue(n,0==r?0:r-e)}(c)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[t];if(null!=o&&(n=e?e(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[t];if(null!=i&&(n=e?e(i):i))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Ge)return t.focus(Ge);let e=qe(t);t.focus(null==Ge?{get preventScroll(){return Ge={preventScroll:!0},!0}}:void 0),Ge||(Ge=!1,Ue(e,0))}(this.dom),_n(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return t||document}posAtCoords(t){return Xe(this,t)}coordsAtPos(t,e=1){return tn(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return function(t,e,n){return sn==e&&an==n?ln:(sn=e,an=n,ln="up"==n||"down"==n?function(t,e,n){let r=e.selection,o="up"==n?r.$from:r.$to;return rn(t,e,(()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.dom;break}e=n.dom.parentNode}let r=tn(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=Re(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let o=e[t];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return on.test(r.parent.textContent)&&a.modify?rn(t,e,(()=>{let e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?i:s}(t,e,n))}(this,e||this.state,t)}destroy(){this.docView&&(function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Yr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){vr(t,e)||!dr[e.type]||!t.editable&&e.type in pr||dr[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelection(){return this.root.getSelection()}}function lo(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t&&(e.class+=" "+n[t]),"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),[Fr.node(0,t.state.doc.content.size,e)]}function co(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Fr.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function uo(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function po(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function ho(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var fo={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:"'",229:"q"},mo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},vo="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),go="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),yo="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),bo="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),wo="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),xo=vo&&(bo||+vo[1]<57)||yo&&bo,So=0;So<10;So++)fo[48+So]=fo[96+So]=String(So);for(So=1;So<=24;So++)fo[So+111]="F"+So;for(So=65;So<=90;So++)fo[So]=String.fromCharCode(So+32),mo[So]=String.fromCharCode(So);for(var Oo in fo)mo.hasOwnProperty(Oo)||(mo[Oo]=fo[Oo]);const ko="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Eo(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);ko?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Co(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function Mo(t){let e=function(t){let e=Object.create(null);for(let n in t)e[Eo(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(xo&&(t.ctrlKey||t.altKey||t.metaKey)||(go||wo)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?mo:fo)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[Co(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=fo[n.keyCode])&&r!=o){let o=e[Co(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[Co(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}const To=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),Ao=(t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;let o=_o(r);if(!o){let n=r.blockRange(),o=n&&Et(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&Vo(t,o,e))return!0;if(0==r.parent.content.size&&(No(i,"end")||Jt.isSelectable(i))){let n=Nt(t.doc,r.before(),r.after(),h.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(No(i,"end")?Ht.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Jt.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))};function No(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)return!1}return!1}const Do=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=_o(r)}let s=i&&i.nodeBefore;return!(!s||!Jt.isSelectable(s)||(e&&e(t.tr.setSelection(Jt.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))};function _o(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}const Ro=(t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;let o=zo(r);if(!o)return!1;let i=o.nodeAfter;if(Vo(t,o,e))return!0;if(0==r.parent.content.size&&(No(i,"start")||Jt.isSelectable(i))){let n=Nt(t.doc,r.before(),r.after(),h.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(No(i,"start")?Ht.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Jt.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))},Io=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=zo(r)}let s=i&&i.nodeAfter;return!(!s||!Jt.isSelectable(s)||(e&&e(t.tr.setSelection(Jt.create(t.doc,i.pos)).scrollIntoView()),0))};function zo(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Lo=(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 Po(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Bo=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Po(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Ht.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0},Fo=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Xt||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Po(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(Gt.create(s.doc,n+1)),e(s.scrollIntoView())}return!0},jo=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Tt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Et(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function Vo(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!At(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,l=a.empty;for(let t=r.length-1;t>=0;t--)l=a.from(r[t].create(null,l));l=a.from(i.copy(l));let c=t.tr.step(new St(e.pos-1,o,e.pos,o,new h(l,1,0),r.length,!0)),u=o+2*r.length;At(c.doc,u)&&c.join(u),n(c.scrollIntoView())}return!0}let c=Ht.findFrom(e,1),u=c&&c.$from.blockRange(c.$to),d=u&&Et(u);if(null!=d&&d>=e.depth)return n&&n(t.tr.lift(u,d).scrollIntoView()),!0;if(l&&No(s,"start",!0)&&No(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let l=s,c=1;for(;!l.isTextblock;l=l.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,l.content)){if(n){let r=a.empty;for(let t=o.length-1;t>=0;t--)r=a.from(o[t].copy(r));n(t.tr.step(new St(e.pos-o.length,e.pos+s.nodeSize,e.pos+c,e.pos+s.nodeSize-c,new h(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function $o(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Gt.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const Ho=$o(-1),Wo=$o(1);function qo(t,e=null){return function(n,r){let{from:o,to:i}=n.selection,s=!1;return n.doc.nodesBetween(o,i,((r,o)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)s=!0;else{let e=n.doc.resolve(o),r=e.index();s=e.parent.canReplaceWith(r,r+1,t)}})),!!s&&(r&&r(n.tr.setBlockType(o,i,t,e).scrollIntoView()),!0)}}function Uo(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}let Go=Uo(To,Ao,Do),Ko=Uo(To,Ro,Io);const Jo={Enter:Uo(Lo,Fo,jo,((t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof Jt&&t.selection.node.isBlock)return!(!n.parentOffset||!Tt(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let o=r.parentOffset==r.parent.content.size,i=t.tr;(t.selection instanceof Gt||t.selection instanceof Xt)&&i.deleteSelection();let s=0==n.depth?null:Po(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=o&&s?[{type:s}]:void 0,l=Tt(i.doc,i.mapping.map(n.pos),1,a);if(a||l||!Tt(i.doc,i.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(i.split(i.mapping.map(n.pos),1,a),!o&&!n.parentOffset&&n.parent.type!=s)){let t=i.mapping.map(n.before()),e=i.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&i.setNodeMarkup(i.mapping.map(n.before()),s)}e(i.scrollIntoView())}return!0})),"Mod-Enter":Bo,Backspace:Go,"Mod-Backspace":Go,"Shift-Backspace":Go,Delete:Ko,"Mod-Delete":Ko,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new Xt(t.doc))),!0)},Zo={"Ctrl-h":Jo.Backspace,"Alt-Backspace":Jo["Mod-Backspace"],"Ctrl-d":Jo.Delete,"Ctrl-Alt-Backspace":Jo["Mod-Delete"],"Alt-Delete":Jo["Mod-Delete"],"Alt-d":Jo["Mod-Delete"],"Ctrl-a":Ho,"Ctrl-e":Wo};for(let t in Jo)Zo[t]=Jo[t];function Xo(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class Yo{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!t,l=t||o.tr,c={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(l,e),o=n(...t)(r);return s.push(o),c}]))),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((t=>!0===t)))};return c}createCan(t){const{rawCommands:e,state:n}=this,r=void 0,o=t||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...i,dispatch:r})]))),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:r,view:i,state:Xo({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}function Qo(t,e,n){return void 0===t.config[e]&&t.parent?Qo(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind({...n,parent:t.parent?Qo(t.parent,e,n):null}):t.config[e]}function ti(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function ei(t){const e=[],{nodeExtensions:n,markExtensions:r}=ti(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=Qo(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});n&&n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:{...i,...r}})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Qo(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};r.isRequired&&void 0===r.default&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function ni(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ri(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function oi(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>ri(t,e)),{})}function ii(t){return"function"==typeof t}function si(t,e,...n){return ii(t)?e?t.bind(e)(...n):t(...n):t}function ai(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}}),{});return{...r,...o}}}}function li(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function ci(t,e){return e.nodes[t]||e.marks[t]||null}function ui(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function di(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class pi{constructor(t){this.find=t.find,this.handler=t.handler}}function hi(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let u=!1;const d=((t,e=500)=>{let n="";return t.parent.nodesBetween(Math.max(0,t.parentOffset-e),t.parentOffset,((e,r,o,i)=>{var s,a,l;n+=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:r,parent:o,index:i}))||(null===(l=t.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(c)+i;return s.forEach((t=>{if(u)return;const e=((t,e)=>{if(di(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,t.find);if(!e)return;const s=l.state.tr,c=Xo({state:l.state,transaction:s}),p={from:r-(e[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new Yo({editor:n,state:c});null!==t.handler({state:c,range:p,match:e,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function fi(t){const{editor:e,rules:n}=t,r=new le({state:{init:()=>null,apply:(t,e)=>t.getMeta(r)||(t.selectionSet||t.docChanged?null:e)},props:{handleTextInput:(t,o,i,s)=>hi({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&hi({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&hi({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}function mi(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1;return n.map((t=>new le({view(t){const e=e=>{var n;r=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:t=>(i=r===t.dom.parentElement,!1),paste:(t,e)=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!i;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!d||u===d.b)return;const p=s.tr,h=Xo({state:s,transaction:p});return function(t){const{editor:e,state:n,from:r,to:o,rule:i}=t,{commands:s,chain:a,can:l}=new Yo({editor:e,state:n}),c=[];return n.doc.nodesBetween(r,o,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const u=Math.max(r,e),d=Math.min(o,e+t.content.size);((t,e)=>{if(di(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[];return n.push(e.text),n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(u-e,d-e,void 0,""),i.find).forEach((t=>{if(void 0===t.index)return;const e=u+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},d=i.handler({state:n,range:o,match:t,commands:s,chain:a,can:l});c.push(d)}))})),c.every((t=>null!==t))}({editor:e,state:h,from:Math.max(u-1,0),to:d.b,rule:t})&&p.steps.length?p:void 0}})))}class vi{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=vi.resolve(t),this.schema=function(t){var e;const n=ei(t),{nodeExtensions:r,markExtensions:o}=ti(t),i=null===(e=r.find((t=>Qo(t,"topNode"))))||void 0===e?void 0:e.name,s=Object.fromEntries(r.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=li({...t.reduce(((t,n)=>{const r=Qo(n,"extendNodeSchema",o);return{...t,...r?r(e):{}}}),{}),content:si(Qo(e,"content",o)),marks:si(Qo(e,"marks",o)),group:si(Qo(e,"group",o)),inline:si(Qo(e,"inline",o)),atom:si(Qo(e,"atom",o)),selectable:si(Qo(e,"selectable",o)),draggable:si(Qo(e,"draggable",o)),code:si(Qo(e,"code",o)),defining:si(Qo(e,"defining",o)),isolating:si(Qo(e,"isolating",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=si(Qo(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>ai(t,r))));const a=Qo(e,"renderHTML",o);a&&(i.toDOM=t=>a({node:t,HTMLAttributes:oi(t,r)}));const l=Qo(e,"renderText",o);return l&&(i.toText=l),[e.name,i]}))),a=Object.fromEntries(o.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=li({...t.reduce(((t,n)=>{const r=Qo(n,"extendMarkSchema",o);return{...t,...r?r(e):{}}}),{}),inclusive:si(Qo(e,"inclusive",o)),excludes:si(Qo(e,"excludes",o)),group:si(Qo(e,"group",o)),spanning:si(Qo(e,"spanning",o)),code:si(Qo(e,"code",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=si(Qo(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>ai(t,r))));const a=Qo(e,"renderHTML",o);return a&&(i.toDOM=t=>a({mark:t,HTMLAttributes:oi(t,r)})),[e.name,i]})));return new J({topNode:i,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ci(t.name,this.schema)};"mark"===t.type&&(null===(e=si(Qo(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name);const r=Qo(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=Qo(t,"onCreate",n);o&&this.editor.on("create",o);const i=Qo(t,"onUpdate",n);i&&this.editor.on("update",i);const s=Qo(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=Qo(t,"onTransaction",n);a&&this.editor.on("transaction",a);const l=Qo(t,"onFocus",n);l&&this.editor.on("focus",l);const c=Qo(t,"onBlur",n);c&&this.editor.on("blur",c);const u=Qo(t,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(t){const e=vi.sort(vi.flatten(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=Qo(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=Qo(t,"priority")||100,r=Qo(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=Qo(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:ci(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=vi.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:ci(e.name,this.schema)},i=[],s=Qo(e,"addKeyboardShortcuts",o);if(s){const e=(a=Object.fromEntries(Object.entries(s()).map((([e,n])=>[e,()=>n({editor:t})]))),new le({props:{handleKeyDown:Mo(a)}}));i.push(e)}var a;const l=Qo(e,"addInputRules",o);ui(e,t.options.enableInputRules)&&l&&n.push(...l());const c=Qo(e,"addPasteRules",o);ui(e,t.options.enablePasteRules)&&c&&r.push(...c());const u=Qo(e,"addProseMirrorPlugins",o);if(u){const t=u();i.push(...t)}return i})).flat();return[fi({editor:t,rules:n}),...mi({editor:t,rules:r}),...o]}get attributes(){return ei(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ti(this.extensions);return Object.fromEntries(e.filter((t=>!!Qo(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:ni(e.name,this.schema)},o=Qo(e,"addNodeView",r);return o?[e.name,(r,i,s,a)=>{const l=oi(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]:[]})))}}function gi(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function yi(t,e){const n={...t};return gi(t)&&gi(e)&&Object.keys(e).forEach((r=>{gi(e[r])?r in t?n[r]=yi(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class bi{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=si(Qo(this,"addOptions",{name:this.name}))),this.storage=si(Qo(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new bi(t)}configure(t={}){const e=this.extend();return e.options=yi(this.options,t),e.storage=si(Qo(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new bi(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=si(Qo(e,"addOptions",{name:e.name})),e.storage=si(Qo(e,"addStorage",{name:e.name,options:e.options})),e}}function wi(t,e,n){const{from:r,to:o}=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(r,o,((t,n,c,u)=>{var d;const p=null==s?void 0:s[t.type.name];p?(t.isBlock&&!l&&(a+=i,l=!0),c&&(a+=p({node:t,pos:n,parent:c,index:u,range:e}))):t.isText?(a+=null===(d=null==t?void 0:t.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,o-n),l=!1):t.isBlock&&!l&&(a+=i,l=!0)})),a}function xi(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}const Si=bi.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new le({key:new de("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o;return wi(r,{from:Math.min(...i.map((t=>t.$from.pos))),to:Math.max(...i.map((t=>t.$to.pos)))},{textSerializers:xi(n)})}}})]}});function Oi(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:di(e[r])?e[r].test(t[r]):e[r]===t[r]))}function ki(t,e,n={}){return t.find((t=>t.type===e&&Oi(t.attrs,n)))}function Ei(t,e,n={}){return!!ki(t,e,n)}function Ci(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=ki([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(ki([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&Ei([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Mi(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Ti(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!function(t){var e;return"class"===(null===(e=t.constructor)||void 0===e?void 0:e.toString().substring(0,5))}(t)}function Ai(t){return Ti(t)&&t instanceof Gt}function Ni(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Di(t,e=null){if(!e)return null;const n=Ht.atStart(t),r=Ht.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Gt.create(t,Ni(0,o,i),Ni(t.content.size,o,i)):Gt.create(t,Ni(e,o,i),Ni(e,o,i))}function _i(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ri(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Ii(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)?a.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Ii("",e,n)}if("string"==typeof t){const r=X.fromSchema(e);return n.slice?r.parseSlice(Ri(t),n.parseOptions).content:r.parse(Ri(t),n.parseOptions)}return Ii("",e,n)}function zi(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Li(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?ni(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const l=o-r,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>Oi(t.node.attrs,n,{strict:!1})));return i?!!c.length:c.reduce(((t,e)=>t+e.to-e.from),0)>=l}function Pi(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Bi(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}function Fi(t,e,n={}){return Ii(t,e,{slice:!1,parseOptions:n})}function ji(t,e){const n=Mi(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function Vi(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function $i(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}function Hi(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function Wi(t,e){const{nodeExtensions:n}=ti(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=si(Qo(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}const qi=(t,e)=>{const n=Hi((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!At(t.doc,n.pos)||(t.join(n.pos),!0)},Ui=(t,e)=>{const n=Hi((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!At(t.doc,r)||(t.join(r),!0)};function Gi(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Mi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>Oi(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:e,$to:n})=>{const r=e.pos,o=n.pos;t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);s+=i-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>Oi(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}var Ki=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,((t,n)=>{if(t.type.isText)return;const{doc:r,mapping:o}=e,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+t.nodeSize)),a=i.blockRange(s);if(!a)return;const l=Et(a);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(a.start,t)}(l||0===l)&&e.lift(a,l)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>Fo(t,e),deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=ni(t,n.schema),i=e.selection.$anchor;for(let t=i.depth;t>0;t-=1)if(i.node(t).type===o){if(r){const n=i.before(t),r=i.after(t);e.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},deleteSelection:()=>({state:t,dispatch:e})=>To(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>Bo(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Mi(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const t=Ci(l,i,e);if(t&&t.from<=c&&t.to>=u){const e=Gt.create(s,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{_i()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===t||!1===t)return!0;if(i&&null===t&&!Ai(n.state.selection))return s(),!0;const a=Di(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,r)=>e(t,{...n,index:r}))),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Ii(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:t,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,c=!!c&&t.isBlock})),s===a&&c){const{parent:t}=r.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}l?r.insertText(e,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof xt||o instanceof St))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(Ht.near(t.doc.resolve(s),-1))}(r,r.steps.length-1)}return!0},joinBackward:()=>({state:t,dispatch:e})=>Ao(t,e),joinForward:()=>({state:t,dispatch:e})=>Ro(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);_i()||zi()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),s=i.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==l||l.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:r})=>!!Li(n,ni(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Et(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:t,dispatch:e})=>jo(t,e),liftListItem:t=>({state:e,dispatch:n})=>{return(r=ni(t,e.schema),function(t,e){let{$from:n,$to:o}=t.selection,i=n.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==r));return!!i&&(!e||(n.node(i.depth-1).type==r?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);return i<s&&(o.step(new St(i-1,s,i,s,new h(a.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new A(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth)),e(o.lift(r,Et(r)).scrollIntoView()),!0}(t,e,r,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,c=n.endIndex==o.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(l?0:1),d+1,s.content.append(c?a.empty:a.from(o))))return!1;let p=i.pos,f=p+s.nodeSize;return r.step(new St(p-(l?1:0),f+(c?1:0),p+1,f-1,new h((l?a.empty:a.from(o.copy(a.empty))).append(c?a.empty:a.from(o.copy(a.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}(t,e,i)))})(e,n);var r},newlineInCode:()=>({state:t,dispatch:e})=>Lo(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Pi("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=ni(t,r.schema)),"mark"===a&&(s=Mi(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,Bi(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(Bi(o.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>Do(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>Io(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(Jt.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>Wo(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>Ho(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=Fi(t,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Mi(t,r.schema);if(o)if(s){const t=ji(r,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i);t.marks.find((t=>t.type===l))?t.marks.forEach((t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))})):n.addMark(s,a,l.create(e))}))}));return!0},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=ni(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!qo(i,e)(n)||t.clearNodes())).command((({state:t})=>qo(i,e)(t,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=Ht.atStart(n).from,o=Ht.atEnd(n).to,i=Ni(t,r,o),s=Jt.create(n,i);e.setSelection(s)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=Gt.atStart(n).from,s=Gt.atEnd(n).to,a=Ni(r,i,s),l=Ni(o,i,s),c=Gt.create(n,a,l);e.setSelection(c)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=ni(t,e.schema);return(o=r,function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let l=i.parent,c=l.child(s-1);if(c.type!=o)return!1;if(e){let n=c.lastChild&&c.lastChild.type==l.type,r=a.from(n?o.create():null),s=new h(a.from(o.create(null,a.from(l.type.create(null,r)))),n?3:1,0),u=i.start,d=i.end;e(t.tr.step(new St(u-(n?3:1),d,u,d,s,1,!0)).scrollIntoView())}return!0})(e,n);var o},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=Vi(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Jt&&i.node.isBlock)return!(!a.parentOffset||!Tt(s,a.pos)||(r&&(t&&$i(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),0));if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof Gt&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,d=Tt(e.doc,e.mapping.map(a.pos),1,u);if(u||d||!Tt(e.doc,e.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,u=s?[{type:s,attrs:c}]:void 0),d&&(e.split(e.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&e.setNodeMarkup(e.mapping.map(a.before()),s)}t&&$i(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=ni(t,n.schema),{$from:l,$to:c}=n.selection,u=n.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==s)return!1;const p=o.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let t=a.empty;const n=l.index(-1)?1:l.index(-2)?2:3;for(let e=l.depth-n;e>=l.depth-3;e-=1)t=a.from(l.node(e).copy(t));const r=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,o=Vi(p,l.node().type.name,l.node().attrs),c=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;t=t.append(a.from(s.createAndFill(null,c)||void 0));const u=l.before(l.depth-(n-1));e.replace(u,l.after(-r),new h(t,4-n,0));let d=-1;e.doc.nodesBetween(u,e.doc.content.size,((t,e)=>{if(d>-1)return!1;t.isTextblock&&0===t.content.size&&(d=e+1)})),d>-1&&e.setSelection(Gt.near(e.doc.resolve(d))),e.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,m=Vi(p,d.type.name,d.attrs),v=Vi(p,l.node().type.name,l.node().attrs);e.delete(l.pos,c.pos);const g=f?[{type:s,attrs:m},{type:f,attrs:v}]:[{type:s,attrs:m}];return!!Tt(e.doc,l.pos,2)&&(r&&e.split(l.pos,2,g).scrollIntoView(),!0)},toggleList:(t,e)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,u=ni(t,o.schema),d=ni(e,o.schema),{selection:p}=o,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const v=Hi((t=>Wi(t.type.name,c)))(p);if(m.depth>=1&&v&&m.depth-v.depth<=1){if(v.node.type===u)return a.liftListItem(d);if(Wi(v.node.type.name,c)&&u.validContent(v.node.content)&&i)return s().command((()=>(r.setNodeMarkup(v.pos,u),!0))).command((()=>qi(r,u))).command((()=>Ui(r,u))).run()}return s().command((()=>!!l().wrapInList(u)||a.clearNodes())).wrapInList(u).command((()=>qi(r,u))).command((()=>Ui(r,u))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Mi(t,r.schema);return Gi(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=ni(t,r.schema),s=ni(e,r.schema);return Li(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=ni(t,n.schema);return Li(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){const n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Mi(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:t,to:e}=a;const r=null===(i=c.marks().find((t=>t.type===l)))||void 0===i?void 0:i.attrs,o=Ci(c,l,r);o&&(t=o.from,e=o.to),n.removeMark(t,e,l)}else d.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Pi("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=ni(t,r.schema)),"mark"===a&&(s=Mi(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+t.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Ct(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(ni(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=!1,c=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);c=new A(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new A(o,n.doc.resolve(i.end(s.depth)),s.depth)),l=!0}let u=Ct(c,t,e,s);return!!u&&(r&&r(function(t,e,n,r,o){let i=a.empty;for(let t=n.length-1;t>=0;t--)i=a.from(n[t].type.create(n[t].attrs,i));t.step(new St(e.start-(r?2:0),e.end,e.start,e.end,new h(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let l=n.length-s,c=e.start+n.length-(r?2:0),u=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&Tt(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=u.child(n).nodeSize;return t}(n.tr,s,u,l,t).scrollIntoView()),!0)}}(ni(t,n.schema),e)(n,r)});const Ji=bi.create({name:"commands",addCommands:()=>({...Ki})}),Zi=bi.create({name:"editable",addProseMirrorPlugins(){return[new le({key:new de("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Xi=bi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new le({key:new de("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Yi=bi.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=Ht.atStart(r).from===s;return!(!(o&&l&&a.type.isTextblock)||a.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return _i()||zi()?o:r},addProseMirrorPlugins(){return[new le({key:new de("clearDocument"),appendTransaction:(t,e,n)=>{if(!t.some((t=>t.docChanged))||e.doc.eq(n.doc))return;const{empty:r,from:o,to:i}=e.selection,s=Ht.atStart(e.doc).from,a=Ht.atEnd(e.doc).to,l=o===s&&i===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!c)return;const u=n.tr,d=Xo({state:n,transaction:u}),{commands:p}=new Yo({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),Qi=bi.create({name:"tabindex",addProseMirrorPlugins(){return[new le({key:new de("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ts=Object.freeze({__proto__:null,ClipboardTextSerializer:Si,Commands:Ji,Editable:Zi,FocusEvents:Xi,Keymap:Yi,Tabindex:Qi});function es(t,e,n){const r=t.state.doc.content.size,o=Ni(e,0,r),i=Ni(n,0,r),s=t.coordsAtPos(o),a=t.coordsAtPos(i,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),u=Math.min(s.left,a.left),d=Math.max(s.right,a.right),p={top:l,bottom:c,left:u,right:d,width:d-u,height:c-l,x:u,y:l};return{...p,toJSON:()=>p}}function ns(t){return new pi({find:t.find,handler:({state:e,range:n,match:r})=>{let o=t.replace,i=n.from;const s=n.to;if(r[1]){const t=r[0].lastIndexOf(r[1]);o+=r[0].slice(t+r[1].length),i+=t;const e=i-s;e>0&&(o=r[0].slice(t-e,t)+o,i=s)}e.tr.insertText(o,i,s)}})}class rs{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=si(Qo(this,"addOptions",{name:this.name}))),this.storage=si(Qo(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new rs(t)}configure(t={}){const e=this.extend();return e.options=yi(this.options,t),e.storage=si(Qo(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new rs(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=si(Qo(e,"addOptions",{name:e.name})),e.storage=si(Qo(e,"addStorage",{name:e.name,options:e.options})),e}}class is{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=si(Qo(this,"addOptions",{name:this.name}))),this.storage=si(Qo(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new is(t)}configure(t={}){const e=this.extend();return e.options=yi(this.options,t),e.storage=si(Qo(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new is(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=si(Qo(e,"addOptions",{name:e.name})),e.storage=si(Qo(e,"addStorage",{name:e.name,options:e.options})),e}}function ss(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function as(t){return t instanceof ss(t).Element||t instanceof Element}function ls(t){return t instanceof ss(t).HTMLElement||t instanceof HTMLElement}function cs(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ss(t).ShadowRoot||t instanceof ShadowRoot)}var us=Math.max,ds=Math.min,ps=Math.round;function hs(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,o=1;if(ls(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(r=ps(n.width)/s||1),i>0&&(o=ps(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function fs(t){var e=ss(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ms(t){return t?(t.nodeName||"").toLowerCase():null}function vs(t){return((as(t)?t.ownerDocument:t.document)||window.document).documentElement}function gs(t){return hs(vs(t)).left+fs(t).scrollLeft}function ys(t){return ss(t).getComputedStyle(t)}function bs(t){var e=ys(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ws(t,e,n){void 0===n&&(n=!1);var r,o,i=ls(e),s=ls(e)&&function(t){var e=t.getBoundingClientRect(),n=ps(e.width)/t.offsetWidth||1,r=ps(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=vs(e),l=hs(t,s),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==ms(e)||bs(a))&&(c=(r=e)!==ss(r)&&ls(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:fs(r)),ls(e)?((u=hs(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=gs(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function xs(t){var e=hs(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Ss(t){return"html"===ms(t)?t:t.assignedSlot||t.parentNode||(cs(t)?t.host:null)||vs(t)}function Os(t){return["html","body","#document"].indexOf(ms(t))>=0?t.ownerDocument.body:ls(t)&&bs(t)?t:Os(Ss(t))}function ks(t,e){var n;void 0===e&&(e=[]);var r=Os(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),i=ss(r),s=o?[i].concat(i.visualViewport||[],bs(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(ks(Ss(s)))}function Es(t){return["table","td","th"].indexOf(ms(t))>=0}function Cs(t){return ls(t)&&"fixed"!==ys(t).position?t.offsetParent:null}function Ms(t){for(var e=ss(t),n=Cs(t);n&&Es(n)&&"static"===ys(n).position;)n=Cs(n);return n&&("html"===ms(n)||"body"===ms(n)&&"static"===ys(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&ls(t)&&"fixed"===ys(t).position)return null;var n=Ss(t);for(cs(n)&&(n=n.host);ls(n)&&["html","body"].indexOf(ms(n))<0;){var r=ys(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}var Ts="top",As="bottom",Ns="right",Ds="left",_s="auto",Rs=[Ts,As,Ns,Ds],Is="start",zs="end",Ls="viewport",Ps="popper",Bs=Rs.reduce((function(t,e){return t.concat([e+"-"+Is,e+"-"+zs])}),[]),Fs=[].concat(Rs,[_s]).reduce((function(t,e){return t.concat([e,e+"-"+Is,e+"-"+zs])}),[]),js=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Vs(t){var e=new Map,n=new Set,r=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var r=e.get(t);r&&o(r)}})),r.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),r}var $s={placement:"bottom",modifiers:[],strategy:"absolute"};function Hs(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Ws(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,o=e.defaultOptions,i=void 0===o?$s:o;return function(t,e,n){void 0===n&&(n=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},$s,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var o="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},i,a.options,o),a.scrollParents={reference:as(t)?ks(t):t.contextElement?ks(t.contextElement):[],popper:ks(e)};var s=function(t){var e=Vs(t);return js.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}(function(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var i=o({state:a,name:e,instance:u,options:r});l.push(i||function(){})}})),u.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(Hs(e,n)){a.rects={reference:ws(e,Ms(n),"fixed"===a.options.strategy),popper:xs(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var o=a.orderedModifiers[r],i=o.fn,s=o.options,l=void 0===s?{}:s,d=o.name;"function"==typeof i&&(a=i({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(t){u.forceUpdate(),t(a)}))},function(){return s||(s=new Promise((function(t){Promise.resolve().then((function(){s=void 0,t(o())}))}))),s}),destroy:function(){d(),c=!0}};if(!Hs(t,e))return u;function d(){l.forEach((function(t){return t()})),l=[]}return u.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),u}}var qs={passive:!0};function Us(t){return t.split("-")[0]}function Gs(t){return t.split("-")[1]}function Ks(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Js(t){var e,n=t.reference,r=t.element,o=t.placement,i=o?Us(o):null,s=o?Gs(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Ts:e={x:a,y:n.y-r.height};break;case As:e={x:a,y:n.y+n.height};break;case Ns:e={x:n.x+n.width,y:l};break;case Ds:e={x:n.x-r.width,y:l};break;default:e={x:n.x,y:n.y}}var c=i?Ks(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Is:e[c]=e[c]-(n[u]/2-r[u]/2);break;case zs:e[c]=e[c]+(n[u]/2-r[u]/2)}}return e}var Zs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Xs(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,v="function"==typeof u?u({x:h,y:m}):{x:h,y:m};h=v.x,m=v.y;var g=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=Ds,w=Ts,x=window;if(c){var S=Ms(n),O="clientHeight",k="clientWidth";S===ss(n)&&"static"!==ys(S=vs(n)).position&&"absolute"===a&&(O="scrollHeight",k="scrollWidth"),(o===Ts||(o===Ds||o===Ns)&&i===zs)&&(w=As,m-=(d&&S===x&&x.visualViewport?x.visualViewport.height:S[O])-r.height,m*=l?1:-1),o!==Ds&&(o!==Ts&&o!==As||i!==zs)||(b=Ns,h-=(d&&S===x&&x.visualViewport?x.visualViewport.width:S[k])-r.width,h*=l?1:-1)}var E,C=Object.assign({position:a},c&&Zs),M=!0===u?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:ps(e*r)/r||0,y:ps(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=M.x,m=M.y,l?Object.assign({},C,((E={})[w]=y?"0":"",E[b]=g?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E)):Object.assign({},C,((e={})[w]=y?m+"px":"",e[b]=g?h+"px":"",e.transform="",e))}const Ys={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];ls(o)&&ms(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});ls(r)&&ms(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};var Qs={left:"right",right:"left",bottom:"top",top:"bottom"};function ta(t){return t.replace(/left|right|bottom|top/g,(function(t){return Qs[t]}))}var ea={start:"end",end:"start"};function na(t){return t.replace(/start|end/g,(function(t){return ea[t]}))}function ra(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&cs(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function oa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ia(t,e){return e===Ls?oa(function(t){var e=ss(t),n=vs(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+gs(t),y:a}}(t)):as(e)?function(t){var e=hs(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):oa(function(t){var e,n=vs(t),r=fs(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=us(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=us(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+gs(t),l=-r.scrollTop;return"rtl"===ys(o||n).direction&&(a+=us(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(vs(t)))}function sa(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function aa(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function la(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=void 0===r?t.placement:r,i=n.boundary,s=void 0===i?"clippingParents":i,a=n.rootBoundary,l=void 0===a?Ls:a,c=n.elementContext,u=void 0===c?Ps:c,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=sa("number"!=typeof f?f:aa(f,Rs)),v=u===Ps?"reference":Ps,g=t.rects.popper,y=t.elements[p?v:u],b=function(t,e,n){var r="clippingParents"===e?function(t){var e=ks(Ss(t)),n=["absolute","fixed"].indexOf(ys(t).position)>=0&&ls(t)?Ms(t):t;return as(n)?e.filter((function(t){return as(t)&&ra(t,n)&&"body"!==ms(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(e,n){var r=ia(t,n);return e.top=us(r.top,e.top),e.right=ds(r.right,e.right),e.bottom=ds(r.bottom,e.bottom),e.left=us(r.left,e.left),e}),ia(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(as(y)?y:y.contextElement||vs(t.elements.popper),s,l),w=hs(t.elements.reference),x=Js({reference:w,element:g,strategy:"absolute",placement:o}),S=oa(Object.assign({},g,x)),O=u===Ps?S:w,k={top:b.top-O.top+m.top,bottom:O.bottom-b.bottom+m.bottom,left:b.left-O.left+m.left,right:O.right-b.right+m.right},E=t.modifiersData.offset;if(u===Ps&&E){var C=E[o];Object.keys(k).forEach((function(t){var e=[Ns,As].indexOf(t)>=0?1:-1,n=[Ts,As].indexOf(t)>=0?"y":"x";k[t]+=C[n]*e}))}return k}const ca={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,v=e.options.placement,g=Us(v),y=l||(g!==v&&f?function(t){if(Us(t)===_s)return[];var e=ta(t);return[na(t),e,na(e)]}(v):[ta(v)]),b=[v].concat(y).reduce((function(t,n){return t.concat(Us(n)===_s?function(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Fs:l,u=Gs(r),d=u?a?Bs:Bs.filter((function(t){return Gs(t)===u})):Rs,p=d.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=d);var h=p.reduce((function(e,n){return e[n]=la(t,{placement:n,boundary:o,rootBoundary:i,padding:s})[Us(n)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}(e,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=e.rects.reference,x=e.rects.popper,S=new Map,O=!0,k=b[0],E=0;E<b.length;E++){var C=b[E],M=Us(C),T=Gs(C)===Is,A=[Ts,As].indexOf(M)>=0,N=A?"width":"height",D=la(e,{placement:C,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),_=A?T?Ns:Ds:T?As:Ts;w[N]>x[N]&&(_=ta(_));var R=ta(_),I=[];if(i&&I.push(D[M]<=0),a&&I.push(D[_]<=0,D[R]<=0),I.every((function(t){return t}))){k=C,O=!1;break}S.set(C,I)}if(O)for(var z=function(t){var e=b.find((function(e){var n=S.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return k=e,"break"},L=f?3:1;L>0&&"break"!==z(L);L--);e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ua(t,e,n){return us(t,ds(e,n))}function da(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function pa(t){return[Ts,Ns,As,Ds].some((function(e){return t[e]>=0}))}var ha=Ws({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=void 0===o||o,s=r.resize,a=void 0===s||s,l=ss(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach((function(t){t.addEventListener("scroll",n.update,qs)})),a&&l.addEventListener("resize",n.update,qs),function(){i&&c.forEach((function(t){t.removeEventListener("scroll",n.update,qs)})),a&&l.removeEventListener("resize",n.update,qs)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=Js({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:Us(e.placement),variation:Gs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Xs(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xs(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ys,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=void 0===o?[0,0]:o,s=Fs.reduce((function(t,n){return t[n]=function(t,e,n){var r=Us(t),o=[Ds,Ts].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Ds,Ns].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}},ca,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,v=la(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=Us(e.placement),y=Gs(e.placement),b=!y,w=Ks(g),x="x"===w?"y":"x",S=e.modifiersData.popperOffsets,O=e.rects.reference,k=e.rects.popper,E="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,T={x:0,y:0};if(S){if(i){var A,N="y"===w?Ts:Ds,D="y"===w?As:Ns,_="y"===w?"height":"width",R=S[w],I=R+v[N],z=R-v[D],L=h?-k[_]/2:0,P=y===Is?O[_]:k[_],B=y===Is?-k[_]:-O[_],F=e.elements.arrow,j=h&&F?xs(F):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=V[N],H=V[D],W=ua(0,O[_],j[_]),q=b?O[_]/2-L-W-$-C.mainAxis:P-W-$-C.mainAxis,U=b?-O[_]/2+L+W+H+C.mainAxis:B+W+H+C.mainAxis,G=e.elements.arrow&&Ms(e.elements.arrow),K=G?"y"===w?G.clientTop||0:G.clientLeft||0:0,J=null!=(A=null==M?void 0:M[w])?A:0,Z=R+U-J,X=ua(h?ds(I,R+q-J-K):I,R,h?us(z,Z):z);S[w]=X,T[w]=X-R}if(a){var Y,Q="x"===w?Ts:Ds,tt="x"===w?As:Ns,et=S[x],nt="y"===x?"height":"width",rt=et+v[Q],ot=et-v[tt],it=-1!==[Ts,Ds].indexOf(g),st=null!=(Y=null==M?void 0:M[x])?Y:0,at=it?rt:et-O[nt]-k[nt]-st+C.altAxis,lt=it?et+O[nt]+k[nt]-st-C.altAxis:ot,ct=h&&it?function(t,e,n){var r=ua(t,e,n);return r>n?n:r}(at,et,lt):ua(h?at:rt,et,h?lt:ot);S[x]=ct,T[x]=ct-et}e.modifiersData[r]=T}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Us(n.placement),l=Ks(a),c=[Ds,Ns].indexOf(a)>=0?"height":"width";if(i&&s){var u=function(t,e){return sa("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:aa(t,Rs))}(o.padding,n),d=xs(i),p="y"===l?Ts:Ds,h="y"===l?As:Ns,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],v=Ms(i),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,y=f/2-m/2,b=u[p],w=g-d[c]-u[h],x=g/2-d[c]/2+y,S=ua(b,x,w),O=l;n.modifiersData[r]=((e={})[O]=S,e.centerOffset=S-x,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&ra(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=la(e,{elementContext:"reference"}),a=la(e,{altBoundary:!0}),l=da(s,r),c=da(a,o,i),u=pa(l),d=pa(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),fa="tippy-content",ma="tippy-arrow",va="tippy-svg-arrow",ga={passive:!0,capture:!0},ya=function(){return document.body};function ba(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function wa(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function xa(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Sa(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r)}),e)};var n}function Oa(t){return[].concat(t)}function ka(t,e){-1===t.indexOf(e)&&t.push(e)}function Ea(t){return[].slice.call(t)}function Ca(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function Ma(){return document.createElement("div")}function Ta(t){return["Element","Fragment"].some((function(e){return wa(t,e)}))}function Aa(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Na(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function Da(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n)}))}function _a(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Ra={isTouch:!1},Ia=0;function za(){Ra.isTouch||(Ra.isTouch=!0,window.performance&&document.addEventListener("mousemove",La))}function La(){var t=performance.now();t-Ia<20&&(Ra.isTouch=!1,document.removeEventListener("mousemove",La)),Ia=t}function Pa(){var t,e=document.activeElement;if((t=e)&&t._tippy&&t._tippy.reference===t){var n=e._tippy;e.blur&&!n.state.isVisible&&e.blur()}}var Ba=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),Fa=Object.assign({appendTo:ya,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),ja=Object.keys(Fa);function Va(t){var e=(t.plugins||[]).reduce((function(e,n){var r,o=n.name,i=n.defaultValue;return o&&(e[o]=void 0!==t[o]?t[o]:null!=(r=Fa[o])?r:i),e}),{});return Object.assign({},t,e)}function $a(t,e){var n=Object.assign({},e,{content:xa(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Va(Object.assign({},Fa,{plugins:e}))):ja).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r)}catch(t){e[n]=r}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},Fa.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}function Ha(t,e){t.innerHTML=e}function Wa(t){var e=Ma();return!0===t?e.className=ma:(e.className=va,Ta(t)?e.appendChild(t):Ha(e,t)),e}function qa(t,e){Ta(e.content)?(Ha(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ha(t,e.content):t.textContent=e.content)}function Ua(t){var e=t.firstElementChild,n=Ea(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(fa)})),arrow:n.find((function(t){return t.classList.contains(ma)||t.classList.contains(va)})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function Ga(t){var e=Ma(),n=Ma();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ma();function o(n,r){var o=Ua(e),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||qa(s,t.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(Wa(r.arrow))):i.appendChild(Wa(r.arrow)):a&&i.removeChild(a)}return r.className=fa,r.setAttribute("data-state","hidden"),qa(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props),{popper:e,onUpdate:o}}Ga.$$tippy=!0;var Ka=1,Ja=[],Za=[];function Xa(t,e){var n,r,o,i,s,a,l,c,u=$a(t,Object.assign({},Fa,Va(Ca(e)))),d=!1,p=!1,h=!1,f=!1,m=[],v=Sa(G,u.interactiveDebounce),g=Ka++,y=(c=u.plugins).filter((function(t,e){return c.indexOf(t)===e})),b={id:g,reference:t,popper:Ma(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(e){if(!b.state.isDestroyed){R("onBeforeUpdate",[b,e]),q();var n=b.props,r=$a(t,Object.assign({},n,Ca(e),{ignoreAttributes:!0}));b.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(L(),v=Sa(G,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?Oa(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):r.triggerTarget&&t.removeAttribute("aria-expanded"),z(),_(),S&&S(n,r),b.popperInstance&&(X(),Q().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),R("onAfterUpdate",[b,e])}},setContent:function(t){b.setProps({content:t})},show:function(){var t=b.state.isVisible,e=b.state.isDestroyed,n=!b.state.isEnabled,r=Ra.isTouch&&!b.props.touch,o=ba(b.props.duration,0,Fa.duration);if(!(t||e||n||r||T().hasAttribute("disabled")||(R("onShow",[b],!1),!1===b.props.onShow(b)))){if(b.state.isVisible=!0,M()&&(x.style.visibility="visible"),_(),j(),b.state.isMounted||(x.style.transition="none"),M()){var i=N();Aa([i.box,i.content],0)}a=function(){var t;if(b.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,M()&&b.props.animation){var e=N(),n=e.box,r=e.content;Aa([n,r],o),Na([n,r],"visible")}I(),z(),ka(Za,b),null==(t=b.popperInstance)||t.forceUpdate(),R("onMount",[b]),b.props.animation&&M()&&function(t,e){$(t,(function(){b.state.isShown=!0,R("onShown",[b])}))}(o)}},function(){var t,e=b.props.appendTo,n=T();(t=b.props.interactive&&e===ya||"parent"===e?n.parentNode:xa(e,[n])).contains(x)||t.appendChild(x),b.state.isMounted=!0,X()}()}},hide:function(){var t=!b.state.isVisible,e=b.state.isDestroyed,n=!b.state.isEnabled,r=ba(b.props.duration,1,Fa.duration);if(!(t||e||n)&&(R("onHide",[b],!1),!1!==b.props.onHide(b))){if(b.state.isVisible=!1,b.state.isShown=!1,f=!1,d=!1,M()&&(x.style.visibility="hidden"),L(),V(),_(!0),M()){var o=N(),i=o.box,s=o.content;b.props.animation&&(Aa([i,s],r),Na([i,s],"hidden"))}I(),z(),b.props.animation?M()&&function(t,e){$(t,(function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}(r,b.unmount):b.unmount()}},hideWithInteractivity:function(t){A().addEventListener("mousemove",v),ka(Ja,v),v(t)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide(),b.state.isMounted&&(Y(),Q().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Za=Za.filter((function(t){return t!==b})),b.state.isMounted=!1,R("onHidden",[b]))},destroy:function(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),q(),delete t._tippy,b.state.isDestroyed=!0,R("onDestroy",[b]))}};if(!u.render)return b;var w=u.render(b),x=w.popper,S=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,t._tippy=b,x._tippy=b;var O=y.map((function(t){return t.fn(b)})),k=t.hasAttribute("aria-expanded");return W(),z(),_(),R("onCreate",[b]),u.showOnCreate&&tt(),x.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&A().addEventListener("mousemove",v)})),b;function E(){var t=b.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===E()[0]}function M(){var t;return!(null==(t=b.props.render)||!t.$$tippy)}function T(){return l||t}function A(){var t,e,n=T().parentNode;return n?null!=(e=Oa(n)[0])&&null!=(t=e.ownerDocument)&&t.body?e.ownerDocument:document:document}function N(){return Ua(x)}function D(t){return b.state.isMounted&&!b.state.isVisible||Ra.isTouch||i&&"focus"===i.type?0:ba(b.props.delay,t?0:1,Fa.delay)}function _(t){void 0===t&&(t=!1),x.style.pointerEvents=b.props.interactive&&!t?"":"none",x.style.zIndex=""+b.props.zIndex}function R(t,e,n){var r;void 0===n&&(n=!0),O.forEach((function(n){n[t]&&n[t].apply(n,e)})),n&&(r=b.props)[t].apply(r,e)}function I(){var e=b.props.aria;if(e.content){var n="aria-"+e.content,r=x.id;Oa(b.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(b.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else{var o=e&&e.replace(r,"").trim();o?t.setAttribute(n,o):t.removeAttribute(n)}}))}}function z(){!k&&b.props.aria.expanded&&Oa(b.props.triggerTarget||t).forEach((function(t){b.props.interactive?t.setAttribute("aria-expanded",b.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function L(){A().removeEventListener("mousemove",v),Ja=Ja.filter((function(t){return t!==v}))}function P(e){if(!Ra.isTouch||!h&&"mousedown"!==e.type){var n=e.composedPath&&e.composedPath()[0]||e.target;if(!b.props.interactive||!_a(x,n)){if(Oa(b.props.triggerTarget||t).some((function(t){return _a(t,n)}))){if(Ra.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[b,e]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),p=!0,setTimeout((function(){p=!1})),b.state.isMounted||V())}}}function B(){h=!0}function F(){h=!1}function j(){var t=A();t.addEventListener("mousedown",P,!0),t.addEventListener("touchend",P,ga),t.addEventListener("touchstart",F,ga),t.addEventListener("touchmove",B,ga)}function V(){var t=A();t.removeEventListener("mousedown",P,!0),t.removeEventListener("touchend",P,ga),t.removeEventListener("touchstart",F,ga),t.removeEventListener("touchmove",B,ga)}function $(t,e){var n=N().box;function r(t){t.target===n&&(Da(n,"remove",r),e())}if(0===t)return e();Da(n,"remove",s),Da(n,"add",r),s=r}function H(e,n,r){void 0===r&&(r=!1),Oa(b.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,r),m.push({node:t,eventType:e,handler:n,options:r})}))}function W(){var t;C()&&(H("touchstart",U,{passive:!0}),H("touchend",K,{passive:!0})),(t=b.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(H(t,U),t){case"mouseenter":H("mouseleave",K);break;case"focus":H(Ba?"focusout":"blur",J);break;case"focusin":H("focusout",J)}}))}function q(){m.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)})),m=[]}function U(t){var e,n=!1;if(b.state.isEnabled&&!Z(t)&&!p){var r="focus"===(null==(e=i)?void 0:e.type);i=t,l=t.currentTarget,z(),!b.state.isVisible&&wa(t,"MouseEvent")&&Ja.forEach((function(e){return e(t)})),"click"===t.type&&(b.props.trigger.indexOf("mouseenter")<0||d)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:tt(t),"click"===t.type&&(d=!n),n&&!r&&et(t)}}function G(t){var e=t.target,n=T().contains(e)||x.contains(e);if("mousemove"!==t.type||!n){var r=Q().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean);(function(t,e){var n=e.clientX,r=e.clientY;return t.every((function(t){var e=t.popperRect,o=t.popperState,i=t.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=e.top-r+l>i,h=r-e.bottom-c>i,f=e.left-n+u>i,m=n-e.right-d>i;return p||h||f||m}))})(r,t)&&(L(),et(t))}}function K(t){Z(t)||b.props.trigger.indexOf("click")>=0&&d||(b.props.interactive?b.hideWithInteractivity(t):et(t))}function J(t){b.props.trigger.indexOf("focusin")<0&&t.target!==T()||b.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||et(t)}function Z(t){return!!Ra.isTouch&&C()!==t.type.indexOf("touch")>=0}function X(){Y();var e=b.props,n=e.popperOptions,r=e.placement,o=e.offset,i=e.getReferenceClientRect,s=e.moveTransition,l=M()?Ua(x).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||T()}:t,u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(M()){var n=N().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];M()&&l&&u.push({name:"arrow",options:{element:l,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),b.popperInstance=ha(c,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:u}))}function Y(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return Ea(x.querySelectorAll("[data-tippy-root]"))}function tt(t){b.clearDelayTimeouts(),t&&R("onTrigger",[b,t]),j();var e=D(!0),r=E(),o=r[0],i=r[1];Ra.isTouch&&"hold"===o&&i&&(e=i),e?n=setTimeout((function(){b.show()}),e):b.show()}function et(t){if(b.clearDelayTimeouts(),R("onUntrigger",[b,t]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=D(!1);e?r=setTimeout((function(){b.state.isVisible&&b.hide()}),e):o=requestAnimationFrame((function(){b.hide()}))}}else V()}}function Ya(t,e){void 0===e&&(e={});var n=Fa.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",za,ga),window.addEventListener("blur",Pa);var r,o=Object.assign({},e,{plugins:n}),i=(r=t,Ta(r)?[r]:function(t){return wa(t,"NodeList")}(r)?Ea(r):Array.isArray(r)?r:Ea(document.querySelectorAll(r))).reduce((function(t,e){var n=e&&Xa(e,o);return n&&t.push(n),t}),[]);return Ta(t)?i[0]:i}Ya.defaultProps=Fa,Ya.setDefaultProps=function(t){Object.keys(t).forEach((function(e){Fa[e]=t[e]}))},Ya.currentInput=Ra,Object.assign({},Ys,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}}),Ya.setDefaultProps({render:Ga});const Qa=Ya;class tl{constructor({editor:t,element:e,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:t,state:e,from:n,to:r})=>{const{doc:o,selection:i}=e,{empty:s}=i,a=!o.textBetween(n,r).length&&Ai(e.selection);return!(!t.hasFocus()||s||a)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;!this.tippy&&e&&(this.tippy=Qa(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(t=>{this.blurHandler({event:t})})))}update(t,e){var n,r,o;const{state:i,composing:s}=t,{doc:a,selection:l}=i,c=e&&e.doc.eq(a)&&e.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,d=Math.min(...u.map((t=>t.$from.pos))),p=Math.max(...u.map((t=>t.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:t,state:i,oldState:e,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>{if(Ti(e=i.selection)&&e instanceof Jt){const e=t.nodeDOM(d);if(e)return e.getBoundingClientRect()}var e;return es(t,d,p)})}),this.show()):this.hide()}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t;null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}bi.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(t={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new le({key:"string"==typeof t.pluginKey?new de(t.pluginKey):t.pluginKey,view:e=>new tl({view:e,...t})}))]:[];var t}});class el{constructor({editor:t,element:e,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:t,state:e})=>{const{selection:n}=e,{$anchor:r,empty:o}=n,i=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(t.hasFocus()&&o&&i&&s)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;!this.tippy&&e&&(this.tippy=Qa(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(t=>{this.blurHandler({event:t})})))}update(t,e){var n,r,o;const{state:i}=t,{doc:s,selection:a}=i,{from:l,to:c}=a;e&&e.doc.eq(s)&&e.selection.eq(a)||(this.createTooltip(),(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:t,state:i,oldState:e}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>es(t,l,c))}),this.show()):this.hide())}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t;null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}bi.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(t={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new le({key:"string"==typeof t.pluginKey?new de(t.pluginKey):t.pluginKey,view:e=>new el({view:e,...t})}))]:[];var t}}),require("vue");class nl extends class extends class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(t,e){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',document.getElementsByTagName("head")[0].appendChild(r),r}(0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){this.setOptions({editable:t})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=ii(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t){if(this.isDestroyed)return;const e="string"==typeof t?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((t=>!t.key.startsWith(e)))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(ts):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new vi(t,this)}createCommandManager(){this.commandManager=new Yo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=Fi(this.options.content,this.schema,this.options.parseOptions),e=Di(t,this.options.autofocus);this.view=new ao(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:se.create({doc:t,selection:e||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus"),o=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,e){const n=Pi("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=ni(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,(t=>{i.push(t)}));const s=i.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}(t,e):"mark"===n?ji(t,e):{}}(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,r="string"==typeof t?e:t;return function(t,e,n={}){if(!e)return Li(t,null,n)||Gi(t,null,n);const r=Pi(e,t.schema);return"node"===r?Li(t,e,n):"mark"===r&&Gi(t,e,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,e){const n=at.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return function(t,e){return wi(t,{from:0,to:t.content.size},e)}(this.state.doc,{blockSeparator:e,textSerializers:{...n,...xi(this.schema)}})}get isEmpty(){return function(t){var e;const n=null===(e=t.type.createAndFill())||void 0===e?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const rl={name:"EditorContent",props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(t){t&&t.options.element&&this.$nextTick((()=>{const e=this.$el;e&&t.options.element.firstChild&&(e.append(...t.options.element.childNodes),t.contentComponent=this,t.setOptions({element:e}),t.createNodeViews())}))}}},render:t=>t("div"),beforeDestroy(){const{editor:t}=this;if(!t)return;if(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild)return;const e=document.createElement("div");e.append(...t.options.element.childNodes),t.setOptions({element:e})}};Boolean;const ol=require("@vue/composition-api");var il=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Transition",{attrs:{name:"zw-toolbar-",duration:800}},[n("div",{staticClass:"zw-toolbar"},[n(t.toolbarComponent,{tag:"component"})],1)])};il._withStripped=!0;var sl=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),al=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),ll=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify"}),cl=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),ul=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),dl=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION]}}),pl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("ToolbarRow",[n("StylePresetControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontFamilyControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontWeightControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontSizeControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("ToolbarGroup",[n("FontColorControl"),t._v(" "),n("BackgroundColorControl")],1)],1),t._v(" "),n("ToolbarDivider",{attrs:{horizontal:""}}),t._v(" "),n("ToolbarRow",[n("ToolbarGroup",[n("ItalicControl"),t._v(" "),n("UnderlineControl"),t._v(" "),n("StrikeThroughControl"),t._v(" "),n("SuperscriptControl"),t._v(" "),n("CaseStyleControl")],1),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("AlignmentControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("ToolbarGroup",[n("LineHeightControl"),t._v(" "),n("ListControl")],1),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("ToolbarGroup",[n("RemoveFormatControl")],1)],1)],1)};pl._withStripped=!0;var hl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-toolbar__divider",class:t.classes})};function fl(t,e,n,r,o,i,s,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}hl._withStripped=!0;var ml=fl({name:"ToolbarDivider",props:{vertical:{type:Boolean,required:!1,default:!1},horizontal:{type:Boolean,required:!1,default:!1}},setup:function(t){return{classes:(0,ol.computed)((function(){return{"zw-toolbar__divider--vertical":t.vertical,"zw-toolbar__divider--horizontal":t.horizontal}}))}}},hl,[],!1,null,"034e1143",null);ml.options.__file="lib/components/toolbar/ToolbarDivider.vue";const vl=ml.exports;var gl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-toolbar__row"},[t._t("default")],2)};gl._withStripped=!0;var yl=fl({name:"ToolbarRow"},gl,[],!1,null,"65916ef8",null);yl.options.__file="lib/components/toolbar/ToolbarRow.vue";const bl=yl.exports;var wl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-toolbar__group"},[t._t("default")],2)};wl._withStripped=!0;var xl=fl({name:"ToolbarGroup"},wl,[],!1,null,"06bbae29",null);xl.options.__file="lib/components/toolbar/ToolbarGroup.vue";const Sl=xl.exports;var Ol=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zw-style-preset-control"},[n("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Text Type",expression:"'Text Type'"}],staticClass:"zw-style-preset-control__dropdown",attrs:{value:t.preset.id,options:t.options},on:{change:t.apply}}),t._v(" "),n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Reset Styles",expression:"'Reset Styles'"}],staticClass:"zw-style-preset-control__reset",attrs:{disabled:!t.isCustomized,icon:""},on:{click:t.removeCustomization}},[n("Icon",{attrs:{name:"reset-styles",size:"28px","auto-color":""}})],1)],1)};Ol._withStripped=!0;var kl=Object.freeze({FONTS:Symbol("fonts"),FONT_SIZES:Symbol("fontSizes"),EDITOR:Symbol("editor"),LOCAL_STORAGE:Symbol("localStorage"),FAVORITE_COLORS:Symbol("favoriteColors")}),El=function(){var t=this,e=t.$createElement;return(t._self._c||e)("button",{staticClass:"zw-button",class:t.classes,attrs:{type:"button",disabled:t.disabled},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default")],2)};function Cl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}El._withStripped=!0;var Ml=fl({name:"Button",props:{skin:{type:String,required:!1,validator:function(t){return["toolbar","none"].includes(t)},default:"none"},active:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},icon:{type:Boolean,required:!1,default:!1}},setup:function(t){return{classes:(0,ol.computed)((function(){var e;return Cl(e={},"zw-button--".concat(t.skin),"none"!==t.skin),Cl(e,"zw-button--active",t.active),Cl(e,"zw-button--icon",t.icon),e}))}}},El,[],!1,null,"610825a2",null);Ml.options.__file="lib/components/base/Button.vue";const Tl=Ml.exports;var Al=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-button-toggle"},[t._l(t.options,(function(e){return t._t("option",null,{option:e,isActive:e.id===t.value,activate:function(){return t.$emit("change",e.id)}})}))],2)};Al._withStripped=!0;var Nl=fl({name:"ButtonToggle",model:{event:"change"},props:{value:{type:String,required:!0},options:{type:Array,required:!0}}},Al,[],!1,null,"de5fa53a",null);Nl.options.__file="lib/components/base/ButtonToggle.vue";const Dl=Nl.exports;var _l=function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"zw-icon",class:t.iconClasses,style:t.iconStyles,domProps:{innerHTML:t._s(t.source)}})};function Rl(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(e){return t.apply(void 0,[e].concat(n))}}}function Il(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zl(t,e){if(t){if("string"==typeof t)return Il(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Il(t,e):void 0}}function Ll(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);s=!0);}catch(t){a=!0,o=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(t,e)||zl(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pl(Object(n),!0).forEach((function(e){Cl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Fl(t){var e=Object.entries(t).reduce((function(t,e){var n=Ll(e,2),r=n[0],o=n[1];if(!o)return t;var i=r.replace(/_/g,"-");return"".concat(t," --zw-").concat(i,": ").concat(o,";").trimStart()}),"");return e?{style:e}:null}function jl(t){var e=Fl(t);return["span",e?Bl(Bl({},e),{},{class:"zw-style"}):{},0]}function Vl(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(e){var r;return(r=e.editor.commands)[t].apply(r,n),!0}}_l._withStripped=!0;const $l=require("zipify-colorpicker");function Hl(t){var e=$l.ColorModel.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}var Wl=n(3700),ql=fl({name:"Icon",props:{name:{type:String,required:!0},size:{type:[String,Number],required:!1,default:""},autoColor:{type:Boolean,required:!1,default:!1}},setup:function(t){var e=(0,ol.computed)((function(){return function(t){try{return Wl("./".concat(t,".svg"))}catch(t){return console.warn("Cannot resolve wysiwyg icon",t),""}}(t.name)})),n=(0,ol.computed)((function(){return isNaN(Number(t.size))?t.size:"".concat(t.size,"px")}));return{source:e,iconStyles:(0,ol.computed)((function(){return t.size?{"--zw-icon-width":n.value,"--zw-icon-height":n.value}:null})),iconClasses:(0,ol.computed)((function(){return{"zw-icon--auto-color":t.autoColor}}))}}},_l,[],!1,null,"d4624794",null);ql.options.__file="lib/components/base/Icon.vue";const Ul=ql.exports;var Gl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{ref:"hostRef",staticClass:"zw-scroll-view",attrs:{"data-simplebar-auto-hide":"false"}},[t._t("default")],2)};Gl._withStripped=!0,n(1539),n(4747);var Kl,Jl=n(1807),Zl=n.n(Jl),Xl=(n(1058),n(9601),n(7327),n(6992),n(8783),n(4129),n(3948),n(3096)),Yl=n.n(Xl),Ql=n(1296),tc=n.n(Ql),ec=n(773),nc=n.n(ec),rc=[],oc="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Kl||(Kl={}));var ic,sc=function(t){return Object.freeze(t)},ac=function(t,e){this.inlineSize=t,this.blockSize=e,sc(this)},lc=function(){function t(t,e,n,r){return this.x=t,this.y=e,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,sc(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),cc=function(t){return t instanceof SVGElement&&"getBBox"in t},uc=function(t){if(cc(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||t.getClientRects().length)},dc=function(t){var e,n;if(t instanceof Element)return!0;var r=null===(n=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&t instanceof r.Element)},pc="undefined"!=typeof window?window:{},hc=new WeakMap,fc=/auto|scroll/,mc=/^tb|vertical/,vc=/msie|trident/i.test(pc.navigator&&pc.navigator.userAgent),gc=function(t){return parseFloat(t||"0")},yc=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new ac((n?e:t)||0,(n?t:e)||0)},bc=sc({devicePixelContentBoxSize:yc(),borderBoxSize:yc(),contentBoxSize:yc(),contentRect:new lc(0,0,0,0)}),wc=function(t,e){if(void 0===e&&(e=!1),hc.has(t)&&!e)return hc.get(t);if(uc(t))return hc.set(t,bc),bc;var n=getComputedStyle(t),r=cc(t)&&t.ownerSVGElement&&t.getBBox(),o=!vc&&"border-box"===n.boxSizing,i=mc.test(n.writingMode||""),s=!r&&fc.test(n.overflowY||""),a=!r&&fc.test(n.overflowX||""),l=r?0:gc(n.paddingTop),c=r?0:gc(n.paddingRight),u=r?0:gc(n.paddingBottom),d=r?0:gc(n.paddingLeft),p=r?0:gc(n.borderTopWidth),h=r?0:gc(n.borderRightWidth),f=r?0:gc(n.borderBottomWidth),m=d+c,v=l+u,g=(r?0:gc(n.borderLeftWidth))+h,y=p+f,b=a?t.offsetHeight-y-t.clientHeight:0,w=s?t.offsetWidth-g-t.clientWidth:0,x=o?m+g:0,S=o?v+y:0,O=r?r.width:gc(n.width)-x-w,k=r?r.height:gc(n.height)-S-b,E=O+m+w+g,C=k+v+b+y,M=sc({devicePixelContentBoxSize:yc(Math.round(O*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:yc(E,C,i),contentBoxSize:yc(O,k,i),contentRect:new lc(d,l,O,k)});return hc.set(t,M),M},xc=function(t,e,n){var r=wc(t,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case Kl.DEVICE_PIXEL_CONTENT_BOX:return s;case Kl.BORDER_BOX:return o;default:return i}},Sc=function(t){var e=wc(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=sc([e.borderBoxSize]),this.contentBoxSize=sc([e.contentBoxSize]),this.devicePixelContentBoxSize=sc([e.devicePixelContentBoxSize])},Oc=function(t){if(uc(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},kc=function(){var t=1/0,e=[];rc.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(e){var n=new Sc(e.target),o=Oc(e.target);r.push(n),e.lastReportedSize=xc(e.target,e.observedBox),o<t&&(t=o)})),e.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=e;n<r.length;n++)(0,r[n])();return t},Ec=function(t){rc.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(Oc(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},Cc=[],Mc=0,Tc={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ac=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Nc=function(t){return void 0===t&&(t=0),Date.now()+t},Dc=!1,_c=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Dc){Dc=!0;var n,r=Nc(t);n=function(){var n=!1;try{n=function(){var t,e=0;for(Ec(e);rc.some((function(t){return t.activeTargets.length>0}));)e=kc(),Ec(e);return rc.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:oc}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=oc),window.dispatchEvent(t)),e>0}()}finally{if(Dc=!1,t=r-Nc(),!Mc)return;n?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!ic){var e=0,n=document.createTextNode("");new MutationObserver((function(){return Cc.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),ic=function(){n.textContent=""+(e?e--:e++)}}Cc.push(t),ic()}((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,Tc)};document.body?e():pc.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ac.forEach((function(e){return pc.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ac.forEach((function(e){return pc.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),Rc=function(t){!Mc&&t>0&&_c.start(),!(Mc+=t)&&_c.stop()},Ic=function(){function t(t,e){this.target=t,this.observedBox=e||Kl.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=xc(this.target,this.observedBox,!0);return t=this.target,cc(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),zc=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Lc=new WeakMap,Pc=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Bc=function(){function t(){}return t.connect=function(t,e){var n=new zc(t,e);Lc.set(t,n)},t.observe=function(t,e,n){var r=Lc.get(t),o=0===r.observationTargets.length;Pc(r.observationTargets,e)<0&&(o&&rc.push(r),r.observationTargets.push(new Ic(e,n&&n.box)),Rc(1),_c.schedule())},t.unobserve=function(t,e){var n=Lc.get(t),r=Pc(n.observationTargets,e),o=1===n.observationTargets.length;r>=0&&(o&&rc.splice(rc.indexOf(n),1),n.observationTargets.splice(r,1),Rc(-1))},t.disconnect=function(t){var e=this,n=Lc.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),Fc=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Bc.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!dc(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Bc.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!dc(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Bc.unobserve(this,t)},t.prototype.disconnect=function(){Bc.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),jc=(n(5827),n(4916),n(4723),n(8309),n(5306),function(t){return Array.prototype.reduce.call(t,(function(t,e){var n=e.name.match(/data-simplebar-(.+)/);if(n){var r=n[1].replace(/\W+(.)/g,(function(t,e){return e.toUpperCase()}));switch(e.value){case"true":t[r]=!0;break;case"false":t[r]=!1;break;case void 0:t[r]=!0;break;default:t[r]=e.value}}return t}),{})});function Vc(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function $c(t){return t&&t.ownerDocument?t.ownerDocument:document}var Hc=null,Wc=null;function qc(t){if(null===Hc){var e=$c(t);if(void 0===e)return Hc=0;var n=e.body,r=e.createElement("div");r.classList.add("simplebar-hide-scrollbar"),n.appendChild(r);var o=r.getBoundingClientRect().right;n.removeChild(r),Hc=o}return Hc}Zl()&&window.addEventListener("resize",(function(){Wc!==window.devicePixelRatio&&(Wc=window.devicePixelRatio,Hc=null)}));var Uc=function(){function t(e,n){var r=this;this.onScroll=function(){var t=Vc(r.el);r.scrollXTicking||(t.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0),r.scrollYTicking||(t.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0)},this.scrollX=function(){r.axis.x.isOverflowing&&(r.showScrollbar("x"),r.positionScrollbar("x")),r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&(r.showScrollbar("y"),r.positionScrollbar("y")),r.scrollYTicking=!1},this.onMouseEnter=function(){r.showScrollbar("x"),r.showScrollbar("y")},this.onMouseMove=function(t){r.mouseX=t.clientX,r.mouseY=t.clientY,(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseMoveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){r.onMouseMove.cancel(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseLeaveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseLeaveForAxis("y"),r.mouseX=-1,r.mouseY=-1},this.onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth(),r.hideNativeScrollbar()},this.hideScrollbars=function(){r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.track.rect)||(r.axis.y.scrollbar.el.classList.remove(r.classNames.visible),r.axis.y.isVisible=!1),r.isWithinBounds(r.axis.x.track.rect)||(r.axis.x.scrollbar.el.classList.remove(r.classNames.visible),r.axis.x.isVisible=!1)},this.onPointerEvent=function(t){var e,n;r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(e=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(n=r.isWithinBounds(r.axis.y.track.rect)),(e||n)&&(t.preventDefault(),t.stopPropagation(),"mousedown"===t.type&&(e&&(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect)?r.onDragStart(t,"x"):r.onTrackClick(t,"x")),n&&(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect)?r.onDragStart(t,"y"):r.onTrackClick(t,"y"))))},this.drag=function(e){var n=r.axis[r.draggedAxis].track,o=n.rect[r.axis[r.draggedAxis].sizeAttr],i=r.axis[r.draggedAxis].scrollbar,s=r.contentWrapperEl[r.axis[r.draggedAxis].scrollSizeAttr],a=parseInt(r.elStyles[r.axis[r.draggedAxis].sizeAttr],10);e.preventDefault(),e.stopPropagation();var l=(("y"===r.draggedAxis?e.pageY:e.pageX)-n.rect[r.axis[r.draggedAxis].offsetAttr]-r.axis[r.draggedAxis].dragOffset)/(o-i.size)*(s-a);"x"===r.draggedAxis&&(l=r.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?l-(o+i.size):l,l=r.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-l:l),r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=l},this.onEndDrag=function(t){var e=$c(r.el),n=Vc(r.el);t.preventDefault(),t.stopPropagation(),r.el.classList.remove(r.classNames.dragging),e.removeEventListener("mousemove",r.drag,!0),e.removeEventListener("mouseup",r.onEndDrag,!0),r.removePreventClickId=n.setTimeout((function(){e.removeEventListener("click",r.preventClick,!0),e.removeEventListener("dblclick",r.preventClick,!0),r.removePreventClickId=null}))},this.preventClick=function(t){t.preventDefault(),t.stopPropagation()},this.el=e,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,n),this.classNames=Object.assign({},t.defaultOptions.classNames,this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el)||(this.recalculate=Yl()(this.recalculate.bind(this),64),this.onMouseMove=Yl()(this.onMouseMove.bind(this),64),this.hideScrollbars=tc()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=tc()(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=nc()(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var e=document.createElement("div");e.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var n=e.firstElementChild;document.body.appendChild(n);var r=n.firstElementChild;n.scrollLeft=0;var o=t.getOffset(n),i=t.getOffset(r);n.scrollLeft=999;var s=t.getOffset(r);return{isRtlScrollingInverted:o.left!==i.left&&i.left-s.left!=0,isRtlScrollbarInverted:o.left!==i.left}},t.getOffset=function(t){var e=t.getBoundingClientRect(),n=$c(t),r=Vc(t);return{top:e.top+(r.pageYOffset||n.documentElement.scrollTop),left:e.left+(r.pageXOffset||n.documentElement.scrollLeft)}};var e=t.prototype;return e.init=function(){t.instances.set(this.el,this),Zl()&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var t=this;if(Array.prototype.filter.call(this.el.children,(function(e){return e.classList.contains(t.classNames.wrapper)})).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var e=document.createElement("div"),n=document.createElement("div");e.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),e.appendChild(n),this.axis.x.track.el=e.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=e.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.setAccessibilityAttributes=function(){var t=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",t)},e.initListeners=function(){var t=this,e=Vc(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),e.addEventListener("resize",this.onWindowResize);var n=!1,r=e.ResizeObserver||Fc;this.resizeObserver=new r((function(){n&&t.recalculate()})),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),e.requestAnimationFrame((function(){n=!0})),this.mutationObserver=new e.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var t=Vc(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var e=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,r=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,i=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var a=this.contentEl.scrollHeight,l=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=e?"auto":"100%",this.placeholderEl.style.width=n?r+"px":"auto",this.placeholderEl.style.height=a+"px";var c=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=l>r,this.axis.y.isOverflowing=a>c,this.axis.x.isOverflowing="hidden"!==i&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==s&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var u=this.axis.x.isOverflowing?this.scrollbarWidth:0,d=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&l>o-d,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&a>c-u,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(t){if(void 0===t&&(t="y"),!this.axis[t].isOverflowing)return 0;var e,n=this.contentEl[this.axis[t].scrollSizeAttr],r=this.axis[t].track.el[this.axis[t].offsetSizeAttr],o=r/n;return e=Math.max(~~(o*r),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(e=Math.min(e,this.options.scrollbarMaxSize)),e},e.positionScrollbar=function(e){if(void 0===e&&(e="y"),this.axis[e].isOverflowing){var n=this.contentWrapperEl[this.axis[e].scrollSizeAttr],r=this.axis[e].track.el[this.axis[e].offsetSizeAttr],o=parseInt(this.elStyles[this.axis[e].sizeAttr],10),i=this.axis[e].scrollbar,s=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],a=(s="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-s:s)/(n-o),l=~~((r-i.size)*a);l="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?l+(r-i.size):l,i.el.style.transform="x"===e?"translate3d("+l+"px, 0, 0)":"translate3d(0, "+l+"px, 0)"}},e.toggleTrackVisibility=function(t){void 0===t&&(t="y");var e=this.axis[t].track.el,n=this.axis[t].scrollbar.el;this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll"):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden"),this.axis[t].isOverflowing?n.style.display="block":n.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.rect=this.axis[t].track.el.getBoundingClientRect(),this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[t].scrollbar.rect)?this.axis[t].scrollbar.el.classList.add(this.classNames.hover):this.axis[t].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[t].track.rect)?(this.showScrollbar(t),this.axis[t].track.el.classList.add(this.classNames.hover)):this.axis[t].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.el.classList.remove(this.classNames.hover),this.axis[t].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(t){void 0===t&&(t="y");var e=this.axis[t].scrollbar.el;this.axis[t].isVisible||(e.classList.add(this.classNames.visible),this.axis[t].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(t,e){void 0===e&&(e="y");var n=$c(this.el),r=Vc(this.el),o=this.axis[e].scrollbar,i="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=i-o.rect[this.axis[e].offsetAttr],this.draggedAxis=e,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(r.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(t,e){var n=this;if(void 0===e&&(e="y"),this.options.clickOnTrack){var r=Vc(this.el);this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect();var o=this.axis[e].scrollbar.rect[this.axis[e].offsetAttr],i=parseInt(this.elStyles[this.axis[e].sizeAttr],10),s=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],a=("y"===e?this.mouseY-o:this.mouseX-o)<0?-1:1,l=-1===a?s-i:s+i;!function t(){var o,i;-1===a?s>l&&(s-=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo(((o={})[n.axis[e].offsetAttr]=s,o)),r.requestAnimationFrame(t)):s<l&&(s+=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo(((i={})[n.axis[e].offsetAttr]=s,i)),r.requestAnimationFrame(t))}()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:qc(this.el)}catch(t){return qc(this.el)}},e.removeListeners=function(){var t=this,e=Vc(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),t.instances.delete(this.el)},e.isWithinBounds=function(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},e.findChild=function(t,e){var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,(function(t){return n.call(t,e)}))[0]},t}();Uc.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},Uc.instances=new WeakMap,Uc.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),(function(t){"init"===t.getAttribute("data-simplebar")||Uc.instances.has(t)||new Uc(t,jc(t.attributes))}))},Uc.removeObserver=function(){this.globalObserver.disconnect()},Uc.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(Uc.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},Uc.handleMutations=function(t){t.forEach((function(t){Array.prototype.forEach.call(t.addedNodes,(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?!Uc.instances.has(t)&&document.documentElement.contains(t)&&new Uc(t,jc(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),(function(t){"init"!==t.getAttribute("data-simplebar")&&!Uc.instances.has(t)&&document.documentElement.contains(t)&&new Uc(t,jc(t.attributes))})))})),Array.prototype.forEach.call(t.removedNodes,(function(t){1===t.nodeType&&("init"===t.getAttribute("data-simplebar")?Uc.instances.has(t)&&!document.documentElement.contains(t)&&Uc.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),(function(t){Uc.instances.has(t)&&!document.documentElement.contains(t)&&Uc.instances.get(t).unMount()})))}))}))},Uc.getOptions=jc,Zl()&&Uc.initHtmlApi();const Gc=Uc;var Kc=function(t){return t};function Jc(t){var e=t.valueRef,n=t.format,r=void 0===n?Kc:n,o=(0,ol.ref)(r(e.value));return(0,ol.watch)(e,(function(){return o.value=r(e.value)})),o}function Zc(t){return(0,ol.computed)((function(){var e;return(null===(e=t.value)||void 0===e?void 0:e.$el)||t.value}))}function Xc(t,e,n,r,o,i,s){try{var a=t[i](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(r,o)}function Yc(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){Xc(i,r,o,s,a,"next",t)}function a(t){Xc(i,r,o,s,a,"throw",t)}s(void 0)}))}}var Qc=n(4687),tu=n.n(Qc);function eu(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onBeforeOpened,r=e.onClosed,o=e.wrapperRef,i=e.modalRef,s=(0,ol.inject)(kl.EDITOR),a=(0,ol.ref)(!1);function l(){var e=Zc(o),n=Zc(i);t=ha(e.value,n.value,{placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:16}}]})}function c(){return u.apply(this,arguments)}function u(){return(u=Yc(tu().mark((function t(){return tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null==n||n(),s.commands.storeSelection(),a.value=!0,t.next=5,(0,ol.nextTick)();case 5:l();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(){a.value=!1,s.commands.restoreSelection(),null==r||r()}(0,ol.onUnmounted)((function(){var e;null===(e=t)||void 0===e||e.destroy()}));var p=function(t){return t?c():d()};return{isOpened:a,open:c,close:d,toggle:p}}function nu(t){var e=t.targetRef,n=t.isActiveRef,r=t.event,o=t.onEvent,i=t.options;function s(){var t;null===(t=e.value)||void 0===t||t.removeEventListener(r,o,i)}function a(){e.value&&(n.value?e.value.addEventListener(r,o,i):s())}(0,ol.watch)(n,a),(0,ol.watch)(e,a),(0,ol.onUnmounted)(s),a()}var ru=["BUTTON","INPUT","LABEL","A"];function ou(t){var e=t.hostRef,n=t.isActiveRef,r=(0,ol.inject)(kl.EDITOR);nu({event:"mousedown",targetRef:Zc(e),isActiveRef:n,onEvent:function(t){ru.includes(t.target.tagName)||(r.isFocused&&(t.stopPropagation(),t.preventDefault()),r.chain().restoreSelection().run())}})}var iu=Symbol("scrollView"),su=fl({name:"ScrollView",setup:function(){var t=(0,ol.ref)(null),e=(0,ol.ref)(null);return(0,ol.provide)(iu,e),(0,ol.onMounted)((function(){var n=Gc.getOptions(t.value.attributes),r=new Gc(t.value,n);e.value=r.getScrollElement()})),{hostRef:t}}},Gl,[],!1,null,"56dc828f",null);su.options.__file="lib/components/base/ScrollView.vue";const au=su.exports;var lu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("label",{staticClass:"zw-field-label",attrs:{for:t.fieldId}},[t._t("default")],2)};lu._withStripped=!0;var cu=fl({name:"FieldLabel",props:{fieldId:{type:String,required:!0}}},lu,[],!1,null,"2be4d197",null);cu.options.__file="lib/components/base/FieldLabel.vue";const uu=cu.exports;var du=function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"zw-range",style:t.inputStyles,attrs:{type:"range",id:t.fieldId,min:t.min,max:t.max,step:t.step},domProps:{value:t.tempValue},on:{input:function(e){return t.update(e)}}})};du._withStripped=!0;var pu=fl({name:"Range",props:{min:{type:[String,Number],required:!0},max:{type:[String,Number],required:!0},step:{type:[String,Number],required:!0},value:{type:[String,Number],required:!0},fieldId:{type:String,required:!1,default:""}},setup:function(t,e){var n=e.emit,r=Jc({valueRef:(0,ol.toRef)(t,"value"),format:Number});return{inputStyles:(0,ol.computed)((function(){var e=Number(t.min),n=Number(t.max),o=Number(t.step),i=Math.ceil(r.value/o)*o;return{"--zw-range-progress":"".concat((i-e)/(n-e)*100,"%")}})),tempValue:r,update:function(t){r.value=Number(t.target.value),n("input",r.value)}}}},du,[],!1,null,"4cc06850",null);pu.options.__file="lib/components/base/Range.vue";const hu=pu.exports;var fu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zw-number-field",class:t.elementClasses},[n("input",{staticClass:"zw-number-field__input",attrs:{type:"number",id:t.fieldId,disabled:t.disabled},domProps:{value:t.tempValue},on:{change:t.onChange}}),t._v(" "),n("div",{staticClass:"zw-number-field__controls"},[n("div",{staticClass:"zw-number-field__buttons"},[n("Button",{staticClass:"zw-number-field__increment-button",attrs:{disabled:t.disabled,"data-test-selector":"increment-button",type:"button"},on:{click:t.incrementValue}}),t._v(" "),n("Button",{staticClass:"zw-number-field__decrement-button",attrs:{disabled:t.disabled,"data-test-selector":"decrement-button",type:"button"},on:{click:t.decrementValue}})],1),t._v(" "),t.units?n("p",{staticClass:"zw-number-field__units"},[t._v("\n "+t._s(t.units)+"\n ")]):t._e()])])};fu._withStripped=!0;var mu=fl({name:"NumberField",components:{Button:Tl},props:{value:{required:!0,type:[Number,String]},min:{type:[Number,String],required:!1,default:null},max:{type:[Number,String],required:!1,default:null},digits:{type:[Number,String],required:!1,default:2},step:{type:[Number,String],required:!1,default:1},units:{type:String,required:!1,default:""},disabled:{type:Boolean,required:!1,default:!1},fieldId:{type:String,required:!1,default:""}},setup:function(t,e){var n=e.emit,r=function(t){return null===t?null:Number(t)},o=function(t){var e=t.digits,n=t.min,r=t.max,o=t.onChange;function i(t){return Number(parseFloat(t).toFixed(e))}var s=Jc({valueRef:t.valueRef,format:i});function a(t){return null!==n&&t<n?n:null!==r&&t>r?r:t}return{temp:s,change:function(t){s.value=t,""===s.value&&(s.value=null!=n?n:1);var e=a(Number.parseFloat(s.value));s.value=i(e),o(s.value)},increment:function(t){var e=a(s.value+Number(t));s.value=i(e),o(s.value)},decrement:function(t){var e=a(s.value-Number(t));s.value=i(e),o(s.value)}}}({valueRef:(0,ol.toRef)(t,"value"),onChange:function(t){return n("input",t)},digits:Number(t.digits),min:r(t.min),max:r(t.max)});return{elementClasses:(0,ol.computed)((function(){return{"zw-number-field--disabled":t.disabled}})),tempValue:o.temp,onChange:function(t){return o.change(t.target.value)},incrementValue:function(){return o.increment(Number(t.step))},decrementValue:function(){return o.decrement(Number(t.step))}}}},fu,[],!1,null,"289baff8",null);mu.options.__file="lib/components/base/NumberField.vue";const vu=mu.exports;var gu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"zw-modal-",duration:t.$options.transition}},[t.isOpened?n("div",{directives:[{name:"out-click",rawName:"v-out-click",value:t.close,expression:"close"}],ref:"hostRef",staticClass:"zw-modal",style:t.modalStyles},[t._t("default")],2):t._e()])};gu._withStripped=!0;var yu=new WeakMap,bu={bind:function(t,e){var n=e.value,r=n.onOutClick||n,o=!n.isDisabled;function i(e){var n=e.target===t||t.contains(e.target);e.target.isConnected&&!n&&r(e)}yu.set(t,{callback:i,isEnabled:o}),o&&setTimeout((function(){return document.addEventListener("click",i)}))},update:function(t,e){var n=e.value,r=yu.get(t),o=!n.isDisabled;o!==r.isEnabled&&(o?document.addEventListener("click",r.callback):document.removeEventListener("click",r.callback),yu.set(t,{callback:r.callback,isEnabled:o}))},unbind:function(t){document.removeEventListener("click",yu.get(t).callback)}};function wu(t,e){var n=e.value,r="string"==typeof n?{text:n}:n,o=r.text,i=r.hotkey;o&&(t.dataset.tooltip=o),o&&i&&(t.dataset.tooltipHotkey=i)}var xu=fl({name:"Modal",transition:{enter:200,leave:100},directives:{outClick:bu},props:{toggler:{type:Object,required:!1,default:null},maxHeight:{type:[Number,String],required:!1,default:1e3},maxWidth:{type:[Number,String],required:!1,default:1e3}},setup:function(t){var e=t.toggler||eu(),n=(0,ol.ref)(null),r=(0,ol.computed)((function(){return{"--zw-modal-max-height":"".concat(t.maxHeight,"px"),"--zw-modal-max-width":"".concat(t.maxWidth,"px")}}));return ou({isActiveRef:e.isOpened,hostRef:n}),{hostRef:n,modalStyles:r,close:e.close,isOpened:e.isOpened}}},gu,[],!1,null,"0a3c1c80",null);xu.options.__file="lib/components/base/Modal.vue";const Su=xu.exports;var Ou=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"dropdownRef",staticClass:"zw-dropdown"},[n("DropdownActivator",{scopedSlots:t._u([{key:"default",fn:function(e){return[t._t("activator",null,null,e)]}}],null,!0)}),t._v(" "),n("Modal",{ref:"modalRef",attrs:{"max-height":"300","max-width":"156",toggler:t.toggler}},[n("DropdownMenu",{attrs:{options:t.options},scopedSlots:t._u([{key:"option",fn:function(e){return[t._t("option",null,null,e)]}}],null,!0)})],1)],1)};Ou._withStripped=!0;var ku=Object.freeze({ACTIVE_MANAGER:Symbol("dropdownActiveManager"),TOGGLER:Symbol("dropdownToggler"),SESSION:Symbol("session")}),Eu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("Button",{staticClass:"zw-dropdown__activator",class:t.dropdownClasses,attrs:{skin:"toolbar",active:t.isOpened},on:{click:t.open}},[n("span",{staticClass:"zw-dropdown__activator-title zw-text--truncate"},[t._v("\n "+t._s(t.activeOptionTitle)+"\n ")]),t._v(" "),n("Icon",{staticClass:"zw-dropdown__activator-arrow",attrs:{name:"arrow",size:"8px","auto-color":""}})],1)]}),{open:t.open,isOpened:t.isOpened})],2)};function Cu(t){return(0,ol.computed)((function(){var e,n;return(null===(e=t.value)||void 0===e?void 0:e.title)||(null===(n=t.value)||void 0===n?void 0:n.id)||""}))}Eu._withStripped=!0;var Mu=fl({name:"DropdownActivator",components:{Icon:Ul,Button:Tl},model:{event:"change"},setup:function(){var t=(0,ol.inject)(ku.ACTIVE_MANAGER),e=(0,ol.inject)(ku.TOGGLER),n=Cu(t.activeOption),r=(0,ol.computed)((function(){return{"zw-dropdown__activator--active":e.isOpened.value}}));return{activeOptionTitle:n,isOpened:e.isOpened,open:e.open,dropdownClasses:r}}},Eu,[],!1,null,"4865ea7a",null);Mu.options.__file="lib/components/base/dropdown/DropdownActivator.vue";const Tu=Mu.exports;var Au=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ScrollView",[n("div",{staticClass:"zw-dropdown__menu",attrs:{"data-test-selector":"dropdownMenu"}},[t._l(t.options,(function(e,r){return[e.options?[n("DropdownGroup",{key:e.id,attrs:{group:e},scopedSlots:t._u([{key:"option",fn:function(e){return[t._t("option",null,null,e)]}}],null,!0)}),t._v(" "),r+1!==t.options.length?n("DropdownDivider",{key:e.id+" divider"}):t._e()]:t._t("option",(function(){return[n("DropdownOption",{attrs:{option:e}})]}),{option:e})]}))],2)])};Au._withStripped=!0;var Nu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zw-dropdown__group"},[n("p",{staticClass:"zw-dropdown__group-title"},[t._v("\n "+t._s(t.groupTitle)+"\n ")]),t._v(" "),t._l(t.group.options,(function(e){return t._t("option",(function(){return[n("DropdownOption",{attrs:{option:e}})]}),{option:e})}))],2)};Nu._withStripped=!0;var Du=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Button",{ref:"optionRef",staticClass:"zw-dropdown__option zw-text--truncate",class:t.classes,on:{click:t.activate}},[t._t("default",(function(){return[t._v(t._s(t.optionTitle))]}))],2)};Du._withStripped=!0;var _u=fl({name:"DropdownOption",components:{Button:Tl},props:{option:{type:Object,required:!0}},setup:function(t){var e,n=(0,ol.inject)(ku.ACTIVE_MANAGER),r=(0,ol.inject)(ku.TOGGLER),o=(0,ol.inject)(ku.SESSION),i=(0,ol.ref)(null),s=(e=(0,ol.inject)(iu),{scrollToElement:function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).offset;if(e.value){var r=e.value.getBoundingClientRect(),o=t.getBoundingClientRect().top-r.top;e.value.scrollTo({top:o-(n||0)})}}}),a=Cu((0,ol.toRef)(t,"option")),l=(0,ol.computed)((function(){var e;return t.option.id===(null===(e=n.activeOption.value)||void 0===e?void 0:e.id)})),c=(0,ol.computed)((function(){return{"zw-dropdown__option--active":l.value}}));return(0,ol.onMounted)(Yc(tu().mark((function t(){var e,n;return tu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!l.value||o.scrolled){t.next=7;break}return o.scrolled=!0,t.next=4,(0,ol.nextTick)();case 4:e=i.value.$el,n=1.5*e.offsetHeight,s.scrollToElement(e,{offset:n});case 7:case"end":return t.stop()}}),t)})))),{optionTitle:a,classes:c,isActive:l,optionRef:i,activate:function(){n.activateOption(t.option),r.close()}}}},Du,[],!1,null,"10a0f0b7",null);_u.options.__file="lib/components/base/dropdown/DropdownOption.vue";const Ru=_u.exports;var Iu=fl({name:"DropdownGroup",components:{DropdownOption:Ru},props:{group:{type:Object,required:!0}},setup:function(t){return{groupTitle:Cu((0,ol.toRef)(t,"group"))}}},Nu,[],!1,null,"207aa7a6",null);Iu.options.__file="lib/components/base/dropdown/DropdownGroup.vue";const zu=Iu.exports;var Lu=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"zw-dropdown__divider"})};Lu._withStripped=!0;var Pu=fl({name:"DropdownDivider"},Lu,[],!1,null,"72e4c372",null);Pu.options.__file="lib/components/base/dropdown/DropdownDivider.vue";var Bu=fl({name:"DropdownMenu",components:{ScrollView:au,DropdownGroup:zu,DropdownOption:Ru,DropdownDivider:Pu.exports},props:{options:{type:Array,required:!0}},setup:function(){(0,ol.provide)(ku.SESSION,{})}},Au,[],!1,null,null,null);Bu.options.__file="lib/components/base/dropdown/DropdownMenu.vue";var Fu=fl({name:"Dropdown",components:{Modal:Su,DropdownActivator:Tu,DropdownMenu:Bu.exports},model:{event:"change"},props:{value:{type:String,required:!1,default:null},options:{type:Array,required:!0}},setup:function(t,e){var n=e.emit,r=(0,ol.ref)(null),o=(0,ol.ref)(null),i=function(t){var e=t.optionsRef,n=t.inputRef,r=t.stateless,o=t.onChange,i=(0,ol.ref)(null);function s(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).emitEvent;r||(i.value=t),!1!==e&&o(t)}var a=function(){return t=n.value,r={emitEvent:!1},void s(e.value.flatMap((function(t){return t.options||t})).find((function(e){return e.id===t})),r);var t,r};return a(),(0,ol.watch)(n,a),{activeOption:i,activateOption:s}}({optionsRef:(0,ol.toRef)(t,"options"),inputRef:(0,ol.toRef)(t,"value"),stateless:null===t.value,onChange:function(t){return n("change",t.id)}}),s=eu({wrapperRef:r,modalRef:o});return(0,ol.provide)(ku.ACTIVE_MANAGER,i),(0,ol.provide)(ku.TOGGLER,s),{dropdownRef:r,modalRef:o,toggler:s}}},Ou,[],!1,null,"35f81e22",null);Fu.options.__file="lib/components/base/dropdown/Dropdown.vue";const ju=Fu.exports;var Vu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("ZipifyColorPicker",{directives:[{name:"out-click",rawName:"v-out-click",value:{onOutClick:t.close,isDisabled:!t.isOpened},expression:"{ onOutClick: close, isDisabled: !isOpened }"}],ref:"pickerRef",attrs:{placement:"bottom-end","favorite-colors":t.favoriteColors},on:{changeFavoriteColors:t.updateFavoriteColors},scopedSlots:t._u([{key:"activator",fn:function(){return[t._t("activator",null,{isOpened:t.isOpened,open:t.open,close:t.close,toggle:t.toggle})]},proxy:!0}],null,!0),model:{value:t.editingColor,callback:function(e){t.editingColor=e},expression:"editingColor"}})};Vu._withStripped=!0;var $u=fl({name:"ColorPicker",components:{ZipifyColorPicker:$l.ZipifyColorPicker},directives:{outClick:bu},props:{value:{type:String,required:!0}},setup:function(t,e){var n=e.emit,r=(0,ol.inject)(kl.FAVORITE_COLORS),o=(0,ol.inject)(kl.EDITOR),i=(0,ol.ref)(null),s=function(t){var e=t.pickerRef,n=t.initialColorRef,r=t.onClosed,o=t.onBeforeOpened,i=(0,ol.ref)(n.value),s=(0,ol.computed)((function(){var t,n;return null!==(t=null===(n=e.value)||void 0===n?void 0:n.isVisible)&&void 0!==t&&t}));function a(){o(),i.value=n.value,e.value.open(e.value.$el)}function l(){e.value.close(i.value),r(i.value)}return{isOpened:s,editingColor:i,open:a,close:l,toggle:function(){s.value?l():a()},cancel:function(){i.value=n.value,e.value.close(i.value)}}}({onClosed:function(e){o.commands.restoreSelection(),e!==t.value&&n("change",e)},onBeforeOpened:function(){o.commands.storeSelection(),n("before-opened")},pickerRef:i,initialColorRef:(0,ol.toRef)(t,"value")});return function(t){var e=t.isOpenedRef,n=t.onCancel,r=t.onApply;function o(t,e){t.stopImmediatePropagation(),t.preventDefault(),e()}nu({targetRef:(0,ol.ref)(document),isActiveRef:e,event:"keydown",onEvent:function(t){switch(t.key){case"Escape":return o(t,n);case"Enter":return o(t,r)}},options:{capture:!0}})}({isOpenedRef:s.isOpened,onCancel:function(){return s.cancel()},onApply:function(){return s.close()}}),ou({hostRef:i,isActiveRef:s.isOpened}),{pickerRef:i,isOpened:s.isOpened,editingColor:s.editingColor,open:s.open,close:s.close,toggle:s.toggle,favoriteColors:r.listRef,updateFavoriteColors:function(t){r.triggerUpdate(t)}}}},Vu,[],!1,null,null,null);$u.options.__file="lib/components/base/colorPicker/ColorPicker.vue";const Hu=$u.exports;var Wu=fl({name:"StylePresetControl",components:{Icon:Ul,Button:Tl,Dropdown:ju},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR),e=t.commands.getPresetList(),n=t.commands.getPreset(),r=t.commands.getPresetCustomization(),o=(0,ol.computed)((function(){var t=r.value,e=t.attributes,n=t.marks;return!!e.length||!!n.length})),i=(0,ol.computed)((function(){return e.value.map((function(t){return{id:t.id,title:t.name}}))}));return{options:i,preset:n,isCustomized:o,apply:function(e){return t.chain().focus().applyPreset(e).run()},removeCustomization:function(){return t.chain().focus().removePresetCustomization().run()}}}},Ol,[],!1,null,"0f6b31b1",null);Wu.options.__file="lib/components/toolbar/controls/StylePresetControl.vue";const qu=Wu.exports;var Uu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Font Name",expression:"'Font Name'"}],staticClass:"zw-font-family-control",attrs:{options:t.options,value:t.currentValue},on:{change:t.apply},scopedSlots:t._u([{key:"option",fn:function(e){var r=e.option;return[n("DropdownOption",{directives:[{name:"tooltip",rawName:"v-tooltip",value:r.id,expression:"option.id"}],staticClass:"zw-font-family-control__option",style:t.renderOptionStyles(r),attrs:{option:r}})]}}])})};function Gu(t){return function(t){if(Array.isArray(t))return Il(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||zl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Uu._withStripped=!0;var Ku="wswg.recently_used_fonts";function Ju(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Zu=fl({name:"FontFamilyControl",components:{Dropdown:ju,DropdownOption:Ru},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.FONTS),e=(0,ol.inject)(kl.EDITOR),n=function(t){var e=(0,ol.inject)(kl.LOCAL_STORAGE),n=(0,ol.ref)(e.getItem(Ku)||[]),r=(0,ol.computed)((function(){return!n.value.length}));return{fonts:n,isEmpty:r,add:function(t){n.value=Array.from(new Set([t].concat(Gu(n.value)))).slice(0,5),e.setItem(Ku,n.value)}}}(),r=(0,ol.computed)((function(){return{id:"Recently Used",options:n.fonts.value.map((function(t){return{id:t}}))}}));return{options:(0,ol.computed)((function(){var e,o={},i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ju(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ju(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(t);try{for(i.s();!(e=i.n()).done;){var s,a,l=e.value;null!==(a=o[s=l.category])&&void 0!==a||(o[s]={id:l.category,options:[]}),o[l.category].options.push({id:l.name})}}catch(t){i.e(t)}finally{i.f()}return n.isEmpty.value?Object.values(o):[r.value].concat(Gu(Object.values(o)))})),currentValue:e.commands.getFontFamily(),renderOptionStyles:function(t){return{"--zw-font-family-option":'"'.concat(t.id,'"')}},apply:function(t){n.add(t),e.chain().focus().applyFontFamily(t).run()}}}},Uu,[],!1,null,"2e95c716",null);Zu.options.__file="lib/components/toolbar/controls/FontFamilyControl.vue";const Xu=Zu.exports;var Yu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Font Weight",hotkey:"Mod B"},expression:"{ text: 'Font Weight', hotkey: 'Mod B' }"}],attrs:{options:t.options,value:t.currentValue},on:{change:t.apply}})};Yu._withStripped=!0;var Qu=fl({name:"FontWeightControl",components:{Dropdown:ju},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR),e=t.commands.getFont();return{options:(0,ol.computed)((function(){return e.value.weights.map((function(t){return{id:t}}))})),currentValue:t.commands.getFontWeight(),apply:function(e){return t.chain().focus().applyFontWeight(e).run()}}}},Yu,[],!1,null,null,null);Qu.options.__file="lib/components/toolbar/controls/FontWeightControl.vue";const td=Qu.exports;var ed=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Font Size",hotkey:"Mod Shift +/-"},expression:"{ text: 'Font Size', hotkey: 'Mod Shift +/-' }"}],attrs:{options:t.options,value:t.currentValue},on:{change:t.apply}})};ed._withStripped=!0;const nd={name:"FontSizeControl",components:{Dropdown:ju},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.FONT_SIZES),e=(0,ol.inject)(kl.EDITOR),n=(0,ol.computed)((function(){return t.map((function(t){return{id:t,title:"".concat(t,"px")}}))}));return{options:n,currentValue:e.commands.getFontSize(),apply:function(t){return e.chain().focus().applyFontSize(t).run()}}}};var rd=fl(nd,ed,[],!1,null,null,null);rd.options.__file="lib/components/toolbar/controls/FontSizeControl.vue";const od=rd.exports;var id=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ColorPicker",{attrs:{value:t.currentValue},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(t){var e=t.toggle,r=t.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Font Color",expression:"'Font Color'"}],attrs:{icon:"",skin:"toolbar",active:r},on:{click:e}},[n("Icon",{attrs:{name:"font-color",size:"28px","auto-color":""}})],1)]}}])})};id._withStripped=!0;var sd=fl({name:"FontColorControl",components:{ColorPicker:Hu,Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR);return{currentValue:t.commands.getFontColor(),apply:function(e){return t.chain().applyFontColor(e).run()}}}},id,[],!1,null,null,null);sd.options.__file="lib/components/toolbar/controls/FontColorControl.vue";const ad=sd.exports;var ld=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ColorPicker",{attrs:{value:t.currentValue},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(t){var e=t.toggle,r=t.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Background Color",expression:"'Background Color'"}],attrs:{icon:"",skin:"toolbar",active:r},on:{click:e}},[n("Icon",{attrs:{name:"background-color",size:"28px","auto-color":""}})],1)]}}])})};ld._withStripped=!0;var cd=fl({name:"BackgroundColorControl",components:{ColorPicker:Hu,Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR);return{currentValue:t.commands.getBackgroundColor(),apply:function(e){return t.chain().applyBackgroundColor(e).run()}}}},ld,[],!1,null,null,null);cd.options.__file="lib/components/toolbar/controls/BackgroundColorControl.vue";const ud=cd.exports;var dd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Italic",hotkey:"Mod I"},expression:"{ text: 'Italic', hotkey: 'Mod I' }"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue,disabled:!t.isAvailable},on:{click:t.apply}},[n("Icon",{attrs:{name:"italic",size:"28px","auto-color":""}})],1)};dd._withStripped=!0;var pd=fl({name:"ItalicControl",components:{Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR),e=t.commands.isItalic();return{isAvailable:t.commands.isItalicAvailable(),currentValue:e,apply:function(){return t.chain().focus().toggleItalic().run()}}}},dd,[],!1,null,null,null);pd.options.__file="lib/components/toolbar/controls/ItalicControl.vue";const hd=pd.exports;var fd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Underline",hotkey:"Mod U"},expression:"{ text: 'Underline', hotkey: 'Mod U' }"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue},on:{click:t.apply}},[n("Icon",{attrs:{name:"underline",size:"28px","auto-color":""}})],1)};fd._withStripped=!0;var md=fl({name:"UnderlineControl",components:{Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR);return{currentValue:t.commands.isUnderline(),apply:function(){return t.chain().focus().toggleUnderline().run()}}}},fd,[],!1,null,null,null);md.options.__file="lib/components/toolbar/controls/UnderlineControl.vue";const vd=md.exports;var gd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Strikethrough",expression:"'Strikethrough'"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue},on:{click:t.apply}},[n("Icon",{attrs:{name:"strike-through",size:"28px","auto-color":""}})],1)};gd._withStripped=!0;var yd=fl({name:"StrikeThroughControl",components:{Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR);return{currentValue:t.commands.isStrikeThrough(),apply:function(){return t.chain().focus().toggleStrikeThrough().run()}}}},gd,[],!1,null,null,null);yd.options.__file="lib/components/toolbar/controls/StrikeThroughControl.vue";const bd=yd.exports;var wd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Superscript",expression:"'Superscript'"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue},on:{click:t.apply}},[n("Icon",{attrs:{name:"superscript",size:"28px","auto-color":""}})],1)};wd._withStripped=!0;var xd=fl({name:"SuperscriptControl",components:{Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR);return{currentValue:(0,ol.computed)((function(){return t.isActive("superscript")})),apply:function(){return t.chain().focus().toggleSuperscript().run()}}}},wd,[],!1,null,null,null);xd.options.__file="lib/components/toolbar/controls/SuperscriptControl.vue";const Sd=xd.exports;var Od=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",{attrs:{options:t.$options.styles},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(t){var e=t.open,r=t.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Case Styles",expression:"'Case Styles'"}],attrs:{icon:"",skin:"toolbar",active:r},on:{click:e}},[n("Icon",{attrs:{name:"case-style",size:"28px","auto-color":""}})],1)]}}])})};Od._withStripped=!0;var kd=fl({name:"CaseStyleControl",components:{Dropdown:ju,Button:Tl,Icon:Ul},directives:{tooltip:wu},styles:[{id:al.UPPERCASE,title:"UPPERCASE"},{id:al.LOWERCASE,title:"lowercase"},{id:al.CAPITALIZE,title:"Capitalize"}],setup:function(){var t=(0,ol.inject)(kl.EDITOR);return{apply:function(e){return t.chain().focus().applyCaseStyle(e).run()}}}},Od,[],!1,null,null,null);kd.options.__file="lib/components/toolbar/controls/CaseStyleControl.vue";const Ed=kd.exports;var Cd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ButtonToggle",{attrs:{value:t.currentValue,options:t.$options.alignments},on:{change:t.apply},scopedSlots:t._u([{key:"option",fn:function(t){var e=t.isActive,r=t.option,o=t.activate;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:r.tooltip,expression:"option.tooltip"}],attrs:{icon:"",skin:"toolbar",active:e},on:{click:o}},[n("Icon",{attrs:{name:"alignment-"+r.id,size:"28px","auto-color":""}})],1)]}}])})};Cd._withStripped=!0;var Md=fl({name:"AlignmentControl",alignments:[{id:ll.LEFT,tooltip:{text:"Align Left",hotkey:"Mod Shift L"}},{id:ll.CENTER,tooltip:{text:"Align Center",hotkey:"Mod Shift E"}},{id:ll.RIGHT,tooltip:{text:"Align Right",hotkey:"Mod Shift R"}},{id:ll.JUSTIFY,tooltip:{text:"Justify",hotkey:"Mod Shift J"}}],components:{ButtonToggle:Dl,Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(t,e){var n=e.emit,r=(0,ol.inject)(kl.EDITOR);return{currentValue:r.commands.getAlignment(),apply:function(t){r.chain().focus().applyAlignment(t).run(),n("applied")}}}},Cd,[],!1,null,null,null);Md.options.__file="lib/components/toolbar/controls/AlignmentControl.vue";const Td=Md.exports;var Ad=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wrapperRef",staticClass:"zw-position--relative"},[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Alignment",expression:"'Alignment'"}],attrs:{icon:"",skin:"toolbar",active:t.isOpened},on:{click:t.toggler.open}},[n("Icon",{attrs:{name:"alignment-"+t.currentValue,size:"28px","auto-color":""}})],1),t._v(" "),n("Modal",{ref:"modalRef",staticClass:"zw-alignment-control__modal",attrs:{toggler:t.toggler}},[n("AlignmentControl",{staticClass:"zw-alignment-control__toggle",on:{applied:t.toggler.close}})],1)],1)};Ad._withStripped=!0;var Nd=fl({name:"AlignmentDeviceControl",components:{Button:Tl,Icon:Ul,Modal:Su,AlignmentControl:Td},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR).commands.getAlignment(),e=(0,ol.ref)(null),n=(0,ol.ref)(null),r=eu({wrapperRef:e,modalRef:n});return{wrapperRef:e,modalRef:n,currentValue:t,toggler:r,isOpened:r.isOpened}}},Ad,[],!1,null,"9713d430",null);Nd.options.__file="lib/components/toolbar/controls/AlignmentDeviceControl.vue";const Dd=Nd.exports;var _d=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wrapperRef",staticClass:"zw-position--relative"},[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Line Height",expression:"'Line Height'"}],attrs:{icon:"",skin:"toolbar",active:t.isOpened},on:{click:t.toggler.open}},[n("Icon",{attrs:{name:"line-height",size:"28px","auto-color":""}})],1),t._v(" "),n("Modal",{ref:"modalRef",staticClass:"zw-line-height-control__modal",attrs:{toggler:t.toggler}},[n("FieldLabel",{staticClass:"zw-margin-bottom--xs",attrs:{"field-id":"wswg-line-height"}},[t._v("\n Line Height\n ")]),t._v(" "),n("div",{staticClass:"zw-line-height-control__row"},[n("Range",{staticClass:"zw-line-height-control__range",attrs:{step:"0.1",min:"1",max:"3",value:t.currentValue},on:{input:t.apply}}),t._v(" "),n("NumberField",{staticClass:"zw-line-height-control__field",attrs:{step:"0.1",min:"1",max:"3","field-id":"wswg-line-height",value:t.currentValue},on:{input:t.apply}})],1)],1)],1)};_d._withStripped=!0;var Rd=fl({name:"LineHeightControl",components:{Range:hu,Modal:Su,Icon:Ul,Button:Tl,NumberField:vu,FieldLabel:uu},directives:{tooltip:wu},setup:function(){var t=(0,ol.ref)(null),e=(0,ol.ref)(null),n=(0,ol.inject)(kl.EDITOR),r=eu({wrapperRef:t,modalRef:e}),o=n.commands.getLineHeight();return{wrapperRef:t,modalRef:e,isOpened:r.isOpened,toggler:r,currentValue:o,apply:function(t){return n.commands.applyLineHeight(String(t))}}}},_d,[],!1,null,"b87c3724",null);Rd.options.__file="lib/components/toolbar/controls/LineHeightControl.vue";const Id=Rd.exports;var zd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",{attrs:{value:t.currentValue,options:t.$options.listTypes},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(e){var r=e.open,o=e.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Bullet Styles",expression:"'Bullet Styles'"}],attrs:{icon:"",skin:"toolbar",active:o||t.isList},on:{click:r}},[n("Icon",{attrs:{name:t.currentIcon,size:"28px","auto-color":""}})],1)]}},{key:"option",fn:function(t){var e=t.option;return[n("DropdownOption",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.tooltip,expression:"option.tooltip"}],staticClass:"zw-list-control__option",attrs:{option:e}},[n("Icon",{attrs:{name:e.icon,size:"28px","auto-color":""}})],1)]}}])})};zd._withStripped=!0;var Ld=fl({name:"ListControl",listTypes:ul.values.map((function(t){return{id:t,icon:"list-".concat(t)}})),components:{Dropdown:ju,DropdownOption:Ru,Button:Tl,Icon:Ul},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR),e=t.commands.getListType();return{isList:(0,ol.computed)((function(){return!!e.value})),currentValue:(0,ol.computed)((function(){return e.value||"none"})),currentIcon:(0,ol.computed)((function(){var t=e.value||ul.DISC;return"list-".concat(t)})),apply:function(e){return t.chain().focus().applyList(e).run()}}}},zd,[],!1,null,"305d852b",null);Ld.options.__file="lib/components/toolbar/controls/ListControl.vue";const Pd=Ld.exports;var Bd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Remove Styles",expression:"'Remove Styles'"}],attrs:{skin:"toolbar",icon:""},on:{click:t.apply}},[n("Icon",{attrs:{name:"remove-format",size:"28px","auto-color":""}})],1)};Bd._withStripped=!0;var Fd=fl({name:"RemoveFormatControl",components:{Icon:Ul,Button:Tl},directives:{tooltip:wu},setup:function(){var t=(0,ol.inject)(kl.EDITOR);return{apply:function(){return t.chain().focus().removeFormat().run()}}}},Bd,[],!1,null,null,null);Fd.options.__file="lib/components/toolbar/controls/RemoveFormatControl.vue";var jd=fl({name:"ToolbarFull",components:{ToolbarRow:bl,ToolbarGroup:Sl,ToolbarDivider:vl,StylePresetControl:qu,CaseStyleControl:Ed,FontFamilyControl:Xu,FontWeightControl:td,FontSizeControl:od,FontColorControl:ad,BackgroundColorControl:ud,ItalicControl:hd,UnderlineControl:vd,SuperscriptControl:Sd,StrikeThroughControl:bd,AlignmentControl:Td,LineHeightControl:Id,ListControl:Pd,RemoveFormatControl:Fd.exports}},pl,[],!1,null,null,null);jd.options.__file="lib/components/toolbar/ToolbarFull.vue";const Vd=jd.exports;var $d=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ToolbarRow",[n("StylePresetControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("AlignmentDeviceControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontSizeControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("LineHeightControl")],1)};$d._withStripped=!0;var Hd=fl({name:"ToolbarDevice",components:{ToolbarRow:bl,ToolbarDivider:vl,StylePresetControl:qu,AlignmentDeviceControl:Dd,FontSizeControl:od,LineHeightControl:Id}},$d,[],!1,null,null,null);Hd.options.__file="lib/components/toolbar/ToolbarDevice.vue";const Wd=Hd.exports;var qd=fl({name:"Toolbar",props:{device:{type:String,required:!0}},setup:function(t){return{toolbarComponent:(0,ol.computed)((function(){return t.device===sl.DESKTOP?Vd:Wd}))}}},il,[],!1,null,"05accea6",null);qd.options.__file="lib/components/toolbar/Toolbar.vue";const Ud=qd.exports;function Gd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Jd(t,e,n){return e&&Kd(t.prototype,e),n&&Kd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Zd=function(){function t(){Gd(this,t)}return Jd(t,null,[{key:"decode",value:function(t){try{return JSON.parse(t)}catch(t){return console.error(t),null}}},{key:"encode",value:function(t){return JSON.stringify(t)}}]),t}(),Xd=function(){function t(e){Gd(this,t),this.nativeStorage=e,this.KEY_PREFIX="zp."}return Jd(t,[{key:"makeKey",value:function(t){return this.KEY_PREFIX+t}},{key:"setItem",value:function(t,e){var n=this,r=Zd.encode(e);this.accessToStorage((function(e){return e.setItem(n.makeKey(t),r)}))}},{key:"getItem",value:function(t){var e=this,n=this.accessToStorage((function(n){return n.getItem(e.makeKey(t))}));return Zd.decode(n)}},{key:"accessToStorage",value:function(t){try{return t(this.nativeStorage)}catch(t){this.onPrivateModeEnabled(t)}}},{key:"onPrivateModeEnabled",value:function(t){console.error(t)}}]),t}(),Yd=Jd((function t(e){var n=e.listRef,r=e.triggerUpdate;Gd(this,t),this.listRef=n,this.triggerUpdate=r}));function Qd(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return tp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function tp(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ep=function(){function t(){Gd(this,t)}return Jd(t,[{key:"normalize",value:function(t){return"string"!=typeof t?t:this._normalizeTextContent(t)}},{key:"_normalizeTextContent",value:function(t){var e=(new DOMParser).parseFromString(t,"text/html");return this._iterateNodes(e,this._normalizeStructure.bind(this),(function(t){return"SPAN"===t.tagName})),this._iterateNodes(e,this._normalizeStyles.bind(this),(function(t){return"SPAN"!==t.tagName})),e.body.innerHTML}},{key:"_iterateNodes",value:function(t,e,n){for(var r=t.createNodeIterator(t.body,NodeFilter.SHOW_ELEMENT,{acceptNode:function(t){return n(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),o=r.nextNode();o;)e(o),o=r.nextNode()}},{key:"_normalizeStructure",value:function(t){var e=Array.from(t.childNodes).every((function(t){return t.nodeType===Node.TEXT_NODE}));if(!e){var n,r=t.cloneNode(!0),o=this._getMigratingStyles(t),i=[],s=Qd(r.childNodes);try{for(s.s();!(n=s.n()).done;){var a=n.value,l=a;o.length&&(l=this._wrapTextNode(r,a),this._assignElementProperties(l,r,o)),i.push(l)}}catch(t){s.e(t)}finally{s.f()}t.replaceWith.apply(t,i)}}},{key:"_normalizeStyles",value:function(t){var e,n=this._getMigratingStyles(t),r=Qd(t.childNodes);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=this._wrapTextNode(t,o);this._assignElementProperties(i,t,n)}}catch(t){r.e(t)}finally{r.f()}this._removeStyleProperties(t,n)}},{key:"_getMigratingStyles",value:function(e){for(var n=t.NORMALIZING_STYLE_BLACKLIST,r=[],o=0;o<e.style.length;o++){var i=e.style.item(o);n.includes(i)||r.push(i)}return r}},{key:"_wrapTextNode",value:function(t,e){if(e.nodeType!==Node.TEXT_NODE)return e;var n=document.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}},{key:"_assignElementProperties",value:function(t,e,n){var r,o=Qd(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;t.style.getPropertyValue(i)||t.style.setProperty(i,e.style.getPropertyValue(i))}}catch(t){o.e(t)}finally{o.f()}}},{key:"_removeStyleProperties",value:function(t,e){var n,r=Qd(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;t.style.removeProperty(o)}}catch(t){r.e(t)}finally{r.f()}0===t.style.length&&t.removeAttribute("style")}}]),t}();Cl(ep,"NORMALIZING_STYLE_BLACKLIST",["text-align","line-height"]);var np=200,rp=function(){};rp.prototype.append=function(t){return t.length?(t=rp.from(t),!this.length&&t||t.length<np&&this.leafAppend(t)||this.length<np&&t.leafPrepend(this)||this.appendInner(t)):this},rp.prototype.prepend=function(t){return t.length?rp.from(t).append(this):this},rp.prototype.appendInner=function(t){return new ip(this,t)},rp.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?rp.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},rp.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},rp.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)},rp.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},rp.from=function(t){return t instanceof rp?t:t&&t.length?new op(t):rp.empty};var op=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 o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=np)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=np)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}(rp);rp.empty=new op([]);var ip=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 t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=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}(rp);const sp=rp;class ap{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new lp(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new lp(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new ap(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,c=t.steps[n].invert(t.docs[n]),u=new lp(t.mapping.maps[n],c,e);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),e&&(i++,e=void 0),r||(a=u)}let l=i-n.depth;return l>up&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new ap(s.append(o),i)}remapping(t,e){let n=new ft;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new ap(this.items.append(t.map((t=>new lp(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new lp(l,i,c))}else n.push(new lp(l))}),r);let l=[];for(let t=e;t<i;t++)l.push(new lp(o.maps[t]));let c=this.items.slice(0,r).append(l).append(n),u=new ap(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}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=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new lp(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new ap(sp.from(r.reverse()),o)}}ap.empty=new ap(sp.empty,0);class lp{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 lp(e.getMap().invert(),e,this.selection)}}}class cp{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const up=20;function dp(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function pp(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function hp(t,e,n,r){let o=vp(e),i=gp.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),c=new cp(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(gp,{redo:r,historyState:c}).scrollIntoView())}let fp=!1,mp=null;function vp(t){let e=t.plugins;if(mp!=e){fp=!1,mp=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){fp=!0;break}}return fp}const gp=new de("history"),yp=new de("closeHistory");function bp(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new le({key:gp,state:{init:()=>new cp(ap.empty,ap.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(gp);if(i)return i.historyState;n.getMeta(yp)&&(t=new cp(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(gp))return s.getMeta(gp).redo?new cp(t.done.addTransform(n,void 0,r,vp(e)),t.undone,dp(n.mapping.maps[n.steps.length-1]),t.prevTime):new cp(t.done,t.undone.addTransform(n,void 0,r,vp(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new cp(t.done.rebased(n,o),t.undone.rebased(n,o),pp(t.prevRanges,n.mapping),t.prevTime):new cp(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),pp(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(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 o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?pp(t.prevRanges,n.mapping):dp(n.mapping.maps[n.steps.length-1]);return new cp(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,vp(e)),ap.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?wp:"historyRedo"==n?xp:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const wp=(t,e)=>{let n=gp.getState(t);return!(!n||0==n.done.eventCount||(e&&hp(n,t,e,!1),0))},xp=(t,e)=>{let n=gp.getState(t);return!(!n||0==n.undone.eventCount||(e&&hp(n,t,e,!0),0))},Sp=bi.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>wp(t,e),redo:()=>({state:t,dispatch:e})=>xp(t,e)}),addProseMirrorPlugins(){return[bp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Op=is.create({name:"doc",topNode:!0,content:"block+"}),kp=is.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",ri(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ep=is.create({name:"text",group:"inline"});function Cp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Mp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cp(Object(n),!0).forEach((function(e){Cl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Tp(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ap(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ap(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function Ap(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Np=bi.create({name:"node_processor",addCommands:function(){return{setBlockAttributes:Rl((function(t,e,n){var r,o,i=t.commands,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=null!==(r=i.getBlockAttributes(e).value)&&void 0!==r?r:{},l=Tp(cl.blocks);try{for(l.s();!(o=l.n()).done;){var c=o.value;i.updateAttributes(c,Cl({},e,Mp(Mp(Mp({},s),a),n)))}}catch(t){l.e(t)}finally{l.f()}})),getBlockAttributes:Rl((function(t,e,n){var r=t.editor;return(0,ol.computed)((function(){var t,o=Object.assign({},n||{}),i=Tp(cl.blocks);try{for(i.s();!(t=i.n()).done;){var s,a=t.value;Object.assign(o,(null===(s=r.getAttributes(a))||void 0===s?void 0:s[e])||{})}}catch(t){i.e(t)}finally{i.f()}return Object.keys(o).length?o:null}))}))}}}),Dp=ns({find:/"/,replace:"”"}),_p=ns({find:/'/,replace:"’"}),Rp=ns({find:/\(c\)/i,replace:"©"}),Ip=ns({find:/\.\.\./,replace:"…"}),zp=ns({find:/--/,replace:"—"}),Lp=ns({find:/(?:^|[\s{[(<'"\u2018\u201C])(")/,replace:"“"}),Pp=ns({find:/(?:^|[\s{[(<'"\u2018\u201C])(')/,replace:"‘"}),Bp=ns({find:/\(r\)/i,replace:"®"}),Fp=ns({find:/\(tm\)/i,replace:"™"}),jp=bi.create({name:"text_processor",addCommands:function(){return{transformText:Rl((function(t,e){var n=t.state,r=n.tr.selection;r.from!==r.to&&n.doc.nodesBetween(r.from,r.to,(function(t,o){if(t.isText){var i=Math.max(o,r.from),s=Math.min(o+t.nodeSize,r.to),a=Math.max(0,r.from-o),l=Math.max(0,r.to-o),c=e({text:t.textContent.substring(a,l),position:{start:i,end:s}}),u=n.schema.text(c,t.marks);n.tr.replaceWith(i,s,u)}}))}))}},addInputRules:function(){return[zp,Bp,Fp,Ip,Lp,Pp,Dp,_p,Rp]}}),Vp=bi.create({name:"selection_processor",addStorage:function(){return{selection:null}},addCommands:function(){var t=this;return{storeSelection:Rl((function(e){var n=e.state;t.storage.selection=n.selection})),restoreSelection:Rl((function(e){e.commands.setTextSelection(t.storage.selection)})),expandSelectionToBlock:Rl((function(t){var e=t.state,n=t.commands,r=e.selection.from,o=e.selection.to;e.doc.nodesBetween(r,o,(function(t,e,n){n.type.name===cl.DOCUMENT&&(r=Math.min(r,e+1),o=Math.max(o,e+t.nodeSize-1))})),n.setTextSelection({from:r,to:o})}))}}}),$p=[Op,kp.configure({HTMLAttributes:{class:"zw-style"}}),Ep,Np,jp,Vp],Hp=rs.create({name:dl.FONT_FAMILY,addOptions:function(){return{fonts:[]}},addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{applyFontFamily:Rl((function(e,n){var r=e.commands;r.setMark(t.name,{value:n});var o=r.findFontByName(n),i=r.getFontWeight().value;o.isWeightSupported(i)||(i=o.findClosestWeight(i),r.applyFontWeight(i)),o.isItalicSupported(i)||r.removeItalic()})),getFont:Rl((function(t){var e=t.commands,n=e.getFontFamily();return(0,ol.computed)((function(){return e.findFontByName(n.value)}))})),findFontByName:Rl((function(e,n){return t.options.fonts.find((function(t){return t.name===n}))})),getFontFamily:Rl((function(e){var n=e.editor,r=e.commands.getDefaultFontFamily();return(0,ol.computed)((function(){var e,o;return null!==(e=null===(o=n.getAttributes(t.name))||void 0===o?void 0:o.value)&&void 0!==e?e:r.value}))})),getDefaultFontFamily:Rl((function(t){var e=t.commands.getPreset();return(0,ol.computed)((function(){return e.value.common.font_family}))}))}},parseHTML:function(){return[{style:"font-family",getAttrs:function(t){return{value:t}}}]},renderHTML:function(t){return jl({font_family:t.HTMLAttributes.value})}});const Wp=is.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}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ri(this.options.HTMLAttributes,e),0]},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=>{return e={find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}},new pi({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=si(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}});var e}))}});function qp(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Up(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Up(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function Up(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Gp(t,e){return t.split(" ").map((function(t){return".".concat(t)})).join("")+e.id}var Kp=bi.create({name:"style_preset",addExtensions:function(){return[Wp.configure({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})]},addOptions:function(){return{presetsRef:null,defaultId:null,baseClass:null,makeVariable:null}},addStorage:function(){return{presetStyleEl:null}},addGlobalAttributes:function(){var t=this;return[{types:[cl.PARAGRAPH,cl.HEADING],attributes:{preset:{isRequired:!1,default:null,parseHTML:function(e){var n,r=qp(t.options.presetsRef.value);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.id,s=o.node,a=o.fallbackClass;if(a&&e.classList.contains(a))return{id:i};var l=Gp(t.options.baseClass,{id:i});if(e.matches(l))return{id:i};if(e.tagName==="H".concat(null==s?void 0:s.level))return{id:i}}}catch(t){r.e(t)}finally{r.f()}return"P"===e.tagName?{id:t.options.defaultId}:null},renderHTML:function(e){return e.preset?{class:t.options.baseClass+e.preset.id}:null}}}}]},addCommands:function(){var t=this;function e(t,e){return t.find((function(t){return e===t.id}))}return{getPresetList:Rl((function(){return(0,ol.computed)((function(){return t.options.presetsRef.value.filter((function(t){return!t.hidden}))}))})),getPreset:Rl((function(n){var r=n.commands,o=r.getBlockAttributes("preset",{id:t.options.defaultId}),i=r.getPresetList();return(0,ol.computed)((function(){return e(i.value,o.value.id)}))})),applyPreset:Rl((function(t,n){var r,o,i=t.commands,s=t.chain,a=e(i.getPresetList().value,n),l=null!==(r=null===(o=a.node)||void 0===o?void 0:o.type)&&void 0!==r?r:cl.PARAGRAPH,c={preset:{id:n}};a.node&&(c.level=a.node.level);var u,d=qp(dl.attributes);try{for(d.s();!(u=d.n()).done;){var p=u.value;c[p]=i.getBlockAttributes(p).value}}catch(t){d.e(t)}finally{d.f()}s().removeList().setNode(l,c).run()})),applyDefaultPreset:Rl((function(e){e.commands.applyPreset(t.options.defaultId)})),removePreset:Rl((function(t){t.commands.setNode(cl.PARAGRAPH,{preset:null})})),getPresetCustomization:Rl((function(t){var e=t.editor,n=(0,ol.toRef)(e,"state");return(0,ol.computed)((function(){var t=new Set,e=new Set,r=n.value.selection,o=r.from,i=r.to;return n.value.doc.nodesBetween(o,i,(function(n){for(var r=0,o=Object.entries(n.attrs);r<o.length;r++){var i=Ll(o[r],2),s=i[0],a=i[1];dl.attributes.includes(s)&&a&&t.add(s)}var l,c=qp(n.marks);try{for(c.s();!(l=c.n()).done;){var u=l.value.type;dl.marks.includes(u.name)&&e.add(u.name)}}catch(t){c.e(t)}finally{c.f()}})),{attributes:Array.from(t),marks:Array.from(e)}}))})),removePresetCustomization:Rl((function(t){(0,t.chain)().storeSelection().expandSelectionToBlock().unsetAllMarks().resetAttributes(cl.PARAGRAPH,dl.attributes).resetAttributes(cl.HEADING,dl.attributes).restoreSelection().run()})),removeFormat:Rl((function(t){var e=t.commands;e.removePresetCustomization(),e.applyDefaultPreset()}))}},onCreate:function(){var t=document.querySelector("[data-zw-styles]");if(t)this.storage.presetStyleEl=t;else{this.storage.presetStyleEl=document.createElement("style"),this.storage.presetStyleEl.dataset.zwStyles="";var e,n=qp(this.options.presetsRef.value);try{for(n.s();!(e=n.n()).done;){var r,o=e.value,i=Gp(this.options.baseClass,o),s=[" ".concat(i," {")],a=qp(sl.values);try{for(a.s();!(r=a.n()).done;)for(var l=r.value,c=0,u=Object.keys(o[l]);c<u.length;c++){var d=u[c],p=this.options.makeVariable({device:l,preset:o,property:d}),h=d.replace(/_/i,"-"),f=l===sl.COMMON?"preset":"preset-".concat(l);s.push("--zw-".concat(f,"-").concat(h,": var(").concat(p,", inherit);"))}}catch(t){a.e(t)}finally{a.f()}s.push("}"),this.storage.presetStyleEl.innerHTML+=s.join(" ")}}catch(t){n.e(t)}finally{n.f()}document.head.append(this.storage.presetStyleEl)}}}),Jp=rs.create({name:dl.FONT_WEIGHT,addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{applyFontWeight:Rl((function(e,n){var r=e.commands;r.setMark(t.name,{value:n}),r.getFont().value.isItalicSupported(n)||r.removeItalic()})),toggleBold:Rl((function(t){var e=t.commands,n=e.getFontWeight().value,r=e.getFont().value,o=Number(n)>=600?"400":"700",i=r.findClosestWeight(o);e.applyFontWeight(i)})),getFontWeight:Rl((function(e){var n=e.editor,r=e.commands,o=r.getDefaultFontWeight(),i=r.getFont();return(0,ol.computed)((function(){var e,r,s=null!==(e=null===(r=n.getAttributes(t.name))||void 0===r?void 0:r.value)&&void 0!==e?e:o.value;return i.value.isWeightSupported(s)?s:i.value.findClosestWeight(s)}))})),getDefaultFontWeight:Rl((function(t){var e=t.commands.getPreset();return(0,ol.computed)((function(){return e.value.common.font_weight}))}))}},addKeyboardShortcuts:function(){return{"Mod-b":Vl("toggleBold"),"Mod-B":Vl("toggleBold")}},parseHTML:function(){return[{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}},{style:"font-weight",getAttrs:function(t){return{value:t}}}]},renderHTML:function(t){return jl({font_weight:t.HTMLAttributes.value})}}),Zp=rs.create({name:dl.FONT_SIZE,addOptions:function(){return{minSize:1,maxSize:100}},addAttributes:function(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands:function(){var t=this;return{getFontSize:Rl((function(e){var n=e.editor,r=e.commands,o=r.getDevice(),i=r.getDefaultFontSize();return(0,ol.computed)((function(){var e,r;return null!==(e=null===(r=n.getAttributes(t.name))||void 0===r?void 0:r[o.value])&&void 0!==e?e:i.value}))})),getDefaultFontSize:Rl((function(t){var e=t.commands,n=e.getDevice(),r=e.getPreset();return(0,ol.computed)((function(){return r.value[n.value].font_size.replace("px","")}))})),applyFontSize:Rl((function(e,n){var r=e.commands,o=r.getDevice().value;r.setMark(t.name,Cl({},o,n))})),increaseFontSize:Rl((function(e){var n=e.commands,r=Number(n.getFontSize().value),o=Math.min(r+1,t.options.maxSize);n.applyFontSize(String(o))})),decreaseFontSize:Rl((function(e){var n=e.commands,r=Number(n.getFontSize().value),o=Math.max(r-1,t.options.minSize);n.applyFontSize(String(o))}))}},addKeyboardShortcuts:function(){return{"Mod-Shift-=":Vl("increaseFontSize"),"Mod-Shift--":Vl("decreaseFontSize")}},parseHTML:function(){return[{style:"font-size",getAttrs:function(t){var e=String(parseInt(t));return{desktop:e,tablet:e,mobile:e}}}]},renderHTML:function(t){var e=t.HTMLAttributes,n=function(t){return t?"".concat(t,"px"):null};return jl({mobile_font_size:n(e.mobile),tablet_font_size:n(e.tablet),desktop_font_size:n(e.desktop)})}}),Xp=rs.create({name:dl.FONT_COLOR,addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{getFontColor:Rl((function(e){var n=e.commands,r=e.editor,o=n.getDefaultFontColor();return(0,ol.computed)((function(){var e,n;return null!==(e=null===(n=r.getAttributes(t.name))||void 0===n?void 0:n.value)&&void 0!==e?e:o.value}))})),getDefaultFontColor:Rl((function(t){var e=t.commands.getPreset();return(0,ol.computed)((function(){return e.value.common.color}))})),applyFontColor:Rl((function(e,n){e.commands.setMark(t.name,{value:n})}))}},parseHTML:function(){return[{style:"color",getAttrs:function(t){return{value:Hl(t)}}}]},renderHTML:function(t){return jl({font_color:t.HTMLAttributes.value})}}),Yp=rs.create({name:dl.BACKGROUND_COLOR,addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{getBackgroundColor:Rl((function(e){var n=e.editor;return(0,ol.computed)((function(){var e,r;return null!==(e=null===(r=n.getAttributes(t.name))||void 0===r?void 0:r.value)&&void 0!==e?e:"rgba(255, 255, 255, 0%)"}))})),applyBackgroundColor:Rl((function(e,n){e.commands.setMark(t.name,{value:n})}))}},parseHTML:function(){return[{style:"background-color",getAttrs:function(t){return{value:Hl(t)}}}]},renderHTML:function(t){return jl({background_color:t.HTMLAttributes.value})}}),Qp=bi.create({name:"device_manager",addOptions:function(){return{deviceRef:null}},addCommands:function(){var t=this;return{getDevice:Rl((function(){return t.options.deviceRef}))}}}),th=rs.create({name:dl.FONT_STYLE,addAttributes:function(){return{italic:{required:!0}}},addCommands:function(){var t=this;return{isItalic:Rl((function(e){var n=e.editor,r=e.commands.getDefaultFontStyle();return(0,ol.computed)((function(){var e,o;return null!==(e=null===(o=n.getAttributes(t.name))||void 0===o?void 0:o.italic)&&void 0!==e?e:r.value.italic}))})),isItalicAvailable:Rl((function(t){var e=t.commands,n=e.getFont(),r=e.getFontWeight();return(0,ol.computed)((function(){return n.value.isItalicSupported(r.value)}))})),getDefaultFontStyle:Rl((function(t){var e=t.commands.getPreset();return(0,ol.computed)((function(){return{italic:"italic"===e.value.common.font_style}}))})),toggleItalic:Rl((function(e){var n=e.commands;t.editor.commands.isItalicAvailable().value&&(n.isItalic().value?n.removeItalic():n.applyItalic())})),applyItalic:Rl((function(e){e.commands.setMark(t.name,{italic:!0})})),removeItalic:Rl((function(e){e.commands.unsetMark(t.name)}))}},addKeyboardShortcuts:function(){return{"Mod-i":Vl("toggleItalic"),"Mod-I":Vl("toggleItalic")}},parseHTML:function(){return[{tag:"i",attrs:{italic:!0}},{style:"font-style",getAttrs:function(t){return{italic:t.includes("italic")}}}]},renderHTML:function(){return jl({font_style:"italic"})}});function eh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?eh(Object(n),!0).forEach((function(e){Cl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var rh=rs.create({name:dl.TEXT_DECORATION,addAttributes:function(){return{underline:{default:!1},strike_through:{default:!1}}},addCommands:function(){var t=this;return{isUnderline:Rl((function(t){var e=t.commands.getTextDecoration();return(0,ol.computed)((function(){return e.value.underline}))})),isStrikeThrough:Rl((function(t){var e=t.commands.getTextDecoration();return(0,ol.computed)((function(){return e.value.strike_through}))})),getTextDecoration:Rl((function(e){var n=e.editor,r=e.commands.getDefaultTextDecoration();return(0,ol.computed)((function(){var e,o,i,s=null!==(e=n.getAttributes(t.name))&&void 0!==e?e:{};return{underline:null!==(o=s.underline)&&void 0!==o?o:r.value.underline,strike_through:null!==(i=s.strike_through)&&void 0!==i?i:r.value.strike_through}}))})),getDefaultTextDecoration:Rl((function(t){var e=t.commands.getPreset();return(0,ol.computed)((function(){var t=e.value.common.text_decoration;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:Rl((function(t){t.commands.toggleTextDecoration("underline")})),toggleStrikeThrough:Rl((function(t){t.commands.toggleTextDecoration("strike_through")})),toggleTextDecoration:Rl((function(t,e){var n=t.commands;n.getTextDecoration().value[e]?n.removeTextDecoration(e):n.applyTextDecoration(e)})),applyTextDecoration:Rl((function(e,n){e.commands.setMark(t.name,Cl({},n,!0))})),removeTextDecoration:Rl((function(e,n){var r=e.commands,o=nh(nh({},r.getTextDecoration().value),{},Cl({},n,!1));o.underline||o.strike_through?r.setMark(t.name,o):r.unsetMark(t.name)}))}},addKeyboardShortcuts:function(){return{"Mod-u":Vl("toggleUnderline"),"Mod-U":Vl("toggleUnderline")}},parseHTML:function(){return[{style:"text-decoration-line",getAttrs:function(t){return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}}]},renderHTML:function(t){var e=t.HTMLAttributes,n=[];return e.underline&&n.push("underline"),e.strike_through&&n.push("line-through"),jl({text_decoration:n.join(" ")})}}),oh=bi.create({name:"case_style",addCommands:function(){return{applyCaseStyle:Rl((function(t,e){var n=t.commands;switch(e){case al.CAPITALIZE:return n.applyCapitalize();case al.LOWERCASE:return n.applyLowerCase();case al.UPPERCASE:return n.applyUpperCase()}})),applyCapitalize:Rl((function(t){t.commands.transformText((function(t){return t.text.toLowerCase().replace(/(?:^|\s)\S/g,(function(t){return t.toUpperCase()}))}))})),applyLowerCase:Rl((function(t){t.commands.transformText((function(t){return t.text.toLowerCase()}))})),applyUpperCase:Rl((function(t){t.commands.transformText((function(t){return t.text.toUpperCase()}))}))}}}),ih={mobile:null,tablet:null,desktop:null},sh=bi.create({name:dl.ALIGNMENT,addGlobalAttributes:function(){return[{types:[cl.PARAGRAPH,cl.HEADING],attributes:Cl({},dl.ALIGNMENT,{isRequired:!1,parseHTML:function(t){var e=t.style.textAlign;return e?{desktop:e,tablet:e,mobile:e}:null},renderHTML:function(t){return t.alignment?Fl({mobile_text_align:t.alignment.mobile,tablet_text_align:t.alignment.tablet,desktop_text_align:t.alignment.desktop}):null}})}]},addCommands:function(){var t=this;return{applyAlignment:Rl((function(e,n){var r=e.commands,o=r.getDevice().value;r.setBlockAttributes(t.name,Cl({},o,n),ih)})),getAlignment:Rl((function(e){var n=e.commands,r=n.getBlockAttributes(t.name,ih),o=n.getDevice(),i=n.getDefaultAlignment();return(0,ol.computed)((function(){var t,e;return null!==(t=null===(e=r.value)||void 0===e?void 0:e[o.value])&&void 0!==t?t:i.value}))})),getDefaultAlignment:Rl((function(t){var e=t.commands,n=e.getDevice(),r=e.getPreset();return(0,ol.computed)((function(){return r.value[n.value].alignment}))}))}},addKeyboardShortcuts:function(){return{"Mod-Shift-l":Vl("applyAlignment",ll.LEFT),"Mod-Shift-e":Vl("applyAlignment",ll.CENTER),"Mod-Shift-r":Vl("applyAlignment",ll.RIGHT),"Mod-Shift-j":Vl("applyAlignment",ll.JUSTIFY)}}}),ah={mobile:null,tablet:null,desktop:null},lh=bi.create({name:dl.LINE_HEIGHT,addGlobalAttributes:function(){return[{types:[cl.PARAGRAPH,cl.HEADING],attributes:Cl({},dl.LINE_HEIGHT,{isRequired:!1,parseHTML:function(t){var e=t.style.lineHeight;if(!e)return null;if(!e.includes("px"))return{desktop:e,tablet:e,mobile:e};var n=t.firstElementChild.style.fontSize||window.getComputedStyle(document.body).fontSize,r=(parseFloat(e)/parseFloat(n)).toFixed(2);return{desktop:r,tablet:r,mobile:r}},renderHTML:function(t){return t.line_height?Fl({mobile_line_height:t.line_height.mobile,tablet_line_height:t.line_height.tablet,desktop_line_height:t.line_height.desktop}):null}})}]},addCommands:function(){var t=this;return{getLineHeight:Rl((function(e){var n=e.commands,r=n.getBlockAttributes(t.name,ah),o=n.getDevice(),i=n.getDefaultLineHeight();return(0,ol.computed)((function(){var t,e;return null!==(t=null===(e=r.value)||void 0===e?void 0:e[o.value])&&void 0!==t?t:i.value}))})),getDefaultLineHeight:Rl((function(t){var e=t.commands,n=e.getDevice(),r=e.getPreset();return(0,ol.computed)((function(){return r.value[n.value].line_height}))})),applyLineHeight:Rl((function(e,n){var r=e.commands,o=r.getDevice().value;r.setBlockAttributes(t.name,Cl({},o,n),ah)}))}}}),ch=is.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ri(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:cl.LIST_ITEM,addKeyboardShortcuts:function(){return{Enter:this.parent().Enter}}});function uh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var dh=is.create({name:cl.LIST,content:"".concat(cl.LIST_ITEM,"+"),group:"block list",addExtensions:function(){return[ch]},addOptions:function(){return{baseClass:""}},addAttributes:function(){return{bullet:{isRequired:!0}}},parseHTML:function(){var t=this,e={a:ul.ROMAN,i:ul.LATIN,1:ul.DECIMAL},n=function(n){var r,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return uh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(ul.values);try{for(o.s();!(r=o.n()).done;){var i=r.value,s=".".concat(t.options.baseClass).concat(i);if(n.matches(s))return i;if(e[n.type.toLowerCase()]===i)return i}}catch(t){o.e(t)}finally{o.f()}};return[{tag:"ol",getAttrs:function(t){return{bullet:{type:n(t)||ul.DECIMAL}}}},{tag:"ul",getAttrs:function(t){return{bullet:{type:n(t)||ul.DISC}}}}]},renderHTML:function(t){var e=t.HTMLAttributes;return[ul.ordered.includes(e.bullet.type)?"ol":"ul",{class:this.options.baseClass+e.bullet.type},0]},addCommands:function(){return{getListType:Rl((function(t){var e=t.commands.getBlockAttributes("bullet",{type:null});return(0,ol.computed)((function(){var t;return null!==(t=e.value.type)&&void 0!==t?t:null}))})),applyList:Rl((function(t,e){var n=t.commands,r=t.chain;if(n.getListType().value!==e)return r().removeList()._addList(e).run();n.applyDefaultPreset()})),_addList:Rl((function(t,e){return(0,t.chain)().removePreset().toggleList(cl.LIST,cl.LIST_ITEM).setBlockAttributes("bullet",{type:e}).run()})),removeList:Rl((function(t){t.commands.liftListItem(cl.LIST_ITEM)}))}},addInputRules:function(){var t=this,e=function(e,n){return r={find:n,type:t.type,getAttributes:{bullet:{type:e}},joinPredicate:function(t,n){return n.attrs.bullet.type===e}},new pi({find:r.find,handler:({state:t,range:e,match:n})=>{const o=si(r.getAttributes,void 0,n)||{},i=t.tr.delete(e.from,e.to),s=i.doc.resolve(e.from).blockRange(),a=s&&Ct(s,r.type,o);if(!a)return null;i.wrap(s,a);const l=i.doc.resolve(e.from-1).nodeBefore;l&&l.type===r.type&&At(i.doc,e.from-1)&&(!r.joinPredicate||r.joinPredicate(n,l))&&i.join(e.from-1)}});var r};return[e(ul.DISC,/^\s*([-+*])\s$/),e(ul.DECIMAL,/^(\d+)\.\s$/),e(ul.LATIN,/^([ivx]{1,3})\.\s$/i),e(ul.ROMAN,/^([a-z])\.\s$/i)]}});const ph=rs.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML({HTMLAttributes:t}){return["sup",ri(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var hh=ph.extend({addKeyboardShortcuts:null});function fh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var mh=function(){function t(e){var n=e.name,r=e.category,o=e.styles;Gd(this,t),this.name=n,this.category=r,this.styles=o}return Jd(t,[{key:"weights",get:function(){return this.styles.filter((function(t){return!t.endsWith("i")}))}},{key:"isWeightSupported",value:function(t){return this.styles.includes(t)}},{key:"isItalicSupported",value:function(t){return this.styles.includes("".concat(t,"i"))}},{key:"findClosestWeight",value:function(t){var e,n,r=this.weights.map((function(t){return parseInt(t)})),o=null,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return fh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(r);try{for(i.s();!(n=i.n()).done;){var s=n.value,a=Math.abs(t-s);(null===o||a<o)&&(o=a,e=s)}}catch(t){i.e(t)}finally{i.f()}return String(e)}}]),t}();const vh={name:"Wysiwyg",components:{Toolbar:Ud,EditorContent:rl},directives:{outClick:bu},props:{value:{type:[String,Object],required:!0},presets:{type:Array,required:!0},defaultPresetId:{type:[Number,String],required:!0},basePresetClass:{type:String,required:!0},makePresetVariable:{type:Function,required:!0},fonts:{type:Array,required:!0},device:{type:String,required:!1,default:sl.DESKTOP},favoriteColors:{type:Array,required:!1,default:function(){return[]}},toolbarOffsets:{type:Array,required:!1,default:function(){return[0,8]}},baseListClass:{type:String,required:!1,default:"zw-list--"}},setup:function(t,e){var n,r=e.emit,o=t.fonts.map((function(t){return new mh(t)})),i=(0,ol.ref)(null),s=(0,ol.ref)(null),a=function(t){var e,n=t.wrapperRef,r=t.popperRef,o=t.offsets,i=(0,ol.ref)(!1);return(0,ol.onMounted)((function(){var t=Zc(n).value,i=Zc(r).value;e=ha(t,i,{placement:"top-start",modifiers:[{name:"offset",options:{offset:o}}]})})),(0,ol.onUnmounted)((function(){e.destroy()})),{toolbar:e,show:function(){i.value=!0,this.update()},hide:function(){i.value=!1},update:function(){e.update()},isShow:i}}({wrapperRef:s,popperRef:i,offsets:(0,ol.toRef)(t,"toolbarOffsets").value}),l=function(t){var e=t.content,n=t.onChange,r=t.onFocus,o=t.extensions,i=new ep,s=(0,ol.reactive)(new nl({content:i.normalize(e.value),onUpdate:function(){return n(s.getJSON())},onFocus:function(){return r()},extensions:o}));return(0,ol.onUnmounted)((function(){return s.destroy()})),(0,ol.watch)(e,(function(t){if(JSON.stringify(s.getJSON())!==JSON.stringify(t)){var e=i.normalize(t);s.commands.setContent(e,!1)}})),s}({content:(0,ol.toRef)(t,"value"),onChange:function(t){return function(t){r("input",t),a.update()}(t)},onFocus:function(){return a.show()},extensions:(n={fonts:o,minFontSize:5,maxFontSize:112,presetsRef:(0,ol.toRef)(t,"presets"),defaultPresetId:t.defaultPresetId,makePresetVariable:t.makePresetVariable,basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:(0,ol.toRef)(t,"device")},$p.concat([Sp,Kp.configure({presetsRef:n.presetsRef,defaultId:n.defaultPresetId,baseClass:n.basePresetClass,makeVariable:n.makePresetVariable}),dh.configure({baseClass:n.baseListClass}),Qp.configure({deviceRef:n.deviceRef}),Hp.configure({fonts:n.fonts}),Jp,Zp.configure({minSize:n.minFontSize,maxSize:n.maxFontSize}),Xp,Yp,th,rh,oh,hh,sh,lh]))}),c=new Array(108).fill(0).map((function(t,e){return String(e+5)})),u=new Yd({listRef:(0,ol.toRef)(t,"favoriteColors"),triggerUpdate:function(t){return r("updateFavoriteColors",t)}});return(0,ol.provide)(kl.EDITOR,l),(0,ol.provide)(kl.FONTS,o),(0,ol.provide)(kl.FONT_SIZES,c),(0,ol.provide)(kl.LOCAL_STORAGE,new Xd(localStorage)),(0,ol.provide)(kl.FAVORITE_COLORS,u),{editor:l,toolbarRef:i,wysiwygRef:s,toolbar:a,hideToolbar:function(){l.isFocused||a.hide()}}}};var gh=fl(vh,t,[],!1,null,null,null);gh.options.__file="lib/Wysiwyg.vue";const yh=gh.exports})(),module.exports=r})();
|
|
2
|
+
import*as t from"@vue/composition-api";import*as e from"zipify-colorpicker";var n={3700:(t,e,n)=>{var r={"./alignment-center.svg":8274,"./alignment-justify.svg":8768,"./alignment-left.svg":2449,"./alignment-right.svg":2515,"./arrow.svg":548,"./background-color.svg":1881,"./case-style.svg":9464,"./font-color.svg":9747,"./italic.svg":9441,"./line-height.svg":4140,"./list-circle.svg":1304,"./list-decimal.svg":2412,"./list-disc.svg":4311,"./list-latin.svg":1477,"./list-roman.svg":5400,"./list-square.svg":2807,"./remove-format.svg":6495,"./reset-styles.svg":7522,"./strike-through.svg":9976,"./superscript.svg":9857,"./underline.svg":6031};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=3700},1807:t=>{var e=!("undefined"==typeof window||!window.document||!window.document.createElement);t.exports=e},9662:(t,e,n)=>{var r=n(614),o=n(6330),i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not a function")}},6077:(t,e,n)=>{var r=n(614),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},1223:(t,e,n)=>{var r=n(5112),o=n(30),i=n(3070).f,s=r("unscopables"),a=Array.prototype;null==a[s]&&i(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},1530:(t,e,n)=>{var r=n(8710).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},5787:(t,e,n)=>{var r=n(7976),o=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw o("Incorrect invocation")}},9670:(t,e,n)=>{var r=n(111),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw i(o(t)+" is not an object")}},7556:(t,e,n)=>{var r=n(7293);t.exports=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},8533:(t,e,n)=>{var r=n(2092).forEach,o=n(9341)("forEach");t.exports=o?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},1318:(t,e,n)=>{var r=n(5656),o=n(1400),i=n(6244),s=function(t){return function(e,n,s){var a,l=r(e),c=i(l),u=o(s,c);if(t&&n!=n){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},2092:(t,e,n)=>{var r=n(9974),o=n(1702),i=n(8361),s=n(7908),a=n(6244),l=n(5417),c=o([].push),u=function(t){var e=1==t,n=2==t,o=3==t,u=4==t,d=6==t,p=7==t,h=5==t||d;return function(f,m,v,g){for(var y,b,w=s(f),x=i(w),S=r(m,v),O=a(x),k=0,E=g||l,C=e?E(f,O):n||p?E(f,0):void 0;O>k;k++)if((h||k in x)&&(b=S(y=x[k],k,w),t))if(e)C[k]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return k;case 2:c(C,y)}else switch(t){case 4:return!1;case 7:c(C,y)}return d?-1:o||u?u:C}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},1194:(t,e,n)=>{var r=n(7293),o=n(5112),i=n(7392),s=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:(t,e,n)=>{var r=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},3671:(t,e,n)=>{var r=n(9662),o=n(7908),i=n(8361),s=n(6244),a=TypeError,l=function(t){return function(e,n,l,c){r(n);var u=o(e),d=i(u),p=s(u),h=t?p-1:0,f=t?-1:1;if(l<2)for(;;){if(h in d){c=d[h],h+=f;break}if(h+=f,t?h<0:p<=h)throw a("Reduce of empty array with no initial value")}for(;t?h>=0:p>h;h+=f)h in d&&(c=n(c,d[h],h,u));return c}};t.exports={left:l(!1),right:l(!0)}},1589:(t,e,n)=>{var r=n(1400),o=n(6244),i=n(6135),s=Array,a=Math.max;t.exports=function(t,e,n){for(var l=o(t),c=r(e,l),u=r(void 0===n?l:n,l),d=s(a(u-c,0)),p=0;c<u;c++,p++)i(d,p,t[c]);return d.length=p,d}},7475:(t,e,n)=>{var r=n(3157),o=n(4411),i=n(111),s=n(5112)("species"),a=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,(o(e)&&(e===a||r(e.prototype))||i(e)&&null===(e=e[s]))&&(e=void 0)),void 0===e?a:e}},5417:(t,e,n)=>{var r=n(7475);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},7072:(t,e,n)=>{var r=n(5112)("iterator"),o=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){o=!0}};s[r]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},4326:(t,e,n)=>{var r=n(1702),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,n)=>{var r=n(1694),o=n(614),i=n(4326),s=n(5112)("toStringTag"),a=Object,l="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=a(t),s))?n:l?i(e):"Object"==(r=i(e))&&o(e.callee)?"Arguments":r}},9320:(t,e,n)=>{var r=n(1702),o=n(9190),i=n(2423).getWeakData,s=n(9670),a=n(111),l=n(5787),c=n(408),u=n(2092),d=n(2597),p=n(9909),h=p.set,f=p.getterFor,m=u.find,v=u.findIndex,g=r([].splice),y=0,b=function(t){return t.frozen||(t.frozen=new w)},w=function(){this.entries=[]},x=function(t,e){return m(t.entries,(function(t){return t[0]===e}))};w.prototype={get:function(t){var e=x(this,t);if(e)return e[1]},has:function(t){return!!x(this,t)},set:function(t,e){var n=x(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=v(this.entries,(function(e){return e[0]===t}));return~e&&g(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var u=t((function(t,o){l(t,p),h(t,{type:e,id:y++,frozen:void 0}),null!=o&&c(o,t[r],{that:t,AS_ENTRIES:n})})),p=u.prototype,m=f(e),v=function(t,e,n){var r=m(t),o=i(s(e),!0);return!0===o?b(r).set(e,n):o[r.id]=n,t};return o(p,{delete:function(t){var e=m(this);if(!a(t))return!1;var n=i(t);return!0===n?b(e).delete(t):n&&d(n,e.id)&&delete n[e.id]},has:function(t){var e=m(this);if(!a(t))return!1;var n=i(t);return!0===n?b(e).has(t):n&&d(n,e.id)}}),o(p,n?{get:function(t){var e=m(this);if(a(t)){var n=i(t);return!0===n?b(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return v(this,t,e)}}:{add:function(t){return v(this,t,!0)}}),u}}},7710:(t,e,n)=>{var r=n(2109),o=n(7854),i=n(1702),s=n(4705),a=n(8052),l=n(2423),c=n(408),u=n(5787),d=n(614),p=n(111),h=n(7293),f=n(7072),m=n(8003),v=n(9587);t.exports=function(t,e,n){var g=-1!==t.indexOf("Map"),y=-1!==t.indexOf("Weak"),b=g?"set":"add",w=o[t],x=w&&w.prototype,S=w,O={},k=function(t){var e=i(x[t]);a(x,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return y&&!p(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!p(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(s(t,!d(w)||!(y||x.forEach&&!h((function(){(new w).entries().next()})))))S=n.getConstructor(e,t,g,b),l.enable();else if(s(t,!0)){var E=new S,C=E[b](y?{}:-0,1)!=E,M=h((function(){E.has(1)})),T=f((function(t){new w(t)})),A=!y&&h((function(){for(var t=new w,e=5;e--;)t[b](e,e);return!t.has(-0)}));T||((S=e((function(t,e){u(t,x);var n=v(new w,t,S);return null!=e&&c(e,n[b],{that:n,AS_ENTRIES:g}),n}))).prototype=x,x.constructor=S),(M||A)&&(k("delete"),k("has"),g&&k("get")),(A||C)&&k(b),y&&x.clear&&delete x.clear}return O[t]=S,r({global:!0,constructor:!0,forced:S!=w},O),m(S,t),y||n.setStrong(S,t,g),S}},9920:(t,e,n)=>{var r=n(2597),o=n(3887),i=n(1236),s=n(3070);t.exports=function(t,e,n){for(var a=o(e),l=s.f,c=i.f,u=0;u<a.length;u++){var d=a[u];r(t,d)||n&&r(n,d)||l(t,d,c(e,d))}}},8544:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4994:(t,e,n)=>{var r=n(3383).IteratorPrototype,o=n(30),i=n(9114),s=n(8003),a=n(7497),l=function(){return this};t.exports=function(t,e,n,c){var u=e+" Iterator";return t.prototype=o(r,{next:i(+!c,n)}),s(t,u,!1,!0),a[u]=l,t}},8880:(t,e,n)=>{var r=n(9781),o=n(3070),i=n(9114);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:(t,e,n)=>{var r=n(4948),o=n(3070),i=n(9114);t.exports=function(t,e,n){var s=r(e);s in t?o.f(t,s,i(0,n)):t[s]=n}},8052:(t,e,n)=>{var r=n(614),o=n(3070),i=n(6339),s=n(3072);t.exports=function(t,e,n,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&i(n,c,a),a.global)l?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},9190:(t,e,n)=>{var r=n(8052);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},3072:(t,e,n)=>{var r=n(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},654:(t,e,n)=>{var r=n(2109),o=n(6916),i=n(1913),s=n(6530),a=n(614),l=n(4994),c=n(9518),u=n(7674),d=n(8003),p=n(8880),h=n(8052),f=n(5112),m=n(7497),v=n(3383),g=s.PROPER,y=s.CONFIGURABLE,b=v.IteratorPrototype,w=v.BUGGY_SAFARI_ITERATORS,x=f("iterator"),S="keys",O="values",k="entries",E=function(){return this};t.exports=function(t,e,n,s,f,v,C){l(n,e,s);var M,T,A,N=function(t){if(t===f&&z)return z;if(!w&&t in R)return R[t];switch(t){case S:case O:case k:return function(){return new n(this,t)}}return function(){return new n(this)}},D=e+" Iterator",_=!1,R=t.prototype,I=R[x]||R["@@iterator"]||f&&R[f],z=!w&&I||N(f),L="Array"==e&&R.entries||I;if(L&&(M=c(L.call(new t)))!==Object.prototype&&M.next&&(i||c(M)===b||(u?u(M,b):a(M[x])||h(M,x,E)),d(M,D,!0,!0),i&&(m[D]=E)),g&&f==O&&I&&I.name!==O&&(!i&&y?p(R,"name",O):(_=!0,z=function(){return o(I,this)})),f)if(T={values:N(O),keys:v?z:N(S),entries:N(k)},C)for(A in T)(w||_||!(A in R))&&h(R,A,T[A]);else r({target:e,proto:!0,forced:w||_},T);return i&&!C||R[x]===z||h(R,x,z,{name:f}),m[e]=z,T}},9781:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,n)=>{var r=n(7854),o=n(111),i=r.document,s=o(i)&&o(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},8324:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(t,e,n)=>{var r=n(317)("span").classList,o=r&&r.constructor&&r.constructor.prototype;t.exports=o===Object.prototype?void 0:o},5268:(t,e,n)=>{var r=n(4326),o=n(7854);t.exports="process"==r(o.process)},8113:(t,e,n)=>{var r=n(5005);t.exports=r("navigator","userAgent")||""},7392:(t,e,n)=>{var r,o,i=n(7854),s=n(8113),a=i.process,l=i.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,n)=>{var r=n(7854),o=n(1236).f,i=n(8880),s=n(8052),a=n(3072),l=n(9920),c=n(4705);t.exports=function(t,e){var n,u,d,p,h,f=t.target,m=t.global,v=t.stat;if(n=m?r:v?r[f]||a(f,{}):(r[f]||{}).prototype)for(u in e){if(p=e[u],d=t.dontCallGetSet?(h=o(n,u))&&h.value:n[u],!c(m?u:f+(v?".":"#")+u,t.forced)&&void 0!==d){if(typeof p==typeof d)continue;l(p,d)}(t.sham||d&&d.sham)&&i(p,"sham",!0),s(n,u,p,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:(t,e,n)=>{n(4916);var r=n(1702),o=n(8052),i=n(2261),s=n(7293),a=n(5112),l=n(8880),c=a("species"),u=RegExp.prototype;t.exports=function(t,e,n,d){var p=a(t),h=!s((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),f=h&&!s((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!h||!f||n){var m=r(/./[p]),v=e(p,""[t],(function(t,e,n,o,s){var a=r(t),l=e.exec;return l===i||l===u.exec?h&&!s?{done:!0,value:m(e,n,o)}:{done:!0,value:a(n,e,o)}:{done:!1}}));o(String.prototype,t,v[0]),o(u,p,v[1])}d&&l(u[p],"sham",!0)}},6677:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2104:(t,e,n)=>{var r=n(4374),o=Function.prototype,i=o.apply,s=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(i):function(){return s.apply(i,arguments)})},9974:(t,e,n)=>{var r=n(1702),o=n(9662),i=n(4374),s=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?s(t,e):function(){return t.apply(e,arguments)}}},4374:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,e,n)=>{var r=n(4374),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,e,n)=>{var r=n(9781),o=n(2597),i=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),l=a&&"something"===function(){}.name,c=a&&(!r||r&&s(i,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},1702:(t,e,n)=>{var r=n(4374),o=Function.prototype,i=o.bind,s=o.call,a=r&&i.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},5005:(t,e,n)=>{var r=n(7854),o=n(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},1246:(t,e,n)=>{var r=n(648),o=n(8173),i=n(7497),s=n(5112)("iterator");t.exports=function(t){if(null!=t)return o(t,s)||o(t,"@@iterator")||i[r(t)]}},8554:(t,e,n)=>{var r=n(6916),o=n(9662),i=n(9670),s=n(6330),a=n(1246),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?a(t):e;if(o(n))return i(r(n,t));throw l(s(t)+" is not iterable")}},8173:(t,e,n)=>{var r=n(9662);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},647:(t,e,n)=>{var r=n(1702),o=n(7908),i=Math.floor,s=r("".charAt),a=r("".replace),l=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,d,p){var h=n+t.length,f=r.length,m=u;return void 0!==d&&(d=o(d),m=c),a(p,m,(function(o,a){var c;switch(s(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,n);case"'":return l(e,h);case"<":c=d[l(a,1,-1)];break;default:var u=+a;if(0===u)return o;if(u>f){var p=i(u/10);return 0===p?o:p<=f?void 0===r[p-1]?s(a,1):r[p-1]+s(a,1):o}c=r[u-1]}return void 0===c?"":c}))}},7854:(t,e,n)=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:(t,e,n)=>{var r=n(1702),o=n(7908),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},490:(t,e,n)=>{var r=n(5005);t.exports=r("document","documentElement")},4664:(t,e,n)=>{var r=n(9781),o=n(7293),i=n(317);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,n)=>{var r=n(1702),o=n(7293),i=n(4326),s=Object,a=r("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?a(t,""):s(t)}:s},9587:(t,e,n)=>{var r=n(614),o=n(111),i=n(7674);t.exports=function(t,e,n){var s,a;return i&&r(s=e.constructor)&&s!==n&&o(a=s.prototype)&&a!==n.prototype&&i(t,a),t}},2788:(t,e,n)=>{var r=n(1702),o=n(614),i=n(5465),s=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},2423:(t,e,n)=>{var r=n(2109),o=n(1702),i=n(3501),s=n(111),a=n(2597),l=n(3070).f,c=n(8006),u=n(1156),d=n(2050),p=n(9711),h=n(6677),f=!1,m=p("meta"),v=0,g=function(t){l(t,m,{value:{objectID:"O"+v++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},f=!0;var t=c.f,e=o([].splice),n={};n[m]=1,t(n).length&&(c.f=function(n){for(var r=t(n),o=0,i=r.length;o<i;o++)if(r[o]===m){e(r,o,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(t,e){if(!s(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,m)){if(!d(t))return"F";if(!e)return"E";g(t)}return t[m].objectID},getWeakData:function(t,e){if(!a(t,m)){if(!d(t))return!0;if(!e)return!1;g(t)}return t[m].weakData},onFreeze:function(t){return h&&f&&d(t)&&!a(t,m)&&g(t),t}};i[m]=!0},9909:(t,e,n)=>{var r,o,i,s=n(8536),a=n(7854),l=n(1702),c=n(111),u=n(8880),d=n(2597),p=n(5465),h=n(6200),f=n(3501),m="Object already initialized",v=a.TypeError,g=a.WeakMap;if(s||p.state){var y=p.state||(p.state=new g),b=l(y.get),w=l(y.has),x=l(y.set);r=function(t,e){if(w(y,t))throw new v(m);return e.facade=t,x(y,t,e),e},o=function(t){return b(y,t)||{}},i=function(t){return w(y,t)}}else{var S=h("state");f[S]=!0,r=function(t,e){if(d(t,S))throw new v(m);return e.facade=t,u(t,S,e),e},o=function(t){return d(t,S)?t[S]:{}},i=function(t){return d(t,S)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},7659:(t,e,n)=>{var r=n(5112),o=n(7497),i=r("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||s[i]===t)}},3157:(t,e,n)=>{var r=n(4326);t.exports=Array.isArray||function(t){return"Array"==r(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,e,n)=>{var r=n(1702),o=n(7293),i=n(614),s=n(648),a=n(5005),l=n(2788),c=function(){},u=[],d=a("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=r(p.exec),f=!p.exec(c),m=function(t){if(!i(t))return!1;try{return d(c,u,t),!0}catch(t){return!1}},v=function(t){if(!i(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!h(p,l(t))}catch(t){return!0}};v.sham=!0,t.exports=!d||o((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?v:m},4705:(t,e,n)=>{var r=n(7293),o=n(614),i=/#|\.prototype\./,s=function(t,e){var n=l[a(t)];return n==u||n!=c&&(o(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";t.exports=s},111:(t,e,n)=>{var r=n(614);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},1913:t=>{t.exports=!1},2190:(t,e,n)=>{var r=n(5005),o=n(614),i=n(7976),s=n(3307),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},408:(t,e,n)=>{var r=n(9974),o=n(6916),i=n(9670),s=n(6330),a=n(7659),l=n(6244),c=n(7976),u=n(8554),d=n(1246),p=n(9212),h=TypeError,f=function(t,e){this.stopped=t,this.result=e},m=f.prototype;t.exports=function(t,e,n){var v,g,y,b,w,x,S,O=n&&n.that,k=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_ITERATOR),C=!(!n||!n.INTERRUPTED),M=r(e,O),T=function(t){return v&&p(v,"normal",t),new f(!0,t)},A=function(t){return k?(i(t),C?M(t[0],t[1],T):M(t[0],t[1])):C?M(t,T):M(t)};if(E)v=t;else{if(!(g=d(t)))throw h(s(t)+" is not iterable");if(a(g)){for(y=0,b=l(t);b>y;y++)if((w=A(t[y]))&&c(m,w))return w;return new f(!1)}v=u(t,g)}for(x=v.next;!(S=o(x,v)).done;){try{w=A(S.value)}catch(t){p(v,"throw",t)}if("object"==typeof w&&w&&c(m,w))return w}return new f(!1)}},9212:(t,e,n)=>{var r=n(6916),o=n(9670),i=n(8173);t.exports=function(t,e,n){var s,a;o(t);try{if(!(s=i(t,"return"))){if("throw"===e)throw n;return n}s=r(s,t)}catch(t){a=!0,s=t}if("throw"===e)throw n;if(a)throw s;return o(s),n}},3383:(t,e,n)=>{var r,o,i,s=n(7293),a=n(614),l=n(30),c=n(9518),u=n(8052),d=n(5112),p=n(1913),h=d("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):f=!0),null==r||s((function(){var t={};return r[h].call(t)!==t}))?r={}:p&&(r=l(r)),a(r[h])||u(r,h,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},7497:t=>{t.exports={}},6244:(t,e,n)=>{var r=n(7466);t.exports=function(t){return r(t.length)}},6339:(t,e,n)=>{var r=n(7293),o=n(614),i=n(2597),s=n(9781),a=n(6530).CONFIGURABLE,l=n(2788),c=n(9909),u=c.enforce,d=c.get,p=Object.defineProperty,h=s&&!r((function(){return 8!==p((function(){}),"length",{value:8}).length})),f=String(String).split("String"),m=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||a&&t.name!==e)&&(s?p(t,"name",{value:e,configurable:!0}):t.name=e),h&&n&&i(n,"arity")&&t.length!==n.arity&&p(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=u(t);return i(r,"source")||(r.source=f.join("string"==typeof e?e:"")),t};Function.prototype.toString=m((function(){return o(this)&&d(this).source||l(this)}),"toString")},4758:t=>{var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},133:(t,e,n)=>{var r=n(7392),o=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:(t,e,n)=>{var r=n(7854),o=n(614),i=n(2788),s=r.WeakMap;t.exports=o(s)&&/native code/.test(i(s))},3009:(t,e,n)=>{var r=n(7854),o=n(7293),i=n(1702),s=n(1340),a=n(3111).trim,l=n(1361),c=r.parseInt,u=r.Symbol,d=u&&u.iterator,p=/^[+-]?0x/i,h=i(p.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||d&&!o((function(){c(Object(d))}));t.exports=f?function(t,e){var n=a(s(t));return c(n,e>>>0||(h(p,n)?16:10))}:c},1574:(t,e,n)=>{var r=n(9781),o=n(1702),i=n(6916),s=n(7293),a=n(1956),l=n(5181),c=n(5296),u=n(7908),d=n(8361),p=Object.assign,h=Object.defineProperty,f=o([].concat);t.exports=!p||s((function(){if(r&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=p({},t)[n]||a(p({},e)).join("")!=o}))?function(t,e){for(var n=u(t),o=arguments.length,s=1,p=l.f,h=c.f;o>s;)for(var m,v=d(arguments[s++]),g=p?f(a(v),p(v)):a(v),y=g.length,b=0;y>b;)m=g[b++],r&&!i(h,v,m)||(n[m]=v[m]);return n}:p},30:(t,e,n)=>{var r,o=n(9670),i=n(6048),s=n(748),a=n(3501),l=n(490),c=n(317),u=n(6200)("IE_PROTO"),d=function(){},p=function(t){return"<script>"+t+"<\/script>"},h=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},f=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}var t,e;f="undefined"!=typeof document?document.domain&&r?h(r):((e=c("iframe")).style.display="none",l.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):h(r);for(var n=s.length;n--;)delete f.prototype[s[n]];return f()};a[u]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(d.prototype=o(t),n=new d,d.prototype=null,n[u]=t):n=f(),void 0===e?n:i.f(n,e)}},6048:(t,e,n)=>{var r=n(9781),o=n(3353),i=n(3070),s=n(9670),a=n(5656),l=n(1956);e.f=r&&!o?Object.defineProperties:function(t,e){s(t);for(var n,r=a(e),o=l(e),c=o.length,u=0;c>u;)i.f(t,n=o[u++],r[n]);return t}},3070:(t,e,n)=>{var r=n(9781),o=n(4664),i=n(3353),s=n(9670),a=n(4948),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor;e.f=r?i?function(t,e,n){if(s(t),e=a(e),s(n),"function"==typeof t&&"prototype"===e&&"value"in n&&"writable"in n&&!n.writable){var r=u(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(s(t),e=a(e),s(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw l("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:(t,e,n)=>{var r=n(9781),o=n(6916),i=n(5296),s=n(9114),a=n(5656),l=n(4948),c=n(2597),u=n(4664),d=Object.getOwnPropertyDescriptor;e.f=r?d:function(t,e){if(t=a(t),e=l(e),u)try{return d(t,e)}catch(t){}if(c(t,e))return s(!o(i.f,t,e),t[e])}},1156:(t,e,n)=>{var r=n(4326),o=n(5656),i=n(8006).f,s=n(1589),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"==r(t)?function(t){try{return i(t)}catch(t){return s(a)}}(t):i(o(t))}},8006:(t,e,n)=>{var r=n(6324),o=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},9518:(t,e,n)=>{var r=n(2597),o=n(614),i=n(7908),s=n(6200),a=n(8544),l=s("IE_PROTO"),c=Object,u=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=i(t);if(r(e,l))return e[l];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof c?u:null}},2050:(t,e,n)=>{var r=n(7293),o=n(111),i=n(4326),s=n(7556),a=Object.isExtensible,l=r((function(){a(1)}));t.exports=l||s?function(t){return!!o(t)&&(!s||"ArrayBuffer"!=i(t))&&(!a||a(t))}:a},7976:(t,e,n)=>{var r=n(1702);t.exports=r({}.isPrototypeOf)},6324:(t,e,n)=>{var r=n(1702),o=n(2597),i=n(5656),s=n(1318).indexOf,a=n(3501),l=r([].push);t.exports=function(t,e){var n,r=i(t),c=0,u=[];for(n in r)!o(a,n)&&o(r,n)&&l(u,n);for(;e.length>c;)o(r,n=e[c++])&&(~s(u,n)||l(u,n));return u}},1956:(t,e,n)=>{var r=n(6324),o=n(748);t.exports=Object.keys||function(t){return r(t,o)}},5296:(t,e)=>{var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},7674:(t,e,n)=>{var r=n(1702),o=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},288:(t,e,n)=>{var r=n(1694),o=n(648);t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,e,n)=>{var r=n(6916),o=n(614),i=n(111),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},3887:(t,e,n)=>{var r=n(5005),o=n(1702),i=n(8006),s=n(5181),a=n(9670),l=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=s.f;return n?l(e,n(t)):e}},7651:(t,e,n)=>{var r=n(6916),o=n(9670),i=n(614),s=n(4326),a=n(2261),l=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var c=r(n,t,e);return null!==c&&o(c),c}if("RegExp"===s(t))return r(a,t,e);throw l("RegExp#exec called on incompatible receiver")}},2261:(t,e,n)=>{var r,o,i=n(6916),s=n(1702),a=n(1340),l=n(7066),c=n(2999),u=n(2309),d=n(30),p=n(9909).get,h=n(3350),f=n(7168),m=u("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,g=v,y=s("".charAt),b=s("".indexOf),w=s("".replace),x=s("".slice),S=(o=/b*/g,i(v,r=/a/,"a"),i(v,o,"a"),0!==r.lastIndex||0!==o.lastIndex),O=c.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(S||k||O||h||f)&&(g=function(t){var e,n,r,o,s,c,u,h=this,f=p(h),E=a(t),C=f.raw;if(C)return C.lastIndex=h.lastIndex,e=i(g,C,E),h.lastIndex=C.lastIndex,e;var M=f.groups,T=O&&h.sticky,A=i(l,h),N=h.source,D=0,_=E;if(T&&(A=w(A,"y",""),-1===b(A,"g")&&(A+="g"),_=x(E,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==y(E,h.lastIndex-1))&&(N="(?: "+N+")",_=" "+_,D++),n=new RegExp("^(?:"+N+")",A)),k&&(n=new RegExp("^"+N+"$(?!\\s)",A)),S&&(r=h.lastIndex),o=i(v,T?n:h,_),T?o?(o.input=x(o.input,D),o[0]=x(o[0],D),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:S&&o&&(h.lastIndex=h.global?o.index+o[0].length:r),k&&o&&o.length>1&&i(m,o[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(o[s]=void 0)})),o&&M)for(o.groups=c=d(null),s=0;s<M.length;s++)c[(u=M[s])[0]]=o[u[1]];return o}),t.exports=g},7066:(t,e,n)=>{var r=n(9670);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},2999:(t,e,n)=>{var r=n(7293),o=n(7854).RegExp,i=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),s=i||r((function(){return!o("a","y").sticky})),a=i||r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:s,UNSUPPORTED_Y:i}},3350:(t,e,n)=>{var r=n(7293),o=n(7854).RegExp;t.exports=r((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},7168:(t,e,n)=>{var r=n(7293),o=n(7854).RegExp;t.exports=r((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4488:t=>{var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},8003:(t,e,n)=>{var r=n(3070).f,o=n(2597),i=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,i)&&r(t,i,{configurable:!0,value:e})}},6200:(t,e,n)=>{var r=n(2309),o=n(9711),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,n)=>{var r=n(7854),o=n(3072),i="__core-js_shared__",s=r[i]||o(i,{});t.exports=s},2309:(t,e,n)=>{var r=n(1913),o=n(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.3",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE",source:"https://github.com/zloirock/core-js"})},8710:(t,e,n)=>{var r=n(1702),o=n(9303),i=n(1340),s=n(4488),a=r("".charAt),l=r("".charCodeAt),c=r("".slice),u=function(t){return function(e,n){var r,u,d=i(s(e)),p=o(n),h=d.length;return p<0||p>=h?t?"":void 0:(r=l(d,p))<55296||r>56319||p+1===h||(u=l(d,p+1))<56320||u>57343?t?a(d,p):r:t?c(d,p,p+2):u-56320+(r-55296<<10)+65536}};t.exports={codeAt:u(!1),charAt:u(!0)}},3111:(t,e,n)=>{var r=n(1702),o=n(4488),i=n(1340),s=n(1361),a=r("".replace),l="["+s+"]",c=RegExp("^"+l+l+"*"),u=RegExp(l+l+"*$"),d=function(t){return function(e){var n=i(o(e));return 1&t&&(n=a(n,c,"")),2&t&&(n=a(n,u,"")),n}};t.exports={start:d(1),end:d(2),trim:d(3)}},1400:(t,e,n)=>{var r=n(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},5656:(t,e,n)=>{var r=n(8361),o=n(4488);t.exports=function(t){return r(o(t))}},9303:(t,e,n)=>{var r=n(4758);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},7466:(t,e,n)=>{var r=n(9303),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},7908:(t,e,n)=>{var r=n(4488),o=Object;t.exports=function(t){return o(r(t))}},7593:(t,e,n)=>{var r=n(6916),o=n(111),i=n(2190),s=n(8173),a=n(2140),l=n(5112),c=TypeError,u=l("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,l=s(t,u);if(l){if(void 0===e&&(e="default"),n=r(l,t,e),!o(n)||i(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},4948:(t,e,n)=>{var r=n(7593),o=n(2190);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},1694:(t,e,n)=>{var r={};r[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(r)},1340:(t,e,n)=>{var r=n(648),o=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:(t,e,n)=>{var r=n(1702),o=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+i,36)}},3307:(t,e,n)=>{var r=n(133);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,e,n)=>{var r=n(9781),o=n(7293);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:(t,e,n)=>{var r=n(7854),o=n(2309),i=n(2597),s=n(9711),a=n(133),l=n(3307),c=o("wks"),u=r.Symbol,d=u&&u.for,p=l?u:u&&u.withoutSetter||s;t.exports=function(t){if(!i(c,t)||!a&&"string"!=typeof c[t]){var e="Symbol."+t;a&&i(u,t)?c[t]=u[t]:c[t]=l&&d?d(e):p(e)}return c[t]}},1361:t=>{t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},7327:(t,e,n)=>{var r=n(2109),o=n(2092).filter;r({target:"Array",proto:!0,forced:!n(1194)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},6992:(t,e,n)=>{var r=n(5656),o=n(1223),i=n(7497),s=n(9909),a=n(3070).f,l=n(654),c=n(1913),u=n(9781),d="Array Iterator",p=s.set,h=s.getterFor(d);t.exports=l(Array,"Array",(function(t,e){p(this,{type:d,target:r(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var f=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!c&&u&&"values"!==f.name)try{a(f,"name",{value:"values"})}catch(t){}},5827:(t,e,n)=>{var r=n(2109),o=n(3671).left,i=n(9341),s=n(7392),a=n(5268);r({target:"Array",proto:!0,forced:!i("reduce")||!a&&s>79&&s<83},{reduce:function(t){var e=arguments.length;return o(this,t,e,e>1?arguments[1]:void 0)}})},8309:(t,e,n)=>{var r=n(9781),o=n(6530).EXISTS,i=n(1702),s=n(3070).f,a=Function.prototype,l=i(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=i(c.exec);r&&!o&&s(a,"name",{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(t){return""}}})},9601:(t,e,n)=>{var r=n(2109),o=n(1574);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},1539:(t,e,n)=>{var r=n(1694),o=n(8052),i=n(288);r||o(Object.prototype,"toString",i,{unsafe:!0})},1058:(t,e,n)=>{var r=n(2109),o=n(3009);r({global:!0,forced:parseInt!=o},{parseInt:o})},4916:(t,e,n)=>{var r=n(2109),o=n(2261);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},8783:(t,e,n)=>{var r=n(8710).charAt,o=n(1340),i=n(9909),s=n(654),a="String Iterator",l=i.set,c=i.getterFor(a);s(String,"String",(function(t){l(this,{type:a,string:o(t),index:0})}),(function(){var t,e=c(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=r(n,o),e.index+=t.length,{value:t,done:!1})}))},4723:(t,e,n)=>{var r=n(6916),o=n(7007),i=n(9670),s=n(7466),a=n(1340),l=n(4488),c=n(8173),u=n(1530),d=n(7651);o("match",(function(t,e,n){return[function(e){var n=l(this),o=null==e?void 0:c(e,t);return o?r(o,e,n):new RegExp(e)[t](a(n))},function(t){var r=i(this),o=a(t),l=n(e,r,o);if(l.done)return l.value;if(!r.global)return d(r,o);var c=r.unicode;r.lastIndex=0;for(var p,h=[],f=0;null!==(p=d(r,o));){var m=a(p[0]);h[f]=m,""===m&&(r.lastIndex=u(o,s(r.lastIndex),c)),f++}return 0===f?null:h}]}))},5306:(t,e,n)=>{var r=n(2104),o=n(6916),i=n(1702),s=n(7007),a=n(7293),l=n(9670),c=n(614),u=n(9303),d=n(7466),p=n(1340),h=n(4488),f=n(1530),m=n(8173),v=n(647),g=n(7651),y=n(5112)("replace"),b=Math.max,w=Math.min,x=i([].concat),S=i([].push),O=i("".indexOf),k=i("".slice),E="$0"==="a".replace(/./,"$0"),C=!!/./[y]&&""===/./[y]("a","$0");s("replace",(function(t,e,n){var i=C?"$":"$0";return[function(t,n){var r=h(this),i=null==t?void 0:m(t,y);return i?o(i,t,r,n):o(e,p(r),t,n)},function(t,o){var s=l(this),a=p(t);if("string"==typeof o&&-1===O(o,i)&&-1===O(o,"$<")){var h=n(e,s,a,o);if(h.done)return h.value}var m=c(o);m||(o=p(o));var y=s.global;if(y){var E=s.unicode;s.lastIndex=0}for(var C=[];;){var M=g(s,a);if(null===M)break;if(S(C,M),!y)break;""===p(M[0])&&(s.lastIndex=f(a,d(s.lastIndex),E))}for(var T,A="",N=0,D=0;D<C.length;D++){for(var _=p((M=C[D])[0]),R=b(w(u(M.index),a.length),0),I=[],z=1;z<M.length;z++)S(I,void 0===(T=M[z])?T:String(T));var L=M.groups;if(m){var P=x([_],I,R,a);void 0!==L&&S(P,L);var B=p(r(o,void 0,P))}else B=v(_,a,R,I,L,o);R>=N&&(A+=k(a,N,R)+B,N=R+_.length)}return A+k(a,N)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!E||C)},1202:(t,e,n)=>{var r,o=n(7854),i=n(1702),s=n(9190),a=n(2423),l=n(7710),c=n(9320),u=n(111),d=n(2050),p=n(9909).enforce,h=n(8536),f=!o.ActiveXObject&&"ActiveXObject"in o,m=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},v=l("WeakMap",m,c);if(h&&f){r=c.getConstructor(m,"WeakMap",!0),a.enable();var g=v.prototype,y=i(g.delete),b=i(g.has),w=i(g.get),x=i(g.set);s(g,{delete:function(t){if(u(t)&&!d(t)){var e=p(this);return e.frozen||(e.frozen=new r),y(this,t)||e.frozen.delete(t)}return y(this,t)},has:function(t){if(u(t)&&!d(t)){var e=p(this);return e.frozen||(e.frozen=new r),b(this,t)||e.frozen.has(t)}return b(this,t)},get:function(t){if(u(t)&&!d(t)){var e=p(this);return e.frozen||(e.frozen=new r),b(this,t)?w(this,t):e.frozen.get(t)}return w(this,t)},set:function(t,e){if(u(t)&&!d(t)){var n=p(this);n.frozen||(n.frozen=new r),b(this,t)?x(this,t,e):n.frozen.set(t,e)}else x(this,t,e);return this}})}},4129:(t,e,n)=>{n(1202)},4747:(t,e,n)=>{var r=n(7854),o=n(8324),i=n(8509),s=n(8533),a=n(8880),l=function(t){if(t&&t.forEach!==s)try{a(t,"forEach",s)}catch(e){t.forEach=s}};for(var c in o)o[c]&&l(r[c]&&r[c].prototype);l(i)},3948:(t,e,n)=>{var r=n(7854),o=n(8324),i=n(8509),s=n(6992),a=n(8880),l=n(5112),c=l("iterator"),u=l("toStringTag"),d=s.values,p=function(t,e){if(t){if(t[c]!==d)try{a(t,c,d)}catch(e){t[c]=d}if(t[u]||a(t,u,e),o[e])for(var n in s)if(t[n]!==s[n])try{a(t,n,s[n])}catch(e){t[n]=s[n]}}};for(var h in o)p(r[h]&&r[h].prototype,h);p(i,"DOMTokenList")},1296:(t,e,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,f=function(){return u.Date.now()};function m(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==d.call(t)}(t))return NaN;if(m(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=m(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(r,"");var n=i.test(t);return n||s.test(t)?a(t.slice(2),n?2:8):o.test(t)?NaN:+t}t.exports=function(t,e,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=r,i=o;return r=o=void 0,c=e,s=t.apply(i,n)}function b(t){return c=t,a=setTimeout(x,e),u?y(t):s}function w(t){var n=t-l;return void 0===l||n>=e||n<0||d&&t-c>=i}function x(){var t=f();if(w(t))return S(t);a=setTimeout(x,function(t){var n=e-(t-l);return d?h(n,i-(t-c)):n}(t))}function S(t){return a=void 0,g&&r?y(t):(r=o=void 0,s)}function O(){var t=f(),n=w(t);if(r=arguments,o=this,l=t,n){if(void 0===a)return b(l);if(d)return a=setTimeout(x,e),y(l)}return void 0===a&&(a=setTimeout(x,e)),s}return e=v(e)||0,m(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(v(n.maxWait)||0,e):i,g="trailing"in n?!!n.trailing:g),O.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},O.flush=function(){return void 0===a?s:S(f())},O}},773:(t,e,n)=>{var r,o="__lodash_hash_undefined__",i=/^\[object .+?Constructor\]$/,s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,l=s||a||Function("return this")(),c=Array.prototype,u=Function.prototype,d=Object.prototype,p=l["__core-js_shared__"],h=(r=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",f=u.toString,m=d.hasOwnProperty,v=d.toString,g=RegExp("^"+f.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),y=c.splice,b=C(l,"Map"),w=C(Object,"create");function x(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function S(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function O(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function k(t,e){for(var n,r,o=t.length;o--;)if((n=t[o][0])===(r=e)||n!=n&&r!=r)return o;return-1}function E(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function C(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){if(!T(t)||h&&h in t)return!1;var e=function(t){var e=T(t)?v.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?g:i;return e.test(function(t){if(null!=t){try{return f.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}(n)?n:void 0}function M(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s),s};return n.cache=new(M.Cache||O),n}function T(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}x.prototype.clear=function(){this.__data__=w?w(null):{}},x.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},x.prototype.get=function(t){var e=this.__data__;if(w){var n=e[t];return n===o?void 0:n}return m.call(e,t)?e[t]:void 0},x.prototype.has=function(t){var e=this.__data__;return w?void 0!==e[t]:m.call(e,t)},x.prototype.set=function(t,e){return this.__data__[t]=w&&void 0===e?o:e,this},S.prototype.clear=function(){this.__data__=[]},S.prototype.delete=function(t){var e=this.__data__,n=k(e,t);return!(n<0||(n==e.length-1?e.pop():y.call(e,n,1),0))},S.prototype.get=function(t){var e=this.__data__,n=k(e,t);return n<0?void 0:e[n][1]},S.prototype.has=function(t){return k(this.__data__,t)>-1},S.prototype.set=function(t,e){var n=this.__data__,r=k(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},O.prototype.clear=function(){this.__data__={hash:new x,map:new(b||S),string:new x}},O.prototype.delete=function(t){return E(this,t).delete(t)},O.prototype.get=function(t){return E(this,t).get(t)},O.prototype.has=function(t){return E(this,t).has(t)},O.prototype.set=function(t,e){return E(this,t).set(t,e),this},M.Cache=O,t.exports=M},3096:(t,e,n)=>{var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function g(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==p.call(t)}(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(o,"");var n=s.test(t);return n||a.test(t)?l(t.slice(2),n?2:8):i.test(t)?NaN:+t}t.exports=function(t,e,n){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(r);return v(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(t,e,n){var o,i,s,a,l,c,u=0,d=!1,p=!1,y=!0;if("function"!=typeof t)throw new TypeError(r);function b(e){var n=o,r=i;return o=i=void 0,u=e,a=t.apply(r,n)}function w(t){return u=t,l=setTimeout(S,e),d?b(t):a}function x(t){var n=t-c;return void 0===c||n>=e||n<0||p&&t-u>=s}function S(){var t=m();if(x(t))return O(t);l=setTimeout(S,function(t){var n=e-(t-c);return p?f(n,s-(t-u)):n}(t))}function O(t){return l=void 0,y&&o?b(t):(o=i=void 0,a)}function k(){var t=m(),n=x(t);if(o=arguments,i=this,c=t,n){if(void 0===l)return w(c);if(p)return l=setTimeout(S,e),b(c)}return void 0===l&&(l=setTimeout(S,e)),a}return e=g(e)||0,v(n)&&(d=!!n.leading,s=(p="maxWait"in n)?h(g(n.maxWait)||0,e):s,y="trailing"in n?!!n.trailing:y),k.cancel=function(){void 0!==l&&clearTimeout(l),u=0,o=c=i=l=void 0},k.flush=function(){return void 0===l?a:O(m())},k}(t,e,{leading:o,maxWait:e,trailing:i})}},8274:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm-3 4H8v2h12v-2Zm3 4H5v2h18v-2ZM8 19h12v2H8v-2Z" clip-rule="evenodd"/>\n</svg>\n'},8768:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm0 4H5v2h18v-2Zm0 4H5v2h18v-2ZM5 19h18v2H5v-2Z" clip-rule="evenodd"/>\n</svg>\n'},2449:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm-6 4H5v2h12v-2Zm6 4H5v2h18v-2ZM5 19h12v2H5v-2Z" clip-rule="evenodd"/>\n</svg>\n'},2515:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M23 7H5v2h18V7Zm0 4H11v2h12v-2Zm0 4H5v2h18v-2Zm-12 4h12v2H11v-2Z" clip-rule="evenodd"/>\n</svg>\n'},548:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 8 8">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m4 6.934 4-5H0l4 5Z" clip-rule="evenodd"/>\n</svg>\n'},1881:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M22 20.62a2.42 2.42 0 0 1-4.84 0c0-1.25 2.42-4.54 2.42-4.54S22 19.37 22 20.62ZM9.92 15.425l1.452-3.951c.071-.182.145-.394.219-.636.074-.242.149-.503.226-.783a17.223 17.223 0 0 0 .454 1.402l1.452 3.968H9.919Zm5.411 4.199c.226-.795.658-1.684 1.184-2.562L12.955 8h-2.269L6 19.93h1.725a.736.736 0 0 0 .474-.157.792.792 0 0 0 .26-.347l.891-2.434h4.941l.891 2.434c.031.079.097.134.148.198Z" clip-rule="evenodd"/>\n</svg>\n'},9464:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M16.64 19.93h-1.715a.75.75 0 0 1-.475-.145.82.82 0 0 1-.268-.359l-.89-2.433H8.35l-.891 2.433a.78.78 0 0 1-.26.347.73.73 0 0 1-.475.157H5L9.686 8h2.269l4.686 11.93Zm-7.72-4.505h3.803l-1.452-3.968a18.048 18.048 0 0 1-.219-.623c-.08-.24-.158-.5-.235-.78-.077.28-.152.542-.227.784a8.742 8.742 0 0 1-.218.635L8.92 15.425Zm14.968 4.505h-.915a.987.987 0 0 1-.454-.087c-.11-.058-.192-.175-.248-.35l-.181-.603a7.005 7.005 0 0 1-.631.507c-.206.146-.42.269-.64.368a3.26 3.26 0 0 1-.7.222c-.248.05-.523.075-.826.075-.357 0-.687-.049-.99-.145a2.134 2.134 0 0 1-.78-.433 1.967 1.967 0 0 1-.507-.718 2.545 2.545 0 0 1-.181-.998c0-.319.084-.634.251-.945.168-.31.447-.59.838-.841.39-.25.91-.458 1.559-.623.649-.165 1.455-.258 2.417-.28v-.495c0-.567-.12-.986-.359-1.259-.239-.272-.587-.408-1.043-.408-.33 0-.605.039-.825.116a3.17 3.17 0 0 0-.574.26 25.11 25.11 0 0 1-.45.26.912.912 0 0 1-.453.115.59.59 0 0 1-.355-.107.843.843 0 0 1-.239-.264l-.371-.652c.973-.891 2.148-1.337 3.523-1.337.494 0 .936.081 1.324.244.387.162.716.387.985.676.27.289.475.634.615 1.036.14.401.21.841.21 1.32v5.346Zm-3.96-1.271c.21 0 .402-.02.578-.058.176-.038.342-.096.5-.173.156-.077.307-.172.453-.285a4.13 4.13 0 0 0 .441-.4v-1.427c-.594.027-1.09.078-1.489.153a3.967 3.967 0 0 0-.961.284c-.242.116-.414.25-.516.404a.894.894 0 0 0-.152.504c0 .357.106.613.317.767.212.154.489.231.83.231Z" clip-rule="evenodd"/>\n</svg>\n'},9747:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="#fff" stroke="#B3B3B3" d="M4.5 4.5h19v19h-19z"/>\n <path fill="#3B3B3B" d="M26 20.7a2.51 2.51 0 0 1-5 0c0-1.31 2.5-4.7 2.5-4.7s2.5 3.39 2.5 4.7Z"/>\n <path fill="#3B3B3B" fill-rule="evenodd" d="M19.64 19.93h-1.715a.75.75 0 0 1-.475-.145.82.82 0 0 1-.268-.359l-.89-2.433h-4.943l-.89 2.433a.78.78 0 0 1-.26.347.73.73 0 0 1-.475.157H8L12.686 8h2.269l4.686 11.93Zm-7.721-4.505h3.803l-1.452-3.968a18.048 18.048 0 0 1-.219-.623c-.08-.24-.158-.5-.235-.78-.077.28-.152.542-.227.784a8.742 8.742 0 0 1-.218.635l-1.452 3.952Z" clip-rule="evenodd"/>\n</svg>\n'},9441:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M18 9V7h-7v2h2.64l-1.22 10H10v2h7v-2h-2.83L15.4 9H18Z"/>\n</svg>\n'},4140:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m5 10 3-3 3 3H9v8h2l-3 3-3-3h2v-8H5Zm8-3h10v2H13V7Zm10 6H13v2h10v-2Zm0 6H13v2h10v-2Z" clip-rule="evenodd"/>\n</svg>\n'},1304:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <rect width="9" height="9" x="9.5" y="9.5" stroke="var(--zw-icon-foreground)" rx="4.5"/>\n</svg>\n'},2412:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M15.108 18.184V19H10.5v-.816h1.842v-5.862c0-.176.006-.354.018-.534l-1.53 1.314a.375.375 0 0 1-.156.084.373.373 0 0 1-.27-.048.318.318 0 0 1-.084-.078l-.336-.462 2.562-2.214h.87v7.8h1.692Zm1.519.156a.8.8 0 0 1 .054-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n'},4311:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <rect width="10" height="10" x="9" y="9" fill="var(--zw-icon-foreground)" rx="5"/>\n</svg>\n'},1477:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M12.086 9.802h.834v11.292h-.834V9.802Zm2.592 8.538a.8.8 0 0 1 .054-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n'},5400:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="m13.664 15.808-1.35-3.498a7.11 7.11 0 0 1-.252-.804c-.084.324-.17.594-.258.81l-1.35 3.492h3.21ZM16.088 19h-.9a.387.387 0 0 1-.252-.078.48.48 0 0 1-.144-.198l-.804-2.076H10.13l-.804 2.076a.421.421 0 0 1-.138.192.383.383 0 0 1-.252.084h-.9l3.438-8.598h1.176L16.088 19Zm.7-.66a.8.8 0 0 1 .053-.294.829.829 0 0 1 .156-.24.77.77 0 0 1 .534-.222.77.77 0 0 1 .696.462c.04.092.06.19.06.294a.744.744 0 0 1-.222.534.692.692 0 0 1-.24.156.73.73 0 0 1-.294.06.73.73 0 0 1-.294-.06.692.692 0 0 1-.396-.39.816.816 0 0 1-.054-.3Z"/>\n</svg>\n'},2807:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M9 9h10v10H9z"/>\n</svg>\n'},6495:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M14.089 6.726a1 1 0 0 1 1.425-.003l6.8 6.882a1 1 0 0 1 .007 1.398L17.2 20.3l-.2.2c-2.2 2.1-5.7 2-7.8-.2l-3.516-3.6a1 1 0 0 1 0-1.399l8.405-8.575Zm1.81 12.674c.1 0 .2 0 .2-.1l4.8-5-6.1-6.2-5 5.1 6.1 6.2Z" clip-rule="evenodd"/>\n</svg>\n'},7522:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M14 9.333V6.666l-3.334 3.333L14 13.333v-2.667c2.206 0 4 1.793 4 4s-1.794 4-4 4c-2.207 0-4-1.793-4-4H8.666A5.332 5.332 0 0 0 14 19.999a5.332 5.332 0 0 0 5.333-5.333A5.332 5.332 0 0 0 14 9.333Z"/>\n</svg>\n'},9976:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="m14 12.731.77.27H20v2H8v-2h2.84a2.892 2.892 0 0 1-.46-.71 3.61 3.61 0 0 1-.29-1.52c0-.484.1-.964.29-1.41a3.5 3.5 0 0 1 .83-1.2 4 4 0 0 1 1.35-.84 4.74 4.74 0 0 1 1.83-.32 6 6 0 0 1 2.11.41 5 5 0 0 1 1.68 1l-.46.88a.69.69 0 0 1-.18.22.41.41 0 0 1-.25.07.69.69 0 0 1-.39-.16 5.551 5.551 0 0 0-.56-.36 4.641 4.641 0 0 0-.8-.36 3.44 3.44 0 0 0-1.14-.16 3.16 3.16 0 0 0-1.11.17 2.29 2.29 0 0 0-.8.45 1.87 1.87 0 0 0-.49.67 2.138 2.138 0 0 0-.11.79c-.023.357.08.711.29 1 .206.267.465.489.76.65.338.187.693.34 1.06.46Zm1.99 6.06c.24-.22.427-.49.55-.79.135-.315.2-.657.19-1h1.74a4.58 4.58 0 0 1-.25 1.38 4 4 0 0 1-.91 1.37 4.231 4.231 0 0 1-1.46.92 5.503 5.503 0 0 1-2 .33 6.13 6.13 0 0 1-2.5-.46 5.66 5.66 0 0 1-1.89-1.31l.54-.88a.61.61 0 0 1 .19-.17.45.45 0 0 1 .25-.07.5.5 0 0 1 .28.1c.128.077.251.16.37.25l.46.33c.19.13.391.243.6.34.245.107.5.191.76.25.328.076.664.11 1 .1a3.67 3.67 0 0 0 1.19-.18c.328-.109.63-.282.89-.51Z" clip-rule="evenodd"/>\n</svg>\n'},9857:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" d="M21.985 8.625h-1.75V9.5h2.625v.875h-3.5v-1.75c0-.481.394-.875.875-.875h1.75v-.875H19.36V6h2.625c.481 0 .875.394.875.875v.875a.878.878 0 0 1-.875.875ZM7.88 20h2.327l2.975-4.742h.105L16.262 20h2.328l-4.069-6.361L18.32 7.75h-2.345l-2.687 4.366h-.105L10.48 7.75H8.15l3.78 5.889L7.88 20Z"/>\n</svg>\n'},6031:t=>{t.exports='<svg xmlns="http://www.w3.org/2000/svg" fill="none" style="width:var(--zw-icon-width);height:var(--zw-icon-height)" viewBox="0 0 28 28">\n <path fill="var(--zw-icon-foreground)" fill-rule="evenodd" d="M15.4 16.06a3.3 3.3 0 0 1-1.4.29 3.12 3.12 0 0 1-1.39-.29 2.88 2.88 0 0 1-1.05-.81 3.711 3.711 0 0 1-.65-1.25 5.659 5.659 0 0 1-.22-1.6V7H9v5.41a6.89 6.89 0 0 0 .34 2.22 5.29 5.29 0 0 0 1 1.77c.437.501.975.904 1.58 1.18A5 5 0 0 0 14 18a5 5 0 0 0 2.08-.42 4.61 4.61 0 0 0 1.57-1.18 5.27 5.27 0 0 0 1-1.77 6.89 6.89 0 0 0 .35-2.22V7h-1.69v5.41a5.659 5.659 0 0 1-.22 1.59 3.71 3.71 0 0 1-.69 1.25c-.27.34-.61.617-1 .81ZM20 19H8v2h12v-2Z" clip-rule="evenodd"/>\n</svg>\n'},7061:(t,e,n)=>{var r=n(8698).default;function o(){t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,i=n.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),s=new C(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var a=O(s,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=p(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,s),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h={};function f(){}function m(){}function v(){}var g={};u(g,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(M([])));b&&b!==n&&i.call(b,a)&&(g=b);var w=v.prototype=f.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,s,a,l){var c=p(t[o],t,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,l)}))}l(c.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=p(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function M(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:T}}function T(){return{value:void 0,done:!0}}return m.prototype=v,u(w,"constructor",v),u(v,"constructor",m),m.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,l,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var s=new S(d(t,n,r,o),i);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},x(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},8698:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},4687:(t,e,n)=>{var r=n(7061)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i={};(()=>{o.d(i,{F:()=>Oh});var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wysiwygRef",staticClass:"zw-wysiwyg"},[n("Toolbar",{directives:[{name:"show",rawName:"v-show",value:t.active,expression:"active"}],ref:"toolbarRef",attrs:{editor:t.editor,device:t.device}}),t._v(" "),n("EditorContent",{attrs:{editor:t.editor}})],1)};function r(t){this.content=t}n._withStripped=!0,r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return-1==i?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(-1==s?i.length:s,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>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)};const s=r;function a(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=a(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function l(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),c=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t<e&&s.text[s.text.length-t-1]==a.text[a.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let t=l(s.content,a.content,n-1,r-1);if(t)return t}n-=c,r-=c}else n-=c,r-=c}}class c{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new c(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new c(n,r)}cutByIndex(t,e){return t==e?c.empty:0==t&&e==this.content.length?this:new c(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new c(r,o)}addToStart(t){return new c([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new c(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return a(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return l(this,t,e,n)}findIndex(t,e=-1){if(0==t)return d(0,t);if(t==this.size)return d(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?d(n+1,o):d(n,r);r=o}}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 c.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new c(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return c.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new c(e||t,n)}static from(t){if(!t)return c.empty;if(t instanceof c)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new c([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}c.empty=new c([],0);const u={index:0,offset:0};function d(t,e){return u.index=t,u.offset=e,u}function p(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!p(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!p(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class h{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&p(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return h.none;if(t instanceof h)return[t];let e=t.slice();return e.sort(((t,e)=>t.type.rank-e.type.rank)),e}}h.none=[];class f extends Error{}class m{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=g(this.content,t+this.openStart,e);return n&&new m(n,this.openStart,this.openEnd)}removeBetween(t,e){return new m(v(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 m.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new m(c.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 m(t,n,r)}}function v(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(v(i.content,e-o-1,n-o-1)))}function g(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=g(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function y(t,e,n){if(n.openStart>t.depth)throw new f("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new f("Inconsistent open depths");return b(t,e,n,0)}function b(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=b(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(c.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return k(i,E(t,o,s,e,r))}{let r=t.parent,o=r.content;return k(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return k(i,C(t,e,r))}function w(t,e){if(!e.type.compatibleContent(t.type))throw new f("Cannot join "+e.type.name+" onto "+t.type.name)}function x(t,e,n){let r=t.node(n);return w(r,e.node(n)),r}function S(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 O(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(S(t.nodeAfter,r),i++));for(let t=i;t<s;t++)S(o.child(t),r);e&&e.depth==n&&e.textOffset&&S(e.nodeBefore,r)}function k(t,e){if(!t.type.validContent(e))throw new f("Invalid content for node "+t.type.name);return t.copy(e)}function E(t,e,n,r,o){let i=t.depth>o&&x(t,e,o+1),s=r.depth>o&&x(n,r,o+1),a=[];return O(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(w(i,s),S(k(i,E(t,e,n,r,o+1)),a)):(i&&S(k(i,C(t,e,o+1)),a),O(e,n,o,a),s&&S(k(s,C(n,r,o+1)),a)),O(r,null,o,a),new c(a)}function C(t,e,n){let r=[];return O(null,t,n,r),t.depth>n&&S(k(x(t,e,n+1),C(t,e,n+1)),r),O(e,null,n,r),new c(r)}m.empty=new m(c.empty,0,0);class M{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 new 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 new 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;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return h.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new D(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<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new M(e,n,o)}static resolveCached(t,e){for(let n=0;n<T.length;n++){let r=T[n];if(r.pos==e&&r.doc==t)return r}let n=T[A]=M.resolve(t,e);return A=(A+1)%N,n}}let T=[],A=0,N=12;class D{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const _=Object.create(null);class R{constructor(t,e,n,r=h.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||c.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&p(this.attrs,e||t.defaultAttrs||_)&&h.sameSet(this.marks,n||h.none)}copy(t=null){return t==this.content?this:new R(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new R(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return m.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new m(a,r.depth-i,o.depth-i)}replace(t,e,n){return y(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),!e)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(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return M.resolveCached(this,t)}resolveNoCache(t){return M.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&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()+")"),z(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=c.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let t=h.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!h.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t=>t.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){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=c.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}R.prototype.text=void 0;class I extends R{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):z(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 I(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new I(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 z(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class L{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new P(t,e);if(null==n.next)return L.empty;let r=B(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);W(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new L(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(H);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}(W(t,0))}(function(t){let e=[[]];return o(function t(e,i){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(t(n,i))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(i,s),o(t(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(t(e.expr,i),s),o(t(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(i)].concat(t(e.expr,i));if("range"==e.type){let s=i;for(let r=0;r<e.min;r++){let r=n();o(t(e.expr,s),r),s=r}if(-1==e.max)o(t(e.expr,s),s);else for(let i=e.min;i<e.max;i++){let i=n();r(s,i),o(t(e.expr,s),i),s=i}return[r(s)]}if("name"==e.type)return[r(i,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=t(e.exprs[r],i);if(r==e.exprs.length-1)return s;o(s,i=n())}}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return c.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r})).join("\n")}}L.empty=new L(!0);class P{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 new SyntaxError(t+" (in content expression '"+this.string+"')")}}function B(t){let e=[];do{e.push(F(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function F(t){let e=[];do{e.push(j(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function j(t){let e=function(t){if(t.eat("(")){let e=B(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&o.push(r)}return 0==o.length&&t.err("No node type or group '"+e+"' found"),o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=$(t,e)}return e}function V(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function $(t,e){let n=V(t),r=n;return t.eat(",")&&(r="}"!=t.next?V(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function H(t,e){return e-t}function W(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(H)}function q(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function U(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function G(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new J(t[n]);return e}class K{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=G(n.attrs),this.defaultAttrs=q(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==L.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:U(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new R(this,this.computeAttrs(t),c.from(e),h.setFrom(n))}createChecked(t=null,e,n){if(e=c.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new R(this,this.computeAttrs(t),e,h.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=c.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(c.empty,!0);return o?new R(this,t,e.append(o),h.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:h.none:t}static compile(t,e){let n=Object.create(null);t.forEach(((t,r)=>n[t]=new K(t,e,r)));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class J{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Z{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=G(r.attrs),this.excluded=null;let o=q(this.attrs);this.instance=o?new h(this,o):null}create(t=null){return!t&&this.instance?this.instance:new h(this,U(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new Z(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class X{constructor(t){this.cached=Object.create(null),this.spec={nodes:s.from(t.nodes),marks:s.from(t.marks||{}),topNode:t.topNode},this.nodes=K.compile(this.spec.nodes,this),this.marks=Z.compile(this.spec.marks,this);let e=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let n=this.nodes[t],r=n.spec.content||"",o=n.spec.marks;n.contentMatch=e[r]||(e[r]=L.parse(r,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.markSet="_"==o?null:o?Y(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:Y(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof K))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new I(n,n.defaultAttrs,t,h.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return R.fromJSON(this,t)}markFromJSON(t){return h.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Y(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Q{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&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 it(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new it(this,e,!0);return n.addAll(t,e.from,e.to),m.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(st(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.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<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach((t=>{n(t=at(t)),t.mark=e}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=at(t)),t.node=e}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Q(t,Q.schemaRules(t)))}}const tt={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},et={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},nt={ol:!0,ul:!0};function rt(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class ot{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=h.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(c.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=c.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):lt(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!tt.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class it{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=rt(null,e.preserveWhitespace,0)|(n?4:0);r=o?new ot(o.type,o.attrs,h.none,h.none,!0,e.topMatch||o.type.contentMatch,i):new ot(n?null:t.schema.topNodeType,null,h.none,h.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let e=t.getAttribute("style"),n=e?this.readStyles(function(t){let e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(let t=0;t<n.length;t++)this.addPendingMark(n[t]);if(this.addElement(t),null!=n)for(let t=0;t<n.length;t++)this.removePendingMark(n[t],r)}}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n,r=t.nodeName.toLowerCase();nt.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&nt.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:et.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let e,n=this.top,i=this.needsBlock;if(tt.hasOwnProperty(r))e=!0,n.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),e&&this.sync(n),this.needsBlock=i}else this.addElementByRule(t,o,!1===o.consuming?n:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=h.none;t:for(let n=0;n<t.length;n+=2)for(let r;;){let o=this.parser.matchStyle(t[n],t[n+1],this,r);if(!o)continue t;if(o.ignore)return null;if(e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1!==o.consuming)break;r=o}return e}addElementByRule(t,e,n){let r,o,i;e.node?(o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs||null,e.preserveWhitespace)):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)e.type&&!e.type.allowsMarkType(t.marks[r].type)||(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let i=rt(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ot(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}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;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<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-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),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(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}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function st(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function at(t){let e={};for(let n in t)e[n]=t[n];return e}function lt(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class ct{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=dt(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=ct.renderSpec(dt(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&ct.renderSpec(dt(n),r(t,e))}static renderSpec(t,e,n=null){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 r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let o=l;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=ct.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new ct(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=ut(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return ut(t.marks)}}function ut(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function dt(t){return t.document||window.document}const pt=Math.pow(2,16);function ht(t){return 65535&t}class ft{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 mt{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&mt.empty)return mt.empty}recover(t){let e=0,n=ht(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/pt}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(t<=u){let o=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:u)?null:s/3+(t-a)*pt,d=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(d|=8),new ft(o,d,i)}r+=c-l}return n?t+r:new ft(t+r,0,null)}touches(t,e){let n=0,r=ht(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),o+=c-l}}invert(){return new mt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?mt.empty:new mt(t<0?[0,-t,0]:[0,0,t])}}mt.empty=new mt([]);class vt{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new vt(this.maps,this.mirror,t,e)}copy(){return new vt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=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 vt;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new ft(t,r,null)}}const gt=Object.create(null);class yt{getMap(){return mt.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=gt[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in gt)throw new RangeError("Duplicate use of step JSON ID "+t);return gt[t]=e,e.prototype.jsonID=t,e}}class bt{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new bt(t,null)}static fail(t){return new bt(null,t)}static fromReplace(t,e,n,r){try{return bt.ok(t.replace(e,n,r))}catch(t){if(t instanceof f)return bt.fail(t.message);throw t}}}function wt(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(wt(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return c.fromArray(r)}class xt extends yt{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=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new m(wt(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return bt.fromReplace(t,this.from,this.to,o)}invert(){return new St(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 xt(e.pos,n.pos,this.mark)}merge(t){return t instanceof xt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xt(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 new RangeError("Invalid input for AddMarkStep.fromJSON");return new xt(e.from,e.to,t.markFromJSON(e.mark))}}yt.jsonID("addMark",xt);class St extends yt{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 m(wt(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return bt.fromReplace(t,this.from,this.to,n)}invert(){return new xt(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 St(e.pos,n.pos,this.mark)}merge(t){return t instanceof St&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new St(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 new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new St(e.from,e.to,t.markFromJSON(e.mark))}}yt.jsonID("removeMark",St);class Ot extends yt{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&Et(t,this.from,this.to)?bt.fail("Structure replace would overwrite content"):bt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new mt([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ot(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new Ot(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof Ot)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?m.empty:new m(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Ot(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?m.empty:new m(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Ot(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ot(e.from,e.to,m.fromJSON(t,e.slice),!!e.structure)}}yt.jsonID("replace",Ot);class kt extends yt{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(Et(t,this.from,this.gapFrom)||Et(t,this.gapTo,this.to)))return bt.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return bt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?bt.fromReplace(t,this.from,this.to,n):bt.fail("Content does not fit in gap")}getMap(){return new mt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new kt(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new kt(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new kt(e.from,e.to,e.gapFrom,e.gapTo,m.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Et(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function Ct(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Mt(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!Ct(r,o,i))break}return null}function Tt(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(At).concat({type:e,attrs:n}).concat(i.map(At)):null}function At(t){return{type:t,attrs:null}}function Nt(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Dt(t,e){let n=t.resolve(e),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function _t(t,e,n=e,r=m.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Rt(o,i,r)?new Ot(e,n,r):new It(o,i,r).fit()}function Rt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}yt.jsonID("replaceAround",kt);class It{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=c.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=c.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,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new m(o,i,s);return t>-1?new kt(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new Ot(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=Pt(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(c.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:n,parent:r,inject:l};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Pt(t,e);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new m(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),0))}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Pt(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new m(zt(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new m(zt(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,l=0,u=[],{match:d,type:p}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)u.push(r.child(t));d=d.matchFragment(r)}let h=s.size+t-(i.content.size-i.openEnd);for(;l<s.childCount;){let t=s.child(l),e=d.matchType(t.type);if(!e)break;l++,(l>1||0==a||t.content.size)&&(d=e,u.push(Bt(t.mark(p.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?h:-1)))}let f=l==s.childCount;f||(h=-1),this.placed=Lt(this.placed,e,c.from(u)),this.frontier[e].match=d,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<h;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=f?0==t?m.empty:new m(zt(i.content,t-1,1),t-1,h<0?i.openEnd:t-1):new m(zt(i.content,t,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Ft(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=Ft(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=Ft(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?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=Lt(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 r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Lt(this.placed,this.depth,c.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(c.empty,!0);t.childCount&&(this.placed=Lt(this.placed,this.frontier.length,t))}}function zt(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(zt(t.firstChild.content,e-1,n)))}function Lt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Lt(t.lastChild.content,e-1,n)))}function Pt(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Bt(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Bt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(c.empty,!0)))),t.copy(r)}function Ft(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function jt(t){return t.spec.defining||t.spec.definingForContent}function Vt(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Vt(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(c.empty,!0))}return t}function $t(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}let Ht=class extends Error{};Ht=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Ht.prototype=Object.create(Error.prototype)).constructor=Ht,Ht.prototype.name="TransformError";const Wt=Object.create(null);class qt{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Ut(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<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=m.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=t.mapping.slice(o);t.replaceRange(c.map(a.pos),c.map(l.pos),s?m.empty:e),0==s&&ne(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),ne(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Jt(t):ee(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?ee(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):ee(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Qt(t.node(0))}static atStart(t){return ee(t,t,0,0,1)||new Qt(t)}static atEnd(t){return ee(t,t,t.content.size,t.childCount,-1)||new Qt(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Wt[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Wt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Wt[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Jt.between(this.$anchor,this.$head).getBookmark()}}qt.prototype.visible=!0;class Ut{constructor(t,e){this.$from=t,this.$to=e}}let Gt=!1;function Kt(t){Gt||t.parent.inlineContent||(Gt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Jt extends qt{constructor(t,e=t){Kt(t),Kt(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 qt.near(n);let r=t.resolve(e.map(this.anchor));return new Jt(r.parent.inlineContent?r:n,n)}replace(t,e=m.empty){if(super.replace(t,e),e==m.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Jt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Zt(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 new RangeError("Invalid input for TextSelection.fromJSON");return new Jt(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=qt.findFrom(e,n,!0)||qt.findFrom(e,-n,!0);if(!t)return qt.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(qt.findFrom(t,-n,!0)||qt.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Jt(t,e)}}qt.jsonID("text",Jt);class Zt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Zt(t.map(this.anchor),t.map(this.head))}resolve(t){return Jt.between(t.resolve(this.anchor),t.resolve(this.head))}}class Xt extends qt{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?qt.near(o):new Xt(o)}content(){return new m(c.from(this.node),0,0)}eq(t){return t instanceof Xt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Yt(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Xt(t.resolve(e.anchor))}static create(t,e){return new Xt(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Xt.prototype.visible=!1,qt.jsonID("node",Xt);class Yt{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new Zt(n,n):new Yt(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Xt.isSelectable(n)?new Xt(e):qt.near(e)}}class Qt extends qt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=m.empty){if(e==m.empty){t.delete(0,t.doc.content.size);let e=qt.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Qt(t)}map(t){return new Qt(t)}eq(t){return t instanceof Qt}getBookmark(){return te}}qt.jsonID("all",Qt);const te={map(){return this},resolve:t=>new Qt(t)};function ee(t,e,n,r,o,i=!1){if(e.inlineContent)return Jt.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Xt.isSelectable(r))return Xt.create(t,n-(o<0?r.nodeSize:0))}else{let e=ee(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function ne(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof Ot||i instanceof kt)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(qt.near(t.doc.resolve(o),n)))}class re extends class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new vt}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ht(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}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=m.empty){let r=_t(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new m(c.from(n),0,0))}delete(t,e){return this.replace(t,e,m.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(Rt(o,i,r))return t.step(new Ot(e,n,r));let s=$t(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let l=s.indexOf(a),c=[],u=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==r.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){let e=c[t].type,n=jt(e);if(n&&o.node(l).type!=e)u=t;else if(n||!e.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+u+1)%(r.openStart+1),d=c[a];if(d)for(let e=0;e<s.length;e++){let c=s[(e+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),h=o.index(c-1);if(p.canReplaceWith(h,h,d.type,d.marks))return t.replace(o.before(c),u?i.after(c):n,new m(Vt(r.content,0,r.openStart,a),a,r.openEnd))}}let d=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>d));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=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(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new m(c.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=$t(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,u=a,d=c.empty,p=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,d=c.from(r.node(t).copy(d)),p++):l--;let h=c.empty,f=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,h=c.from(o.node(t).copy(h)),f++):u++;t.step(new kt(l,u,s,a,new m(d.append(h),p,f),d.size-p,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new Ot(e-n,e+n,m.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=c.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=c.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new kt(o,i,o,i,new m(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),l=s.map(n+e.nodeSize,1);return t.step(new kt(a,l,a+1,l-1,new m(c.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new kt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new m(c.from(s),0,0),1,!0))}(this,t,e,n,r),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=c.empty,s=c.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=c.from(o.node(t).copy(i));let e=r&&r[a];s=c.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new Ot(e,e,new m(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),d=Math.min(l+t.nodeSize,n),p=r.addToSet(u);for(let t=0;t<u.length;t++)u[t].isInSet(p)||(o&&o.to==c&&o.mark.eq(u[t])?o.to=d:s.push(o=new St(c,d,u[t])));i&&i.to==c?i.to=d:a.push(i=new xt(c,d,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof Z){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,l=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&l.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,e),to:r,step:i})}}})),o.forEach((e=>t.step(new St(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let e=0;e<o.childCount;e++){let a=o.child(e),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let e=0;e<a.marks.length;e++)n.allowsMarkType(a.marks[e].type)||t.step(new St(s,l,a.marks[e]))}else i.push(new Ot(s,l,m.empty));s=l}if(!r.validEnd){let e=r.fillBefore(c.empty,!0);t.replace(s,s,new m(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return h.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)||h.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),n=null==n?e:n,!t)return this.deleteRange(e,n);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(qt.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 oe(t,e){return e&&t?t.bind(e):t}class ie{constructor(t,e,n){this.name=t,this.init=oe(e.init,n),this.apply=oe(e.apply,n)}}const se=[new ie("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new ie("selection",{init:(t,e)=>t.selection||qt.atStart(e.doc),apply:t=>t.selection}),new ie("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new ie("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class ae{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=se.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new 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 ie(t.key,t.spec.state,t))}))}}class le{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;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<i?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new le(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];e[o.name]=o.apply(t,this[o.name],this,e)}return e}get tr(){return new re(this)}static create(t){let e=new ae(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new le(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new ae(this.schema,t.plugins),n=e.fields,r=new le(e);for(let e=0;e<n.length;e++){let o=n[e].name;r[o]=this.hasOwnProperty(o)?this[o]:n[e].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((t=>t.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new ae(t.schema,t.plugins),o=new le(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=R.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=qt.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}})),o}}function ce(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=ce(o,e,{})),n[r]=o}return n}class ue{constructor(t){this.spec=t,this.props={},t.props&&ce(t.props,this,this.props),this.key=t.key?t.key.key:pe("plugin")}getState(t){return t[this.key]}}const de=Object.create(null);function pe(t){return t in de?t+"$"+ ++de[t]:(de[t]=0,t+"$")}class he{constructor(t="key"){this.key=pe(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const fe="undefined"!=typeof navigator?navigator:null,me="undefined"!=typeof document?document:null,ve=fe&&fe.userAgent||"",ge=/Edge\/(\d+)/.exec(ve),ye=/MSIE \d/.exec(ve),be=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ve),we=!!(ye||be||ge),xe=ye?document.documentMode:be?+be[1]:ge?+ge[1]:0,Se=!we&&/gecko\/(\d+)/i.test(ve);Se&&(/Firefox\/(\d+)/.exec(ve)||[0,0])[1];const Oe=!we&&/Chrome\/(\d+)/.exec(ve),ke=!!Oe,Ee=Oe?+Oe[1]:0,Ce=!we&&!!fe&&/Apple Computer/.test(fe.vendor),Me=Ce&&(/Mobile\/\w+/.test(ve)||!!fe&&fe.maxTouchPoints>2),Te=Me||!!fe&&/Mac/.test(fe.platform),Ae=/Android \d/.test(ve),Ne=!!me&&"webkitFontSmoothing"in me.documentElement.style,De=Ne?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,_e=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Re=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let Ie=null;const ze=function(t,e,n){let r=Ie||(Ie=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},Le=function(t,e,n,r){return n&&(Be(t,e,n,r,-1)||Be(t,e,n,r,1))},Pe=/^(img|br|input|textarea|hr)$/i;function Be(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Fe(t))){let n=t.parentNode;if(!n||1!=n.nodeType||je(t)||Pe.test(t.nodeName)||"false"==t.contentEditable)return!1;e=_e(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?Fe(t):0}}}function Fe(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function je(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Ve=function(t){let e=t.isCollapsed;return e&&ke&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function $e(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function He(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function We(t,e){return"number"==typeof t?t:t[e]}function qe(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Ue(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Re(s)){if(1!=s.nodeType)continue;let t=s,n=t==i.body,a=n?He(i):qe(t),l=0,c=0;if(e.top<a.top+We(r,"top")?c=-(a.top-e.top+We(o,"top")):e.bottom>a.bottom-We(r,"bottom")&&(c=e.bottom-a.bottom+We(o,"bottom")),e.left<a.left+We(r,"left")?l=-(a.left-e.left+We(o,"left")):e.right>a.right-We(r,"right")&&(l=e.right-a.right+We(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let o=t.scrollLeft-n,i=t.scrollTop-r;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}if(n)break}}function Ge(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Re(r));return e}function Ke(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Je=null;function Ze(t,e){let n,r,o=2e8,i=0,s=e.top,a=e.top;for(let l=t.firstChild,c=0;l;l=l.nextSibling,c++){let t;if(1==l.nodeType)t=l.getClientRects();else{if(3!=l.nodeType)continue;t=ze(l).getClientRects()}for(let u=0;u<t.length;u++){let d=t[u];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let t=d.left>e.left?d.left-e.left:d.right<e.left?e.left-d.right:0;if(t<o){n=l,o=t,r=t&&3==n.nodeType?{left:d.right<e.left?d.right:d.left,top:e.top}:e,1==l.nodeType&&t&&(i=c+(e.left>=(d.left+d.right)/2?1:0));continue}}!n&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let n=tn(r,1);if(n.top!=n.bottom&&Xe(e,n))return{node:t,offset:o+(e.left>=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:Ze(n,r)}function Xe(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ye(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=t.childNodes[i];if(1==n.nodeType){let t=n.getClientRects();for(let r=0;r<t.length;r++){let o=t[r];if(Xe(e,o))return Ye(n,e,o)}}if((i=(i+1)%r)==o)break}return t}function Qe(t,e){let n,r=t.dom.ownerDocument,o=0;if(r.caretPositionFromPoint)try{let t=r.caretPositionFromPoint(e.left,e.top);t&&({offsetNode:n,offset:o}=t)}catch(t){}if(!n&&r.caretRangeFromPoint){let t=r.caretRangeFromPoint(e.left,e.top);t&&({startContainer:n,startOffset:o}=t)}let i,s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top+1);if(!s||!t.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=t.dom.getBoundingClientRect();if(!Xe(e,n))return null;if(s=Ye(t.dom,e,n),!s)return null}if(Ce)for(let t=s;n&&t;t=Re(t))t.draggable&&(n=void 0);if(s=function(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(s,e),n){if(Se&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let t,r=n.childNodes[o];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&o++}n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?i=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(i=function(t,e,n,r){let o=-1;for(let n=e;n!=t.dom;){let e=t.docView.nearestDesc(n,!0);if(!e)return null;if(e.node.isBlock&&e.parent){let t=e.dom.getBoundingClientRect();if(t.left>r.left||t.top>r.top)o=e.posBefore;else{if(!(t.right<r.left||t.bottom<r.top))break;o=e.posAfter}}n=e.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,1)}(t,n,o,e))}null==i&&(i=function(t,e,n){let{node:r,offset:o}=Ze(e,n),i=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();i=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function tn(t,e){let n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}const en=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nn(t,e,n){let{node:r,offset:o}=t.docView.domFromPos(e,n<0?-1:1),i=Ne||Se;if(3==r.nodeType){if(!i||!en.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let t=o,e=o,i=n<0?1:-1;return n<0&&!o?(e++,i=-1):n>=0&&o==r.nodeValue.length?(t--,i=1):n<0?t--:e++,rn(tn(ze(r,t,e),i),i<0)}{let t=tn(ze(r,o,o),n);if(Se&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let e=tn(ze(r,o-1,o-1),-1);if(e.top==t.top){let n=tn(ze(r,o,o+1),-1);if(n.top!=t.top)return rn(n,n.left<e.left)}}return t}}if(!t.state.doc.resolve(e).parent.inlineContent){if(o&&(n<0||o==Fe(r))){let t=r.childNodes[o-1];if(1==t.nodeType)return on(t.getBoundingClientRect(),!1)}if(o<Fe(r)){let t=r.childNodes[o];if(1==t.nodeType)return on(t.getBoundingClientRect(),!0)}return on(r.getBoundingClientRect(),n>=0)}if(o&&(n<0||o==Fe(r))){let t=r.childNodes[o-1],e=3==t.nodeType?ze(t,Fe(t)-(i?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return rn(tn(e,1),!1)}if(o<Fe(r)){let t=r.childNodes[o];for(;t.pmViewDesc&&t.pmViewDesc.ignoreForCoords;)t=t.nextSibling;let e=t?3==t.nodeType?ze(t,0,i?0:1):1==t.nodeType?t:null:null;if(e)return rn(tn(e,-1),!0)}return rn(tn(3==r.nodeType?ze(r):r,-n),n>=0)}function rn(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function on(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function sn(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}const an=/[\u0590-\u08ac]/;let ln=null,cn=null,un=!1;class dn{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){let n,r;if(t==this.contentDOM)n=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(t==this.contentDOM)n=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;n=t.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>_e(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let t=e;t;t=t.parent)if(t==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<o)return r.descAt(t-n-r.border);n=o}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,o=0;for(let e=0;r<this.children.length;r++){let n=this.children[r],i=e+n.size;if(i>t||n instanceof yn){o=t-e;break}e=i}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof pn&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;t=r?this.children[r-1]:null,t&&t.dom.parentNode!=this.contentDOM;r--,n=!1);return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?_e(t.dom)+1:0}}{let t,n=!0;for(;t=r<this.children.length?this.children[r]:null,t&&t.dom.parentNode!=this.contentDOM;r++,n=!1);return t&&n&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?_e(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,n=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&t<=a){let o=i+n.border;if(t>=o&&e<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,o);t=i;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=_e(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;t<this.children.length;t++){let n=this.children[t];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=_e(n.dom);break}e+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(1!=e.nodeType||n==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n,r=!1){let o=Math.min(t,e),i=Math.max(t,e);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(t-a-l.border,e-a-l.border,n,r);a=c}let s=this.domFromPos(t,t?-1:1),a=e==t?s:this.domFromPos(e,e?-1:1),l=n.getSelection(),c=!1;if((Se||Ce)&&t==e){let{node:t,offset:e}=s;if(3==t.nodeType){if(c=!(!e||"\n"!=t.nodeValue[e-1]),c&&e==t.nodeValue.length)for(let e,n=t;n;n=n.parentNode){if(e=n.nextSibling){"BR"==e.nodeName&&(s=a={node:e.parentNode,offset:_e(e)+1});break}let t=n.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let n=t.childNodes[e-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Se&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let t=l.focusNode.childNodes[l.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||c&&Ce)&&Le(s.node,s.offset,l.anchorNode,l.anchorOffset)&&Le(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||t==e)&&!c){l.collapse(s.node,s.offset);try{t!=e&&l.extend(a.node,a.offset),u=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!u){if(t>e){let t=s;s=a,a=t}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){let r=n+o.border,s=i-o.border;if(t>=r&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=r||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-r,e-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class pn extends dn{constructor(t,e,n,r){let o,i=e.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class hn extends dn{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class fn extends dn{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let o=r.nodeViews[e.type.name],i=o&&o(e,r,n);return i&&i.dom||(i=ct.renderSpec(document,e.type.spec.toDOM(e,n))),new fn(t,e,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=0}}slice(t,e,n){let r=fn.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;e<i&&(o=Dn(o,e,i,n)),t>0&&(o=Dn(o,0,t,n));for(let t=0;t<o.length;t++)o[t].parent=r;return r.children=o,r}}class mn extends dn{constructor(t,e,n,r,o,i,s,a,l){super(t,[],o,i),this.node=e,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,i&&this.updateChildren(a,l)}static create(t,e,n,r,o,i){let s,a=o.nodeViews[e.type.name],l=a&&a(e,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else c||({dom:c,contentDOM:u}=ct.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let d=c;return c=Cn(c,n,e),l?s=new bn(t,e,n,r,c,u||null,d,l,o,i+1):e.isText?new gn(t,e,n,r,c,d,o):new mn(t,e,n,r,c,u||null,d,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>c.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&Mn(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,o=t.composing?this.localCompositionInfo(t,e):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new An(this,i&&i.node);!function(t,e,n,r){let o=e.locals(t),i=0;if(0==o.length){for(let n=0;n<t.childCount;n++){let s=t.child(n);r(s,o,e.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<o.length&&o[s].to==i){let t,e=o[s++];for(;s<o.length&&o[s].to==i;)(t||(t=[e])).push(o[s++]);if(t){t.sort(Nn);for(let e=0;e<t.length;e++)n(t[e],c,!!l)}else n(e,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<t.childCount))break;d=c,u=t.child(c++)}for(let t=0;t<a.length;t++)a[t].to<=i&&a.splice(t--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+u.nodeSize;if(u.isText){let t=p;s<o.length&&o[s].from<t&&(t=o[s].from);for(let e=0;e<a.length;e++)a[e].to<t&&(t=a[e].to);t<p&&(l=u.cut(t-i),u=u.cut(0,t-i),p=t,d=-1)}r(u,u.isInline&&!u.isLeaf?a.filter((t=>!t.inline)):a.slice(),e.forChild(i,u),d),i=p}}(this.node,this.innerDeco,((e,o,i)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?h.none:this.node.child(o).marks,n,t),a.placeWidget(e,t,r)}),((e,i,l,c)=>{let u;a.syncToMarks(e.marks,n,t),a.findNodeMatch(e,i,l,c)||s&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(u=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(e,i,l,u,t)||a.updateNextNode(e,i,l,t,c)||a.addNode(e,i,l,t,r),r+=e.nodeSize})),a.syncToMarks([],n,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),wn(this.contentDOM,this.children,t),Me&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof Jt)||n<e||r>e+this.node.content.size)return null;let o=t.domSelection(),i=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Fe(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(o.focusNode,o.focusOffset);if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let t=i.nodeValue,o=function(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let e=t.child(o++);if(i+=e.nodeSize,!e.isText)break;l+=e.text}if(i>=n){let t=a<r?l.lastIndexOf(e,r-a-1):-1;if(t>=0&&t+e.length+a>=n)return a+t;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let o=e;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new hn(this,o,e,r);t.input.compositionNodes.push(i),this.children=Dn(this.children,n,n+r.length,t,i)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node)||(this.updateInner(t,e,n,r),0))}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(Mn(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=kn(this.dom,this.nodeDOM,On(this.outerDeco,this.node,e),On(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function vn(t,e,n,r,o){return Cn(r,e,t),new mn(void 0,t,e,n,r,r,r,o,0)}class gn extends mn{constructor(t,e,n,r,o,i,s){super(t,e,n,r,o,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node)||(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,0))}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),o=document.createTextNode(r.text);return new gn(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class yn extends dn{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class bn extends mn{constructor(t,e,n,r,o,i,s,a,l,c){super(t,e,n,r,o,i,s,l,c),this.spec=a}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(t,e,n);return o&&this.updateInner(t,e,n,r),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function wn(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=Tn(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof fn){let e=r?r.previousSibling:t.lastChild;wn(s.contentDOM,s.children,n),r=e?e.nextSibling:t.firstChild}}for(;r;)r=Tn(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const xn=function(t){t&&(this.nodeName=t)};xn.prototype=Object.create(null);const Sn=[new xn];function On(t,e,n){if(0==t.length)return Sn;let r=n?Sn[0]:new xn,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new xn(s.nodeName));for(let t in s){let i=s[t];null!=i&&(n&&1==o.length&&o.push(r=new xn(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+i:"style"==t?r.style=(r.style?r.style+";":"")+i:"nodeName"!=t&&(r[t]=i))}}}return o}function kn(t,e,n,r){if(n==Sn&&r==Sn)return e;let o=e;for(let e=0;e<r.length;e++){let i=r[e],s=n[e];if(e){let e;s&&s.nodeName==i.nodeName&&o!=t&&(e=o.parentNode)&&e.nodeName.toLowerCase()==i.nodeName||(e=document.createElement(i.nodeName),e.pmIsDeco=!0,e.appendChild(o),s=Sn[0]),o=e}En(o,s||Sn[0],i)}return o}function En(t,e,n){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==o.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<o.length;e++)-1==r.indexOf(o[e])&&t.classList.add(o[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(e.style);)t.style.removeProperty(n[1])}n.style&&(t.style.cssText+=n.style)}}function Cn(t,e,n){return kn(t,t,Sn,On(e,n,1!=t.nodeType))}function Mn(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Tn(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class An{constructor(t,e){this.lock=e,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];t:for(;o>0;){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof fn)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n){let r=0,o=this.stack.length>>1,i=Math.min(o,t.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let e=this.index;e<Math.min(this.index+3,this.top.children.length);e++)if(this.top.children[e].matchesMark(t[o])){r=e;break}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=fn.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(t,e,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(t,e,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,n,r,o){for(let i=this.index;i<this.top.children.length;i++){let s=this.top.children[i];if(s instanceof mn){let a=this.preMatch.matched.get(s);if(null!=a&&a!=o)return!1;let l=s.dom;if((!this.lock||!(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))||t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&Mn(e,s.outerDeco))&&s.update(t,e,n,r))return this.destroyBetween(this.index,i),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(t,e,n,r,o){this.top.children.splice(this.index++,0,mn.create(this.top,t,e,n,r,o)),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new pn(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof fn;)e=t,t=e.children[e.children.length-1];t&&t instanceof gn&&!/\n$/.test(t.node.text)||((Ce||ke)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");let r=new yn(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}}function Nn(t,e){return t.type.side-e.type.side}function Dn(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function _n(t,e=null){let n=t.domSelection(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Ve(n)){for(a=c;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Xt.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==Fe(t);r||o;){if(t==n)return!0;let e=_e(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==Fe(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new Xt(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}return l||(l=Vn(t,a,c,"pointer"==e||t.state.selection.head<c.pos&&!i?1:-1)),l}function Rn(t){return t.editable?t.hasFocus():Hn(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function In(t,e=!1){let n=t.state.selection;if(Fn(t,n),Rn(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ke){let e=t.domSelection(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&Le(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,_e(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&we&&xe<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!zn||n instanceof Jt||(n.$from.parent.inlineContent||(r=Ln(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=Ln(t,n.to))),t.docView.setSelection(i,s,t.root,e),zn&&(r&&Bn(r),o&&Bn(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelection(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Rn(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const zn=Ce||ke&&Ee<63;function Ln(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Ce&&o&&"false"==o.contentEditable)return Pn(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Pn(o);if(i)return Pn(i)}}function Pn(t){return t.contentEditable="true",Ce&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Bn(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Fn(t,e){if(e instanceof Xt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(jn(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else jn(t)}function jn(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Vn(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||Jt.between(e,n,r)}function $n(t){return(!t.editable||t.root.activeElement==t.dom)&&Hn(t)}function Hn(t){let e=t.domSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Wn(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&qt.findFrom(i,e)}function qn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Un(t,e,n){let r=t.state.selection;if(!(r instanceof Jt)){if(r instanceof Xt&&r.node.isInline)return qn(t,new Jt(e>0?r.$to:r.$from));{let n=Wn(t.state,e);return!!n&&qn(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=Wn(t.state,e);return!!(n&&n instanceof Xt)&&qn(t,n)}if(!(Te&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Xt.isSelectable(i)?qn(t,new Xt(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Ne&&qn(t,new Jt(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Gn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Kn(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Jn(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(Se&&1==n.nodeType&&r<Gn(n)&&Kn(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Kn(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Xn(n))break;{let e=n.previousSibling;for(;e&&Kn(e);)o=n.parentNode,i=_e(e),e=e.previousSibling;if(e)n=e,r=Gn(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Yn(t,e,n,r):o&&Yn(t,e,o,i)}function Zn(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Gn(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Kn(n.childNodes[r]))break;o=n,i=++r}else{if(Xn(n))break;{let e=n.nextSibling;for(;e&&Kn(e);)o=e.parentNode,i=_e(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Gn(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Yn(t,e,o,i)}function Xn(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Yn(t,e,n,r){if(Ve(e)){let t=document.createRange();t.setEnd(n,r),t.setStart(n,r),e.removeAllRanges(),e.addRange(t)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&In(t)}),50)}function Qn(t,e,n){let r=t.state.selection;if(r instanceof Jt&&!r.empty||n.indexOf("s")>-1)return!1;if(Te&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Wn(t.state,e);if(n&&n instanceof Xt)return qn(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Qt?qt.near(n,e):qt.findFrom(n,e);return!!s&&qn(t,s)}return!1}function tr(t,e){if(!(t.state.selection instanceof Jt))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function er(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function nr(t,e){let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||ct.fromSchema(t.state.schema),a=pr(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=ur[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(t=>t(e)))||e.content.textBetween(0,e.content.size,"\n\n")}}function rr(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let l=e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",(t=>{e=t(e,a||r)})),a)return e?new m(c.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):m.empty;let n=t.someProp("clipboardTextParser",(t=>t(e,o,r)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=ct.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(t=>{n=t(n)})),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=pr().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);if((n=o&&ur[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join("")),r.innerHTML=t,n)for(let t=0;t<n.length;t++)r=r.querySelector(n[t])||r;return r}(n),Ne&&function(t){let e=t.querySelectorAll(ke?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let u=i&&i.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let t=+d[3];t>0&&i.firstChild;t--)i=i.firstChild;if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Q.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!l&&!d),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||or.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(d)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;o=c.from(e.create(n[t+1],o)),i++,s++}return new m(o,i,s)}(cr(s,+d[1],+d[2]),d[4]);else if(s=m.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&sr(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=ar(i[i.length-1],r.length));let e=ir(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return c.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=cr(s,t,e)}return t.someProp("transformPasted",(t=>{s=t(s)})),s}const or=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ir(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,c.from(t));return t}function sr(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=sr(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(c.from(ir(n,t,o+1))))}}function ar(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,ar(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(c.empty,!0);return t.copy(n.append(r))}function lr(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return o<r-1&&(a=lr(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(c.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function cr(t,e,n){return e<t.openStart&&(t=new m(lr(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new m(lr(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const ur={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let dr=null;function pr(){return dr||(dr=document.implementation.createHTMLDocument("title"))}const hr={};let fr={};class mr{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function vr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function gr(t){t.someProp("handleDOMEvents",(e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>yr(t,e))}))}function yr(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function br(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function wr(t){return{left:t.clientX,top:t.clientY}}function xr(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,(e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function Sr(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Or(t,e,n,r){return xr(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function kr(t,e,n,r){return xr(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(Sr(t,Jt.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(n.inlineContent)Sr(t,Jt.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Xt.isSelectable(n))continue;Sr(t,Xt.create(r,i),"pointer")}return!0}}(t,n,r)}function Er(t){return _r(t)}fr.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Tr(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Ae||!ke||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Me||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||function(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Te&&72==n&&"c"==r?tr(t,-1)||Jn(t):46==n||Te&&68==n&&"c"==r?tr(t,1)||Zn(t):13==n||27==n||(37==n||Te&&66==n&&"c"==r?Un(t,-1,r)||Jn(t):39==n||Te&&70==n&&"c"==r?Un(t,1,r)||Zn(t):38==n||Te&&80==n&&"c"==r?Qn(t,-1,r)||Jn(t):40==n||Te&&78==n&&"c"==r?function(t){if(!Ce||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelection();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;er(t,n,"true"),setTimeout((()=>er(t,n,"false")),20)}return!1}(t)||Qn(t,1,r)||Zn(t):r==(Te?"m":"c")&&(66==n||73==n||89==n||90==n))}(t,n)?n.preventDefault():vr(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,$e(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},fr.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},fr.keypress=(t,e)=>{let n=e;if(Tr(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Te&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Jt&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const Cr=Te?"metaKey":"ctrlKey";hr.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Er(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[Cr]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(wr(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Mr(t,s,n,!!r)):("doubleClick"==i?Or:kr)(t,s.pos,s.inside,n)?n.preventDefault():vr(t,"pointer"))};class Mr{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[Cr],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Xt&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Se||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),vr(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>In(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(wr(t))),this.allowDefault||!e?vr(this.view,"pointer"):function(t,e,n,r,o){return xr(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Xt&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(Xt.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(Sr(t,Xt.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Xt.isSelectable(r))&&(Sr(t,new Xt(n),"pointer"),!0)}(t,n))}(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Ce&&this.mightDrag&&!this.mightDrag.node.isAtom||ke&&!(this.view.state.selection instanceof Jt)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Sr(this.view,qt.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):vr(this.view,"pointer")}move(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),vr(this.view,"pointer"),0==t.buttons&&this.done()}}function Tr(t,e){return!!t.composing||!!(Ce&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}hr.touchdown=t=>{Er(t),vr(t,"pointer")},hr.contextmenu=t=>Er(t);const Ar=Ae?5e3:-1;function Nr(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>_r(t)),e))}function Dr(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function _r(t,e=!1){if(!(Ae&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Dr(t),e||t.docView&&t.docView.dirty){let e=_n(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}fr.compositionstart=fr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),_r(t,!0),t.markCursor=null;else if(_r(t),Se&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelection();for(let t=e.focusNode,n=e.focusOffset;t&&1==t.nodeType&&0!=n;){let r=n<0?t.lastChild:t.childNodes[n-1];if(!r)break;if(3==r.nodeType){e.collapse(r,r.nodeValue.length);break}t=r,n=-1}}t.input.composing=!0}Nr(t,Ar)},fr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,Nr(t,20))};const Rr=we&&xe<15||Me&&De<604;function Ir(t,e,n,r){let o=rr(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||m.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}hr.copy=fr.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Rr?null:n.clipboardData,s=r.content(),{dom:a,text:l}=nr(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},fr.paste=(t,e)=>{let n=e;if(t.composing&&!Ae)return;let r=Rr?null:n.clipboardData;r&&Ir(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ir(t,r.value,null,e):Ir(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class zr{constructor(t,e){this.slice=t,this.move=e}}const Lr=Te?"altKey":"ctrlKey";hr.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(wr(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Xt?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Xt.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Xt.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=nr(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Rr?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Rr||n.dataTransfer.setData("text/plain",l),t.dragging=new zr(s,!n[Lr])},hr.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},fr.dragover=fr.dragenter=(t,e)=>e.preventDefault(),fr.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(wr(n));if(!o)return;let i=t.state.doc.resolve(o.pos);if(!i)return;let s=r&&r.slice;s?t.someProp("transformPasted",(t=>{s=t(s)})):s=rr(t,n.dataTransfer.getData(Rr?"Text":"text/plain"),Rr?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Lr]);if(t.someProp("handleDrop",(e=>e(t,n,s||m.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}(t.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let h=c.doc.resolve(u);if(d&&Xt.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Xt(h));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),c.setSelection(Vn(t,h,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},hr.focus=t=>{t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelection())&&In(t)}),20))},hr.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},hr.beforeinput=(t,e)=>{if(ke&&Ae&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,$e(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in fr)hr[t]=fr[t];function Pr(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Br{constructor(t,e){this.toDOM=t,this.spec=e||Hr,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new Vr(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Br&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Pr(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Fr{constructor(t,e){this.attrs=t,this.spec=e||Hr}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Vr(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Fr&&Pr(this.attrs,t.attrs)&&Pr(this.spec,t.spec)}static is(t){return t.type instanceof Fr}destroy(){}}class jr{constructor(t,e){this.attrs=t,this.spec=e||Hr}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Vr(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof jr&&Pr(this.attrs,t.attrs)&&Pr(this.spec,t.spec)}destroy(){}}class Vr{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new Vr(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new Vr(t,t,new Br(e,n))}static inline(t,e,n,r){return new Vr(t,e,new Fr(n,r))}static node(t,e,n,r){return new Vr(t,e,new jr(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fr}}const $r=[],Hr={};class Wr{constructor(t,e){this.local=t.length?t:$r,this.children=e.length?e:$r}static create(t,e){return e.length?Zr(e,t,0,Hr):qr}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==qr||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Hr)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice(),l=(t,e,n,r)=>{for(let s=0;s<a.length;s+=3){let l,c=a[s+1];if(c<0||t>c+i)continue;let u=a[s]+i;e>=u?a[s+1]=t<=u?-2:-1:n>=o&&(l=r-n-(e-t))&&(a[s]+=l,a[s+1]+=l)}};for(let t=0;t<n.maps.length;t++)n.maps[t].forEach(l);let c=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){c=!0,a[e+1]=-1;continue}let l=n.map(t[e]+i),u=l-o;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(t[e+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(u),f=r.maybeChild(p);if(f&&h==u&&h+f.nodeSize==d){let r=a[e+2].mapInner(n,f,l+1,t[e]+i+1,s);r!=qr?(a[e]=u,a[e+1]=d,a[e+2]=r):(a[e+1]=-2,c=!0)}else c=!0}if(c){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),c=Zr(l,r,0,s);e=c.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<c.children.length;t+=3){let n=c.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,c.children[t],c.children[t+1],c.children[t+2])}}return new Wr(e.sort(Xr),a)}(this.children,i||[],t,e,n,r,o):i?new Wr(i.sort(Xr),$r):qr}add(t,e){return e.length?this==qr?Wr.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=Kr(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,Zr(s,t,a+1,Hr)),o+=3}}));let i=Gr(o?Jr(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new Wr(i.length?this.local.concat(i).sort(Xr):this.local,r||this.children)}remove(t){return 0==t.length||this==qr?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=qr?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Wr(r,n):qr}forChild(t,e){if(this==qr)return this;if(e.isLeaf)return Wr.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof Fr){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new Wr(r.sort(Xr),$r);return n?new Ur([t,n]):t}return n||qr}eq(t){if(this==t)return!0;if(!(t instanceof Wr)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Yr(this.localsInner(t))}localsInner(t){if(this==qr)return $r;if(t.inlineContent||!this.local.some(Fr.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Fr||e.push(this.local[t]);return e}}Wr.empty=new Wr([],[]),Wr.removeOverlap=Yr;const qr=Wr.empty;class Ur{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,Hr)));return Ur.from(n)}forChild(t,e){if(e.isLeaf)return Wr.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=qr&&(o instanceof Ur?n=n.concat(o.members):n.push(o))}return Ur.from(n)}eq(t){if(!(t instanceof Ur)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?Yr(n?e:e.sort(Xr)):$r}static from(t){switch(t.length){case 0:return qr;case 1:return t[0];default:return new Ur(t)}}}function Gr(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Vr(o.from+e,o.to+e,o.type))}return n}function Kr(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function Jr(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Zr(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Kr(t,e,s+n);if(a){i=!0;let t=Zr(a,e,n+s+1,r);t!=qr&&o.push(s,s+e.nodeSize,t)}}));let s=Gr(i?Jr(t):t,-n).sort(Xr);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new Wr(s,o):qr}function Xr(t,e){return t.from-e.from||t.to-e.to}function Yr(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Qr(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Qr(e,o+1,i.copy(r.to,i.to)))}}return e}function Qr(t,e,n){for(;e<t.length&&Xr(n,t[e])>0;)e++;t.splice(e,0,n)}function to(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=qr&&e.push(r)})),t.cursorWrapper&&e.push(Wr.create(t.state.doc,[t.cursorWrapper.deco])),Ur.from(e)}const eo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},no=we&&xe<=11;class ro{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class oo{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ro,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);we&&xe<=11&&t.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),no&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,eo),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if($n(this.view)){if(this.suppressingSelectionUpdates)return In(this.view);if(we&&xe<=11&&!this.view.state.selection.empty){let t=this.view.domSelection();if(t.focusNode&&Le(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(t){if(0==t.rangeCount)return!0;let e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let e=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&$n(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(r=r<0?n.from:Math.min(n.from,r),o=o<0?n.to:Math.max(n.to,o),n.typeOver&&(i=!0))}if(Se&&s.length>1){let t=s.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}var a;(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),a=this.view,io||(io=!0,"normal"==getComputedStyle(a.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."))),this.handleDOMChange(r,o,i,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||In(this.view),this.currentSelection.set(e))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;n<t.addedNodes.length;n++)e.push(t.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,o=t.nextSibling;if(we&&xe<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:n,nextSibling:i}=t.addedNodes[e];(!n||Array.prototype.indexOf.call(t.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(t.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==t.target?_e(r)+1:0,s=n.localPosFromDOM(t.target,i,-1),a=o&&o.parentNode==t.target?_e(o):t.target.childNodes.length;return{from:s,to:n.localPosFromDOM(t.target,a,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let io=!1;function so(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Ce&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||Ce&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}function ao(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Vn(t,e.resolve(n.anchor),e.resolve(n.head))}function lo(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}class co{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new mr,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(mo),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ho(this),po(this),this.nodeViews=fo(this),this.docView=vn(this.state.doc,uo(this),to(this),this.dom,this),this.domObserver=new oo(this,((t,e,n,r)=>function(t,e,n,r,o){if(e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=_n(t,e);if(n&&!t.state.selection.eq(n)){let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),t.dispatch(r)}return}let i=t.state.doc.resolve(e),s=i.sharedDepth(n);e=i.before(s+1),n=t.state.doc.resolve(n).after(s+1);let a=t.state.selection,l=function(t,e,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),c=t.domSelection(),u=c.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],Ve(c)||r.push({node:c.focusNode,offset:c.focusOffset})),ke&&8===t.input.lastKeyCode)for(let t=s;t>i;t--){let e=o.childNodes[t-1],n=e.pmViewDesc;if("BR"==e.nodeName&&!n){s=t;break}if(!n||n.size)break}let d=t.state.doc,p=t.someProp("domParser")||Q.fromSchema(t.state.schema),h=d.resolve(a),f=null,m=p.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:so,context:h});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),f={anchor:t+a,head:e+a}}return{doc:m,sel:f,from:a,to:l}}(t,e,n);if(ke&&t.cursorWrapper&&l.sel&&l.sel.anchor==t.cursorWrapper.deco.from){let e=t.cursorWrapper.deco.type.toDOM.nextSibling,n=e&&e.nodeValue?e.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let u,d,p=t.state.doc,h=p.slice(l.from,l.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(u=t.state.selection.to,d="end"):(u=t.state.selection.from,d="start"),t.input.lastKeyCode=null;let f=function(t,e,n,r,o){let i=t.findDiffStart(e,n);if(null==i)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);return"end"==o&&(r-=s+Math.max(0,i-Math.min(s,a))-i),s<i&&t.size<e.size?(i-=r<=i&&r>=s?i-r:0,a=i+(a-s),s=i):a<i&&(i-=r<=i&&r>=a?i-r:0,s=i+(s-a),a=i),{start:i,endA:s,endB:a}}(h.content,l.doc.content,l.from,u,d);if((Me&&t.input.lastIOSEnter>Date.now()-225||Ae)&&o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",(e=>e(t,$e(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!f){if(!(r&&a instanceof Jt&&!a.empty&&a.$head.sameParent(a.$anchor))||t.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let e=ao(t,t.state.doc,l.sel);e&&!e.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(e))}return}f={start:a.from,endA:a.to,endB:a.to}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&f.start==f.endB&&t.state.selection instanceof Jt&&(f.start>t.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=l.from?f.start=t.state.selection.from:f.endA<t.state.selection.to&&f.endA>=t.state.selection.to-2&&t.state.selection.to<=l.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),we&&xe<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>l.from&&" "==l.doc.textBetween(f.start-l.from-1,f.start-l.from+1)&&(f.start--,f.endA--,f.endB--);let m,v=l.doc.resolveNoCache(f.start-l.from),g=l.doc.resolveNoCache(f.endB-l.from),y=p.resolve(f.start),b=v.sameParent(g)&&v.parent.inlineContent&&y.end()>=f.endA;if((Me&&t.input.lastIOSEnter>Date.now()-225&&(!b||o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!b&&v.pos<l.doc.content.size&&(m=qt.findFrom(l.doc.resolve(v.pos+1),1,!0))&&m.head==g.pos)&&t.someProp("handleKeyDown",(e=>e(t,$e(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>f.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||lo(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(lo(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||lo(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(p,f.start,f.endA,v,g)&&t.someProp("handleKeyDown",(e=>e(t,$e(8,"Backspace")))))return void(Ae&&ke&&t.domObserver.suppressSelectionUpdates());ke&&Ae&&f.endB==f.start&&(t.input.lastAndroidDelete=Date.now()),Ae&&!b&&v.start()!=g.start()&&0==g.parentOffset&&v.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==f.endA&&(f.endB-=2,g=l.doc.resolveNoCache(f.endB-l.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,$e(13,"Enter"))}))}),20));let w,x,S,O=f.start,k=f.endA;if(b)if(v.pos==g.pos)we&&xe<=11&&0==v.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>In(t)),20)),w=t.state.tr.delete(O,k),x=p.resolve(f.start).marksAcross(p.resolve(f.endA));else if(f.endA==f.endB&&(S=function(t,e){let n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,l=s;for(let t=0;t<s.length;t++)a=s[t].removeFromSet(a);for(let t=0;t<i.length;t++)l=i[t].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",o=t=>t.mark(r.addToSet(t.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=t=>t.mark(r.removeFromSet(t.marks))}let u=[];for(let t=0;t<e.childCount;t++)u.push(o(e.child(t)));if(c.from(u).eq(t))return{mark:r,type:n}}(v.parent.content.cut(v.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start()))))w=t.state.tr,"add"==S.type?w.addMark(O,k,S.mark):w.removeMark(O,k,S.mark);else if(v.parent.child(v.index()).isText&&v.index()==g.index()-(g.textOffset?0:1)){let e=v.parent.textBetween(v.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",(n=>n(t,O,k,e))))return;w=t.state.tr.insertText(e,O,k)}if(w||(w=t.state.tr.replace(O,k,l.doc.slice(f.start-l.from,f.endB-l.from))),l.sel){let e=ao(t,w.doc,l.sel);e&&!(ke&&Ae&&t.composing&&e.empty&&(f.start!=f.endB||t.input.lastAndroidDelete<Date.now()-100)&&(e.head==O||e.head==w.mapping.map(k)-1)||we&&e.empty&&e.head==O)&&w.setSelection(e)}x&&w.ensureMarks(x),t.dispatch(w.scrollIntoView())}(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in hr){let n=hr[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!br(t,e)||yr(t,e)||!t.editable&&e.type in fr||n(t,e)})}Ce&&t.dom.addEventListener("input",(()=>null)),gr(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&gr(this),this._props=t,t.plugins&&(t.plugins.forEach(mo),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)}setProps(t){let e={};for(let t in this._props)e[t]=this._props[t];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this.state.plugins!=t.plugins)}updateStateInner(t,e){let n=this.state,r=!1,o=!1;if(t.storedMarks&&this.composing&&(Dr(this),o=!0),this.state=t,e){let t=fo(this);(function(t,e){let n=0,r=0;for(let r in t){if(t[r]!=e[r])return!0;n++}for(let t in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,r=!0),gr(this)}this.editable=ho(this),po(this);let i=to(this),s=uo(this),a=e?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(t.doc,s,i);!l&&t.selection.eq(n.selection)||(o=!0);let c="preserve"==a&&o&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=t.root.elementFromPoint(i,s);if(!r||r==t.dom||!t.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:Ge(t.dom)}}(this);if(o){this.domObserver.stop();let e=l&&(we||ke)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(l){let n=ke?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(t.doc,s,i,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=vn(t.doc,s,i,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelection();return Le(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?In(this,e):(Fn(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(t.selection instanceof Xt){let n=this.docView.domAfterPos(t.selection.from);1==n.nodeType&&Ue(this,n.getBoundingClientRect(),e)}else Ue(this,this.coordsAtPos(t.selection.head,1),e)}else c&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Ke(n,0==r?0:r-e)}(c)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[t];if(null!=o&&(n=e?e(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[t];if(null!=i&&(n=e?e(i):i))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Je)return t.focus(Je);let e=Ge(t);t.focus(null==Je?{get preventScroll(){return Je={preventScroll:!0},!0}}:void 0),Je||(Je=!1,Ke(e,0))}(this.dom),In(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return t||document}posAtCoords(t){return Qe(this,t)}coordsAtPos(t,e=1){return nn(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return function(t,e,n){return ln==e&&cn==n?un:(ln=e,cn=n,un="up"==n||"down"==n?function(t,e,n){let r=e.selection,o="up"==n?r.$from:r.$to;return sn(t,e,(()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.dom;break}e=n.dom.parentNode}let r=nn(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=ze(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let o=e[t];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return an.test(r.parent.textContent)&&a.modify?sn(t,e,(()=>{let e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?i:s}(t,e,n))}(this,e||this.state,t)}destroy(){this.docView&&(function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],to(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){yr(t,e)||!hr[e.type]||!t.editable&&e.type in fr||hr[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelection(){return this.root.getSelection()}}function uo(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t&&(e.class+=" "+n[t]),"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),[Vr.node(0,t.state.doc.content.size,e)]}function po(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Vr.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ho(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function fo(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function mo(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var vo={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:"'",229:"q"},go={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},yo="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),bo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),wo="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),xo="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),So="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Oo=yo&&(xo||+yo[1]<57)||wo&&xo,ko=0;ko<10;ko++)vo[48+ko]=vo[96+ko]=String(ko);for(ko=1;ko<=24;ko++)vo[ko+111]="F"+ko;for(ko=65;ko<=90;ko++)vo[ko]=String.fromCharCode(ko+32),go[ko]=String.fromCharCode(ko);for(var Eo in vo)go.hasOwnProperty(Eo)||(go[Eo]=vo[Eo]);const Co="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Mo(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Co?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function To(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function Ao(t){let e=function(t){let e=Object.create(null);for(let n in t)e[Mo(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(Oo&&(t.ctrlKey||t.altKey||t.metaKey)||(bo||So)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?go:vo)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[To(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=vo[n.keyCode])&&r!=o){let o=e[To(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[To(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}const No=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),Do=(t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;let o=Io(r);if(!o){let n=r.blockRange(),o=n&&Mt(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&Ho(t,o,e))return!0;if(0==r.parent.content.size&&(_o(i,"end")||Xt.isSelectable(i))){let n=_t(t.doc,r.before(),r.after(),m.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(_o(i,"end")?qt.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Xt.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))};function _o(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)return!1}return!1}const Ro=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Io(r)}let s=i&&i.nodeBefore;return!(!s||!Xt.isSelectable(s)||(e&&e(t.tr.setSelection(Xt.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))};function Io(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}const zo=(t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;let o=Po(r);if(!o)return!1;let i=o.nodeAfter;if(Ho(t,o,e))return!0;if(0==r.parent.content.size&&(_o(i,"start")||Xt.isSelectable(i))){let n=_t(t.doc,r.before(),r.after(),m.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(_o(i,"start")?qt.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Xt.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))},Lo=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Po(r)}let s=i&&i.nodeAfter;return!(!s||!Xt.isSelectable(s)||(e&&e(t.tr.setSelection(Xt.create(t.doc,i.pos)).scrollIntoView()),0))};function Po(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Bo=(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 Fo(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const jo=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Fo(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(qt.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0},Vo=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Qt||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Fo(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(Jt.create(s.doc,n+1)),e(s.scrollIntoView())}return!0},$o=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Nt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Mt(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function Ho(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Dt(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=c.empty;for(let t=r.length-1;t>=0;t--)a=c.from(r[t].create(null,a));a=c.from(i.copy(a));let l=t.tr.step(new kt(e.pos-1,o,e.pos,o,new m(a,1,0),r.length,!0)),u=o+2*r.length;Dt(l.doc,u)&&l.join(u),n(l.scrollIntoView())}return!0}let l=qt.findFrom(e,1),u=l&&l.$from.blockRange(l.$to),d=u&&Mt(u);if(null!=d&&d>=e.depth)return n&&n(t.tr.lift(u,d).scrollIntoView()),!0;if(a&&_o(s,"start",!0)&&_o(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=c.empty;for(let t=o.length-1;t>=0;t--)r=c.from(o[t].copy(r));n(t.tr.step(new kt(e.pos-o.length,e.pos+s.nodeSize,e.pos+l,e.pos+s.nodeSize-l,new m(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Wo(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Jt.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const qo=Wo(-1),Uo=Wo(1);function Go(t,e=null){return function(n,r){let{from:o,to:i}=n.selection,s=!1;return n.doc.nodesBetween(o,i,((r,o)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)s=!0;else{let e=n.doc.resolve(o),r=e.index();s=e.parent.canReplaceWith(r,r+1,t)}})),!!s&&(r&&r(n.tr.setBlockType(o,i,t,e).scrollIntoView()),!0)}}function Ko(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}let Jo=Ko(No,Do,Ro),Zo=Ko(No,zo,Lo);const Xo={Enter:Ko(Bo,Vo,$o,((t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof Xt&&t.selection.node.isBlock)return!(!n.parentOffset||!Nt(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(e){let o=r.parentOffset==r.parent.content.size,i=t.tr;(t.selection instanceof Jt||t.selection instanceof Qt)&&i.deleteSelection();let s=0==n.depth?null:Fo(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=o&&s?[{type:s}]:void 0,l=Nt(i.doc,i.mapping.map(n.pos),1,a);if(a||l||!Nt(i.doc,i.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(i.split(i.mapping.map(n.pos),1,a),!o&&!n.parentOffset&&n.parent.type!=s)){let t=i.mapping.map(n.before()),e=i.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&i.setNodeMarkup(i.mapping.map(n.before()),s)}e(i.scrollIntoView())}return!0})),"Mod-Enter":jo,Backspace:Jo,"Mod-Backspace":Jo,"Shift-Backspace":Jo,Delete:Zo,"Mod-Delete":Zo,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new Qt(t.doc))),!0)},Yo={"Ctrl-h":Xo.Backspace,"Alt-Backspace":Xo["Mod-Backspace"],"Ctrl-d":Xo.Delete,"Ctrl-Alt-Backspace":Xo["Mod-Delete"],"Alt-Delete":Xo["Mod-Delete"],"Alt-d":Xo["Mod-Delete"],"Ctrl-a":qo,"Ctrl-e":Uo};for(let t in Xo)Yo[t]=Xo[t];function Qo(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class ti{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!t,l=t||o.tr,c={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(l,e),o=n(...t)(r);return s.push(o),c}]))),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((t=>!0===t)))};return c}createCan(t){const{rawCommands:e,state:n}=this,r=void 0,o=t||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...i,dispatch:r})]))),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:r,view:i,state:Qo({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}function ei(t,e,n){return void 0===t.config[e]&&t.parent?ei(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind({...n,parent:t.parent?ei(t.parent,e,n):null}):t.config[e]}function ni(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function ri(t){const e=[],{nodeExtensions:n,markExtensions:r}=ni(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=ei(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});n&&n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:{...i,...r}})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},r=ei(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};r.isRequired&&void 0===r.default&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function oi(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ii(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function si(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>ii(t,e)),{})}function ai(t){return"function"==typeof t}function li(t,e,...n){return ai(t)?e?t.bind(e)(...n):t(...n):t}function ci(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}}),{});return{...r,...o}}}}function ui(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function di(t,e){return e.nodes[t]||e.marks[t]||null}function pi(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function hi(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class fi{constructor(t){this.find=t.find,this.handler=t.handler}}function mi(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let u=!1;const d=((t,e=500)=>{let n="";return t.parent.nodesBetween(Math.max(0,t.parentOffset-e),t.parentOffset,((e,r,o,i)=>{var s,a,l;n+=(null===(a=(s=e.type.spec).toText)||void 0===a?void 0:a.call(s,{node:e,pos:r,parent:o,index:i}))||(null===(l=t.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n})(c)+i;return s.forEach((t=>{if(u)return;const e=((t,e)=>{if(hi(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[];return r.push(n.text),r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(d,t.find);if(!e)return;const s=l.state.tr,c=Qo({state:l.state,transaction:s}),p={from:r-(e[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new ti({editor:n,state:c});null!==t.handler({state:c,range:p,match:e,commands:h,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function vi(t){const{editor:e,rules:n}=t,r=new ue({state:{init:()=>null,apply:(t,e)=>t.getMeta(r)||(t.selectionSet||t.docChanged?null:e)},props:{handleTextInput:(t,o,i,s)=>mi({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&mi({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&mi({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}function gi(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1;return n.map((t=>new ue({view(t){const e=e=>{var n;r=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:t=>(i=r===t.dom.parentElement,!1),paste:(t,e)=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!i;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),d=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!d||u===d.b)return;const p=s.tr,h=Qo({state:s,transaction:p});return function(t){const{editor:e,state:n,from:r,to:o,rule:i}=t,{commands:s,chain:a,can:l}=new ti({editor:e,state:n}),c=[];return n.doc.nodesBetween(r,o,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const u=Math.max(r,e),d=Math.min(o,e+t.content.size);((t,e)=>{if(hi(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[];return n.push(e.text),n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(u-e,d-e,void 0,""),i.find).forEach((t=>{if(void 0===t.index)return;const e=u+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},d=i.handler({state:n,range:o,match:t,commands:s,chain:a,can:l});c.push(d)}))})),c.every((t=>null!==t))}({editor:e,state:h,from:Math.max(u-1,0),to:d.b,rule:t})&&p.steps.length?p:void 0}})))}class yi{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=yi.resolve(t),this.schema=function(t){var e;const n=ri(t),{nodeExtensions:r,markExtensions:o}=ni(t),i=null===(e=r.find((t=>ei(t,"topNode"))))||void 0===e?void 0:e.name,s=Object.fromEntries(r.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=ui({...t.reduce(((t,n)=>{const r=ei(n,"extendNodeSchema",o);return{...t,...r?r(e):{}}}),{}),content:li(ei(e,"content",o)),marks:li(ei(e,"marks",o)),group:li(ei(e,"group",o)),inline:li(ei(e,"inline",o)),atom:li(ei(e,"atom",o)),selectable:li(ei(e,"selectable",o)),draggable:li(ei(e,"draggable",o)),code:li(ei(e,"code",o)),defining:li(ei(e,"defining",o)),isolating:li(ei(e,"isolating",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=li(ei(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>ci(t,r))));const a=ei(e,"renderHTML",o);a&&(i.toDOM=t=>a({node:t,HTMLAttributes:si(t,r)}));const l=ei(e,"renderText",o);return l&&(i.toText=l),[e.name,i]}))),a=Object.fromEntries(o.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options,storage:e.storage},i=ui({...t.reduce(((t,n)=>{const r=ei(n,"extendMarkSchema",o);return{...t,...r?r(e):{}}}),{}),inclusive:li(ei(e,"inclusive",o)),excludes:li(ei(e,"excludes",o)),group:li(ei(e,"group",o)),spanning:li(ei(e,"spanning",o)),code:li(ei(e,"code",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),s=li(ei(e,"parseHTML",o));s&&(i.parseDOM=s.map((t=>ci(t,r))));const a=ei(e,"renderHTML",o);return a&&(i.toDOM=t=>a({mark:t,HTMLAttributes:si(t,r)})),[e.name,i]})));return new X({topNode:i,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:di(t.name,this.schema)};"mark"===t.type&&(null===(e=li(ei(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name);const r=ei(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=ei(t,"onCreate",n);o&&this.editor.on("create",o);const i=ei(t,"onUpdate",n);i&&this.editor.on("update",i);const s=ei(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=ei(t,"onTransaction",n);a&&this.editor.on("transaction",a);const l=ei(t,"onFocus",n);l&&this.editor.on("focus",l);const c=ei(t,"onBlur",n);c&&this.editor.on("blur",c);const u=ei(t,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(t){const e=yi.sort(yi.flatten(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=ei(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=ei(t,"priority")||100,r=ei(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=ei(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:di(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=yi.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:di(e.name,this.schema)},i=[],s=ei(e,"addKeyboardShortcuts",o);if(s){const e=(a=Object.fromEntries(Object.entries(s()).map((([e,n])=>[e,()=>n({editor:t})]))),new ue({props:{handleKeyDown:Ao(a)}}));i.push(e)}var a;const l=ei(e,"addInputRules",o);pi(e,t.options.enableInputRules)&&l&&n.push(...l());const c=ei(e,"addPasteRules",o);pi(e,t.options.enablePasteRules)&&c&&r.push(...c());const u=ei(e,"addProseMirrorPlugins",o);if(u){const t=u();i.push(...t)}return i})).flat();return[vi({editor:t,rules:n}),...gi({editor:t,rules:r}),...o]}get attributes(){return ri(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ni(this.extensions);return Object.fromEntries(e.filter((t=>!!ei(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:oi(e.name,this.schema)},o=ei(e,"addNodeView",r);return o?[e.name,(r,i,s,a)=>{const l=si(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]:[]})))}}function bi(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function wi(t,e){const n={...t};return bi(t)&&bi(e)&&Object.keys(e).forEach((r=>{bi(e[r])?r in t?n[r]=wi(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class xi{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=li(ei(this,"addOptions",{name:this.name}))),this.storage=li(ei(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new xi(t)}configure(t={}){const e=this.extend();return e.options=wi(this.options,t),e.storage=li(ei(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new xi(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=li(ei(e,"addOptions",{name:e.name})),e.storage=li(ei(e,"addStorage",{name:e.name,options:e.options})),e}}function Si(t,e,n){const{from:r,to:o}=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(r,o,((t,n,c,u)=>{var d;const p=null==s?void 0:s[t.type.name];p?(t.isBlock&&!l&&(a+=i,l=!0),c&&(a+=p({node:t,pos:n,parent:c,index:u,range:e}))):t.isText?(a+=null===(d=null==t?void 0:t.text)||void 0===d?void 0:d.slice(Math.max(r,n)-n,o-n),l=!1):t.isBlock&&!l&&(a+=i,l=!0)})),a}function Oi(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}const ki=xi.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new ue({key:new he("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o;return Si(r,{from:Math.min(...i.map((t=>t.$from.pos))),to:Math.max(...i.map((t=>t.$to.pos)))},{textSerializers:Oi(n)})}}})]}});function Ei(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:hi(e[r])?e[r].test(t[r]):e[r]===t[r]))}function Ci(t,e,n={}){return t.find((t=>t.type===e&&Ei(t.attrs,n)))}function Mi(t,e,n={}){return!!Ci(t,e,n)}function Ti(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=Ci([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Ci([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&Mi([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Ai(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Ni(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!function(t){var e;return"class"===(null===(e=t.constructor)||void 0===e?void 0:e.toString().substring(0,5))}(t)}function Di(t){return Ni(t)&&t instanceof Jt}function _i(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Ri(t,e=null){if(!e)return null;const n=qt.atStart(t),r=qt.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Jt.create(t,_i(0,o,i),_i(t.content.size,o,i)):Jt.create(t,_i(e,o,i),_i(e,o,i))}function Ii(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function zi(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Li(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)?c.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Li("",e,n)}if("string"==typeof t){const r=Q.fromSchema(e);return n.slice?r.parseSlice(zi(t),n.parseOptions).content:r.parse(zi(t),n.parseOptions)}return Li("",e,n)}function Pi(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Bi(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?oi(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const l=o-r,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>Ei(t.node.attrs,n,{strict:!1})));return i?!!c.length:c.reduce(((t,e)=>t+e.to-e.from),0)>=l}function Fi(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ji(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}function Vi(t,e,n={}){return Li(t,e,{slice:!1,parseOptions:n})}function $i(t,e){const n=Ai(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function Hi(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function Wi(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}function qi(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function Ui(t,e){const{nodeExtensions:n}=ni(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=li(ei(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}const Gi=(t,e)=>{const n=qi((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Dt(t.doc,n.pos)||(t.join(n.pos),!0)},Ki=(t,e)=>{const n=qi((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Dt(t.doc,r)||(t.join(r),!0)};function Ji(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Ai(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>Ei(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:e,$to:n})=>{const r=e.pos,o=n.pos;t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);s+=i-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>Ei(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}var Zi=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,((t,n)=>{if(t.type.isText)return;const{doc:r,mapping:o}=e,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+t.nodeSize)),a=i.blockRange(s);if(!a)return;const l=Mt(a);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(a.start,t)}(l||0===l)&&e.lift(a,l)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>Vo(t,e),deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=oi(t,n.schema),i=e.selection.$anchor;for(let t=i.depth;t>0;t-=1)if(i.node(t).type===o){if(r){const n=i.before(t),r=i.after(t);e.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},deleteSelection:()=>({state:t,dispatch:e})=>No(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>jo(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Ai(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const t=Ti(l,i,e);if(t&&t.from<=c&&t.to>=u){const e=Jt.create(s,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Ii()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===t||!1===t)return!0;if(i&&null===t&&!Di(n.state.selection))return s(),!0;const a=Ri(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,r)=>e(t,{...n,index:r}))),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Li(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:t,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,c=!!c&&t.isBlock})),s===a&&c){const{parent:t}=r.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}l?r.insertText(e,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Ot||o instanceof kt))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(qt.near(t.doc.resolve(s),-1))}(r,r.steps.length-1)}return!0},joinBackward:()=>({state:t,dispatch:e})=>Do(t,e),joinForward:()=>({state:t,dispatch:e})=>zo(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Ii()||Pi()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),s=i.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==l||l.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:r})=>!!Bi(n,oi(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Mt(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:t,dispatch:e})=>$o(t,e),liftListItem:t=>({state:e,dispatch:n})=>{return(r=oi(t,e.schema),function(t,e){let{$from:n,$to:o}=t.selection,i=n.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==r));return!!i&&(!e||(n.node(i.depth-1).type==r?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);return i<s&&(o.step(new kt(i-1,s,i,s,new m(c.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new D(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth)),e(o.lift(r,Mt(r)).scrollIntoView()),!0}(t,e,r,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(a?0:1),d+1,s.content.append(l?c.empty:c.from(o))))return!1;let p=i.pos,h=p+s.nodeSize;return r.step(new kt(p-(a?1:0),h+(l?1:0),p+1,h-1,new m((a?c.empty:c.from(o.copy(c.empty))).append(l?c.empty:c.from(o.copy(c.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(t,e,i)))})(e,n);var r},newlineInCode:()=>({state:t,dispatch:e})=>Bo(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Fi("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=oi(t,r.schema)),"mark"===a&&(s=Ai(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,ji(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(ji(o.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>Ro(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>Lo(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(Xt.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>Uo(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>qo(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=Vi(t,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Ai(t,r.schema);if(o)if(s){const t=$i(r,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i);t.marks.find((t=>t.type===l))?t.marks.forEach((t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))})):n.addMark(s,a,l.create(e))}))}));return!0},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=oi(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!Go(i,e)(n)||t.clearNodes())).command((({state:t})=>Go(i,e)(t,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=qt.atStart(n).from,o=qt.atEnd(n).to,i=_i(t,r,o),s=Xt.create(n,i);e.setSelection(s)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=Jt.atStart(n).from,s=Jt.atEnd(n).to,a=_i(r,i,s),l=_i(o,i,s),c=Jt.create(n,a,l);e.setSelection(c)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=oi(t,e.schema);return(o=r,function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(e){let n=l.lastChild&&l.lastChild.type==a.type,r=c.from(n?o.create():null),s=new m(c.from(o.create(null,c.from(a.type.create(null,r)))),n?3:1,0),u=i.start,d=i.end;e(t.tr.step(new kt(u-(n?3:1),d,u,d,s,1,!0)).scrollIntoView())}return!0})(e,n);var o},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=Hi(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Xt&&i.node.isBlock)return!(!a.parentOffset||!Nt(s,a.pos)||(r&&(t&&Wi(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),0));if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof Jt&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,d=Nt(e.doc,e.mapping.map(a.pos),1,u);if(u||d||!Nt(e.doc,e.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(d=!0,u=s?[{type:s,attrs:c}]:void 0),d&&(e.split(e.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&e.setNodeMarkup(e.mapping.map(a.before()),s)}t&&Wi(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=oi(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const d=a.node(-1);if(d.type!==s)return!1;const p=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let t=c.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-n;e>=a.depth-3;e-=1)t=c.from(a.node(e).copy(t));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=Hi(p,a.node().type.name,a.node().attrs),l=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;t=t.append(c.from(s.createAndFill(null,l)||void 0));const u=a.before(a.depth-(n-1));e.replace(u,a.after(-r),new m(t,4-n,0));let d=-1;e.doc.nodesBetween(u,e.doc.content.size,((t,e)=>{if(d>-1)return!1;t.isTextblock&&0===t.content.size&&(d=e+1)})),d>-1&&e.setSelection(Jt.near(e.doc.resolve(d))),e.scrollIntoView()}return!0}const h=l.pos===a.end()?d.contentMatchAt(0).defaultType:null,f=Hi(p,d.type.name,d.attrs),v=Hi(p,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const g=h?[{type:s,attrs:f},{type:h,attrs:v}]:[{type:s,attrs:f}];return!!Nt(e.doc,a.pos,2)&&(r&&e.split(a.pos,2,g).scrollIntoView(),!0)},toggleList:(t,e)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:l})=>{const{extensions:c}=n.extensionManager,u=oi(t,o.schema),d=oi(e,o.schema),{selection:p}=o,{$from:h,$to:f}=p,m=h.blockRange(f);if(!m)return!1;const v=qi((t=>Ui(t.type.name,c)))(p);if(m.depth>=1&&v&&m.depth-v.depth<=1){if(v.node.type===u)return a.liftListItem(d);if(Ui(v.node.type.name,c)&&u.validContent(v.node.content)&&i)return s().command((()=>(r.setNodeMarkup(v.pos,u),!0))).command((()=>Gi(r,u))).command((()=>Ki(r,u))).run()}return s().command((()=>!!l().wrapInList(u)||a.clearNodes())).wrapInList(u).command((()=>Gi(r,u))).command((()=>Ki(r,u))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Ai(t,r.schema);return Ji(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=oi(t,r.schema),s=oi(e,r.schema);return Bi(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=oi(t,n.schema);return Bi(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){const n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Ai(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:t,to:e}=a;const r=null===(i=c.marks().find((t=>t.type===l)))||void 0===i?void 0:i.attrs,o=Ti(c,l,r);o&&(t=o.from,e=o.to),n.removeMark(t,e,l)}else d.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Fi("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=oi(t,r.schema)),"mark"===a&&(s=Ai(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+t.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Tt(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(oi(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);l=new D(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new D(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let u=Tt(l,t,e,s);return!!u&&(r&&r(function(t,e,n,r,o){let i=c.empty;for(let t=n.length-1;t>=0;t--)i=c.from(n[t].type.create(n[t].attrs,i));t.step(new kt(e.start-(r?2:0),e.end,e.start,e.end,new m(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let a=n.length-s,l=e.start+n.length-(r?2:0),u=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&Nt(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(n).nodeSize;return t}(n.tr,s,u,a,t).scrollIntoView()),!0)}}(oi(t,n.schema),e)(n,r)});const Xi=xi.create({name:"commands",addCommands:()=>({...Zi})}),Yi=xi.create({name:"editable",addProseMirrorPlugins(){return[new ue({key:new he("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Qi=xi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ue({key:new he("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),ts=xi.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=qt.atStart(r).from===s;return!(!(o&&l&&a.type.isTextblock)||a.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ii()||Pi()?o:r},addProseMirrorPlugins(){return[new ue({key:new he("clearDocument"),appendTransaction:(t,e,n)=>{if(!t.some((t=>t.docChanged))||e.doc.eq(n.doc))return;const{empty:r,from:o,to:i}=e.selection,s=qt.atStart(e.doc).from,a=qt.atEnd(e.doc).to,l=o===s&&i===a,c=0===n.doc.textBetween(0,n.doc.content.size," "," ").length;if(r||!l||!c)return;const u=n.tr,d=Qo({state:n,transaction:u}),{commands:p}=new ti({editor:this.editor,state:d});return p.clearNodes(),u.steps.length?u:void 0}})]}}),es=xi.create({name:"tabindex",addProseMirrorPlugins(){return[new ue({key:new he("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ns=Object.freeze({__proto__:null,ClipboardTextSerializer:ki,Commands:Xi,Editable:Yi,FocusEvents:Qi,Keymap:ts,Tabindex:es});function rs(t,e,n){const r=t.state.doc.content.size,o=_i(e,0,r),i=_i(n,0,r),s=t.coordsAtPos(o),a=t.coordsAtPos(i,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),u=Math.min(s.left,a.left),d=Math.max(s.right,a.right),p={top:l,bottom:c,left:u,right:d,width:d-u,height:c-l,x:u,y:l};return{...p,toJSON:()=>p}}function is(t){return new fi({find:t.find,handler:({state:e,range:n,match:r})=>{let o=t.replace,i=n.from;const s=n.to;if(r[1]){const t=r[0].lastIndexOf(r[1]);o+=r[0].slice(t+r[1].length),i+=t;const e=i-s;e>0&&(o=r[0].slice(t-e,t)+o,i=s)}e.tr.insertText(o,i,s)}})}class ss{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=li(ei(this,"addOptions",{name:this.name}))),this.storage=li(ei(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ss(t)}configure(t={}){const e=this.extend();return e.options=wi(this.options,t),e.storage=li(ei(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new ss(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=li(ei(e,"addOptions",{name:e.name})),e.storage=li(ei(e,"addStorage",{name:e.name,options:e.options})),e}}class as{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=li(ei(this,"addOptions",{name:this.name}))),this.storage=li(ei(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new as(t)}configure(t={}){const e=this.extend();return e.options=wi(this.options,t),e.storage=li(ei(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new as(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=li(ei(e,"addOptions",{name:e.name})),e.storage=li(ei(e,"addStorage",{name:e.name,options:e.options})),e}}function ls(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function cs(t){return t instanceof ls(t).Element||t instanceof Element}function us(t){return t instanceof ls(t).HTMLElement||t instanceof HTMLElement}function ds(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ls(t).ShadowRoot||t instanceof ShadowRoot)}var ps=Math.max,hs=Math.min,fs=Math.round;function ms(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,o=1;if(us(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(r=fs(n.width)/s||1),i>0&&(o=fs(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function vs(t){var e=ls(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function gs(t){return t?(t.nodeName||"").toLowerCase():null}function ys(t){return((cs(t)?t.ownerDocument:t.document)||window.document).documentElement}function bs(t){return ms(ys(t)).left+vs(t).scrollLeft}function ws(t){return ls(t).getComputedStyle(t)}function xs(t){var e=ws(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Ss(t,e,n){void 0===n&&(n=!1);var r,o,i=us(e),s=us(e)&&function(t){var e=t.getBoundingClientRect(),n=fs(e.width)/t.offsetWidth||1,r=fs(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=ys(e),l=ms(t,s),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==gs(e)||xs(a))&&(c=(r=e)!==ls(r)&&us(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:vs(r)),us(e)?((u=ms(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=bs(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Os(t){var e=ms(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ks(t){return"html"===gs(t)?t:t.assignedSlot||t.parentNode||(ds(t)?t.host:null)||ys(t)}function Es(t){return["html","body","#document"].indexOf(gs(t))>=0?t.ownerDocument.body:us(t)&&xs(t)?t:Es(ks(t))}function Cs(t,e){var n;void 0===e&&(e=[]);var r=Es(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),i=ls(r),s=o?[i].concat(i.visualViewport||[],xs(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(Cs(ks(s)))}function Ms(t){return["table","td","th"].indexOf(gs(t))>=0}function Ts(t){return us(t)&&"fixed"!==ws(t).position?t.offsetParent:null}function As(t){for(var e=ls(t),n=Ts(t);n&&Ms(n)&&"static"===ws(n).position;)n=Ts(n);return n&&("html"===gs(n)||"body"===gs(n)&&"static"===ws(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&us(t)&&"fixed"===ws(t).position)return null;var n=ks(t);for(ds(n)&&(n=n.host);us(n)&&["html","body"].indexOf(gs(n))<0;){var r=ws(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}var Ns="top",Ds="bottom",_s="right",Rs="left",Is="auto",zs=[Ns,Ds,_s,Rs],Ls="start",Ps="end",Bs="viewport",Fs="popper",js=zs.reduce((function(t,e){return t.concat([e+"-"+Ls,e+"-"+Ps])}),[]),Vs=[].concat(zs,[Is]).reduce((function(t,e){return t.concat([e,e+"-"+Ls,e+"-"+Ps])}),[]),$s=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Hs(t){var e=new Map,n=new Set,r=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var r=e.get(t);r&&o(r)}})),r.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),r}var Ws={placement:"bottom",modifiers:[],strategy:"absolute"};function qs(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Us(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,o=e.defaultOptions,i=void 0===o?Ws:o;return function(t,e,n){void 0===n&&(n=i);var o,s,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ws,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var o="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},i,a.options,o),a.scrollParents={reference:cs(t)?Cs(t):t.contextElement?Cs(t.contextElement):[],popper:Cs(e)};var s=function(t){var e=Hs(t);return $s.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}(function(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=s.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var i=o({state:a,name:e,instance:u,options:r});l.push(i||function(){})}})),u.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(qs(e,n)){a.rects={reference:Ss(e,As(n),"fixed"===a.options.strategy),popper:Os(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var o=a.orderedModifiers[r],i=o.fn,s=o.options,l=void 0===s?{}:s,d=o.name;"function"==typeof i&&(a=i({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(t){u.forceUpdate(),t(a)}))},function(){return s||(s=new Promise((function(t){Promise.resolve().then((function(){s=void 0,t(o())}))}))),s}),destroy:function(){d(),c=!0}};if(!qs(t,e))return u;function d(){l.forEach((function(t){return t()})),l=[]}return u.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),u}}var Gs={passive:!0};function Ks(t){return t.split("-")[0]}function Js(t){return t.split("-")[1]}function Zs(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Xs(t){var e,n=t.reference,r=t.element,o=t.placement,i=o?Ks(o):null,s=o?Js(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Ns:e={x:a,y:n.y-r.height};break;case Ds:e={x:a,y:n.y+n.height};break;case _s:e={x:n.x+n.width,y:l};break;case Rs:e={x:n.x-r.width,y:l};break;default:e={x:n.x,y:n.y}}var c=i?Zs(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case Ls:e[c]=e[c]-(n[u]/2-r[u]/2);break;case Ps:e[c]=e[c]+(n[u]/2-r[u]/2)}}return e}var Ys={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qs(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,m=void 0===f?0:f,v="function"==typeof u?u({x:h,y:m}):{x:h,y:m};h=v.x,m=v.y;var g=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=Rs,w=Ns,x=window;if(c){var S=As(n),O="clientHeight",k="clientWidth";S===ls(n)&&"static"!==ws(S=ys(n)).position&&"absolute"===a&&(O="scrollHeight",k="scrollWidth"),(o===Ns||(o===Rs||o===_s)&&i===Ps)&&(w=Ds,m-=(d&&S===x&&x.visualViewport?x.visualViewport.height:S[O])-r.height,m*=l?1:-1),o!==Rs&&(o!==Ns&&o!==Ds||i!==Ps)||(b=_s,h-=(d&&S===x&&x.visualViewport?x.visualViewport.width:S[k])-r.width,h*=l?1:-1)}var E,C=Object.assign({position:a},c&&Ys),M=!0===u?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:fs(e*r)/r||0,y:fs(n*r)/r||0}}({x:h,y:m}):{x:h,y:m};return h=M.x,m=M.y,l?Object.assign({},C,((E={})[w]=y?"0":"",E[b]=g?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",E)):Object.assign({},C,((e={})[w]=y?m+"px":"",e[b]=g?h+"px":"",e.transform="",e))}const ta={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];us(o)&&gs(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});us(r)&&gs(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]},ea={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=void 0===o?[0,0]:o,s=Vs.reduce((function(t,n){return t[n]=function(t,e,n){var r=Ks(t),o=[Rs,Ns].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Rs,_s].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t}),{}),a=s[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}};var na={left:"right",right:"left",bottom:"top",top:"bottom"};function ra(t){return t.replace(/left|right|bottom|top/g,(function(t){return na[t]}))}var oa={start:"end",end:"start"};function ia(t){return t.replace(/start|end/g,(function(t){return oa[t]}))}function sa(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&ds(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function aa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function la(t,e){return e===Bs?aa(function(t){var e=ls(t),n=ys(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+bs(t),y:a}}(t)):cs(e)?function(t){var e=ms(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):aa(function(t){var e,n=ys(t),r=vs(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=ps(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ps(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+bs(t),l=-r.scrollTop;return"rtl"===ws(o||n).direction&&(a+=ps(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}(ys(t)))}function ca(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function ua(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function da(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=void 0===r?t.placement:r,i=n.boundary,s=void 0===i?"clippingParents":i,a=n.rootBoundary,l=void 0===a?Bs:a,c=n.elementContext,u=void 0===c?Fs:c,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=ca("number"!=typeof f?f:ua(f,zs)),v=u===Fs?"reference":Fs,g=t.rects.popper,y=t.elements[p?v:u],b=function(t,e,n){var r="clippingParents"===e?function(t){var e=Cs(ks(t)),n=["absolute","fixed"].indexOf(ws(t).position)>=0&&us(t)?As(t):t;return cs(n)?e.filter((function(t){return cs(t)&&sa(t,n)&&"body"!==gs(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(e,n){var r=la(t,n);return e.top=ps(r.top,e.top),e.right=hs(r.right,e.right),e.bottom=hs(r.bottom,e.bottom),e.left=ps(r.left,e.left),e}),la(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(cs(y)?y:y.contextElement||ys(t.elements.popper),s,l),w=ms(t.elements.reference),x=Xs({reference:w,element:g,strategy:"absolute",placement:o}),S=aa(Object.assign({},g,x)),O=u===Fs?S:w,k={top:b.top-O.top+m.top,bottom:O.bottom-b.bottom+m.bottom,left:b.left-O.left+m.left,right:O.right-b.right+m.right},E=t.modifiersData.offset;if(u===Fs&&E){var C=E[o];Object.keys(k).forEach((function(t){var e=[_s,Ds].indexOf(t)>=0?1:-1,n=[Ns,Ds].indexOf(t)>=0?"y":"x";k[t]+=C[n]*e}))}return k}const pa={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,v=e.options.placement,g=Ks(v),y=l||(g!==v&&f?function(t){if(Ks(t)===Is)return[];var e=ra(t);return[ia(t),e,ia(e)]}(v):[ra(v)]),b=[v].concat(y).reduce((function(t,n){return t.concat(Ks(n)===Is?function(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Vs:l,u=Js(r),d=u?a?js:js.filter((function(t){return Js(t)===u})):zs,p=d.filter((function(t){return c.indexOf(t)>=0}));0===p.length&&(p=d);var h=p.reduce((function(e,n){return e[n]=da(t,{placement:n,boundary:o,rootBoundary:i,padding:s})[Ks(n)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}(e,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=e.rects.reference,x=e.rects.popper,S=new Map,O=!0,k=b[0],E=0;E<b.length;E++){var C=b[E],M=Ks(C),T=Js(C)===Ls,A=[Ns,Ds].indexOf(M)>=0,N=A?"width":"height",D=da(e,{placement:C,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),_=A?T?_s:Rs:T?Ds:Ns;w[N]>x[N]&&(_=ra(_));var R=ra(_),I=[];if(i&&I.push(D[M]<=0),a&&I.push(D[_]<=0,D[R]<=0),I.every((function(t){return t}))){k=C,O=!1;break}S.set(C,I)}if(O)for(var z=function(t){var e=b.find((function(e){var n=S.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return k=e,"break"},L=f?3:1;L>0&&"break"!==z(L);L--);e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ha(t,e,n){return ps(t,hs(e,n))}function fa(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function ma(t){return[Ns,_s,Ds,Rs].some((function(e){return t[e]>=0}))}var va=Us({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=void 0===o||o,s=r.resize,a=void 0===s||s,l=ls(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach((function(t){t.addEventListener("scroll",n.update,Gs)})),a&&l.addEventListener("resize",n.update,Gs),function(){i&&c.forEach((function(t){t.removeEventListener("scroll",n.update,Gs)})),a&&l.removeEventListener("resize",n.update,Gs)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=Xs({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:Ks(e.placement),variation:Js(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Qs(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Qs(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},ta,ea,pa,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,m=void 0===f?0:f,v=da(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=Ks(e.placement),y=Js(e.placement),b=!y,w=Zs(g),x="x"===w?"y":"x",S=e.modifiersData.popperOffsets,O=e.rects.reference,k=e.rects.popper,E="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,C="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,T={x:0,y:0};if(S){if(i){var A,N="y"===w?Ns:Rs,D="y"===w?Ds:_s,_="y"===w?"height":"width",R=S[w],I=R+v[N],z=R-v[D],L=h?-k[_]/2:0,P=y===Ls?O[_]:k[_],B=y===Ls?-k[_]:-O[_],F=e.elements.arrow,j=h&&F?Os(F):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=V[N],H=V[D],W=ha(0,O[_],j[_]),q=b?O[_]/2-L-W-$-C.mainAxis:P-W-$-C.mainAxis,U=b?-O[_]/2+L+W+H+C.mainAxis:B+W+H+C.mainAxis,G=e.elements.arrow&&As(e.elements.arrow),K=G?"y"===w?G.clientTop||0:G.clientLeft||0:0,J=null!=(A=null==M?void 0:M[w])?A:0,Z=R+U-J,X=ha(h?hs(I,R+q-J-K):I,R,h?ps(z,Z):z);S[w]=X,T[w]=X-R}if(a){var Y,Q="x"===w?Ns:Rs,tt="x"===w?Ds:_s,et=S[x],nt="y"===x?"height":"width",rt=et+v[Q],ot=et-v[tt],it=-1!==[Ns,Rs].indexOf(g),st=null!=(Y=null==M?void 0:M[x])?Y:0,at=it?rt:et-O[nt]-k[nt]-st+C.altAxis,lt=it?et+O[nt]+k[nt]-st-C.altAxis:ot,ct=h&&it?function(t,e,n){var r=ha(t,e,n);return r>n?n:r}(at,et,lt):ha(h?at:rt,et,h?lt:ot);S[x]=ct,T[x]=ct-et}e.modifiersData[r]=T}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ks(n.placement),l=Zs(a),c=[Rs,_s].indexOf(a)>=0?"height":"width";if(i&&s){var u=function(t,e){return ca("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ua(t,zs))}(o.padding,n),d=Os(i),p="y"===l?Ns:Rs,h="y"===l?Ds:_s,f=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],m=s[l]-n.rects.reference[l],v=As(i),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,y=f/2-m/2,b=u[p],w=g-d[c]-u[h],x=g/2-d[c]/2+y,S=ha(b,x,w),O=l;n.modifiersData[r]=((e={})[O]=S,e.centerOffset=S-x,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&sa(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=da(e,{elementContext:"reference"}),a=da(e,{altBoundary:!0}),l=fa(s,r),c=fa(a,o,i),u=ma(l),d=ma(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),ga="tippy-content",ya="tippy-arrow",ba="tippy-svg-arrow",wa={passive:!0,capture:!0},xa=function(){return document.body};function Sa(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function Oa(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function ka(t,e){return"function"==typeof t?t.apply(void 0,e):t}function Ea(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r)}),e)};var n}function Ca(t){return[].concat(t)}function Ma(t,e){-1===t.indexOf(e)&&t.push(e)}function Ta(t){return[].slice.call(t)}function Aa(t){return Object.keys(t).reduce((function(e,n){return void 0!==t[n]&&(e[n]=t[n]),e}),{})}function Na(){return document.createElement("div")}function Da(t){return["Element","Fragment"].some((function(e){return Oa(t,e)}))}function _a(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function Ra(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function Ia(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n)}))}function za(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var La={isTouch:!1},Pa=0;function Ba(){La.isTouch||(La.isTouch=!0,window.performance&&document.addEventListener("mousemove",Fa))}function Fa(){var t=performance.now();t-Pa<20&&(La.isTouch=!1,document.removeEventListener("mousemove",Fa)),Pa=t}function ja(){var t,e=document.activeElement;if((t=e)&&t._tippy&&t._tippy.reference===t){var n=e._tippy;e.blur&&!n.state.isVisible&&e.blur()}}var Va=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),$a=Object.assign({appendTo:xa,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Ha=Object.keys($a);function Wa(t){var e=(t.plugins||[]).reduce((function(e,n){var r,o=n.name,i=n.defaultValue;return o&&(e[o]=void 0!==t[o]?t[o]:null!=(r=$a[o])?r:i),e}),{});return Object.assign({},t,e)}function qa(t,e){var n=Object.assign({},e,{content:ka(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Wa(Object.assign({},$a,{plugins:e}))):Ha).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r)}catch(t){e[n]=r}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},$a.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}function Ua(t,e){t.innerHTML=e}function Ga(t){var e=Na();return!0===t?e.className=ya:(e.className=ba,Da(t)?e.appendChild(t):Ua(e,t)),e}function Ka(t,e){Da(e.content)?(Ua(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Ua(t,e.content):t.textContent=e.content)}function Ja(t){var e=t.firstElementChild,n=Ta(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(ga)})),arrow:n.find((function(t){return t.classList.contains(ya)||t.classList.contains(ba)})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function Za(t){var e=Na(),n=Na();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Na();function o(n,r){var o=Ja(e),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Ka(s,t.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(Ga(r.arrow))):i.appendChild(Ga(r.arrow)):a&&i.removeChild(a)}return r.className=ga,r.setAttribute("data-state","hidden"),Ka(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props),{popper:e,onUpdate:o}}Za.$$tippy=!0;var Xa=1,Ya=[],Qa=[];function tl(t,e){var n,r,o,i,s,a,l,c,u=qa(t,Object.assign({},$a,Wa(Aa(e)))),d=!1,p=!1,h=!1,f=!1,m=[],v=Ea(G,u.interactiveDebounce),g=Xa++,y=(c=u.plugins).filter((function(t,e){return c.indexOf(t)===e})),b={id:g,reference:t,popper:Na(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(e){if(!b.state.isDestroyed){R("onBeforeUpdate",[b,e]),q();var n=b.props,r=qa(t,Object.assign({},n,Aa(e),{ignoreAttributes:!0}));b.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(L(),v=Ea(G,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?Ca(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):r.triggerTarget&&t.removeAttribute("aria-expanded"),z(),_(),S&&S(n,r),b.popperInstance&&(X(),Q().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)}))),R("onAfterUpdate",[b,e])}},setContent:function(t){b.setProps({content:t})},show:function(){var t=b.state.isVisible,e=b.state.isDestroyed,n=!b.state.isEnabled,r=La.isTouch&&!b.props.touch,o=Sa(b.props.duration,0,$a.duration);if(!(t||e||n||r||T().hasAttribute("disabled")||(R("onShow",[b],!1),!1===b.props.onShow(b)))){if(b.state.isVisible=!0,M()&&(x.style.visibility="visible"),_(),j(),b.state.isMounted||(x.style.transition="none"),M()){var i=N();_a([i.box,i.content],0)}a=function(){var t;if(b.state.isVisible&&!f){if(f=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,M()&&b.props.animation){var e=N(),n=e.box,r=e.content;_a([n,r],o),Ra([n,r],"visible")}I(),z(),Ma(Qa,b),null==(t=b.popperInstance)||t.forceUpdate(),R("onMount",[b]),b.props.animation&&M()&&function(t,e){$(t,(function(){b.state.isShown=!0,R("onShown",[b])}))}(o)}},function(){var t,e=b.props.appendTo,n=T();(t=b.props.interactive&&e===xa||"parent"===e?n.parentNode:ka(e,[n])).contains(x)||t.appendChild(x),b.state.isMounted=!0,X()}()}},hide:function(){var t=!b.state.isVisible,e=b.state.isDestroyed,n=!b.state.isEnabled,r=Sa(b.props.duration,1,$a.duration);if(!(t||e||n)&&(R("onHide",[b],!1),!1!==b.props.onHide(b))){if(b.state.isVisible=!1,b.state.isShown=!1,f=!1,d=!1,M()&&(x.style.visibility="hidden"),L(),V(),_(!0),M()){var o=N(),i=o.box,s=o.content;b.props.animation&&(_a([i,s],r),Ra([i,s],"hidden"))}I(),z(),b.props.animation?M()&&function(t,e){$(t,(function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}(r,b.unmount):b.unmount()}},hideWithInteractivity:function(t){A().addEventListener("mousemove",v),Ma(Ya,v),v(t)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide(),b.state.isMounted&&(Y(),Q().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Qa=Qa.filter((function(t){return t!==b})),b.state.isMounted=!1,R("onHidden",[b]))},destroy:function(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),q(),delete t._tippy,b.state.isDestroyed=!0,R("onDestroy",[b]))}};if(!u.render)return b;var w=u.render(b),x=w.popper,S=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,t._tippy=b,x._tippy=b;var O=y.map((function(t){return t.fn(b)})),k=t.hasAttribute("aria-expanded");return W(),z(),_(),R("onCreate",[b]),u.showOnCreate&&tt(),x.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&A().addEventListener("mousemove",v)})),b;function E(){var t=b.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===E()[0]}function M(){var t;return!(null==(t=b.props.render)||!t.$$tippy)}function T(){return l||t}function A(){var t,e,n=T().parentNode;return n?null!=(e=Ca(n)[0])&&null!=(t=e.ownerDocument)&&t.body?e.ownerDocument:document:document}function N(){return Ja(x)}function D(t){return b.state.isMounted&&!b.state.isVisible||La.isTouch||i&&"focus"===i.type?0:Sa(b.props.delay,t?0:1,$a.delay)}function _(t){void 0===t&&(t=!1),x.style.pointerEvents=b.props.interactive&&!t?"":"none",x.style.zIndex=""+b.props.zIndex}function R(t,e,n){var r;void 0===n&&(n=!0),O.forEach((function(n){n[t]&&n[t].apply(n,e)})),n&&(r=b.props)[t].apply(r,e)}function I(){var e=b.props.aria;if(e.content){var n="aria-"+e.content,r=x.id;Ca(b.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(b.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else{var o=e&&e.replace(r,"").trim();o?t.setAttribute(n,o):t.removeAttribute(n)}}))}}function z(){!k&&b.props.aria.expanded&&Ca(b.props.triggerTarget||t).forEach((function(t){b.props.interactive?t.setAttribute("aria-expanded",b.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function L(){A().removeEventListener("mousemove",v),Ya=Ya.filter((function(t){return t!==v}))}function P(e){if(!La.isTouch||!h&&"mousedown"!==e.type){var n=e.composedPath&&e.composedPath()[0]||e.target;if(!b.props.interactive||!za(x,n)){if(Ca(b.props.triggerTarget||t).some((function(t){return za(t,n)}))){if(La.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[b,e]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),p=!0,setTimeout((function(){p=!1})),b.state.isMounted||V())}}}function B(){h=!0}function F(){h=!1}function j(){var t=A();t.addEventListener("mousedown",P,!0),t.addEventListener("touchend",P,wa),t.addEventListener("touchstart",F,wa),t.addEventListener("touchmove",B,wa)}function V(){var t=A();t.removeEventListener("mousedown",P,!0),t.removeEventListener("touchend",P,wa),t.removeEventListener("touchstart",F,wa),t.removeEventListener("touchmove",B,wa)}function $(t,e){var n=N().box;function r(t){t.target===n&&(Ia(n,"remove",r),e())}if(0===t)return e();Ia(n,"remove",s),Ia(n,"add",r),s=r}function H(e,n,r){void 0===r&&(r=!1),Ca(b.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,r),m.push({node:t,eventType:e,handler:n,options:r})}))}function W(){var t;C()&&(H("touchstart",U,{passive:!0}),H("touchend",K,{passive:!0})),(t=b.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(H(t,U),t){case"mouseenter":H("mouseleave",K);break;case"focus":H(Va?"focusout":"blur",J);break;case"focusin":H("focusout",J)}}))}function q(){m.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)})),m=[]}function U(t){var e,n=!1;if(b.state.isEnabled&&!Z(t)&&!p){var r="focus"===(null==(e=i)?void 0:e.type);i=t,l=t.currentTarget,z(),!b.state.isVisible&&Oa(t,"MouseEvent")&&Ya.forEach((function(e){return e(t)})),"click"===t.type&&(b.props.trigger.indexOf("mouseenter")<0||d)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:tt(t),"click"===t.type&&(d=!n),n&&!r&&et(t)}}function G(t){var e=t.target,n=T().contains(e)||x.contains(e);if("mousemove"!==t.type||!n){var r=Q().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:u}:null})).filter(Boolean);(function(t,e){var n=e.clientX,r=e.clientY;return t.every((function(t){var e=t.popperRect,o=t.popperState,i=t.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var l="bottom"===s?a.top.y:0,c="top"===s?a.bottom.y:0,u="right"===s?a.left.x:0,d="left"===s?a.right.x:0,p=e.top-r+l>i,h=r-e.bottom-c>i,f=e.left-n+u>i,m=n-e.right-d>i;return p||h||f||m}))})(r,t)&&(L(),et(t))}}function K(t){Z(t)||b.props.trigger.indexOf("click")>=0&&d||(b.props.interactive?b.hideWithInteractivity(t):et(t))}function J(t){b.props.trigger.indexOf("focusin")<0&&t.target!==T()||b.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||et(t)}function Z(t){return!!La.isTouch&&C()!==t.type.indexOf("touch")>=0}function X(){Y();var e=b.props,n=e.popperOptions,r=e.placement,o=e.offset,i=e.getReferenceClientRect,s=e.moveTransition,l=M()?Ja(x).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||T()}:t,u=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(M()){var n=N().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];M()&&l&&u.push({name:"arrow",options:{element:l,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),b.popperInstance=va(c,x,Object.assign({},n,{placement:r,onFirstUpdate:a,modifiers:u}))}function Y(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return Ta(x.querySelectorAll("[data-tippy-root]"))}function tt(t){b.clearDelayTimeouts(),t&&R("onTrigger",[b,t]),j();var e=D(!0),r=E(),o=r[0],i=r[1];La.isTouch&&"hold"===o&&i&&(e=i),e?n=setTimeout((function(){b.show()}),e):b.show()}function et(t){if(b.clearDelayTimeouts(),R("onUntrigger",[b,t]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var e=D(!1);e?r=setTimeout((function(){b.state.isVisible&&b.hide()}),e):o=requestAnimationFrame((function(){b.hide()}))}}else V()}}function el(t,e){void 0===e&&(e={});var n=$a.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",Ba,wa),window.addEventListener("blur",ja);var r,o=Object.assign({},e,{plugins:n}),i=(r=t,Da(r)?[r]:function(t){return Oa(t,"NodeList")}(r)?Ta(r):Array.isArray(r)?r:Ta(document.querySelectorAll(r))).reduce((function(t,e){var n=e&&tl(e,o);return n&&t.push(n),t}),[]);return Da(t)?i[0]:i}el.defaultProps=$a,el.setDefaultProps=function(t){Object.keys(t).forEach((function(e){$a[e]=t[e]}))},el.currentInput=La,Object.assign({},ta,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}}),el.setDefaultProps({render:Za});const nl=el;class rl{constructor({editor:t,element:e,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:t,state:e,from:n,to:r})=>{const{doc:o,selection:i}=e,{empty:s}=i,a=!o.textBetween(n,r).length&&Di(e.selection);return!(!t.hasFocus()||s||a)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;!this.tippy&&e&&(this.tippy=nl(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(t=>{this.blurHandler({event:t})})))}update(t,e){var n,r,o;const{state:i,composing:s}=t,{doc:a,selection:l}=i,c=e&&e.doc.eq(a)&&e.selection.eq(l);if(s||c)return;this.createTooltip();const{ranges:u}=l,d=Math.min(...u.map((t=>t.$from.pos))),p=Math.max(...u.map((t=>t.$to.pos)));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:t,state:i,oldState:e,from:d,to:p}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>{if(Ni(e=i.selection)&&e instanceof Xt){const e=t.nodeDOM(d);if(e)return e.getBoundingClientRect()}var e;return rs(t,d,p)})}),this.show()):this.hide()}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t;null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}xi.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(t={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new ue({key:"string"==typeof t.pluginKey?new he(t.pluginKey):t.pluginKey,view:e=>new rl({view:e,...t})}))]:[];var t}});class ol{constructor({editor:t,element:e,view:n,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:t,state:e})=>{const{selection:n}=e,{$anchor:r,empty:o}=n,i=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(t.hasFocus()&&o&&i&&s)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,e=!!t.parentElement;!this.tippy&&e&&(this.tippy=nl(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(t=>{this.blurHandler({event:t})})))}update(t,e){var n,r,o;const{state:i}=t,{doc:s,selection:a}=i,{from:l,to:c}=a;e&&e.doc.eq(s)&&e.selection.eq(a)||(this.createTooltip(),(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:t,state:i,oldState:e}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>rs(t,l,c))}),this.show()):this.hide())}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t;null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}xi.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[(t={pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow},new ue({key:"string"==typeof t.pluginKey?new he(t.pluginKey):t.pluginKey,view:e=>new ol({view:e,...t})}))]:[];var t}});class il extends class extends class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(t,e){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',document.getElementsByTagName("head")[0].appendChild(r),r}(0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t){this.setOptions({editable:t})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=ai(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t){if(this.isDestroyed)return;const e="string"==typeof t?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((t=>!t.key.startsWith(e)))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(ns):[],...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new yi(t,this)}createCommandManager(){this.commandManager=new ti({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=Vi(this.options.content,this.schema,this.options.parseOptions),e=Ri(t,this.options.autofocus);this.view=new co(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:le.create({doc:t,selection:e||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus"),o=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,e){const n=Fi("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=oi(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,(t=>{i.push(t)}));const s=i.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}(t,e):"mark"===n?$i(t,e):{}}(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,r="string"==typeof t?e:t;return function(t,e,n={}){if(!e)return Bi(t,null,n)||Ji(t,null,n);const r=Fi(e,t.schema);return"node"===r?Bi(t,e,n):"mark"===r&&Ji(t,e,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,e){const n=ct.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return function(t,e){return Si(t,{from:0,to:t.content.size},e)}(this.state.doc,{blockSeparator:e,textSerializers:{...n,...Oi(this.schema)}})}get isEmpty(){return function(t){var e;const n=null===(e=t.type.createAndFill())||void 0===e?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}}{constructor(){super(...arguments),this.contentComponent=null}}const sl={name:"EditorContent",props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(t){t&&t.options.element&&this.$nextTick((()=>{const e=this.$el;e&&t.options.element.firstChild&&(e.append(...t.options.element.childNodes),t.contentComponent=this,t.setOptions({element:e}),t.createNodeViews())}))}}},render:t=>t("div"),beforeDestroy(){const{editor:t}=this;if(!t)return;if(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild)return;const e=document.createElement("div");e.append(...t.options.element.childNodes),t.setOptions({element:e})}};Boolean;const al=(ll={computed:()=>t.computed,inject:()=>t.inject,nextTick:()=>t.nextTick,onMounted:()=>t.onMounted,onUnmounted:()=>t.onUnmounted,provide:()=>t.provide,reactive:()=>t.reactive,ref:()=>t.ref,toRef:()=>t.toRef,watch:()=>t.watch},cl={},o.d(cl,ll),cl);var ll,cl,ul=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Transition",{attrs:{name:"zw-toolbar-",duration:800}},[n("div",{staticClass:"zw-toolbar"},[n(t.toolbarComponent,{tag:"component"})],1)])};ul._withStripped=!0;var dl=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),pl=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),hl=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify"}),fl=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),ml=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),vl=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION]}}),gl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("ToolbarRow",[n("StylePresetControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontFamilyControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontWeightControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontSizeControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("ToolbarGroup",[n("FontColorControl"),t._v(" "),n("BackgroundColorControl")],1)],1),t._v(" "),n("ToolbarDivider",{attrs:{horizontal:""}}),t._v(" "),n("ToolbarRow",[n("ToolbarGroup",[n("ItalicControl"),t._v(" "),n("UnderlineControl"),t._v(" "),n("StrikeThroughControl"),t._v(" "),n("SuperscriptControl"),t._v(" "),n("CaseStyleControl")],1),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("AlignmentControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("ToolbarGroup",[n("LineHeightControl"),t._v(" "),n("ListControl")],1),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("ToolbarGroup",[n("RemoveFormatControl")],1)],1)],1)};gl._withStripped=!0;var yl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-toolbar__divider",class:t.classes})};function bl(t,e,n,r,o,i,s,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}yl._withStripped=!0;var wl=bl({name:"ToolbarDivider",props:{vertical:{type:Boolean,required:!1,default:!1},horizontal:{type:Boolean,required:!1,default:!1}},setup:function(t){return{classes:(0,al.computed)((function(){return{"zw-toolbar__divider--vertical":t.vertical,"zw-toolbar__divider--horizontal":t.horizontal}}))}}},yl,[],!1,null,"034e1143",null);wl.options.__file="lib/components/toolbar/ToolbarDivider.vue";const xl=wl.exports;var Sl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-toolbar__row"},[t._t("default")],2)};Sl._withStripped=!0;var Ol=bl({name:"ToolbarRow"},Sl,[],!1,null,"65916ef8",null);Ol.options.__file="lib/components/toolbar/ToolbarRow.vue";const kl=Ol.exports;var El=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-toolbar__group"},[t._t("default")],2)};El._withStripped=!0;var Cl=bl({name:"ToolbarGroup"},El,[],!1,null,"06bbae29",null);Cl.options.__file="lib/components/toolbar/ToolbarGroup.vue";const Ml=Cl.exports;var Tl=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zw-style-preset-control"},[n("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Text Type",expression:"'Text Type'"}],staticClass:"zw-style-preset-control__dropdown",attrs:{value:t.preset.id,options:t.options},on:{change:t.apply}}),t._v(" "),n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Reset Styles",expression:"'Reset Styles'"}],staticClass:"zw-style-preset-control__reset",attrs:{disabled:!t.isCustomized,icon:""},on:{click:t.removeCustomization}},[n("Icon",{attrs:{name:"reset-styles",size:"28px","auto-color":""}})],1)],1)};Tl._withStripped=!0;var Al=Object.freeze({FONTS:Symbol("fonts"),FONT_SIZES:Symbol("fontSizes"),EDITOR:Symbol("editor"),LOCAL_STORAGE:Symbol("localStorage"),FAVORITE_COLORS:Symbol("favoriteColors")}),Nl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("button",{staticClass:"zw-button",class:t.classes,attrs:{type:"button",disabled:t.disabled},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default")],2)};function Dl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Nl._withStripped=!0;var _l=bl({name:"Button",props:{skin:{type:String,required:!1,validator:function(t){return["toolbar","none"].includes(t)},default:"none"},active:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},icon:{type:Boolean,required:!1,default:!1}},setup:function(t){return{classes:(0,al.computed)((function(){var e;return Dl(e={},"zw-button--".concat(t.skin),"none"!==t.skin),Dl(e,"zw-button--active",t.active),Dl(e,"zw-button--icon",t.icon),e}))}}},Nl,[],!1,null,"610825a2",null);_l.options.__file="lib/components/base/Button.vue";const Rl=_l.exports;var Il=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"zw-button-toggle"},[t._l(t.options,(function(e){return t._t("option",null,{option:e,isActive:e.id===t.value,activate:function(){return t.$emit("change",e.id)}})}))],2)};Il._withStripped=!0;var zl=bl({name:"ButtonToggle",model:{event:"change"},props:{value:{type:String,required:!0},options:{type:Array,required:!0}}},Il,[],!1,null,"de5fa53a",null);zl.options.__file="lib/components/base/ButtonToggle.vue";const Ll=zl.exports;var Pl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"zw-icon",class:t.iconClasses,style:t.iconStyles,domProps:{innerHTML:t._s(t.source)}})};function Bl(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(e){return t.apply(void 0,[e].concat(n))}}}function Fl(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function jl(t,e){if(t){if("string"==typeof t)return Fl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fl(t,e):void 0}}function Vl(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);s=!0);}catch(t){a=!0,o=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(t,e)||jl(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Hl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$l(Object(n),!0).forEach((function(e){Dl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wl(t){var e=Object.entries(t).reduce((function(t,e){var n=Vl(e,2),r=n[0],o=n[1];if(!o)return t;var i=r.replace(/_/g,"-");return"".concat(t," --zw-").concat(i,": ").concat(o,";").trimStart()}),"");return e?{style:e}:null}function ql(t){var e=Wl(t);return["span",e?Hl(Hl({},e),{},{class:"zw-style"}):{},0]}function Ul(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(e){var r;return(r=e.editor.commands)[t].apply(r,n),!0}}Pl._withStripped=!0;const Gl=(t=>{var e={};return o.d(e,t),e})({ColorModel:()=>e.ColorModel,ZipifyColorPicker:()=>e.ZipifyColorPicker});function Kl(t){var e=Gl.ColorModel.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}var Jl=o(3700),Zl=bl({name:"Icon",props:{name:{type:String,required:!0},size:{type:[String,Number],required:!1,default:""},autoColor:{type:Boolean,required:!1,default:!1}},setup:function(t){var e=(0,al.computed)((function(){return function(t){try{return Jl("./".concat(t,".svg"))}catch(t){return console.warn("Cannot resolve wysiwyg icon",t),""}}(t.name)})),n=(0,al.computed)((function(){return isNaN(Number(t.size))?t.size:"".concat(t.size,"px")}));return{source:e,iconStyles:(0,al.computed)((function(){return t.size?{"--zw-icon-width":n.value,"--zw-icon-height":n.value}:null})),iconClasses:(0,al.computed)((function(){return{"zw-icon--auto-color":t.autoColor}}))}}},Pl,[],!1,null,"d4624794",null);Zl.options.__file="lib/components/base/Icon.vue";const Xl=Zl.exports;var Yl=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{ref:"hostRef",staticClass:"zw-scroll-view",attrs:{"data-simplebar-auto-hide":"false"}},[t._t("default")],2)};Yl._withStripped=!0,o(1539),o(4747);var Ql,tc=o(1807),ec=o.n(tc),nc=(o(1058),o(9601),o(7327),o(6992),o(8783),o(4129),o(3948),o(3096)),rc=o.n(nc),oc=o(1296),ic=o.n(oc),sc=o(773),ac=o.n(sc),lc=[],cc="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Ql||(Ql={}));var uc,dc=function(t){return Object.freeze(t)},pc=function(t,e){this.inlineSize=t,this.blockSize=e,dc(this)},hc=function(){function t(t,e,n,r){return this.x=t,this.y=e,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,dc(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),fc=function(t){return t instanceof SVGElement&&"getBBox"in t},mc=function(t){if(fc(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||t.getClientRects().length)},vc=function(t){var e,n;if(t instanceof Element)return!0;var r=null===(n=null===(e=t)||void 0===e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(r&&t instanceof r.Element)},gc="undefined"!=typeof window?window:{},yc=new WeakMap,bc=/auto|scroll/,wc=/^tb|vertical/,xc=/msie|trident/i.test(gc.navigator&&gc.navigator.userAgent),Sc=function(t){return parseFloat(t||"0")},Oc=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new pc((n?e:t)||0,(n?t:e)||0)},kc=dc({devicePixelContentBoxSize:Oc(),borderBoxSize:Oc(),contentBoxSize:Oc(),contentRect:new hc(0,0,0,0)}),Ec=function(t,e){if(void 0===e&&(e=!1),yc.has(t)&&!e)return yc.get(t);if(mc(t))return yc.set(t,kc),kc;var n=getComputedStyle(t),r=fc(t)&&t.ownerSVGElement&&t.getBBox(),o=!xc&&"border-box"===n.boxSizing,i=wc.test(n.writingMode||""),s=!r&&bc.test(n.overflowY||""),a=!r&&bc.test(n.overflowX||""),l=r?0:Sc(n.paddingTop),c=r?0:Sc(n.paddingRight),u=r?0:Sc(n.paddingBottom),d=r?0:Sc(n.paddingLeft),p=r?0:Sc(n.borderTopWidth),h=r?0:Sc(n.borderRightWidth),f=r?0:Sc(n.borderBottomWidth),m=d+c,v=l+u,g=(r?0:Sc(n.borderLeftWidth))+h,y=p+f,b=a?t.offsetHeight-y-t.clientHeight:0,w=s?t.offsetWidth-g-t.clientWidth:0,x=o?m+g:0,S=o?v+y:0,O=r?r.width:Sc(n.width)-x-w,k=r?r.height:Sc(n.height)-S-b,E=O+m+w+g,C=k+v+b+y,M=dc({devicePixelContentBoxSize:Oc(Math.round(O*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:Oc(E,C,i),contentBoxSize:Oc(O,k,i),contentRect:new hc(d,l,O,k)});return yc.set(t,M),M},Cc=function(t,e,n){var r=Ec(t,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case Ql.DEVICE_PIXEL_CONTENT_BOX:return s;case Ql.BORDER_BOX:return o;default:return i}},Mc=function(t){var e=Ec(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=dc([e.borderBoxSize]),this.contentBoxSize=dc([e.contentBoxSize]),this.devicePixelContentBoxSize=dc([e.devicePixelContentBoxSize])},Tc=function(t){if(mc(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Ac=function(){var t=1/0,e=[];lc.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(e){var n=new Mc(e.target),o=Tc(e.target);r.push(n),e.lastReportedSize=Cc(e.target,e.observedBox),o<t&&(t=o)})),e.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=e;n<r.length;n++)(0,r[n])();return t},Nc=function(t){lc.forEach((function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach((function(n){n.isActive()&&(Tc(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))}))}))},Dc=[],_c=0,Rc={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ic=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],zc=function(t){return void 0===t&&(t=0),Date.now()+t},Lc=!1,Pc=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!Lc){Lc=!0;var n,r=zc(t);n=function(){var n=!1;try{n=function(){var t,e=0;for(Nc(e);lc.some((function(t){return t.activeTargets.length>0}));)e=Ac(),Nc(e);return lc.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:cc}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=cc),window.dispatchEvent(t)),e>0}()}finally{if(Lc=!1,t=r-zc(),!_c)return;n?e.run(1e3):t>0?e.run(t):e.start()}},function(t){if(!uc){var e=0,n=document.createTextNode("");new MutationObserver((function(){return Dc.splice(0).forEach((function(t){return t()}))})).observe(n,{characterData:!0}),uc=function(){n.textContent=""+(e?e--:e++)}}Dc.push(t),uc()}((function(){requestAnimationFrame(n)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,Rc)};document.body?e():gc.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ic.forEach((function(e){return gc.addEventListener(e,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ic.forEach((function(e){return gc.removeEventListener(e,t.listener,!0)})),this.stopped=!0)},t}()),Bc=function(t){!_c&&t>0&&Pc.start(),!(_c+=t)&&Pc.stop()},Fc=function(){function t(t,e){this.target=t,this.observedBox=e||Ql.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=Cc(this.target,this.observedBox,!0);return t=this.target,fc(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),jc=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Vc=new WeakMap,$c=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Hc=function(){function t(){}return t.connect=function(t,e){var n=new jc(t,e);Vc.set(t,n)},t.observe=function(t,e,n){var r=Vc.get(t),o=0===r.observationTargets.length;$c(r.observationTargets,e)<0&&(o&&lc.push(r),r.observationTargets.push(new Fc(e,n&&n.box)),Bc(1),Pc.schedule())},t.unobserve=function(t,e){var n=Vc.get(t),r=$c(n.observationTargets,e),o=1===n.observationTargets.length;r>=0&&(o&&lc.splice(lc.indexOf(n),1),n.observationTargets.splice(r,1),Bc(-1))},t.disconnect=function(t){var e=this,n=Vc.get(t);n.observationTargets.slice().forEach((function(n){return e.unobserve(t,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},t}(),Wc=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Hc.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!vc(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Hc.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!vc(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Hc.unobserve(this,t)},t.prototype.disconnect=function(){Hc.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}(),qc=(o(5827),o(4916),o(4723),o(8309),o(5306),function(t){return Array.prototype.reduce.call(t,(function(t,e){var n=e.name.match(/data-simplebar-(.+)/);if(n){var r=n[1].replace(/\W+(.)/g,(function(t,e){return e.toUpperCase()}));switch(e.value){case"true":t[r]=!0;break;case"false":t[r]=!1;break;case void 0:t[r]=!0;break;default:t[r]=e.value}}return t}),{})});function Uc(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function Gc(t){return t&&t.ownerDocument?t.ownerDocument:document}var Kc=null,Jc=null;function Zc(t){if(null===Kc){var e=Gc(t);if(void 0===e)return Kc=0;var n=e.body,r=e.createElement("div");r.classList.add("simplebar-hide-scrollbar"),n.appendChild(r);var o=r.getBoundingClientRect().right;n.removeChild(r),Kc=o}return Kc}ec()&&window.addEventListener("resize",(function(){Jc!==window.devicePixelRatio&&(Jc=window.devicePixelRatio,Kc=null)}));var Xc=function(){function t(e,n){var r=this;this.onScroll=function(){var t=Uc(r.el);r.scrollXTicking||(t.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0),r.scrollYTicking||(t.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0)},this.scrollX=function(){r.axis.x.isOverflowing&&(r.showScrollbar("x"),r.positionScrollbar("x")),r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&(r.showScrollbar("y"),r.positionScrollbar("y")),r.scrollYTicking=!1},this.onMouseEnter=function(){r.showScrollbar("x"),r.showScrollbar("y")},this.onMouseMove=function(t){r.mouseX=t.clientX,r.mouseY=t.clientY,(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseMoveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){r.onMouseMove.cancel(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseLeaveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseLeaveForAxis("y"),r.mouseX=-1,r.mouseY=-1},this.onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth(),r.hideNativeScrollbar()},this.hideScrollbars=function(){r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.track.rect)||(r.axis.y.scrollbar.el.classList.remove(r.classNames.visible),r.axis.y.isVisible=!1),r.isWithinBounds(r.axis.x.track.rect)||(r.axis.x.scrollbar.el.classList.remove(r.classNames.visible),r.axis.x.isVisible=!1)},this.onPointerEvent=function(t){var e,n;r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(e=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(n=r.isWithinBounds(r.axis.y.track.rect)),(e||n)&&(t.preventDefault(),t.stopPropagation(),"mousedown"===t.type&&(e&&(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect)?r.onDragStart(t,"x"):r.onTrackClick(t,"x")),n&&(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect)?r.onDragStart(t,"y"):r.onTrackClick(t,"y"))))},this.drag=function(e){var n=r.axis[r.draggedAxis].track,o=n.rect[r.axis[r.draggedAxis].sizeAttr],i=r.axis[r.draggedAxis].scrollbar,s=r.contentWrapperEl[r.axis[r.draggedAxis].scrollSizeAttr],a=parseInt(r.elStyles[r.axis[r.draggedAxis].sizeAttr],10);e.preventDefault(),e.stopPropagation();var l=(("y"===r.draggedAxis?e.pageY:e.pageX)-n.rect[r.axis[r.draggedAxis].offsetAttr]-r.axis[r.draggedAxis].dragOffset)/(o-i.size)*(s-a);"x"===r.draggedAxis&&(l=r.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?l-(o+i.size):l,l=r.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-l:l),r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=l},this.onEndDrag=function(t){var e=Gc(r.el),n=Uc(r.el);t.preventDefault(),t.stopPropagation(),r.el.classList.remove(r.classNames.dragging),e.removeEventListener("mousemove",r.drag,!0),e.removeEventListener("mouseup",r.onEndDrag,!0),r.removePreventClickId=n.setTimeout((function(){e.removeEventListener("click",r.preventClick,!0),e.removeEventListener("dblclick",r.preventClick,!0),r.removePreventClickId=null}))},this.preventClick=function(t){t.preventDefault(),t.stopPropagation()},this.el=e,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,n),this.classNames=Object.assign({},t.defaultOptions.classNames,this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el)||(this.recalculate=rc()(this.recalculate.bind(this),64),this.onMouseMove=rc()(this.onMouseMove.bind(this),64),this.hideScrollbars=ic()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=ic()(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=ac()(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var e=document.createElement("div");e.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var n=e.firstElementChild;document.body.appendChild(n);var r=n.firstElementChild;n.scrollLeft=0;var o=t.getOffset(n),i=t.getOffset(r);n.scrollLeft=999;var s=t.getOffset(r);return{isRtlScrollingInverted:o.left!==i.left&&i.left-s.left!=0,isRtlScrollbarInverted:o.left!==i.left}},t.getOffset=function(t){var e=t.getBoundingClientRect(),n=Gc(t),r=Uc(t);return{top:e.top+(r.pageYOffset||n.documentElement.scrollTop),left:e.left+(r.pageXOffset||n.documentElement.scrollLeft)}};var e=t.prototype;return e.init=function(){t.instances.set(this.el,this),ec()&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var t=this;if(Array.prototype.filter.call(this.el.children,(function(e){return e.classList.contains(t.classNames.wrapper)})).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var e=document.createElement("div"),n=document.createElement("div");e.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),e.appendChild(n),this.axis.x.track.el=e.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=e.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.setAccessibilityAttributes=function(){var t=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",t)},e.initListeners=function(){var t=this,e=Uc(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.addEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),e.addEventListener("resize",this.onWindowResize);var n=!1,r=e.ResizeObserver||Wc;this.resizeObserver=new r((function(){n&&t.recalculate()})),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),e.requestAnimationFrame((function(){n=!0})),this.mutationObserver=new e.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var t=Uc(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var e=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,r=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,i=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var a=this.contentEl.scrollHeight,l=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=e?"auto":"100%",this.placeholderEl.style.width=n?r+"px":"auto",this.placeholderEl.style.height=a+"px";var c=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=l>r,this.axis.y.isOverflowing=a>c,this.axis.x.isOverflowing="hidden"!==i&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==s&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var u=this.axis.x.isOverflowing?this.scrollbarWidth:0,d=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&l>o-d,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&a>c-u,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(t){if(void 0===t&&(t="y"),!this.axis[t].isOverflowing)return 0;var e,n=this.contentEl[this.axis[t].scrollSizeAttr],r=this.axis[t].track.el[this.axis[t].offsetSizeAttr],o=r/n;return e=Math.max(~~(o*r),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(e=Math.min(e,this.options.scrollbarMaxSize)),e},e.positionScrollbar=function(e){if(void 0===e&&(e="y"),this.axis[e].isOverflowing){var n=this.contentWrapperEl[this.axis[e].scrollSizeAttr],r=this.axis[e].track.el[this.axis[e].offsetSizeAttr],o=parseInt(this.elStyles[this.axis[e].sizeAttr],10),i=this.axis[e].scrollbar,s=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],a=(s="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-s:s)/(n-o),l=~~((r-i.size)*a);l="x"===e&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?l+(r-i.size):l,i.el.style.transform="x"===e?"translate3d("+l+"px, 0, 0)":"translate3d(0, "+l+"px, 0)"}},e.toggleTrackVisibility=function(t){void 0===t&&(t="y");var e=this.axis[t].track.el,n=this.axis[t].scrollbar.el;this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll"):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden"),this.axis[t].isOverflowing?n.style.display="block":n.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.rect=this.axis[t].track.el.getBoundingClientRect(),this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[t].scrollbar.rect)?this.axis[t].scrollbar.el.classList.add(this.classNames.hover):this.axis[t].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[t].track.rect)?(this.showScrollbar(t),this.axis[t].track.el.classList.add(this.classNames.hover)):this.axis[t].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(t){void 0===t&&(t="y"),this.axis[t].track.el.classList.remove(this.classNames.hover),this.axis[t].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(t){void 0===t&&(t="y");var e=this.axis[t].scrollbar.el;this.axis[t].isVisible||(e.classList.add(this.classNames.visible),this.axis[t].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(t,e){void 0===e&&(e="y");var n=Gc(this.el),r=Uc(this.el),o=this.axis[e].scrollbar,i="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=i-o.rect[this.axis[e].offsetAttr],this.draggedAxis=e,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(r.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(t,e){var n=this;if(void 0===e&&(e="y"),this.options.clickOnTrack){var r=Uc(this.el);this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect();var o=this.axis[e].scrollbar.rect[this.axis[e].offsetAttr],i=parseInt(this.elStyles[this.axis[e].sizeAttr],10),s=this.contentWrapperEl[this.axis[e].scrollOffsetAttr],a=("y"===e?this.mouseY-o:this.mouseX-o)<0?-1:1,l=-1===a?s-i:s+i;!function t(){var o,i;-1===a?s>l&&(s-=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo(((o={})[n.axis[e].offsetAttr]=s,o)),r.requestAnimationFrame(t)):s<l&&(s+=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo(((i={})[n.axis[e].offsetAttr]=s,i)),r.requestAnimationFrame(t))}()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:Zc(this.el)}catch(t){return Zc(this.el)}},e.removeListeners=function(){var t=this,e=Uc(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(e){t.el.removeEventListener(e,t.onPointerEvent,{capture:!0,passive:!0})})),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),t.instances.delete(this.el)},e.isWithinBounds=function(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height},e.findChild=function(t,e){var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,(function(t){return n.call(t,e)}))[0]},t}();Xc.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},Xc.instances=new WeakMap,Xc.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),(function(t){"init"===t.getAttribute("data-simplebar")||Xc.instances.has(t)||new Xc(t,qc(t.attributes))}))},Xc.removeObserver=function(){this.globalObserver.disconnect()},Xc.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(Xc.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},Xc.handleMutations=function(t){t.forEach((function(t){Array.prototype.forEach.call(t.addedNodes,(function(t){1===t.nodeType&&(t.hasAttribute("data-simplebar")?!Xc.instances.has(t)&&document.documentElement.contains(t)&&new Xc(t,qc(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),(function(t){"init"!==t.getAttribute("data-simplebar")&&!Xc.instances.has(t)&&document.documentElement.contains(t)&&new Xc(t,qc(t.attributes))})))})),Array.prototype.forEach.call(t.removedNodes,(function(t){1===t.nodeType&&("init"===t.getAttribute("data-simplebar")?Xc.instances.has(t)&&!document.documentElement.contains(t)&&Xc.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),(function(t){Xc.instances.has(t)&&!document.documentElement.contains(t)&&Xc.instances.get(t).unMount()})))}))}))},Xc.getOptions=qc,ec()&&Xc.initHtmlApi();const Yc=Xc;var Qc=function(t){return t};function tu(t){var e=t.valueRef,n=t.format,r=void 0===n?Qc:n,o=(0,al.ref)(r(e.value));return(0,al.watch)(e,(function(){return o.value=r(e.value)})),o}function eu(t){return(0,al.computed)((function(){var e;return(null===(e=t.value)||void 0===e?void 0:e.$el)||t.value}))}function nu(t,e,n,r,o,i,s){try{var a=t[i](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(r,o)}function ru(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function s(t){nu(i,r,o,s,a,"next",t)}function a(t){nu(i,r,o,s,a,"throw",t)}s(void 0)}))}}var ou=o(4687),iu=o.n(ou);function su(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onBeforeOpened,r=e.onClosed,o=e.wrapperRef,i=e.modalRef,s=(0,al.inject)(Al.EDITOR),a=(0,al.ref)(!1);function l(){var e=eu(o),n=eu(i);t=va(e.value,n.value,{placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:16}}]})}function c(){return u.apply(this,arguments)}function u(){return(u=ru(iu().mark((function t(){return iu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null==n||n(),s.commands.storeSelection(),a.value=!0,t.next=5,(0,al.nextTick)();case 5:l();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(){a.value=!1,s.commands.restoreSelection(),null==r||r()}(0,al.onUnmounted)((function(){var e;null===(e=t)||void 0===e||e.destroy()}));var p=function(t){return t?c():d()};return{isOpened:a,open:c,close:d,toggle:p}}function au(t){var e=t.targetRef,n=t.isActiveRef,r=t.event,o=t.onEvent,i=t.options;function s(){var t;null===(t=e.value)||void 0===t||t.removeEventListener(r,o,i)}function a(){e.value&&(n.value?e.value.addEventListener(r,o,i):s())}(0,al.watch)(n,a),(0,al.watch)(e,a),(0,al.onUnmounted)(s),a()}var lu=["BUTTON","INPUT","LABEL","A"];function cu(t){var e=t.hostRef,n=t.isActiveRef,r=(0,al.inject)(Al.EDITOR);au({event:"mousedown",targetRef:eu(e),isActiveRef:n,onEvent:function(t){lu.includes(t.target.tagName)||(r.isFocused&&(t.stopPropagation(),t.preventDefault()),r.chain().restoreSelection().run())}})}var uu=Symbol("scrollView"),du=bl({name:"ScrollView",setup:function(){var t=(0,al.ref)(null),e=(0,al.ref)(null);return(0,al.provide)(uu,e),(0,al.onMounted)((function(){var n=Yc.getOptions(t.value.attributes),r=new Yc(t.value,n);e.value=r.getScrollElement()})),{hostRef:t}}},Yl,[],!1,null,"56dc828f",null);du.options.__file="lib/components/base/ScrollView.vue";const pu=du.exports;var hu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("label",{staticClass:"zw-field-label",attrs:{for:t.fieldId}},[t._t("default")],2)};hu._withStripped=!0;var fu=bl({name:"FieldLabel",props:{fieldId:{type:String,required:!0}}},hu,[],!1,null,"2be4d197",null);fu.options.__file="lib/components/base/FieldLabel.vue";const mu=fu.exports;var vu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("input",{staticClass:"zw-range",style:t.inputStyles,attrs:{type:"range",id:t.fieldId,min:t.min,max:t.max,step:t.step},domProps:{value:t.tempValue},on:{input:function(e){return t.update(e)}}})};vu._withStripped=!0;var gu=bl({name:"Range",props:{min:{type:[String,Number],required:!0},max:{type:[String,Number],required:!0},step:{type:[String,Number],required:!0},value:{type:[String,Number],required:!0},fieldId:{type:String,required:!1,default:""}},setup:function(t,e){var n=e.emit,r=tu({valueRef:(0,al.toRef)(t,"value"),format:Number});return{inputStyles:(0,al.computed)((function(){var e=Number(t.min),n=Number(t.max),o=Number(t.step),i=Math.ceil(r.value/o)*o;return{"--zw-range-progress":"".concat((i-e)/(n-e)*100,"%")}})),tempValue:r,update:function(t){r.value=Number(t.target.value),n("input",r.value)}}}},vu,[],!1,null,"4cc06850",null);gu.options.__file="lib/components/base/Range.vue";const yu=gu.exports;var bu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zw-number-field",class:t.elementClasses},[n("input",{staticClass:"zw-number-field__input",attrs:{type:"number",id:t.fieldId,disabled:t.disabled},domProps:{value:t.tempValue},on:{change:t.onChange}}),t._v(" "),n("div",{staticClass:"zw-number-field__controls"},[n("div",{staticClass:"zw-number-field__buttons"},[n("Button",{staticClass:"zw-number-field__increment-button",attrs:{disabled:t.disabled,"data-test-selector":"increment-button",type:"button"},on:{click:t.incrementValue}}),t._v(" "),n("Button",{staticClass:"zw-number-field__decrement-button",attrs:{disabled:t.disabled,"data-test-selector":"decrement-button",type:"button"},on:{click:t.decrementValue}})],1),t._v(" "),t.units?n("p",{staticClass:"zw-number-field__units"},[t._v("\n "+t._s(t.units)+"\n ")]):t._e()])])};bu._withStripped=!0;var wu=bl({name:"NumberField",components:{Button:Rl},props:{value:{required:!0,type:[Number,String]},min:{type:[Number,String],required:!1,default:null},max:{type:[Number,String],required:!1,default:null},digits:{type:[Number,String],required:!1,default:2},step:{type:[Number,String],required:!1,default:1},units:{type:String,required:!1,default:""},disabled:{type:Boolean,required:!1,default:!1},fieldId:{type:String,required:!1,default:""}},setup:function(t,e){var n=e.emit,r=function(t){return null===t?null:Number(t)},o=function(t){var e=t.digits,n=t.min,r=t.max,o=t.onChange;function i(t){return Number(parseFloat(t).toFixed(e))}var s=tu({valueRef:t.valueRef,format:i});function a(t){return null!==n&&t<n?n:null!==r&&t>r?r:t}return{temp:s,change:function(t){s.value=t,""===s.value&&(s.value=null!=n?n:1);var e=a(Number.parseFloat(s.value));s.value=i(e),o(s.value)},increment:function(t){var e=a(s.value+Number(t));s.value=i(e),o(s.value)},decrement:function(t){var e=a(s.value-Number(t));s.value=i(e),o(s.value)}}}({valueRef:(0,al.toRef)(t,"value"),onChange:function(t){return n("input",t)},digits:Number(t.digits),min:r(t.min),max:r(t.max)});return{elementClasses:(0,al.computed)((function(){return{"zw-number-field--disabled":t.disabled}})),tempValue:o.temp,onChange:function(t){return o.change(t.target.value)},incrementValue:function(){return o.increment(Number(t.step))},decrementValue:function(){return o.decrement(Number(t.step))}}}},bu,[],!1,null,"289baff8",null);wu.options.__file="lib/components/base/NumberField.vue";const xu=wu.exports;var Su=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"zw-modal-",duration:t.$options.transition}},[t.isOpened?n("div",{directives:[{name:"out-click",rawName:"v-out-click",value:t.close,expression:"close"}],ref:"hostRef",staticClass:"zw-modal",style:t.modalStyles},[t._t("default")],2):t._e()])};Su._withStripped=!0;var Ou=new WeakMap,ku={bind:function(t,e){var n=e.value,r=n.onOutClick||n,o=!n.isDisabled;function i(e){var n=e.target===t||t.contains(e.target);e.target.isConnected&&!n&&r(e)}Ou.set(t,{callback:i,isEnabled:o}),o&&setTimeout((function(){return document.addEventListener("click",i)}))},update:function(t,e){var n=e.value,r=Ou.get(t),o=!n.isDisabled;o!==r.isEnabled&&(o?document.addEventListener("click",r.callback):document.removeEventListener("click",r.callback),Ou.set(t,{callback:r.callback,isEnabled:o}))},unbind:function(t){document.removeEventListener("click",Ou.get(t).callback)}};function Eu(t,e){var n=e.value,r="string"==typeof n?{text:n}:n,o=r.text,i=r.hotkey;o&&(t.dataset.tooltip=o),o&&i&&(t.dataset.tooltipHotkey=i)}var Cu=bl({name:"Modal",transition:{enter:200,leave:100},directives:{outClick:ku},props:{toggler:{type:Object,required:!1,default:null},maxHeight:{type:[Number,String],required:!1,default:1e3},maxWidth:{type:[Number,String],required:!1,default:1e3}},setup:function(t){var e=t.toggler||su(),n=(0,al.ref)(null),r=(0,al.computed)((function(){return{"--zw-modal-max-height":"".concat(t.maxHeight,"px"),"--zw-modal-max-width":"".concat(t.maxWidth,"px")}}));return cu({isActiveRef:e.isOpened,hostRef:n}),{hostRef:n,modalStyles:r,close:e.close,isOpened:e.isOpened}}},Su,[],!1,null,"0a3c1c80",null);Cu.options.__file="lib/components/base/Modal.vue";const Mu=Cu.exports;var Tu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"dropdownRef",staticClass:"zw-dropdown"},[n("DropdownActivator",{scopedSlots:t._u([{key:"default",fn:function(e){return[t._t("activator",null,null,e)]}}],null,!0)}),t._v(" "),n("Modal",{ref:"modalRef",attrs:{"max-height":"300","max-width":"156",toggler:t.toggler}},[n("DropdownMenu",{attrs:{options:t.options},scopedSlots:t._u([{key:"option",fn:function(e){return[t._t("option",null,null,e)]}}],null,!0)})],1)],1)};Tu._withStripped=!0;var Au=Object.freeze({ACTIVE_MANAGER:Symbol("dropdownActiveManager"),TOGGLER:Symbol("dropdownToggler"),SESSION:Symbol("session")}),Nu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("Button",{staticClass:"zw-dropdown__activator",class:t.dropdownClasses,attrs:{skin:"toolbar",active:t.isOpened},on:{click:t.open}},[n("span",{staticClass:"zw-dropdown__activator-title zw-text--truncate"},[t._v("\n "+t._s(t.activeOptionTitle)+"\n ")]),t._v(" "),n("Icon",{staticClass:"zw-dropdown__activator-arrow",attrs:{name:"arrow",size:"8px","auto-color":""}})],1)]}),{open:t.open,isOpened:t.isOpened})],2)};function Du(t){return(0,al.computed)((function(){var e,n;return(null===(e=t.value)||void 0===e?void 0:e.title)||(null===(n=t.value)||void 0===n?void 0:n.id)||""}))}Nu._withStripped=!0;var _u=bl({name:"DropdownActivator",components:{Icon:Xl,Button:Rl},model:{event:"change"},setup:function(){var t=(0,al.inject)(Au.ACTIVE_MANAGER),e=(0,al.inject)(Au.TOGGLER),n=Du(t.activeOption),r=(0,al.computed)((function(){return{"zw-dropdown__activator--active":e.isOpened.value}}));return{activeOptionTitle:n,isOpened:e.isOpened,open:e.open,dropdownClasses:r}}},Nu,[],!1,null,"4865ea7a",null);_u.options.__file="lib/components/base/dropdown/DropdownActivator.vue";const Ru=_u.exports;var Iu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ScrollView",[n("div",{staticClass:"zw-dropdown__menu",attrs:{"data-test-selector":"dropdownMenu"}},[t._l(t.options,(function(e,r){return[e.options?[n("DropdownGroup",{key:e.id,attrs:{group:e},scopedSlots:t._u([{key:"option",fn:function(e){return[t._t("option",null,null,e)]}}],null,!0)}),t._v(" "),r+1!==t.options.length?n("DropdownDivider",{key:e.id+" divider"}):t._e()]:t._t("option",(function(){return[n("DropdownOption",{attrs:{option:e}})]}),{option:e})]}))],2)])};Iu._withStripped=!0;var zu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"zw-dropdown__group"},[n("p",{staticClass:"zw-dropdown__group-title"},[t._v("\n "+t._s(t.groupTitle)+"\n ")]),t._v(" "),t._l(t.group.options,(function(e){return t._t("option",(function(){return[n("DropdownOption",{attrs:{option:e}})]}),{option:e})}))],2)};zu._withStripped=!0;var Lu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Button",{ref:"optionRef",staticClass:"zw-dropdown__option zw-text--truncate",class:t.classes,on:{click:t.activate}},[t._t("default",(function(){return[t._v(t._s(t.optionTitle))]}))],2)};Lu._withStripped=!0;var Pu=bl({name:"DropdownOption",components:{Button:Rl},props:{option:{type:Object,required:!0}},setup:function(t){var e,n=(0,al.inject)(Au.ACTIVE_MANAGER),r=(0,al.inject)(Au.TOGGLER),o=(0,al.inject)(Au.SESSION),i=(0,al.ref)(null),s=(e=(0,al.inject)(uu),{scrollToElement:function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).offset;if(e.value){var r=e.value.getBoundingClientRect(),o=t.getBoundingClientRect().top-r.top;e.value.scrollTo({top:o-(n||0)})}}}),a=Du((0,al.toRef)(t,"option")),l=(0,al.computed)((function(){var e;return t.option.id===(null===(e=n.activeOption.value)||void 0===e?void 0:e.id)})),c=(0,al.computed)((function(){return{"zw-dropdown__option--active":l.value}}));return(0,al.onMounted)(ru(iu().mark((function t(){var e,n;return iu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!l.value||o.scrolled){t.next=7;break}return o.scrolled=!0,t.next=4,(0,al.nextTick)();case 4:e=i.value.$el,n=1.5*e.offsetHeight,s.scrollToElement(e,{offset:n});case 7:case"end":return t.stop()}}),t)})))),{optionTitle:a,classes:c,isActive:l,optionRef:i,activate:function(){n.activateOption(t.option),r.close()}}}},Lu,[],!1,null,"10a0f0b7",null);Pu.options.__file="lib/components/base/dropdown/DropdownOption.vue";const Bu=Pu.exports;var Fu=bl({name:"DropdownGroup",components:{DropdownOption:Bu},props:{group:{type:Object,required:!0}},setup:function(t){return{groupTitle:Du((0,al.toRef)(t,"group"))}}},zu,[],!1,null,"207aa7a6",null);Fu.options.__file="lib/components/base/dropdown/DropdownGroup.vue";const ju=Fu.exports;var Vu=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"zw-dropdown__divider"})};Vu._withStripped=!0;var $u=bl({name:"DropdownDivider"},Vu,[],!1,null,"72e4c372",null);$u.options.__file="lib/components/base/dropdown/DropdownDivider.vue";var Hu=bl({name:"DropdownMenu",components:{ScrollView:pu,DropdownGroup:ju,DropdownOption:Bu,DropdownDivider:$u.exports},props:{options:{type:Array,required:!0}},setup:function(){(0,al.provide)(Au.SESSION,{})}},Iu,[],!1,null,null,null);Hu.options.__file="lib/components/base/dropdown/DropdownMenu.vue";var Wu=bl({name:"Dropdown",components:{Modal:Mu,DropdownActivator:Ru,DropdownMenu:Hu.exports},model:{event:"change"},props:{value:{type:String,required:!1,default:null},options:{type:Array,required:!0}},setup:function(t,e){var n=e.emit,r=(0,al.ref)(null),o=(0,al.ref)(null),i=function(t){var e=t.optionsRef,n=t.inputRef,r=t.stateless,o=t.onChange,i=(0,al.ref)(null);function s(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).emitEvent;r||(i.value=t),!1!==e&&o(t)}var a=function(){return t=n.value,r={emitEvent:!1},void s(e.value.flatMap((function(t){return t.options||t})).find((function(e){return e.id===t})),r);var t,r};return a(),(0,al.watch)(n,a),{activeOption:i,activateOption:s}}({optionsRef:(0,al.toRef)(t,"options"),inputRef:(0,al.toRef)(t,"value"),stateless:null===t.value,onChange:function(t){return n("change",t.id)}}),s=su({wrapperRef:r,modalRef:o});return(0,al.provide)(Au.ACTIVE_MANAGER,i),(0,al.provide)(Au.TOGGLER,s),{dropdownRef:r,modalRef:o,toggler:s}}},Tu,[],!1,null,"35f81e22",null);Wu.options.__file="lib/components/base/dropdown/Dropdown.vue";const qu=Wu.exports;var Uu=function(){var t=this,e=t.$createElement;return(t._self._c||e)("ZipifyColorPicker",{directives:[{name:"out-click",rawName:"v-out-click",value:{onOutClick:t.close,isDisabled:!t.isOpened},expression:"{ onOutClick: close, isDisabled: !isOpened }"}],ref:"pickerRef",attrs:{placement:"bottom-end","favorite-colors":t.favoriteColors},on:{changeFavoriteColors:t.updateFavoriteColors},scopedSlots:t._u([{key:"activator",fn:function(){return[t._t("activator",null,{isOpened:t.isOpened,open:t.open,close:t.close,toggle:t.toggle})]},proxy:!0}],null,!0),model:{value:t.editingColor,callback:function(e){t.editingColor=e},expression:"editingColor"}})};Uu._withStripped=!0;var Gu=bl({name:"ColorPicker",components:{ZipifyColorPicker:Gl.ZipifyColorPicker},directives:{outClick:ku},props:{value:{type:String,required:!0}},setup:function(t,e){var n=e.emit,r=(0,al.inject)(Al.FAVORITE_COLORS),o=(0,al.inject)(Al.EDITOR),i=(0,al.ref)(null),s=function(t){var e=t.pickerRef,n=t.initialColorRef,r=t.onClosed,o=t.onBeforeOpened,i=(0,al.ref)(n.value),s=(0,al.computed)((function(){var t,n;return null!==(t=null===(n=e.value)||void 0===n?void 0:n.isVisible)&&void 0!==t&&t}));function a(){o(),i.value=n.value,e.value.open(e.value.$el)}function l(){e.value.close(i.value),r(i.value)}return{isOpened:s,editingColor:i,open:a,close:l,toggle:function(){s.value?l():a()},cancel:function(){i.value=n.value,e.value.close(i.value)}}}({onClosed:function(e){o.commands.restoreSelection(),e!==t.value&&n("change",e)},onBeforeOpened:function(){o.commands.storeSelection(),n("before-opened")},pickerRef:i,initialColorRef:(0,al.toRef)(t,"value")});return function(t){var e=t.isOpenedRef,n=t.onCancel,r=t.onApply;function o(t,e){t.stopImmediatePropagation(),t.preventDefault(),e()}au({targetRef:(0,al.ref)(document),isActiveRef:e,event:"keydown",onEvent:function(t){switch(t.key){case"Escape":return o(t,n);case"Enter":return o(t,r)}},options:{capture:!0}})}({isOpenedRef:s.isOpened,onCancel:function(){return s.cancel()},onApply:function(){return s.close()}}),cu({hostRef:i,isActiveRef:s.isOpened}),{pickerRef:i,isOpened:s.isOpened,editingColor:s.editingColor,open:s.open,close:s.close,toggle:s.toggle,favoriteColors:r.listRef,updateFavoriteColors:function(t){r.triggerUpdate(t)}}}},Uu,[],!1,null,null,null);Gu.options.__file="lib/components/base/colorPicker/ColorPicker.vue";const Ku=Gu.exports;var Ju=bl({name:"StylePresetControl",components:{Icon:Xl,Button:Rl,Dropdown:qu},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR),e=t.commands.getPresetList(),n=t.commands.getPreset(),r=t.commands.getPresetCustomization(),o=(0,al.computed)((function(){var t=r.value,e=t.attributes,n=t.marks;return!!e.length||!!n.length})),i=(0,al.computed)((function(){return e.value.map((function(t){return{id:t.id,title:t.name}}))}));return{options:i,preset:n,isCustomized:o,apply:function(e){return t.chain().focus().applyPreset(e).run()},removeCustomization:function(){return t.chain().focus().removePresetCustomization().run()}}}},Tl,[],!1,null,"0f6b31b1",null);Ju.options.__file="lib/components/toolbar/controls/StylePresetControl.vue";const Zu=Ju.exports;var Xu=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Font Name",expression:"'Font Name'"}],staticClass:"zw-font-family-control",attrs:{options:t.options,value:t.currentValue},on:{change:t.apply},scopedSlots:t._u([{key:"option",fn:function(e){var r=e.option;return[n("DropdownOption",{directives:[{name:"tooltip",rawName:"v-tooltip",value:r.id,expression:"option.id"}],staticClass:"zw-font-family-control__option",style:t.renderOptionStyles(r),attrs:{option:r}})]}}])})};function Yu(t){return function(t){if(Array.isArray(t))return Fl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||jl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Xu._withStripped=!0;var Qu="wswg.recently_used_fonts";function td(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ed=bl({name:"FontFamilyControl",components:{Dropdown:qu,DropdownOption:Bu},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.FONTS),e=(0,al.inject)(Al.EDITOR),n=function(t){var e=(0,al.inject)(Al.LOCAL_STORAGE),n=(0,al.ref)(e.getItem(Qu)||[]),r=(0,al.computed)((function(){return!n.value.length}));return{fonts:n,isEmpty:r,add:function(t){n.value=Array.from(new Set([t].concat(Yu(n.value)))).slice(0,5),e.setItem(Qu,n.value)}}}(),r=(0,al.computed)((function(){return{id:"Recently Used",options:n.fonts.value.map((function(t){return{id:t}}))}}));return{options:(0,al.computed)((function(){var e,o={},i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return td(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?td(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(t);try{for(i.s();!(e=i.n()).done;){var s,a,l=e.value;null!==(a=o[s=l.category])&&void 0!==a||(o[s]={id:l.category,options:[]}),o[l.category].options.push({id:l.name})}}catch(t){i.e(t)}finally{i.f()}return n.isEmpty.value?Object.values(o):[r.value].concat(Yu(Object.values(o)))})),currentValue:e.commands.getFontFamily(),renderOptionStyles:function(t){return{"--zw-font-family-option":'"'.concat(t.id,'"')}},apply:function(t){n.add(t),e.chain().focus().applyFontFamily(t).run()}}}},Xu,[],!1,null,"2e95c716",null);ed.options.__file="lib/components/toolbar/controls/FontFamilyControl.vue";const nd=ed.exports;var rd=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Font Weight",hotkey:"Mod B"},expression:"{ text: 'Font Weight', hotkey: 'Mod B' }"}],attrs:{options:t.options,value:t.currentValue},on:{change:t.apply}})};rd._withStripped=!0;var od=bl({name:"FontWeightControl",components:{Dropdown:qu},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR),e=t.commands.getFont();return{options:(0,al.computed)((function(){return e.value.weights.map((function(t){return{id:t}}))})),currentValue:t.commands.getFontWeight(),apply:function(e){return t.chain().focus().applyFontWeight(e).run()}}}},rd,[],!1,null,null,null);od.options.__file="lib/components/toolbar/controls/FontWeightControl.vue";const id=od.exports;var sd=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Dropdown",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Font Size",hotkey:"Mod Shift +/-"},expression:"{ text: 'Font Size', hotkey: 'Mod Shift +/-' }"}],attrs:{options:t.options,value:t.currentValue},on:{change:t.apply}})};sd._withStripped=!0;const ad={name:"FontSizeControl",components:{Dropdown:qu},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.FONT_SIZES),e=(0,al.inject)(Al.EDITOR),n=(0,al.computed)((function(){return t.map((function(t){return{id:t,title:"".concat(t,"px")}}))}));return{options:n,currentValue:e.commands.getFontSize(),apply:function(t){return e.chain().focus().applyFontSize(t).run()}}}};var ld=bl(ad,sd,[],!1,null,null,null);ld.options.__file="lib/components/toolbar/controls/FontSizeControl.vue";const cd=ld.exports;var ud=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ColorPicker",{attrs:{value:t.currentValue},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(t){var e=t.toggle,r=t.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Font Color",expression:"'Font Color'"}],attrs:{icon:"",skin:"toolbar",active:r},on:{click:e}},[n("Icon",{attrs:{name:"font-color",size:"28px","auto-color":""}})],1)]}}])})};ud._withStripped=!0;var dd=bl({name:"FontColorControl",components:{ColorPicker:Ku,Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR);return{currentValue:t.commands.getFontColor(),apply:function(e){return t.chain().applyFontColor(e).run()}}}},ud,[],!1,null,null,null);dd.options.__file="lib/components/toolbar/controls/FontColorControl.vue";const pd=dd.exports;var hd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ColorPicker",{attrs:{value:t.currentValue},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(t){var e=t.toggle,r=t.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Background Color",expression:"'Background Color'"}],attrs:{icon:"",skin:"toolbar",active:r},on:{click:e}},[n("Icon",{attrs:{name:"background-color",size:"28px","auto-color":""}})],1)]}}])})};hd._withStripped=!0;var fd=bl({name:"BackgroundColorControl",components:{ColorPicker:Ku,Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR);return{currentValue:t.commands.getBackgroundColor(),apply:function(e){return t.chain().applyBackgroundColor(e).run()}}}},hd,[],!1,null,null,null);fd.options.__file="lib/components/toolbar/controls/BackgroundColorControl.vue";const md=fd.exports;var vd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Italic",hotkey:"Mod I"},expression:"{ text: 'Italic', hotkey: 'Mod I' }"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue,disabled:!t.isAvailable},on:{click:t.apply}},[n("Icon",{attrs:{name:"italic",size:"28px","auto-color":""}})],1)};vd._withStripped=!0;var gd=bl({name:"ItalicControl",components:{Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR),e=t.commands.isItalic();return{isAvailable:t.commands.isItalicAvailable(),currentValue:e,apply:function(){return t.chain().focus().toggleItalic().run()}}}},vd,[],!1,null,null,null);gd.options.__file="lib/components/toolbar/controls/ItalicControl.vue";const yd=gd.exports;var bd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:{text:"Underline",hotkey:"Mod U"},expression:"{ text: 'Underline', hotkey: 'Mod U' }"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue},on:{click:t.apply}},[n("Icon",{attrs:{name:"underline",size:"28px","auto-color":""}})],1)};bd._withStripped=!0;var wd=bl({name:"UnderlineControl",components:{Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR);return{currentValue:t.commands.isUnderline(),apply:function(){return t.chain().focus().toggleUnderline().run()}}}},bd,[],!1,null,null,null);wd.options.__file="lib/components/toolbar/controls/UnderlineControl.vue";const xd=wd.exports;var Sd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Strikethrough",expression:"'Strikethrough'"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue},on:{click:t.apply}},[n("Icon",{attrs:{name:"strike-through",size:"28px","auto-color":""}})],1)};Sd._withStripped=!0;var Od=bl({name:"StrikeThroughControl",components:{Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR);return{currentValue:t.commands.isStrikeThrough(),apply:function(){return t.chain().focus().toggleStrikeThrough().run()}}}},Sd,[],!1,null,null,null);Od.options.__file="lib/components/toolbar/controls/StrikeThroughControl.vue";const kd=Od.exports;var Ed=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Superscript",expression:"'Superscript'"}],attrs:{skin:"toolbar",icon:"",active:t.currentValue},on:{click:t.apply}},[n("Icon",{attrs:{name:"superscript",size:"28px","auto-color":""}})],1)};Ed._withStripped=!0;var Cd=bl({name:"SuperscriptControl",components:{Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR);return{currentValue:(0,al.computed)((function(){return t.isActive("superscript")})),apply:function(){return t.chain().focus().toggleSuperscript().run()}}}},Ed,[],!1,null,null,null);Cd.options.__file="lib/components/toolbar/controls/SuperscriptControl.vue";const Md=Cd.exports;var Td=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",{attrs:{options:t.$options.styles},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(t){var e=t.open,r=t.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Case Styles",expression:"'Case Styles'"}],attrs:{icon:"",skin:"toolbar",active:r},on:{click:e}},[n("Icon",{attrs:{name:"case-style",size:"28px","auto-color":""}})],1)]}}])})};Td._withStripped=!0;var Ad=bl({name:"CaseStyleControl",components:{Dropdown:qu,Button:Rl,Icon:Xl},directives:{tooltip:Eu},styles:[{id:pl.UPPERCASE,title:"UPPERCASE"},{id:pl.LOWERCASE,title:"lowercase"},{id:pl.CAPITALIZE,title:"Capitalize"}],setup:function(){var t=(0,al.inject)(Al.EDITOR);return{apply:function(e){return t.chain().focus().applyCaseStyle(e).run()}}}},Td,[],!1,null,null,null);Ad.options.__file="lib/components/toolbar/controls/CaseStyleControl.vue";const Nd=Ad.exports;var Dd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ButtonToggle",{attrs:{value:t.currentValue,options:t.$options.alignments},on:{change:t.apply},scopedSlots:t._u([{key:"option",fn:function(t){var e=t.isActive,r=t.option,o=t.activate;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:r.tooltip,expression:"option.tooltip"}],attrs:{icon:"",skin:"toolbar",active:e},on:{click:o}},[n("Icon",{attrs:{name:"alignment-"+r.id,size:"28px","auto-color":""}})],1)]}}])})};Dd._withStripped=!0;var _d=bl({name:"AlignmentControl",alignments:[{id:hl.LEFT,tooltip:{text:"Align Left",hotkey:"Mod Shift L"}},{id:hl.CENTER,tooltip:{text:"Align Center",hotkey:"Mod Shift E"}},{id:hl.RIGHT,tooltip:{text:"Align Right",hotkey:"Mod Shift R"}},{id:hl.JUSTIFY,tooltip:{text:"Justify",hotkey:"Mod Shift J"}}],components:{ButtonToggle:Ll,Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(t,e){var n=e.emit,r=(0,al.inject)(Al.EDITOR);return{currentValue:r.commands.getAlignment(),apply:function(t){r.chain().focus().applyAlignment(t).run(),n("applied")}}}},Dd,[],!1,null,null,null);_d.options.__file="lib/components/toolbar/controls/AlignmentControl.vue";const Rd=_d.exports;var Id=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wrapperRef",staticClass:"zw-position--relative"},[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Alignment",expression:"'Alignment'"}],attrs:{icon:"",skin:"toolbar",active:t.isOpened},on:{click:t.toggler.open}},[n("Icon",{attrs:{name:"alignment-"+t.currentValue,size:"28px","auto-color":""}})],1),t._v(" "),n("Modal",{ref:"modalRef",staticClass:"zw-alignment-control__modal",attrs:{toggler:t.toggler}},[n("AlignmentControl",{staticClass:"zw-alignment-control__toggle",on:{applied:t.toggler.close}})],1)],1)};Id._withStripped=!0;var zd=bl({name:"AlignmentDeviceControl",components:{Button:Rl,Icon:Xl,Modal:Mu,AlignmentControl:Rd},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR).commands.getAlignment(),e=(0,al.ref)(null),n=(0,al.ref)(null),r=su({wrapperRef:e,modalRef:n});return{wrapperRef:e,modalRef:n,currentValue:t,toggler:r,isOpened:r.isOpened}}},Id,[],!1,null,"9713d430",null);zd.options.__file="lib/components/toolbar/controls/AlignmentDeviceControl.vue";const Ld=zd.exports;var Pd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"wrapperRef",staticClass:"zw-position--relative"},[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Line Height",expression:"'Line Height'"}],attrs:{icon:"",skin:"toolbar",active:t.isOpened},on:{click:t.toggler.open}},[n("Icon",{attrs:{name:"line-height",size:"28px","auto-color":""}})],1),t._v(" "),n("Modal",{ref:"modalRef",staticClass:"zw-line-height-control__modal",attrs:{toggler:t.toggler}},[n("FieldLabel",{staticClass:"zw-margin-bottom--xs",attrs:{"field-id":"wswg-line-height"}},[t._v("\n Line Height\n ")]),t._v(" "),n("div",{staticClass:"zw-line-height-control__row"},[n("Range",{staticClass:"zw-line-height-control__range",attrs:{step:"0.1",min:"1",max:"3",value:t.currentValue},on:{input:t.apply}}),t._v(" "),n("NumberField",{staticClass:"zw-line-height-control__field",attrs:{step:"0.1",min:"1",max:"3","field-id":"wswg-line-height",value:t.currentValue},on:{input:t.apply}})],1)],1)],1)};Pd._withStripped=!0;var Bd=bl({name:"LineHeightControl",components:{Range:yu,Modal:Mu,Icon:Xl,Button:Rl,NumberField:xu,FieldLabel:mu},directives:{tooltip:Eu},setup:function(){var t=(0,al.ref)(null),e=(0,al.ref)(null),n=(0,al.inject)(Al.EDITOR),r=su({wrapperRef:t,modalRef:e}),o=n.commands.getLineHeight();return{wrapperRef:t,modalRef:e,isOpened:r.isOpened,toggler:r,currentValue:o,apply:function(t){return n.commands.applyLineHeight(String(t))}}}},Pd,[],!1,null,"b87c3724",null);Bd.options.__file="lib/components/toolbar/controls/LineHeightControl.vue";const Fd=Bd.exports;var jd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Dropdown",{attrs:{value:t.currentValue,options:t.$options.listTypes},on:{change:t.apply},scopedSlots:t._u([{key:"activator",fn:function(e){var r=e.open,o=e.isOpened;return[n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Bullet Styles",expression:"'Bullet Styles'"}],attrs:{icon:"",skin:"toolbar",active:o||t.isList},on:{click:r}},[n("Icon",{attrs:{name:t.currentIcon,size:"28px","auto-color":""}})],1)]}},{key:"option",fn:function(t){var e=t.option;return[n("DropdownOption",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.tooltip,expression:"option.tooltip"}],staticClass:"zw-list-control__option",attrs:{option:e}},[n("Icon",{attrs:{name:e.icon,size:"28px","auto-color":""}})],1)]}}])})};jd._withStripped=!0;var Vd=bl({name:"ListControl",listTypes:ml.values.map((function(t){return{id:t,icon:"list-".concat(t)}})),components:{Dropdown:qu,DropdownOption:Bu,Button:Rl,Icon:Xl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR),e=t.commands.getListType();return{isList:(0,al.computed)((function(){return!!e.value})),currentValue:(0,al.computed)((function(){return e.value||"none"})),currentIcon:(0,al.computed)((function(){var t=e.value||ml.DISC;return"list-".concat(t)})),apply:function(e){return t.chain().focus().applyList(e).run()}}}},jd,[],!1,null,"305d852b",null);Vd.options.__file="lib/components/toolbar/controls/ListControl.vue";const $d=Vd.exports;var Hd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("Button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:"Remove Styles",expression:"'Remove Styles'"}],attrs:{skin:"toolbar",icon:""},on:{click:t.apply}},[n("Icon",{attrs:{name:"remove-format",size:"28px","auto-color":""}})],1)};Hd._withStripped=!0;var Wd=bl({name:"RemoveFormatControl",components:{Icon:Xl,Button:Rl},directives:{tooltip:Eu},setup:function(){var t=(0,al.inject)(Al.EDITOR);return{apply:function(){return t.chain().focus().removeFormat().run()}}}},Hd,[],!1,null,null,null);Wd.options.__file="lib/components/toolbar/controls/RemoveFormatControl.vue";var qd=bl({name:"ToolbarFull",components:{ToolbarRow:kl,ToolbarGroup:Ml,ToolbarDivider:xl,StylePresetControl:Zu,CaseStyleControl:Nd,FontFamilyControl:nd,FontWeightControl:id,FontSizeControl:cd,FontColorControl:pd,BackgroundColorControl:md,ItalicControl:yd,UnderlineControl:xd,SuperscriptControl:Md,StrikeThroughControl:kd,AlignmentControl:Rd,LineHeightControl:Fd,ListControl:$d,RemoveFormatControl:Wd.exports}},gl,[],!1,null,null,null);qd.options.__file="lib/components/toolbar/ToolbarFull.vue";const Ud=qd.exports;var Gd=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ToolbarRow",[n("StylePresetControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("AlignmentDeviceControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("FontSizeControl"),t._v(" "),n("ToolbarDivider",{attrs:{vertical:""}}),t._v(" "),n("LineHeightControl")],1)};Gd._withStripped=!0;var Kd=bl({name:"ToolbarDevice",components:{ToolbarRow:kl,ToolbarDivider:xl,StylePresetControl:Zu,AlignmentDeviceControl:Ld,FontSizeControl:cd,LineHeightControl:Fd}},Gd,[],!1,null,null,null);Kd.options.__file="lib/components/toolbar/ToolbarDevice.vue";const Jd=Kd.exports;var Zd=bl({name:"Toolbar",props:{device:{type:String,required:!0}},setup:function(t){return{toolbarComponent:(0,al.computed)((function(){return t.device===dl.DESKTOP?Ud:Jd}))}}},ul,[],!1,null,"05accea6",null);Zd.options.__file="lib/components/toolbar/Toolbar.vue";const Xd=Zd.exports;function Yd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qd(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function tp(t,e,n){return e&&Qd(t.prototype,e),n&&Qd(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var ep=function(){function t(){Yd(this,t)}return tp(t,null,[{key:"decode",value:function(t){try{return JSON.parse(t)}catch(t){return console.error(t),null}}},{key:"encode",value:function(t){return JSON.stringify(t)}}]),t}(),np=function(){function t(e){Yd(this,t),this.nativeStorage=e,this.KEY_PREFIX="zp."}return tp(t,[{key:"makeKey",value:function(t){return this.KEY_PREFIX+t}},{key:"setItem",value:function(t,e){var n=this,r=ep.encode(e);this.accessToStorage((function(e){return e.setItem(n.makeKey(t),r)}))}},{key:"getItem",value:function(t){var e=this,n=this.accessToStorage((function(n){return n.getItem(e.makeKey(t))}));return ep.decode(n)}},{key:"accessToStorage",value:function(t){try{return t(this.nativeStorage)}catch(t){this.onPrivateModeEnabled(t)}}},{key:"onPrivateModeEnabled",value:function(t){console.error(t)}}]),t}(),rp=tp((function t(e){var n=e.listRef,r=e.triggerUpdate;Yd(this,t),this.listRef=n,this.triggerUpdate=r}));function op(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return ip(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ip(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function ip(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var sp=function(){function t(){Yd(this,t)}return tp(t,[{key:"normalize",value:function(t){return"string"!=typeof t?t:this._normalizeTextContent(t)}},{key:"_normalizeTextContent",value:function(t){var e=(new DOMParser).parseFromString(t,"text/html");return this._iterateNodes(e,this._normalizeStructure.bind(this),(function(t){return"SPAN"===t.tagName})),this._iterateNodes(e,this._normalizeStyles.bind(this),(function(t){return"SPAN"!==t.tagName})),e.body.innerHTML}},{key:"_iterateNodes",value:function(t,e,n){for(var r=t.createNodeIterator(t.body,NodeFilter.SHOW_ELEMENT,{acceptNode:function(t){return n(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),o=r.nextNode();o;)e(o),o=r.nextNode()}},{key:"_normalizeStructure",value:function(t){var e=Array.from(t.childNodes).every((function(t){return t.nodeType===Node.TEXT_NODE}));if(!e){var n,r=t.cloneNode(!0),o=this._getMigratingStyles(t),i=[],s=op(r.childNodes);try{for(s.s();!(n=s.n()).done;){var a=n.value,l=a;o.length&&(l=this._wrapTextNode(r,a),this._assignElementProperties(l,r,o)),i.push(l)}}catch(t){s.e(t)}finally{s.f()}t.replaceWith.apply(t,i)}}},{key:"_normalizeStyles",value:function(t){var e,n=this._getMigratingStyles(t),r=op(t.childNodes);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=this._wrapTextNode(t,o);this._assignElementProperties(i,t,n)}}catch(t){r.e(t)}finally{r.f()}this._removeStyleProperties(t,n)}},{key:"_getMigratingStyles",value:function(e){for(var n=t.NORMALIZING_STYLE_BLACKLIST,r=[],o=0;o<e.style.length;o++){var i=e.style.item(o);n.includes(i)||r.push(i)}return r}},{key:"_wrapTextNode",value:function(t,e){if(e.nodeType!==Node.TEXT_NODE)return e;var n=document.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}},{key:"_assignElementProperties",value:function(t,e,n){var r,o=op(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;t.style.getPropertyValue(i)||t.style.setProperty(i,e.style.getPropertyValue(i))}}catch(t){o.e(t)}finally{o.f()}}},{key:"_removeStyleProperties",value:function(t,e){var n,r=op(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;t.style.removeProperty(o)}}catch(t){r.e(t)}finally{r.f()}0===t.style.length&&t.removeAttribute("style")}}]),t}();Dl(sp,"NORMALIZING_STYLE_BLACKLIST",["text-align","line-height"]);var ap=200,lp=function(){};lp.prototype.append=function(t){return t.length?(t=lp.from(t),!this.length&&t||t.length<ap&&this.leafAppend(t)||this.length<ap&&t.leafPrepend(this)||this.appendInner(t)):this},lp.prototype.prepend=function(t){return t.length?lp.from(t).append(this):this},lp.prototype.appendInner=function(t){return new up(this,t)},lp.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?lp.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},lp.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},lp.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)},lp.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},lp.from=function(t){return t instanceof lp?t:t&&t.length?new cp(t):lp.empty};var cp=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 o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=ap)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=ap)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}(lp);lp.empty=new cp([]);var up=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 t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=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}(lp);const dp=lp;class pp{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new hp(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new hp(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new pp(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,c=t.steps[n].invert(t.docs[n]),u=new hp(t.mapping.maps[n],c,e);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),e&&(i++,e=void 0),r||(a=u)}let l=i-n.depth;return l>mp&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new pp(s.append(o),i)}remapping(t,e){let n=new vt;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new pp(this.items.append(t.map((t=>new hp(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new hp(l,i,c))}else n.push(new hp(l))}),r);let l=[];for(let t=e;t<i;t++)l.push(new hp(o.maps[t]));let c=this.items.slice(0,r).append(l).append(n),u=new pp(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}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=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new hp(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new pp(dp.from(r.reverse()),o)}}pp.empty=new pp(dp.empty,0);class hp{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 hp(e.getMap().invert(),e,this.selection)}}}class fp{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const mp=20;function vp(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function gp(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function yp(t,e,n,r){let o=xp(e),i=Sp.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),c=new fp(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(Sp,{redo:r,historyState:c}).scrollIntoView())}let bp=!1,wp=null;function xp(t){let e=t.plugins;if(wp!=e){bp=!1,wp=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){bp=!0;break}}return bp}const Sp=new he("history"),Op=new he("closeHistory");function kp(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ue({key:Sp,state:{init:()=>new fp(pp.empty,pp.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(Sp);if(i)return i.historyState;n.getMeta(Op)&&(t=new fp(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Sp))return s.getMeta(Sp).redo?new fp(t.done.addTransform(n,void 0,r,xp(e)),t.undone,vp(n.mapping.maps[n.steps.length-1]),t.prevTime):new fp(t.done,t.undone.addTransform(n,void 0,r,xp(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new fp(t.done.rebased(n,o),t.undone.rebased(n,o),gp(t.prevRanges,n.mapping),t.prevTime):new fp(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),gp(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(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 o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?gp(t.prevRanges,n.mapping):vp(n.mapping.maps[n.steps.length-1]);return new fp(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,xp(e)),pp.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Ep:"historyRedo"==n?Cp:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const Ep=(t,e)=>{let n=Sp.getState(t);return!(!n||0==n.done.eventCount||(e&&yp(n,t,e,!1),0))},Cp=(t,e)=>{let n=Sp.getState(t);return!(!n||0==n.undone.eventCount||(e&&yp(n,t,e,!0),0))},Mp=xi.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Ep(t,e),redo:()=>({state:t,dispatch:e})=>Cp(t,e)}),addProseMirrorPlugins(){return[kp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Tp=as.create({name:"doc",topNode:!0,content:"block+"}),Ap=as.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",ii(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Np=as.create({name:"text",group:"inline"});function Dp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dp(Object(n),!0).forEach((function(e){Dl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dp(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Rp(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ip(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ip(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function Ip(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var zp=xi.create({name:"node_processor",addCommands:function(){return{setBlockAttributes:Bl((function(t,e,n){var r,o,i=t.commands,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=null!==(r=i.getBlockAttributes(e).value)&&void 0!==r?r:{},l=Rp(fl.blocks);try{for(l.s();!(o=l.n()).done;){var c=o.value;i.updateAttributes(c,Dl({},e,_p(_p(_p({},s),a),n)))}}catch(t){l.e(t)}finally{l.f()}})),getBlockAttributes:Bl((function(t,e,n){var r=t.editor;return(0,al.computed)((function(){var t,o=Object.assign({},n||{}),i=Rp(fl.blocks);try{for(i.s();!(t=i.n()).done;){var s,a=t.value;Object.assign(o,(null===(s=r.getAttributes(a))||void 0===s?void 0:s[e])||{})}}catch(t){i.e(t)}finally{i.f()}return Object.keys(o).length?o:null}))}))}}}),Lp=is({find:/"/,replace:"”"}),Pp=is({find:/'/,replace:"’"}),Bp=is({find:/\(c\)/i,replace:"©"}),Fp=is({find:/\.\.\./,replace:"…"}),jp=is({find:/--/,replace:"—"}),Vp=is({find:/(?:^|[\s{[(<'"\u2018\u201C])(")/,replace:"“"}),$p=is({find:/(?:^|[\s{[(<'"\u2018\u201C])(')/,replace:"‘"}),Hp=is({find:/\(r\)/i,replace:"®"}),Wp=is({find:/\(tm\)/i,replace:"™"}),qp=xi.create({name:"text_processor",addCommands:function(){return{transformText:Bl((function(t,e){var n=t.state,r=n.tr.selection;r.from!==r.to&&n.doc.nodesBetween(r.from,r.to,(function(t,o){if(t.isText){var i=Math.max(o,r.from),s=Math.min(o+t.nodeSize,r.to),a=Math.max(0,r.from-o),l=Math.max(0,r.to-o),c=e({text:t.textContent.substring(a,l),position:{start:i,end:s}}),u=n.schema.text(c,t.marks);n.tr.replaceWith(i,s,u)}}))}))}},addInputRules:function(){return[jp,Hp,Wp,Fp,Vp,$p,Lp,Pp,Bp]}}),Up=xi.create({name:"selection_processor",addStorage:function(){return{selection:null}},addCommands:function(){var t=this;return{storeSelection:Bl((function(e){var n=e.state;t.storage.selection=n.selection})),restoreSelection:Bl((function(e){e.commands.setTextSelection(t.storage.selection)})),expandSelectionToBlock:Bl((function(t){var e=t.state,n=t.commands,r=e.selection.from,o=e.selection.to;e.doc.nodesBetween(r,o,(function(t,e,n){n.type.name===fl.DOCUMENT&&(r=Math.min(r,e+1),o=Math.max(o,e+t.nodeSize-1))})),n.setTextSelection({from:r,to:o})}))}}}),Gp=[Tp,Ap.configure({HTMLAttributes:{class:"zw-style"}}),Np,zp,qp,Up],Kp=ss.create({name:vl.FONT_FAMILY,addOptions:function(){return{fonts:[]}},addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{applyFontFamily:Bl((function(e,n){var r=e.commands;r.setMark(t.name,{value:n});var o=r.findFontByName(n),i=r.getFontWeight().value;o.isWeightSupported(i)||(i=o.findClosestWeight(i),r.applyFontWeight(i)),o.isItalicSupported(i)||r.removeItalic()})),getFont:Bl((function(t){var e=t.commands,n=e.getFontFamily();return(0,al.computed)((function(){return e.findFontByName(n.value)}))})),findFontByName:Bl((function(e,n){return t.options.fonts.find((function(t){return t.name===n}))})),getFontFamily:Bl((function(e){var n=e.editor,r=e.commands.getDefaultFontFamily();return(0,al.computed)((function(){var e,o;return null!==(e=null===(o=n.getAttributes(t.name))||void 0===o?void 0:o.value)&&void 0!==e?e:r.value}))})),getDefaultFontFamily:Bl((function(t){var e=t.commands.getPreset();return(0,al.computed)((function(){return e.value.common.font_family}))}))}},parseHTML:function(){return[{style:"font-family",getAttrs:function(t){return{value:t}}}]},renderHTML:function(t){return ql({font_family:t.HTMLAttributes.value})}});const Jp=as.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}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ii(this.options.HTMLAttributes,e),0]},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=>{return e={find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}},new fi({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=li(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}});var e}))}});function Zp(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Xp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xp(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function Xp(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yp(t,e){return t.split(" ").map((function(t){return".".concat(t)})).join("")+e.id}var Qp=xi.create({name:"style_preset",addExtensions:function(){return[Jp.configure({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})]},addOptions:function(){return{presetsRef:null,defaultId:null,baseClass:null,makeVariable:null}},addStorage:function(){return{presetStyleEl:null}},addGlobalAttributes:function(){var t=this;return[{types:[fl.PARAGRAPH,fl.HEADING],attributes:{preset:{isRequired:!1,default:null,parseHTML:function(e){var n,r=Zp(t.options.presetsRef.value);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.id,s=o.node,a=o.fallbackClass;if(a&&e.classList.contains(a))return{id:i};var l=Yp(t.options.baseClass,{id:i});if(e.matches(l))return{id:i};if(e.tagName==="H".concat(null==s?void 0:s.level))return{id:i}}}catch(t){r.e(t)}finally{r.f()}return"P"===e.tagName?{id:t.options.defaultId}:null},renderHTML:function(e){return e.preset?{class:t.options.baseClass+e.preset.id}:null}}}}]},addCommands:function(){var t=this;function e(t,e){return t.find((function(t){return e===t.id}))}return{getPresetList:Bl((function(){return(0,al.computed)((function(){return t.options.presetsRef.value.filter((function(t){return!t.hidden}))}))})),getPreset:Bl((function(n){var r=n.commands,o=r.getBlockAttributes("preset",{id:t.options.defaultId}),i=r.getPresetList();return(0,al.computed)((function(){return e(i.value,o.value.id)}))})),applyPreset:Bl((function(t,n){var r,o,i=t.commands,s=t.chain,a=e(i.getPresetList().value,n),l=null!==(r=null===(o=a.node)||void 0===o?void 0:o.type)&&void 0!==r?r:fl.PARAGRAPH,c={preset:{id:n}};a.node&&(c.level=a.node.level);var u,d=Zp(vl.attributes);try{for(d.s();!(u=d.n()).done;){var p=u.value;c[p]=i.getBlockAttributes(p).value}}catch(t){d.e(t)}finally{d.f()}s().removeList().setNode(l,c).run()})),applyDefaultPreset:Bl((function(e){e.commands.applyPreset(t.options.defaultId)})),removePreset:Bl((function(t){t.commands.setNode(fl.PARAGRAPH,{preset:null})})),getPresetCustomization:Bl((function(t){var e=t.editor,n=(0,al.toRef)(e,"state");return(0,al.computed)((function(){var t=new Set,e=new Set,r=n.value.selection,o=r.from,i=r.to;return n.value.doc.nodesBetween(o,i,(function(n){for(var r=0,o=Object.entries(n.attrs);r<o.length;r++){var i=Vl(o[r],2),s=i[0],a=i[1];vl.attributes.includes(s)&&a&&t.add(s)}var l,c=Zp(n.marks);try{for(c.s();!(l=c.n()).done;){var u=l.value.type;vl.marks.includes(u.name)&&e.add(u.name)}}catch(t){c.e(t)}finally{c.f()}})),{attributes:Array.from(t),marks:Array.from(e)}}))})),removePresetCustomization:Bl((function(t){(0,t.chain)().storeSelection().expandSelectionToBlock().unsetAllMarks().resetAttributes(fl.PARAGRAPH,vl.attributes).resetAttributes(fl.HEADING,vl.attributes).restoreSelection().run()})),removeFormat:Bl((function(t){var e=t.commands;e.removePresetCustomization(),e.applyDefaultPreset()}))}},onCreate:function(){var t=document.querySelector("[data-zw-styles]");if(t)this.storage.presetStyleEl=t;else{this.storage.presetStyleEl=document.createElement("style"),this.storage.presetStyleEl.dataset.zwStyles="";var e,n=Zp(this.options.presetsRef.value);try{for(n.s();!(e=n.n()).done;){var r,o=e.value,i=Yp(this.options.baseClass,o),s=[" ".concat(i," {")],a=Zp(dl.values);try{for(a.s();!(r=a.n()).done;)for(var l=r.value,c=0,u=Object.keys(o[l]);c<u.length;c++){var d=u[c],p=this.options.makeVariable({device:l,preset:o,property:d}),h=d.replace(/_/i,"-"),f=l===dl.COMMON?"preset":"preset-".concat(l);s.push("--zw-".concat(f,"-").concat(h,": var(").concat(p,", inherit);"))}}catch(t){a.e(t)}finally{a.f()}s.push("}"),this.storage.presetStyleEl.innerHTML+=s.join(" ")}}catch(t){n.e(t)}finally{n.f()}document.head.append(this.storage.presetStyleEl)}}}),th=ss.create({name:vl.FONT_WEIGHT,addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{applyFontWeight:Bl((function(e,n){var r=e.commands;r.setMark(t.name,{value:n}),r.getFont().value.isItalicSupported(n)||r.removeItalic()})),toggleBold:Bl((function(t){var e=t.commands,n=e.getFontWeight().value,r=e.getFont().value,o=Number(n)>=600?"400":"700",i=r.findClosestWeight(o);e.applyFontWeight(i)})),getFontWeight:Bl((function(e){var n=e.editor,r=e.commands,o=r.getDefaultFontWeight(),i=r.getFont();return(0,al.computed)((function(){var e,r,s=null!==(e=null===(r=n.getAttributes(t.name))||void 0===r?void 0:r.value)&&void 0!==e?e:o.value;return i.value.isWeightSupported(s)?s:i.value.findClosestWeight(s)}))})),getDefaultFontWeight:Bl((function(t){var e=t.commands.getPreset();return(0,al.computed)((function(){return e.value.common.font_weight}))}))}},addKeyboardShortcuts:function(){return{"Mod-b":Ul("toggleBold"),"Mod-B":Ul("toggleBold")}},parseHTML:function(){return[{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}},{style:"font-weight",getAttrs:function(t){return{value:t}}}]},renderHTML:function(t){return ql({font_weight:t.HTMLAttributes.value})}}),eh=ss.create({name:vl.FONT_SIZE,addOptions:function(){return{minSize:1,maxSize:100}},addAttributes:function(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands:function(){var t=this;return{getFontSize:Bl((function(e){var n=e.editor,r=e.commands,o=r.getDevice(),i=r.getDefaultFontSize();return(0,al.computed)((function(){var e,r;return null!==(e=null===(r=n.getAttributes(t.name))||void 0===r?void 0:r[o.value])&&void 0!==e?e:i.value}))})),getDefaultFontSize:Bl((function(t){var e=t.commands,n=e.getDevice(),r=e.getPreset();return(0,al.computed)((function(){return r.value[n.value].font_size.replace("px","")}))})),applyFontSize:Bl((function(e,n){var r=e.commands,o=r.getDevice().value;r.setMark(t.name,Dl({},o,n))})),increaseFontSize:Bl((function(e){var n=e.commands,r=Number(n.getFontSize().value),o=Math.min(r+1,t.options.maxSize);n.applyFontSize(String(o))})),decreaseFontSize:Bl((function(e){var n=e.commands,r=Number(n.getFontSize().value),o=Math.max(r-1,t.options.minSize);n.applyFontSize(String(o))}))}},addKeyboardShortcuts:function(){return{"Mod-Shift-=":Ul("increaseFontSize"),"Mod-Shift--":Ul("decreaseFontSize")}},parseHTML:function(){return[{style:"font-size",getAttrs:function(t){var e=String(parseInt(t));return{desktop:e,tablet:e,mobile:e}}}]},renderHTML:function(t){var e=t.HTMLAttributes,n=function(t){return t?"".concat(t,"px"):null};return ql({mobile_font_size:n(e.mobile),tablet_font_size:n(e.tablet),desktop_font_size:n(e.desktop)})}}),nh=ss.create({name:vl.FONT_COLOR,addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{getFontColor:Bl((function(e){var n=e.commands,r=e.editor,o=n.getDefaultFontColor();return(0,al.computed)((function(){var e,n;return null!==(e=null===(n=r.getAttributes(t.name))||void 0===n?void 0:n.value)&&void 0!==e?e:o.value}))})),getDefaultFontColor:Bl((function(t){var e=t.commands.getPreset();return(0,al.computed)((function(){return e.value.common.color}))})),applyFontColor:Bl((function(e,n){e.commands.setMark(t.name,{value:n})}))}},parseHTML:function(){return[{style:"color",getAttrs:function(t){return{value:Kl(t)}}}]},renderHTML:function(t){return ql({font_color:t.HTMLAttributes.value})}}),rh=ss.create({name:vl.BACKGROUND_COLOR,addAttributes:function(){return{value:{required:!0}}},addCommands:function(){var t=this;return{getBackgroundColor:Bl((function(e){var n=e.editor;return(0,al.computed)((function(){var e,r;return null!==(e=null===(r=n.getAttributes(t.name))||void 0===r?void 0:r.value)&&void 0!==e?e:"rgba(255, 255, 255, 0%)"}))})),applyBackgroundColor:Bl((function(e,n){e.commands.setMark(t.name,{value:n})}))}},parseHTML:function(){return[{style:"background-color",getAttrs:function(t){return{value:Kl(t)}}}]},renderHTML:function(t){return ql({background_color:t.HTMLAttributes.value})}}),oh=xi.create({name:"device_manager",addOptions:function(){return{deviceRef:null}},addCommands:function(){var t=this;return{getDevice:Bl((function(){return t.options.deviceRef}))}}}),ih=ss.create({name:vl.FONT_STYLE,addAttributes:function(){return{italic:{required:!0}}},addCommands:function(){var t=this;return{isItalic:Bl((function(e){var n=e.editor,r=e.commands.getDefaultFontStyle();return(0,al.computed)((function(){var e,o;return null!==(e=null===(o=n.getAttributes(t.name))||void 0===o?void 0:o.italic)&&void 0!==e?e:r.value.italic}))})),isItalicAvailable:Bl((function(t){var e=t.commands,n=e.getFont(),r=e.getFontWeight();return(0,al.computed)((function(){return n.value.isItalicSupported(r.value)}))})),getDefaultFontStyle:Bl((function(t){var e=t.commands.getPreset();return(0,al.computed)((function(){return{italic:"italic"===e.value.common.font_style}}))})),toggleItalic:Bl((function(e){var n=e.commands;t.editor.commands.isItalicAvailable().value&&(n.isItalic().value?n.removeItalic():n.applyItalic())})),applyItalic:Bl((function(e){e.commands.setMark(t.name,{italic:!0})})),removeItalic:Bl((function(e){e.commands.unsetMark(t.name)}))}},addKeyboardShortcuts:function(){return{"Mod-i":Ul("toggleItalic"),"Mod-I":Ul("toggleItalic")}},parseHTML:function(){return[{tag:"i",attrs:{italic:!0}},{style:"font-style",getAttrs:function(t){return{italic:t.includes("italic")}}}]},renderHTML:function(){return ql({font_style:"italic"})}});function sh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ah(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sh(Object(n),!0).forEach((function(e){Dl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sh(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var lh=ss.create({name:vl.TEXT_DECORATION,addAttributes:function(){return{underline:{default:!1},strike_through:{default:!1}}},addCommands:function(){var t=this;return{isUnderline:Bl((function(t){var e=t.commands.getTextDecoration();return(0,al.computed)((function(){return e.value.underline}))})),isStrikeThrough:Bl((function(t){var e=t.commands.getTextDecoration();return(0,al.computed)((function(){return e.value.strike_through}))})),getTextDecoration:Bl((function(e){var n=e.editor,r=e.commands.getDefaultTextDecoration();return(0,al.computed)((function(){var e,o,i,s=null!==(e=n.getAttributes(t.name))&&void 0!==e?e:{};return{underline:null!==(o=s.underline)&&void 0!==o?o:r.value.underline,strike_through:null!==(i=s.strike_through)&&void 0!==i?i:r.value.strike_through}}))})),getDefaultTextDecoration:Bl((function(t){var e=t.commands.getPreset();return(0,al.computed)((function(){var t=e.value.common.text_decoration;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:Bl((function(t){t.commands.toggleTextDecoration("underline")})),toggleStrikeThrough:Bl((function(t){t.commands.toggleTextDecoration("strike_through")})),toggleTextDecoration:Bl((function(t,e){var n=t.commands;n.getTextDecoration().value[e]?n.removeTextDecoration(e):n.applyTextDecoration(e)})),applyTextDecoration:Bl((function(e,n){e.commands.setMark(t.name,Dl({},n,!0))})),removeTextDecoration:Bl((function(e,n){var r=e.commands,o=ah(ah({},r.getTextDecoration().value),{},Dl({},n,!1));o.underline||o.strike_through?r.setMark(t.name,o):r.unsetMark(t.name)}))}},addKeyboardShortcuts:function(){return{"Mod-u":Ul("toggleUnderline"),"Mod-U":Ul("toggleUnderline")}},parseHTML:function(){return[{style:"text-decoration-line",getAttrs:function(t){return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}}]},renderHTML:function(t){var e=t.HTMLAttributes,n=[];return e.underline&&n.push("underline"),e.strike_through&&n.push("line-through"),ql({text_decoration:n.join(" ")})}}),ch=xi.create({name:"case_style",addCommands:function(){return{applyCaseStyle:Bl((function(t,e){var n=t.commands;switch(e){case pl.CAPITALIZE:return n.applyCapitalize();case pl.LOWERCASE:return n.applyLowerCase();case pl.UPPERCASE:return n.applyUpperCase()}})),applyCapitalize:Bl((function(t){t.commands.transformText((function(t){return t.text.toLowerCase().replace(/(?:^|\s)\S/g,(function(t){return t.toUpperCase()}))}))})),applyLowerCase:Bl((function(t){t.commands.transformText((function(t){return t.text.toLowerCase()}))})),applyUpperCase:Bl((function(t){t.commands.transformText((function(t){return t.text.toUpperCase()}))}))}}}),uh={mobile:null,tablet:null,desktop:null},dh=xi.create({name:vl.ALIGNMENT,addGlobalAttributes:function(){return[{types:[fl.PARAGRAPH,fl.HEADING],attributes:Dl({},vl.ALIGNMENT,{isRequired:!1,parseHTML:function(t){var e=t.style.textAlign;return e?{desktop:e,tablet:e,mobile:e}:null},renderHTML:function(t){return t.alignment?Wl({mobile_text_align:t.alignment.mobile,tablet_text_align:t.alignment.tablet,desktop_text_align:t.alignment.desktop}):null}})}]},addCommands:function(){var t=this;return{applyAlignment:Bl((function(e,n){var r=e.commands,o=r.getDevice().value;r.setBlockAttributes(t.name,Dl({},o,n),uh)})),getAlignment:Bl((function(e){var n=e.commands,r=n.getBlockAttributes(t.name,uh),o=n.getDevice(),i=n.getDefaultAlignment();return(0,al.computed)((function(){var t,e;return null!==(t=null===(e=r.value)||void 0===e?void 0:e[o.value])&&void 0!==t?t:i.value}))})),getDefaultAlignment:Bl((function(t){var e=t.commands,n=e.getDevice(),r=e.getPreset();return(0,al.computed)((function(){return r.value[n.value].alignment}))}))}},addKeyboardShortcuts:function(){return{"Mod-Shift-l":Ul("applyAlignment",hl.LEFT),"Mod-Shift-e":Ul("applyAlignment",hl.CENTER),"Mod-Shift-r":Ul("applyAlignment",hl.RIGHT),"Mod-Shift-j":Ul("applyAlignment",hl.JUSTIFY)}}}),ph={mobile:null,tablet:null,desktop:null},hh=xi.create({name:vl.LINE_HEIGHT,addGlobalAttributes:function(){return[{types:[fl.PARAGRAPH,fl.HEADING],attributes:Dl({},vl.LINE_HEIGHT,{isRequired:!1,parseHTML:function(t){var e=t.style.lineHeight;if(!e)return null;if(!e.includes("px"))return{desktop:e,tablet:e,mobile:e};var n=t.firstElementChild.style.fontSize||window.getComputedStyle(document.body).fontSize,r=(parseFloat(e)/parseFloat(n)).toFixed(2);return{desktop:r,tablet:r,mobile:r}},renderHTML:function(t){return t.line_height?Wl({mobile_line_height:t.line_height.mobile,tablet_line_height:t.line_height.tablet,desktop_line_height:t.line_height.desktop}):null}})}]},addCommands:function(){var t=this;return{getLineHeight:Bl((function(e){var n=e.commands,r=n.getBlockAttributes(t.name,ph),o=n.getDevice(),i=n.getDefaultLineHeight();return(0,al.computed)((function(){var t,e;return null!==(t=null===(e=r.value)||void 0===e?void 0:e[o.value])&&void 0!==t?t:i.value}))})),getDefaultLineHeight:Bl((function(t){var e=t.commands,n=e.getDevice(),r=e.getPreset();return(0,al.computed)((function(){return r.value[n.value].line_height}))})),applyLineHeight:Bl((function(e,n){var r=e.commands,o=r.getDevice().value;r.setBlockAttributes(t.name,Dl({},o,n),ph)}))}}}),fh=as.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ii(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:fl.LIST_ITEM,addKeyboardShortcuts:function(){return{Enter:this.parent().Enter}}});function mh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var vh=as.create({name:fl.LIST,content:"".concat(fl.LIST_ITEM,"+"),group:"block list",addExtensions:function(){return[fh]},addOptions:function(){return{baseClass:""}},addAttributes:function(){return{bullet:{isRequired:!0}}},parseHTML:function(){var t=this,e={a:ml.ROMAN,i:ml.LATIN,1:ml.DECIMAL},n=function(n){var r,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return mh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(ml.values);try{for(o.s();!(r=o.n()).done;){var i=r.value,s=".".concat(t.options.baseClass).concat(i);if(n.matches(s))return i;if(e[n.type.toLowerCase()]===i)return i}}catch(t){o.e(t)}finally{o.f()}};return[{tag:"ol",getAttrs:function(t){return{bullet:{type:n(t)||ml.DECIMAL}}}},{tag:"ul",getAttrs:function(t){return{bullet:{type:n(t)||ml.DISC}}}}]},renderHTML:function(t){var e=t.HTMLAttributes;return[ml.ordered.includes(e.bullet.type)?"ol":"ul",{class:this.options.baseClass+e.bullet.type},0]},addCommands:function(){return{getListType:Bl((function(t){var e=t.commands.getBlockAttributes("bullet",{type:null});return(0,al.computed)((function(){var t;return null!==(t=e.value.type)&&void 0!==t?t:null}))})),applyList:Bl((function(t,e){var n=t.commands,r=t.chain;if(n.getListType().value!==e)return r().removeList()._addList(e).run();n.applyDefaultPreset()})),_addList:Bl((function(t,e){return(0,t.chain)().removePreset().toggleList(fl.LIST,fl.LIST_ITEM).setBlockAttributes("bullet",{type:e}).run()})),removeList:Bl((function(t){t.commands.liftListItem(fl.LIST_ITEM)}))}},addInputRules:function(){var t=this,e=function(e,n){return r={find:n,type:t.type,getAttributes:{bullet:{type:e}},joinPredicate:function(t,n){return n.attrs.bullet.type===e}},new fi({find:r.find,handler:({state:t,range:e,match:n})=>{const o=li(r.getAttributes,void 0,n)||{},i=t.tr.delete(e.from,e.to),s=i.doc.resolve(e.from).blockRange(),a=s&&Tt(s,r.type,o);if(!a)return null;i.wrap(s,a);const l=i.doc.resolve(e.from-1).nodeBefore;l&&l.type===r.type&&Dt(i.doc,e.from-1)&&(!r.joinPredicate||r.joinPredicate(n,l))&&i.join(e.from-1)}});var r};return[e(ml.DISC,/^\s*([-+*])\s$/),e(ml.DECIMAL,/^(\d+)\.\s$/),e(ml.LATIN,/^([ivx]{1,3})\.\s$/i),e(ml.ROMAN,/^([a-z])\.\s$/i)]}});const gh=ss.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML({HTMLAttributes:t}){return["sup",ii(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var yh=gh.extend({addKeyboardShortcuts:null});function bh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var wh=function(){function t(e){var n=e.name,r=e.category,o=e.styles;Yd(this,t),this.name=n,this.category=r,this.styles=o}return tp(t,[{key:"weights",get:function(){return this.styles.filter((function(t){return!t.endsWith("i")}))}},{key:"isWeightSupported",value:function(t){return this.styles.includes(t)}},{key:"isItalicSupported",value:function(t){return this.styles.includes("".concat(t,"i"))}},{key:"findClosestWeight",value:function(t){var e,n,r=this.weights.map((function(t){return parseInt(t)})),o=null,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return bh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bh(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(r);try{for(i.s();!(n=i.n()).done;){var s=n.value,a=Math.abs(t-s);(null===o||a<o)&&(o=a,e=s)}}catch(t){i.e(t)}finally{i.f()}return String(e)}}]),t}();const xh={name:"Wysiwyg",components:{Toolbar:Xd,EditorContent:sl},directives:{outClick:ku},props:{value:{type:[String,Object],required:!0},presets:{type:Array,required:!0},defaultPresetId:{type:[Number,String],required:!0},basePresetClass:{type:String,required:!0},makePresetVariable:{type:Function,required:!0},fonts:{type:Array,required:!0},active:{type:Boolean,required:!0},device:{type:String,required:!1,default:dl.DESKTOP},favoriteColors:{type:Array,required:!1,default:function(){return[]}},toolbarOffsets:{type:Array,required:!1,default:function(){return[0,8]}},baseListClass:{type:String,required:!1,default:"zw-list--"}},setup:function(t,e){var n,r=e.emit,o=t.fonts.map((function(t){return new wh(t)})),i=(0,al.ref)(null),s=(0,al.ref)(null),a=function(t){var e,n=t.wrapperRef,r=t.popperRef,o=t.offsets,i=t.isActiveRef;(0,al.onMounted)((function(){var t=eu(n).value,i=eu(r).value;e=va(t,i,{placement:"top-start",modifiers:[{name:"offset",options:{offset:o}}]})}));var s=function(){return e.update()};return(0,al.watch)(i,(function(){i.value&&s()})),(0,al.onUnmounted)((function(){return e.destroy()})),{toolbar:e,update:s}}({wrapperRef:s,popperRef:i,isActiveRef:(0,al.toRef)(t,"active"),offsets:t.toolbarOffsets}),l=function(t){var e=t.content,n=t.onChange,r=t.extensions,o=new sp,i=(0,al.reactive)(new il({content:o.normalize(e.value),onUpdate:function(){return n(i.getJSON())},extensions:r}));return(0,al.onUnmounted)((function(){return i.destroy()})),(0,al.watch)(e,(function(t){if(JSON.stringify(i.getJSON())!==JSON.stringify(t)){var e=o.normalize(t);i.commands.setContent(e,!1)}})),i}({content:(0,al.toRef)(t,"value"),onChange:function(t){return function(t){r("input",t),a.update()}(t)},extensions:(n={fonts:o,minFontSize:5,maxFontSize:112,presetsRef:(0,al.toRef)(t,"presets"),defaultPresetId:t.defaultPresetId,makePresetVariable:t.makePresetVariable,basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:(0,al.toRef)(t,"device")},Gp.concat([Mp,Qp.configure({presetsRef:n.presetsRef,defaultId:n.defaultPresetId,baseClass:n.basePresetClass,makeVariable:n.makePresetVariable}),vh.configure({baseClass:n.baseListClass}),oh.configure({deviceRef:n.deviceRef}),Kp.configure({fonts:n.fonts}),th,eh.configure({minSize:n.minFontSize,maxSize:n.maxFontSize}),nh,rh,ih,lh,ch,yh,dh,hh]))}),c=new Array(108).fill(0).map((function(t,e){return String(e+5)})),u=new rp({listRef:(0,al.toRef)(t,"favoriteColors"),triggerUpdate:function(t){return r("updateFavoriteColors",t)}});return(0,al.provide)(Al.EDITOR,l),(0,al.provide)(Al.FONTS,o),(0,al.provide)(Al.FONT_SIZES,c),(0,al.provide)(Al.LOCAL_STORAGE,new np(localStorage)),(0,al.provide)(Al.FAVORITE_COLORS,u),{editor:l,toolbarRef:i,wysiwygRef:s,toolbar:a}}};var Sh=bl(xh,n,[],!1,null,null,null);Sh.options.__file="lib/Wysiwyg.vue";const Oh=Sh.exports})();var s=i.F;export{s as Wysiwyg};
|