/*! * Vue.js v2.7.4 * (c) 2014-2022 Evan You * Released under the MIT License. */ var t=Object.freeze({}),e=Array.isArray;function n(t){return null==t}function r(t){return null!=t}function o(t){return!0===t}function i(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function s(t){return"function"==typeof t}function a(t){return null!==t&&"object"==typeof t}var l=Object.prototype.toString;function c(t){return"[object Object]"===l.call(t)}function u(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function f(t){var e=parseFloat(t);return isNaN(e)?t:e}function p(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(n,1)}}var y=Object.prototype.hasOwnProperty;function b(t,e){return y.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,S=w((function(t){return t.replace(x,(function(t,e){return e?e.toUpperCase():""}))})),k=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),_=/\B([A-Z])/g,O=w((function(t){return t.replace(_,"-$1").toLowerCase()}));var C=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function M(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function D(t,e){for(var n in e)t[n]=e[n];return t}function T(t){for(var e={},n=0;n0,U=J&&J.indexOf("edge/")>0;J&&J.indexOf("android");var G=J&&/iphone|ipad|ipod|ios/.test(J);J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J);var X,Z=J&&J.match(/firefox\/(\d+)/),Q={}.watch,tt=!1;if(H)try{var et={};Object.defineProperty(et,"passive",{get:function(){tt=!0}}),window.addEventListener("test-passive",null,et)}catch(jy){}var nt=function(){return void 0===X&&(X=!H&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),X},rt=H&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ot(t){return"function"==typeof t&&/native code/.test(t.toString())}var it,st="undefined"!=typeof Symbol&&ot(Symbol)&&"undefined"!=typeof Reflect&&ot(Reflect.ownKeys);it="undefined"!=typeof Set&&ot(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var at=null;function lt(t){void 0===t&&(t=null),t||at&&at._scope.off(),at=t,t&&t._scope.on()}var ct=$,ut=0,dt=function(){function t(){this.id=ut++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){v(this.subs,t)},t.prototype.depend=function(e){t.target&&t.target.addDep(this)},t.prototype.notify=function(t){for(var e=this.subs.slice(),n=0,r=e.length;n0&&(Pt((l=It(l,"".concat(s||"","_").concat(a)))[0])&&Pt(u)&&(d[c]=vt(u.text+l[0].text),l.shift()),d.push.apply(d,l)):i(l)?Pt(u)?d[c]=vt(u.text+l):""!==l&&d.push(vt(l)):Pt(l)&&Pt(u)?d[c]=vt(u.text+l.text):(o(t._isVList)&&r(l.tag)&&n(l.key)&&r(s)&&(l.key="__vlist".concat(s,"_").concat(a,"__")),d.push(l)));return d}function Rt(e){var n=e.$options,r=n.setup;if(r){var o=e._setupContext=function(e){return{get attrs(){return function(e){if(!e._attrsProxy){var n=e._attrsProxy={};V(n,"_v_attr_proxy",!0),zt(n,e.$attrs,t,e)}return e._attrsProxy}(e)},get slots(){return function(t){t._slotsProxy||Ft(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(e)},emit:C(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return _t(e,t,n)}))}}}(e);lt(e),ft();var i=rn(r,null,[e._props||xt({}),o],e,"setup");if(pt(),lt(),s(i))n.render=i;else if(a(i))if(e._setupState=i,i.__sfc){var l=e._setupProxy={};for(var c in i)"__sfc"!==c&&_t(l,i,c)}else for(var c in i)B(c)||_t(e,i,c)}}function zt(t,e,n,r){var o=!1;for(var i in e)i in t?e[i]!==n[i]&&(o=!0):(o=!0,jt(t,i,r));for(var i in t)i in e||(o=!0,delete t[i]);return o}function jt(t,e,n){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n.$attrs[e]}})}function Ft(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var Lt={enumerable:!0,configurable:!0,get:$,set:$};function Bt(t,e,n){Lt.get=function(){return this[e][n]},Lt.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Lt)}function Vt(t){var n=t.$options;if(n.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=xt({}),o=t.$options._propKeys=[];t.$parent&&wn(!1);var i=function(i){o.push(i);var s=Rn(i,e,n,t);_n(r,i,s),i in t||Bt(t,"_props",i)};for(var s in e)i(s);wn(!0)}(t,n.props),Rt(t),n.methods&&function(t,e){for(var n in t.$options.props,e)t[n]="function"!=typeof e[n]?$:C(e[n],t)}(t,n.methods),n.data)!function(t){var e=t.$options.data;c(e=t._data=s(e)?function(t,e){ft();try{return t.call(e,e)}catch(jy){return nn(jy,e,"data()"),{}}finally{pt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props;t.$options.methods;var o=n.length;for(;o--;){var i=n[o];r&&b(r,i)||B(i)||Bt(t,"_data",i)}var a=kn(e);a&&a.vmCount++}(t);else{var r=kn(t._data={});r&&r.vmCount++}n.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=nt();for(var o in e){var i=e[o],a=s(i)?i:i.get;r||(n[o]=new en(t,a||$,$,qt)),o in t||Ht(t,o,i)}}(t,n.computed),n.watch&&n.watch!==Q&&function(t,n){for(var r in n){var o=n[r];if(e(o))for(var i=0;i0,a=n?!!n.$stable:!s,l=n&&n.$key;if(n){if(n._normalized)return n._normalized;if(a&&o&&o!==t&&l===o.$key&&!s&&!o.$hasNormal)return o;for(var c in i={},n)n[c]&&"$"!==c[0]&&(i[c]=oe(e,r,c,n[c]))}else i={};for(var u in r)u in i||(i[u]=ie(r,u));return n&&Object.isExtensible(n)&&(n._normalized=i),V(i,"$stable",a),V(i,"$key",l),V(i,"$hasNormal",s),i}function oe(t,n,r,o){var i=function(){var n=at;lt(t);var r=arguments.length?o.apply(null,arguments):o({}),i=(r=r&&"object"==typeof r&&!e(r)?[r]:At(r))&&r[0];return lt(n),r&&(!i||1===r.length&&i.isComment&&!ne(i))?void 0:r};return o.proxy&&Object.defineProperty(n,r,{get:i,enumerable:!0,configurable:!0}),i}function ie(t,e){return function(){return t[e]}}function se(t,n){var o,i,s,l,c=null;if(e(t)||"string"==typeof t)for(c=new Array(t.length),o=0,i=t.length;odocument.createEvent("Event").timeStamp&&(Xe=function(){return Ze.now()})}function Qe(){var t,e;for(Ge=Xe(),Ye=!0,qe.sort((function(t,e){return t.id-e.id})),Ue=0;UeUe&&qe[n].id>t.id;)n--;qe.splice(n+1,0,t)}else qe.push(t);Ke||(Ke=!0,gn(Qe))}}(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||a(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');rn(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&v(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();function nn(t,e,n){ft();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i-1)if(i&&!b(o,"default"))a=!1;else if(""===a||a===O(t)){var c=Ln(String,o.type);(c<0||l-1:"string"==typeof t?t.split(",").indexOf(n)>-1:(r=t,"[object RegExp]"===l.call(r)&&t.test(n));var r}function Hn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!e(a)&&Jn(n,i,r,o)}}}function Jn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,v(n,e)}Bn.prototype._init=function(e){var n=this;n._uid=Zt++,n._isVue=!0,n.__v_skip=!0,n._scope=new Xt(!0),e&&e._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(n,e):n.$options=Pn(Qt(n.constructor),e||{},n),n._renderProxy=n,n._self=n,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(n),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ze(t,e)}(n),function(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,o=r&&r.context;e.$slots=te(n._renderChildren,o),e.$scopedSlots=t,e._c=function(t,n,r,o){return De(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return De(e,t,n,r,o,!0)};var i=r&&r.data;_n(e,"$attrs",i&&i.attrs||t,null,!0),_n(e,"$listeners",n._parentListeners||t,null,!0)}(n),We(n,"beforeCreate"),function(t){var e=Gt(t.$options.inject,t);e&&(wn(!1),Object.keys(e).forEach((function(n){_n(t,n,e[n])})),wn(!0))}(n),Vt(n),function(t){var e=t.$options.provide;if(e){var n=s(e)?e.call(t):e;if(!a(n))return;var r=st?Reflect.ownKeys(n):Object.keys(n);lt(t);for(var o=0;o1?M(n):n;for(var r=M(arguments,1),o='event handler for "'.concat(t,'"'),i=0,s=n.length;iparseInt(this.max)&&Jn(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Jn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Hn(t,(function(t){return qn(e,t)}))})),this.$watch("exclude",(function(e){Hn(t,(function(t){return!qn(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Ae(t),n=e&&e.componentOptions;if(n){var r=Wn(n),o=this.include,i=this.exclude;if(o&&(!r||!qn(o,r))||i&&r&&qn(i,r))return e;var s=this.cache,a=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,v(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return F}};Object.defineProperty(t,"config",e),t.util={warn:ct,extend:D,mergeOptions:Pn,defineReactive:_n},t.set=On,t.delete=Cn,t.nextTick=gn,t.observable=function(t){return kn(t),t},t.options=Object.create(null),z.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,D(t.options.components,Yn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=M(arguments,1);return n.unshift(this),s(t.install)?t.install.apply(t,n):s(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Pn(this.options,t),this}}(t),Vn(t),function(t){z.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&c(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&s(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Bn),Object.defineProperty(Bn.prototype,"$isServer",{get:nt}),Object.defineProperty(Bn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Bn,"FunctionalRenderContext",{value:xe}),Bn.version="2.7.4";var Un=p("style,class"),Gn=p("input,textarea,option,select,progress"),Xn=function(t,e,n){return"value"===n&&Gn(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Zn=p("contenteditable,draggable,spellcheck"),Qn=p("events,caret,typing,plaintext-only"),tr=p("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"),er="http://www.w3.org/1999/xlink",nr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},rr=function(t){return nr(t)?t.slice(6,t.length):""},or=function(t){return null==t||!1===t};function ir(t){for(var e=t.data,n=t,o=t;r(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=sr(o.data,e));for(;r(n=n.parent);)n&&n.data&&(e=sr(e,n.data));return function(t,e){if(r(t)||r(e))return ar(t,lr(e));return""}(e.staticClass,e.class)}function sr(t,e){return{staticClass:ar(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function ar(t,e){return t?e?t+" "+e:t:e||""}function lr(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Pr(t,e,n):tr(e)?or(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Zn(e)?t.setAttribute(e,function(t,e){return or(e)||"false"===e?"false":"contenteditable"===t&&Qn(e)?e:"true"}(e,n)):nr(e)?or(n)?t.removeAttributeNS(er,rr(e)):t.setAttributeNS(er,e,n):Pr(t,e,n)}function Pr(t,e,n){if(or(n))t.removeAttribute(e);else{if(K&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Ir={create:Nr,update:Nr};function Rr(t,e){var o=e.elm,i=e.data,s=t.data;if(!(n(i.staticClass)&&n(i.class)&&(n(s)||n(s.staticClass)&&n(s.class)))){var a=ir(e),l=o._transitionClasses;r(l)&&(a=ar(a,lr(l))),a!==o._prevClass&&(o.setAttribute("class",a),o._prevClass=a)}}var zr,jr,Fr,Lr,Br,Vr,Wr={create:Rr,update:Rr},qr=/[\w).+\-_$\]]/;function Hr(t){var e,n,r,o,i,s=!1,a=!1,l=!1,c=!1,u=0,d=0,h=0,f=0;for(r=0;r=0&&" "===(m=t.charAt(p));p--);m&&qr.test(m)||(c=!0)}}else void 0===o?(f=r+1,o=t.slice(0,r).trim()):g();function g(){(i||(i=[])).push(t.slice(f,r).trim()),f=r+1}if(void 0===o?o=t.slice(0,r).trim():0!==f&&g(),i)for(r=0;r-1?{exp:t.slice(0,Lr),key:'"'+t.slice(Lr+1)+'"'}:{exp:t,key:null};jr=t,Lr=Br=Vr=0;for(;!lo();)co(Fr=ao())?ho(Fr):91===Fr&&uo(Fr);return{exp:t.slice(0,Br),key:t.slice(Br+1,Vr)}}(t);return null===n.key?"".concat(t,"=").concat(e):"$set(".concat(n.exp,", ").concat(n.key,", ").concat(e,")")}function ao(){return jr.charCodeAt(++Lr)}function lo(){return Lr>=zr}function co(t){return 34===t||39===t}function uo(t){var e=1;for(Br=Lr;!lo();)if(co(t=ao()))ho(t);else if(91===t&&e++,93===t&&e--,0===e){Vr=Lr;break}}function ho(t){for(var e=t;!lo()&&(t=ao())!==e;);}var fo;function po(t,e,n){var r=fo;return function o(){var i=e.apply(null,arguments);null!==i&&vo(t,o,n,r)}}var mo=ln&&!(Z&&Number(Z[1])<=53);function go(t,e,n,r){if(mo){var o=Ge,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}fo.addEventListener(t,e,tt?{capture:n,passive:r}:n)}function vo(t,e,n,r){(r||fo).removeEventListener(t,e._wrapper||e,n)}function yo(t,e){if(!n(t.data.on)||!n(e.data.on)){var o=e.data.on||{},i=t.data.on||{};fo=e.elm||t.elm,function(t){if(r(t.__r)){var e=K?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}r(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(o),$t(o,i,go,vo,po,e.context),fo=void 0}}var bo,wo={create:yo,update:yo,destroy:function(t){return yo(t,xr)}};function xo(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var i,s,a=e.elm,l=t.data.domProps||{},c=e.data.domProps||{};for(i in(r(c.__ob__)||o(c._v_attr_proxy))&&(c=e.data.domProps=D({},c)),l)i in c||(a[i]="");for(i in c){if(s=c[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),s===l[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=s;var u=n(s)?"":String(s);So(a,u)&&(a.value=u)}else if("innerHTML"===i&&dr(a.tagName)&&n(a.innerHTML)){(bo=bo||document.createElement("div")).innerHTML="".concat(s,"");for(var d=bo.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;d.firstChild;)a.appendChild(d.firstChild)}else if(s!==l[i])try{a[i]=s}catch(jy){}}}}function So(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(jy){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(r(o)){if(o.number)return f(n)!==f(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var ko={create:xo,update:xo},_o=w((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Oo(t){var e=Co(t.style);return t.staticStyle?D(t.staticStyle,e):e}function Co(t){return Array.isArray(t)?T(t):"string"==typeof t?_o(t):t}var Mo,Do=/^--/,To=/\s*!important$/,$o=function(t,e,n){if(Do.test(e))t.style.setProperty(e,n);else if(To.test(n))t.style.setProperty(O(e),n.replace(To,""),"important");else{var r=No(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(Io).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function zo(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Io).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function jo(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&D(e,Fo(t.name||"v")),D(e,t),e}return"string"==typeof t?Fo(t):void 0}}var Fo=w((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),Lo=H&&!Y,Bo="transition",Vo="transitionend",Wo="animation",qo="animationend";Lo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Bo="WebkitTransition",Vo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Wo="WebkitAnimation",qo="webkitAnimationEnd"));var Ho=H?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Jo(t){Ho((function(){Ho(t)}))}function Ko(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Ro(t,e))}function Yo(t,e){t._transitionClasses&&v(t._transitionClasses,e),zo(t,e)}function Uo(t,e,n){var r=Xo(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a="transition"===o?Vo:qo,l=0,c=function(){t.removeEventListener(a,u),n()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout((function(){l0&&(n="transition",u=s,d=i.length):"animation"===e?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?i.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Go.test(r[Bo+"Property"])}}function Zo(t,e){for(;t.length1}function oi(t,e){!0!==e.data.show&&ti(e)}var ii=function(t){var s,a,l={},c=t.modules,u=t.nodeOps;for(s=0;sp?w(t,n(o[v+1])?null:o[v+1].elm,o,f,v,i):f>v&&S(e,d,p)}(d,m,g,i,c):r(g)?(r(t.text)&&u.setTextContent(d,""),w(d,null,g,0,g.length-1,i)):r(m)?S(m,0,m.length-1):r(t.text)&&u.setTextContent(d,""):t.text!==e.text&&u.setTextContent(d,e.text),r(p)&&r(f=p.hook)&&r(f=f.postpatch)&&f(t,e)}}}function C(t,e,n){if(o(n)&&r(t.parent))t.parent.data.pendingInsert=e;else for(var i=0;i-1,s.selected!==i&&(s.selected=i);else if(A(ui(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}}function ci(t,e){return e.every((function(e){return!A(e,t)}))}function ui(t){return"_value"in t?t._value:t.value}function di(t){t.target.composing=!0}function hi(t){t.target.composing&&(t.target.composing=!1,fi(t.target,"input"))}function fi(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function pi(t){return!t.componentInstance||t.data&&t.data.transition?t:pi(t.componentInstance._vnode)}var mi={model:si,show:{bind:function(t,e,n){var r=e.value,o=(n=pi(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,ti(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=pi(n)).data&&n.data.transition?(n.data.show=!0,r?ti(n,(function(){t.style.display=t.__vOriginalDisplay})):ei(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},gi={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 vi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?vi(Ae(e.children)):t}function yi(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[S(r)]=o[r];return e}function bi(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var wi=function(t){return t.tag||ne(t)},xi=function(t){return"show"===t.name},Si={name:"transition",props:gi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(wi)).length){var r=this.mode,o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var s=vi(o);if(!s)return o;if(this._leaving)return bi(t,o);var a="__transition-".concat(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=yi(this),c=this._vnode,u=vi(c);if(s.data.directives&&s.data.directives.some(xi)&&(s.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(s,u)&&!ne(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=D({},l);if("out-in"===r)return this._leaving=!0,Et(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),bi(t,o);if("in-out"===r){if(ne(s))return c;var h,f=function(){h()};Et(l,"afterEnter",f),Et(l,"enterCancelled",f),Et(d,"delayLeave",(function(t){h=t}))}}return o}}},ki=D({tag:String,moveClass:String},gi);delete ki.mode;var _i={props:ki,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Fe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=yi(this),a=0;a-1?pr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:pr[t]=/HTMLUnknownElement/.test(e.toString())},D(Bn.options.directives,mi),D(Bn.options.components,Di),Bn.prototype.__patch__=H?ii:$,Bn.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=gt),We(t,"beforeMount"),r=function(){t._update(t._render(),n)},new en(t,r,$,{before:function(){t._isMounted&&!t._isDestroyed&&We(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Li=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Bi="[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(L.source,"]*"),Vi="((?:".concat(Bi,"\\:)?").concat(Bi,")"),Wi=new RegExp("^<".concat(Vi)),qi=/^\s*(\/?)>/,Hi=new RegExp("^<\\/".concat(Vi,"[^>]*>")),Ji=/^]+>/i,Ki=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Zi=/&(?:lt|gt|quot|amp|#39);/g,Qi=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,ts=p("pre,textarea",!0),es=function(t,e){return t&&ts(t)&&"\n"===e[0]};function ns(t,e){var n=e?Qi:Zi;return t.replace(n,(function(t){return Xi[t]}))}function rs(t,e){for(var n,r,o=[],i=e.expectHTML,s=e.isUnaryTag||E,a=e.canBeLeftOpenTag||E,l=0,c=function(){if(n=t,r&&Ui(r)){var c=0,h=r.toLowerCase(),f=Gi[h]||(Gi[h]=new RegExp("([\\s\\S]*?)(]*>)","i"));S=t.replace(f,(function(t,n,r){return c=r.length,Ui(h)||"noscript"===h||(n=n.replace(//g,"$1").replace(//g,"$1")),es(h,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""}));l+=t.length-S.length,t=S,d(h,l-c,l)}else{var p=t.indexOf("<");if(0===p){if(Ki.test(t)){var m=t.indexOf("--\x3e");if(m>=0)return e.shouldKeepComment&&e.comment&&e.comment(t.substring(4,m),l,l+m+3),u(m+3),"continue"}if(Yi.test(t)){var g=t.indexOf("]>");if(g>=0)return u(g+2),"continue"}var v=t.match(Ji);if(v)return u(v[0].length),"continue";var y=t.match(Hi);if(y){var b=l;return u(y[0].length),d(y[1],b,l),"continue"}var w=function(){var e=t.match(Wi);if(e){var n={tagName:e[1],attrs:[],start:l};u(e[0].length);for(var r=void 0,o=void 0;!(r=t.match(qi))&&(o=t.match(Li)||t.match(Fi));)o.start=l,u(o[0].length),o.end=l,n.attrs.push(o);if(r)return n.unarySlash=r[1],u(r[0].length),n.end=l,n}}();if(w)return function(t){var n=t.tagName,l=t.unarySlash;i&&("p"===r&&ji(n)&&d(r),a(n)&&r===n&&d(n));for(var c=s(n)||!!l,u=t.attrs.length,h=new Array(u),f=0;f=0){for(S=t.slice(p);!(Hi.test(S)||Wi.test(S)||Ki.test(S)||Yi.test(S)||(k=S.indexOf("<",1))<0);)p+=k,S=t.slice(p);x=t.substring(0,p)}p<0&&(x=t),x&&u(x.length),e.chars&&x&&e.chars(x,l-x.length,l)}if(t===n)return e.chars&&e.chars(t),"break"};t;){if("break"===c())break}function u(e){l+=e,t=t.substring(e)}function d(t,n,i){var s,a;if(null==n&&(n=l),null==i&&(i=l),t)for(a=t.toLowerCase(),s=o.length-1;s>=0&&o[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=o.length-1;c>=s;c--)e.end&&e.end(o[c].tag,n,i);o.length=s,r=s&&o[s-1].tag}else"br"===a?e.start&&e.start(t,[],!0,n,i):"p"===a&&(e.start&&e.start(t,[],!1,n,i),e.end&&e.end(t,n,i))}d()}var is,ss,as,ls,cs,us,ds,hs,fs=/^@|^v-on:/,ps=/^v-|^@|^:|^#/,ms=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,gs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,vs=/^\(|\)$/g,ys=/^\[.*\]$/,bs=/:(.*)$/,ws=/^:|^\.|^v-bind:/,xs=/\.[^.\]]+(?=[^\]]*$)/g,Ss=/^v-slot(:|$)|^#/,ks=/[\r\n]/,_s=/[ \f\t\r\n]+/g,Os=w(Ii);function Cs(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:As(e),rawAttrsMap:{},parent:n,children:[]}}function Ms(t,e){is=e.warn||Kr,us=e.isPreTag||E,ds=e.mustUseProp||E,hs=e.getTagNamespace||E,e.isReservedTag,as=Yr(e.modules,"transformNode"),ls=Yr(e.modules,"preTransformNode"),cs=Yr(e.modules,"postTransformNode"),ss=e.delimiters;var n,r,o=[],i=!1!==e.preserveWhitespace,s=e.whitespace,a=!1,l=!1;function c(t){if(u(t),a||t.processed||(t=Ds(t,e)),o.length||t===n||n.if&&(t.elseif||t.else)&&$s(n,{exp:t.elseif,block:t}),r&&!t.forbidden)if(t.elseif||t.else)s=t,c=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(r.children),c&&c.if&&$s(c,{exp:s.elseif,block:s});else{if(t.slotScope){var i=t.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[i]=t}r.children.push(t),t.parent=r}var s,c;t.children=t.children.filter((function(t){return!t.slotScope})),u(t),t.pre&&(a=!1),us(t.tag)&&(l=!1);for(var d=0;dl&&(a.push(i=t.slice(l,o)),s.push(JSON.stringify(i)));var c=Hr(r[1].trim());s.push("_s(".concat(c,")")),a.push({"@binding":c}),l=o+r[0].length}return l-1")+("true"===i?":(".concat(e,")"):":_q(".concat(e,",").concat(i,")"))),to(t,"change","var $$a=".concat(e,",")+"$$el=$event.target,"+"$$c=$$el.checked?(".concat(i,"):(").concat(s,");")+"if(Array.isArray($$a)){"+"var $$v=".concat(r?"_n("+o+")":o,",")+"$$i=_i($$a,$$v);"+"if($$el.checked){$$i<0&&(".concat(so(e,"$$a.concat([$$v])"),")}")+"else{$$i>-1&&(".concat(so(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))"),")}")+"}else{".concat(so(e,"$$c"),"}"),null,!0)}(t,r,o);else if("input"===i&&"radio"===s)!function(t,e,n){var r=n&&n.number,o=eo(t,"value")||"null";o=r?"_n(".concat(o,")"):o,Ur(t,"checked","_q(".concat(e,",").concat(o,")")),to(t,"change",so(e,o),null,!0)}(t,r,o);else if("input"===i||"textarea"===i)!function(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,s=o.number,a=o.trim,l=!i&&"range"!==r,c=i?"change":"range"===r?"__r":"input",u="$event.target.value";a&&(u="$event.target.value.trim()");s&&(u="_n(".concat(u,")"));var d=so(e,u);l&&(d="if($event.target.composing)return;".concat(d));Ur(t,"value","(".concat(e,")")),to(t,c,d,null,!0),(a||s)&&to(t,"blur","$forceUpdate()")}(t,r,o);else if(!F.isReservedTag(i))return io(t,r,o),!1;return!0},text:function(t,e){e.value&&Ur(t,"textContent","_s(".concat(e.value,")"),e)},html:function(t,e){e.value&&Ur(t,"innerHTML","_s(".concat(e.value,")"),e)}},Vs={expectHTML:!0,modules:zs,directives:Bs,isPreTag:function(t){return"pre"===t},isUnaryTag:Ri,mustUseProp:Xn,canBeLeftOpenTag:zi,isReservedTag:hr,getTagNamespace:fr,staticKeys:(js=zs,js.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(","))},Ws=w((function(t){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function qs(t,e){t&&(Fs=Ws(e.staticKeys||""),Ls=e.isReservedTag||E,Hs(t),Js(t,!1))}function Hs(t){if(t.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!Ls(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Fs)))}(t),1===t.type){if(!Ls(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e|^function(?:\s+[\w$]+)?\s*\(/,Ys=/\([^)]*?\);*$/,Us=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Gs={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Xs={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"]},Zs=function(t){return"if(".concat(t,")return null;")},Qs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Zs("$event.target !== $event.currentTarget"),ctrl:Zs("!$event.ctrlKey"),shift:Zs("!$event.shiftKey"),alt:Zs("!$event.altKey"),meta:Zs("!$event.metaKey"),left:Zs("'button' in $event && $event.button !== 0"),middle:Zs("'button' in $event && $event.button !== 1"),right:Zs("'button' in $event && $event.button !== 2")};function ta(t,e){var n=e?"nativeOn:":"on:",r="",o="";for(var i in t){var s=ea(t[i]);t[i]&&t[i].dynamic?o+="".concat(i,",").concat(s,","):r+='"'.concat(i,'":').concat(s,",")}return r="{".concat(r.slice(0,-1),"}"),o?n+"_d(".concat(r,",[").concat(o.slice(0,-1),"])"):n+r}function ea(t){if(!t)return"function(){}";if(Array.isArray(t))return"[".concat(t.map((function(t){return ea(t)})).join(","),"]");var e=Us.test(t.value),n=Ks.test(t.value),r=Us.test(t.value.replace(Ys,""));if(t.modifiers){var o="",i="",s=[],a=function(e){if(Qs[e])i+=Qs[e],Gs[e]&&s.push(e);else if("exact"===e){var n=t.modifiers;i+=Zs(["ctrl","shift","alt","meta"].filter((function(t){return!n[t]})).map((function(t){return"$event.".concat(t,"Key")})).join("||"))}else s.push(e)};for(var l in t.modifiers)a(l);s.length&&(o+=function(t){return"if(!$event.type.indexOf('key')&&"+"".concat(t.map(na).join("&&"),")return null;")}(s)),i&&(o+=i);var c=e?"return ".concat(t.value,".apply(null, arguments)"):n?"return (".concat(t.value,").apply(null, arguments)"):r?"return ".concat(t.value):t.value;return"function($event){".concat(o).concat(c,"}")}return e||n?t.value:"function($event){".concat(r?"return ".concat(t.value):t.value,"}")}function na(t){var e=parseInt(t,10);if(e)return"$event.keyCode!==".concat(e);var n=Gs[t],r=Xs[t];return"_k($event.keyCode,"+"".concat(JSON.stringify(t),",")+"".concat(JSON.stringify(n),",")+"$event.key,"+"".concat(JSON.stringify(r))+")"}var ra={on:function(t,e){t.wrapListeners=function(t){return"_g(".concat(t,",").concat(e.value,")")}},bind:function(t,e){t.wrapData=function(n){return"_b(".concat(n,",'").concat(t.tag,"',").concat(e.value,",").concat(e.modifiers&&e.modifiers.prop?"true":"false").concat(e.modifiers&&e.modifiers.sync?",true":"",")")}},cloak:$},oa=function(t){this.options=t,this.warn=t.warn||Kr,this.transforms=Yr(t.modules,"transformCode"),this.dataGenFns=Yr(t.modules,"genData"),this.directives=D(D({},ra),t.directives);var e=t.isReservedTag||E;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ia(t,e){var n=new oa(e),r=t?"script"===t.tag?"null":sa(t,n):'_c("div")';return{render:"with(this){return ".concat(r,"}"),staticRenderFns:n.staticRenderFns}}function sa(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return la(t,e);if(t.once&&!t.onceProcessed)return ca(t,e);if(t.for&&!t.forProcessed)return ha(t,e);if(t.if&&!t.ifProcessed)return ua(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=ga(t,e),o="_t(".concat(n).concat(r?",function(){return ".concat(r,"}"):""),i=t.attrs||t.dynamicAttrs?ba((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:S(t.name),value:t.value,dynamic:t.dynamic}}))):null,s=t.attrsMap["v-bind"];!i&&!s||r||(o+=",null");i&&(o+=",".concat(i));s&&(o+="".concat(i?"":",null",",").concat(s));return o+")"}(t,e);var n=void 0;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:ga(e,n,!0);return"_c(".concat(t,",").concat(fa(e,n)).concat(r?",".concat(r):"",")")}(t.component,t,e);else{var r=void 0;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=fa(t,e));var o=void 0,i=e.options.bindings;i&&!1!==i.__isScriptSetup&&(o=aa(i,t.tag)||aa(i,S(t.tag))||aa(i,k(S(t.tag)))),o||(o="'".concat(t.tag,"'"));var s=t.inlineTemplate?null:ga(t,e,!0);n="_c(".concat(o).concat(r?",".concat(r):"").concat(s?",".concat(s):"",")")}for(var a=0;a>>0}(s)):"",")")}(t,t.scopedSlots,e),",")),t.model&&(n+="model:{value:".concat(t.model.value,",callback:").concat(t.model.callback,",expression:").concat(t.model.expression,"},")),t.inlineTemplate){var i=function(t,e){var n=t.children[0];if(n&&1===n.type){var r=ia(n,e.options);return"inlineTemplate:{render:function(){".concat(r.render,"},staticRenderFns:[").concat(r.staticRenderFns.map((function(t){return"function(){".concat(t,"}")})).join(","),"]}")}}(t,e);i&&(n+="".concat(i,","))}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b(".concat(n,',"').concat(t.tag,'",').concat(ba(t.dynamicAttrs),")")),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function pa(t){return 1===t.type&&("slot"===t.tag||t.children.some(pa))}function ma(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return ua(t,e,ma,"null");if(t.for&&!t.forProcessed)return ha(t,e,ma);var r="_empty_"===t.slotScope?"":String(t.slotScope),o="function(".concat(r,"){")+"return ".concat("template"===t.tag?t.if&&n?"(".concat(t.if,")?").concat(ga(t,e)||"undefined",":undefined"):ga(t,e)||"undefined":sa(t,e),"}"),i=r?"":",proxy:true";return"{key:".concat(t.slotTarget||'"default"',",fn:").concat(o).concat(i,"}")}function ga(t,e,n,r,o){var i=t.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?e.maybeComponent(s)?",1":",0":"";return"".concat((r||sa)(s,e)).concat(a)}var l=n?function(t,e){for(var n=0,r=0;r':'
',_a.innerHTML.indexOf(" ")>0}var Da=!!H&&Ma(!1),Ta=!!H&&Ma(!0),$a=w((function(t){var e=gr(t);return e&&e.innerHTML})),Ea=Bn.prototype.$mount;Bn.prototype.$mount=function(t,e){if((t=t&&gr(t))===document.body||t===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=$a(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(r){var o=Ca(r,{outputSourceRange:!1,shouldDecodeNewlines:Da,shouldDecodeNewlinesForHref:Ta,delimiters:n.delimiters,comments:n.comments},this),i=o.render,s=o.staticRenderFns;n.render=i,n.staticRenderFns=s}}return Ea.call(this,t,e)},Bn.compile=Ca;var Na=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function Aa(t,e){if(void 0===e&&(e=[]),null===t||"object"!=typeof t)return t;var n,r=(n=function(e){return e.original===t},e.filter(n)[0]);if(r)return r.copy;var o=Array.isArray(t)?[]:{};return e.push({original:t,copy:o}),Object.keys(t).forEach((function(n){o[n]=Aa(t[n],e)})),o}function Pa(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function Ia(t){return null!==t&&"object"==typeof t}var Ra=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},za={namespaced:{configurable:!0}};za.namespaced.get=function(){return!!this._rawModule.namespaced},Ra.prototype.addChild=function(t,e){this._children[t]=e},Ra.prototype.removeChild=function(t){delete this._children[t]},Ra.prototype.getChild=function(t){return this._children[t]},Ra.prototype.hasChild=function(t){return t in this._children},Ra.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},Ra.prototype.forEachChild=function(t){Pa(this._children,t)},Ra.prototype.forEachGetter=function(t){this._rawModule.getters&&Pa(this._rawModule.getters,t)},Ra.prototype.forEachAction=function(t){this._rawModule.actions&&Pa(this._rawModule.actions,t)},Ra.prototype.forEachMutation=function(t){this._rawModule.mutations&&Pa(this._rawModule.mutations,t)},Object.defineProperties(Ra.prototype,za);var ja,Fa=function(t){this.register([],t,!1)};function La(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return;La(t.concat(r),e.getChild(r),n.modules[r])}}Fa.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},Fa.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")}),"")},Fa.prototype.update=function(t){La([],this.root,t)},Fa.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var o=new Ra(e,n);0===t.length?this.root=o:this.get(t.slice(0,-1)).addChild(t[t.length-1],o);e.modules&&Pa(e.modules,(function(e,o){r.register(t.concat(o),e,n)}))},Fa.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],r=e.getChild(n);r&&r.runtime&&e.removeChild(n)},Fa.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var Ba=function(t){var e=this;void 0===t&&(t={}),!ja&&"undefined"!=typeof window&&window.Vue&&Ua(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.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 Fa(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new ja,this._makeLocalGettersCache=Object.create(null);var o=this,i=this.dispatch,s=this.commit;this.dispatch=function(t,e){return i.call(o,t,e)},this.commit=function(t,e,n){return s.call(o,t,e,n)},this.strict=r;var a=this._modules.root.state;Ja(this,a,[],this._modules.root),Ha(this,a),n.forEach((function(t){return t(e)})),(void 0!==t.devtools?t.devtools:ja.config.devtools)&&function(t){Na&&(t._devtoolHook=Na,Na.emit("vuex:init",t),Na.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){Na.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){Na.emit("vuex:action",t,e)}),{prepend:!0}))}(this)},Va={state:{configurable:!0}};function Wa(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function qa(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;Ja(t,n,[],t._modules.root,!0),Ha(t,n,e)}function Ha(t,e,n){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,i={};Pa(o,(function(e,n){i[n]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var s=ja.config.silent;ja.config.silent=!0,t._vm=new ja({data:{$$state:e},computed:i}),ja.config.silent=s,t.strict&&function(t){t._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(t),r&&(n&&t._withCommit((function(){r._data.$$state=null})),ja.nextTick((function(){return r.$destroy()})))}function Ja(t,e,n,r,o){var i=!n.length,s=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[s],t._modulesNamespaceMap[s]=r),!i&&!o){var a=Ka(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit((function(){ja.set(a,l,r.state)}))}var c=r.context=function(t,e,n){var r=""===e,o={dispatch:r?t.dispatch:function(n,r,o){var i=Ya(n,r,o),s=i.payload,a=i.options,l=i.type;return a&&a.root||(l=e+l),t.dispatch(l,s)},commit:r?t.commit:function(n,r,o){var i=Ya(n,r,o),s=i.payload,a=i.options,l=i.type;a&&a.root||(l=e+l),t.commit(l,s,a)}};return Object.defineProperties(o,{getters:{get:r?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach((function(o){if(o.slice(0,r)===e){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return t.getters[o]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return Ka(t.state,n)}}}),o}(t,s,n);r.forEachMutation((function(e,n){!function(t,e,n,r){(t._mutations[e]||(t._mutations[e]=[])).push((function(e){n.call(t,r.state,e)}))}(t,s+n,e,c)})),r.forEachAction((function(e,n){var r=e.root?n:s+n,o=e.handler||e;!function(t,e,n,r){(t._actions[e]||(t._actions[e]=[])).push((function(e){var o,i=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),t._devtoolHook?i.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):i}))}(t,r,o,c)})),r.forEachGetter((function(e,n){!function(t,e,n,r){if(t._wrappedGetters[e])return;t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)}}(t,s+n,e,c)})),r.forEachChild((function(r,i){Ja(t,e,n.concat(i),r,o)}))}function Ka(t,e){return e.reduce((function(t,e){return t[e]}),t)}function Ya(t,e,n){return Ia(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function Ua(t){ja&&t===ja|| /*! * vuex v3.6.2 * (c) 2021 Evan You * @license MIT */ function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(ja=t)}Va.state.get=function(){return this._vm._data.$$state},Va.state.set=function(t){},Ba.prototype.commit=function(t,e,n){var r=this,o=Ya(t,e,n),i=o.type,s=o.payload,a={type:i,payload:s},l=this._mutations[i];l&&(this._withCommit((function(){l.forEach((function(t){t(s)}))})),this._subscribers.slice().forEach((function(t){return t(a,r.state)})))},Ba.prototype.dispatch=function(t,e){var n=this,r=Ya(t,e),o=r.type,i=r.payload,s={type:o,payload:i},a=this._actions[o];if(a){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(s,n.state)}))}catch(jy){}var l=a.length>1?Promise.all(a.map((function(t){return t(i)}))):a[0](i);return new Promise((function(t,e){l.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(s,n.state)}))}catch(jy){}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(s,n.state,t)}))}catch(jy){}e(t)}))}))}},Ba.prototype.subscribe=function(t,e){return Wa(t,this._subscribers,e)},Ba.prototype.subscribeAction=function(t,e){return Wa("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},Ba.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},Ba.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},Ba.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),Ja(this,this.state,t,this._modules.get(t),n.preserveState),Ha(this,this.state)},Ba.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=Ka(e.state,t.slice(0,-1));ja.delete(n,t[t.length-1])})),qa(this)},Ba.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},Ba.prototype.hotUpdate=function(t){this._modules.update(t),qa(this,!0)},Ba.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(Ba.prototype,Va);var Ga=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=nl(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,e,n):e[o]},n[r].vuex=!0})),n})),Xa=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var i=nl(this.$store,"mapMutations",t);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n})),Za=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;o=t+o,n[r]=function(){if(!t||nl(this.$store,"mapGetters",t))return this.$store.getters[o]},n[r].vuex=!0})),n})),Qa=el((function(t,e){var n={};return tl(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var i=nl(this.$store,"mapActions",t);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n}));function tl(t){return function(t){return Array.isArray(t)||Ia(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function el(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function nl(t,e,n){return t._modulesNamespaceMap[n]}function rl(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch(jy){t.log(e)}}function ol(t){try{t.groupEnd()}catch(jy){t.log("—— log end ——")}}function il(){var t=new Date;return" @ "+sl(t.getHours(),2)+":"+sl(t.getMinutes(),2)+":"+sl(t.getSeconds(),2)+"."+sl(t.getMilliseconds(),3)}function sl(t,e){return n="0",r=e-t.toString().length,new Array(r+1).join(n)+t;var n,r}var al={Store:Ba,install:Ua,version:"3.6.2",mapState:Ga,mapMutations:Xa,mapGetters:Za,mapActions:Qa,createNamespacedHelpers:function(t){return{mapState:Ga.bind(null,t),mapGetters:Za.bind(null,t),mapMutations:Xa.bind(null,t),mapActions:Qa.bind(null,t)}},createLogger:function(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var r=t.transformer;void 0===r&&(r=function(t){return t});var o=t.mutationTransformer;void 0===o&&(o=function(t){return t});var i=t.actionFilter;void 0===i&&(i=function(t,e){return!0});var s=t.actionTransformer;void 0===s&&(s=function(t){return t});var a=t.logMutations;void 0===a&&(a=!0);var l=t.logActions;void 0===l&&(l=!0);var c=t.logger;return void 0===c&&(c=console),function(t){var u=Aa(t.state);void 0!==c&&(a&&t.subscribe((function(t,i){var s=Aa(i);if(n(t,u,s)){var a=il(),l=o(t),d="mutation "+t.type+a;rl(c,d,e),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)),ol(c)}u=s})),l&&t.subscribeAction((function(t,n){if(i(t,n)){var r=il(),o=s(t),a="action "+t.type+r;rl(c,a,e),c.log("%c action","color: #03A9F4; font-weight: bold",o),ol(c)}})))}}};function ll(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map((function(t){t(n)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,n)}))}}}var cl,ul,dl="function"==typeof Map?new Map:(cl=[],ul=[],{has:function(t){return cl.indexOf(t)>-1},get:function(t){return ul[cl.indexOf(t)]},set:function(t,e){-1===cl.indexOf(t)&&(cl.push(t),ul.push(e))},delete:function(t){var e=cl.indexOf(t);e>-1&&(cl.splice(e,1),ul.splice(e,1))}}),hl=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(jy){hl=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!1),e}}function fl(t){var e=dl.get(t);e&&e.destroy()}function pl(t){var e=dl.get(t);e&&e.update()}var ml=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((ml=function(t){return t}).destroy=function(t){return t},ml.update=function(t){return t}):((ml=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!dl.has(t)){var e,n=null,r=null,o=null,i=function(){t.clientWidth!==r&&c()},s=function(e){window.removeEventListener("resize",i,!1),t.removeEventListener("input",c,!1),t.removeEventListener("keyup",c,!1),t.removeEventListener("autosize:destroy",s,!1),t.removeEventListener("autosize:update",c,!1),Object.keys(e).forEach((function(n){t.style[n]=e[n]})),dl.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",s,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",c,!1),window.addEventListener("resize",i,!1),t.addEventListener("input",c,!1),t.addEventListener("autosize:update",c,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",dl.set(t,{destroy:s,update:c}),"vertical"===(e=window.getComputedStyle(t,null)).resize?t.style.resize="none":"both"===e.resize&&(t.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),c()}function a(e){var n=t.style.width;t.style.width="0px",t.style.width=n,t.style.overflowY=e}function l(){if(0!==t.scrollHeight){var e=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;return e}(t),o=document.documentElement&&document.documentElement.scrollTop;t.style.height="",t.style.height=t.scrollHeight+n+"px",r=t.clientWidth,e.forEach((function(t){t.node.scrollTop=t.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function c(){l();var e=Math.round(parseFloat(t.style.height)),n=window.getComputedStyle(t,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):t.offsetHeight;if(r=e?t:""+Array(e+1-r.length).join(n)+t},y={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),o=n%60;return(e<=0?"+":"-")+v(r,2,"0")+":"+v(o,2,"0")},m:function t(e,n){if(e.date()1)return t(s[0])}else{var a=e.name;w[a]=e,o=a}return!r&&o&&(b=o),o||!r&&b},k=function(t,e){if(x(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new O(n)},_=y;_.l=S,_.i=x,_.w=function(t,e){return k(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function g(t){this.$L=S(t.locale,null,!0),this.parse(t)}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(p);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return _},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(t,e){var n=k(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return k(t)68?1900:2e3)},a=function(t){return function(e){this[t]=+e}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],c=function(t){var e=i[t];return e&&(e.indexOf?e:e.s.concat(e.f))},u=function(t,e){var n,r=i.meridiem;if(r){for(var o=1;o<=24;o+=1)if(t.indexOf(r(o,0,e))>-1){n=o>12;break}}else n=t===(e?"pm":"PM");return n},d={A:[o,function(t){this.afternoon=u(t,!1)}],a:[o,function(t){this.afternoon=u(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],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:[o,function(t){var e=i.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var r=1;r<=31;r+=1)e(r).replace(/\[|\]/g,"")===t&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[o,function(t){var e=c("months"),n=(c("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(t){var e=c("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(t){this.year=s(t)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var r,o;r=n,o=i&&i.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,r){var i=r&&r.toUpperCase();return n||o[r]||t[r]||o[i].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),a=s.length,l=0;l-1)return new Date(("X"===e?1e3:1)*t);var r=h(e)(t),o=r.year,i=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||(o||i?1:f.getDate()),m=o||f.getFullYear(),g=0;o&&!i||(g=i>0?i-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("")}}(e,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&e!=this.format(a)&&(this.$d=new Date("")),i={}}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 o.call(this,t)}}}();function Sl(t){return(Sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var kl={selector:"vue-portal-target-".concat(((t=21)=>{let e="",n=t;for(;n--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e})())},_l=function(t){return kl.selector=t},Ol="undefined"!=typeof window&&void 0!==("undefined"==typeof document?"undefined":Sl(document)),Cl=Bn.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(t){return{updatedNodes:t.nodes}},render:function(t){var e=this.updatedNodes&&this.updatedNodes();return e?1!==e.length||e[0].text?t(this.tag||"DIV",e):e:t()},destroyed:function(){var t=this.$el;t&&t.parentNode.removeChild(t)}}),Ml=Bn.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(kl.selector)}},tag:{type:String,default:"DIV"}},render:function(t){if(this.disabled){var e=this.$scopedSlots&&this.$scopedSlots.default();return e?e.length<2&&!e[0].text?e:t(this.tag,e):t()}return t()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var t=this;this.$nextTick((function(){t.disabled||t.slotFn===t.$scopedSlots.default||(t.container.updatedNodes=t.$scopedSlots.default),t.slotFn=t.$scopedSlots.default}))},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(t){t?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(Ol)return document.querySelector(this.selector)},insertTargetEl:function(){if(Ol){var t=document.querySelector("body"),e=document.createElement(this.tag);e.id=this.selector.substring(1),t.appendChild(e)}},mount:function(){if(Ol){var t=this.getTargetEl(),e=document.createElement("DIV");this.prepend&&t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e),this.container=new Cl({el:e,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function Dl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.component(e.name||"portal",Ml),e.defaultSelector&&_l(e.defaultSelector)}"undefined"!=typeof window&&window.Vue&&window.Vue===Bn&&Bn.use(Dl);var Tl={},$l={};function El(t){return null==t}function Nl(t){return null!=t}function Al(t,e){return e.tag===t.tag&&e.key===t.key}function Pl(t){var e=t.tag;t.vm=new e({data:t.args})}function Il(t,e,n){var r,o,i={};for(r=e;r<=n;++r)Nl(o=t[r].key)&&(i[o]=r);return i}function Rl(t,e,n){for(;e<=n;++e)Pl(t[e])}function zl(t,e,n){for(;e<=n;++e){var r=t[e];Nl(r)&&(r.vm.$destroy(),r.vm=null)}}function jl(t,e){t!==e&&(e.vm=t.vm,function(t){for(var e=Object.keys(t.args),n=0;na?Rl(e,s,u):s>u&&zl(t,i,a)}(t,e):Nl(e)?Rl(e,0,e.length-1):Nl(t)&&zl(t,0,t.length-1)};var Fl={};function Ll(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bl(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?a:a.$sub[0]:null}}},computed:{run:function(){var t=this,e=this.lazyParentModel();if(Array.isArray(e)&&e.__ob__){var n=e.__ob__.dep;n.depend();var r=n.constructor.target;if(!this._indirectWatcher){var o=r.constructor;this._indirectWatcher=new o(this,(function(){return t.runRule(e)}),null,{lazy:!0})}var i=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===i)return this._indirectWatcher.depend(),r.value;this._lastModel=i,this._indirectWatcher.evaluate(),this._indirectWatcher.depend()}else this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null);return this._indirectWatcher?this._indirectWatcher.value:this.runRule(e)},$params:function(){return this.run.params},proxy:function(){var t=this.run.output;return t.__isVuelidateAsyncVm?!!t.v:!!t},$pending:function(){var t=this.run.output;return!!t.__isVuelidateAsyncVm&&t.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),a=o.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:s(s({},g),{},{refProxy:function(t){return this.getRef(t).proxy},getRef:function(t){return this.refs[t]},isNested:function(t){return"function"!=typeof this.validations[t]}}),computed:s(s({},p),{},{nestedKeys:function(){return this.keys.filter(this.isNested)},ruleKeys:function(){var t=this;return this.keys.filter((function(e){return!t.isNested(e)}))},keys:function(){return Object.keys(this.validations).filter((function(t){return"$params"!==t}))},proxy:function(){var t=this,e=u(this.keys,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t.refProxy(e)}}})),n=u(v,(function(e){return{enumerable:!0,configurable:!0,get:function(){return t[e]}}})),r=u(y,(function(e){return{enumerable:!1,configurable:!0,get:function(){return t[e]}}})),o=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},s({},e))}}:{};return Object.defineProperties({},s(s(s(s({},e),o),{},{$model:{enumerable:!0,get:function(){var e=t.lazyParentModel();return null!=e?e[t.prop]:null},set:function(e){var n=t.lazyParentModel();null!=n&&(n[t.prop]=e,t.$touch())}}},n),r))},children:function(){var t=this;return[].concat(r(this.nestedKeys.map((function(e){return w(t,e)}))),r(this.ruleKeys.map((function(e){return x(t,e)})))).filter(Boolean)}})}),l=a.extend({methods:{isNested:function(t){return void 0!==this.validations[t]()},getRef:function(t){var e=this;return{get proxy(){return e.validations[t]()||!1}}}}}),m=a.extend({computed:{keys:function(){var t=this.getModel();return h(t)?Object.keys(t):[]},tracker:function(){var t=this,e=this.validations.$trackBy;return e?function(n){return"".concat(f(t.rootModel,t.getModelKey(n),e))}:function(t){return"".concat(t)}},getModelLazy:function(){var t=this;return function(){return t.getModel()}},children:function(){var t=this,n=this.validations,r=this.getModel(),o=s({},n);delete o.$trackBy;var i={};return this.keys.map((function(n){var s=t.tracker(n);return i.hasOwnProperty(s)?null:(i[s]=!0,(0,e.h)(a,s,{validations:o,prop:n,lazyParentModel:t.getModelLazy,model:r[n],rootModel:t.rootModel}))})).filter(Boolean)}},methods:{isNested:function(){return!0},getRef:function(t){return this.refs[this.tracker(t)]},hasIter:function(){return!0}}}),w=function(t,n){if("$each"===n)return(0,e.h)(m,n,{validations:t.validations[n],lazyParentModel:t.lazyParentModel,prop:n,lazyModel:t.getModel,rootModel:t.rootModel});var r=t.validations[n];if(Array.isArray(r)){var o=t.rootModel,i=u(r,(function(t){return function(){return f(o,o.$v,t)}}),(function(t){return Array.isArray(t)?t.join("."):t}));return(0,e.h)(l,n,{validations:i,lazyParentModel:c,prop:n,lazyModel:c,rootModel:o})}return(0,e.h)(a,n,{validations:r,lazyParentModel:t.getModel,prop:n,lazyModel:t.getModelKey,rootModel:t.rootModel})},x=function(t,n){return(0,e.h)(i,n,{rule:t.validations[n],lazyParentModel:t.lazyParentModel,lazyModel:t.getModel,rootModel:t.rootModel})};return b={VBase:o,Validation:a}},x=null;var S=function(t,n){var r=function(t){if(x)return x;for(var e=t.constructor;e.super;)e=e.super;return x=e,e}(t),o=w(r),i=o.Validation;return new(0,o.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(t):n;return[(0,e.h)(i,"$v",{validations:r,lazyParentModel:c,prop:"$v",model:t,rootModel:t})]}}})},k={data:function(){var t=this.$options.validations;return t&&(this._vuelidate=S(this,t)),{}},beforeCreate:function(){var t=this.$options;t.validations&&(t.computed||(t.computed={}),t.computed.$v||(t.computed.$v=function(){return this._vuelidate?this._vuelidate.refs.$v.proxy:null}))},beforeDestroy:function(){this._vuelidate&&(this._vuelidate.$destroy(),this._vuelidate=null)}};function _(t){t.mixin(k)}t.validationMixin=k;var O=_;t.default=O}(Tl);var Gl=vl(Tl);function Xl(t){this.content=t}function Zl(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=Zl(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function Ql(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t>1}},Xl.from=function(t){if(t instanceof Xl)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Xl(e)};class tc{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;nt&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);ot)for(let o=0,i=0;it&&((ie)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new tc(n,r)}cutByIndex(t,e){return t==e?tc.empty:0==t&&e==this.content.length?this:new tc(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new tc(r,o)}addToStart(t){return new tc([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new tc(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?nc(n+1,o):nc(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return tc.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new tc(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return tc.empty;let e,n=0;for(let r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),e}}oc.none=[];class ic extends Error{}class sc{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=lc(this.content,t+this.openStart,e);return n&&new sc(n,this.openStart,this.openEnd)}removeBetween(t,e){return new sc(ac(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return sc.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new sc(tc.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(let o=t.lastChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.lastChild)r++;return new sc(t,n,r)}}function ac(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(ac(i.content,e-o-1,n-o-1)))}function lc(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=lc(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function cc(t,e,n){if(n.openStart>t.depth)throw new ic("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ic("Inconsistent open depths");return uc(t,e,n,0)}function uc(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r=0;o--)r=e.node(o).copy(tc.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return mc(i,gc(t,o,s,e,r))}{let r=t.parent,o=r.content;return mc(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return mc(i,vc(t,e,r))}function dc(t,e){if(!e.type.compatibleContent(t.type))throw new ic("Cannot join "+e.type.name+" onto "+t.type.name)}function hc(t,e,n){let r=t.node(n);return dc(r,e.node(n)),r}function fc(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function pc(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(fc(t.nodeAfter,r),i++));for(let a=i;ao&&hc(t,e,o+1),s=r.depth>o&&hc(n,r,o+1),a=[];return pc(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(dc(i,s),fc(mc(i,gc(t,e,n,r,o+1)),a)):(i&&fc(mc(i,vc(t,e,o+1)),a),pc(e,n,o,a),s&&fc(mc(s,vc(n,r,o+1)),a)),pc(r,null,o,a),new tc(a)}function vc(t,e,n){let r=[];if(pc(null,t,n,r),t.depth>n){fc(mc(hc(t,e,n+1),vc(t,e,n+1)),r)}return pc(e,null,n,r),new tc(r)}sc.empty=new sc(tc.empty,0,0);class yc{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let o=0;o0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Sc(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let i=t;;){let{index:t,offset:e}=i.content.findIndex(o),s=o-e;if(n.push(i,t,r+e),!s)break;if(i=i.child(t),i.isText)break;o=s-1,r+=e+1}return new yc(e,n,o)}static resolveCached(t,e){for(let r=0;rt&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Cc(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=tc.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let a=r;at.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=tc.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}_c.prototype.text=void 0;class Oc extends _c{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Oc(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Oc(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Cc(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Mc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Dc(t,e);if(null==n.next)return Mc.empty;let r=Tc(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(Ic(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new Mc(r.indexOf(t.length-1)>-1);for(let t=0;tt.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;et.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r{let r=n+(e.validEnd?"*":" ")+" ";for(let o=0;o"+t.indexOf(e.next[o].next);return r})).join("\n")}}Mc.empty=new Mc(!0);class Dc{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Tc(t){let e=[];do{e.push($c(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function $c(t){let e=[];do{e.push(Ec(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Ec(t){let e=function(t){if(t.eat("(")){let e=Tc(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let t=n[i];t.groups.indexOf(e)>-1&&o.push(t)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Ac(t,e)}return e}function Nc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Ac(t,e){let n=Nc(t),r=n;return t.eat(",")&&(r="}"!=t.next?Nc(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Pc(t,e){return e-t}function Ic(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;en[t]=new Fc(t,e,r)));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Lc{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Bc{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=jc(r.attrs),this.excluded=null;let o=Rc(this.attrs);this.instance=o?new oc(this,o):null}create(t=null){return!t&&this.instance?this.instance:new oc(this,zc(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new Bc(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e-1}}class Vc{constructor(t){this.cached=Object.create(null),this.spec={nodes:Xl.from(t.nodes),marks:Xl.from(t.marks||{}),topNode:t.topNode},this.nodes=Fc.compile(this.spec.nodes,this),this.marks=Bc.compile(this.spec.marks,this);let e=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 t=this.nodes[n],r=t.spec.content||"",o=t.spec.marks;t.contentMatch=e[r]||(e[r]=Mc.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==o?null:o?Wc(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let n in this.marks){let t=this.marks[n],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:Wc(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Fc))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new Oc(n,n.defaultAttrs,t,oc.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return _c.fromJSON(this,t)}markFromJSON(t){return oc.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Wc(t,e){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class qc{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new Gc(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Gc(this,e,!0);return n.addAll(t,e.from,e.to),sc.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r{n(t=Zc(t)),t.mark=r}))}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach((t=>{n(t=Zc(t)),t.node=r}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new qc(t,qc.schemaRules(t)))}}const Hc={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},Jc={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Kc={ol:!0,ul:!0};function Yc(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Uc{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=oc.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(tc.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=tc.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(tc.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;ethis.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let r=0;rthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(t){let e=function(t,e){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function Xc(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Zc(t){let e={};for(let n in t)e[n]=t[n];return e}function Qc(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n{if(o.length||t.marks.length){let n=0,i=0;for(;n=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&tu.renderSpec(nu(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let c=l;cl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:i}=tu.renderSpec(t,o,n);if(s.appendChild(e),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new tu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=eu(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return eu(t.marks)}}function eu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function nu(t){return t.document||window.document}const ru=Math.pow(2,16);function ou(t){return 65535&t}class iu{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class su{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&su.empty)return su.empty}recover(t){let e=0,n=ou(t);if(!this.inverted)for(let r=0;rt)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(t<=u){let o=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:u)?null:s/3+(t-a)*ru,d=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(d|=8),new iu(o,d,i)}r+=c-l}return n?t+r:new iu(t+r,0,null)}touches(t,e){let n=0,r=ou(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;st)break;let a=this.ranges[s+o];if(t<=e+a&&s==3*r)return!0;n+=this.ranges[s+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new au;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;no&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return uu.fromReplace(t,this.from,this.to,o)}invert(){return new fu(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new hu(e.pos,n.pos,this.mark)}merge(t){return t instanceof hu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new hu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new hu(e.from,e.to,t.markFromJSON(e.mark))}}cu.jsonID("addMark",hu);class fu extends cu{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new sc(du(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return uu.fromReplace(t,this.from,this.to,n)}invert(){return new hu(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new fu(e.pos,n.pos,this.mark)}merge(t){return t instanceof fu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new fu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fu(e.from,e.to,t.markFromJSON(e.mark))}}cu.jsonID("removeMark",fu);class pu extends cu{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&gu(t,this.from,this.to)?uu.fail("Structure replace would overwrite content"):uu.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new su([this.from,this.to-this.from,this.slice.size])}invert(t){return new pu(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new pu(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof pu)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?sc.empty:new sc(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new pu(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?sc.empty:new sc(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new pu(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new pu(e.from,e.to,sc.fromJSON(t,e.slice),!!e.structure)}}cu.jsonID("replace",pu);class mu extends cu{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(gu(t,this.from,this.gapFrom)||gu(t,this.gapTo,this.to)))return uu.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return uu.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?uu.fromReplace(t,this.from,this.to,n):uu.fail("Content does not fit in gap")}getMap(){return new su([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new mu(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||rn.pos?null:new mu(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new mu(e.from,e.to,e.gapFrom,e.gapTo,sc.fromJSON(t,e.slice),e.insert,!!e.structure)}}function gu(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function vu(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function yu(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(ni;c--,u--){let t=o.node(c),e=o.index(c);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),i=r&&r[u]||t;if(i!=t&&(n=n.replaceChild(0,i.type.create(i.attrs))),!t.canReplace(e+1,t.childCount)||!i.type.validContent(n))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Su(t,e){let n=t.resolve(e),r=n.index();return o=n.nodeBefore,i=n.nodeAfter,!(!o||!i||o.isLeaf||!o.canAppend(i))&&n.parent.canReplace(r,r+1);var o,i}function ku(t,e,n=e,r=sc.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return _u(o,i,r)?new pu(e,n,r):new Ou(o,i,r).fit()}function _u(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}cu.jsonID("replaceAround",mu);class Ou{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=tc.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=tc.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new sc(o,i,s);return t>-1?new mu(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new pu(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=Du(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let i=this.depth;i>=0;i--){let n,{type:s,match:a}=this.frontier[i],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(tc.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:i,parent:r,inject:l};if(2==t&&o&&(n=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:i,parent:r,wrap:n};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Du(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new sc(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Du(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new sc(Cu(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new sc(Cu(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let p=0;p1||0==a||t.content.size)&&(u=e,c.push(Tu(t.mark(d.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?h:-1)))}let f=l==s.childCount;f||(h=-1),this.placed=Mu(this.placed,e,tc.from(c)),this.frontier[e].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;p1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e=0;n--){let{match:e,type:r}=this.frontier[n],o=$u(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Mu(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Mu(this.placed,this.depth,tc.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(tc.empty,!0);t.childCount&&(this.placed=Mu(this.placed,this.frontier.length,t))}}function Cu(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Cu(t.firstChild.content,e-1,n)))}function Mu(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Mu(t.lastChild.content,e-1,n)))}function Du(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Tu(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(tc.empty,!0)))),t.copy(r)}function $u(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;rr){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(tc.empty,!0))}return t}function Au(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(oe.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}let Pu=class extends Error{};Pu=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Pu.prototype=Object.create(Error.prototype)).constructor=Pu,Pu.prototype.name="TransformError";const Iu=Object.create(null);class Ru{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new zu(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e=0;o--){let r=e<0?Ju(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):Ju(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new qu(t.node(0))}static atStart(t){return Ju(t,t,0,0,1)||new qu(t)}static atEnd(t){return Ju(t,t,t.content.size,t.childCount,-1)||new qu(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Iu[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in Iu)throw new RangeError("Duplicate use of selection JSON ID "+t);return Iu[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Lu.between(this.$anchor,this.$head).getBookmark()}}Ru.prototype.visible=!0;class zu{constructor(t,e){this.$from=t,this.$to=e}}let ju=!1;function Fu(t){ju||t.parent.inlineContent||(ju=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Lu extends Ru{constructor(t,e=t){Fu(t),Fu(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return Ru.near(n);let r=t.resolve(e.map(this.anchor));return new Lu(r.parent.inlineContent?r:n,n)}replace(t,e=sc.empty){if(super.replace(t,e),e==sc.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Lu&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Bu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Lu(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=Ru.findFrom(e,n,!0)||Ru.findFrom(e,-n,!0);if(!t)return Ru.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(Ru.findFrom(t,-n,!0)||Ru.findFrom(t,n,!0)).$anchor).posnew qu(t)};function Ju(t,e,n,r,o,i=!1){if(e.inlineContent)return Lu.create(t,n);for(let s=r-(o>0?0:1);o>0?s=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Vu.isSelectable(r))return Vu.create(t,n-(o<0?r.nodeSize:0))}else{let e=Ju(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Ku(t,e,n){let r=t.steps.length-1;if(r{null==o&&(o=r)})),t.setSelection(Ru.near(t.doc.resolve(o),n)))}class Yu extends class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new au}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Pu(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=sc.empty){let r=ku(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new sc(tc.from(n),0,0))}delete(t,e){return this.replace(t,e,sc.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(_u(o,i,r))return t.step(new pu(e,n,r));let s=Au(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let h=o.depth,f=o.pos-1;h>0;h--,f--){let t=o.node(h).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;s.indexOf(h)>-1?a=h:o.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 t=h.firstChild;if(c.push(t),f==r.openStart)break;h=t.content}for(let h=u-1;h>=0;h--){let t=c[h].type,e=Eu(t);if(e&&o.node(l).type!=t)u=h;else if(e||!t.isTextblock)break}for(let h=r.openStart;h>=0;h--){let e=(h+u+1)%(r.openStart+1),a=c[e];if(a)for(let c=0;c=0&&(t.replace(e,n,r),!(t.steps.length>d));h--){let t=s[h];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let o=r.depth-1;o>=0;o--){let t=r.index(o);if(r.node(o).canReplaceWith(t,t,n))return r.before(o+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let t=r.indexAfter(o);if(r.node(o).canReplaceWith(t,t,n))return r.after(o+1);if(t0&&(n||r.node(e-1).canReplace(r.index(e-1),o.indexAfter(e-1))))return t.delete(r.before(e),o.after(e))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=tc.empty,d=0;for(let p=i,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=tc.from(r.node(p).copy(u)),d++):l--;let h=tc.empty,f=0;for(let p=i,m=!1;p>n;p--)m||o.after(p+1)=0;s--){if(r.size){let t=n[s].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=tc.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new mu(o,i,o,i,new sc(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),l=s.map(n+e.nodeSize,1);return t.step(new mu(a,l,a+1,l-1,new sc(tc.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new mu(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new sc(tc.from(s),0,0),1,!0))}(this,t,e,n,r),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=tc.empty,s=tc.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=tc.from(o.node(a).copy(i));let t=r&&r[c];s=tc.from(t?t.type.create(t.attrs,s):o.node(a).copy(s))}t.step(new pu(e,e,new sc(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),d=Math.min(l+t.nodeSize,n),h=r.addToSet(u);for(let t=0;tt.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof Bc){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;tt.step(new fu(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let a=0;a=0;a--)t.step(i[a])}(this,t,e,n),this}}{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return oc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||oc.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Ru.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Uu(t,e){return e&&t?t.bind(e):t}class Gu{constructor(t,e,n){this.name=t,this.init=Uu(e.init,n),this.apply=Uu(e.apply,n)}}const Xu=[new Gu("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Gu("selection",{init:(t,e)=>t.selection||Ru.atStart(e.doc),apply:t=>t.selection}),new Gu("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new Gu("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class Zu{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Xu.slice(),e&&e.forEach((t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new Gu(t.key,t.spec.state,t))}))}}class Qu{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;nt.toJSON()))),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new Zu(t.schema,t.plugins),o=new Qu(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=_c.fromJSON(t.schema,e.doc);else if("selection"==r.name)o.selection=Ru.fromJSON(o.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o[r.name]=a.fromJSON.call(s,t,e[i],o))}o[r.name]=r.init(t,o)}})),o}}function td(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=td(o,e,{})),n[r]=o}return n}class ed{constructor(t){this.spec=t,this.props={},t.props&&td(t.props,this,this.props),this.key=t.key?t.key.key:rd("plugin")}getState(t){return t[this.key]}}const nd=Object.create(null);function rd(t){return t in nd?t+"$"+ ++nd[t]:(nd[t]=0,t+"$")}class od{constructor(t="key"){this.key=rd(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const id="undefined"!=typeof navigator?navigator:null,sd="undefined"!=typeof document?document:null,ad=id&&id.userAgent||"",ld=/Edge\/(\d+)/.exec(ad),cd=/MSIE \d/.exec(ad),ud=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ad),dd=!!(cd||ud||ld),hd=cd?document.documentMode:ud?+ud[1]:ld?+ld[1]:0,fd=!dd&&/gecko\/(\d+)/i.test(ad);fd&&(/Firefox\/(\d+)/.exec(ad)||[0,0])[1];const pd=!dd&&/Chrome\/(\d+)/.exec(ad),md=!!pd,gd=pd?+pd[1]:0,vd=!dd&&!!id&&/Apple Computer/.test(id.vendor),yd=vd&&(/Mobile\/\w+/.test(ad)||!!id&&id.maxTouchPoints>2),bd=yd||!!id&&/Mac/.test(id.platform),wd=/Android \d/.test(ad),xd=!!sd&&"webkitFontSmoothing"in sd.documentElement.style,Sd=xd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,kd=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},_d=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let Od=null;const Cd=function(t,e,n){let r=Od||(Od=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},Md=function(t,e,n,r){return n&&(Td(t,e,n,r,-1)||Td(t,e,n,r,1))},Dd=/^(img|br|input|textarea|hr)$/i;function Td(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:$d(t))){let n=t.parentNode;if(!n||1!=n.nodeType||Ed(t)||Dd.test(t.nodeName)||"false"==t.contentEditable)return!1;e=kd(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?$d(t):0}}}function $d(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ed(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Nd=function(t){let e=t.isCollapsed;return e&&md&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Ad(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Pd(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Id(t,e){return"number"==typeof t?t:t[e]}function Rd(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function zd(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=_d(s)){if(1!=s.nodeType)continue;let t=s,n=t==i.body,a=n?Pd(i):Rd(t),l=0,c=0;if(e.topa.bottom-Id(r,"bottom")&&(c=e.bottom-a.bottom+Id(o,"bottom")),e.lefta.right-Id(r,"right")&&(l=e.right-a.right+Id(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=t.scrollLeft,r=t.scrollTop;c&&(t.scrollTop+=c),l&&(t.scrollLeft+=l);let o=t.scrollLeft-n,i=t.scrollTop-r;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}if(n)break}}function jd(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=_d(r));return e}function Fd(t,e){for(let n=0;n=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let t=d.left>e.left?d.left-e.left:d.right=(d.left+d.right)/2?1:0));continue}}!n&&(e.left>=d.right&&e.top>=d.top||e.left>=d.left&&e.top>=d.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:Bd(n,r)}function Vd(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Wd(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&o++}n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?i=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(i=function(t,e,n,r){let o=-1;for(let i=e;i!=t.dom;){let e=t.docView.nearestDesc(i,!0);if(!e)return null;if(e.node.isBlock&&e.parent){let t=e.dom.getBoundingClientRect();if(t.left>r.left||t.top>r.top)o=e.posBefore;else{if(!(t.right-1?o:t.docView.posFromDOM(e,n,1)}(t,n,o,e))}null==i&&(i=function(t,e,n){let{node:r,offset:o}=Bd(e,n),i=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();i=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function Hd(t,e){let n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}const Jd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Kd(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=xd||fd;if(3==r.nodeType){if(!s||!Jd.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let t=o,e=o,i=n<0?1:-1;return n<0&&!o?(e++,i=-1):n>=0&&o==r.nodeValue.length?(t--,i=1):n<0?t--:e++,Yd(Hd(Cd(r,t,e),i),i<0)}{let t=Hd(Cd(r,o,o),n);if(fd&&o&&/\s/.test(r.nodeValue[o-1])&&o=0)}if(null==i&&o&&(n<0||o==$d(r))){let t=r.childNodes[o-1],e=3==t.nodeType?Cd(t,$d(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return Yd(Hd(e,1),!1)}if(null==i&&o<$d(r)){let t=r.childNodes[o];for(;t.pmViewDesc&&t.pmViewDesc.ignoreForCoords;)t=t.nextSibling;let e=t?3==t.nodeType?Cd(t,0,s?0:1):1==t.nodeType?t:null:null;if(e)return Yd(Hd(e,-1),!0)}return Yd(Hd(3==r.nodeType?Cd(r):r,-n),n>=0)}function Yd(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ud(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Gd(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}const Xd=/[\u0590-\u08ac]/;let Zd=null,Qd=null,th=!1;function eh(t,e,n){return Zd==e&&Qd==n?th:(Zd=e,Qd=n,th="up"==n||"down"==n?function(t,e,n){let r=e.selection,o="up"==n?r.$from:r.$to;return Gd(t,e,(()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.dom;break}e=n.dom.parentNode}let r=Kd(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=Cd(t,0,t.nodeValue.length).getClientRects()}for(let t=0;to.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return Xd.test(r.parent.textContent)&&a.modify?Gd(t,e,(()=>{let e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?i:s}(t,e,n))}class nh{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;ekd(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;et||e instanceof ch){o=t-i;break}i=n}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof rh&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;t=r?this.children[r-1]:null,t&&t.dom.parentNode!=this.contentDOM;r--,n=!1);return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?kd(t.dom)+1:0}}{let t,n=!0;for(;t=r=o&&e<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,o);t=i;for(let e=s;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=kd(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;tf&&ie){let t=s;s=a,a=t}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r=n:tn){let r=n+o.border,s=i-o.border;if(t>=r&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=r||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-r,e-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?2:1;e.dirtyo?o.parent?o.parent.posBeforeChild(o):void 0:r))),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class oh extends nh{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class ih extends nh{constructor(t,e,n,r){super(t,[],n,r),this.mark=e}static create(t,e,n,r){let o=r.nodeViews[e.type.name],i=o&&o(e,r,n);return i&&i.dom||(i=tu.renderSpec(document,e.type.spec.toDOM(e,n))),new ih(t,e,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(o=Sh(o,0,t,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(e.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(e.text);else c||({dom:c,contentDOM:u}=tu.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),e.type.spec.draggable&&(c.draggable=!0));let d=c;return c=vh(c,n,e),l?s=new uh(t,e,n,r,c,u||null,d,l,o,i+1):e.isText?new lh(t,e,n,r,c,d,o):new sh(t,e,n,r,c,u||null,d,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>tc.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return 0==this.dirty&&t.eq(this.node)&&yh(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,o=t.composing?this.localCompositionInfo(t,e):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new wh(this,i&&i.node);!function(t,e,n,r){let o=e.locals(t),i=0;if(0==o.length){for(let n=0;ni;)a.push(o[s++]);let h=i+u.nodeSize;if(u.isText){let t=h;s!t.inline)):a.slice(),e.forChild(i,u),d),i=h}}(this.node,this.innerDeco,((e,o,i)=>{e.spec.marks?a.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?oc.none:this.node.child(o).marks,n,t),a.placeWidget(e,t,r)}),((e,i,l,c)=>{let u;a.syncToMarks(e.marks,n,t),a.findNodeMatch(e,i,l,c)||s&&t.state.selection.from>r&&t.state.selection.to-1&&a.updateNodeAt(e,i,l,u,t)||a.updateNextNode(e,i,l,t,c)||a.addNode(e,i,l,t,r),r+=e.nodeSize})),a.syncToMarks([],n,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),dh(this.contentDOM,this.children,t),yd&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof Lu)||ne+this.node.content.size)return null;let o=t.domSelection(),i=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=$d(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){let t=a=0&&t+e.length+a>=n)return a+t;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}(this.node.content,t,n-e,r-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let o=e;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new oh(this,o,e,r);t.input.compositionNodes.push(i),this.children=Sh(this.children,n,n+r.length,t,i)}update(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(yh(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=mh(this.dom,this.nodeDOM,ph(this.outerDeco,this.node,e),ph(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ah(t,e,n,r,o){return vh(r,e,t),new sh(void 0,t,e,n,r,r,r,o,0)}class lh extends sh{constructor(t,e,n,r,o,i,s){super(t,e,n,r,o,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),o=document.createTextNode(r.text);return new lh(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class ch extends nh{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class uh extends sh{constructor(t,e,n,r,o,i,s,a,l,c){super(t,e,n,r,o,i,s,l,c),this.spec=a}update(t,e,n,r){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(t,e,n);return o&&this.updateInner(t,e,n,r),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function dh(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i0;){let a;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof ih)){a=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n>1,i=Math.min(o,t.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=ih.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s=n||u<=e?i.push(l):(cn&&i.push(l.slice(n-c,l.size,r)))}return i}function kh(t,e=null){let n=t.domSelection(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Nd(n)){for(a=c;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Vu.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==$d(t);r||o;){if(t==n)return!0;let e=kd(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==$d(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new Vu(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!l){l=Nh(t,a,c,"pointer"==e||t.state.selection.head{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{_h(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Ch=vd||md&&gd<63;function Mh(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=rr(t,e,n)))||Lu.between(e,n,r)}function Ah(t){return(!t.editable||t.root.activeElement==t.dom)&&Ph(t)}function Ph(t){let e=t.domSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function Ih(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ru.findFrom(i,e)}function Rh(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function zh(t,e,n){let r=t.state.selection;if(!(r instanceof Lu)){if(r instanceof Vu&&r.node.isInline)return Rh(t,new Lu(e>0?r.$to:r.$from));{let n=Ih(t.state,e);return!!n&&Rh(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=Ih(t.state,e);return!!(n&&n instanceof Vu)&&Rh(t,n)}if(!(bd&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Vu.isSelectable(i)?Rh(t,new Vu(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!xd&&Rh(t,new Lu(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function jh(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Fh(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Lh(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(fd&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Fh(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(Vh(n))break;{let e=n.previousSibling;for(;e&&Fh(e);)o=n.parentNode,i=kd(e),e=e.previousSibling;if(e)n=e,r=jh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Wh(t,e,n,r):o&&Wh(t,e,o,i)}function Bh(t){let e=t.domSelection(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=jh(n);for(;;)if(r{t.state==o&&Oh(t)}),50)}function qh(t,e,n){let r=t.state.selection;if(r instanceof Lu&&!r.empty||n.indexOf("s")>-1)return!1;if(bd&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=Ih(t.state,e);if(n&&n instanceof Vu)return Rh(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof qu?Ru.near(n,e):Ru.findFrom(n,e);return!!s&&Rh(t,s)}return!1}function Hh(t,e){if(!(t.state.selection instanceof Lu))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function Jh(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Kh(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||bd&&72==n&&"c"==r?Hh(t,-1)||Lh(t):46==n||bd&&68==n&&"c"==r?Hh(t,1)||Bh(t):13==n||27==n||(37==n||bd&&66==n&&"c"==r?zh(t,-1,r)||Lh(t):39==n||bd&&70==n&&"c"==r?zh(t,1,r)||Bh(t):38==n||bd&&80==n&&"c"==r?qh(t,-1,r)||Lh(t):40==n||bd&&78==n&&"c"==r?function(t){if(!vd||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelection();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Jh(t,n,"true"),setTimeout((()=>Jh(t,n,"false")),20)}return!1}(t)||qh(t,1,r)||Bh(t):r==(bd?"m":"c")&&(66==n||73==n||89==n||90==n))}function Yh(t,e){let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||tu.fromSchema(t.state.schema),a=of(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=nf[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(t=>t(e)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Uh(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let l=e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",(t=>{e=t(e,a||r)})),a)return e?new sc(tc.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):sc.empty;let n=t.someProp("clipboardTextParser",(t=>t(e,o,r)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=tu.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(t=>{n=t(n)})),i=function(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=of().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&nf[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"")).reverse().join(""));if(r.innerHTML=t,n)for(let i=0;i0&&i.firstChild;d--)i=i.firstChild;if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||qc.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Gh.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(jy){return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let t=r.nodes[n[a]];if(!t||t.hasRequiredAttrs())break;o=tc.from(t.create(n[a+1],o)),i++,s++}return new sc(o,i,s)}(ef(s,+u[1],+u[2]),u[4]);else if(s=sc.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&Zh(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=Qh(i[i.length-1],r.length));let e=Xh(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return tc.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let n=s.content.firstChild;t{s=t(s)})),s}const Gh=/^(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 Xh(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,tc.from(t));return t}function Zh(t,e,n,r,o){if(o=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(tc.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function ef(t,e,n){return e{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>df(t,e))}))}function df(t,e){return t.someProp("handleDOMEvents",(n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function hf(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function ff(t){return{left:t.clientX,top:t.clientY}}function pf(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,(e=>s>i.depth?e(t,n,i.nodeAfter,i.before(s),o,!0):e(t,n,i.node(s),i.before(s),o,!1))))return!0;return!1}function mf(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function gf(t,e,n,r,o){return pf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Vu&&(n=o.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let t=s>i.depth?i.nodeAfter:i.node(s);if(Vu.isSelectable(t)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(mf(t,Vu.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Vu.isSelectable(r))&&(mf(t,new Vu(n),"pointer"),!0)}(t,n))}function vf(t,e,n,r){return pf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function yf(t,e,n,r){return pf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(mf(t,Lu.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let e=i>o.depth?o.nodeAfter:o.node(i),n=o.before(i);if(e.inlineContent)mf(t,Lu.create(r,n+1,n+1+e.content.size),"pointer");else{if(!Vu.isSelectable(e))continue;mf(t,Vu.create(r,n),"pointer")}return!0}}(t,n,r)}function bf(t){return Cf(t)}af.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!Sf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!wd||!md||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!yd||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Kh(t,n)?n.preventDefault():cf(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,Ad(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},af.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},af.keypress=(t,e)=>{let n=e;if(Sf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||bd&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Lu&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const wf=bd?"metaKey":"ctrlKey";sf.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=bf(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[wf]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(ff(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new xf(t,s,n,!!r)):("doubleClick"==i?vf:yf)(t,s.pos,s.inside,n)?n.preventDefault():cf(t,"pointer"))};class xf{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[wf],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Vu&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!fd||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),cf(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Oh(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(ff(t))),this.allowDefault||!e?cf(this.view,"pointer"):gf(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||vd&&this.mightDrag&&!this.mightDrag.node.isAtom||md&&!(this.view.state.selection instanceof Lu)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(mf(this.view,Ru.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):cf(this.view,"pointer")}move(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),cf(this.view,"pointer"),0==t.buttons&&this.done()}}function Sf(t,e){return!!t.composing||!!(vd&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}sf.touchdown=t=>{bf(t),cf(t,"pointer")},sf.contextmenu=t=>bf(t);const kf=wd?5e3:-1;function _f(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Cf(t)),e))}function Of(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Cf(t,e=!1){if(!(wd&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Of(t),e||t.docView&&t.docView.dirty){let e=kh(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}af.compositionstart=af.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Cf(t,!0),t.markCursor=null;else if(Cf(t),fd&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelection();for(let t=e.focusNode,n=e.focusOffset;t&&1==t.nodeType&&0!=n;){let r=n<0?t.lastChild:t.childNodes[n-1];if(!r)break;if(3==r.nodeType){e.collapse(r,r.nodeValue.length);break}t=r,n=-1}}t.input.composing=!0}_f(t,kf)},af.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,_f(t,20))};const Mf=dd&&hd<15||yd&&Sd<604;function Df(t,e,n,r){let o=Uh(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||sc.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}sf.copy=af.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Mf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Yh(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},af.paste=(t,e)=>{let n=e;if(t.composing&&!wd)return;let r=Mf?null:n.clipboardData;r&&Df(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Df(t,r.value,null,e):Df(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Tf{constructor(t,e){this.slice=t,this.move=e}}const $f=bd?"altKey":"ctrlKey";sf.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(ff(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Vu?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Vu.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Vu.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=Yh(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Mf?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Mf||n.dataTransfer.setData("text/plain",l),t.dragging=new Tf(s,!n[$f])},sf.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},af.dragover=af.dragenter=(t,e)=>e.preventDefault(),af.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(ff(n));if(!o)return;let i=t.state.doc.resolve(o.pos);if(!i)return;let s=r&&r.slice;s?t.someProp("transformPasted",(t=>{s=t(s)})):s=Uh(t,n.dataTransfer.getData(Mf?"Text":"text/plain"),Mf?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[$f]);if(t.someProp("handleDrop",(e=>e(t,n,s||sc.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),s=r.node(t),a=!1;if(1==i)a=s.canReplace(n,n,o);else{let t=s.contentMatchAt(n).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(n,n,t[0])}if(a)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}(t.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,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&&Vu.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Vu(f));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),c.setSelection(Nh(t,f,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},sf.focus=t=>{t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelection())&&Oh(t)}),20))},sf.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},sf.beforeinput=(t,e)=>{if(md&&wd&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,Ad(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in af)sf[os]=af[os];function Ef(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Nf{constructor(t,e){this.toDOM=t,this.spec=e||zf,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new If(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Nf&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ef(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Af{constructor(t,e){this.attrs=t,this.spec=e||zf}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new If(o,i,this)}valid(t,e){return e.from=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;it){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==Ff||0==t.maps.length?this:this.mapInner(t,e,0,0,n||zf)}mapInner(t,e,n,r,o){let i;for(let s=0;s{for(let s=0;sc+i)continue;let u=a[s]+i;e>=u?a[s+1]=t<=u?-2:-1:n>=o&&(l=r-n-(e-t))&&(a[s]+=l,a[s+1]+=l)}};for(let u=0;u=r.content.size){c=!0;continue}let d=n.map(t[u+1]+i,-1)-o,{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,e+1,t[u]+i+1,s);r!=Ff?(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(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i{let s,a=i+n;if(s=Vf(e,t,a)){for(r||(r=this.children.slice());oi&&e.to=t){this.children[s]==t&&(n=this.children[s+2]);break}let o=t+1,i=o+e.content.size;for(let s=0;so&&t.type instanceof Af){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;en.map(t,e,zf)));return Lf.from(n)}forChild(t,e){if(e.isLeaf)return jf.empty;let n=[];for(let r=0;rn&&i.to{let a=Vf(t,e,s+n);if(a){i=!0;let t=qf(a,e,n+s+1,r);t!=Ff&&o.push(s,s+e.nodeSize,t)}}));let s=Bf(i?Wf(t):t,-n).sort(Hf);for(let a=0;a0;)e++;t.splice(e,0,n)}function Yf(t){let e=[];return t.someProp("decorations",(n=>{let r=n(t.state);r&&r!=Ff&&e.push(r)})),t.cursorWrapper&&e.push(jf.create(t.state.doc,[t.cursorWrapper.deco])),Lf.from(e)}const Uf={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Gf=dd&&hd<=11;class Xf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Zf{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Xf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),Gf&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Uf)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;ethis.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(Ah(this.view)){if(this.suppressingSelectionUpdates)return Oh(this.view);if(dd&&hd<=11&&!this.view.state.selection.empty){let t=this.view.domSelection();if(t.focusNode&&Md(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(t){if(0==t.rangeCount)return!0;let e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let e=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Ah(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(let a=0;a1){let t=s.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t[0],n=t[1];e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(t){if(Qf)return;Qf=!0,"normal"==getComputedStyle(t.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,o,i,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||Oh(this.view),this.currentSelection.set(e))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;nDate.now()-50?t.input.lastSelectionOrigin:null,n=kh(t,e);if(n&&!t.state.selection.eq(n)){let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),t.dispatch(r)}return}let i=t.state.doc.resolve(e),s=i.sharedDepth(n);e=i.before(s+1),n=t.state.doc.resolve(n).after(s+1);let a=t.state.selection,l=function(t,e,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),c=t.domSelection(),u=c.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],Nd(c)||r.push({node:c.focusNode,offset:c.focusOffset})),md&&8===t.input.lastKeyCode)for(let g=s;g>i;g--){let t=o.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){s=g;break}if(!e||e.size)break}let d=t.state.doc,h=t.someProp("domParser")||qc.fromSchema(t.state.schema),f=d.resolve(a),p=null,m=h.parse(o,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:tp,context:f});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),p={anchor:t+a,head:e+a}}return{doc:m,sel:p,from:a,to:l}}(t,e,n);if(md&&t.cursorWrapper&&l.sel&&l.sel.anchor==t.cursorWrapper.deco.from){let e=t.cursorWrapper.deco.type.toDOM.nextSibling,n=e&&e.nodeValue?e.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let c,u,d=t.state.doc,h=d.slice(l.from,l.to);8===t.input.lastKeyCode&&Date.now()-100=s?i-r:0,a=i+(a-s),s=i}else if(a=a?i-r:0,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(h.content,l.doc.content,l.from,c,u);if((yd&&t.input.lastIOSEnter>Date.now()-225||wd)&&o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName))&&(!f||f.endA>=f.endB)&&t.someProp("handleKeyDown",(e=>e(t,Ad(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!f){if(!(r&&a instanceof Lu&&!a.empty&&a.$head.sameParent(a.$anchor))||t.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let e=np(t,t.state.doc,l.sel);e&&!e.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(e))}return}f={start:a.from,endA:a.to,endB:a.to}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&f.start<=t.state.selection.from+2&&t.state.selection.from>=l.from?f.start=t.state.selection.from:f.endA=t.state.selection.to-2&&t.state.selection.to<=l.to&&(f.endB+=t.state.selection.to-f.endA,f.endA=t.state.selection.to)),dd&&hd<=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((yd&&t.input.lastIOSEnter>Date.now()-225&&(!y||o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!y&&m.pose(t,Ad(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>f.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||rp(r,!0,!1)n||rp(s,!0,!1)e(t,Ad(8,"Backspace")))))return void(wd&&md&&t.domObserver.suppressSelectionUpdates());md&&wd&&f.endB==f.start&&(t.input.lastAndroidDelete=Date.now()),wd&&!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((()=>{t.someProp("handleKeyDown",(function(e){return e(t,Ad(13,"Enter"))}))}),20));let b,w,x,S=f.start,k=f.endA;if(y)if(m.pos==g.pos)dd&&hd<=11&&0==m.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>Oh(t)),20)),b=t.state.tr.delete(S,k),w=d.resolve(f.start).marksAcross(d.resolve(f.endA));else if(f.endA==f.endB&&(x=function(t,e){let n,r,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,l=s;for(let u=0;ut.mark(r.addToSet(t.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=t=>t.mark(r.removeFromSet(t.marks))}let c=[];for(let u=0;un(t,S,k,e))))return;b=t.state.tr.insertText(e,S,k)}if(b||(b=t.state.tr.replace(S,k,l.doc.slice(f.start-l.from,f.endB-l.from))),l.sel){let e=np(t,b.doc,l.sel);e&&!(md&&wd&&t.composing&&e.empty&&(f.start!=f.endB||t.input.lastAndroidDeletee.content.size?null:Nh(t,e.resolve(n.anchor),e.resolve(n.head))}function rp(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}class op{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new lf,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(cp),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ap(this),sp(this),this.nodeViews=lp(this),this.docView=ah(this.state.doc,ip(this),Yf(this),this.dom,this),this.domObserver=new Zf(this,((t,e,n,r)=>ep(this,t,e,n,r))),this.domObserver.start(),function(t){for(let e in sf){let n=sf[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!hf(t,e)||df(t,e)||!t.editable&&e.type in af||n(t,e)})}vd&&t.dom.addEventListener("input",(()=>null)),uf(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&uf(this),this._props=t,t.plugins&&(t.plugins.forEach(cp),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this.state.plugins!=t.plugins)}updateStateInner(t,e){let n=this.state,r=!1,o=!1;if(t.storedMarks&&this.composing&&(Of(this),o=!0),this.state=t,e){let t=lp(this);(function(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r})(t,this.nodeViews)&&(this.nodeViews=t,r=!0),uf(this)}this.editable=ap(this),sp(this);let i=Yf(this),s=ip(this),a=e?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(t.doc,s,i);!l&&t.selection.eq(n.selection)||(o=!0);let c="preserve"==a&&o&&null==this.dom.style.overflowAnchor&&function(t){let e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s=o-20){e=r,n=a.top;break}}return{refDOM:e,refTop:n,stack:jd(t.dom)}}(this);if(o){this.domObserver.stop();let e=l&&(dd||md)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(l){let n=md?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(t.doc,s,i,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ah(t.doc,s,i,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelection();return Md(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?Oh(this,e):($h(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let e=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(t.selection instanceof Vu){let n=this.docView.domAfterPos(t.selection.from);1==n.nodeType&&zd(this,n.getBoundingClientRect(),e)}else zd(this,this.coordsAtPos(t.selection.head,1),e)}else c&&function({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Fd(n,0==r?0:r-e)}(c)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;ee.ownerDocument.getSelection()),this._root=e;return t||document}posAtCoords(t){return qd(this,t)}coordsAtPos(t,e=1){return Kd(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return eh(this,e||this.state,t)}destroy(){this.docView&&(!function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Yf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){df(t,e)||!sf[e.type]||!t.editable&&e.type in af||sf[e.type](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelection(){return this.root.getSelection()}}function ip(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t&&(e.class+=" "+n[t]),"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))})),[If.node(0,t.state.doc.content.size,e)]}function sp(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:If.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ap(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function lp(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function cp(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var up={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"},dp={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"},hp="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),fp="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),pp="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),mp="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),gp="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),vp=hp&&(mp||+hp[1]<57)||pp&&mp,yp=0;yp<10;yp++)up[48+yp]=up[96+yp]=String(yp);for(yp=1;yp<=24;yp++)up[yp+111]="F"+yp;for(yp=65;yp<=90;yp++)up[yp]=String.fromCharCode(yp+32),dp[yp]=String.fromCharCode(yp);for(var bp in up)dp.hasOwnProperty(bp)||(dp[bp]=up[bp]);const wp="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function xp(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let a=0;a127)&&(r=up[n.keyCode])&&r!=o){let o=e[Sp(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[Sp(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}const Op=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Cp(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Mp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Dp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Tp(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Ru.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0};function Ep(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Su(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=tc.empty;for(let t=r.length-1;t>=0;t--)a=tc.from(r[t].create(null,a));a=tc.from(i.copy(a));let l=t.tr.step(new mu(e.pos-1,o,e.pos,o,new sc(a,1,0),r.length,!0)),c=o+2*r.length;Su(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=Ru.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&yu(c);if(null!=u&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&Cp(s,"start",!0)&&Cp(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=tc.empty;for(let t=o.length-1;t>=0;t--)r=tc.from(o[t].copy(r));n(t.tr.step(new mu(e.pos-o.length,e.pos+s.nodeSize,e.pos+l,e.pos+s.nodeSize-l,new sc(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Np(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Lu.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const Ap=Np(-1),Pp=Np(1);function Ip(t,e=null){return function(n,r){let{from:o,to:i}=n.selection,s=!1;return n.doc.nodesBetween(o,i,((r,o)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)s=!0;else{let e=n.doc.resolve(o),r=e.index();s=e.parent.canReplaceWith(r,r+1,t)}})),!!s&&(r&&r(n.tr.setBlockType(o,i,t,e).scrollIntoView()),!0)}}function Rp(t,e=null){return function(n,r){let{empty:o,$cursor:i,ranges:s}=n.selection;if(o&&!i||!function(t,e,n){for(let r=0;r{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,t))return!1;if(r)if(i)t.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{let o=!1,i=n.tr;for(let e=0;!o&&e{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;let o=Mp(r);if(!o){let n=r.blockRange(),o=n&&yu(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&Ep(t,o,e))return!0;if(0==r.parent.content.size&&(Cp(i,"end")||Vu.isSelectable(i))){let n=ku(t.doc,r.before(),r.after(),sc.empty);if(n&&n.slice.size{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Mp(r)}let s=i&&i.nodeBefore;return!(!s||!Vu.isSelectable(s))&&(e&&e(t.tr.setSelection(Vu.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)})),Fp=zp(Op,((t,e,n)=>{let{$cursor:r}=t.selection;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof qu||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Tp(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(xu(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&yu(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)}),((t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof Vu&&t.selection.node.isBlock)return!(!n.parentOffset||!xu(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(e){let o=r.parentOffset==r.parent.content.size,i=t.tr;(t.selection instanceof Lu||t.selection instanceof qu)&&i.deleteSelection();let s=0==n.depth?null:Tp(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=o&&s?[{type:s}]:void 0,l=xu(i.doc,i.mapping.map(n.pos),1,a);if(a||l||!xu(i.doc,i.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(i.split(i.mapping.map(n.pos),1,a),!o&&!n.parentOffset&&n.parent.type!=s)){let t=i.mapping.map(n.before()),e=i.doc.resolve(t);s&&n.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&i.setNodeMarkup(i.mapping.map(n.before()),s)}e(i.scrollIntoView())}return!0})),"Mod-Enter":$p,Backspace:jp,"Mod-Backspace":jp,"Shift-Backspace":jp,Delete:Fp,"Mod-Delete":Fp,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new qu(t.doc))),!0)},Bp={"Ctrl-h":Lp.Backspace,"Alt-Backspace":Lp["Mod-Backspace"],"Ctrl-d":Lp.Delete,"Ctrl-Alt-Backspace":Lp["Mod-Delete"],"Alt-Delete":Lp["Mod-Delete"],"Alt-d":Lp["Mod-Delete"],"Ctrl-a":Ap,"Ctrl-e":Pp};for(let os in Lp)Bp[os]=Lp[os];const Vp=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?Bp:Lp;class Wp{constructor(t,e){var n;this.match=t,this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){let i=n;if(e[1]){let t=e[0].lastIndexOf(e[1]);i+=e[0].slice(t+e[1].length);let n=(r+=t)-o;n>0&&(i=e[0].slice(t-n,t)+i,r=o)}return t.tr.insertText(i,r,o)}):e}}function qp({rules:t}){let e=new ed({state:{init:()=>null,apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,o,i)=>Hp(n,r,o,i,t,e),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&Hp(n,r.pos,r.pos,"",t,e)}))}}},isInputRules:!0});return e}function Hp(t,e,n,r,o,i){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e);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{let n=t.plugins;for(let r=0;r=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(o.text){let e=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,t.schema.text(o.text,e))}else n.delete(o.from,o.to);e(n)}return!0}}return!1};function Kp(t,e,n=null,r){return new Wp(t,((t,o,i,s)=>{let a=n instanceof Function?n(o):n,l=t.tr.delete(i,s),c=l.doc.resolve(i).blockRange(),u=c&&bu(c,e,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(i-1).nodeBefore;return d&&d.type==e&&Su(l.doc,i-1)&&(!r||r(o,d))&&l.join(i-1),l}))}function Yp(t,e,n=null){return new Wp(t,((t,r,o,i)=>{let s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}new Wp(/--$/,"—"),new Wp(/\.\.\.$/,"…"),new Wp(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new Wp(/"$/,"”"),new Wp(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new Wp(/'$/,"’");const Up=["ol",0],Gp=["ul",0],Xp=["li",0],Zp={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?Up:["ol",{start:t.attrs.order},0]},Qp={parseDOM:[{tag:"ul"}],toDOM:()=>Gp},tm={parseDOM:[{tag:"li"}],toDOM:()=>Xp,defining:!0};function em(t,e){let n={};for(let r in t)n[r]=t[r];for(let r in e)n[r]=e[r];return n}function nm(t,e,n){return t.append({ordered_list:em(Zp,{content:"list_item+",group:n}),bullet_list:em(Qp,{content:"list_item+",group:n}),list_item:em(tm,{content:e})})}function rm(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);l=new Sc(t,t,s.depth),s.endIndex=0;u--)i=tc.from(n[u].type.create(n[u].attrs,i));t.step(new mu(e.start-(r?2:0),e.end,e.start,e.end,new sc(i,0,0),n.length,!0));let s=0;for(let u=0;u=r.depth-3;t--)o=tc.from(r.node(t).copy(o));let s=r.indexAfter(-1){if(c>-1)return!1;t.isTextblock&&0==t.content.size&&(c=e+1)})),c>-1&&l.setSelection(Ru.near(l.doc.resolve(c))),n(l.scrollIntoView())}return!0}let a=o.pos==r.end()?s.contentMatchAt(0).defaultType:null,l=e.tr.delete(r.pos,o.pos),c=a?[null,{type:a}]:void 0;return!!xu(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0)}}function im(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!n||(r.node(i.depth-1).type==t?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);im;p--)f-=o.child(p).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?tc.empty:tc.from(o))))return!1;let d=i.pos,h=d+s.nodeSize;return r.step(new mu(d-(a?1:0),h+(l?1:0),d+1,h-1,new sc((a?tc.empty:tc.from(o.copy(tc.empty))).append(l?tc.empty:tc.from(o.copy(tc.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function sm(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,o=tc.from(r?t.create():null),s=new sc(tc.from(t.create(null,tc.from(a.type.create(null,o)))),r?3:1,0),c=i.start,u=i.end;n(e.tr.step(new mu(c-(r?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0}}var am=function(){};am.prototype.append=function(t){return t.length?(t=am.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},am.prototype.prepend=function(t){return t.length?am.from(t).append(this):this},am.prototype.appendInner=function(t){return new cm(this,t)},am.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?am.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},am.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},am.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},am.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},am.from=function(t){return t instanceof am?t:t&&t.length?new lm(t):am.empty};var lm=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(am);am.empty=new lm([]);var cm=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return to&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(am),um=am;class dm{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new hm(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new hm(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new dm(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;cpm&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new dm(s.append(o),i)}remapping(t,e){let n=new au;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new dm(this.items.append(t.map((t=>new hm(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new hm(l,i,c))}else n.push(new hm(l))}),r);let l=[];for(let d=e;d500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new hm(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new dm(um.from(r.reverse()),o)}}dm.empty=new dm(um.empty,0);class hm{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new hm(e.getMap().invert(),e,this.selection)}}}class fm{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const pm=20;function mm(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function gm(t,e){if(!t)return null;let n=[];for(let r=0;rnew fm(dm.empty,dm.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(xm);if(i)return i.historyState;n.getMeta(Sm)&&(t=new fm(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(xm))return s.getMeta(xm).redo?new fm(t.done.addTransform(n,void 0,r,wm(e)),t.undone,mm(n.mapping.maps[n.steps.length-1]),t.prevTime):new fm(t.done,t.undone.addTransform(n,void 0,r,wm(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new fm(t.done.rebased(n,o),t.undone.rebased(n,o),gm(t.prevRanges,n.mapping),t.prevTime):new fm(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),gm(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?gm(t.prevRanges,n.mapping):mm(n.mapping.maps[n.steps.length-1]);return new fm(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,wm(e)),dm.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?_m:"historyRedo"==n?Om:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const _m=(t,e)=>{let n=xm.getState(t);return!(!n||0==n.done.eventCount)&&(e&&vm(n,t,e,!1),!0)},Om=(t,e)=>{let n=xm.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&vm(n,t,e,!0),!0)};function Cm(t){let e=xm.getState(t);return e?e.done.eventCount:0}function Mm(t){let e=xm.getState(t);return e?e.undone.eventCount:0}var Dm={},Tm={},$m={},Em={};Object.defineProperty(Em,"__esModule",{value:!0}),Em.default=void 0;var Nm=Fl.withParams;Em.default=Nm,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.req=t.regex=t.ref=t.len=void 0,Object.defineProperty(t,"withParams",{enumerable:!0,get:function(){return n.default}});var e,n=(e=Em)&&e.__esModule?e:{default:e};function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=function(t){if(Array.isArray(t))return!!t.length;if(null==t)return!1;if(!1===t)return!0;if(t instanceof Date)return!isNaN(t.getTime());if("object"===r(t)){for(var e in t)return!0;return!1}return!!String(t).length};t.req=o;t.len=function(t){return Array.isArray(t)?t.length:"object"===r(t)?Object.keys(t).length:String(t).length};t.ref=function(t,e,n){return"function"==typeof t?t.call(e,n):n[t]};t.regex=function(t,e){return(0,n.default)({type:t},(function(t){return!o(t)||e.test(t)}))}}($m),Object.defineProperty(Tm,"__esModule",{value:!0}),Tm.default=void 0;var Am=(0,$m.regex)("alpha",/^[a-zA-Z]*$/);Tm.default=Am;var Pm={};Object.defineProperty(Pm,"__esModule",{value:!0}),Pm.default=void 0;var Im=(0,$m.regex)("alphaNum",/^[a-zA-Z0-9]*$/);Pm.default=Im;var Rm={};Object.defineProperty(Rm,"__esModule",{value:!0}),Rm.default=void 0;var zm=(0,$m.regex)("numeric",/^[0-9]*$/);Rm.default=zm;var jm={};Object.defineProperty(jm,"__esModule",{value:!0}),jm.default=void 0;var Fm=$m;jm.default=function(t,e){return(0,Fm.withParams)({type:"between",min:t,max:e},(function(n){return!(0,Fm.req)(n)||(!/\s/.test(n)||n instanceof Date)&&+t<=+n&&+e>=+n}))};var Lm={};Object.defineProperty(Lm,"__esModule",{value:!0}),Lm.default=void 0;var Bm=(0,$m.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);Lm.default=Bm;var Vm={};Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.default=void 0;var Wm=$m,qm=(0,Wm.withParams)({type:"ipAddress"},(function(t){if(!(0,Wm.req)(t))return!0;if("string"!=typeof t)return!1;var e=t.split(".");return 4===e.length&&e.every(Hm)}));Vm.default=qm;var Hm=function(t){if(t.length>3||0===t.length)return!1;if("0"===t[0]&&"0"!==t)return!1;if(!t.match(/^\d+$/))return!1;var e=0|+t;return e>=0&&e<=255},Jm={};Object.defineProperty(Jm,"__esModule",{value:!0}),Jm.default=void 0;var Km=$m;Jm.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,Km.withParams)({type:"macAddress"},(function(e){if(!(0,Km.req)(e))return!0;if("string"!=typeof e)return!1;var n="string"==typeof t&&""!==t?e.split(t):12===e.length||16===e.length?e.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every(Ym)}))};var Ym=function(t){return t.toLowerCase().match(/^[0-9a-f]{2}$/)},Um={};Object.defineProperty(Um,"__esModule",{value:!0}),Um.default=void 0;var Gm=$m;Um.default=function(t){return(0,Gm.withParams)({type:"maxLength",max:t},(function(e){return!(0,Gm.req)(e)||(0,Gm.len)(e)<=t}))};var Xm={};Object.defineProperty(Xm,"__esModule",{value:!0}),Xm.default=void 0;var Zm=$m;Xm.default=function(t){return(0,Zm.withParams)({type:"minLength",min:t},(function(e){return!(0,Zm.req)(e)||(0,Zm.len)(e)>=t}))};var Qm={};Object.defineProperty(Qm,"__esModule",{value:!0}),Qm.default=void 0;var tg=$m,eg=(0,tg.withParams)({type:"required"},(function(t){return(0,tg.req)("string"==typeof t?t.trim():t)}));Qm.default=eg;var ng={};Object.defineProperty(ng,"__esModule",{value:!0}),ng.default=void 0;var rg=$m;ng.default=function(t){return(0,rg.withParams)({type:"requiredIf",prop:t},(function(e,n){return!(0,rg.ref)(t,this,n)||(0,rg.req)(e)}))};var og={};Object.defineProperty(og,"__esModule",{value:!0}),og.default=void 0;var ig=$m;og.default=function(t){return(0,ig.withParams)({type:"requiredUnless",prop:t},(function(e,n){return!!(0,ig.ref)(t,this,n)||(0,ig.req)(e)}))};var sg={};Object.defineProperty(sg,"__esModule",{value:!0}),sg.default=void 0;var ag=$m;sg.default=function(t){return(0,ag.withParams)({type:"sameAs",eq:t},(function(e,n){return e===(0,ag.ref)(t,this,n)}))};var lg={};Object.defineProperty(lg,"__esModule",{value:!0}),lg.default=void 0;var cg=(0,$m.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);lg.default=cg;var ug={};Object.defineProperty(ug,"__esModule",{value:!0}),ug.default=void 0;var dg=$m;ug.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e||n.apply(t,r)}),!1)}))};var hg={};Object.defineProperty(hg,"__esModule",{value:!0}),hg.default=void 0;var fg=$m;hg.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&e.reduce((function(e,n){return e&&n.apply(t,r)}),!0)}))};var pg={};Object.defineProperty(pg,"__esModule",{value:!0}),pg.default=void 0;var mg=$m;pg.default=function(t){return(0,mg.withParams)({type:"not"},(function(e,n){return!(0,mg.req)(e)||!t.call(this,e,n)}))};var gg={};Object.defineProperty(gg,"__esModule",{value:!0}),gg.default=void 0;var vg=$m;gg.default=function(t){return(0,vg.withParams)({type:"minValue",min:t},(function(e){return!(0,vg.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e>=+t}))};var yg={};Object.defineProperty(yg,"__esModule",{value:!0}),yg.default=void 0;var bg=$m;yg.default=function(t){return(0,bg.withParams)({type:"maxValue",max:t},(function(e){return!(0,bg.req)(e)||(!/\s/.test(e)||e instanceof Date)&&+e<=+t}))};var wg={};Object.defineProperty(wg,"__esModule",{value:!0}),wg.default=void 0;var xg=(0,$m.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);wg.default=xg;var Sg={};Object.defineProperty(Sg,"__esModule",{value:!0}),Sg.default=void 0;var kg=(0,$m.regex)("decimal",/^[-]?\d*(\.\d+)?$/); /**! * Sortable 1.10.2 * @author RubaXa * @author owenm * @license MIT */ function _g(t){return(_g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Og(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cg(){return Cg=Object.assign||function(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}Sg.default=kg,function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"alpha",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"alphaNum",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"and",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"between",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"email",{enumerable:!0,get:function(){return s.default}}),t.helpers=void 0,Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"ipAddress",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"macAddress",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"maxValue",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"minValue",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"not",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"numeric",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"or",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"required",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"requiredIf",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"requiredUnless",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"url",{enumerable:!0,get:function(){return m.default}});var n=O(Tm),r=O(Pm),o=O(Rm),i=O(jm),s=O(Lm),a=O(Vm),l=O(Jm),c=O(Um),u=O(Xm),d=O(Qm),h=O(ng),f=O(og),p=O(sg),m=O(lg),g=O(ug),v=O(hg),y=O(pg),b=O(gg),w=O(yg),x=O(wg),S=O(Sg),k=function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var r=_(n);if(r&&r.has(t))return r.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var a=i?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(o,s,a):o[s]=t[s]}o.default=t,r&&r.set(t,o);return o}($m);function _(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(_=function(t){return t?n:e})(t)}function O(t){return t&&t.__esModule?t:{default:t}}t.helpers=k}(Dm);function Tg(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var $g=Tg(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Eg=Tg(/Edge/i),Ng=Tg(/firefox/i),Ag=Tg(/safari/i)&&!Tg(/chrome/i)&&!Tg(/android/i),Pg=Tg(/iP(ad|od|hone)/i),Ig=Tg(/chrome/i)&&Tg(/android/i),Rg={capture:!1,passive:!1};function zg(t,e,n){t.addEventListener(e,n,!$g&&Rg)}function jg(t,e,n){t.removeEventListener(e,n,!$g&&Rg)}function Fg(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function Lg(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Bg(t,e,n,r){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Fg(t,e):Fg(t,e))||r&&t===n)return t;if(t===n)break}while(t=Lg(t))}return null}var Vg,Wg=/\s+/g;function qg(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(Wg," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(Wg," ")}}function Hg(t,e,n){var r=t&&t.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in r||-1!==e.indexOf("webkit")||(e="-webkit-"+e),r[e]=n+("string"==typeof n?"":"px")}}function Jg(t,e){var n="";if("string"==typeof t)n=t;else do{var r=Hg(t,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function Kg(t,e,n){if(t){var r=t.getElementsByTagName(e),o=0,i=r.length;if(n)for(;o=i:o<=i))return r;if(r===Yg())break;r=ev(r,!1)}return!1}function Xg(t,e,n){for(var r=0,o=0,i=t.children;o2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,o=Dg(n,["evt"]);uv.pluginEvent.bind(ry)(t,e,Mg({dragEl:fv,parentEl:pv,ghostEl:mv,rootEl:gv,nextEl:vv,lastDownEl:yv,cloneEl:bv,cloneHidden:wv,dragStarted:Av,putSortable:Cv,activeSortable:ry.active,originalEvent:r,oldIndex:xv,oldDraggableIndex:kv,newIndex:Sv,newDraggableIndex:_v,hideGhostForTarget:Qv,unhideGhostForTarget:ty,cloneNowHidden:function(){wv=!0},cloneNowShown:function(){wv=!1},dispatchSortableEvent:function(t){hv({sortable:e,name:t,originalEvent:r})}},o))};function hv(t){!function(t){var e=t.sortable,n=t.rootEl,r=t.name,o=t.targetEl,i=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,f=t.putSortable,p=t.extraEventProperties;if(e=e||n&&n[sv]){var m,g=e.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||$g||Eg?(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=o||n,m.clone=i,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=d,m.originalEvent=h,m.pullMode=f?f.lastPutMode:void 0;var y=Mg({},p,uv.getEventProperties(r,e));for(var b in y)m[b]=y[b];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(Mg({putSortable:Cv,cloneEl:bv,targetEl:fv,rootEl:gv,oldIndex:xv,oldDraggableIndex:kv,newIndex:Sv,newDraggableIndex:_v},t))}var fv,pv,mv,gv,vv,yv,bv,wv,xv,Sv,kv,_v,Ov,Cv,Mv,Dv,Tv,$v,Ev,Nv,Av,Pv,Iv,Rv,zv,jv=!1,Fv=!1,Lv=[],Bv=!1,Vv=!1,Wv=[],qv=!1,Hv=[],Jv="undefined"!=typeof document,Kv=Pg,Yv=Eg||$g?"cssFloat":"float",Uv=Jv&&!Ig&&!Pg&&"draggable"in document.createElement("div"),Gv=function(){if(Jv){if($g)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Xv=function(t,e){var n=Hg(t),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Xg(t,0,e),i=Xg(t,1,e),s=o&&Hg(o),a=i&&Hg(i),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ug(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ug(i).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(o&&s.float&&"none"!==s.float){var u="left"===s.float?"left":"right";return!i||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return o&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=r&&"none"===n[Yv]||i&&"none"===n[Yv]&&l+c>r)?"vertical":"horizontal"},Zv=function(t){function e(t,n){return function(r,o,i,s){var a=r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(r,o,i,s),n)(r,o,i,s);var l=(n?r:o).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},r=t.group;r&&"object"==_g(r)||(r={name:r}),n.name=r.name,n.checkPull=e(r.pull,!0),n.checkPut=e(r.put),n.revertClone=r.revertClone,t.group=n},Qv=function(){!Gv&&mv&&Hg(mv,"display","none")},ty=function(){!Gv&&mv&&Hg(mv,"display","")};Jv&&document.addEventListener("click",(function(t){if(Fv)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Fv=!1,!1}),!0);var ey=function(t){if(fv){t=t.touches?t.touches[0]:t;var e=(o=t.clientX,i=t.clientY,Lv.some((function(t){if(!Zg(t)){var e=Ug(t),n=t[sv].options.emptyInsertThreshold,r=o>=e.left-n&&o<=e.right+n,a=i>=e.top-n&&i<=e.bottom+n;return n&&r&&a?s=t:void 0}})),s);if(e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[sv]._onDragOver(n)}}var o,i,s},ny=function(t){fv&&fv.parentNode[sv]._isOutsideThisEl(t.target)};function ry(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Cg({},e),t[sv]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xv(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.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!==ry.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var r in uv.initializePlugins(this,t,n),n)!(r in e)&&(e[r]=n[r]);for(var o in Zv(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&Uv,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?zg(t,"pointerdown",this._onTapStart):(zg(t,"mousedown",this._onTapStart),zg(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(zg(t,"dragover",this),zg(t,"dragenter",this)),Lv.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Cg(this,av())}function oy(t,e,n,r,o,i,s,a){var l,c,u=t[sv],d=u.options.onMove;return!window.CustomEvent||$g||Eg?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=r,l.related=o||e,l.relatedRect=i||Ug(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),d&&(c=d.call(u,l,s)),c}function iy(t){t.draggable=!1}function sy(){qv=!1}function ay(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function ly(t){return setTimeout(t,0)}function cy(t){return clearTimeout(t)}ry.prototype={constructor:ry,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Pv=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,fv):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,r=this.options,o=r.preventOnFilter,i=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=r.filter;if(function(t){Hv.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var r=e[n];r.checked&&Hv.push(r)}}(n),!fv&&!(/mousedown|pointerdown/.test(i)&&0!==t.button||r.disabled||l.isContentEditable||(a=Bg(a,r.draggable,n,!1))&&a.animated||yv===a)){if(xv=Qg(a),kv=Qg(a,r.draggable),"function"==typeof c){if(c.call(this,t,a,this))return hv({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),dv("filter",e,{evt:t}),void(o&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(r){if(r=Bg(l,r.trim(),n,!1))return hv({sortable:e,rootEl:r,name:"filter",targetEl:a,fromEl:n,toEl:n}),dv("filter",e,{evt:t}),!0}))))return void(o&&t.cancelable&&t.preventDefault());r.handle&&!Bg(l,r.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var r,o=this,i=o.el,s=o.options,a=i.ownerDocument;if(n&&!fv&&n.parentNode===i){var l=Ug(n);if(gv=i,pv=(fv=n).parentNode,vv=fv.nextSibling,yv=n,Ov=s.group,ry.dragged=fv,Mv={target:fv,clientX:(e||t).clientX,clientY:(e||t).clientY},Ev=Mv.clientX-l.left,Nv=Mv.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,fv.style["will-change"]="all",r=function(){dv("delayEnded",o,{evt:t}),ry.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!Ng&&o.nativeDraggable&&(fv.draggable=!0),o._triggerDragStart(t,e),hv({sortable:o,name:"choose",originalEvent:t}),qg(fv,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Kg(fv,t.trim(),iy)})),zg(a,"dragover",ey),zg(a,"mousemove",ey),zg(a,"touchmove",ey),zg(a,"mouseup",o._onDrop),zg(a,"touchend",o._onDrop),zg(a,"touchcancel",o._onDrop),Ng&&this.nativeDraggable&&(this.options.touchStartThreshold=4,fv.draggable=!0),dv("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Eg||$g))r();else{if(ry.eventCanceled)return void this._onDrop();zg(a,"mouseup",o._disableDelayedDrag),zg(a,"touchend",o._disableDelayedDrag),zg(a,"touchcancel",o._disableDelayedDrag),zg(a,"mousemove",o._delayedDragTouchMoveHandler),zg(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&zg(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){fv&&iy(fv),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;jg(t,"mouseup",this._disableDelayedDrag),jg(t,"touchend",this._disableDelayedDrag),jg(t,"touchcancel",this._disableDelayedDrag),jg(t,"mousemove",this._delayedDragTouchMoveHandler),jg(t,"touchmove",this._delayedDragTouchMoveHandler),jg(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?zg(document,"pointermove",this._onTouchMove):zg(document,e?"touchmove":"mousemove",this._onTouchMove):(zg(fv,"dragend",this),zg(gv,"dragstart",this._onDragStart));try{document.selection?ly((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(jv=!1,gv&&fv){dv("dragStarted",this,{evt:e}),this.nativeDraggable&&zg(document,"dragover",ny);var n=this.options;!t&&qg(fv,n.dragClass,!1),qg(fv,n.ghostClass,!0),ry.active=this,t&&this._appendGhost(),hv({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Dv){this._lastX=Dv.clientX,this._lastY=Dv.clientY,Qv();for(var t=document.elementFromPoint(Dv.clientX,Dv.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Dv.clientX,Dv.clientY))!==e;)e=t;if(fv.parentNode[sv]._isOutsideThisEl(t),e)do{if(e[sv]){if(e[sv]._onDragOver({clientX:Dv.clientX,clientY:Dv.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);ty()}},_onTouchMove:function(t){if(Mv){var e=this.options,n=e.fallbackTolerance,r=e.fallbackOffset,o=t.touches?t.touches[0]:t,i=mv&&Jg(mv,!0),s=mv&&i&&i.a,a=mv&&i&&i.d,l=Kv&&zv&&tv(zv),c=(o.clientX-Mv.clientX+r.x)/(s||1)+(l?l[0]-Wv[0]:0)/(s||1),u=(o.clientY-Mv.clientY+r.y)/(a||1)+(l?l[1]-Wv[1]:0)/(a||1);if(!ry.active&&!jv){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))r.right+o||t.clientX<=r.right&&t.clientY>r.bottom&&t.clientX>=r.left:t.clientX>r.right&&t.clientY>r.top||t.clientX<=r.right&&t.clientY>r.bottom+o}(t,o,this)&&!m.animated){if(m===fv)return $(!1);if(m&&i===t.target&&(s=m),s&&(n=Ug(s)),!1!==oy(gv,i,fv,e,s,n,t,!!s))return T(),i.appendChild(fv),pv=i,E(),$(!0)}else if(s.parentNode===i){n=Ug(s);var g,v,y,b=fv.parentNode!==i,w=!function(t,e,n){var r=n?t.left:t.top,o=n?t.right:t.bottom,i=n?t.width:t.height,s=n?e.left:e.top,a=n?e.right:e.bottom,l=n?e.width:e.height;return r===s||o===a||r+i/2===s+l/2}(fv.animated&&fv.toRect||e,s.animated&&s.toRect||n,o),x=o?"top":"left",S=Gg(s,"top","top")||Gg(fv,"top","top"),k=S?S.scrollTop:void 0;if(Pv!==s&&(v=n[x],Bv=!1,Vv=!w&&a.invertSwap||b),g=function(t,e,n,r,o,i,s,a){var l=r?t.clientY:t.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&&Rvu+c*i/2:ld-Rv)return-Iv}else if(l>u+c*(1-o)/2&&ld-c*i/2))return l>u+c/2?1:-1;return 0}(t,s,n,o,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Vv,Pv===s),0!==g){var _=Qg(fv);do{_-=g,y=pv.children[_]}while(y&&("none"===Hg(y,"display")||y===mv))}if(0===g||y===s)return $(!1);Pv=s,Iv=g;var O=s.nextElementSibling,C=!1,M=oy(gv,i,fv,e,s,n,t,C=1===g);if(!1!==M)return 1!==M&&-1!==M||(C=1===M),qv=!0,setTimeout(sy,30),T(),C&&!O?i.appendChild(fv):s.parentNode.insertBefore(fv,C?O:s),S&&ov(S,0,k-S.scrollTop),pv=fv.parentNode,void 0===v||Vv||(Rv=Math.abs(v-Ug(s)[x])),E(),$(!0)}if(i.contains(fv))return $(!1)}return!1}function D(a,l){dv(a,f,Mg({evt:t,isOwner:u,axis:o?"vertical":"horizontal",revert:r,dragRect:e,targetRect:n,canSort:d,fromSortable:h,target:s,completed:$,onMove:function(n,r){return oy(gv,i,fv,e,n,Ug(n),t,r)},changed:E},l))}function T(){D("dragOverAnimationCapture"),f.captureAnimationState(),f!==h&&h.captureAnimationState()}function $(e){return D("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(f),f!==h&&(qg(fv,Cv?Cv.options.ghostClass:c.options.ghostClass,!1),qg(fv,a.ghostClass,!0)),Cv!==f&&f!==ry.active?Cv=f:f===ry.active&&Cv&&(Cv=null),h===f&&(f._ignoreWhileAnimating=s),f.animateAll((function(){D("dragOverAnimationComplete"),f._ignoreWhileAnimating=null})),f!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===fv&&!fv.animated||s===i&&!s.animated)&&(Pv=null),a.dragoverBubble||t.rootEl||s===document||(fv.parentNode[sv]._isOutsideThisEl(t.target),!e&&ey(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function E(){Sv=Qg(fv),_v=Qg(fv,a.draggable),hv({sortable:f,name:"change",toEl:i,newIndex:Sv,newDraggableIndex:_v,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){jg(document,"mousemove",this._onTouchMove),jg(document,"touchmove",this._onTouchMove),jg(document,"pointermove",this._onTouchMove),jg(document,"dragover",ey),jg(document,"mousemove",ey),jg(document,"touchmove",ey)},_offUpEvents:function(){var t=this.el.ownerDocument;jg(t,"mouseup",this._onDrop),jg(t,"touchend",this._onDrop),jg(t,"pointerup",this._onDrop),jg(t,"touchcancel",this._onDrop),jg(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Sv=Qg(fv),_v=Qg(fv,n.draggable),dv("drop",this,{evt:t}),pv=fv&&fv.parentNode,Sv=Qg(fv),_v=Qg(fv,n.draggable),ry.eventCanceled||(jv=!1,Vv=!1,Bv=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),cy(this.cloneId),cy(this._dragStartId),this.nativeDraggable&&(jg(document,"drop",this),jg(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ag&&Hg(document.body,"user-select",""),Hg(fv,"transform",""),t&&(Av&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),mv&&mv.parentNode&&mv.parentNode.removeChild(mv),(gv===pv||Cv&&"clone"!==Cv.lastPutMode)&&bv&&bv.parentNode&&bv.parentNode.removeChild(bv),fv&&(this.nativeDraggable&&jg(fv,"dragend",this),iy(fv),fv.style["will-change"]="",Av&&!jv&&qg(fv,Cv?Cv.options.ghostClass:this.options.ghostClass,!1),qg(fv,this.options.chosenClass,!1),hv({sortable:this,name:"unchoose",toEl:pv,newIndex:null,newDraggableIndex:null,originalEvent:t}),gv!==pv?(Sv>=0&&(hv({rootEl:pv,name:"add",toEl:pv,fromEl:gv,originalEvent:t}),hv({sortable:this,name:"remove",toEl:pv,originalEvent:t}),hv({rootEl:pv,name:"sort",toEl:pv,fromEl:gv,originalEvent:t}),hv({sortable:this,name:"sort",toEl:pv,originalEvent:t})),Cv&&Cv.save()):Sv!==xv&&Sv>=0&&(hv({sortable:this,name:"update",toEl:pv,originalEvent:t}),hv({sortable:this,name:"sort",toEl:pv,originalEvent:t})),ry.active&&(null!=Sv&&-1!==Sv||(Sv=xv,_v=kv),hv({sortable:this,name:"end",toEl:pv,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){dv("nulling",this),gv=fv=pv=mv=vv=bv=yv=wv=Mv=Dv=Av=Sv=_v=xv=kv=Pv=Iv=Cv=Ov=ry.dragged=ry.ghost=ry.clone=ry.active=null,Hv.forEach((function(t){t.checked=!0})),Hv.length=Tv=$v=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":fv&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,r=0,o=n.length,i=this.options;rt.replace(Oy,((t,e)=>e?e.toUpperCase():""))));function My(t){null!==t.parentElement&&t.parentElement.removeChild(t)}function Dy(t,e,n){const r=0===n?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,r)}function Ty(t,e){this.$nextTick((()=>this.$emit(t.toLowerCase(),e)))}function $y(t){return e=>{null!==this.realList&&this["onDrag"+t](e),Ty.call(this,t,e)}}function Ey(t){return["transition-group","TransitionGroup"].includes(t)}function Ny(t,e,n){return t[n]||(e[n]?e[n]():void 0)}const Ay=["Start","Add","Remove","Update","End"],Py=["Choose","Unchoose","Sort","Filter","Clone"],Iy=["Move",...Ay,...Py].map((t=>"on"+t));var Ry=null;const zy={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:t=>t},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(t){const e=this.$slots.default;this.transitionMode=function(t){if(!t||1!==t.length)return!1;const[{componentOptions:e}]=t;return!!e&&Ey(e.tag)}(e);const{children:n,headerOffset:r,footerOffset:o}=function(t,e,n){let r=0,o=0;const i=Ny(e,n,"header");i&&(r=i.length,t=t?[...i,...t]:[...i]);const s=Ny(e,n,"footer");return s&&(o=s.length,t=t?[...t,...s]:[...s]),{children:t,headerOffset:r,footerOffset:o}}(e,this.$slots,this.$scopedSlots);this.headerOffset=r,this.footerOffset=o;const i=function(t,e){let n=null;const r=(t,e)=>{n=function(t,e,n){return void 0===n||((t=t||{})[e]=n),t}(n,t,e)};if(r("attrs",Object.keys(t).filter((t=>"id"===t||t.startsWith("data-"))).reduce(((e,n)=>(e[n]=t[n],e)),{})),!e)return n;const{on:o,props:i,attrs:s}=e;return r("on",o),r("props",i),Object.assign(n.attrs,s),n}(this.$attrs,this.componentData);return t(this.getTag(),i,n)},created(){null!==this.list&&null!==this.value&&_y.error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&_y.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&&_y.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 t={};Ay.forEach((e=>{t["on"+e]=$y.call(this,e)})),Py.forEach((e=>{t["on"+e]=Ty.bind(this,e)}));const e=Object.keys(this.$attrs).reduce(((t,e)=>(t[Cy(e)]=this.$attrs[e],t)),{}),n=Object.assign({},this.options,e,t,{onMove:(t,e)=>this.onDragMove(t,e)});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new ry(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(t){this.updateOptions(t)},deep:!0},$attrs:{handler(t){this.updateOptions(t)},deep:!0},realList(){this.computeIndexes()}},methods:{getIsFunctional(){const{fnOptions:t}=this._vnode;return t&&t.functional},getTag(){return this.tag||this.element},updateOptions(t){for(var e in t){const n=Cy(e);-1===Iy.indexOf(n)&&this._sortable.option(n,t[e])}},getChildrenNodes(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;const t=this.$slots.default;return this.transitionMode?t[0].child.$slots.default:t},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=function(t,e,n,r){if(!t)return[];const o=t.map((t=>t.elm)),i=e.length-r,s=[...e].map(((t,e)=>e>=i?o.length:o.indexOf(t)));return n?s.filter((t=>-1!==t)):s}(this.getChildrenNodes(),this.rootContainer.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(t){const e=function(t,e){return t.map((t=>t.elm)).indexOf(e)}(this.getChildrenNodes()||[],t);if(-1===e)return null;return{index:e,element:this.realList[e]}},getUnderlyingPotencialDraggableComponent:({__vue__:t})=>t&&t.$options&&Ey(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t,emitChanges(t){this.$nextTick((()=>{this.$emit("change",t)}))},alterList(t){if(this.list)return void t(this.list);const e=[...this.value];t(e),this.$emit("input",e)},spliceList(){this.alterList((t=>t.splice(...arguments)))},updatePosition(t,e){this.alterList((n=>n.splice(e,0,n.splice(t,1)[0])))},getRelatedContextFromMoveEvent({to:t,related:e}){const n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};const r=n.realList,o={list:r,component:n};if(t!==e&&r&&n.getUnderlyingVm){const t=n.getUnderlyingVm(e);if(t)return Object.assign(t,o)}return o},getVmIndex(t){const e=this.visibleIndexes,n=e.length;return t>n-1?n:e[t]},getComponent(){return this.$slots.default[0].componentInstance},resetTransitionData(t){if(!this.noTransitionOnDrag||!this.transitionMode)return;this.getChildrenNodes()[t].data=null;const e=this.getComponent();e.children=[],e.kept=void 0},onDragStart(t){this.context=this.getUnderlyingVm(t.item),t.item._underlying_vm_=this.clone(this.context.element),Ry=t.item},onDragAdd(t){const e=t.item._underlying_vm_;if(void 0===e)return;My(t.item);const n=this.getVmIndex(t.newIndex);this.spliceList(n,0,e),this.computeIndexes();const r={element:e,newIndex:n};this.emitChanges({added:r})},onDragRemove(t){if(Dy(this.rootContainer,t.item,t.oldIndex),"clone"===t.pullMode)return void My(t.clone);const e=this.context.index;this.spliceList(e,1);const n={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:n})},onDragUpdate(t){My(t.item),Dy(t.from,t.item,t.oldIndex);const e=this.context.index,n=this.getVmIndex(t.newIndex);this.updatePosition(e,n);const r={element:this.context.element,oldIndex:e,newIndex:n};this.emitChanges({moved:r})},updateProperty(t,e){t.hasOwnProperty(e)&&(t[e]+=this.headerOffset)},computeFutureIndex(t,e){if(!t.element)return 0;const n=[...e.to.children].filter((t=>"none"!==t.style.display)),r=n.indexOf(e.related),o=t.component.getVmIndex(r);return-1!==n.indexOf(Ry)||!e.willInsertAfter?o:o+1},onDragMove(t,e){const n=this.move;if(!n||!this.realList)return!0;const r=this.getRelatedContextFromMoveEvent(t),o=this.context,i=this.computeFutureIndex(r,t);Object.assign(o,{futureIndex:i});return n(Object.assign({},t,{relatedContext:r,draggedContext:o}),e)},onDragEnd(){this.computeIndexes(),Ry=null}}};"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("draggable",zy);export{Mm as A,km as B,Dm as C,qc as D,Qu as E,tc as F,zy as G,Dl as H,Wp as I,Gl as J,Vu as N,ed as P,sc as S,Lu as T,Bn as V,al as a,gl as b,xl as c,bl as d,zp as e,$p as f,Kp as g,Yp as h,nm as i,om as j,sm as k,im as l,ll as m,kp as n,Vc as o,qp as p,op as q,tu as r,Ip as s,Rp as t,Jp as u,Vp as v,rm as w,_m as x,Om as y,Cm as z};