20 lines
370 KiB
JavaScript
Executable File
20 lines
370 KiB
JavaScript
Executable File
/*!
|
||
* Vue.js v2.6.14
|
||
* (c) 2014-2021 Evan You
|
||
* Released under the MIT License.
|
||
*/
|
||
var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var s=Object.prototype.toString;function a(e){return"[object Object]"===s.call(e)}function l(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function c(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function u(e){return null==e?"":Array.isArray(e)||a(e)&&e.toString===s?JSON.stringify(e,null,2):String(e)}function d(e){var t=parseFloat(e);return isNaN(t)?e:t}function h(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var f=h("slot,component",!0),p=h("key,ref,slot,slot-scope,is");function m(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var g=Object.prototype.hasOwnProperty;function v(e,t){return g.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var b=/-(\w)/g,w=y((function(e){return e.replace(b,(function(e,t){return t?t.toUpperCase():""}))})),x=y((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),S=/\B([A-Z])/g,k=y((function(e){return e.replace(S,"-$1").toLowerCase()}));var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function O(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function M(e,t){for(var n in t)e[n]=t[n];return e}function _(e){for(var t={},n=0;n<e.length;n++)e[n]&&M(t,e[n]);return t}function D(e,t,n){}var T=function(e,t,n){return!1},$=function(e){return e};function A(e,t){if(e===t)return!0;var n=o(e),r=o(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),s=Array.isArray(t);if(i&&s)return e.length===t.length&&e.every((function(e,n){return A(e,t[n])}));if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||s)return!1;var a=Object.keys(e),l=Object.keys(t);return a.length===l.length&&a.every((function(n){return A(e[n],t[n])}))}catch(c){return!1}}function E(e,t){for(var n=0;n<e.length;n++)if(A(e[n],t))return n;return-1}function N(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var P=["component","directive","filter"],I=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],R={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:D,parsePlatformTagName:$,mustUseProp:T,async:!0,_lifecycleHooks:I},z=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function j(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function F(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var L=new RegExp("[^"+z.source+".$_\\d]");var B="__proto__"in{},V="undefined"!=typeof window,W="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,q=W&&WXEnvironment.platform.toLowerCase(),H=V&&window.navigator.userAgent.toLowerCase(),J=H&&/msie|trident/.test(H),K=H&&H.indexOf("msie 9.0")>0,Y=H&&H.indexOf("edge/")>0;H&&H.indexOf("android");var U=H&&/iphone|ipad|ipod|ios/.test(H)||"ios"===q;H&&/chrome\/\d+/.test(H),H&&/phantomjs/.test(H);var X,G=H&&H.match(/firefox\/(\d+)/),Z={}.watch,Q=!1;if(V)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(wy){}var te=function(){return void 0===X&&(X=!V&&!W&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),X},ne=V&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var se=D,ae=0,le=function(){this.id=ae++,this.subs=[]};le.prototype.addSub=function(e){this.subs.push(e)},le.prototype.removeSub=function(e){m(this.subs,e)},le.prototype.depend=function(){le.target&&le.target.addDep(this)},le.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},le.target=null;var ce=[];function ue(e){ce.push(e),le.target=e}function de(){ce.pop(),le.target=ce[ce.length-1]}var he=function(e,t,n,r,i,o,s,a){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},fe={child:{configurable:!0}};fe.child.get=function(){return this.componentInstance},Object.defineProperties(he.prototype,fe);var pe=function(e){void 0===e&&(e="");var t=new he;return t.text=e,t.isComment=!0,t};function me(e){return new he(void 0,void 0,void 0,String(e))}function ge(e){var t=new he(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ve=Array.prototype,ye=Object.create(ve);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(e){var t=ve[e];F(ye,e,(function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),s=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&s.observeArray(i),s.dep.notify(),o}))}));var be=Object.getOwnPropertyNames(ye),we=!0;function xe(e){we=e}var Se=function(e){var t;this.value=e,this.dep=new le,this.vmCount=0,F(e,"__ob__",this),Array.isArray(e)?(B?(t=ye,e.__proto__=t):function(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];F(e,o,t[o])}}(e,ye,be),this.observeArray(e)):this.walk(e)};function ke(e,t){var n;if(o(e)&&!(e instanceof he))return v(e,"__ob__")&&e.__ob__ instanceof Se?n=e.__ob__:we&&!te()&&(Array.isArray(e)||a(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new Se(e)),t&&n&&n.vmCount++,n}function Ce(e,t,n,r,i){var o=new le,s=Object.getOwnPropertyDescriptor(e,t);if(!s||!1!==s.configurable){var a=s&&s.get,l=s&&s.set;a&&!l||2!==arguments.length||(n=e[t]);var c=!i&&ke(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=a?a.call(e):n;return le.target&&(o.depend(),c&&(c.dep.depend(),Array.isArray(t)&&_e(t))),t},set:function(t){var r=a?a.call(e):n;t===r||t!=t&&r!=r||a&&!l||(l?l.call(e,t):n=t,c=!i&&ke(t),o.notify())}})}}function Oe(e,t,n){if(Array.isArray(e)&&l(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(Ce(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Me(e,t){if(Array.isArray(e)&&l(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||v(e,t)&&(delete e[t],n&&n.dep.notify())}}function _e(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&_e(t)}Se.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)Ce(e,t[n])},Se.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)ke(e[t])};var De=R.optionMergeStrategies;function Te(e,t){if(!t)return e;for(var n,r,i,o=oe?Reflect.ownKeys(t):Object.keys(t),s=0;s<o.length;s++)"__ob__"!==(n=o[s])&&(r=e[n],i=t[n],v(e,n)?r!==i&&a(r)&&a(i)&&Te(r,i):Oe(e,n,i));return e}function $e(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Te(r,i):i}:t?e?function(){return Te("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Ae(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ee(e,t,n,r){var i=Object.create(e||null);return t?M(i,t):i}De.data=function(e,t,n){return n?$e(e,t,n):t&&"function"!=typeof t?e:$e(e,t)},I.forEach((function(e){De[e]=Ae})),P.forEach((function(e){De[e+"s"]=Ee})),De.watch=function(e,t,n,r){if(e===Z&&(e=void 0),t===Z&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in M(i,e),t){var s=i[o],a=t[o];s&&!Array.isArray(s)&&(s=[s]),i[o]=s?s.concat(a):Array.isArray(a)?a:[a]}return i},De.props=De.methods=De.inject=De.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return M(i,e),t&&M(i,t),i},De.provide=$e;var Ne=function(e,t){return void 0===t?e:t};function Pe(e,t,n){if("function"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[w(i)]={type:null});else if(a(n))for(var s in n)i=n[s],o[w(s)]=a(i)?i:{type:i};e.props=o}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(a(n))for(var o in n){var s=n[o];r[o]=a(s)?M({from:o},s):{from:s}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=Pe(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=Pe(e,t.mixins[r],n);var o,s={};for(o in e)l(o);for(o in t)v(e,o)||l(o);function l(r){var i=De[r]||Ne;s[r]=i(e[r],t[r],n,r)}return s}function Ie(e,t,n,r){if("string"==typeof n){var i=e[t];if(v(i,n))return i[n];var o=w(n);if(v(i,o))return i[o];var s=x(o);return v(i,s)?i[s]:i[n]||i[o]||i[s]}}function Re(e,t,n,r){var i=t[e],o=!v(n,e),s=n[e],a=Le(Boolean,i.type);if(a>-1)if(o&&!v(i,"default"))s=!1;else if(""===s||s===k(e)){var l=Le(String,i.type);(l<0||a<l)&&(s=!0)}if(void 0===s){s=function(e,t,n){if(!v(t,"default"))return;var r=t.default;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return"function"==typeof r&&"Function"!==je(t.type)?r.call(e):r}(r,i,e);var c=we;xe(!0),ke(s),xe(c)}return s}var ze=/^\s*function (\w+)/;function je(e){var t=e&&e.toString().match(ze);return t?t[1]:""}function Fe(e,t){return je(e)===je(t)}function Le(e,t){if(!Array.isArray(t))return Fe(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Fe(t[n],e))return n;return-1}function Be(e,t,n){ue();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(wy){We(wy,r,"errorCaptured hook")}}We(e,t,n)}finally{de()}}function Ve(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&c(o)&&!o._handled&&(o.catch((function(e){return Be(e,r,i+" (Promise/async)")})),o._handled=!0)}catch(wy){Be(wy,r,i)}return o}function We(e,t,n){if(R.errorHandler)try{return R.errorHandler.call(null,e,t,n)}catch(wy){wy!==e&&qe(wy)}qe(e)}function qe(e,t,n){if(!V&&!W||"undefined"==typeof console)throw e;console.error(e)}var He,Je=!1,Ke=[],Ye=!1;function Ue(){Ye=!1;var e=Ke.slice(0);Ke.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&re(Promise)){var Xe=Promise.resolve();He=function(){Xe.then(Ue),U&&setTimeout(D)},Je=!0}else if(J||"undefined"==typeof MutationObserver||!re(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())He="undefined"!=typeof setImmediate&&re(setImmediate)?function(){setImmediate(Ue)}:function(){setTimeout(Ue,0)};else{var Ge=1,Ze=new MutationObserver(Ue),Qe=document.createTextNode(String(Ge));Ze.observe(Qe,{characterData:!0}),He=function(){Ge=(Ge+1)%2,Qe.data=String(Ge)},Je=!0}function et(e,t){var n;if(Ke.push((function(){if(e)try{e.call(t)}catch(wy){Be(wy,t,"nextTick")}else n&&n(t)})),Ye||(Ye=!0,He()),!e&&"undefined"!=typeof Promise)return new Promise((function(e){n=e}))}var tt=new ie;function nt(e){rt(e,tt),tt.clear()}function rt(e,t){var n,r,i=Array.isArray(e);if(!(!i&&!o(e)||Object.isFrozen(e)||e instanceof he)){if(e.__ob__){var s=e.__ob__.dep.id;if(t.has(s))return;t.add(s)}if(i)for(n=e.length;n--;)rt(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)rt(e[r[n]],t)}}var it=y((function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}}));function ot(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return Ve(r,null,arguments,t,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)Ve(i[o],null,e,t,"v-on handler")}return n.fns=e,n}function st(e,n,i,o,s,a){var l,c,u,d;for(l in e)c=e[l],u=n[l],d=it(l),t(c)||(t(u)?(t(c.fns)&&(c=e[l]=ot(c,a)),r(d.once)&&(c=e[l]=s(d.name,c,d.capture)),i(d.name,c,d.capture,d.passive,d.params)):c!==u&&(u.fns=c,e[l]=u));for(l in n)t(e[l])&&o((d=it(l)).name,n[l],d.capture)}function at(e,i,o){var s;e instanceof he&&(e=e.data.hook||(e.data.hook={}));var a=e[i];function l(){o.apply(this,arguments),m(s.fns,l)}t(a)?s=ot([l]):n(a.fns)&&r(a.merged)?(s=a).fns.push(l):s=ot([a,l]),s.merged=!0,e[i]=s}function lt(e,t,r,i,o){if(n(t)){if(v(t,r))return e[r]=t[r],o||delete t[r],!0;if(v(t,i))return e[r]=t[i],o||delete t[i],!0}return!1}function ct(e){return i(e)?[me(e)]:Array.isArray(e)?dt(e):void 0}function ut(e){return n(e)&&n(e.text)&&!1===e.isComment}function dt(e,o){var s,a,l,c,u=[];for(s=0;s<e.length;s++)t(a=e[s])||"boolean"==typeof a||(c=u[l=u.length-1],Array.isArray(a)?a.length>0&&(ut((a=dt(a,(o||"")+"_"+s))[0])&&ut(c)&&(u[l]=me(c.text+a[0].text),a.shift()),u.push.apply(u,a)):i(a)?ut(c)?u[l]=me(c.text+a):""!==a&&u.push(me(a)):ut(a)&&ut(c)?u[l]=me(c.text+a.text):(r(e._isVList)&&n(a.tag)&&t(a.key)&&n(o)&&(a.key="__vlist"+o+"_"+s+"__"),u.push(a)));return u}function ht(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var s=e[o].from,a=t;a;){if(a._provided&&v(a._provided,s)){n[o]=a._provided[s];break}a=a.$parent}if(!a&&"default"in e[o]){var l=e[o].default;n[o]="function"==typeof l?l.call(t):l}}}return n}}function ft(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],s=o.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,o.context!==t&&o.fnContext!==t||!s||null==s.slot)(n.default||(n.default=[])).push(o);else{var a=s.slot,l=n[a]||(n[a]=[]);"template"===o.tag?l.push.apply(l,o.children||[]):l.push(o)}}for(var c in n)n[c].every(pt)&&delete n[c];return n}function pt(e){return e.isComment&&!e.asyncFactory||" "===e.text}function mt(e){return e.isComment&&e.asyncFactory}function gt(t,n,r){var i,o=Object.keys(n).length>0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&r&&r!==e&&a===r.$key&&!o&&!r.$hasNormal)return r;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=vt(n,l,t[l]))}else i={};for(var c in n)c in i||(i[c]=yt(n,c));return t&&Object.isExtensible(t)&&(t._normalized=i),F(i,"$stable",s),F(i,"$key",a),F(i,"$hasNormal",o),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({}),t=(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:ct(e))&&e[0];return e&&(!t||1===e.length&&t.isComment&&!mt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function yt(e,t){return function(){return e[t]}}function bt(e,t){var r,i,s,a,l;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,s=e.length;i<s;i++)r[i]=t(e[i],i);else if("number"==typeof e)for(r=new Array(e),i=0;i<e;i++)r[i]=t(i+1,i);else if(o(e))if(oe&&e[Symbol.iterator]){r=[];for(var c=e[Symbol.iterator](),u=c.next();!u.done;)r.push(t(u.value,r.length)),u=c.next()}else for(a=Object.keys(e),r=new Array(a.length),i=0,s=a.length;i<s;i++)l=a[i],r[i]=t(e[l],l,i);return n(r)||(r=[]),r._isVList=!0,r}function wt(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=M(M({},r),n)),i=o(n)||("function"==typeof t?t():t)):i=this.$slots[e]||("function"==typeof t?t():t);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},i):i}function xt(e){return Ie(this.$options,"filters",e)||$}function St(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function kt(e,t,n,r,i){var o=R.keyCodes[t]||n;return i&&r&&!R.keyCodes[t]?St(i,r):o?St(o,e):r?k(r)!==t:void 0===e}function Ct(e,t,n,r,i){if(n)if(o(n)){var s;Array.isArray(n)&&(n=_(n));var a=function(o){if("class"===o||"style"===o||p(o))s=e;else{var a=e.attrs&&e.attrs.type;s=r||R.mustUseProp(t,a,o)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var l=w(o),c=k(o);l in s||c in s||(s[o]=n[o],i&&((e.on||(e.on={}))["update:"+o]=function(e){n[o]=e}))};for(var l in n)a(l)}else;return e}function Ot(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t||_t(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r}function Mt(e,t,n){return _t(e,"__once__"+t+(n?"_"+n:""),!0),e}function _t(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&Dt(e[r],t+"_"+r,n);else Dt(e,t,n)}function Dt(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function Tt(e,t){if(t)if(a(t)){var n=e.on=e.on?M({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function $t(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?$t(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function At(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Et(e,t){return"string"==typeof e?t+e:e}function Nt(e){e._o=Mt,e._n=d,e._s=u,e._l=bt,e._t=wt,e._q=A,e._i=E,e._m=Ot,e._f=xt,e._k=kt,e._b=Ct,e._v=me,e._e=pe,e._u=$t,e._g=Tt,e._d=At,e._p=Et}function Pt(t,n,i,o,s){var a,l=this,c=s.options;v(o,"_uid")?(a=Object.create(o))._original=o:(a=o,o=o._original);var u=r(c._compiled),d=!u;this.data=t,this.props=n,this.children=i,this.parent=o,this.listeners=t.on||e,this.injections=ht(c.inject,o),this.slots=function(){return l.$slots||gt(t.scopedSlots,l.$slots=ft(i,o)),l.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return gt(t.scopedSlots,this.slots())}}),u&&(this.$options=c,this.$slots=this.slots(),this.$scopedSlots=gt(t.scopedSlots,this.$slots)),c._scopeId?this._c=function(e,t,n,r){var i=Bt(a,e,t,n,r,d);return i&&!Array.isArray(i)&&(i.fnScopeId=c._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Bt(a,e,t,n,r,d)}}function It(e,t,n,r,i){var o=ge(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Rt(e,t){for(var n in t)e[w(n)]=t[n]}Nt(Pt.prototype);var zt={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var r=e;zt.prepatch(r,r)}else{(e.componentInstance=function(e,t){var r={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;n(i)&&(r.render=i.render,r.staticRenderFns=i.staticRenderFns);return new e.componentOptions.Ctor(r)}(e,Gt)).$mount(t?e.elm:void 0,t)}},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,i,o){var s=i.data.scopedSlots,a=t.$scopedSlots,l=!!(s&&!s.$stable||a!==e&&!a.$stable||s&&t.$scopedSlots.$key!==s.$key||!s&&t.$scopedSlots.$key),c=!!(o||t.$options._renderChildren||l);t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i);if(t.$options._renderChildren=o,t.$attrs=i.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){xe(!1);for(var u=t._props,d=t.$options._propKeys||[],h=0;h<d.length;h++){var f=d[h],p=t.$options.props;u[f]=Re(f,p,n,t)}xe(!0),t.$options.propsData=n}r=r||e;var m=t.$options._parentListeners;t.$options._parentListeners=r,Xt(t,r,m),c&&(t.$slots=ft(o,i.context),t.$forceUpdate())}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,nn(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,on.push(t)):en(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?tn(t,!0):t.$destroy())}},jt=Object.keys(zt);function Ft(i,s,a,l,u){if(!t(i)){var d=a.$options._base;if(o(i)&&(i=d.extend(i)),"function"==typeof i){var h;if(t(i.cid)&&(i=function(e,i){if(r(e.error)&&n(e.errorComp))return e.errorComp;if(n(e.resolved))return e.resolved;var s=qt;s&&n(e.owners)&&-1===e.owners.indexOf(s)&&e.owners.push(s);if(r(e.loading)&&n(e.loadingComp))return e.loadingComp;if(s&&!n(e.owners)){var a=e.owners=[s],l=!0,u=null,d=null;s.$on("hook:destroyed",(function(){return m(a,s)}));var h=function(e){for(var t=0,n=a.length;t<n;t++)a[t].$forceUpdate();e&&(a.length=0,null!==u&&(clearTimeout(u),u=null),null!==d&&(clearTimeout(d),d=null))},f=N((function(t){e.resolved=Ht(t,i),l?a.length=0:h(!0)})),p=N((function(t){n(e.errorComp)&&(e.error=!0,h(!0))})),g=e(f,p);return o(g)&&(c(g)?t(e.resolved)&&g.then(f,p):c(g.component)&&(g.component.then(f,p),n(g.error)&&(e.errorComp=Ht(g.error,i)),n(g.loading)&&(e.loadingComp=Ht(g.loading,i),0===g.delay?e.loading=!0:u=setTimeout((function(){u=null,t(e.resolved)&&t(e.error)&&(e.loading=!0,h(!1))}),g.delay||200)),n(g.timeout)&&(d=setTimeout((function(){d=null,t(e.resolved)&&p(null)}),g.timeout)))),l=!1,e.loading?e.loadingComp:e.resolved}}(h=i,d),void 0===i))return function(e,t,n,r,i){var o=pe();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}(h,s,a,l,u);s=s||{},On(i),n(s.model)&&function(e,t){var r=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[r]=t.model.value;var o=t.on||(t.on={}),s=o[i],a=t.model.callback;n(s)?(Array.isArray(s)?-1===s.indexOf(a):s!==a)&&(o[i]=[a].concat(s)):o[i]=a}(i.options,s);var f=function(e,r,i){var o=r.options.props;if(!t(o)){var s={},a=e.attrs,l=e.props;if(n(a)||n(l))for(var c in o){var u=k(c);lt(s,l,c,u,!0)||lt(s,a,c,u,!1)}return s}}(s,i);if(r(i.options.functional))return function(t,r,i,o,s){var a=t.options,l={},c=a.props;if(n(c))for(var u in c)l[u]=Re(u,c,r||e);else n(i.attrs)&&Rt(l,i.attrs),n(i.props)&&Rt(l,i.props);var d=new Pt(i,l,s,o,t),h=a.render.call(null,d._c,d);if(h instanceof he)return It(h,i,d.parent,a);if(Array.isArray(h)){for(var f=ct(h)||[],p=new Array(f.length),m=0;m<f.length;m++)p[m]=It(f[m],i,d.parent,a);return p}}(i,f,s,a,l);var p=s.on;if(s.on=s.nativeOn,r(i.options.abstract)){var g=s.slot;s={},g&&(s.slot=g)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<jt.length;n++){var r=jt[n],i=t[r],o=zt[r];i===o||i&&i._merged||(t[r]=i?Lt(o,i):o)}}(s);var v=i.options.name||u;return new he("vue-component-"+i.cid+(v?"-"+v:""),s,void 0,void 0,void 0,a,{Ctor:i,propsData:f,listeners:p,tag:u,children:l},h)}}}function Lt(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}function Bt(e,t,s,a,l,c){return(Array.isArray(s)||i(s))&&(l=a,a=s,s=void 0),r(c)&&(l=2),function(e,t,r,i,s){if(n(r)&&n(r.__ob__))return pe();n(r)&&n(r.is)&&(t=r.is);if(!t)return pe();Array.isArray(i)&&"function"==typeof i[0]&&((r=r||{}).scopedSlots={default:i[0]},i.length=0);2===s?i=ct(i):1===s&&(i=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(i));var a,l;if("string"==typeof t){var c;l=e.$vnode&&e.$vnode.ns||R.getTagNamespace(t),a=R.isReservedTag(t)?new he(R.parsePlatformTagName(t),r,i,void 0,void 0,e):r&&r.pre||!n(c=Ie(e.$options,"components",t))?new he(t,r,i,void 0,void 0,e):Ft(c,r,e,i,t)}else a=Ft(t,r,e,i);return Array.isArray(a)?a:n(a)?(n(l)&&Vt(a,l),n(r)&&function(e){o(e.style)&&nt(e.style);o(e.class)&&nt(e.class)}(r),a):pe()}(e,t,s,a,l)}function Vt(e,i,o){if(e.ns=i,"foreignObject"===e.tag&&(i=void 0,o=!0),n(e.children))for(var s=0,a=e.children.length;s<a;s++){var l=e.children[s];n(l.tag)&&(t(l.ns)||r(o)&&"svg"!==l.tag)&&Vt(l,i,o)}}var Wt,qt=null;function Ht(e,t){return(e.__esModule||oe&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function Jt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];if(n(r)&&(n(r.componentOptions)||mt(r)))return r}}function Kt(e,t){Wt.$on(e,t)}function Yt(e,t){Wt.$off(e,t)}function Ut(e,t){var n=Wt;return function r(){var i=t.apply(null,arguments);null!==i&&n.$off(e,r)}}function Xt(e,t,n){Wt=e,st(t,n||{},Kt,Yt,Ut,e),Wt=void 0}var Gt=null;function Zt(e){var t=Gt;return Gt=e,function(){Gt=t}}function Qt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function en(e,t){if(t){if(e._directInactive=!1,Qt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)en(e.$children[n]);nn(e,"activated")}}function tn(e,t){if(!(t&&(e._directInactive=!0,Qt(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)tn(e.$children[n]);nn(e,"deactivated")}}function nn(e,t){ue();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,o=n.length;i<o;i++)Ve(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),de()}var rn=[],on=[],sn={},an=!1,ln=!1,cn=0;var un=0,dn=Date.now;if(V&&!J){var hn=window.performance;hn&&"function"==typeof hn.now&&dn()>document.createEvent("Event").timeStamp&&(dn=function(){return hn.now()})}function fn(){var e,t;for(un=dn(),ln=!0,rn.sort((function(e,t){return e.id-t.id})),cn=0;cn<rn.length;cn++)(e=rn[cn]).before&&e.before(),t=e.id,sn[t]=null,e.run();var n=on.slice(),r=rn.slice();cn=rn.length=on.length=0,sn={},an=ln=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,en(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&nn(r,"updated")}}(r),ne&&R.devtools&&ne.emit("flush")}var pn=0,mn=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++pn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ie,this.newDepIds=new ie,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!L.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};mn.prototype.get=function(){var e;ue(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(wy){if(!this.user)throw wy;Be(wy,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&nt(e),de(),this.cleanupDeps()}return e},mn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},mn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},mn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==sn[t]){if(sn[t]=!0,ln){for(var n=rn.length-1;n>cn&&rn[n].id>e.id;)n--;rn.splice(n+1,0,e)}else rn.push(e);an||(an=!0,et(fn))}}(this)},mn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';Ve(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},mn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},mn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},mn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||m(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var gn={enumerable:!0,configurable:!0,get:D,set:D};function vn(e,t,n){gn.get=function(){return this[t][n]},gn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,gn)}function yn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&xe(!1);var o=function(o){i.push(o);var s=Re(o,t,n,e);Ce(r,o,s),o in e||vn(e,"_props",o)};for(var s in t)o(s);xe(!0)}(e,t.props),t.methods&&function(e,t){for(var n in e.$options.props,t)e[n]="function"!=typeof t[n]?D:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;a(t=e._data="function"==typeof t?function(e,t){ue();try{return e.call(t,t)}catch(wy){return Be(wy,t,"data()"),{}}finally{de()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props;e.$options.methods;var i=n.length;for(;i--;){var o=n[i];r&&v(r,o)||j(o)||vn(e,"_data",o)}ke(t,!0)}(e):ke(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],s="function"==typeof o?o:o.get;r||(n[i]=new mn(e,s||D,D,bn)),i in e||wn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Z&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)kn(e,n,r[i]);else kn(e,n,r)}}(e,t.watch)}var bn={lazy:!0};function wn(e,t,n){var r=!te();"function"==typeof n?(gn.get=r?xn(t):Sn(n),gn.set=D):(gn.get=n.get?r&&!1!==n.cache?xn(t):Sn(n.get):D,gn.set=n.set||D),Object.defineProperty(e,t,gn)}function xn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),le.target&&t.depend(),t.value}}function Sn(e){return function(){return e.call(this,this)}}function kn(e,t,n,r){return a(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var Cn=0;function On(e){var t=e.options;if(e.super){var n=On(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}(e);r&&M(e.extendOptions,r),(t=e.options=Pe(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function Mn(e){this._init(e)}function _n(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,s=function(e){this._init(e)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=t++,s.options=Pe(n.options,e),s.super=n,s.options.props&&function(e){var t=e.options.props;for(var n in t)vn(e.prototype,"_props",n)}(s),s.options.computed&&function(e){var t=e.options.computed;for(var n in t)wn(e.prototype,n,t[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,P.forEach((function(e){s[e]=n[e]})),o&&(s.options.components[o]=s),s.superOptions=n.options,s.extendOptions=e,s.sealedOptions=M({},s.options),i[r]=s,s}}function Dn(e){return e&&(e.Ctor.options.name||e.tag)}function Tn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===s.call(n)&&e.test(t));var n}function $n(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var s=n[o];if(s){var a=s.name;a&&!t(a)&&An(n,o,r,i)}}}function An(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,m(n,t)}Mn.prototype._init=function(t){var n=this;n._uid=Cn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Pe(On(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Xt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ft(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Bt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Bt(t,e,n,r,i,!0)};var o=r&&r.data;Ce(t,"$attrs",o&&o.attrs||e,null,!0),Ce(t,"$listeners",n._parentListeners||e,null,!0)}(n),nn(n,"beforeCreate"),function(e){var t=ht(e.$options.inject,e);t&&(xe(!1),Object.keys(t).forEach((function(n){Ce(e,n,t[n])})),xe(!0))}(n),yn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),nn(n,"created"),n.$options.el&&n.$mount(n.$options.el)},function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Oe,e.prototype.$delete=Me,e.prototype.$watch=function(e,t,n){var r=this;if(a(t))return kn(r,e,t,n);(n=n||{}).user=!0;var i=new mn(r,e,t,n);if(n.immediate){var o='callback for immediate watcher "'+i.expression+'"';ue(),Ve(t,r,[i.value],r,o),de()}return function(){i.teardown()}}}(Mn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,s=n._events[e];if(!s)return n;if(!t)return n._events[e]=null,n;for(var a=s.length;a--;)if((o=s[a])===t||o.fn===t){s.splice(a,1);break}return n},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?O(n):n;for(var r=O(arguments,1),i='event handler for "'+e+'"',o=0,s=n.length;o<s;o++)Ve(n[o],t,r,t,i)}return t}}(Mn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=Zt(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){nn(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||m(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),nn(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(Mn),function(e){Nt(e.prototype),e.prototype.$nextTick=function(e){return et(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=gt(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{qt=t,e=r.call(t._renderProxy,t.$createElement)}catch(wy){Be(wy,t,"render"),e=t._vnode}finally{qt=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof he||(e=pe()),e.parent=i,e}}(Mn);var En=[String,RegExp,Array],Nn={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:En,exclude:En,max:[String,Number]},methods:{cacheVNode:function(){var e=this,t=e.cache,n=e.keys,r=e.vnodeToCache,i=e.keyToCache;if(r){var o=r.tag,s=r.componentInstance,a=r.componentOptions;t[i]={name:Dn(a),tag:o,componentInstance:s},n.push(i),this.max&&n.length>parseInt(this.max)&&An(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)An(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){$n(e,(function(e){return Tn(t,e)}))})),this.$watch("exclude",(function(t){$n(e,(function(e){return!Tn(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Jt(e),n=t&&t.componentOptions;if(n){var r=Dn(n),i=this.include,o=this.exclude;if(i&&(!r||!Tn(i,r))||o&&r&&Tn(o,r))return t;var s=this.cache,a=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;s[l]?(t.componentInstance=s[l].componentInstance,m(a,l),a.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return R}};Object.defineProperty(e,"config",t),e.util={warn:se,extend:M,mergeOptions:Pe,defineReactive:Ce},e.set=Oe,e.delete=Me,e.nextTick=et,e.observable=function(e){return ke(e),e},e.options=Object.create(null),P.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,M(e.options.components,Nn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=O(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Pe(this.options,e),this}}(e),_n(e),function(e){P.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&a(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Mn),Object.defineProperty(Mn.prototype,"$isServer",{get:te}),Object.defineProperty(Mn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Mn,"FunctionalRenderContext",{value:Pt}),Mn.version="2.6.14";var Pn=h("style,class"),In=h("input,textarea,option,select,progress"),Rn=function(e,t,n){return"value"===n&&In(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},zn=h("contenteditable,draggable,spellcheck"),jn=h("events,caret,typing,plaintext-only"),Fn=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Ln="http://www.w3.org/1999/xlink",Bn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Vn=function(e){return Bn(e)?e.slice(6,e.length):""},Wn=function(e){return null==e||!1===e};function qn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Hn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Hn(t,r.data));return function(e,t){if(n(e)||n(t))return Jn(e,Kn(t));return""}(t.staticClass,t.class)}function Hn(e,t){return{staticClass:Jn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Jn(e,t){return e?t?e+" "+t:e:t||""}function Kn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i<o;i++)n(t=Kn(e[i]))&&""!==t&&(r&&(r+=" "),r+=t);return r}(e):o(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var Yn={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Un=h("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Xn=h("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Gn=function(e){return Un(e)||Xn(e)};function Zn(e){return Xn(e)?"svg":"math"===e?"math":void 0}var Qn=Object.create(null);var er=h("text,number,password,search,email,tel,url");function tr(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}var nr=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(e,t){return document.createElementNS(Yn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),rr={create:function(e,t){ir(t)},update:function(e,t){e.data.ref!==t.data.ref&&(ir(e,!0),ir(t))},destroy:function(e){ir(e,!0)}};function ir(e,t){var r=e.data.ref;if(n(r)){var i=e.context,o=e.componentInstance||e.elm,s=i.$refs;t?Array.isArray(s[r])?m(s[r],o):s[r]===o&&(s[r]=void 0):e.data.refInFor?Array.isArray(s[r])?s[r].indexOf(o)<0&&s[r].push(o):s[r]=[o]:s[r]=o}}var or=new he("",{},[]),sr=["create","activate","update","remove","destroy"];function ar(e,i){return e.key===i.key&&e.asyncFactory===i.asyncFactory&&(e.tag===i.tag&&e.isComment===i.isComment&&n(e.data)===n(i.data)&&function(e,t){if("input"!==e.tag)return!0;var r,i=n(r=e.data)&&n(r=r.attrs)&&r.type,o=n(r=t.data)&&n(r=r.attrs)&&r.type;return i===o||er(i)&&er(o)}(e,i)||r(e.isAsyncPlaceholder)&&t(i.asyncFactory.error))}function lr(e,t,r){var i,o,s={};for(i=t;i<=r;++i)n(o=e[i].key)&&(s[o]=i);return s}var cr={create:ur,update:ur,destroy:function(e){ur(e,or)}};function ur(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,o=e===or,s=t===or,a=hr(e.data.directives,e.context),l=hr(t.data.directives,t.context),c=[],u=[];for(n in l)r=a[n],i=l[n],r?(i.oldValue=r.value,i.oldArg=r.arg,pr(i,"update",t,e),i.def&&i.def.componentUpdated&&u.push(i)):(pr(i,"bind",t,e),i.def&&i.def.inserted&&c.push(i));if(c.length){var d=function(){for(var n=0;n<c.length;n++)pr(c[n],"inserted",t,e)};o?at(t,"insert",d):d()}u.length&&at(t,"postpatch",(function(){for(var n=0;n<u.length;n++)pr(u[n],"componentUpdated",t,e)}));if(!o)for(n in a)l[n]||pr(a[n],"unbind",e,e,s)}(e,t)}var dr=Object.create(null);function hr(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=dr),i[fr(r)]=r,r.def=Ie(t.$options,"directives",r.name);return i}function fr(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function pr(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(wy){Be(wy,n.context,"directive "+e.name+" "+t+" hook")}}var mr=[rr,cr];function gr(e,r){var i=r.componentOptions;if(!(n(i)&&!1===i.Ctor.options.inheritAttrs||t(e.data.attrs)&&t(r.data.attrs))){var o,s,a=r.elm,l=e.data.attrs||{},c=r.data.attrs||{};for(o in n(c.__ob__)&&(c=r.data.attrs=M({},c)),c)s=c[o],l[o]!==s&&vr(a,o,s,r.data.pre);for(o in(J||Y)&&c.value!==l.value&&vr(a,"value",c.value),l)t(c[o])&&(Bn(o)?a.removeAttributeNS(Ln,Vn(o)):zn(o)||a.removeAttribute(o))}}function vr(e,t,n,r){r||e.tagName.indexOf("-")>-1?yr(e,t,n):Fn(t)?Wn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):zn(t)?e.setAttribute(t,function(e,t){return Wn(t)||"false"===t?"false":"contenteditable"===e&&jn(t)?t:"true"}(t,n)):Bn(t)?Wn(n)?e.removeAttributeNS(Ln,Vn(t)):e.setAttributeNS(Ln,t,n):yr(e,t,n)}function yr(e,t,n){if(Wn(n))e.removeAttribute(t);else{if(J&&!K&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var br={create:gr,update:gr};function wr(e,r){var i=r.elm,o=r.data,s=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(s)||t(s.staticClass)&&t(s.class)))){var a=qn(r),l=i._transitionClasses;n(l)&&(a=Jn(a,Kn(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var xr,Sr,kr,Cr,Or,Mr,_r={create:wr,update:wr},Dr=/[\w).+\-_$\]]/;function Tr(e){var t,n,r,i,o,s=!1,a=!1,l=!1,c=!1,u=0,d=0,h=0,f=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),s)39===t&&92!==n&&(s=!1);else if(a)34===t&&92!==n&&(a=!1);else if(l)96===t&&92!==n&&(l=!1);else if(c)47===t&&92!==n&&(c=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||u||d||h){switch(t){case 34:a=!0;break;case 39:s=!0;break;case 96:l=!0;break;case 40:h++;break;case 41:h--;break;case 91:d++;break;case 93:d--;break;case 123:u++;break;case 125:u--}if(47===t){for(var p=r-1,m=void 0;p>=0&&" "===(m=e.charAt(p));p--);m&&Dr.test(m)||(c=!0)}}else void 0===i?(f=r+1,i=e.slice(0,r).trim()):g();function g(){(o||(o=[])).push(e.slice(f,r).trim()),f=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==f&&g(),o)for(r=0;r<o.length;r++)i=$r(i,o[r]);return i}function $r(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function Ar(e,t){console.error("[Vue compiler]: "+e)}function Er(e,t){return e?e.map((function(e){return e[t]})).filter((function(e){return e})):[]}function Nr(e,t,n,r,i){(e.props||(e.props=[])).push(Vr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Pr(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Vr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Ir(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Vr({name:t,value:n},r))}function Rr(e,t,n,r,i,o,s,a){(e.directives||(e.directives=[])).push(Vr({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:s},a)),e.plain=!1}function zr(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function jr(t,n,r,i,o,s,a,l){var c;(i=i||e).right?l?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete i.right):i.middle&&(l?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),i.capture&&(delete i.capture,n=zr("!",n,l)),i.once&&(delete i.once,n=zr("~",n,l)),i.passive&&(delete i.passive,n=zr("&",n,l)),i.native?(delete i.native,c=t.nativeEvents||(t.nativeEvents={})):c=t.events||(t.events={});var u=Vr({value:r.trim(),dynamic:l},a);i!==e&&(u.modifiers=i);var d=c[n];Array.isArray(d)?o?d.unshift(u):d.push(u):c[n]=d?o?[u,d]:[d,u]:u,t.plain=!1}function Fr(e,t,n){var r=Lr(e,":"+t)||Lr(e,"v-bind:"+t);if(null!=r)return Tr(r);if(!1!==n){var i=Lr(e,t);if(null!=i)return JSON.stringify(i)}}function Lr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,s=i.length;o<s;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Br(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Vr(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Wr(e,t,n){var r=n||{},i=r.number,o="$$v",s=o;r.trim&&(s="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(s="_n("+s+")");var a=qr(t,s);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function qr(e,t){var n=function(e){if(e=e.trim(),xr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<xr-1)return(Cr=e.lastIndexOf("."))>-1?{exp:e.slice(0,Cr),key:'"'+e.slice(Cr+1)+'"'}:{exp:e,key:null};Sr=e,Cr=Or=Mr=0;for(;!Jr();)Kr(kr=Hr())?Ur(kr):91===kr&&Yr(kr);return{exp:e.slice(0,Or),key:e.slice(Or+1,Mr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Hr(){return Sr.charCodeAt(++Cr)}function Jr(){return Cr>=xr}function Kr(e){return 34===e||39===e}function Yr(e){var t=1;for(Or=Cr;!Jr();)if(Kr(e=Hr()))Ur(e);else if(91===e&&t++,93===e&&t--,0===t){Mr=Cr;break}}function Ur(e){for(var t=e;!Jr()&&(e=Hr())!==t;);}var Xr;function Gr(e,t,n){var r=Xr;return function i(){var o=t.apply(null,arguments);null!==o&&ei(e,i,n,r)}}var Zr=Je&&!(G&&Number(G[1])<=53);function Qr(e,t,n,r){if(Zr){var i=un,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Xr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||Xr).removeEventListener(e,t._wrapper||t,n)}function ti(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Xr=r.elm,function(e){if(n(e.__r)){var t=J?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}n(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(i),st(i,o,Qr,ei,Gr,r.context),Xr=void 0}}var ni,ri={create:ti,update:ti};function ii(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,s=r.elm,a=e.data.domProps||{},l=r.data.domProps||{};for(i in n(l.__ob__)&&(l=r.data.domProps=M({},l)),a)i in l||(s[i]="");for(i in l){if(o=l[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===a[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=o;var c=t(o)?"":String(o);oi(s,c)&&(s.value=c)}else if("innerHTML"===i&&Xn(s.tagName)&&t(s.innerHTML)){(ni=ni||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var u=ni.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}else if(o!==a[i])try{s[i]=o}catch(wy){}}}}function oi(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(wy){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return d(r)!==d(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var si={create:ii,update:ii},ai=y((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function li(e){var t=ci(e.style);return e.staticStyle?M(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?_(e):"string"==typeof e?ai(e):e}var ui,di=/^--/,hi=/\s*!important$/,fi=function(e,t,n){if(di.test(t))e.style.setProperty(t,n);else if(hi.test(n))e.style.setProperty(k(t),n.replace(hi,""),"important");else{var r=mi(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},pi=["Webkit","Moz","ms"],mi=y((function(e){if(ui=ui||document.createElement("div").style,"filter"!==(e=w(e))&&e in ui)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<pi.length;n++){var r=pi[n]+t;if(r in ui)return r}}));function gi(e,r){var i=r.data,o=e.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var s,a,l=r.elm,c=o.staticStyle,u=o.normalizedStyle||o.style||{},d=c||u,h=ci(r.data.style)||{};r.data.normalizedStyle=n(h.__ob__)?M({},h):h;var f=function(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=li(i.data))&&M(r,n);(n=li(e.data))&&M(r,n);for(var o=e;o=o.parent;)o.data&&(n=li(o.data))&&M(r,n);return r}(r,!0);for(a in d)t(f[a])&&fi(l,a,"");for(a in f)(s=f[a])!==d[a]&&fi(l,a,null==s?"":s)}}var vi={create:gi,update:gi},yi=/\s+/;function bi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function wi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function xi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&M(t,Si(e.name||"v")),M(t,e),t}return"string"==typeof e?Si(e):void 0}}var Si=y((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),ki=V&&!K,Ci="transition",Oi="transitionend",Mi="animation",_i="animationend";ki&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ci="WebkitTransition",Oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Mi="WebkitAnimation",_i="webkitAnimationEnd"));var Di=V?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ti(e){Di((function(){Di(e)}))}function $i(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),bi(e,t))}function Ai(e,t){e._transitionClasses&&m(e._transitionClasses,t),wi(e,t)}function Ei(e,t,n){var r=Pi(e,t),i=r.type,o=r.timeout,s=r.propCount;if(!i)return n();var a="transition"===i?Oi:_i,l=0,c=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++l>=s&&c()};setTimeout((function(){l<s&&c()}),o+1),e.addEventListener(a,u)}var Ni=/\b(transform|all)(,|$)/;function Pi(e,t){var n,r=window.getComputedStyle(e),i=(r[Ci+"Delay"]||"").split(", "),o=(r[Ci+"Duration"]||"").split(", "),s=Ii(i,o),a=(r[Mi+"Delay"]||"").split(", "),l=(r[Mi+"Duration"]||"").split(", "),c=Ii(a,l),u=0,d=0;return"transition"===t?s>0&&(n="transition",u=s,d=o.length):"animation"===t?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?o.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Ni.test(r[Ci+"Property"])}}function Ii(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map((function(t,n){return Ri(t)+Ri(e[n])})))}function Ri(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function zi(e,r){var i=e.elm;n(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var s=xi(e.data.transition);if(!t(s)&&!n(i._enterCb)&&1===i.nodeType){for(var a=s.css,l=s.type,c=s.enterClass,u=s.enterToClass,h=s.enterActiveClass,f=s.appearClass,p=s.appearToClass,m=s.appearActiveClass,g=s.beforeEnter,v=s.enter,y=s.afterEnter,b=s.enterCancelled,w=s.beforeAppear,x=s.appear,S=s.afterAppear,k=s.appearCancelled,C=s.duration,O=Gt,M=Gt.$vnode;M&&M.parent;)O=M.context,M=M.parent;var _=!O._isMounted||!e.isRootInsert;if(!_||x||""===x){var D=_&&f?f:c,T=_&&m?m:h,$=_&&p?p:u,A=_&&w||g,E=_&&"function"==typeof x?x:v,P=_&&S||y,I=_&&k||b,R=d(o(C)?C.enter:C),z=!1!==a&&!K,j=Li(E),F=i._enterCb=N((function(){z&&(Ai(i,$),Ai(i,T)),F.cancelled?(z&&Ai(i,D),I&&I(i)):P&&P(i),i._enterCb=null}));e.data.show||at(e,"insert",(function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),E&&E(i,F)})),A&&A(i),z&&($i(i,D),$i(i,T),Ti((function(){Ai(i,D),F.cancelled||($i(i,$),j||(Fi(R)?setTimeout(F,R):Ei(i,l,F)))}))),e.data.show&&(r&&r(),E&&E(i,F)),z||j||F()}}}function ji(e,r){var i=e.elm;n(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var s=xi(e.data.transition);if(t(s)||1!==i.nodeType)return r();if(!n(i._leaveCb)){var a=s.css,l=s.type,c=s.leaveClass,u=s.leaveToClass,h=s.leaveActiveClass,f=s.beforeLeave,p=s.leave,m=s.afterLeave,g=s.leaveCancelled,v=s.delayLeave,y=s.duration,b=!1!==a&&!K,w=Li(p),x=d(o(y)?y.leave:y),S=i._leaveCb=N((function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),b&&(Ai(i,u),Ai(i,h)),S.cancelled?(b&&Ai(i,c),g&&g(i)):(r(),m&&m(i)),i._leaveCb=null}));v?v(k):k()}function k(){S.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),f&&f(i),b&&($i(i,c),$i(i,h),Ti((function(){Ai(i,c),S.cancelled||($i(i,u),w||(Fi(x)?setTimeout(S,x):Ei(i,l,S)))}))),p&&p(i,S),b||w||S())}}function Fi(e){return"number"==typeof e&&!isNaN(e)}function Li(e){if(t(e))return!1;var r=e.fns;return n(r)?Li(Array.isArray(r)?r[0]:r):(e._length||e.length)>1}function Bi(e,t){!0!==t.data.show&&zi(t)}var Vi=function(e){var o,s,a={},l=e.modules,c=e.nodeOps;for(o=0;o<sr.length;++o)for(a[sr[o]]=[],s=0;s<l.length;++s)n(l[s][sr[o]])&&a[sr[o]].push(l[s][sr[o]]);function u(e){var t=c.parentNode(e);n(t)&&c.removeChild(t,e)}function d(e,t,i,o,s,l,u){if(n(e.elm)&&n(l)&&(e=l[u]=ge(e)),e.isRootInsert=!s,!function(e,t,i,o){var s=e.data;if(n(s)){var l=n(e.componentInstance)&&s.keepAlive;if(n(s=s.hook)&&n(s=s.init)&&s(e,!1),n(e.componentInstance))return f(e,t),p(i,e.elm,o),r(l)&&function(e,t,r,i){var o,s=e;for(;s.componentInstance;)if(n(o=(s=s.componentInstance._vnode).data)&&n(o=o.transition)){for(o=0;o<a.activate.length;++o)a.activate[o](or,s);t.push(s);break}p(r,e.elm,i)}(e,t,i,o),!0}}(e,t,i,o)){var d=e.data,h=e.children,g=e.tag;n(g)?(e.elm=e.ns?c.createElementNS(e.ns,g):c.createElement(g,e),y(e),m(e,h,t),n(d)&&v(e,t),p(i,e.elm,o)):r(e.isComment)?(e.elm=c.createComment(e.text),p(i,e.elm,o)):(e.elm=c.createTextNode(e.text),p(i,e.elm,o))}}function f(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,g(e)?(v(e,t),y(e)):(ir(e),t.push(e))}function p(e,t,r){n(e)&&(n(r)?c.parentNode(r)===e&&c.insertBefore(e,t,r):c.appendChild(e,t))}function m(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)d(t[r],n,e.elm,null,!0,t,r);else i(e.text)&&c.appendChild(e.elm,c.createTextNode(String(e.text)))}function g(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return n(e.tag)}function v(e,t){for(var r=0;r<a.create.length;++r)a.create[r](or,e);n(o=e.data.hook)&&(n(o.create)&&o.create(or,e),n(o.insert)&&t.push(e))}function y(e){var t;if(n(t=e.fnScopeId))c.setStyleScope(e.elm,t);else for(var r=e;r;)n(t=r.context)&&n(t=t.$options._scopeId)&&c.setStyleScope(e.elm,t),r=r.parent;n(t=Gt)&&t!==e.context&&t!==e.fnContext&&n(t=t.$options._scopeId)&&c.setStyleScope(e.elm,t)}function b(e,t,n,r,i,o){for(;r<=i;++r)d(n[r],o,e,t,!1,n,r)}function w(e){var t,r,i=e.data;if(n(i))for(n(t=i.hook)&&n(t=t.destroy)&&t(e),t=0;t<a.destroy.length;++t)a.destroy[t](e);if(n(t=e.children))for(r=0;r<e.children.length;++r)w(e.children[r])}function x(e,t,r){for(;t<=r;++t){var i=e[t];n(i)&&(n(i.tag)?(S(i),w(i)):u(i.elm))}}function S(e,t){if(n(t)||n(e.data)){var r,i=a.remove.length+1;for(n(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&u(e)}return n.listeners=t,n}(e.elm,i),n(r=e.componentInstance)&&n(r=r._vnode)&&n(r.data)&&S(r,t),r=0;r<a.remove.length;++r)a.remove[r](e,t);n(r=e.data.hook)&&n(r=r.remove)?r(e,t):t()}else u(e.elm)}function k(e,t,r,i){for(var o=r;o<i;o++){var s=t[o];if(n(s)&&ar(e,s))return o}}function C(e,i,o,s,l,u){if(e!==i){n(i.elm)&&n(s)&&(i=s[l]=ge(i));var h=i.elm=e.elm;if(r(e.isAsyncPlaceholder))n(i.asyncFactory.resolved)?_(e.elm,i,o):i.isAsyncPlaceholder=!0;else if(r(i.isStatic)&&r(e.isStatic)&&i.key===e.key&&(r(i.isCloned)||r(i.isOnce)))i.componentInstance=e.componentInstance;else{var f,p=i.data;n(p)&&n(f=p.hook)&&n(f=f.prepatch)&&f(e,i);var m=e.children,v=i.children;if(n(p)&&g(i)){for(f=0;f<a.update.length;++f)a.update[f](e,i);n(f=p.hook)&&n(f=f.update)&&f(e,i)}t(i.text)?n(m)&&n(v)?m!==v&&function(e,r,i,o,s){for(var a,l,u,h=0,f=0,p=r.length-1,m=r[0],g=r[p],v=i.length-1,y=i[0],w=i[v],S=!s;h<=p&&f<=v;)t(m)?m=r[++h]:t(g)?g=r[--p]:ar(m,y)?(C(m,y,o,i,f),m=r[++h],y=i[++f]):ar(g,w)?(C(g,w,o,i,v),g=r[--p],w=i[--v]):ar(m,w)?(C(m,w,o,i,v),S&&c.insertBefore(e,m.elm,c.nextSibling(g.elm)),m=r[++h],w=i[--v]):ar(g,y)?(C(g,y,o,i,f),S&&c.insertBefore(e,g.elm,m.elm),g=r[--p],y=i[++f]):(t(a)&&(a=lr(r,h,p)),t(l=n(y.key)?a[y.key]:k(y,r,h,p))?d(y,o,e,m.elm,!1,i,f):ar(u=r[l],y)?(C(u,y,o,i,f),r[l]=void 0,S&&c.insertBefore(e,u.elm,m.elm)):d(y,o,e,m.elm,!1,i,f),y=i[++f]);h>p?b(e,t(i[v+1])?null:i[v+1].elm,i,f,v,o):f>v&&x(r,h,p)}(h,m,v,o,u):n(v)?(n(e.text)&&c.setTextContent(h,""),b(h,null,v,0,v.length-1,o)):n(m)?x(m,0,m.length-1):n(e.text)&&c.setTextContent(h,""):e.text!==i.text&&c.setTextContent(h,i.text),n(p)&&n(f=p.hook)&&n(f=f.postpatch)&&f(e,i)}}}function O(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var M=h("attrs,class,staticClass,staticStyle,key");function _(e,t,i,o){var s,a=t.tag,l=t.data,c=t.children;if(o=o||l&&l.pre,t.elm=e,r(t.isComment)&&n(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(n(l)&&(n(s=l.hook)&&n(s=s.init)&&s(t,!0),n(s=t.componentInstance)))return f(t,i),!0;if(n(a)){if(n(c))if(e.hasChildNodes())if(n(s=l)&&n(s=s.domProps)&&n(s=s.innerHTML)){if(s!==e.innerHTML)return!1}else{for(var u=!0,d=e.firstChild,h=0;h<c.length;h++){if(!d||!_(d,c[h],i,o)){u=!1;break}d=d.nextSibling}if(!u||d)return!1}else m(t,c,i);if(n(l)){var p=!1;for(var g in l)if(!M(g)){p=!0,v(t,i);break}!p&&l.class&&nt(l.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,i,o,s){if(!t(i)){var l,u=!1,h=[];if(t(e))u=!0,d(i,h);else{var f=n(e.nodeType);if(!f&&ar(e,i))C(e,i,h,null,null,s);else{if(f){if(1===e.nodeType&&e.hasAttribute("data-server-rendered")&&(e.removeAttribute("data-server-rendered"),o=!0),r(o)&&_(e,i,h))return O(i,h,!0),e;l=e,e=new he(c.tagName(l).toLowerCase(),{},[],void 0,l)}var p=e.elm,m=c.parentNode(p);if(d(i,h,p._leaveCb?null:m,c.nextSibling(p)),n(i.parent))for(var v=i.parent,y=g(i);v;){for(var b=0;b<a.destroy.length;++b)a.destroy[b](v);if(v.elm=i.elm,y){for(var S=0;S<a.create.length;++S)a.create[S](or,v);var k=v.data.hook.insert;if(k.merged)for(var M=1;M<k.fns.length;M++)k.fns[M]()}else ir(v);v=v.parent}n(m)?x([e],0,0):n(e.tag)&&w(e)}}return O(i,h,u),i.elm}n(e)&&w(e)}}({nodeOps:nr,modules:[br,_r,ri,si,vi,V?{create:Bi,activate:Bi,remove:function(e,t){!0!==e.data.show?ji(e,t):t()}}:{}].concat(mr)});K&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&Xi(e,"input")}));var Wi={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?at(n,"postpatch",(function(){Wi.componentUpdated(e,t,n)})):qi(e,t,n.context),e._vOptions=[].map.call(e.options,Ki)):("textarea"===n.tag||er(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",Yi),e.addEventListener("compositionend",Ui),e.addEventListener("change",Ui),K&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){qi(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Ki);if(i.some((function(e,t){return!A(e,r[t])})))(e.multiple?t.value.some((function(e){return Ji(e,i)})):t.value!==t.oldValue&&Ji(t.value,i))&&Xi(e,"change")}}};function qi(e,t,n){Hi(e,t),(J||Y)&&setTimeout((function(){Hi(e,t)}),0)}function Hi(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,s,a=0,l=e.options.length;a<l;a++)if(s=e.options[a],i)o=E(r,Ki(s))>-1,s.selected!==o&&(s.selected=o);else if(A(Ki(s),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));i||(e.selectedIndex=-1)}}function Ji(e,t){return t.every((function(t){return!A(t,e)}))}function Ki(e){return"_value"in e?e._value:e.value}function Yi(e){e.target.composing=!0}function Ui(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,"input"))}function Xi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Gi(e){return!e.componentInstance||e.data&&e.data.transition?e:Gi(e.componentInstance._vnode)}var Zi={model:Wi,show:{bind:function(e,t,n){var r=t.value,i=(n=Gi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,zi(n,(function(){e.style.display=o}))):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Gi(n)).data&&n.data.transition?(n.data.show=!0,r?zi(n,(function(){e.style.display=e.__vOriginalDisplay})):ji(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Qi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function eo(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?eo(Jt(t.children)):e}function to(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[w(o)]=i[o];return t}function no(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ro=function(e){return e.tag||mt(e)},io=function(e){return"show"===e.name},oo={name:"transition",props:Qi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ro)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var s=eo(o);if(!s)return o;if(this._leaving)return no(e,o);var a="__transition-"+this._uid+"-";s.key=null==s.key?s.isComment?a+"comment":a+s.tag:i(s.key)?0===String(s.key).indexOf(a)?s.key:a+s.key:s.key;var l=(s.data||(s.data={})).transition=to(this),c=this._vnode,u=eo(c);if(s.data.directives&&s.data.directives.some(io)&&(s.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(s,u)&&!mt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=M({},l);if("out-in"===r)return this._leaving=!0,at(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),no(e,o);if("in-out"===r){if(mt(s))return c;var h,f=function(){h()};at(l,"afterEnter",f),at(l,"enterCancelled",f),at(d,"delayLeave",(function(e){h=e}))}}return o}}},so=M({tag:String,moveClass:String},Qi);delete so.mode;var ao={props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],s=to(this),a=0;a<i.length;a++){var l=i[a];l.tag&&null!=l.key&&0!==String(l.key).indexOf("__vlist")&&(o.push(l),n[l.key]=l,(l.data||(l.data={})).transition=s)}if(r){for(var c=[],u=[],d=0;d<r.length;d++){var h=r[d];h.data.transition=s,h.data.pos=h.elm.getBoundingClientRect(),n[h.key]?c.push(h):u.push(h)}this.kept=e(t,null,c),this.removed=u}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(lo),e.forEach(co),e.forEach(uo),this._reflow=document.body.offsetHeight,e.forEach((function(e){if(e.data.moved){var n=e.elm,r=n.style;$i(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Oi,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Oi,e),n._moveCb=null,Ai(n,t))})}})))},methods:{hasMove:function(e,t){if(!ki)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach((function(e){wi(n,e)})),bi(n,t),n.style.display="none",this.$el.appendChild(n);var r=Pi(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function lo(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function co(e){e.data.newPos=e.elm.getBoundingClientRect()}function uo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}var ho={Transition:oo,TransitionGroup:ao};Mn.config.mustUseProp=Rn,Mn.config.isReservedTag=Gn,Mn.config.isReservedAttr=Pn,Mn.config.getTagNamespace=Zn,Mn.config.isUnknownElement=function(e){if(!V)return!0;if(Gn(e))return!1;if(e=e.toLowerCase(),null!=Qn[e])return Qn[e];var t=document.createElement(e);return e.indexOf("-")>-1?Qn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Qn[e]=/HTMLUnknownElement/.test(t.toString())},M(Mn.options.directives,Zi),M(Mn.options.components,ho),Mn.prototype.__patch__=V?Vi:D,Mn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=pe),nn(e,"beforeMount"),r=function(){e._update(e._render(),n)},new mn(e,r,D,{before:function(){e._isMounted&&!e._isDestroyed&&nn(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,nn(e,"mounted")),e}(this,e=e&&V?tr(e):void 0,t)},V&&setTimeout((function(){R.devtools&&ne&&ne.emit("init",Mn)}),0);var fo=/\{\{((?:.|\r?\n)+?)\}\}/g,po=/[-.*+?^${}()|[\]\/\\]/g,mo=y((function(e){var t=e[0].replace(po,"\\$&"),n=e[1].replace(po,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}));var go={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Lr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var vo,yo={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Lr(e,"style");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},bo=function(e){return(vo=vo||document.createElement("div")).innerHTML=e,vo.textContent},wo=h("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),xo=h("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),So=h("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ko=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Co=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Oo="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+z.source+"]*",Mo="((?:"+Oo+"\\:)?"+Oo+")",_o=new RegExp("^<"+Mo),Do=/^\s*(\/?)>/,To=new RegExp("^<\\/"+Mo+"[^>]*>"),$o=/^<!DOCTYPE [^>]+>/i,Ao=/^<!\--/,Eo=/^<!\[/,No=h("script,style,textarea",!0),Po={},Io={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t","'":"'"},Ro=/&(?:lt|gt|quot|amp|#39);/g,zo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,jo=h("pre,textarea",!0),Fo=function(e,t){return e&&jo(e)&&"\n"===t[0]};function Lo(e,t){var n=t?zo:Ro;return e.replace(n,(function(e){return Io[e]}))}var Bo,Vo,Wo,qo,Ho,Jo,Ko,Yo,Uo=/^@|^v-on:/,Xo=/^v-|^@|^:|^#/,Go=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Zo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Qo=/^\(|\)$/g,es=/^\[.*\]$/,ts=/:(.*)$/,ns=/^:|^\.|^v-bind:/,rs=/\.[^.\]]+(?=[^\]]*$)/g,is=/^v-slot(:|$)|^#/,ss=/[\r\n]/,as=/[ \f\t\r\n]+/g,ls=y(bo);function cs(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:gs(t),rawAttrsMap:{},parent:n,children:[]}}function us(e,t){Bo=t.warn||Ar,Jo=t.isPreTag||T,Ko=t.mustUseProp||T,Yo=t.getTagNamespace||T,t.isReservedTag,Wo=Er(t.modules,"transformNode"),qo=Er(t.modules,"preTransformNode"),Ho=Er(t.modules,"postTransformNode"),Vo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,s=t.whitespace,a=!1,l=!1;function c(e){if(u(e),a||e.processed||(e=ds(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&fs(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)s=e,c=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children),c&&c.if&&fs(c,{exp:s.elseif,block:s});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var s,c;e.children=e.children.filter((function(e){return!e.slotScope})),u(e),e.pre&&(a=!1),Jo(e.tag)&&(l=!1);for(var d=0;d<Ho.length;d++)Ho[d](e,t)}function u(e){if(!l)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return function(e,t){for(var n,r,i=[],o=t.expectHTML,s=t.isUnaryTag||T,a=t.canBeLeftOpenTag||T,l=0;e;){if(n=e,r&&No(r)){var c=0,u=r.toLowerCase(),d=Po[u]||(Po[u]=new RegExp("([\\s\\S]*?)(</"+u+"[^>]*>)","i")),h=e.replace(d,(function(e,n,r){return c=r.length,No(u)||"noscript"===u||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Fo(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));l+=e.length-h.length,e=h,M(u,l-c,l)}else{var f=e.indexOf("<");if(0===f){if(Ao.test(e)){var p=e.indexOf("--\x3e");if(p>=0){t.shouldKeepComment&&t.comment(e.substring(4,p),l,l+p+3),k(p+3);continue}}if(Eo.test(e)){var m=e.indexOf("]>");if(m>=0){k(m+2);continue}}var g=e.match($o);if(g){k(g[0].length);continue}var v=e.match(To);if(v){var y=l;k(v[0].length),M(v[1],y,l);continue}var b=C();if(b){O(b),Fo(b.tagName,e)&&k(1);continue}}var w=void 0,x=void 0,S=void 0;if(f>=0){for(x=e.slice(f);!(To.test(x)||_o.test(x)||Ao.test(x)||Eo.test(x)||(S=x.indexOf("<",1))<0);)f+=S,x=e.slice(f);w=e.substring(0,f)}f<0&&(w=e),w&&k(w.length),t.chars&&w&&t.chars(w,l-w.length,l)}if(e===n){t.chars&&t.chars(e);break}}function k(t){l+=t,e=e.substring(t)}function C(){var t=e.match(_o);if(t){var n,r,i={tagName:t[1],attrs:[],start:l};for(k(t[0].length);!(n=e.match(Do))&&(r=e.match(Co)||e.match(ko));)r.start=l,k(r[0].length),r.end=l,i.attrs.push(r);if(n)return i.unarySlash=n[1],k(n[0].length),i.end=l,i}}function O(e){var n=e.tagName,l=e.unarySlash;o&&("p"===r&&So(n)&&M(r),a(n)&&r===n&&M(n));for(var c=s(n)||!!l,u=e.attrs.length,d=new Array(u),h=0;h<u;h++){var f=e.attrs[h],p=f[3]||f[4]||f[5]||"",m="a"===n&&"href"===f[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;d[h]={name:f[1],value:Lo(p,m)}}c||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:d,start:e.start,end:e.end}),r=n),t.start&&t.start(n,d,c,e.start,e.end)}function M(e,n,o){var s,a;if(null==n&&(n=l),null==o&&(o=l),e)for(a=e.toLowerCase(),s=i.length-1;s>=0&&i[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=i.length-1;c>=s;c--)t.end&&t.end(i[c].tag,n,o);i.length=s,r=s&&i[s-1].tag}else"br"===a?t.start&&t.start(e,[],!0,n,o):"p"===a&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}M()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,s,u,d){var h=r&&r.ns||Yo(e);J&&"svg"===h&&(o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];vs.test(r.name)||(r.name=r.name.replace(ys,""),t.push(r))}return t}(o));var f,p=cs(e,o,r);h&&(p.ns=h),"style"!==(f=p).tag&&("script"!==f.tag||f.attrsMap.type&&"text/javascript"!==f.attrsMap.type)||te()||(p.forbidden=!0);for(var m=0;m<qo.length;m++)p=qo[m](p,t)||p;a||(!function(e){null!=Lr(e,"v-pre")&&(e.pre=!0)}(p),p.pre&&(a=!0)),Jo(p.tag)&&(l=!0),a?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}(p):p.processed||(hs(p),function(e){var t=Lr(e,"v-if");if(t)e.if=t,fs(e,{exp:t,block:e});else{null!=Lr(e,"v-else")&&(e.else=!0);var n=Lr(e,"v-else-if");n&&(e.elseif=n)}}(p),function(e){null!=Lr(e,"v-once")&&(e.once=!0)}(p)),n||(n=p),s?c(p):(r=p,i.push(p))},end:function(e,t,n){var o=i[i.length-1];i.length-=1,r=i[i.length-1],c(o)},chars:function(e,t,n){if(r&&(!J||"textarea"!==r.tag||r.attrsMap.placeholder!==e)){var i,c,u,d=r.children;if(e=l||e.trim()?"script"===(i=r).tag||"style"===i.tag?e:ls(e):d.length?s?"condense"===s&&ss.test(e)?"":" ":o?" ":"":"")l||"condense"!==s||(e=e.replace(as," ")),!a&&" "!==e&&(c=function(e,t){var n=t?mo(t):fo;if(n.test(e)){for(var r,i,o,s=[],a=[],l=n.lastIndex=0;r=n.exec(e);){(i=r.index)>l&&(a.push(o=e.slice(l,i)),s.push(JSON.stringify(o)));var c=Tr(r[1].trim());s.push("_s("+c+")"),a.push({"@binding":c}),l=i+r[0].length}return l<e.length&&(a.push(o=e.slice(l)),s.push(JSON.stringify(o))),{expression:s.join("+"),tokens:a}}}(e,Vo))?u={type:2,expression:c.expression,tokens:c.tokens,text:e}:" "===e&&d.length&&" "===d[d.length-1].text||(u={type:3,text:e}),u&&d.push(u)}},comment:function(e,t,n){if(r){var i={type:3,text:e,isComment:!0};r.children.push(i)}}}),n}function ds(e,t){var n,r;(r=Fr(n=e,"key"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Fr(e,"ref");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?(t=Lr(e,"scope"),e.slotScope=t||Lr(e,"slot-scope")):(t=Lr(e,"slot-scope"))&&(e.slotScope=t);var n=Fr(e,"slot");n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||Pr(e,"slot",n,function(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}(e,"slot")));if("template"===e.tag){var r=Br(e,is);if(r){var i=ps(r),o=i.name,s=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=s,e.slotScope=r.value||"_empty_"}}else{var a=Br(e,is);if(a){var l=e.scopedSlots||(e.scopedSlots={}),c=ps(a),u=c.name,d=c.dynamic,h=l[u]=cs("template",[],e);h.slotTarget=u,h.slotTargetDynamic=d,h.children=e.children.filter((function(e){if(!e.slotScope)return e.parent=h,!0})),h.slotScope=a.value||"_empty_",e.children=[],e.plain=!1}}}(e),function(e){"slot"===e.tag&&(e.slotName=Fr(e,"name"))}(e),function(e){var t;(t=Fr(e,"is"))&&(e.component=t);null!=Lr(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var i=0;i<Wo.length;i++)e=Wo[i](e,t)||e;return function(e){var t,n,r,i,o,s,a,l,c=e.attrsList;for(t=0,n=c.length;t<n;t++)if(r=i=c[t].name,o=c[t].value,Xo.test(r))if(e.hasBindings=!0,(s=ms(r.replace(Xo,"")))&&(r=r.replace(rs,"")),ns.test(r))r=r.replace(ns,""),o=Tr(o),(l=es.test(r))&&(r=r.slice(1,-1)),s&&(s.prop&&!l&&"innerHtml"===(r=w(r))&&(r="innerHTML"),s.camel&&!l&&(r=w(r)),s.sync&&(a=qr(o,"$event"),l?jr(e,'"update:"+('+r+")",a,null,!1,0,c[t],!0):(jr(e,"update:"+w(r),a,null,!1,0,c[t]),k(r)!==w(r)&&jr(e,"update:"+k(r),a,null,!1,0,c[t])))),s&&s.prop||!e.component&&Ko(e.tag,e.attrsMap.type,r)?Nr(e,r,o,c[t],l):Pr(e,r,o,c[t],l);else if(Uo.test(r))r=r.replace(Uo,""),(l=es.test(r))&&(r=r.slice(1,-1)),jr(e,r,o,s,!1,0,c[t],l);else{var u=(r=r.replace(Xo,"")).match(ts),d=u&&u[1];l=!1,d&&(r=r.slice(0,-(d.length+1)),es.test(d)&&(d=d.slice(1,-1),l=!0)),Rr(e,r,i,o,d,l,s,c[t])}else Pr(e,r,JSON.stringify(o),c[t]),!e.component&&"muted"===r&&Ko(e.tag,e.attrsMap.type,r)&&Nr(e,r,"true",c[t])}(e),e}function hs(e){var t;if(t=Lr(e,"v-for")){var n=function(e){var t=e.match(Go);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Qo,""),i=r.match(Zo);i?(n.alias=r.replace(Zo,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(t);n&&M(e,n)}}function fs(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function ps(e){var t=e.name.replace(is,"");return t||"#"!==e.name[0]&&(t="default"),es.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function ms(e){var t=e.match(rs);if(t){var n={};return t.forEach((function(e){n[e.slice(1)]=!0})),n}}function gs(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}var vs=/^xmlns:NS\d+/,ys=/^NS\d+:/;function bs(e){return cs(e.tag,e.attrsList.slice(),e.parent)}var ws=[go,yo,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Fr(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Lr(e,"v-if",!0),o=i?"&&("+i+")":"",s=null!=Lr(e,"v-else",!0),a=Lr(e,"v-else-if",!0),l=bs(e);hs(l),Ir(l,"type","checkbox"),ds(l,t),l.processed=!0,l.if="("+n+")==='checkbox'"+o,fs(l,{exp:l.if,block:l});var c=bs(e);Lr(c,"v-for",!0),Ir(c,"type","radio"),ds(c,t),fs(l,{exp:"("+n+")==='radio'"+o,block:c});var u=bs(e);return Lr(u,"v-for",!0),Ir(u,":type",n),ds(u,t),fs(l,{exp:i,block:u}),s?l.else=!0:a&&(l.elseif=a),l}}}}];var xs,Ss,ks,Cs={model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,s=e.attrsMap.type;if(e.component)return Wr(e,r,i),!1;if("select"===o)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";r=r+" "+qr(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),jr(e,"change",r,null,!0)}(e,r,i);else if("input"===o&&"checkbox"===s)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null",o=Fr(e,"true-value")||"true",s=Fr(e,"false-value")||"false";Nr(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),jr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+qr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+qr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+qr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===s)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null";Nr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),jr(e,"change",qr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,s=i.number,a=i.trim,l=!o&&"range"!==r,c=o?"change":"range"===r?"__r":"input",u="$event.target.value";a&&(u="$event.target.value.trim()");s&&(u="_n("+u+")");var d=qr(t,u);l&&(d="if($event.target.composing)return;"+d);Nr(e,"value","("+t+")"),jr(e,c,d,null,!0),(a||s)&&jr(e,"blur","$forceUpdate()")}(e,r,i);else if(!R.isReservedTag(o))return Wr(e,r,i),!1;return!0},text:function(e,t){t.value&&Nr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Nr(e,"innerHTML","_s("+t.value+")",t)}},Os={expectHTML:!0,modules:ws,directives:Cs,isPreTag:function(e){return"pre"===e},isUnaryTag:wo,mustUseProp:Rn,canBeLeftOpenTag:xo,isReservedTag:Gn,getTagNamespace:Zn,staticKeys:(xs=ws,xs.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(","))},Ms=y((function(e){return h("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function _s(e,t){e&&(Ss=Ms(t.staticKeys||""),ks=t.isReservedTag||T,Ds(e),Ts(e,!1))}function Ds(e){if(e.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||f(e.tag)||!ks(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Ss)))}(e),1===e.type){if(!ks(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];Ds(r),r.static||(e.static=!1)}if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++){var s=e.ifConditions[i].block;Ds(s),s.static||(e.static=!1)}}}function Ts(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)Ts(e.children[n],t||!!e.for);if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++)Ts(e.ifConditions[i].block,t)}}var $s=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,As=/\([^)]*?\);*$/,Es=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ns={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ps={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Is=function(e){return"if("+e+")return null;"},Rs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Is("$event.target !== $event.currentTarget"),ctrl:Is("!$event.ctrlKey"),shift:Is("!$event.shiftKey"),alt:Is("!$event.altKey"),meta:Is("!$event.metaKey"),left:Is("'button' in $event && $event.button !== 0"),middle:Is("'button' in $event && $event.button !== 1"),right:Is("'button' in $event && $event.button !== 2")};function zs(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var s=js(e[o]);e[o]&&e[o].dynamic?i+=o+","+s+",":r+='"'+o+'":'+s+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function js(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return js(e)})).join(",")+"]";var t=Es.test(e.value),n=$s.test(e.value),r=Es.test(e.value.replace(As,""));if(e.modifiers){var i="",o="",s=[];for(var a in e.modifiers)if(Rs[a])o+=Rs[a],Ns[a]&&s.push(a);else if("exact"===a){var l=e.modifiers;o+=Is(["ctrl","shift","alt","meta"].filter((function(e){return!l[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(a);return s.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Fs).join("&&")+")return null;"}(s)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Fs(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ns[e],r=Ps[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ls={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:D},Bs=function(e){this.options=e,this.warn=e.warn||Ar,this.transforms=Er(e.modules,"transformCode"),this.dataGenFns=Er(e.modules,"genData"),this.directives=M(M({},Ls),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Vs(e,t){var n=new Bs(t);return{render:"with(this){return "+(e?"script"===e.tag?"null":Ws(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ws(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return qs(e,t);if(e.once&&!e.onceProcessed)return Hs(e,t);if(e.for&&!e.forProcessed)return Ys(e,t);if(e.if&&!e.ifProcessed)return Js(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Zs(e,t),i="_t("+n+(r?",function(){return "+r+"}":""),o=e.attrs||e.dynamicAttrs?ta((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:w(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];!o&&!s||r||(i+=",null");o&&(i+=","+o);s&&(i+=(o?"":",null")+","+s);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Zs(t,n,!0);return"_c("+e+","+Us(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Us(e,t));var i=e.inlineTemplate?null:Zs(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return Zs(e,t)||"void 0"}function qs(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+Ws(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function Hs(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Js(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Ws(e,t)+","+t.onceId+++","+n+")":Ws(e,t)}return qs(e,t)}function Js(e,t,n,r){return e.ifProcessed=!0,Ks(e.ifConditions.slice(),t,n,r)}function Ks(e,t,n,r){if(!e.length)return r||"_e()";var i=e.shift();return i.exp?"("+i.exp+")?"+o(i.block)+":"+Ks(e,t,n,r):""+o(i.block);function o(e){return n?n(e,t):e.once?Hs(e,t):Ws(e,t)}}function Ys(e,t,n,r){var i=e.for,o=e.alias,s=e.iterator1?","+e.iterator1:"",a=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+s+a+"){return "+(n||Ws)(e,t)+"})"}function Us(e,t){var n="{",r=function(e,t){var n=e.directives;if(!n)return;var r,i,o,s,a="directives:[",l=!1;for(r=0,i=n.length;r<i;r++){o=n[r],s=!0;var c=t.directives[o.name];c&&(s=!!c(e,o,t.warn)),s&&(l=!0,a+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}if(l)return a.slice(0,-1)+"]"}(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+ta(e.attrs)+","),e.props&&(n+="domProps:"+ta(e.props)+","),e.events&&(n+=zs(e.events,!1)+","),e.nativeEvents&&(n+=zs(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some((function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Xs(n)})),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&"_empty_"!==o.slotScope||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var s=Object.keys(t).map((function(e){return Gs(t[e],n)})).join(",");return"scopedSlots:_u(["+s+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+function(e){var t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Vs(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+ta(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Xs(e){return 1===e.type&&("slot"===e.tag||e.children.some(Xs))}function Gs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Js(e,t,Gs,"null");if(e.for&&!e.forProcessed)return Ys(e,t,Gs);var r="_empty_"===e.slotScope?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Zs(e,t)||"undefined")+":undefined":Zs(e,t)||"undefined":Ws(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Zs(e,t,n,r,i){var o=e.children;if(o.length){var s=o[0];if(1===o.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Ws)(s,t)+a}var l=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Qs(i)||i.ifConditions&&i.ifConditions.some((function(e){return Qs(e.block)}))){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some((function(e){return t(e.block)})))&&(n=1)}}return n}(o,t.maybeComponent):0,c=i||ea;return"["+o.map((function(e){return c(e,t)})).join(",")+"]"+(l?","+l:"")}}function Qs(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function ea(e,t){return 1===e.type?Ws(e,t):3===e.type&&e.isComment?(r=e,"_e("+JSON.stringify(r.text)+")"):"_v("+(2===(n=e).type?n.expression:na(JSON.stringify(n.text)))+")";var n,r}function ta(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],o=na(i.value);i.dynamic?n+=i.name+","+o+",":t+='"'+i.name+'":'+o+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function na(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ra(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),D}}function ia(e){var t=Object.create(null);return function(n,r,i){(r=M({},r)).warn,delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var s=e(n,r),a={},l=[];return a.render=ra(s.render,l),a.staticRenderFns=s.staticRenderFns.map((function(e){return ra(e,l)})),t[o]=a}}new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)");var oa,sa,aa=(oa=function(e,t){var n=us(e.trim(),t);!1!==t.optimize&&_s(n,t);var r=Vs(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],o=[];if(n)for(var s in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=M(Object.create(e.directives||null),n.directives)),n)"modules"!==s&&"directives"!==s&&(r[s]=n[s]);r.warn=function(e,t,n){(n?o:i).push(e)};var a=oa(t.trim(),r);return a.errors=i,a.tips=o,a}return{compile:t,compileToFunctions:ia(t)}}),la=aa(Os).compileToFunctions;function ca(e){return(sa=sa||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',sa.innerHTML.indexOf(" ")>0}var ua=!!V&&ca(!1),da=!!V&&ca(!0),ha=y((function(e){var t=tr(e);return t&&t.innerHTML})),fa=Mn.prototype.$mount;Mn.prototype.$mount=function(e,t){if((e=e&&tr(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ha(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=la(r,{outputSourceRange:!1,shouldDecodeNewlines:ua,shouldDecodeNewlinesForHref:da,delimiters:n.delimiters,comments:n.comments},this),o=i.render,s=i.staticRenderFns;n.render=o,n.staticRenderFns=s}}return fa.call(this,e,t)},Mn.compile=la;var pa=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function ma(e,t){if(void 0===t&&(t=[]),null===e||"object"!=typeof e)return e;var n,r=(n=function(t){return t.original===e},t.filter(n)[0]);if(r)return r.copy;var i=Array.isArray(e)?[]:{};return t.push({original:e,copy:i}),Object.keys(e).forEach((function(n){i[n]=ma(e[n],t)})),i}function ga(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function va(e){return null!==e&&"object"==typeof e}var ya=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"==typeof n?n():n)||{}},ba={namespaced:{configurable:!0}};ba.namespaced.get=function(){return!!this._rawModule.namespaced},ya.prototype.addChild=function(e,t){this._children[e]=t},ya.prototype.removeChild=function(e){delete this._children[e]},ya.prototype.getChild=function(e){return this._children[e]},ya.prototype.hasChild=function(e){return e in this._children},ya.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},ya.prototype.forEachChild=function(e){ga(this._children,e)},ya.prototype.forEachGetter=function(e){this._rawModule.getters&&ga(this._rawModule.getters,e)},ya.prototype.forEachAction=function(e){this._rawModule.actions&&ga(this._rawModule.actions,e)},ya.prototype.forEachMutation=function(e){this._rawModule.mutations&&ga(this._rawModule.mutations,e)},Object.defineProperties(ya.prototype,ba);var wa,xa=function(e){this.register([],e,!1)};function Sa(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;Sa(e.concat(r),t.getChild(r),n.modules[r])}}xa.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},xa.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")}),"")},xa.prototype.update=function(e){Sa([],this.root,e)},xa.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var i=new ya(t,n);0===e.length?this.root=i:this.get(e.slice(0,-1)).addChild(e[e.length-1],i);t.modules&&ga(t.modules,(function(t,i){r.register(e.concat(i),t,n)}))},xa.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],r=t.getChild(n);r&&r.runtime&&t.removeChild(n)},xa.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var ka=function(e){var t=this;void 0===e&&(e={}),!wa&&"undefined"!=typeof window&&window.Vue&&Aa(window.Vue);var n=e.plugins;void 0===n&&(n=[]);var r=e.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new xa(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new wa,this._makeLocalGettersCache=Object.create(null);var i=this,o=this.dispatch,s=this.commit;this.dispatch=function(e,t){return o.call(i,e,t)},this.commit=function(e,t,n){return s.call(i,e,t,n)},this.strict=r;var a=this._modules.root.state;Da(this,a,[],this._modules.root),_a(this,a),n.forEach((function(e){return e(t)})),(void 0!==e.devtools?e.devtools:wa.config.devtools)&&function(e){pa&&(e._devtoolHook=pa,pa.emit("vuex:init",e),pa.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){pa.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){pa.emit("vuex:action",e,t)}),{prepend:!0}))}(this)},Ca={state:{configurable:!0}};function Oa(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function Ma(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;Da(e,n,[],e._modules.root,!0),_a(e,n,t)}function _a(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var i=e._wrappedGetters,o={};ga(i,(function(t,n){o[n]=function(e,t){return function(){return e(t)}}(t,e),Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})}));var s=wa.config.silent;wa.config.silent=!0,e._vm=new wa({data:{$$state:t},computed:o}),wa.config.silent=s,e.strict&&function(e){e._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(e),r&&(n&&e._withCommit((function(){r._data.$$state=null})),wa.nextTick((function(){return r.$destroy()})))}function Da(e,t,n,r,i){var o=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!o&&!i){var a=Ta(t,n.slice(0,-1)),l=n[n.length-1];e._withCommit((function(){wa.set(a,l,r.state)}))}var c=r.context=function(e,t,n){var r=""===t,i={dispatch:r?e.dispatch:function(n,r,i){var o=$a(n,r,i),s=o.payload,a=o.options,l=o.type;return a&&a.root||(l=t+l),e.dispatch(l,s)},commit:r?e.commit:function(n,r,i){var o=$a(n,r,i),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=t+l),e.commit(l,s,a)}};return Object.defineProperties(i,{getters:{get:r?function(){return e.getters}:function(){return function(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach((function(i){if(i.slice(0,r)===t){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return e.getters[i]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}(e,t)}},state:{get:function(){return Ta(e.state,n)}}}),i}(e,s,n);r.forEachMutation((function(t,n){!function(e,t,n,r){(e._mutations[t]||(e._mutations[t]=[])).push((function(t){n.call(e,r.state,t)}))}(e,s+n,t,c)})),r.forEachAction((function(t,n){var r=t.root?n:s+n,i=t.handler||t;!function(e,t,n,r){(e._actions[t]||(e._actions[t]=[])).push((function(t){var i,o=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return(i=o)&&"function"==typeof i.then||(o=Promise.resolve(o)),e._devtoolHook?o.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):o}))}(e,r,i,c)})),r.forEachGetter((function(t,n){!function(e,t,n,r){if(e._wrappedGetters[t])return;e._wrappedGetters[t]=function(e){return n(r.state,r.getters,e.state,e.getters)}}(e,s+n,t,c)})),r.forEachChild((function(r,o){Da(e,t,n.concat(o),r,i)}))}function Ta(e,t){return t.reduce((function(e,t){return e[t]}),e)}function $a(e,t,n){return va(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function Aa(e){wa&&e===wa||
|
||
/*!
|
||
* vuex v3.6.2
|
||
* (c) 2021 Evan You
|
||
* @license MIT
|
||
*/
|
||
function(e){if(Number(e.version.split(".")[0])>=2)e.mixin({beforeCreate:n});else{var t=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[n].concat(e.init):n,t.call(this,e)}}function n(){var e=this.$options;e.store?this.$store="function"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}(wa=e)}Ca.state.get=function(){return this._vm._data.$$state},Ca.state.set=function(e){},ka.prototype.commit=function(e,t,n){var r=this,i=$a(e,t,n),o=i.type,s=i.payload,a={type:o,payload:s},l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(a,r.state)})))},ka.prototype.dispatch=function(e,t){var n=this,r=$a(e,t),i=r.type,o=r.payload,s={type:i,payload:o},a=this._actions[i];if(a){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(wy){}var l=a.length>1?Promise.all(a.map((function(e){return e(o)}))):a[0](o);return new Promise((function(e,t){l.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(wy){}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(wy){}t(e)}))}))}},ka.prototype.subscribe=function(e,t){return Oa(e,this._subscribers,t)},ka.prototype.subscribeAction=function(e,t){return Oa("function"==typeof e?{before:e}:e,this._actionSubscribers,t)},ka.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},ka.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},ka.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),Da(this,this.state,e,this._modules.get(e),n.preserveState),_a(this,this.state)},ka.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=Ta(t.state,e.slice(0,-1));wa.delete(n,e[e.length-1])})),Ma(this)},ka.prototype.hasModule=function(e){return"string"==typeof e&&(e=[e]),this._modules.isRegistered(e)},ka.prototype.hotUpdate=function(e){this._modules.update(e),Ma(this,!0)},ka.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(ka.prototype,Ca);var Ea=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=ja(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"==typeof i?i.call(this,t,n):t[i]},n[r].vuex=!0})),n})),Na=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.commit;if(e){var o=ja(this.$store,"mapMutations",e);if(!o)return;r=o.context.commit}return"function"==typeof i?i.apply(this,[r].concat(t)):r.apply(this.$store,[i].concat(t))}})),n})),Pa=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;i=e+i,n[r]=function(){if(!e||ja(this.$store,"mapGetters",e))return this.$store.getters[i]},n[r].vuex=!0})),n})),Ia=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var o=ja(this.$store,"mapActions",e);if(!o)return;r=o.context.dispatch}return"function"==typeof i?i.apply(this,[r].concat(t)):r.apply(this.$store,[i].concat(t))}})),n}));function Ra(e){return function(e){return Array.isArray(e)||va(e)}(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function za(e){return function(t,n){return"string"!=typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function ja(e,t,n){return e._modulesNamespaceMap[n]}function Fa(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch(wy){e.log(t)}}function La(e){try{e.groupEnd()}catch(wy){e.log("—— log end ——")}}function Ba(){var e=new Date;return" @ "+Va(e.getHours(),2)+":"+Va(e.getMinutes(),2)+":"+Va(e.getSeconds(),2)+"."+Va(e.getMilliseconds(),3)}function Va(e,t){return n="0",r=t-e.toString().length,new Array(r+1).join(n)+e;var n,r}var Wa={Store:ka,install:Aa,version:"3.6.2",mapState:Ea,mapMutations:Na,mapGetters:Pa,mapActions:Ia,createNamespacedHelpers:function(e){return{mapState:Ea.bind(null,e),mapGetters:Pa.bind(null,e),mapMutations:Na.bind(null,e),mapActions:Ia.bind(null,e)}},createLogger:function(e){void 0===e&&(e={});var t=e.collapsed;void 0===t&&(t=!0);var n=e.filter;void 0===n&&(n=function(e,t,n){return!0});var r=e.transformer;void 0===r&&(r=function(e){return e});var i=e.mutationTransformer;void 0===i&&(i=function(e){return e});var o=e.actionFilter;void 0===o&&(o=function(e,t){return!0});var s=e.actionTransformer;void 0===s&&(s=function(e){return e});var a=e.logMutations;void 0===a&&(a=!0);var l=e.logActions;void 0===l&&(l=!0);var c=e.logger;return void 0===c&&(c=console),function(e){var u=ma(e.state);void 0!==c&&(a&&e.subscribe((function(e,o){var s=ma(o);if(n(e,u,s)){var a=Ba(),l=i(e),d="mutation "+e.type+a;Fa(c,d,t),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(u)),c.log("%c mutation","color: #03A9F4; font-weight: bold",l),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),La(c)}u=s})),l&&e.subscribeAction((function(e,n){if(o(e,n)){var r=Ba(),i=s(e),a="action "+e.type+r;Fa(c,a,t),c.log("%c action","color: #03A9F4; font-weight: bold",i),La(c)}})))}}};function qa(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}}}var Ha,Ja,Ka="function"==typeof Map?new Map:(Ha=[],Ja=[],{has:function(e){return Ha.indexOf(e)>-1},get:function(e){return Ja[Ha.indexOf(e)]},set:function(e,t){-1===Ha.indexOf(e)&&(Ha.push(e),Ja.push(t))},delete:function(e){var t=Ha.indexOf(e);t>-1&&(Ha.splice(t,1),Ja.splice(t,1))}}),Ya=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(wy){Ya=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function Ua(e){var t=Ka.get(e);t&&t.destroy()}function Xa(e){var t=Ka.get(e);t&&t.update()}var Ga=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((Ga=function(e){return e}).destroy=function(e){return e},Ga.update=function(e){return e}):((Ga=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!Ka.has(e)){var t,n=null,r=null,i=null,o=function(){e.clientWidth!==r&&c()},s=function(t){window.removeEventListener("resize",o,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),Ka.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",o,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",Ka.set(e,{destroy:s,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),c()}function a(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t}function l(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),i=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+n+"px",r=e.clientWidth,t.forEach((function(e){e.node.scrollTop=e.scrollTop})),i&&(document.documentElement.scrollTop=i)}}function c(){l();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(a("scroll"),l(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(a("hidden"),l(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),i!==r){i=r;var o=Ya("autosize:resized");try{e.dispatchEvent(o)}catch(s){}}}}(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Ua),e},Ga.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],Xa),e});var Za=Ga;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Qa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var el={exports:{}},tl=el.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",s="hour",a="day",l="week",c="month",u="quarter",d="year",h="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,c),o=n-i<0,s=t.clone().add(r+(o?-1:1),c);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:d,w:l,d:a,D:h,h:s,m:o,s:i,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=g;var x=function(e){return e instanceof O},S=function e(t,n,r){var i;if(!t)return b;if("string"==typeof t){var o=t.toLowerCase();w[o]&&(i=o),n&&(w[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;w[a]=t,i=a}return!r&&i&&(b=i),i||!r&&b},k=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},C=y;C.l=S,C.i=x,C.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function g(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return k(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<k(e)},v.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!C.u(t)||t,u=C.p(e),f=function(e,t){var i=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(a)},p=function(e,t){return C.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case d:return r?f(1,0):f(31,11);case c:return r?f(1,g):f(0,g+1);case l:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return f(r?v-w:v+(6-w),g);case a:case h:return p(y+"Hours",0);case s:return p(y+"Minutes",1);case o:return p(y+"Seconds",2);case i:return p(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,l=C.p(e),u="set"+(this.$u?"UTC":""),f=(n={},n[a]=u+"Date",n[h]=u+"Date",n[c]=u+"Month",n[d]=u+"FullYear",n[s]=u+"Hours",n[o]=u+"Minutes",n[i]=u+"Seconds",n[r]=u+"Milliseconds",n)[l],p=l===a?this.$D+(t-this.$W):t;if(l===c||l===d){var m=this.clone().set(h,1);m.$d[f](p),m.init(),this.$d=m.set(h,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[C.p(e)]()},v.add=function(r,u){var h,f=this;r=Number(r);var p=C.p(u),m=function(e){var t=k(f);return C.w(t.date(t.date()+Math.round(e*r)),f)};if(p===c)return this.set(c,this.$M+r);if(p===d)return this.set(d,this.$y+r);if(p===a)return m(1);if(p===l)return m(7);var g=(h={},h[o]=t,h[s]=n,h[i]=e,h)[p]||1,v=this.$d.getTime()+r*g;return C.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=C.z(this),o=this.$H,s=this.$m,a=this.$M,l=n.weekdays,c=n.months,u=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},d=function(e){return C.s(o%12||12,e,"0")},h=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:C.s(a+1,2,"0"),MMM:u(n.monthsShort,a,c,3),MMMM:u(c,a),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:u(n.weekdaysMin,this.$W,l,2),ddd:u(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:C.s(o,2,"0"),h:d(1),hh:d(2),a:h(o,s,!0),A:h(o,s,!1),m:String(s),mm:C.s(s,2,"0"),s:String(this.$s),ss:C.s(this.$s,2,"0"),SSS:C.s(this.$ms,3,"0"),Z:i};return r.replace(m,(function(e,t){return t||p[e]||i.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,h,f){var p,m=C.p(h),g=k(r),v=(g.utcOffset()-this.utcOffset())*t,y=this-g,b=C.m(this,g);return b=(p={},p[d]=b/12,p[c]=b,p[u]=b/3,p[l]=(y-v)/6048e5,p[a]=(y-v)/864e5,p[s]=y/n,p[o]=y/t,p[i]=y/e,p)[m]||y,f?b:C.a(b)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return w[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=S(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return C.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),M=O.prototype;return k.prototype=M,[["$ms",r],["$s",i],["$m",o],["$H",s],["$W",a],["$M",c],["$y",d],["$D",h]].forEach((function(e){M[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),k.extend=function(e,t){return e.$i||(e(t,O,k),e.$i=!0),k},k.locale=S,k.isDayjs=x,k.unix=function(e){return k(1e3*e)},k.en=w[b],k.Ls=w,k.p={},k}(),nl={exports:{}},rl=nl.exports=function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^\s\d-_:/()]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,l=0;l<a;l+=1){var c=s[l],u=d[c],h=u&&u[0],f=u&&u[1];s[l]=f?{regex:h,parser:f}:c.replace(/^\[|\]$/g,"")}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else{var o=i.regex,l=i.parser,c=e.slice(r),u=o.exec(c)[0];l.call(t,u),e=e.replace(u,"")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var l=!0===s[2],c=!0===s[3],u=l||c,d=s[2];c&&(d=s[2]),o=this.$locale(),!l&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,f=new Date,p=s||(i||o?1:f.getDate()),m=i||f.getFullYear(),g=0;i&&!o||(g=o>0?o-1:f.getMonth());var v=a||0,y=l||0,b=c||0,w=u||0;return d?new Date(Date.UTC(m,g,p,v,y,b,w+60*d.offset*1e3)):n?new Date(Date.UTC(m,g,p,v,y,b,w)):new Date(m,g,p,v,y,b,w)}catch(x){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var f=a.length,p=1;p<=f;p+=1){s[1]=a[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===f&&(this.$d=new Date(""))}else i.call(this,e)}}}();function il(e){return(il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ol={selector:"vue-portal-target-".concat(((e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})())},sl=function(e){return ol.selector=e},al="undefined"!=typeof window&&void 0!==("undefined"==typeof document?"undefined":il(document)),ll=Mn.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(e){return{updatedNodes:e.nodes}},render:function(e){var t=this.updatedNodes&&this.updatedNodes();return t?1!==t.length||t[0].text?e(this.tag||"DIV",t):t:e()},destroyed:function(){var e=this.$el;e&&e.parentNode.removeChild(e)}}),cl=Mn.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(ol.selector)}},tag:{type:String,default:"DIV"}},render:function(e){if(this.disabled){var t=this.$scopedSlots&&this.$scopedSlots.default();return t?t.length<2&&!t[0].text?t:e(this.tag,t):e()}return e()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var e=this;this.$nextTick((function(){e.disabled||e.slotFn===e.$scopedSlots.default||(e.container.updatedNodes=e.$scopedSlots.default),e.slotFn=e.$scopedSlots.default}))},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(e){e?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(al)return document.querySelector(this.selector)},insertTargetEl:function(){if(al){var e=document.querySelector("body"),t=document.createElement(this.tag);t.id=this.selector.substring(1),e.appendChild(t)}},mount:function(){if(al){var e=this.getTargetEl(),t=document.createElement("DIV");this.prepend&&e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t),this.container=new ll({el:t,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function ul(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.name||"portal",cl),t.defaultSelector&&sl(t.defaultSelector)}"undefined"!=typeof window&&window.Vue&&window.Vue===Mn&&Mn.use(ul);var dl={},hl={};function fl(e){return null==e}function pl(e){return null!=e}function ml(e,t){return t.tag===e.tag&&t.key===e.key}function gl(e){var t=e.tag;e.vm=new t({data:e.args})}function vl(e,t,n){var r,i,o={};for(r=t;r<=n;++r)pl(i=e[r].key)&&(o[i]=r);return o}function yl(e,t,n){for(;t<=n;++t)gl(e[t])}function bl(e,t,n){for(;t<=n;++t){var r=e[t];pl(r)&&(r.vm.$destroy(),r.vm=null)}}function wl(e,t){e!==t&&(t.vm=e.vm,function(e){for(var t=Object.keys(e.args),n=0;n<t.length;n++)t.forEach((function(t){e.vm[t]=e.args[t]}))}(t))}Object.defineProperty(hl,"__esModule",{value:!0}),hl.h=function(e,t,n){return{tag:e,key:t,args:n}},hl.patchChildren=function(e,t){pl(e)&&pl(t)?e!==t&&function(e,t){var n,r,i,o=0,s=0,a=e.length-1,l=e[0],c=e[a],u=t.length-1,d=t[0],h=t[u];for(;o<=a&&s<=u;)fl(l)?l=e[++o]:fl(c)?c=e[--a]:ml(l,d)?(wl(l,d),l=e[++o],d=t[++s]):ml(c,h)?(wl(c,h),c=e[--a],h=t[--u]):ml(l,h)?(wl(l,h),l=e[++o],h=t[--u]):ml(c,d)?(wl(c,d),c=e[--a],d=t[++s]):(fl(n)&&(n=vl(e,o,a)),fl(r=pl(d.key)?n[d.key]:null)?(gl(d),d=t[++s]):ml(i=e[r],d)?(wl(i,d),e[r]=void 0,d=t[++s]):(gl(d),d=t[++s]));o>a?yl(t,s,u):s>u&&bl(e,o,a)}(e,t):pl(t)?yl(t,0,t.length-1):pl(e)&&bl(e,0,e.length-1)};var xl={};function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sl(Object(n),!0).forEach((function(t){Cl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ol(e){return(Ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(xl,"__esModule",{value:!0}),xl._setTarget=void 0,xl.popParams=Tl,xl.pushParams=Dl,xl.target=void 0,xl.withParams=function(e,t){if("object"===Ol(e)&&void 0!==t)return n=e,r=t,Al((function(e){return function(){e(n);for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return r.apply(this,i)}}));var n,r;return Al(e)};var Ml=[],_l=null;xl.target=_l;function Dl(){null!==_l&&Ml.push(_l),xl.target=_l={}}function Tl(){var e=_l,t=xl.target=_l=Ml.pop()||null;return t&&(Array.isArray(t.$sub)||(t.$sub=[]),t.$sub.push(e)),e}function $l(e){if("object"!==Ol(e)||Array.isArray(e))throw new Error("params must be an object");xl.target=_l=kl(kl({},_l),e)}function Al(e){var t=e($l);return function(){Dl();try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}finally{Tl()}}}xl._setTarget=function(e){xl.target=_l=e},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Vuelidate=C,e.validationMixin=e.default=void 0,Object.defineProperty(e,"withParams",{enumerable:!0,get:function(){return n.withParams}});var t=hl,n=xl;function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e)||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.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=function(){return null},u=function(e,t,n){return e.reduce((function(e,r){return e[n?n(r):r]=t(r),e}),{})};function d(e){return"function"==typeof e}function h(e){return null!==e&&("object"===l(e)||d(e))}var f=function(e,t,n,r){if("function"==typeof n)return n.call(e,t,r);n=Array.isArray(n)?n:n.split(".");for(var i=0;i<n.length;i++){if(!t||"object"!==l(t))return r;t=t[n[i]]}return void 0===t?r:t};var p={$invalid:function(){var e=this,t=this.proxy;return this.nestedKeys.some((function(t){return e.refProxy(t).$invalid}))||this.ruleKeys.some((function(e){return!t[e]}))},$dirty:function(){var e=this;return!!this.dirty||0!==this.nestedKeys.length&&this.nestedKeys.every((function(t){return e.refProxy(t).$dirty}))},$anyDirty:function(){var e=this;return!!this.dirty||0!==this.nestedKeys.length&&this.nestedKeys.some((function(t){return e.refProxy(t).$anyDirty}))},$error:function(){return this.$dirty&&!this.$pending&&this.$invalid},$anyError:function(){var e=this;return!!this.$error||this.nestedKeys.some((function(t){return e.refProxy(t).$anyError}))},$pending:function(){var e=this;return this.ruleKeys.some((function(t){return e.getRef(t).$pending}))||this.nestedKeys.some((function(t){return e.refProxy(t).$pending}))},$params:function(){var e=this,t=this.validations;return s(s({},u(this.nestedKeys,(function(e){return t[e]&&t[e].$params||null}))),u(this.ruleKeys,(function(t){return e.getRef(t).$params})))}};function m(e){this.dirty=e;var t=this.proxy,n=e?"$touch":"$reset";this.nestedKeys.forEach((function(e){t[e][n]()}))}var g={$touch:function(){m.call(this,!0)},$reset:function(){m.call(this,!1)},$flattenParams:function(){var e=this.proxy,t=[];for(var n in this.$params)if(this.isNested(n)){for(var r=e[n].$flattenParams(),i=0;i<r.length;i++)r[i].path.unshift(n);t=t.concat(r)}else t.push({path:[],name:n,params:this.$params[n]});return t}},v=Object.keys(p),y=Object.keys(g),b=null,w=function(e){if(b)return b;var i=e.extend({computed:{refs:function(){var e=this._vval;this._vval=this.children,(0,t.patchChildren)(e,this._vval);var n={};return this._vval.forEach((function(e){n[e.key]=e.vm})),n}},beforeCreate:function(){this._vval=null},beforeDestroy:function(){this._vval&&((0,t.patchChildren)(this._vval),this._vval=null)},methods:{getModel:function(){return this.lazyModel?this.lazyModel(this.prop):this.model},getModelKey:function(e){var t=this.getModel();if(t)return t[e]},hasIter:function(){return!1}}}),o=i.extend({data:function(){return{rule:null,lazyModel:null,model:null,lazyParentModel:null,rootModel:null}},methods:{runRule:function(t){var r=this.getModel();(0,n.pushParams)();var i,o=this.rule.call(this.rootModel,r,t),s=h(i=o)&&d(i.then)?function(e,t){var n=new e({data:{p:!0,v:!1}});return t.then((function(e){n.p=!1,n.v=e}),(function(e){throw n.p=!1,n.v=!1,e})),n.__isVuelidateAsyncVm=!0,n}(e,o):o,a=(0,n.popParams)();return{output:s,params:a&&a.$sub?a.$sub.length>1?a:a.$sub[0]:null}}},computed:{run:function(){var e=this,t=this.lazyParentModel();if(Array.isArray(t)&&t.__ob__){var n=t.__ob__.dep;n.depend();var r=n.constructor.target;if(!this._indirectWatcher){var i=r.constructor;this._indirectWatcher=new i(this,(function(){return e.runRule(t)}),null,{lazy:!0})}var o=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===o)return this._indirectWatcher.depend(),r.value;this._lastModel=o,this._indirectWatcher.evaluate(),this._indirectWatcher.depend()}else this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null);return this._indirectWatcher?this._indirectWatcher.value:this.runRule(t)},$params:function(){return this.run.params},proxy:function(){var e=this.run.output;return e.__isVuelidateAsyncVm?!!e.v:!!e},$pending:function(){var e=this.run.output;return!!e.__isVuelidateAsyncVm&&e.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),a=i.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:s(s({},g),{},{refProxy:function(e){return this.getRef(e).proxy},getRef:function(e){return this.refs[e]},isNested:function(e){return"function"!=typeof this.validations[e]}}),computed:s(s({},p),{},{nestedKeys:function(){return this.keys.filter(this.isNested)},ruleKeys:function(){var e=this;return this.keys.filter((function(t){return!e.isNested(t)}))},keys:function(){return Object.keys(this.validations).filter((function(e){return"$params"!==e}))},proxy:function(){var e=this,t=u(this.keys,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e.refProxy(t)}}})),n=u(v,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e[t]}}})),r=u(y,(function(t){return{enumerable:!1,configurable:!0,get:function(){return e[t]}}})),i=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},s({},t))}}:{};return Object.defineProperties({},s(s(s(s({},t),i),{},{$model:{enumerable:!0,get:function(){var t=e.lazyParentModel();return null!=t?t[e.prop]:null},set:function(t){var n=e.lazyParentModel();null!=n&&(n[e.prop]=t,e.$touch())}}},n),r))},children:function(){var e=this;return[].concat(r(this.nestedKeys.map((function(t){return w(e,t)}))),r(this.ruleKeys.map((function(t){return x(e,t)})))).filter(Boolean)}})}),l=a.extend({methods:{isNested:function(e){return void 0!==this.validations[e]()},getRef:function(e){var t=this;return{get proxy(){return t.validations[e]()||!1}}}}}),m=a.extend({computed:{keys:function(){var e=this.getModel();return h(e)?Object.keys(e):[]},tracker:function(){var e=this,t=this.validations.$trackBy;return t?function(n){return"".concat(f(e.rootModel,e.getModelKey(n),t))}:function(e){return"".concat(e)}},getModelLazy:function(){var e=this;return function(){return e.getModel()}},children:function(){var e=this,n=this.validations,r=this.getModel(),i=s({},n);delete i.$trackBy;var o={};return this.keys.map((function(n){var s=e.tracker(n);return o.hasOwnProperty(s)?null:(o[s]=!0,(0,t.h)(a,s,{validations:i,prop:n,lazyParentModel:e.getModelLazy,model:r[n],rootModel:e.rootModel}))})).filter(Boolean)}},methods:{isNested:function(){return!0},getRef:function(e){return this.refs[this.tracker(e)]},hasIter:function(){return!0}}}),w=function(e,n){if("$each"===n)return(0,t.h)(m,n,{validations:e.validations[n],lazyParentModel:e.lazyParentModel,prop:n,lazyModel:e.getModel,rootModel:e.rootModel});var r=e.validations[n];if(Array.isArray(r)){var i=e.rootModel,o=u(r,(function(e){return function(){return f(i,i.$v,e)}}),(function(e){return Array.isArray(e)?e.join("."):e}));return(0,t.h)(l,n,{validations:o,lazyParentModel:c,prop:n,lazyModel:c,rootModel:i})}return(0,t.h)(a,n,{validations:r,lazyParentModel:e.getModel,prop:n,lazyModel:e.getModelKey,rootModel:e.rootModel})},x=function(e,n){return(0,t.h)(o,n,{rule:e.validations[n],lazyParentModel:e.lazyParentModel,lazyModel:e.getModel,rootModel:e.rootModel})};return b={VBase:i,Validation:a}},x=null;var S=function(e,n){var r=function(e){if(x)return x;for(var t=e.constructor;t.super;)t=t.super;return x=t,t}(e),i=w(r),o=i.Validation;return new(0,i.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(e):n;return[(0,t.h)(o,"$v",{validations:r,lazyParentModel:c,prop:"$v",model:e,rootModel:e})]}}})},k={data:function(){var e=this.$options.validations;return e&&(this._vuelidate=S(this,e)),{}},beforeCreate:function(){var e=this.$options;e.validations&&(e.computed||(e.computed={}),e.computed.$v||(e.computed.$v=function(){return this._vuelidate?this._vuelidate.refs.$v.proxy:null}))},beforeDestroy:function(){this._vuelidate&&(this._vuelidate.$destroy(),this._vuelidate=null)}};function C(e){e.mixin(k)}e.validationMixin=k;var O=C;e.default=O}(dl);var El=Qa(dl);function Nl(e){this.content=e}function Pl(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=Pl(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function Il(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=Il(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}Nl.prototype={constructor:Nl,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new Nl(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Nl(n)},addToStart:function(e,t){return new Nl([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Nl(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new Nl(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Nl.from(e)).size?new Nl(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Nl.from(e)).size?new Nl(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Nl.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},Nl.from=function(e){if(e instanceof Nl)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Nl(t)};class Rl{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf&&r?(i+="function"==typeof r?r(s):r,o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new Rl(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new Rl(n,r)}cutByIndex(e,t){return e==t?Rl.empty:0==e&&t==this.content.length?this:new Rl(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Rl(r,i)}addToStart(e){return new Rl([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Rl(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Pl(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Il(this,e,t,n)}findIndex(e,t=-1){if(0==e)return jl(0,e);if(e==this.size)return jl(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?jl(n+1,i):jl(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return Rl.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Rl(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Rl.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new Rl(t||e,n)}static from(e){if(!e)return Rl.empty;if(e instanceof Rl)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Rl([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Rl.empty=new Rl([],0);const zl={index:0,offset:0};function jl(e,t){return zl.index=e,zl.offset=t,zl}function Fl(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Fl(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Fl(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class Ll{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Fl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return Ll.none;if(e instanceof Ll)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}Ll.none=[];class Bl extends Error{}class Vl{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ql(this.content,e+this.openStart,t);return n&&new Vl(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Vl(Wl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Vl.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Vl(Rl.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new Vl(e,n,r)}}function Wl(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(Wl(o.content,t-i-1,n-i-1)))}function ql(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ql(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function Hl(e,t,n){if(n.openStart>e.depth)throw new Bl("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Bl("Inconsistent open depths");return Jl(e,t,n,0)}function Jl(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=Jl(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(Rl.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Gl(o,Zl(e,i,s,t,r))}{let r=e.parent,i=r.content;return Gl(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return Gl(o,Ql(e,t,r))}function Kl(e,t){if(!t.type.compatibleContent(e.type))throw new Bl("Cannot join "+t.type.name+" onto "+e.type.name)}function Yl(e,t,n){let r=e.node(n);return Kl(r,t.node(n)),r}function Ul(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Xl(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Ul(e.nodeAfter,r),o++));for(let a=o;a<s;a++)Ul(i.child(a),r);t&&t.depth==n&&t.textOffset&&Ul(t.nodeBefore,r)}function Gl(e,t){if(!e.type.validContent(t))throw new Bl("Invalid content for node "+e.type.name);return e.copy(t)}function Zl(e,t,n,r,i){let o=e.depth>i&&Yl(e,t,i+1),s=r.depth>i&&Yl(n,r,i+1),a=[];return Xl(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(Kl(o,s),Ul(Gl(o,Zl(e,t,n,r,i+1)),a)):(o&&Ul(Gl(o,Ql(e,t,i+1)),a),Xl(t,n,i,a),s&&Ul(Gl(s,Ql(n,r,i+1)),a)),Xl(r,null,i,a),new Rl(a)}function Ql(e,t,n){let r=[];if(Xl(null,e,n,r),e.depth>n){Ul(Gl(Yl(e,t,n+1),Ql(e,t,n+1)),r)}return Xl(t,null,n,r),new Rl(r)}Vl.empty=new Vl(Rl.empty,0,0);class ec{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Ll.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ic(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let o=e;;){let{index:e,offset:t}=o.content.findIndex(i),s=i-t;if(n.push(o,e,r+t),!s)break;if(o=o.child(e),o.isText)break;i=s-1,r+=t+1}return new ec(t,n,i)}static resolveCached(e,t){for(let r=0;r<tc.length;r++){let n=tc[r];if(n.pos==t&&n.doc==e)return n}let n=tc[nc]=ec.resolve(e,t);return nc=(nc+1)%rc,n}}let tc=[],nc=0,rc=12;class ic{constructor(e,t,n){this.$from=e,this.$to=t,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 oc=Object.create(null);class sc{constructor(e,t,n,r=Ll.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Rl.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Fl(this.attrs,t||e.defaultAttrs||oc)&&Ll.sameSet(this.marks,n||Ll.none)}copy(e=null){return e==this.content?this:new sc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new sc(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Vl.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new Vl(a,r.depth-o,i.depth-o)}replace(e,t,n){return Hl(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ec.resolveCached(this,e)}resolveNoCache(e){return ec.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),lc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Rl.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.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 e=Ll.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Ll.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Rl.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}sc.prototype.text=void 0;class ac extends sc{constructor(e,t,n,r){if(super(e,t,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):lc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ac(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ac(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function lc(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class cc{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new uc(e,t);if(null==n.next)return cc.empty;let r=dc(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(vc(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);vc(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new cc(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(gc);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}}(function(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();i(o(e.expr,s),t),s=t}if(-1==e.max)i(o(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),i(o(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=o(e.exprs[r],t);if(r==e.exprs.length-1)return s;i(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return Rl.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r})).join("\n")}}cc.empty=new cc(!0);class uc{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function dc(e){let t=[];do{t.push(hc(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function hc(e){let t=[];do{t.push(fc(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function fc(e){let t=function(e){if(e.eat("(")){let t=dc(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let e=n[o];e.groups.indexOf(t)>-1&&i.push(e)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=mc(e,t)}return t}function pc(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function mc(e,t){let n=pc(e),r=n;return e.eat(",")&&(r="}"!=e.next?pc(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function gc(e,t){return t-e}function vc(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(gc)}function yc(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function bc(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function wc(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Sc(e[n]);return t}class xc{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=wc(n.attrs),this.defaultAttrs=yc(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==cc.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:bc(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new sc(this,this.computeAttrs(e),Rl.from(t),Ll.setFrom(n))}createChecked(e=null,t,n){if(t=Rl.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new sc(this,this.computeAttrs(e),t,Ll.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Rl.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(Rl.empty,!0);return i?new sc(this,e,t.append(i),Ll.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Ll.none:e}static compile(e,t){let n=Object.create(null);e.forEach(((e,r)=>n[e]=new xc(e,t,r)));let r=t.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 i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Sc{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class kc{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=wc(r.attrs),this.excluded=null;let i=yc(this.attrs);this.instance=i?new Ll(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ll(this,bc(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new kc(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Cc{constructor(e){this.cached=Object.create(null),this.spec={nodes:Nl.from(e.nodes),marks:Nl.from(e.marks||{}),topNode:e.topNode},this.nodes=xc.compile(this.spec.nodes,this),this.marks=kc.compile(this.spec.marks,this);let t=Object.create(null);for(let n in this.nodes){if(n in this.marks)throw new RangeError(n+" can not be both a node and a mark");let e=this.nodes[n],r=e.spec.content||"",i=e.spec.marks;e.contentMatch=t[r]||(t[r]=cc.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?Oc(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let n in this.marks){let e=this.marks[n],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:Oc(this,t.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(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof xc))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ac(n,n.defaultAttrs,e,Ll.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return sc.fromJSON(this,e)}markFromJSON(e){return Ll.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Oc(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Mc{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new Ec(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ec(this,t,!0);return n.addAll(e,t.from,t.to),Vl.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Nc(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach((e=>{n(e=Pc(e)),e.mark=r}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=Pc(e)),e.node=r}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mc(e,Mc.schemaRules(e)))}}const _c={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},Dc={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tc={ol:!0,ul:!0};function $c(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Ac{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ll.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Rl.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Rl.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Rl.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):Ic(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!_c.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ec{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=$c(null,t.preserveWhitespace,0)|(n?4:0);r=i?new Ac(i.type,i.attrs,Ll.none,Ll.none,!0,t.topMatch||i.type.contentMatch,o):new Ac(n?null:e.schema.topNodeType,null,Ll.none,Ll.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();Tc.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Tc.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:Dc.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(_c.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Ll.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;if(t.node)i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace);else{o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o)}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let r=0;r<t.length;r++)this.enterInner(t[r],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=$c(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new Ac(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).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(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function Nc(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Pc(e){let t={};for(let n in e)t[n]=e[n];return t}function Ic(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class Rc{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=jc(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Rc.renderSpec(jc(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Rc.renderSpec(jc(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let c=l;c<t.length;c++){let i=t[c];if(0===i){if(c<t.length-1||c>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=Rc.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Rc(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=zc(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return zc(e.marks)}}function zc(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function jc(e){return e.document||window.document}const Fc=Math.pow(2,16);function Lc(e){return 65535&e}class Bc{constructor(e,t=!1,n=null){this.pos=e,this.deleted=t,this.recover=n}}class Vc{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Vc.empty)return Vc.empty}recover(e){let t=0,n=Lc(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Fc}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=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>e)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(e<=u){let i=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return i;let o=e==(t<0?a:u)?null:s/3+(e-a)*Fc;return new Bc(i,t<0?e!=a:e!=u,o)}r+=c-l}return n?e+r:new Bc(e+r)}touches(e,t){let n=0,r=Lc(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}}invert(){return new Vc(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Vc.empty:new Vc(e<0?[0,-e,0]:[0,0,e])}}Vc.empty=new Vc([]);class Wc{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new Wc(this.maps,this.mirror,e,t)}copy(){return new Wc(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new Wc;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=!1;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}n.deleted&&(r=!0),e=n.pos}return n?e:new Bc(e,r)}}const qc=Object.create(null);class Hc{getMap(){return Vc.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=qc[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in qc)throw new RangeError("Duplicate use of step JSON ID "+e);return qc[e]=t,t.prototype.jsonID=e,t}}class Jc{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Jc(e,null)}static fail(e){return new Jc(null,e)}static fromReplace(e,t,n,r){try{return Jc.ok(e.replace(t,n,r))}catch(wy){if(wy instanceof Bl)return Jc.fail(wy.message);throw wy}}}function Kc(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Kc(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return Rl.fromArray(r)}class Yc extends Hc{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new Vl(Kc(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Jc.fromReplace(e,this.from,this.to,i)}invert(){return new Uc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Yc(t.pos,n.pos,this.mark)}merge(e){return e instanceof Yc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yc(t.from,t.to,e.markFromJSON(t.mark))}}Hc.jsonID("addMark",Yc);class Uc extends Hc{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Vl(Kc(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Jc.fromReplace(e,this.from,this.to,n)}invert(){return new Yc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Uc(t.pos,n.pos,this.mark)}merge(e){return e instanceof Uc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Uc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Uc(t.from,t.to,e.markFromJSON(t.mark))}}Hc.jsonID("removeMark",Uc);class Xc extends Hc{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Zc(e,this.from,this.to)?Jc.fail("Structure replace would overwrite content"):Jc.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Vc([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xc(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted?null:new Xc(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Xc)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?Vl.empty:new Vl(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xc(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?Vl.empty:new Vl(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xc(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xc(t.from,t.to,Vl.fromJSON(e,t.slice),!!t.structure)}}Hc.jsonID("replace",Xc);class Gc extends Hc{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Zc(e,this.from,this.gapFrom)||Zc(e,this.gapTo,this.to)))return Jc.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Jc.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Jc.fromReplace(e,this.from,this.to,n):Jc.fail("Content does not fit in gap")}getMap(){return new Vc([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Gc(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deleted&&n.deleted||r<t.pos||i>n.pos?null:new Gc(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Gc(t.from,t.to,t.gapFrom,t.gapTo,Vl.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Zc(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Qc(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function eu(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!Qc(r,i,o))break}return null}function tu(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(nu).concat({type:t,attrs:n}).concat(o.map(nu)):null}function nu(e){return{type:e,attrs:null}}function ru(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[u]||e;if(o!=e&&(n=n.replaceChild(0,o.type.create(o.attrs))),!e.canReplace(t+1,e.childCount)||!o.type.validContent(n))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function iu(e,t){let n=e.resolve(t),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!i.canAppend(o))&&n.parent.canReplace(r,r+1);var i,o}function ou(e,t,n=t,r=Vl.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return su(i,o,r)?new Xc(t,n,r):new au(i,o,r).fit()}function su(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Hc.jsonID("replaceAround",Gc);class au{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Rl.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Rl.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new Vl(i,o,s);return e>-1?new Gc(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Xc(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=uu(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let o=this.depth;o>=0;o--){let n,{type:s,match:a}=this.frontier[o],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(Rl.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:o,parent:r,inject:l};if(2==e&&i&&(n=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:o,parent:r,wrap:n};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Vl(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new Vl(lu(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new Vl(lu(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let p=0;p<i.length;p++)this.openFrontierNode(i[p]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.child(l),t=u.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(u=t,c.push(du(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let f=l==s.childCount;f||(h=-1),this.placed=cu(this.placed,t,Rl.from(c)),this.frontier[t].match=u,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=s;p<h;p++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=f?0==e?Vl.empty:new Vl(lu(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new Vl(lu(o.content,e,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!hu(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=hu(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=hu(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=cu(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=cu(this.placed,this.depth,Rl.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Rl.empty,!0);e.childCount&&(this.placed=cu(this.placed,this.frontier.length,e))}}function lu(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(lu(e.firstChild.content,t-1,n)))}function cu(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(cu(e.lastChild.content,t-1,n)))}function uu(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function du(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,du(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Rl.empty,!0)))),e.copy(r)}function hu(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function fu(e){return e.spec.defining||e.spec.definingForContent}function pu(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(pu(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Rl.empty,!0))}return e}function mu(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let gu=class extends Error{};gu=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(gu.prototype=Object.create(Error.prototype)).constructor=gu,gu.prototype.name="TransformError";const vu=Object.create(null);class yu{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new bu(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Vl.empty){let n=t.content.lastChild,r=null;for(let s=0;s<t.openEnd;s++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),s?Vl.empty:t),0==s&&Tu(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),Tu(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Su(e):Du(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let i=e.depth-1;i>=0;i--){let r=t<0?Du(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Du(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Mu(e.node(0))}static atStart(e){return Du(e,e,0,0,1)||new Mu(e)}static atEnd(e){return Du(e,e,e.content.size,e.childCount,-1)||new Mu(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=vu[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in vu)throw new RangeError("Duplicate use of selection JSON ID "+e);return vu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Su.between(this.$anchor,this.$head).getBookmark()}}yu.prototype.visible=!0;class bu{constructor(e,t){this.$from=e,this.$to=t}}let wu=!1;function xu(e){wu||e.parent.inlineContent||(wu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Su extends yu{constructor(e,t=e){xu(e),xu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return yu.near(n);let r=e.resolve(t.map(this.anchor));return new Su(r.parent.inlineContent?r:n,n)}replace(e,t=Vl.empty){if(super.replace(e,t),t==Vl.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Su&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ku(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Su(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=yu.findFrom(t,n,!0)||yu.findFrom(t,-n,!0);if(!e)return yu.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(yu.findFrom(e,-n,!0)||yu.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new Su(e,t)}}yu.jsonID("text",Su);class ku{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ku(e.map(this.anchor),e.map(this.head))}resolve(e){return Su.between(e.resolve(this.anchor),e.resolve(this.head))}}class Cu extends yu{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?yu.near(i):new Cu(i)}content(){return new Vl(Rl.from(this.node),0,0)}eq(e){return e instanceof Cu&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ou(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Cu(e.resolve(t.anchor))}static create(e,t){return new Cu(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Cu.prototype.visible=!1,yu.jsonID("node",Cu);class Ou{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new ku(n,n):new Ou(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Cu.isSelectable(n)?new Cu(t):yu.near(t)}}class Mu extends yu{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Vl.empty){if(t==Vl.empty){e.delete(0,e.doc.content.size);let t=yu.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Mu(e)}map(e){return new Mu(e)}eq(e){return e instanceof Mu}getBookmark(){return _u}}yu.jsonID("all",Mu);const _u={map(){return this},resolve:e=>new Mu(e)};function Du(e,t,n,r,i,o=!1){if(t.inlineContent)return Su.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&Cu.isSelectable(r))return Cu.create(e,n-(i<0?r.nodeSize:0))}else{let t=Du(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function Tu(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof Xc||o instanceof Gc)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(yu.near(e.doc.resolve(i),n)))}class $u extends class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Wc}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gu(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Vl.empty){let r=ou(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Vl(Rl.from(n),0,0))}delete(e,t){return this.replace(e,t,Vl.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(su(i,o,r))return e.step(new Xc(t,n,r));let s=mu(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let e=i.node(h).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==f&&s.splice(1,0,-h)}let l=s.indexOf(a),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let e=h.firstChild;if(c.push(e),f==r.openStart)break;h=e.content}for(let h=u-1;h>=0;h--){let e=c[h].type,t=fu(e);if(t&&i.node(l).type!=e)u=h;else if(t||!e.isTextblock)break}for(let h=r.openStart;h>=0;h--){let t=(h+u+1)%(r.openStart+1),a=c[t];if(a)for(let c=0;c<s.length;c++){let u=s[(c+l)%s.length],d=!0;u<0&&(d=!1,u=-u);let h=i.node(u-1),f=i.index(u-1);if(h.canReplaceWith(f,f,a.type,a.marks))return e.replace(i.before(u),d?o.after(u):n,new Vl(pu(r.content,0,r.openStart,t),t,r.openEnd))}}let d=e.steps.length;for(let h=s.length-1;h>=0&&(e.replace(t,n,r),!(e.steps.length>d));h--){let e=s[h];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e<r.node(i).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new Vl(Rl.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=mu(r,i);for(let s=0;s<o.length;s++){let t=o[s],n=s==o.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),i.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=Rl.empty,d=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=Rl.from(r.node(p).copy(u)),d++):l--;let h=Rl.empty,f=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,h=Rl.from(i.node(p).copy(h)),f++):c++;e.step(new Gc(l,c,s,a,new Vl(u.append(h),d,f),u.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new Xc(t-n,t+n,Vl.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Rl.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let e=n[s].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=Rl.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Gc(i,o,i,o,new Vl(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Gc(a,l,a+1,l-1,new Vl(Rl.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Gc(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Vl(Rl.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=Rl.empty,s=Rl.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=Rl.from(i.node(a).copy(o));let e=r&&r[c];s=Rl.from(e?e.type.create(e.attrs,s):i.node(a).copy(s))}e.step(new Xc(t,t,new Vl(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),h=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(h)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=d:s.push(i=new Uc(c,d,u[e])));o&&o.to==c?o.to=d:a.push(o=new Yc(c,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof kc){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&l.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:l,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new Uc(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let a=0;a<i.childCount;a++){let t=i.child(a),l=s+t.nodeSize,c=r.matchType(t.type);if(c){r=c;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new Uc(s,l,t.marks[r]))}else o.push(new Xc(s,l,Vl.empty));s=l}if(!r.validEnd){let t=r.fillBefore(Rl.empty,!0);e.replace(s,s,new Vl(t,0,0))}for(let a=o.length-1;a>=0;a--)e.step(o[a])}(this,e,t,n),this}}{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Ll.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ll.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(yu.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Au(e,t){return t&&e?e.bind(t):e}class Eu{constructor(e,t,n){this.name=e,this.init=Au(t.init,n),this.apply=Au(t.apply,n)}}const Nu=[new Eu("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Eu("selection",{init:(e,t)=>e.selection||yu.atStart(t.doc),apply:e=>e.selection}),new Eu("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Eu("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Pu{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nu.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Eu(e.key,e.spec.state,e))}))}}class Iu{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Iu(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new $u(this)}static create(e){let t=new Pu(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Iu(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new Pu(this.schema,e.plugins),n=t.fields,r=new Iu(t);for(let i=0;i<n.length;i++){let t=n[i].name;r[t]=this.hasOwnProperty(t)?this[t]:n[i].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new Pu(e.schema,e.plugins),i=new Iu(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=sc.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=yu.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function Ru(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Ru(i,t,{})),n[r]=i}return n}class zu{constructor(e){this.spec=e,this.props={},e.props&&Ru(e.props,this,this.props),this.key=e.key?e.key.key:Fu("plugin")}getState(e){return e[this.key]}}const ju=Object.create(null);function Fu(e){return e in ju?e+"$"+ ++ju[e]:(ju[e]=0,e+"$")}class Lu{constructor(e="key"){this.key=Fu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Bu="undefined"!=typeof navigator?navigator:null,Vu="undefined"!=typeof document?document:null,Wu=Bu&&Bu.userAgent||"",qu=/Edge\/(\d+)/.exec(Wu),Hu=/MSIE \d/.exec(Wu),Ju=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wu),Ku=!!(Hu||Ju||qu),Yu=Hu?document.documentMode:Ju?+Ju[1]:qu?+qu[1]:0,Uu=!Ku&&/gecko\/(\d+)/i.test(Wu);Uu&&(/Firefox\/(\d+)/.exec(Wu)||[0,0])[1];const Xu=!Ku&&/Chrome\/(\d+)/.exec(Wu),Gu=!!Xu,Zu=Xu?+Xu[1]:0,Qu=!Ku&&!!Bu&&/Apple Computer/.test(Bu.vendor),ed=Qu&&(/Mobile\/\w+/.test(Wu)||!!Bu&&Bu.maxTouchPoints>2),td=ed||!!Bu&&/Mac/.test(Bu.platform),nd=/Android \d/.test(Wu),rd=!!Vu&&"webkitFontSmoothing"in Vu.documentElement.style,id=rd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,od=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},sd=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let ad=null;const ld=function(e,t,n){let r=ad||(ad=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},cd=function(e,t,n,r){return n&&(dd(e,t,n,r,-1)||dd(e,t,n,r,1))},ud=/^(img|br|input|textarea|hr)$/i;function dd(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:hd(e))){let n=e.parentNode;if(!n||1!=n.nodeType||fd(e)||ud.test(e.nodeName)||"false"==e.contentEditable)return!1;t=od(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?hd(e):0}}}function hd(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function fd(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const pd=function(e){let t=e.isCollapsed;return t&&Gu&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function md(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function gd(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function vd(e,t){return"number"==typeof e?e:e[t]}function yd(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function bd(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=sd(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?gd(o):yd(e),l=0,c=0;if(t.top<a.top+vd(r,"top")?c=-(a.top-t.top+vd(i,"top")):t.bottom>a.bottom-vd(r,"bottom")&&(c=t.bottom-a.bottom+vd(i,"bottom")),t.left<a.left+vd(r,"left")?l=-(a.left-t.left+vd(i,"left")):t.right>a.right-vd(r,"right")&&(l=t.right-a.right+vd(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function wd(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=sd(r));return t}function xd(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Sd=null;function kd(e,t){let n,r,i=2e8,o=0,s=t.top,a=t.top;for(let l=e.firstChild,c=0;l;l=l.nextSibling,c++){let e;if(1==l.nodeType)e=l.getClientRects();else{if(3!=l.nodeType)continue;e=ld(l).getClientRects()}for(let u=0;u<e.length;u++){let d=e[u];if(d.top<=s&&d.bottom>=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(e<i){n=l,i=e,r=e&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==l.nodeType&&e&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=_d(r,1);if(n.top!=n.bottom&&Cd(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:kd(n,r)}function Cd(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Od(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Cd(t,i))return Od(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function Md(e,t){let n,r=e.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{let e=r.caretPositionFromPoint(t.left,t.top);e&&({offsetNode:n,offset:i}=e)}catch(l){}if(!n&&r.caretRangeFromPoint){let e=r.caretRangeFromPoint(t.left,t.top);e&&({startContainer:n,startOffset:i}=e)}let o,s=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!s||!e.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=e.dom.getBoundingClientRect();if(!Cd(t,n))return null;if(s=Od(e.dom,t,n),!s)return null}if(Qu)for(let c=s;n&&c;c=sd(c))c.draggable&&(n=void 0);if(s=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(s,t),n){if(Uu&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right<r.left||e.bottom<r.top))break;i=t.posAfter}}o=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=kd(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function _d(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const Dd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Td(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=rd||Uu;if(3==r.nodeType){if(!o||!Dd.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,$d(_d(ld(r,e,t),o),o<0)}{let e=_d(ld(r,i,i),n);if(Uu&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=_d(ld(r,i-1,i-1),-1);if(t.top==e.top){let n=_d(ld(r,i,i+1),-1);if(n.top!=e.top)return $d(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==hd(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return Ad(e.getBoundingClientRect(),!1)}if(i<hd(r)){let e=r.childNodes[i];if(1==e.nodeType)return Ad(e.getBoundingClientRect(),!0)}return Ad(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==hd(r))){let e=r.childNodes[i-1],t=3==e.nodeType?ld(e,hd(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return $d(_d(t,1),!1)}if(i<hd(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?ld(e,0,o?0:1):1==e.nodeType?e:null:null;if(t)return $d(_d(t,-1),!0)}return $d(_d(3==r.nodeType?ld(r):r,-n),n>=0)}function $d(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ad(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Ed(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const Nd=/[\u0590-\u08ac]/;let Pd=null,Id=null,Rd=!1;function zd(e,t,n){return Pd==t&&Id==n?Rd:(Pd=t,Id=n,Rd="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Ed(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=Td(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=ld(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return Nd.test(r.parent.textContent)&&a.modify?Ed(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}class jd{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>od(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};let n,r=0,i=0;for(let o=0;r<this.children.length;r++){let t=this.children[r],n=o+t.size;if(n>e||t instanceof Hd){i=e-o;break}o=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Fd&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?od(e.dom)+1:0}}{let e,n=!0;for(;e=r<this.children.length?this.children[r]:null,e&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?od(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=od(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=od(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let h=0,f=0;h<this.children.length;h++){let s=this.children[h],a=f+s.size;if(i>f&&o<a)return s.setSelection(e-f-s.border,t-f-s.border,n,r);f=a}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.getSelection(),c=!1;if((Uu||Qu)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(c=!(!t||"\n"!=e.nodeValue[t-1]),c&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:od(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Uu&&l.focusNode&&l.focusNode!=a.node&&1==l.focusNode.nodeType){let e=l.focusNode.childNodes[l.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&Qu)&&cd(s.node,s.offset,l.anchorNode,l.anchorOffset)&&cd(a.node,a.offset,l.focusNode,l.focusOffset))return;let u=!1;if((l.extend||e==t)&&!c){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(d){if(!(d instanceof DOMException))throw d}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Fd extends jd{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ld extends jd{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Bd extends jd{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=Rc.renderSpec(document,t.type.spec.toDOM(t,n))),new Bd(e,t,o.dom,o.contentDOM||o.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(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=Bd.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=ih(i,t,o,n)),e>0&&(i=ih(i,0,e,n));for(let s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r}}class Vd extends jd{constructor(e,t,n,r,i,o,s,a,l){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s,o&&this.updateChildren(a,l)}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],l=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=Rc.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=Qd(c,n,t),l?s=new Jd(e,t,n,r,c,u||null,d,l,i,o+1):t.isText?new qd(e,t,n,r,c,d,i):new Vd(e,t,n,r,c,u||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Rl.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&eh(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new nh(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){if(s<i.length&&i[s].to==o){let e,t=i[s++];for(;s<i.length&&i[s].to==o;)(e||(e=[t])).push(i[s++]);if(e){e.sort(rh);for(let t=0;t<e.length;t++)n(e[t],c,!!l)}else n(t,c,!!l)}let u,d;if(l)d=-1,u=l,l=null;else{if(!(c<e.childCount))break;d=c,u=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let h=o+u.nodeSize;if(u.isText){let e=h;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<h&&(l=u.cut(e-o),u=u.cut(0,e-o),h=e,d=-1)}r(u,u.isInline&&!u.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(o,u),d),o=h}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?Ll.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,l,u,e)||a.updateNextNode(t,o,l,e,c)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),Kd(this.contentDOM,this.children,e),ed&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Su)||n<t||r>t+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=hd(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text}if(o>=n){let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Ld(this,i,t,r);e.input.compositionNodes.push(o),this.children=ih(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(eh(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Gd(this.dom,this.nodeDOM,Xd(this.outerDeco,this.node,t),Xd(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.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 Wd(e,t,n,r,i){return Qd(r,t,e),new Vd(void 0,e,t,n,r,r,r,i,0)}class qd extends Vd{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new qd(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Hd extends jd{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Jd extends Vd{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Kd(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=th(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof Bd){let t=r?r.previousSibling:e.lastChild;Kd(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=th(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Yd=function(e){e&&(this.nodeName=e)};Yd.prototype=Object.create(null);const Ud=[new Yd];function Xd(e,t,n){if(0==e.length)return Ud;let r=n?Ud[0]:new Yd,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Yd(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Yd(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function Gd(e,t,n,r){if(n==Ud&&r==Ud)return t;let i=t;for(let o=0;o<r.length;o++){let t=r[o],s=n[o];if(o){let n;s&&s.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(i),s=Ud[0]),i=n}Zd(i,s||Ud[0],t)}return i}function Zd(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Qd(e,t,n){return Gd(e,e,Ud,Xd(t,n,1!=e.nodeType))}function eh(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function th(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class nh{constructor(e,t){this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Bd)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++)if(this.top.children[t].matchesMark(e[i])){r=t;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=Bd.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=s;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Vd){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let l=s.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&eh(t,s.outerDeco)))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(e,t,n,r,i){this.top.children.splice(this.index++,0,Vd.create(this.top,e,t,n,r,i)),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Fd(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Bd;)t=e,e=t.children[t.children.length-1];e&&e instanceof qd&&!/\n$/.test(e.node.text)||((Qu||Gu)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Hd(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}function rh(e,t){return e.type.side-t.type.side}function ih(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function oh(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(pd(n)){for(a=c;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Cu.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==hd(e);r||i;){if(e==n)return!0;let t=od(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==hd(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Cu(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=ph(e,a,c,"pointer"==t||e.state.selection.head<c.pos&&!o?1:-1)}return l}function sh(e){return e.editable?e.hasFocus():gh(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ah(e,t=!1){let n=e.state.selection;if(hh(e,n),sh(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Gu){let t=e.domSelection(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&cd(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,od(r)+1):n.setEnd(r,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&Ku&&Yu<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!lh||n instanceof Su||(n.$from.parent.inlineContent||(r=ch(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=ch(e,n.to))),e.docView.setSelection(o,s,e.root,t),lh&&(r&&dh(r),i&&dh(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{sh(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const lh=Qu||Gu&&Zu<63;function ch(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Qu&&i&&"false"==i.contentEditable)return uh(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return uh(i);if(o)return uh(o)}}function uh(e){return e.contentEditable="true",Qu&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function dh(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function hh(e,t){if(t instanceof Cu){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(fh(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else fh(e)}function fh(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ph(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||Su.between(t,n,r)}function mh(e){return(!e.editable||e.root.activeElement==e.dom)&&gh(e)}function gh(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function vh(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&yu.findFrom(o,t)}function yh(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function bh(e,t,n){let r=e.state.selection;if(!(r instanceof Su)){if(r instanceof Cu&&r.node.isInline)return yh(e,new Su(t>0?r.$to:r.$from));{let n=vh(e.state,t);return!!n&&yh(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=vh(e.state,t);return!!(n&&n instanceof Cu)&&yh(e,n)}if(!(td&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Cu.isSelectable(o)?yh(e,new Cu(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!rd&&yh(e,new Su(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function wh(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function xh(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Sh(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Uu&&1==n.nodeType&&r<wh(n)&&xh(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(xh(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Ch(n))break;{let t=n.previousSibling;for(;t&&xh(t);)i=n.parentNode,o=od(t),t=t.previousSibling;if(t)n=t,r=wh(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Oh(e,t,n,r):i&&Oh(e,t,i,o)}function kh(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=wh(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!xh(n.childNodes[r]))break;i=n,o=++r}else{if(Ch(n))break;{let t=n.nextSibling;for(;t&&xh(t);)i=t.parentNode,o=od(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=wh(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&Oh(e,t,i,o)}function Ch(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Oh(e,t,n,r){if(pd(t)){let e=document.createRange();e.setEnd(n,r),e.setStart(n,r),t.removeAllRanges(),t.addRange(e)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&ah(e)}),50)}function Mh(e,t,n){let r=e.state.selection;if(r instanceof Su&&!r.empty||n.indexOf("s")>-1)return!1;if(td&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=vh(e.state,t);if(n&&n instanceof Cu)return yh(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof Mu?yu.near(n,t):yu.findFrom(n,t);return!!s&&yh(e,s)}return!1}function _h(e,t){if(!(e.state.selection instanceof Su))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Dh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Th(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||td&&72==n&&"c"==r?_h(e,-1)||Sh(e):46==n||td&&68==n&&"c"==r?_h(e,1)||kh(e):13==n||27==n||(37==n||td&&66==n&&"c"==r?bh(e,-1,r)||Sh(e):39==n||td&&70==n&&"c"==r?bh(e,1,r)||kh(e):38==n||td&&80==n&&"c"==r?Mh(e,-1,r)||Sh(e):40==n||td&&78==n&&"c"==r?function(e){if(!Qu||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Dh(e,n,"true"),setTimeout((()=>Dh(e,n,"false")),20)}return!1}(e)||Mh(e,1,r)||kh(e):r==(td?"m":"c")&&(66==n||73==n||89==n||90==n))}function $h(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Rc.fromSchema(e.state.schema),a=Lh(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=jh[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ah(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new Vl(Rl.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):Vl.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=Rc.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Lh().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&jh[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=e,n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),rd&&function(e){let t=e.querySelectorAll(Gu?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0&&o.firstChild;d--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Mc.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Eh.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(wy){return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;i=Rl.from(e.create(n[a+1],i)),o++,s++}return new Vl(i,o,s)}(zh(s,+u[1],+u[2]),u[4]);else if(s=Vl.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Ph(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ih(o[o.length-1],r.length));let t=Nh(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return Rl.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e<s.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=s.content.lastChild;t<s.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);s=zh(s,e,t)}return e.someProp("transformPasted",(e=>{s=e(s)})),s}const Eh=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Nh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Rl.from(e));return e}function Ph(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=Ph(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Rl.from(Nh(n,e,i+1))))}}function Ih(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Ih(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Rl.empty,!0);return e.copy(n.append(r))}function Rh(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=Rh(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Rl.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function zh(e,t,n){return t<e.openStart&&(e=new Vl(Rh(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Vl(Rh(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const jh={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 Fh=null;function Lh(){return Fh||(Fh=document.implementation.createHTMLDocument("title"))}const Bh={};let Vh={};class Wh{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 qh(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Hh(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Jh(e,t))}))}function Jh(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Kh(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Yh(e){return{left:e.clientX,top:e.clientY}}function Uh(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,(t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Xh(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Gh(e,t,n,r,i){return Uh(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof Cu&&(n=i.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s);if(Cu.isSelectable(e)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Xh(e,Cu.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Cu.isSelectable(r))&&(Xh(e,new Cu(n),"pointer"),!0)}(e,n))}function Zh(e,t,n,r){return Uh(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Qh(e,t,n,r){return Uh(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Xh(e,Su.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let t=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(t.inlineContent)Xh(e,Su.create(r,n+1,n+1+t.content.size),"pointer");else{if(!Cu.isSelectable(t))continue;Xh(e,Cu.create(r,n),"pointer")}return!0}}(e,n,r)}function ef(e){return lf(e)}Vh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!rf(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!nd||!Gu||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!ed||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Th(e,n)?n.preventDefault():qh(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,md(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Vh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Vh.keypress=(e,t)=>{let n=t;if(rf(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||td&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Su&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const tf=td?"metaKey":"ctrlKey";Bh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ef(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[tf]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Yh(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new nf(e,s,n,!!r)):("doubleClick"==o?Zh:Qh)(e,s.pos,s.inside,n)?n.preventDefault():qh(e,"pointer"))};class nf{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[tf],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof Cu&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Uu||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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),qh(e,"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((()=>ah(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Yh(e))),this.allowDefault||!t?qh(this.view,"pointer"):Gh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Qu&&this.mightDrag&&!this.mightDrag.node.isAtom||Gu&&!(this.view.state.selection instanceof Su)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Xh(this.view,yu.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):qh(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),qh(this.view,"pointer"),0==e.buttons&&this.done()}}function rf(e,t){return!!e.composing||!!(Qu&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Bh.touchdown=e=>{ef(e),qh(e,"pointer")},Bh.contextmenu=e=>ef(e);const of=nd?5e3:-1;function sf(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>lf(e)),t))}function af(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function lf(e,t=!1){if(!(nd&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),af(e),t||e.docView&&e.docView.dirty){let t=oh(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Vh.compositionstart=Vh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),lf(e,!0),e.markCursor=null;else if(lf(e),Uu&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}sf(e,of)},Vh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,sf(e,20))};const cf=Ku&&Yu<15||ed&&id<604;function uf(e,t,n,r){let i=Ah(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||Vl.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Bh.copy=Vh.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=cf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=$h(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Vh.paste=(e,t)=>{let n=t;if(e.composing&&!nd)return;let r=cf?null:n.clipboardData;r&&uf(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?uf(e,r.value,null,t):uf(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class df{constructor(e,t){this.slice=e,this.move=t}}const hf=td?"altKey":"ctrlKey";Bh.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Yh(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof Cu?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(Cu.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(Cu.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=$h(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(cf?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",cf||n.dataTransfer.setData("text/plain",l),e.dragging=new df(s,!n[hf])},Bh.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Vh.dragover=Vh.dragenter=(e,t)=>t.preventDefault(),Vh.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Yh(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Ah(e,n.dataTransfer.getData(cf?"Text":"text/plain"),cf?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[hf]);if(e.someProp("handleDrop",(t=>t(e,n,s||Vl.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let f=c.doc.resolve(u);if(d&&Cu.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Cu(f));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(ph(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Bh.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&ah(e)}),20))},Bh.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Bh.beforeinput=(e,t)=>{if(Gu&&nd&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,md(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Vh)Bh[os]=Vh[os];function ff(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class pf{constructor(e,t){this.toDOM=e,this.spec=t||bf,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new vf(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof pf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ff(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class mf{constructor(e,t){this.attrs=e,this.spec=t||bf}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new vf(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof mf&&ff(this.attrs,e.attrs)&&ff(this.spec,e.spec)}static is(e){return e.type instanceof mf}destroy(){}}class gf{constructor(e,t){this.attrs=e,this.spec=t||bf}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new vf(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof gf&&ff(this.attrs,e.attrs)&&ff(this.spec,e.spec)}destroy(){}}class vf{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new vf(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new vf(e,e,new pf(t,n))}static inline(e,t,n,r){return new vf(e,t,new mf(n,r))}static node(e,t,n,r){return new vf(e,t,new gf(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof mf}}const yf=[],bf={};class wf{constructor(e,t){this.local=e.length?e:yf,this.children=t.length?t:yf}static create(e,t){return t.length?Mf(t,e,0,bf):xf}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==xf||0==e.maps.length?this:this.mapInner(e,t,0,0,n||bf)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice(),l=(e,t,n,r)=>{for(let s=0;s<a.length;s+=3){let l,c=a[s+1];if(c<0||e>c+o)continue;let u=a[s]+o;t>=u?a[s+1]=e<=u?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let u=0;u<n.maps.length;u++)n.maps[u].forEach(l);let c=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(-2==a[u+1]){c=!0,a[u+1]=-1;continue}let t=n.map(e[u]+o),l=t-i;if(l<0||l>=r.content.size){c=!0;continue}let d=n.map(e[u+1]+o,-1)-i,{index:h,offset:f}=r.content.findIndex(l),p=r.maybeChild(h);if(p&&f==l&&f+p.nodeSize==d){let r=a[u+2].mapInner(n,p,t+1,e[u]+o+1,s);r!=xf?(a[u]=l,a[u+1]=d,a[u+2]=r):(a[u+1]=-2,c=!0)}else c=!0}if(c){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let l=0;l<e.length;l+=3)-1==e[l+1]&&a(e[l+2],t[l]+o+1);return n}(a,e,t,n,i,o,s),c=Mf(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new wf(t.sort(_f),a)}(this.children,o||[],e,t,n,r,i):o?new wf(o.sort(_f),yf):xf}add(e,t){return t.length?this==xf?wf.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=Cf(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,Mf(s,e,a+1,bf)),i+=3}}));let o=kf(i?Of(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new wf(o.length?this.local.concat(o).sort(_f):this.local,r||this.children)}remove(e){return 0==e.length||this==xf?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(r,o+1);a!=xf?n[i+2]=a:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<e.length;o++)if(i=e[o])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new wf(r,n):xf}forChild(e,t){if(this==xf)return this;if(t.isLeaf)return wf.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;s<this.local.length;s++){let e=this.local[s];if(e.from<o&&e.to>i&&e.type instanceof mf){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new wf(r.sort(_f),yf);return n?new Sf([e,n]):e}return n||xf}eq(e){if(this==e)return!0;if(!(e instanceof wf)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Df(this.localsInner(e))}localsInner(e){if(this==xf)return yf;if(e.inlineContent||!this.local.some(mf.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof mf||t.push(this.local[n]);return t}}wf.empty=new wf([],[]),wf.removeOverlap=Df;const xf=wf.empty;class Sf{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,bf)));return Sf.from(n)}forChild(e,t){if(t.isLeaf)return wf.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=xf&&(i instanceof Sf?n=n.concat(i.members):n.push(i))}return Sf.from(n)}eq(e){if(!(e instanceof Sf)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?Df(n?t:t.sort(_f)):yf}static from(e){switch(e.length){case 0:return xf;case 1:return e[0];default:return new Sf(e)}}}function kf(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new vf(i.from+t,i.to+t,i.type))}return n}function Cf(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o,s=0;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function Of(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Mf(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=Cf(e,t,s+n);if(a){o=!0;let e=Mf(a,t,n+s+1,r);e!=xf&&i.push(s,s+t.nodeSize,e)}}));let s=kf(o?Of(e):e,-n).sort(_f);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new wf(s,i):xf}function _f(e,t){return e.from-t.from||e.to-t.to}function Df(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Tf(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),Tf(t,i+1,o.copy(r.to,o.to)))}}return t}function Tf(e,t,n){for(;t<e.length&&_f(n,e[t])>0;)t++;e.splice(t,0,n)}function $f(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=xf&&t.push(r)})),e.cursorWrapper&&t.push(wf.create(e.state.doc,[e.cursorWrapper.deco])),Sf.from(t)}const Af={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ef=Ku&&Yu<=11;class Nf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Pf{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Nf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);Ku&&Yu<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Ef&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,Af),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(mh(this.view)){if(this.suppressingSelectionUpdates)return ah(this.view);if(Ku&&Yu<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&cd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&mh(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let a=0;a<e.length;a++){let t=this.registerMutation(e[a],s);t&&(r=r<0?t.from:Math.min(t.from,r),i=i<0?t.to:Math.max(t.to,i),t.typeOver&&(o=!0))}if(Uu&&s.length>1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(If)return;If=!0,"normal"==getComputedStyle(e.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.view)),this.handleDOMChange(r,i,o,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ah(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Ku&&Yu<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?od(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?od(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let If=!1;function Rf(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Qu&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Qu&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function zf(e,t,n,r,i){if(t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=oh(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],pd(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Gu&&8===e.input.lastKeyCode)for(let g=s;g>o;g--){let e=i.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let d=e.state.doc,h=e.someProp("domParser")||Mc.fromSchema(e.state.schema),f=d.resolve(a),p=null,m=h.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Rf,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),p={anchor:e+a,head:t+a}}return{doc:m,sel:p,from:a,to:l}}(e,t,n);if(Gu&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let c,u,d=e.state.doc,h=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(c=e.state.selection.to,u="end"):(c=e.state.selection.from,u="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){r-=s+Math.max(0,o-Math.min(s,a))-o}if(s<o&&e.size<t.size){o-=r<=o&&r>=s?o-r:0,a=o+(a-s),s=o}else if(a<o){o-=r<=o&&r>=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(h.content,l.doc.content,l.from,c,u);if((ed&&e.input.lastIOSEnter>Date.now()-225||nd)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,md(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&a instanceof Su&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=jf(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}f={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Su&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),Ku&&Yu<=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 p,m=l.doc.resolveNoCache(f.start-l.from),g=l.doc.resolveNoCache(f.endB-l.from),v=d.resolve(f.start),y=m.sameParent(g)&&m.parent.inlineContent&&v.end()>=f.endA;if((ed&&e.input.lastIOSEnter>Date.now()-225&&(!y||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!y&&m.pos<l.doc.content.size&&(p=yu.findFrom(l.doc.resolve(m.pos+1),1,!0))&&p.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,md(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ff(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(Ff(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Ff(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,md(8,"Backspace")))))return void(nd&&Gu&&e.domObserver.suppressSelectionUpdates());Gu&&nd&&f.endB==f.start&&(e.input.lastAndroidDelete=Date.now()),nd&&!y&&m.start()!=g.start()&&0==g.parentOffset&&m.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((()=>{e.someProp("handleKeyDown",(function(t){return t(e,md(13,"Enter"))}))}),20));let b,w,x,S=f.start,k=f.endA;if(y)if(m.pos==g.pos)Ku&&Yu<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>ah(e)),20)),b=e.state.tr.delete(S,k),w=d.resolve(f.start).marksAcross(d.resolve(f.endA));else if(f.endA==f.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let u=0;u<s.length;u++)a=s[u].removeFromSet(a);for(let u=0;u<o.length;u++)l=o[u].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let u=0;u<t.childCount;u++)c.push(i(t.child(u)));if(Rl.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),v.parent.content.cut(v.parentOffset,f.endA-v.start()))))b=e.state.tr,"add"==x.type?b.addMark(S,k,x.mark):b.removeMark(S,k,x.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,S,k,t))))return;b=e.state.tr.insertText(t,S,k)}if(b||(b=e.state.tr.replace(S,k,l.doc.slice(f.start-l.from,f.endB-l.from))),l.sel){let t=jf(e,b.doc,l.sel);t&&!(Gu&&nd&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==S||t.head==b.mapping.map(k)-1)||Ku&&t.empty&&t.head==S)&&b.setSelection(t)}w&&b.ensureMarks(w),e.dispatch(b.scrollIntoView())}function jf(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ph(e,t.resolve(n.anchor),t.resolve(n.head))}function Ff(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class Lf{constructor(e,t){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 Wh,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Hf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Wf(this),Vf(this),this.nodeViews=qf(this),this.docView=Wd(this.state.doc,Bf(this),$f(this),this.dom,this),this.domObserver=new Pf(this,((e,t,n,r)=>zf(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Bh){let n=Bh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Kh(e,t)||Jh(e,t)||!e.editable&&t.type in Vh||n(e,t)})}Qu&&e.dom.addEventListener("input",(()=>null)),Hh(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Hh(this),this._props=e,e.plugins&&(e.plugins.forEach(Hf),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(af(this),i=!0),this.state=e,t){let e=qf(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),Hh(this)}this.editable=Wf(this),Vf(this);let o=$f(this),s=Bf(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let c="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:wd(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(Ku||Gu)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Gu?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Wd(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return cd(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ah(this,t):(hh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof Cu){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&bd(this,n.getBoundingClientRect(),t)}else bd(this,this.coordsAtPos(e.selection.head,1),t)}else c&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;xd(n,0==r?0:r-t)}(c)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[e];if(null!=r&&(n=t?t(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(Sd)return e.focus(Sd);let t=wd(e);e.focus(null==Sd?{get preventScroll(){return Sd={preventScroll:!0},!0}}:void 0),Sd||(Sd=!1,xd(t,0))}(this.dom),ah(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)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 e||document}posAtCoords(e){return Md(this,e)}coordsAtPos(e,t=1){return Td(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return zd(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$f(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(e){return function(e,t){Jh(e,t)||!Bh[t.type]||!e.editable&&t.type in Vh||Bh[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function Bf(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[vf.node(0,e.state.doc.content.size,t)]}function Vf(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:vf.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Wf(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function qf(e){let t=Object.create(null);return e.someProp("nodeViews",(e=>{for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])})),t}function Hf(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Jf={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"},Kf={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"},Yf="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Uf="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Xf="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Gf="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Zf="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qf=Yf&&(Gf||+Yf[1]<57)||Xf&&Gf,ep=0;ep<10;ep++)Jf[48+ep]=Jf[96+ep]=String(ep);for(ep=1;ep<=24;ep++)Jf[ep+111]="F"+ep;for(ep=65;ep<=90;ep++)Jf[ep]=String.fromCharCode(ep+32),Kf[ep]=String.fromCharCode(ep);for(var tp in Jf)Kf.hasOwnProperty(tp)||(Kf[tp]=Jf[tp]);const np="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function rp(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a<o.length-1;a++){let e=o[a];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);np?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function ip(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function op(e){return new zu({props:{handleKeyDown:sp(e)}})}function sp(e){let t=function(e){let t=Object.create(null);for(let n in e)t[rp(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(Qf&&(e.ctrlKey||e.altKey||e.metaKey)||(Uf||Zf)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Kf:Jf)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=1==i.length&&" "!=i,s=t[ip(i,n,!o)];if(s&&s(e.state,e.dispatch,e))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=Jf[n.keyCode])&&r!=i){let i=t[ip(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[ip(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}const ap=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function lp(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function cp(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function up(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function dp(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const hp=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=dp(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(yu.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0};function fp(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!iu(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=Rl.empty;for(let e=r.length-1;e>=0;e--)a=Rl.from(r[e].create(null,a));a=Rl.from(o.copy(a));let l=e.tr.step(new Gc(t.pos-1,i,t.pos,i,new Vl(a,1,0),r.length,!0)),c=i+2*r.length;iu(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=yu.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&eu(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&lp(s,"start",!0)&&lp(o,"end")){let r=o,i=[];for(;i.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=Rl.empty;for(let e=i.length-1;e>=0;e--)r=Rl.from(i[e].copy(r));n(e.tr.step(new Gc(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new Vl(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pp(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(Su.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const mp=pp(-1),gp=pp(1);function vp(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function yp(e,t=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(e,t,n){for(let r=0;r<t.length;r++){let{$from:i,$to:o}=t[r],s=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,o.pos,(e=>{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(o)e.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let i=!1,o=n.tr;for(let t=0;!i&&t<s.length;t++){let{$from:r,$to:o}=s[t];i=n.doc.rangeHasMark(r.pos,o.pos,e)}for(let n=0;n<s.length;n++){let{$from:r,$to:a}=s[n];if(i)o.removeMark(r.pos,a.pos,e);else{let n=r.pos,i=a.pos,s=r.nodeAfter,l=a.nodeBefore,c=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,u=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<i&&(n+=c,i-=u),o.addMark(n,i,e.create(t))}}r(o.scrollIntoView())}return!0}}function bp(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let wp=bp(ap,((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=cp(r);if(!i){let n=r.blockRange(),i=n&&eu(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&fp(e,i,t))return!0;if(0==r.parent.content.size&&(lp(o,"end")||Cu.isSelectable(o))){let n=ou(e.doc,r.before(),r.after(),Vl.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(lp(o,"end")?yu.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):Cu.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=cp(r)}let s=o&&o.nodeBefore;return!(!s||!Cu.isSelectable(s))&&(t&&t(e.tr.setSelection(Cu.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),xp=bp(ap,((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=up(r);if(!i)return!1;let o=i.nodeAfter;if(fp(e,i,t))return!0;if(0==r.parent.content.size&&(lp(o,"start")||Cu.isSelectable(o))){let n=ou(e.doc,r.before(),r.after(),Vl.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(lp(o,"start")?yu.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Cu.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=up(r)}let s=o&&o.nodeAfter;return!(!s||!Cu.isSelectable(s))&&(t&&t(e.tr.setSelection(Cu.create(e.doc,o.pos)).scrollIntoView()),!0)}));const Sp={Enter:bp(((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}),((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Mu||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=dp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(Su.create(s.doc,n+1)),t(s.scrollIntoView())}return!0}),((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ru(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&eu(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Cu&&e.selection.node.isBlock)return!(!n.parentOffset||!ru(e.doc,n.pos))&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let i=r.parentOffset==r.parent.content.size,o=e.tr;(e.selection instanceof Su||e.selection instanceof Mu)&&o.deleteSelection();let s=0==n.depth?null:dp(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=i&&s?[{type:s}]:void 0,l=ru(o.doc,o.mapping.map(n.pos),1,a);if(a||l||!ru(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let e=o.mapping.map(n.before()),t=o.doc.resolve(e);s&&n.node(-1).canReplaceWith(t.index(),t.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}t(o.scrollIntoView())}return!0})),"Mod-Enter":hp,Backspace:wp,"Mod-Backspace":wp,"Shift-Backspace":wp,Delete:xp,"Mod-Delete":xp,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Mu(e.doc))),!0)},kp={"Ctrl-h":Sp.Backspace,"Alt-Backspace":Sp["Mod-Backspace"],"Ctrl-d":Sp.Delete,"Ctrl-Alt-Backspace":Sp["Mod-Delete"],"Alt-Delete":Sp["Mod-Delete"],"Alt-d":Sp["Mod-Delete"],"Ctrl-a":mp,"Ctrl-e":gp};for(let os in Sp)kp[os]=Sp[os];const Cp=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?kp:Sp;class Op{constructor(e,t){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,i){let o=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);o+=t[0].slice(e+t[1].length);let n=(r+=e)-i;n>0&&(o=t[0].slice(e-n,e)+o,r=i)}return e.tr.insertText(o,r,i)}):t}}function Mp({rules:e}){let t=new zu({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,o)=>_p(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&_p(n,r.pos,r.pos,"",e,t)}))}}},isInputRules:!0});return t}function _p(e,t,n,r,i,o){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let c=0;c<i.length;c++){let a=i[c].match.exec(l),u=a&&i[c].handler(s,a,t-(a[0].length-r.length),n);if(u)return e.dispatch(u.setMeta(o,{transform:u,from:t,to:n,text:r})),!0}return!1}const Dp=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let n=e.tr,r=i.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(i.text){let t=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,e.schema.text(i.text,t))}else n.delete(i.from,i.to);t(n)}return!0}}return!1};function Tp(e,t,n=null,r){return new Op(e,((e,i,o,s)=>{let a=n instanceof Function?n(i):n,l=e.tr.delete(o,s),c=l.doc.resolve(o).blockRange(),u=c&&tu(c,t,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(o-1).nodeBefore;return d&&d.type==t&&iu(l.doc,o-1)&&(!r||r(i,d))&&l.join(o-1),l}))}function $p(e,t,n=null){return new Op(e,((e,r,i,o)=>{let s=e.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,a):null}))}new Op(/--$/,"—"),new Op(/\.\.\.$/,"…"),new Op(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new Op(/"$/,"”"),new Op(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new Op(/'$/,"’");const Ap=["ol",0],Ep=["ul",0],Np=["li",0],Pp={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1==e.attrs.order?Ap:["ol",{start:e.attrs.order},0]},Ip={parseDOM:[{tag:"ul"}],toDOM:()=>Ep},Rp={parseDOM:[{tag:"li"}],toDOM:()=>Np,defining:!0};function zp(e,t){let n={};for(let r in e)n[r]=e[r];for(let r in t)n[r]=t[r];return n}function jp(e,t,n){return e.append({ordered_list:zp(Pp,{content:"list_item+",group:n}),bullet_list:zp(Ip,{content:"list_item+",group:n}),list_item:zp(Rp,{content:t})})}function Fp(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new ic(e,e,s.depth),s.endIndex<s.parent.childCount&&(s=new ic(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=tu(l,e,t,s);return!!c&&(r&&r(function(e,t,n,r,i){let o=Rl.empty;for(let u=n.length-1;u>=0;u--)o=Rl.from(n[u].type.create(n[u].attrs,o));e.step(new Gc(t.start-(r?2:0),t.end,t.start,t.end,new Vl(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,d=t.endIndex,h=!0;u<d;u++,h=!1)!h&&ru(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return e}(n.tr,s,c,a,e).scrollIntoView()),!0)}}function Lp(e){return function(t,n){let{$from:r,$to:i,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(i))return!1;let s=r.node(-1);if(s.type!=e)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=Rl.empty,o=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-o;e>=r.depth-3;e--)i=Rl.from(r.node(e).copy(i));let s=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;i=i.append(Rl.from(e.createAndFill()));let a=r.before(r.depth-(o-1)),l=t.tr.replace(a,r.after(-s),new Vl(i,4-o,0)),c=-1;l.doc.nodesBetween(a,l.doc.content.size,((e,t)=>{if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1)})),c>-1&&l.setSelection(yu.near(l.doc.resolve(c))),n(l.scrollIntoView())}return!0}let a=i.pos==r.end()?s.contentMatchAt(0).defaultType:null,l=t.tr.delete(r.pos,i.pos),c=a?[null,{type:a}]:void 0;return!!ru(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0)}}function Bp(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Gc(o-1,s,o,s,new Vl(Rl.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ic(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));return t(i.lift(r,eu(r)).scrollIntoView()),!0}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let f=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Rl.empty:Rl.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new Gc(d-(a?1:0),h+(l?1:0),d+1,h-1,new Vl((a?Rl.empty:Rl.from(i.copy(Rl.empty))).append(l?Rl.empty:Rl.from(i.copy(Rl.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function Vp(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,i=Rl.from(r?e.create():null),s=new Vl(Rl.from(e.create(null,Rl.from(a.type.create(null,i)))),r?3:1,0),c=o.start,u=o.end;n(t.tr.step(new Gc(c-(r?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0}}var Wp=function(){};Wp.prototype.append=function(e){return e.length?(e=Wp.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Wp.prototype.prepend=function(e){return e.length?Wp.from(e).append(this):this},Wp.prototype.appendInner=function(e){return new Hp(this,e)},Wp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Wp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Wp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Wp.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Wp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Wp.from=function(e){return e instanceof Wp?e:e&&e.length?new qp(e):Wp.empty};var qp=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Wp);Wp.empty=new qp([]);var Hp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Wp),Jp=Wp;class Kp{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Yp(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Yp(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new Kp(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;c<e.steps.length;c++){let n,l=e.steps[c].invert(e.docs[c]),u=new Yp(e.mapping.maps[c],l,t);(n=a&&a.merge(u))&&(u=n,c?i.pop():s=s.slice(0,s.length-1)),i.push(u),t&&(o++,t=void 0),r||(a=u)}let l=o-n.depth;return l>Xp&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new Kp(s.append(i),o)}remapping(e,t){let n=new Wc;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Kp(this.items.append(e.map((e=>new Yp(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new Yp(l,o,c))}else n.push(new Yp(l))}),r);let l=[];for(let d=t;d<o;d++)l.push(new Yp(i.maps[d]));let c=this.items.slice(0,r).append(l).append(n),u=new Kp(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new Yp(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new Kp(Jp.from(r.reverse()),i)}}Kp.empty=new Kp(Jp.empty,0);class Yp{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Yp(t.getMap().invert(),t,this.selection)}}}class Up{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const Xp=20;function Gp(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function Zp(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Qp(e,t,n,r){let i=nm(t),o=rm.get(t).spec.config,s=(r?e.undone:e.done).popEvent(t,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),o,i),c=new Up(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(rm,{redo:r,historyState:c}).scrollIntoView())}let em=!1,tm=null;function nm(e){let t=e.plugins;if(tm!=t){em=!1,tm=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){em=!0;break}}return em}const rm=new Lu("history"),im=new Lu("closeHistory");function om(e){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new zu({key:rm,state:{init:()=>new Up(Kp.empty,Kp.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(rm);if(o)return o.historyState;n.getMeta(im)&&(e=new Up(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(rm))return s.getMeta(rm).redo?new Up(e.done.addTransform(n,void 0,r,nm(t)),e.undone,Gp(n.mapping.maps[n.steps.length-1]),e.prevTime):new Up(e.done,e.undone.addTransform(n,void 0,r,nm(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Up(e.done.rebased(n,i),e.undone.rebased(n,i),Zp(e.prevRanges,n.mapping),e.prevTime):new Up(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Zp(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?Zp(e.prevRanges,n.mapping):Gp(n.mapping.maps[n.steps.length-1]);return new Up(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,nm(t)),Kp.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?sm:"historyRedo"==n?am:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const sm=(e,t)=>{let n=rm.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Qp(n,e,t,!1),!0)},am=(e,t)=>{let n=rm.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Qp(n,e,t,!0),!0)};function lm(e){let t=rm.getState(e);return t?t.done.eventCount:0}function cm(e){let t=rm.getState(e);return t?t.undone.eventCount:0}var um={},dm={},hm={},fm={};Object.defineProperty(fm,"__esModule",{value:!0}),fm.default=void 0;var pm=xl.withParams;fm.default=pm,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.req=e.regex=e.ref=e.len=void 0,Object.defineProperty(e,"withParams",{enumerable:!0,get:function(){return n.default}});var t,n=(t=fm)&&t.__esModule?t:{default:t};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){if(Array.isArray(e))return!!e.length;if(null==e)return!1;if(!1===e)return!0;if(e instanceof Date)return!isNaN(e.getTime());if("object"===r(e)){for(var t in e)return!0;return!1}return!!String(e).length};e.req=i;e.len=function(e){return Array.isArray(e)?e.length:"object"===r(e)?Object.keys(e).length:String(e).length};e.ref=function(e,t,n){return"function"==typeof e?e.call(t,n):n[e]};e.regex=function(e,t){return(0,n.default)({type:e},(function(e){return!i(e)||t.test(e)}))}}(hm),Object.defineProperty(dm,"__esModule",{value:!0}),dm.default=void 0;var mm=(0,hm.regex)("alpha",/^[a-zA-Z]*$/);dm.default=mm;var gm={};Object.defineProperty(gm,"__esModule",{value:!0}),gm.default=void 0;var vm=(0,hm.regex)("alphaNum",/^[a-zA-Z0-9]*$/);gm.default=vm;var ym={};Object.defineProperty(ym,"__esModule",{value:!0}),ym.default=void 0;var bm=(0,hm.regex)("numeric",/^[0-9]*$/);ym.default=bm;var wm={};Object.defineProperty(wm,"__esModule",{value:!0}),wm.default=void 0;var xm=hm;wm.default=function(e,t){return(0,xm.withParams)({type:"between",min:e,max:t},(function(n){return!(0,xm.req)(n)||(!/\s/.test(n)||n instanceof Date)&&+e<=+n&&+t>=+n}))};var Sm={};Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.default=void 0;var km=(0,hm.regex)("email",/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);Sm.default=km;var Cm={};Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.default=void 0;var Om=hm,Mm=(0,Om.withParams)({type:"ipAddress"},(function(e){if(!(0,Om.req)(e))return!0;if("string"!=typeof e)return!1;var t=e.split(".");return 4===t.length&&t.every(_m)}));Cm.default=Mm;var _m=function(e){if(e.length>3||0===e.length)return!1;if("0"===e[0]&&"0"!==e)return!1;if(!e.match(/^\d+$/))return!1;var t=0|+e;return t>=0&&t<=255},Dm={};Object.defineProperty(Dm,"__esModule",{value:!0}),Dm.default=void 0;var Tm=hm;Dm.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,Tm.withParams)({type:"macAddress"},(function(t){if(!(0,Tm.req)(t))return!0;if("string"!=typeof t)return!1;var n="string"==typeof e&&""!==e?t.split(e):12===t.length||16===t.length?t.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every($m)}))};var $m=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)},Am={};Object.defineProperty(Am,"__esModule",{value:!0}),Am.default=void 0;var Em=hm;Am.default=function(e){return(0,Em.withParams)({type:"maxLength",max:e},(function(t){return!(0,Em.req)(t)||(0,Em.len)(t)<=e}))};var Nm={};Object.defineProperty(Nm,"__esModule",{value:!0}),Nm.default=void 0;var Pm=hm;Nm.default=function(e){return(0,Pm.withParams)({type:"minLength",min:e},(function(t){return!(0,Pm.req)(t)||(0,Pm.len)(t)>=e}))};var Im={};Object.defineProperty(Im,"__esModule",{value:!0}),Im.default=void 0;var Rm=hm,zm=(0,Rm.withParams)({type:"required"},(function(e){return(0,Rm.req)("string"==typeof e?e.trim():e)}));Im.default=zm;var jm={};Object.defineProperty(jm,"__esModule",{value:!0}),jm.default=void 0;var Fm=hm;jm.default=function(e){return(0,Fm.withParams)({type:"requiredIf",prop:e},(function(t,n){return!(0,Fm.ref)(e,this,n)||(0,Fm.req)(t)}))};var Lm={};Object.defineProperty(Lm,"__esModule",{value:!0}),Lm.default=void 0;var Bm=hm;Lm.default=function(e){return(0,Bm.withParams)({type:"requiredUnless",prop:e},(function(t,n){return!!(0,Bm.ref)(e,this,n)||(0,Bm.req)(t)}))};var Vm={};Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.default=void 0;var Wm=hm;Vm.default=function(e){return(0,Wm.withParams)({type:"sameAs",eq:e},(function(t,n){return t===(0,Wm.ref)(e,this,n)}))};var qm={};Object.defineProperty(qm,"__esModule",{value:!0}),qm.default=void 0;var Hm=(0,hm.regex)("url",/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);qm.default=Hm;var Jm={};Object.defineProperty(Jm,"__esModule",{value:!0}),Jm.default=void 0;var Km=hm;Jm.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,Km.withParams)({type:"or"},(function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.length>0&&t.reduce((function(t,n){return t||n.apply(e,r)}),!1)}))};var Ym={};Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.default=void 0;var Um=hm;Ym.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,Um.withParams)({type:"and"},(function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.length>0&&t.reduce((function(t,n){return t&&n.apply(e,r)}),!0)}))};var Xm={};Object.defineProperty(Xm,"__esModule",{value:!0}),Xm.default=void 0;var Gm=hm;Xm.default=function(e){return(0,Gm.withParams)({type:"not"},(function(t,n){return!(0,Gm.req)(t)||!e.call(this,t,n)}))};var Zm={};Object.defineProperty(Zm,"__esModule",{value:!0}),Zm.default=void 0;var Qm=hm;Zm.default=function(e){return(0,Qm.withParams)({type:"minValue",min:e},(function(t){return!(0,Qm.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t>=+e}))};var eg={};Object.defineProperty(eg,"__esModule",{value:!0}),eg.default=void 0;var tg=hm;eg.default=function(e){return(0,tg.withParams)({type:"maxValue",max:e},(function(t){return!(0,tg.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t<=+e}))};var ng={};Object.defineProperty(ng,"__esModule",{value:!0}),ng.default=void 0;var rg=(0,hm.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);ng.default=rg;var ig={};Object.defineProperty(ig,"__esModule",{value:!0}),ig.default=void 0;var og=(0,hm.regex)("decimal",/^[-]?\d*(\.\d+)?$/);
|
||
/**!
|
||
* Sortable 1.10.2
|
||
* @author RubaXa <trash@rubaxa.org>
|
||
* @author owenm <owen23355@gmail.com>
|
||
* @license MIT
|
||
*/
|
||
function sg(e){return(sg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ag(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lg(){return lg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lg.apply(this,arguments)}function cg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ag(e,t,n[t])}))}return e}function ug(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}ig.default=og,function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"alpha",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"alphaNum",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"and",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"between",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"decimal",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"email",{enumerable:!0,get:function(){return s.default}}),e.helpers=void 0,Object.defineProperty(e,"integer",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"ipAddress",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"macAddress",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"maxLength",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"maxValue",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(e,"minLength",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"minValue",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"not",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"numeric",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"or",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"required",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"requiredIf",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"requiredUnless",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"url",{enumerable:!0,get:function(){return m.default}});var n=O(dm),r=O(gm),i=O(ym),o=O(wm),s=O(Sm),a=O(Cm),l=O(Dm),c=O(Am),u=O(Nm),d=O(Im),h=O(jm),f=O(Lm),p=O(Vm),m=O(qm),g=O(Jm),v=O(Ym),y=O(Xm),b=O(Zm),w=O(eg),x=O(ng),S=O(ig),k=function(e,n){if(!n&&e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return{default:e};var r=C(n);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=e[s]}i.default=e,r&&r.set(e,i);return i}(hm);function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(C=function(e){return e?n:t})(e)}function O(e){return e&&e.__esModule?e:{default:e}}e.helpers=k}(um);function dg(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var hg=dg(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),fg=dg(/Edge/i),pg=dg(/firefox/i),mg=dg(/safari/i)&&!dg(/chrome/i)&&!dg(/android/i),gg=dg(/iP(ad|od|hone)/i),vg=dg(/chrome/i)&&dg(/android/i),yg={capture:!1,passive:!1};function bg(e,t,n){e.addEventListener(t,n,!hg&&yg)}function wg(e,t,n){e.removeEventListener(t,n,!hg&&yg)}function xg(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(n){return!1}return!1}}function Sg(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function kg(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&xg(e,t):xg(e,t))||r&&e===n)return e;if(e===n)break}while(e=Sg(e))}return null}var Cg,Og=/\s+/g;function Mg(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(Og," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(Og," ")}}function _g(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function Dg(e,t){var n="";if("string"==typeof e)n=e;else do{var r=_g(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Tg(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,o=r.length;if(n)for(;i<o;i++)n(r[i],i);return r}return[]}function $g(){var e=document.scrollingElement;return e||document.documentElement}function Ag(e,t,n,r,i){if(e.getBoundingClientRect||e===window){var o,s,a,l,c,u,d;if(e!==window&&e!==$g()?(s=(o=e.getBoundingClientRect()).top,a=o.left,l=o.bottom,c=o.right,u=o.height,d=o.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!hg))do{if(i&&i.getBoundingClientRect&&("none"!==_g(i,"transform")||n&&"static"!==_g(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(_g(i,"border-top-width")),a-=h.left+parseInt(_g(i,"border-left-width")),l=s+o.height,c=a+o.width;break}}while(i=i.parentNode);if(r&&e!==window){var f=Dg(i||e),p=f&&f.a,m=f&&f.d;f&&(l=(s/=m)+(u/=m),c=(a/=p)+(d/=p))}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function Eg(e,t,n){for(var r=zg(e,!0),i=Ag(e)[t];r;){var o=Ag(r)[n];if(!("top"===n||"left"===n?i>=o:i<=o))return r;if(r===$g())break;r=zg(r,!1)}return!1}function Ng(e,t,n){for(var r=0,i=0,o=e.children;i<o.length;){if("none"!==o[i].style.display&&o[i]!==Fv.ghost&&o[i]!==Fv.dragged&&kg(o[i],n.draggable,e,!1)){if(r===t)return o[i];r++}i++}return null}function Pg(e,t){for(var n=e.lastElementChild;n&&(n===Fv.ghost||"none"===_g(n,"display")||t&&!xg(n,t));)n=n.previousElementSibling;return n||null}function Ig(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Fv.clone||t&&!xg(e,t)||n++;return n}function Rg(e){var t=0,n=0,r=$g();if(e)do{var i=Dg(e),o=i.a,s=i.d;t+=e.scrollLeft*o,n+=e.scrollTop*s}while(e!==r&&(e=e.parentNode));return[t,n]}function zg(e,t){if(!e||!e.getBoundingClientRect)return $g();var n=e,r=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=_g(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return $g();if(r||t)return n;r=!0}}}while(n=n.parentNode);return $g()}function jg(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Fg(e,t){return function(){if(!Cg){var n=arguments,r=this;1===n.length?e.call(r,n[0]):e.apply(r,n),Cg=setTimeout((function(){Cg=void 0}),t)}}}function Lg(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Bg(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Vg="Sortable"+(new Date).getTime();function Wg(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(e){if("none"!==_g(e,"display")&&e!==Fv.ghost){t.push({target:e,rect:Ag(e)});var n=cg({},t[t.length-1].rect);if(e.thisAnimationDuration){var r=Dg(e,!0);r&&(n.top-=r.f,n.left-=r.e)}e.fromRect=n}}))},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(t,{target:e}),1)},animateAll:function(n){var r=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof n&&n());var i=!1,o=0;t.forEach((function(e){var t=0,n=e.target,s=n.fromRect,a=Ag(n),l=n.prevFromRect,c=n.prevToRect,u=e.rect,d=Dg(n,!0);d&&(a.top-=d.f,a.left-=d.e),n.toRect=a,n.thisAnimationDuration&&jg(l,a)&&!jg(s,a)&&(u.top-a.top)/(u.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(t=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(u,l,c,r.options)),jg(a,s)||(n.prevFromRect=s,n.prevToRect=a,t||(t=r.options.animation),r.animate(n,u,a,t)),t&&(i=!0,o=Math.max(o,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),t),n.thisAnimationDuration=t)})),clearTimeout(e),i?e=setTimeout((function(){"function"==typeof n&&n()}),o):"function"==typeof n&&n(),t=[]},animate:function(e,t,n,r){if(r){_g(e,"transition",""),_g(e,"transform","");var i=Dg(this.el),o=i&&i.a,s=i&&i.d,a=(t.left-n.left)/(o||1),l=(t.top-n.top)/(s||1);e.animatingX=!!a,e.animatingY=!!l,_g(e,"transform","translate3d("+a+"px,"+l+"px,0)"),function(e){e.offsetWidth}(e),_g(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),_g(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){_g(e,"transition",""),_g(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),r)}}}}var qg=[],Hg={initializeByDefault:!0},Jg={mount:function(e){for(var t in Hg)Hg.hasOwnProperty(t)&&!(t in e)&&(e[t]=Hg[t]);qg.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+"Global";qg.forEach((function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](cg({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](cg({sortable:t},n)))}))},initializePlugins:function(e,t,n,r){for(var i in qg.forEach((function(r){var i=r.pluginName;if(e.options[i]||r.initializeByDefault){var o=new r(e,t,e.options);o.sortable=e,o.options=e.options,e[i]=o,lg(n,o.defaults)}})),e.options)if(e.options.hasOwnProperty(i)){var o=this.modifyOption(e,i,e.options[i]);void 0!==o&&(e.options[i]=o)}},getEventProperties:function(e,t){var n={};return qg.forEach((function(r){"function"==typeof r.eventProperties&&lg(n,r.eventProperties.call(t[r.pluginName],e))})),n},modifyOption:function(e,t,n){var r;return qg.forEach((function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(r=i.optionListeners[t].call(e[i.pluginName],n))})),r}};var Kg=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,i=ug(n,["evt"]);Jg.pluginEvent.bind(Fv)(e,t,cg({dragEl:Ug,parentEl:Xg,ghostEl:Gg,rootEl:Zg,nextEl:Qg,lastDownEl:ev,cloneEl:tv,cloneHidden:nv,dragStarted:mv,putSortable:lv,activeSortable:Fv.active,originalEvent:r,oldIndex:rv,oldDraggableIndex:ov,newIndex:iv,newDraggableIndex:sv,hideGhostForTarget:Iv,unhideGhostForTarget:Rv,cloneNowHidden:function(){nv=!0},cloneNowShown:function(){nv=!1},dispatchSortableEvent:function(e){Yg({sortable:t,name:e,originalEvent:r})}},i))};function Yg(e){!function(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Vg]){var m,g=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||hg||fg?(m=document.createEvent("Event")).initEvent(r,!0,!0):m=new CustomEvent(r,{bubbles:!0,cancelable:!0}),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=o,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=d,m.originalEvent=h,m.pullMode=f?f.lastPutMode:void 0;var y=cg({},p,Jg.getEventProperties(r,t));for(var b in y)m[b]=y[b];n&&n.dispatchEvent(m),g[v]&&g[v].call(t,m)}}(cg({putSortable:lv,cloneEl:tv,targetEl:Ug,rootEl:Zg,oldIndex:rv,oldDraggableIndex:ov,newIndex:iv,newDraggableIndex:sv},e))}var Ug,Xg,Gg,Zg,Qg,ev,tv,nv,rv,iv,ov,sv,av,lv,cv,uv,dv,hv,fv,pv,mv,gv,vv,yv,bv,wv=!1,xv=!1,Sv=[],kv=!1,Cv=!1,Ov=[],Mv=!1,_v=[],Dv="undefined"!=typeof document,Tv=gg,$v=fg||hg?"cssFloat":"float",Av=Dv&&!vg&&!gg&&"draggable"in document.createElement("div"),Ev=function(){if(Dv){if(hg)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Nv=function(e,t){var n=_g(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ng(e,0,t),o=Ng(e,1,t),s=i&&_g(i),a=o&&_g(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ag(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ag(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var u="left"===s.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=r&&"none"===n[$v]||o&&"none"===n[$v]&&l+c>r)?"vertical":"horizontal"},Pv=function(e){function t(e,n){return function(r,i,o,s){var a=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(null==e&&(n||a))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,i,o,s),n)(r,i,o,s);var l=(n?r:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==sg(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Iv=function(){!Ev&&Gg&&_g(Gg,"display","none")},Rv=function(){!Ev&&Gg&&_g(Gg,"display","")};Dv&&document.addEventListener("click",(function(e){if(xv)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),xv=!1,!1}),!0);var zv=function(e){if(Ug){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,o=e.clientY,Sv.some((function(e){if(!Pg(e)){var t=Ag(e),n=e[Vg].options.emptyInsertThreshold,r=i>=t.left-n&&i<=t.right+n,a=o>=t.top-n&&o<=t.bottom+n;return n&&r&&a?s=e:void 0}})),s);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Vg]._onDragOver(n)}}var i,o,s},jv=function(e){Ug&&Ug.parentNode[Vg]._isOutsideThisEl(e.target)};function Fv(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=lg({},t),e[Vg]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Nv(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Fv.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var r in Jg.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in Pv(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&Av,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?bg(e,"pointerdown",this._onTapStart):(bg(e,"mousedown",this._onTapStart),bg(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(bg(e,"dragover",this),bg(e,"dragenter",this)),Sv.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),lg(this,Wg())}function Lv(e,t,n,r,i,o,s,a){var l,c,u=e[Vg],d=u.options.onMove;return!window.CustomEvent||hg||fg?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=i||t,l.relatedRect=o||Ag(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),d&&(c=d.call(u,l,s)),c}function Bv(e){e.draggable=!1}function Vv(){Mv=!1}function Wv(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function qv(e){return setTimeout(e,0)}function Hv(e){return clearTimeout(e)}Fv.prototype={constructor:Fv,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(gv=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Ug):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,o=e.type,s=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(s||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=r.filter;if(function(e){_v.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var r=t[n];r.checked&&_v.push(r)}}(n),!Ug&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||r.disabled||l.isContentEditable||(a=kg(a,r.draggable,n,!1))&&a.animated||ev===a)){if(rv=Ig(a),ov=Ig(a,r.draggable),"function"==typeof c){if(c.call(this,e,a,this))return Yg({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Kg("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(r){if(r=kg(l,r.trim(),n,!1))return Yg({sortable:t,rootEl:r,name:"filter",targetEl:a,fromEl:n,toEl:n}),Kg("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());r.handle&&!kg(l,r.handle,n,!1)||this._prepareDragStart(e,s,a)}}},_prepareDragStart:function(e,t,n){var r,i=this,o=i.el,s=i.options,a=o.ownerDocument;if(n&&!Ug&&n.parentNode===o){var l=Ag(n);if(Zg=o,Xg=(Ug=n).parentNode,Qg=Ug.nextSibling,ev=n,av=s.group,Fv.dragged=Ug,cv={target:Ug,clientX:(t||e).clientX,clientY:(t||e).clientY},fv=cv.clientX-l.left,pv=cv.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Ug.style["will-change"]="all",r=function(){Kg("delayEnded",i,{evt:e}),Fv.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!pg&&i.nativeDraggable&&(Ug.draggable=!0),i._triggerDragStart(e,t),Yg({sortable:i,name:"choose",originalEvent:e}),Mg(Ug,s.chosenClass,!0))},s.ignore.split(",").forEach((function(e){Tg(Ug,e.trim(),Bv)})),bg(a,"dragover",zv),bg(a,"mousemove",zv),bg(a,"touchmove",zv),bg(a,"mouseup",i._onDrop),bg(a,"touchend",i._onDrop),bg(a,"touchcancel",i._onDrop),pg&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ug.draggable=!0),Kg("delayStart",this,{evt:e}),!s.delay||s.delayOnTouchOnly&&!t||this.nativeDraggable&&(fg||hg))r();else{if(Fv.eventCanceled)return void this._onDrop();bg(a,"mouseup",i._disableDelayedDrag),bg(a,"touchend",i._disableDelayedDrag),bg(a,"touchcancel",i._disableDelayedDrag),bg(a,"mousemove",i._delayedDragTouchMoveHandler),bg(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&bg(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(r,s.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ug&&Bv(Ug),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;wg(e,"mouseup",this._disableDelayedDrag),wg(e,"touchend",this._disableDelayedDrag),wg(e,"touchcancel",this._disableDelayedDrag),wg(e,"mousemove",this._delayedDragTouchMoveHandler),wg(e,"touchmove",this._delayedDragTouchMoveHandler),wg(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?bg(document,"pointermove",this._onTouchMove):bg(document,t?"touchmove":"mousemove",this._onTouchMove):(bg(Ug,"dragend",this),bg(Zg,"dragstart",this._onDragStart));try{document.selection?qv((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(e,t){if(wv=!1,Zg&&Ug){Kg("dragStarted",this,{evt:t}),this.nativeDraggable&&bg(document,"dragover",jv);var n=this.options;!e&&Mg(Ug,n.dragClass,!1),Mg(Ug,n.ghostClass,!0),Fv.active=this,e&&this._appendGhost(),Yg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(uv){this._lastX=uv.clientX,this._lastY=uv.clientY,Iv();for(var e=document.elementFromPoint(uv.clientX,uv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(uv.clientX,uv.clientY))!==t;)t=e;if(Ug.parentNode[Vg]._isOutsideThisEl(e),t)do{if(t[Vg]){if(t[Vg]._onDragOver({clientX:uv.clientX,clientY:uv.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Rv()}},_onTouchMove:function(e){if(cv){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=Gg&&Dg(Gg,!0),s=Gg&&o&&o.a,a=Gg&&o&&o.d,l=Tv&&bv&&Rg(bv),c=(i.clientX-cv.clientX+r.x)/(s||1)+(l?l[0]-Ov[0]:0)/(s||1),u=(i.clientY-cv.clientY+r.y)/(a||1)+(l?l[1]-Ov[1]:0)/(a||1);if(!Fv.active&&!wv){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Gg){o?(o.e+=c-(dv||0),o.f+=u-(hv||0)):o={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");_g(Gg,"webkitTransform",d),_g(Gg,"mozTransform",d),_g(Gg,"msTransform",d),_g(Gg,"transform",d),dv=c,hv=u,uv=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Gg){var e=this.options.fallbackOnBody?document.body:Zg,t=Ag(Ug,!0,Tv,!0,e),n=this.options;if(Tv){for(bv=e;"static"===_g(bv,"position")&&"none"===_g(bv,"transform")&&bv!==document;)bv=bv.parentNode;bv!==document.body&&bv!==document.documentElement?(bv===document&&(bv=$g()),t.top+=bv.scrollTop,t.left+=bv.scrollLeft):bv=$g(),Ov=Rg(bv)}Mg(Gg=Ug.cloneNode(!0),n.ghostClass,!1),Mg(Gg,n.fallbackClass,!0),Mg(Gg,n.dragClass,!0),_g(Gg,"transition",""),_g(Gg,"transform",""),_g(Gg,"box-sizing","border-box"),_g(Gg,"margin",0),_g(Gg,"top",t.top),_g(Gg,"left",t.left),_g(Gg,"width",t.width),_g(Gg,"height",t.height),_g(Gg,"opacity","0.8"),_g(Gg,"position",Tv?"absolute":"fixed"),_g(Gg,"zIndex","100000"),_g(Gg,"pointerEvents","none"),Fv.ghost=Gg,e.appendChild(Gg),_g(Gg,"transform-origin",fv/parseInt(Gg.style.width)*100+"% "+pv/parseInt(Gg.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;Kg("dragStart",this,{evt:e}),Fv.eventCanceled?this._onDrop():(Kg("setupClone",this),Fv.eventCanceled||((tv=Bg(Ug)).draggable=!1,tv.style["will-change"]="",this._hideClone(),Mg(tv,this.options.chosenClass,!1),Fv.clone=tv),n.cloneId=qv((function(){Kg("clone",n),Fv.eventCanceled||(n.options.removeCloneOnHide||Zg.insertBefore(tv,Ug),n._hideClone(),Yg({sortable:n,name:"clone"}))})),!t&&Mg(Ug,i.dragClass,!0),t?(xv=!0,n._loopId=setInterval(n._emulateDragOver,50)):(wg(document,"mouseup",n._onDrop),wg(document,"touchend",n._onDrop),wg(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,Ug)),bg(document,"drop",n),_g(Ug,"transform","translateZ(0)")),wv=!0,n._dragStartId=qv(n._dragStarted.bind(n,t,e)),bg(document,"selectstart",n),mv=!0,mg&&_g(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,r,i,o=this.el,s=e.target,a=this.options,l=a.group,c=Fv.active,u=av===l,d=a.sort,h=lv||c,f=this,p=!1;if(!Mv){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=kg(s,a.draggable,o,!0),D("dragOver"),Fv.eventCanceled)return p;if(Ug.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||f._ignoreWhileAnimating===s)return $(!1);if(xv=!1,c&&!a.disabled&&(u?d||(r=!Zg.contains(Ug)):lv===this||(this.lastPutMode=av.checkPull(this,c,Ug,e))&&l.checkPut(this,c,Ug,e))){if(i="vertical"===this._getDirection(e,s),t=Ag(Ug),D("dragOverValid"),Fv.eventCanceled)return p;if(r)return Xg=Zg,T(),this._hideClone(),D("revert"),Fv.eventCanceled||(Qg?Zg.insertBefore(Ug,Qg):Zg.appendChild(Ug)),$(!0);var m=Pg(o,a.draggable);if(!m||function(e,t,n){var r=Ag(Pg(n.el,n.options.draggable)),i=10;return t?e.clientX>r.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}(e,i,this)&&!m.animated){if(m===Ug)return $(!1);if(m&&o===e.target&&(s=m),s&&(n=Ag(s)),!1!==Lv(Zg,o,Ug,t,s,n,e,!!s))return T(),o.appendChild(Ug),Xg=o,A(),$(!0)}else if(s.parentNode===o){n=Ag(s);var g,v,y,b=Ug.parentNode!==o,w=!function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,o=n?e.width:e.height,s=n?t.left:t.top,a=n?t.right:t.bottom,l=n?t.width:t.height;return r===s||i===a||r+o/2===s+l/2}(Ug.animated&&Ug.toRect||t,s.animated&&s.toRect||n,i),x=i?"top":"left",S=Eg(s,"top","top")||Eg(Ug,"top","top"),k=S?S.scrollTop:void 0;if(gv!==s&&(v=n[x],kv=!1,Cv=!w&&a.invertSwap||b),g=function(e,t,n,r,i,o,s,a){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,h=!1;if(!s)if(a&&yv<c*i){if(!kv&&(1===vv?l>u+c*o/2:l<d-c*o/2)&&(kv=!0),kv)h=!0;else if(1===vv?l<u+yv:l>d-yv)return-vv}else if(l>u+c*(1-i)/2&&l<d-c*(1-i)/2)return function(e){return Ig(Ug)<Ig(e)?1:-1}(t);if((h=h||s)&&(l<u+c*o/2||l>d-c*o/2))return l>u+c/2?1:-1;return 0}(e,s,n,i,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Cv,gv===s),0!==g){var C=Ig(Ug);do{C-=g,y=Xg.children[C]}while(y&&("none"===_g(y,"display")||y===Gg))}if(0===g||y===s)return $(!1);gv=s,vv=g;var O=s.nextElementSibling,M=!1,_=Lv(Zg,o,Ug,t,s,n,e,M=1===g);if(!1!==_)return 1!==_&&-1!==_||(M=1===_),Mv=!0,setTimeout(Vv,30),T(),M&&!O?o.appendChild(Ug):s.parentNode.insertBefore(Ug,M?O:s),S&&Lg(S,0,k-S.scrollTop),Xg=Ug.parentNode,void 0===v||Cv||(yv=Math.abs(v-Ag(s)[x])),A(),$(!0)}if(o.contains(Ug))return $(!1)}return!1}function D(a,l){Kg(a,f,cg({evt:e,isOwner:u,axis:i?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:d,fromSortable:h,target:s,completed:$,onMove:function(n,r){return Lv(Zg,o,Ug,t,n,Ag(n),e,r)},changed:A},l))}function T(){D("dragOverAnimationCapture"),f.captureAnimationState(),f!==h&&h.captureAnimationState()}function $(t){return D("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(f),f!==h&&(Mg(Ug,lv?lv.options.ghostClass:c.options.ghostClass,!1),Mg(Ug,a.ghostClass,!0)),lv!==f&&f!==Fv.active?lv=f:f===Fv.active&&lv&&(lv=null),h===f&&(f._ignoreWhileAnimating=s),f.animateAll((function(){D("dragOverAnimationComplete"),f._ignoreWhileAnimating=null})),f!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===Ug&&!Ug.animated||s===o&&!s.animated)&&(gv=null),a.dragoverBubble||e.rootEl||s===document||(Ug.parentNode[Vg]._isOutsideThisEl(e.target),!t&&zv(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function A(){iv=Ig(Ug),sv=Ig(Ug,a.draggable),Yg({sortable:f,name:"change",toEl:o,newIndex:iv,newDraggableIndex:sv,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){wg(document,"mousemove",this._onTouchMove),wg(document,"touchmove",this._onTouchMove),wg(document,"pointermove",this._onTouchMove),wg(document,"dragover",zv),wg(document,"mousemove",zv),wg(document,"touchmove",zv)},_offUpEvents:function(){var e=this.el.ownerDocument;wg(e,"mouseup",this._onDrop),wg(e,"touchend",this._onDrop),wg(e,"pointerup",this._onDrop),wg(e,"touchcancel",this._onDrop),wg(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;iv=Ig(Ug),sv=Ig(Ug,n.draggable),Kg("drop",this,{evt:e}),Xg=Ug&&Ug.parentNode,iv=Ig(Ug),sv=Ig(Ug,n.draggable),Fv.eventCanceled||(wv=!1,Cv=!1,kv=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Hv(this.cloneId),Hv(this._dragStartId),this.nativeDraggable&&(wg(document,"drop",this),wg(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),mg&&_g(document.body,"user-select",""),_g(Ug,"transform",""),e&&(mv&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Gg&&Gg.parentNode&&Gg.parentNode.removeChild(Gg),(Zg===Xg||lv&&"clone"!==lv.lastPutMode)&&tv&&tv.parentNode&&tv.parentNode.removeChild(tv),Ug&&(this.nativeDraggable&&wg(Ug,"dragend",this),Bv(Ug),Ug.style["will-change"]="",mv&&!wv&&Mg(Ug,lv?lv.options.ghostClass:this.options.ghostClass,!1),Mg(Ug,this.options.chosenClass,!1),Yg({sortable:this,name:"unchoose",toEl:Xg,newIndex:null,newDraggableIndex:null,originalEvent:e}),Zg!==Xg?(iv>=0&&(Yg({rootEl:Xg,name:"add",toEl:Xg,fromEl:Zg,originalEvent:e}),Yg({sortable:this,name:"remove",toEl:Xg,originalEvent:e}),Yg({rootEl:Xg,name:"sort",toEl:Xg,fromEl:Zg,originalEvent:e}),Yg({sortable:this,name:"sort",toEl:Xg,originalEvent:e})),lv&&lv.save()):iv!==rv&&iv>=0&&(Yg({sortable:this,name:"update",toEl:Xg,originalEvent:e}),Yg({sortable:this,name:"sort",toEl:Xg,originalEvent:e})),Fv.active&&(null!=iv&&-1!==iv||(iv=rv,sv=ov),Yg({sortable:this,name:"end",toEl:Xg,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Kg("nulling",this),Zg=Ug=Xg=Gg=Qg=tv=ev=nv=cv=uv=mv=iv=sv=rv=ov=gv=vv=lv=av=Fv.dragged=Fv.ghost=Fv.clone=Fv.active=null,_v.forEach((function(e){e.checked=!0})),_v.length=dv=hv=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Ug&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,i=n.length,o=this.options;r<i;r++)kg(e=n[r],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||Wv(e));return t},sort:function(e){var t={},n=this.el;this.toArray().forEach((function(e,r){var i=n.children[r];kg(i,this.options.draggable,n,!1)&&(t[e]=i)}),this),e.forEach((function(e){t[e]&&(n.removeChild(t[e]),n.appendChild(t[e]))}))},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return kg(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=Jg.modifyOption(this,e,t);n[e]=void 0!==r?r:t,"group"===e&&Pv(n)},destroy:function(){Kg("destroy",this);var e=this.el;e[Vg]=null,wg(e,"mousedown",this._onTapStart),wg(e,"touchstart",this._onTapStart),wg(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(wg(e,"dragover",this),wg(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Sv.splice(Sv.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!nv){if(Kg("hideClone",this),Fv.eventCanceled)return;_g(tv,"display","none"),this.options.removeCloneOnHide&&tv.parentNode&&tv.parentNode.removeChild(tv),nv=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(nv){if(Kg("showClone",this),Fv.eventCanceled)return;Zg.contains(Ug)&&!this.options.group.revertClone?Zg.insertBefore(tv,Ug):Qg?Zg.insertBefore(tv,Qg):Zg.appendChild(tv),this.options.group.revertClone&&this.animate(Ug,tv),_g(tv,"display",""),nv=!1}}else this._hideClone()}},Dv&&bg(document,"touchmove",(function(e){(Fv.active||wv)&&e.cancelable&&e.preventDefault()})),Fv.utils={on:bg,off:wg,css:_g,find:Tg,is:function(e,t){return!!kg(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:Fg,closest:kg,toggleClass:Mg,clone:Bg,index:Ig,nextTick:qv,cancelNextTick:Hv,detectDirection:Nv,getChild:Ng},Fv.get=function(e){return e[Vg]},Fv.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Fv.utils=cg({},Fv.utils,e.utils)),Jg.mount(e)}))},Fv.create=function(e,t){return new Fv(e,t)},Fv.version="1.10.2";var Jv,Kv,Yv,Uv,Xv,Gv,Zv=[],Qv=!1;function ey(){Zv.forEach((function(e){clearInterval(e.pid)})),Zv=[]}function ty(){clearInterval(Gv)}var ny=Fg((function(e,t,n,r){if(t.scroll){var i,o=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,c=$g(),u=!1;Kv!==n&&(Kv=n,ey(),Jv=t.scroll,i=t.scrollFn,!0===Jv&&(Jv=zg(n,!0)));var d=0,h=Jv;do{var f=h,p=Ag(f),m=p.top,g=p.bottom,v=p.left,y=p.right,b=p.width,w=p.height,x=void 0,S=void 0,k=f.scrollWidth,C=f.scrollHeight,O=_g(f),M=f.scrollLeft,_=f.scrollTop;f===c?(x=b<k&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),S=w<C&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(x=b<k&&("auto"===O.overflowX||"scroll"===O.overflowX),S=w<C&&("auto"===O.overflowY||"scroll"===O.overflowY));var D=x&&(Math.abs(y-o)<=a&&M+b<k)-(Math.abs(v-o)<=a&&!!M),T=S&&(Math.abs(g-s)<=a&&_+w<C)-(Math.abs(m-s)<=a&&!!_);if(!Zv[d])for(var $=0;$<=d;$++)Zv[$]||(Zv[$]={});Zv[d].vx==D&&Zv[d].vy==T&&Zv[d].el===f||(Zv[d].el=f,Zv[d].vx=D,Zv[d].vy=T,clearInterval(Zv[d].pid),0==D&&0==T||(u=!0,Zv[d].pid=setInterval(function(){r&&0===this.layer&&Fv.active._onTouchMove(Xv);var t=Zv[this.layer].vy?Zv[this.layer].vy*l:0,n=Zv[this.layer].vx?Zv[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Fv.dragged.parentNode[Vg],n,t,e,Xv,Zv[this.layer].el)||Lg(Zv[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==c&&(h=zg(h,!1)));Qv=u}}),30),ry=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,o=e.dispatchSortableEvent,s=e.hideGhostForTarget,a=e.unhideGhostForTarget;if(t){var l=n||i;s();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(u)&&(o("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function iy(){}function oy(){}iy.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Ng(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:ry},lg(iy,{pluginName:"revertOnSpill"}),oy.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:ry},lg(oy,{pluginName:"removeOnSpill"}),Fv.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?bg(document,"dragover",this._handleAutoScroll):this.options.supportPointer?bg(document,"pointermove",this._handleFallbackAutoScroll):t.touches?bg(document,"touchmove",this._handleFallbackAutoScroll):bg(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?wg(document,"dragover",this._handleAutoScroll):(wg(document,"pointermove",this._handleFallbackAutoScroll),wg(document,"touchmove",this._handleFallbackAutoScroll),wg(document,"mousemove",this._handleFallbackAutoScroll)),ty(),ey(),clearTimeout(Cg),Cg=void 0},nulling:function(){Xv=Kv=Jv=Qv=Gv=Yv=Uv=null,Zv.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(r,i);if(Xv=e,t||fg||hg||mg){ny(e,this.options,o,t);var s=zg(o,!0);!Qv||Gv&&r===Yv&&i===Uv||(Gv&&ty(),Gv=setInterval((function(){var o=zg(document.elementFromPoint(r,i),!0);o!==s&&(s=o,ey()),ny(e,n.options,o,t)}),10),Yv=r,Uv=i)}else{if(!this.options.bubbleScroll||zg(o,!0)===$g())return void ey();ny(e,this.options,zg(o,!1),!1)}}},lg(e,{pluginName:"scroll",initializeByDefault:!0})}),Fv.mount(oy,iy);const sy="undefined"!=typeof window?window.console:global.console;const ay=/-(\w)/g,ly=function(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}((e=>e.replace(ay,((e,t)=>t?t.toUpperCase():""))));function cy(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function uy(e,t,n){const r=0===n?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,r)}function dy(e,t){this.$nextTick((()=>this.$emit(e.toLowerCase(),t)))}function hy(e){return t=>{null!==this.realList&&this["onDrag"+e](t),dy.call(this,e,t)}}function fy(e){return["transition-group","TransitionGroup"].includes(e)}function py(e,t,n){return e[n]||(t[n]?t[n]():void 0)}const my=["Start","Add","Remove","Update","End"],gy=["Choose","Unchoose","Sort","Filter","Clone"],vy=["Move",...my,...gy].map((e=>"on"+e));var yy=null;const by={name:"draggable",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},data:()=>({transitionMode:!1,noneFunctionalComponentMode:!1}),render(e){const t=this.$slots.default;this.transitionMode=function(e){if(!e||1!==e.length)return!1;const[{componentOptions:t}]=e;return!!t&&fy(t.tag)}(t);const{children:n,headerOffset:r,footerOffset:i}=function(e,t,n){let r=0,i=0;const o=py(t,n,"header");o&&(r=o.length,e=e?[...o,...e]:[...o]);const s=py(t,n,"footer");return s&&(i=s.length,e=e?[...e,...s]:[...s]),{children:e,headerOffset:r,footerOffset:i}}(t,this.$slots,this.$scopedSlots);this.headerOffset=r,this.footerOffset=i;const o=function(e,t){let n=null;const r=(e,t)=>{n=function(e,t,n){return void 0===n||((e=e||{})[t]=n),e}(n,e,t)};if(r("attrs",Object.keys(e).filter((e=>"id"===e||e.startsWith("data-"))).reduce(((t,n)=>(t[n]=e[n],t)),{})),!t)return n;const{on:i,props:o,attrs:s}=t;return r("on",i),r("props",o),Object.assign(n.attrs,s),n}(this.$attrs,this.componentData);return e(this.getTag(),o,n)},created(){null!==this.list&&null!==this.value&&sy.error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&sy.warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&sy.warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted(){if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error(`Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}`);const e={};my.forEach((t=>{e["on"+t]=hy.call(this,t)})),gy.forEach((t=>{e["on"+t]=dy.bind(this,t)}));const t=Object.keys(this.$attrs).reduce(((e,t)=>(e[ly(t)]=this.$attrs[t],e)),{}),n=Object.assign({},this.options,t,e,{onMove:(e,t)=>this.onDragMove(e,t)});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new Fv(this.rootContainer,n),this.computeIndexes()},beforeDestroy(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer(){return this.transitionMode?this.$el.children[0]:this.$el},realList(){return this.list?this.list:this.value}},watch:{options:{handler(e){this.updateOptions(e)},deep:!0},$attrs:{handler(e){this.updateOptions(e)},deep:!0},realList(){this.computeIndexes()}},methods:{getIsFunctional(){const{fnOptions:e}=this._vnode;return e&&e.functional},getTag(){return this.tag||this.element},updateOptions(e){for(var t in e){const n=ly(t);-1===vy.indexOf(n)&&this._sortable.option(n,e[t])}},getChildrenNodes(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;const e=this.$slots.default;return this.transitionMode?e[0].child.$slots.default:e},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=function(e,t,n,r){if(!e)return[];const i=e.map((e=>e.elm)),o=t.length-r,s=[...t].map(((e,t)=>t>=o?i.length:i.indexOf(e)));return n?s.filter((e=>-1!==e)):s}(this.getChildrenNodes(),this.rootContainer.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(e){const t=function(e,t){return e.map((e=>e.elm)).indexOf(t)}(this.getChildrenNodes()||[],e);if(-1===t)return null;return{index:t,element:this.realList[t]}},getUnderlyingPotencialDraggableComponent:({__vue__:e})=>e&&e.$options&&fy(e.$options._componentTag)?e.$parent:!("realList"in e)&&1===e.$children.length&&"realList"in e.$children[0]?e.$children[0]:e,emitChanges(e){this.$nextTick((()=>{this.$emit("change",e)}))},alterList(e){if(this.list)return void e(this.list);const t=[...this.value];e(t),this.$emit("input",t)},spliceList(){this.alterList((e=>e.splice(...arguments)))},updatePosition(e,t){this.alterList((n=>n.splice(t,0,n.splice(e,1)[0])))},getRelatedContextFromMoveEvent({to:e,related:t}){const n=this.getUnderlyingPotencialDraggableComponent(e);if(!n)return{component:n};const r=n.realList,i={list:r,component:n};if(e!==t&&r&&n.getUnderlyingVm){const e=n.getUnderlyingVm(t);if(e)return Object.assign(e,i)}return i},getVmIndex(e){const t=this.visibleIndexes,n=t.length;return e>n-1?n:t[e]},getComponent(){return this.$slots.default[0].componentInstance},resetTransitionData(e){if(!this.noTransitionOnDrag||!this.transitionMode)return;this.getChildrenNodes()[e].data=null;const t=this.getComponent();t.children=[],t.kept=void 0},onDragStart(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),yy=e.item},onDragAdd(e){const t=e.item._underlying_vm_;if(void 0===t)return;cy(e.item);const n=this.getVmIndex(e.newIndex);this.spliceList(n,0,t),this.computeIndexes();const r={element:t,newIndex:n};this.emitChanges({added:r})},onDragRemove(e){if(uy(this.rootContainer,e.item,e.oldIndex),"clone"===e.pullMode)return void cy(e.clone);const t=this.context.index;this.spliceList(t,1);const n={element:this.context.element,oldIndex:t};this.resetTransitionData(t),this.emitChanges({removed:n})},onDragUpdate(e){cy(e.item),uy(e.from,e.item,e.oldIndex);const t=this.context.index,n=this.getVmIndex(e.newIndex);this.updatePosition(t,n);const r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},updateProperty(e,t){e.hasOwnProperty(t)&&(e[t]+=this.headerOffset)},computeFutureIndex(e,t){if(!e.element)return 0;const n=[...t.to.children].filter((e=>"none"!==e.style.display)),r=n.indexOf(t.related),i=e.component.getVmIndex(r);return-1!==n.indexOf(yy)||!t.willInsertAfter?i:i+1},onDragMove(e,t){const n=this.move;if(!n||!this.realList)return!0;const r=this.getRelatedContextFromMoveEvent(e),i=this.context,o=this.computeFutureIndex(r,e);Object.assign(i,{futureIndex:o});return n(Object.assign({},e,{relatedContext:r,draggedContext:i}),t)},onDragEnd(){this.computeIndexes(),yy=null}}};"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("draggable",by);export{cm as A,om as B,um as C,Mc as D,Iu as E,Rl as F,by as G,ul as H,Op as I,El as J,Cu as N,zu as P,Vl as S,Su as T,Mn as V,Wa as a,Za as b,rl as c,tl as d,bp as e,hp as f,Tp as g,$p as h,jp as i,Lp as j,Vp as k,Bp as l,qa as m,op as n,Cc as o,Mp as p,Lf as q,Rc as r,vp as s,yp as t,Dp as u,Cp as v,Fp as w,sm as x,am as y,lm as z};
|