/*! For license information please see application-17c8ec1abff8d9ee68fc.js.LICENSE.txt */ !function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/packs/",n(n.s=485)}([function(t,e,n){var r=n(2),i=n(14).f,o=n(17),a=n(15),s=n(88),u=n(120),c=n(59);t.exports=function(t,e){var n,l,h,f,d,p=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[p]||s(p,{}):(r[p]||{}).prototype)for(l in e){if(f=e[l],h=t.noTargetGet?(d=i(n,l))&&d.value:n[l],!c(v?l:p+(m?".":"#")+l,t.forced)&&void 0!==h){if(typeof f===typeof h)continue;u(f,h)}(t.sham||h&&h.sham)&&o(f,"sham",!0),a(n,l,f,t)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n(50))},function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},function(t,e,n){var r=n(3);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var r=n(1);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){"use strict";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 i=Object.prototype.hasOwnProperty;function o(t,e){return i.call(t,e)}function a(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!==(65535&t)&&65534!==(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function s(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(u.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,h=n(167);var f=/[&<>"]/,d=/[&<>"]/g,p={"&":"&","<":"<",">":">",'"':"""};function v(t){return p[t]}var m=/[.?*+^$[\]\\(){}|-]/g;var g=n(114);e.lib={},e.lib.mdurl=n(168),e.lib.ucmicro=n(425),e.assign=function(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){if(e){if("object"!==r(e))throw new TypeError(e+"must be object");Object.keys(e).forEach((function(n){t[n]=e[n]}))}})),t},e.isString=function(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=o,e.unescapeMd=function(t){return t.indexOf("\\")<0?t:t.replace(u,"$1")},e.unescapeAll=function(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(c,(function(t,e,n){return e||function(t,e){var n=0;return o(h,e)?h[e]:35===e.charCodeAt(0)&&l.test(e)&&a(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?s(n):t}(t,n)}))},e.isValidEntityCode=a,e.fromCodePoint=s,e.escapeHtml=function(t){return f.test(t)?t.replace(d,v):t},e.arrayReplaceAt=function(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},e.isMdAsciiPunct=function(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(m,"\\$&")},e.normalizeReference=function(t){return t=t.trim().replace(/\s+/g," "),"\u1e7e"==="\u1e9e".toLowerCase()&&(t=t.replace(/\u1e9e/g,"\xdf")),t.toLowerCase().toUpperCase()}},function(t,e,n){var r=n(2),i=n(91),o=n(12),a=n(56),s=n(95),u=n(123),c=i("wks"),l=r.Symbol,h=u?l:l&&l.withoutSetter||a;t.exports=function(t){return o(c,t)||(s&&o(l,t)?c[t]=l[t]:c[t]=h("Symbol."+t)),c[t]}},function(t,e,n){"use strict";var r,i=n(102),o=n(5),a=n(2),s=n(3),u=n(12),c=n(67),l=n(17),h=n(15),f=n(10).f,d=n(29),p=n(48),v=n(7),m=n(56),g=a.Int8Array,y=g&&g.prototype,b=a.Uint8ClampedArray,w=b&&b.prototype,_=g&&d(g),x=y&&d(y),k=Object.prototype,S=k.isPrototypeOf,C=v("toStringTag"),M=m("TYPED_ARRAY_TAG"),E=i&&!!p&&"Opera"!==c(a.opera),T=!1,A={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},O={BigInt64Array:8,BigUint64Array:8},D=function(t){if(!s(t))return!1;var e=c(t);return u(A,e)||u(O,e)};for(r in A)a[r]||(E=!1);if((!E||"function"!=typeof _||_===Function.prototype)&&(_=function(){throw TypeError("Incorrect invocation")},E))for(r in A)a[r]&&p(a[r],_);if((!E||!x||x===k)&&(x=_.prototype,E))for(r in A)a[r]&&p(a[r].prototype,x);if(E&&d(w)!==x&&p(w,x),o&&!u(x,C))for(r in T=!0,f(x,C,{get:function(){return s(this)?this[M]:void 0}}),A)a[r]&&l(a[r],M,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:E,TYPED_ARRAY_TAG:T&&M,aTypedArray:function(t){if(D(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(p){if(S.call(_,t))return t}else for(var e in A)if(u(A,r)){var n=a[e];if(n&&(t===n||S.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n){if(o){if(n)for(var r in A){var i=a[r];i&&u(i.prototype,t)&&delete i.prototype[t]}x[t]&&!n||h(x,t,n?e:E&&y[t]||e)}},exportTypedArrayStaticMethod:function(t,e,n){var r,i;if(o){if(p){if(n)for(r in A)(i=a[r])&&u(i,t)&&delete i[t];if(_[t]&&!n)return;try{return h(_,t,n?e:E&&g[t]||e)}catch(s){}}for(r in A)!(i=a[r])||i[t]&&!n||h(i,t,e)}},isView:function(t){if(!s(t))return!1;var e=c(t);return"DataView"===e||u(A,e)||u(O,e)},isTypedArray:D,TypedArray:_,TypedArrayPrototype:x}},function(t,e,n){var r=n(24),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(5),i=n(118),o=n(4),a=n(27),s=Object.defineProperty;e.f=r?s:function(t,e,n){if(o(t),e=a(e,!0),o(n),i)try{return s(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(16);t.exports=function(t){return Object(r(t))}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(39),i=n(55),o=n(11),a=n(9),s=n(61),u=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,l=4==t,h=6==t,f=7==t,d=5==t||h;return function(p,v,m,g){for(var y,b,w=o(p),_=i(w),x=r(v,m,3),k=a(_.length),S=0,C=g||s,M=e?C(p,k):n||f?C(p,0):void 0;k>S;S++)if((d||S in _)&&(b=x(y=_[S],S,w),t))if(e)M[S]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return S;case 2:u.call(M,y)}else switch(t){case 4:return!1;case 7:u.call(M,y)}return h?-1:c||l?l:M}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},function(t,e,n){var r=n(5),i=n(70),o=n(36),a=n(19),s=n(27),u=n(12),c=n(118),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=a(t),e=s(e,!0),c)try{return l(t,e)}catch(n){}if(u(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){var r=n(2),i=n(17),o=n(12),a=n(88),s=n(89),u=n(20),c=u.get,l=u.enforce,h=String(String).split("String");(t.exports=function(t,e,n,s){var u,c=!!s&&!!s.unsafe,f=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||i(n,"name",e),(u=l(n)).source||(u.source=h.join("string"==typeof e?e:""))),t!==r?(c?!d&&t[e]&&(f=!0):delete t[e],f?t[e]=n:i(t,e,n)):f?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(5),i=n(10),o=n(36);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(5),i=n(1),o=n(12),a=Object.defineProperty,s={},u=function(t){throw t};t.exports=function(t,e){if(o(s,t))return s[t];e||(e={});var n=[][t],c=!!o(e,"ACCESSORS")&&e.ACCESSORS,l=o(e,0)?e[0]:u,h=o(e,1)?e[1]:void 0;return s[t]=!!n&&!i((function(){if(c&&!r)return!0;var t={length:-1};c?a(t,1,{enumerable:!0,get:u}):t[1]=1,n.call(t,l,h)}))}},function(t,e,n){var r=n(55),i=n(16);t.exports=function(t){return r(i(t))}},function(t,e,n){var r,i,o,a=n(119),s=n(2),u=n(3),c=n(17),l=n(12),h=n(90),f=n(71),d=n(57),p=s.WeakMap;if(a){var v=h.state||(h.state=new p),m=v.get,g=v.has,y=v.set;r=function(t,e){return e.facade=t,y.call(v,t,e),e},i=function(t){return m.call(v,t)||{}},o=function(t){return g.call(v,t)}}else{var b=f("state");d[b]=!0,r=function(t,e){return e.facade=t,c(t,b,e),e},i=function(t){return l(t,b)?t[b]:{}},o=function(t){return l(t,b)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(121),i=n(12),o=n(126),a=n(10).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},function(t,e,n){var r=n(16),i=/"/g;t.exports=function(t,e,n,o){var a=String(r(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(o).replace(i,""")+'"'),s+">"+a+""}},function(t,e,n){var r=n(1);t.exports=function(t){return r((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r,i,o,a;function s(t){return(s="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)}a=function(t){"use strict";function e(t){var e,n,r,i;for(n=1,r=arguments.length;n0?Math.floor(t):Math.ceil(t)};function N(t,e,n){return t instanceof D?t:g(t)?new D(t[0],t[1]):void 0===t||null===t?t:"object"===s(t)&&"x"in t&&"y"in t?new D(t.x,t.y):new D(t,e,n)}function R(t,e){if(t)for(var n=e?[t,e]:t,r=0,i=n.length;r=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=I(t);var e=this.min,n=this.max,r=t.min,i=t.max,o=i.x>=e.x&&r.x<=n.x,a=i.y>=e.y&&r.y<=n.y;return o&&a},overlaps:function(t){t=I(t);var e=this.min,n=this.max,r=t.min,i=t.max,o=i.x>e.x&&r.xe.y&&r.y=r.lat&&n.lat<=i.lat&&e.lng>=r.lng&&n.lng<=i.lng},intersects:function(t){t=B(t);var e=this._southWest,n=this._northEast,r=t.getSouthWest(),i=t.getNorthEast(),o=i.lat>=e.lat&&r.lat<=n.lat,a=i.lng>=e.lng&&r.lng<=n.lng;return o&&a},overlaps:function(t){t=B(t);var e=this._southWest,n=this._northEast,r=t.getSouthWest(),i=t.getNorthEast(),o=i.lat>e.lat&&r.late.lng&&r.lng1,Et=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(n){}return t}(),Tt=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!K("svg").createSVGRect),Ot=!At&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"===s(e.adj)}catch(n){return!1}}();function Dt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Pt={ie:Q,ielt9:tt,edge:et,webkit:nt,android:rt,android23:it,androidStock:at,opera:st,chrome:ut,gecko:ct,safari:lt,phantom:ht,opera12:ft,win:dt,ie3d:pt,webkit3d:vt,gecko3d:mt,any3d:gt,mobile:yt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:_t,pointer:xt,touch:kt,mobileOpera:St,mobileGecko:Ct,retina:Mt,passiveEvents:Et,canvas:Tt,svg:At,vml:Ot},Lt=_t?"MSPointerDown":"pointerdown",Nt=_t?"MSPointerMove":"pointermove",Rt=_t?"MSPointerUp":"pointerup",It=_t?"MSPointerCancel":"pointercancel",zt={},Bt=!1;function jt(t,e,n,i){return"touchstart"===e?function(t,e,n){var i=r((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Ie(t),Vt(t,e)}));t["_leaflet_touchstart"+n]=i,t.addEventListener(Lt,i,!1),Bt||(document.addEventListener(Lt,Ft,!0),document.addEventListener(Nt,qt,!0),document.addEventListener(Rt,$t,!0),document.addEventListener(It,$t,!0),Bt=!0)}(t,n,i):"touchmove"===e?function(t,e,n){var r=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Vt(t,e)};t["_leaflet_touchmove"+n]=r,t.addEventListener(Nt,r,!1)}(t,n,i):"touchend"===e&&function(t,e,n){var r=function(t){Vt(t,e)};t["_leaflet_touchend"+n]=r,t.addEventListener(Rt,r,!1),t.addEventListener(It,r,!1)}(t,n,i),this}function Ft(t){zt[t.pointerId]=t}function qt(t){zt[t.pointerId]&&(zt[t.pointerId]=t)}function $t(t){delete zt[t.pointerId]}function Vt(t,e){for(var n in t.touches=[],zt)t.touches.push(zt[n]);t.changedTouches=[t],e(t)}var Ut,Ht,Wt,Zt,Jt,Yt=_t?"MSPointerDown":xt?"pointerdown":"touchstart",Kt=_t?"MSPointerUp":xt?"pointerup":"touchend",Gt="_leaflet_",Xt=pe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Qt=pe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),te="webkitTransition"===Qt||"OTransition"===Qt?Qt+"End":"transitionend";function ee(t){return"string"===typeof t?document.getElementById(t):t}function ne(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return"auto"===n?null:n}function re(t,e,n){var r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r}function ie(t){var e=t.parentNode;e&&e.removeChild(t)}function oe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ae(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function se(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ue(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=fe(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function ce(t,e){if(void 0!==t.classList)for(var n=f(e),r=0,i=n.length;r1)return;var e=Date.now(),n=e-(r||e);i=t.touches?t.touches[0]:t,o=n>0&&n<=250,r=e}function s(t){if(o&&!i.cancelBubble){if(xt){if("mouse"===t.pointerType)return;var n,a,s={};for(a in i)n=i[a],s[a]=n&&n.bind?n.bind(i):n;i=s}i.type="dblclick",i.button=0,e(i),r=null}}t[Gt+Yt+n]=a,t[Gt+Kt+n]=s,t[Gt+"dblclick"+n]=e,t.addEventListener(Yt,a,!!Et&&{passive:!1}),t.addEventListener(Kt,s,!!Et&&{passive:!1}),t.addEventListener("dblclick",e,!1)}(t,a,i):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Oe[e]||e,a,!!Et&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(a=function(e){e=e||window.event,Ue(t,e)&&s(e)},t.addEventListener(Oe[e],a,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[Ee]=t[Ee]||{},t[Ee][i]=a}function Pe(t,e,n,r){var i=e+o(n)+(r?"_"+o(r):""),a=t[Ee]&&t[Ee][i];if(!a)return this;xt&&0===e.indexOf("touch")?function(t,e,n){var r=t["_leaflet_"+e+n];"touchstart"===e?t.removeEventListener(Lt,r,!1):"touchmove"===e?t.removeEventListener(Nt,r,!1):"touchend"===e&&(t.removeEventListener(Rt,r,!1),t.removeEventListener(It,r,!1))}(t,e,i):kt&&"dblclick"===e&&!Ae()?function(t,e){var n=t[Gt+Yt+e],r=t[Gt+Kt+e],i=t[Gt+"dblclick"+e];t.removeEventListener(Yt,n,!!Et&&{passive:!1}),t.removeEventListener(Kt,r,!!Et&&{passive:!1}),t.removeEventListener("dblclick",i,!1)}(t,i):"removeEventListener"in t?t.removeEventListener(Oe[e]||e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[Ee][i]=null}function Le(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Ve(t),this}function Ne(t){return De(t,"wheel",Le),this}function Re(t){return Me(t,"mousedown touchstart dblclick",Le),De(t,"click",$e),this}function Ie(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function ze(t){return Ie(t),Le(t),this}function Be(t,e){if(!e)return new D(t.clientX,t.clientY);var n=Se(e),r=n.boundingClientRect;return new D((t.clientX-r.left)/n.x-e.clientLeft,(t.clientY-r.top)/n.y-e.clientTop)}var je=dt&&ut?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Fe(t){return et?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var qe={};function $e(t){qe[t.type]=!0}function Ve(t){var e=qe[t.type];return qe[t.type]=!1,e}function Ue(t,e){var n=e.relatedTarget;if(!n)return!0;try{for(;n&&n!==t;)n=n.parentNode}catch(r){return!1}return n!==t}var He={on:Me,off:Te,stopPropagation:Le,disableScrollPropagation:Ne,disableClickPropagation:Re,preventDefault:Ie,stop:ze,getMousePosition:Be,getWheelDelta:Fe,fakeStop:$e,skipped:Ve,isExternalTarget:Ue,addListener:Me,removeListener:Te},We=O.extend({run:function(t,e,n,r){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=ge(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,B(t));return n.equals(r)||this.panTo(r,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=N((e=e||{}).paddingTopLeft||e.padding||[0,0]),r=N(e.paddingBottomRight||e.padding||[0,0]),i=this.getCenter(),o=this.project(i),a=this.project(t),s=this.getPixelBounds(),u=s.getSize().divideBy(2),c=I([s.min.add(n),s.max.subtract(r)]);if(!c.contains(a)){this._enforcingBounds=!0;var l=o.subtract(a),h=N(a.x+l.x,a.y+l.y);(a.xc.max.x)&&(h.x=o.x-l.x,l.x>0?h.x+=u.x-n.x:h.x-=u.x-r.x),(a.yc.max.y)&&(h.y=o.y-l.y,l.y>0?h.y+=u.y-n.y:h.y-=u.y-r.y),this.panTo(this.unproject(h),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=n.divideBy(2).round(),a=i.divideBy(2).round(),s=o.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=r(this._handleGeolocationResponse,this),i=r(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,i,t):navigator.geolocation.getCurrentPosition(n,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(t){var e=new j(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),r=this._locateOptions;if(r.setView){var i=this.getBoundsZoom(n);this.setView(e,r.maxZoom?Math.min(i,r.maxZoom):i)}var o={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"===typeof t.coords[a]&&(o[a]=t.coords[a]);this.fire("locationfound",o)},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ie(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(M(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ie(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=re("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new z(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=B(t),n=N(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),o=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),u=this.getSize().subtract(n),c=I(this.project(s,r),this.project(a,r)).getSize(),l=gt?this.options.zoomSnap:1,h=u.x/c.x,f=u.y/c.y,d=e?Math.max(h,f):Math.min(h,f);return r=this.getScaleZoom(d,r),l&&(r=Math.round(r/(l/100))*(l/100),r=e?Math.ceil(r/l)*l:Math.floor(r/l)*l),Math.max(i,Math.min(o,r))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new D(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new R(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"===typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e;var r=n.zoom(t*n.scale(e));return isNaN(r)?1/0:r},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(N(t),e)},layerPointToLatLng:function(t){var e=N(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(B(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return N(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return N(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(N(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Be(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ee(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Me(e,"scroll",this._onScroll,this),this._containerId=o(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&>,ce(t,"leaflet-container"+(kt?" leaflet-touch":"")+(Mt?" leaflet-retina":"")+(tt?" leaflet-oldie":"")+(lt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ne(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),me(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ce(t.markerPane,"leaflet-zoom-hide"),ce(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){me(this._mapPane,new D(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var r=this._zoom!==e;this._moveStart(r,!1)._move(t,e)._moveEnd(r),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n){void 0===e&&(e=this._zoom);var r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return M(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){me(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[o(this._container)]=this;var e=t?Te:Me;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),gt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){M(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,r=[],i="mouseout"===e||"mouseover"===e,a=t.target||t.srcElement,s=!1;a;){if((n=this._targets[o(a)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(i&&!Ue(a,t))break;if(r.push(n),i)break}if(a===this._container)break;a=a.parentNode}return r.length||s||i||!Ue(a,t)||(r=[this]),r},_handleDOMEvent:function(t){if(this._loaded&&!Ve(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||_e(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,r){if("click"===t.type){var i=e({},t);i.type="preclick",this._fireDOMEvent(i,i.type,r)}if(!t._stopped&&(r=(r||[]).concat(this._findEventTargets(t,n))).length){var o=r[0];"contextmenu"===n&&o.listens(n,!0)&&Ie(t);var a={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var s=o.getLatLng&&(!o._radius||o._radius<=10);a.containerPoint=s?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),a.layerPoint=this.containerPointToLayerPoint(a.containerPoint),a.latlng=s?o.getLatLng():this.layerPointToLatLng(a.layerPoint)}for(var u=0;u0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),r=gt?this.options.zoomSnap:1;return r&&(t=Math.round(t/r)*r),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){le(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n))&&(this.panBy(n,e),!0)},_createAnimProxy:function(){var t=this._proxy=re("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=Xt,n=this._proxy.style[e];ve(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ie(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();ve(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(e),i=this._getCenterOffset(t)._divideBy(1-1/r);return!(!0!==n.animate&&!this.getSize().contains(i))&&(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),!0)},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ce(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&le(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}}),Je=T.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),r=t._controlCorners[n];return ce(e,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(e,r.firstChild):r.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ie(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Ye=function(t){return new Je(t)};Ze.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=re("div",e+"control-container",this._container);function r(r,i){var o=e+r+" "+e+i;t[r+i]=re("div",o,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ie(this._controlCorners[t]);ie(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ke=Je.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,r){return n1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(o(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='",r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(t){var e,n=document.createElement("label"),r=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=r):e=this._createRadioElement("leaflet-base-layers_"+o(this),r),this._layerControlInputs.push(e),e.layerId=o(t.layer),Me(e,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+t.name;var a=document.createElement("div");return n.appendChild(a),a.appendChild(e),a.appendChild(i),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,n=this._layerControlInputs,r=[],i=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.checked?r.push(e):t.checked||i.push(e);for(o=0;o=0;i--)t=n[i],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&re.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),Ge=Je.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=re("div",e+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,r,i){var o=re("a",n,r);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),Re(o),Me(o,"click",ze),Me(o,"click",i,this),Me(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";le(this._zoomInButton,e),le(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ce(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ce(this._zoomInButton,e)}});Ze.mergeOptions({zoomControl:!0}),Ze.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Ge,this.addControl(this.zoomControl))}));var Xe=Je.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=re("div",e),r=this.options;return this._addScales(r,e+"-line",n),t.on(r.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=re("div",e,n)),t.imperial&&(this._iScale=re("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,r,i=3.2808399*t;i>5280?(e=i/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(r=this._getRoundNum(i),this._updateScale(this._iScale,r+" ft",r/i))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Qe=Je.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=re("div","leaflet-control-attribution"),Re(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(" | ")}}});Ze.mergeOptions({attributionControl:!0}),Ze.addInitHook((function(){this.options.attributionControl&&(new Qe).addTo(this)})),Je.Layers=Ke,Je.Zoom=Ge,Je.Scale=Xe,Je.Attribution=Qe,Ye.layers=function(t,e,n){return new Ke(t,e,n)},Ye.zoom=function(t){return new Ge(t)},Ye.scale=function(t){return new Xe(t)},Ye.attribution=function(t){return new Qe(t)};var tn=T.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});tn.addTo=function(t,e){return t.addHandler(e,this),this};var en,nn={Events:A},rn=kt?"touchstart mousedown":"mousedown",on={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},an={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},sn=O.extend({options:{clickTolerance:3},initialize:function(t,e,n,r){d(this,r),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(Me(this._dragStartTarget,rn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(sn._dragging===this&&this.finishDrag(),Te(this._dragStartTarget,rn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ue(this._element,"leaflet-zoom-anim")&&!(sn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches)&&(sn._dragging=this,this._preventOutline&&_e(this._element),be(),Ut(),!this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=ke(this._element);this._startPoint=new D(e.clientX,e.clientY),this._parentScale=Se(n),Me(document,an[t.type],this._onMove,this),Me(document,on[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new D(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)e&&(n.push(t[r]),i=r);return iu&&(o=a,u=s);u>n&&(e[o]=1,ln(t,e,n,r,o),ln(t,e,n,o,i))}function hn(t,e,n,r,i){var o,a,s,u=r?en:dn(t,n),c=dn(e,n);for(en=c;;){if(!(u|c))return[t,e];if(u&c)return!1;s=dn(a=fn(t,e,o=u||c,n,i),n),o===u?(t=a,u=s):(e=a,c=s)}}function fn(t,e,n,r,i){var o,a,s=e.x-t.x,u=e.y-t.y,c=r.min,l=r.max;return 8&n?(o=t.x+s*(l.y-t.y)/u,a=l.y):4&n?(o=t.x+s*(c.y-t.y)/u,a=c.y):2&n?(o=l.x,a=t.y+u*(l.x-t.x)/s):1&n&&(o=c.x,a=t.y+u*(c.x-t.x)/s),new D(o,a,i)}function dn(t,e){var n=0;return t.xe.max.x&&(n|=2),t.ye.max.y&&(n|=8),n}function pn(t,e){var n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function vn(t,e,n,r){var i,o=e.x,a=e.y,s=n.x-o,u=n.y-a,c=s*s+u*u;return c>0&&((i=((t.x-o)*s+(t.y-a)*u)/c)>1?(o=n.x,a=n.y):i>0&&(o+=s*i,a+=u*i)),s=t.x-o,u=t.y-a,r?s*s+u*u:new D(o,a)}function mn(t){return!g(t[0])||"object"!==s(t[0][0])&&"undefined"!==typeof t[0][0]}function gn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),mn(t)}var yn={simplify:un,pointToSegmentDistance:cn,closestPointOnSegment:function(t,e,n){return vn(t,e,n)},clipSegment:hn,_getEdgeIntersection:fn,_getBitCode:dn,_sqClosestPointOnSegment:vn,isFlat:mn,_flat:gn};function bn(t,e,n){var r,i,o,a,s,u,c,l,h,f=[1,4,2,8];for(i=0,c=t.length;i1e-7;u++)e=o*Math.sin(s),e=Math.pow((1-e)/(1+e),o/2),s+=c=Math.PI/2-2*Math.atan(a*e)-s;return new j(s*n,t.x*n/r)}},kn={LonLat:_n,Mercator:xn,SphericalMercator:H},Sn=e({},V,{code:"EPSG:3395",projection:xn,transformation:function(){var t=.5/(Math.PI*xn.R);return Z(t,.5,-t,.5)}()}),Cn=e({},V,{code:"EPSG:4326",projection:_n,transformation:Z(1/180,1,-1/180,.5)}),Mn=e({},$,{projection:_n,transformation:Z(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,r=e.lat-t.lat;return Math.sqrt(n*n+r*r)},infinite:!0});$.Earth=V,$.EPSG3395=Sn,$.EPSG3857=J,$.EPSG900913=Y,$.EPSG4326=Cn,$.Simple=Mn;var En=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[o(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[o(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",(function(){e.off(n,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});Ze.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=o(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=o(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&o(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?g(t)?t:[t]:[]).length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()e)return a=(r-e)/n,this._map.layerPointToLatLng([o.x-a*(o.x-i.x),o.y-a*(o.y-i.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new z,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return mn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],n=mn(t),r=0,i=t.length;r=2&&e[0]instanceof j&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){zn.prototype._setLatLngs.call(this,t),mn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return mn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new D(e,e);if(t=new R(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var r,i=0,o=this._rings.length;it.y!==r.y>t.y&&t.x<(r.x-n.x)*(t.y-n.y)/(r.y-n.y)+n.x&&(c=!c);return c||zn.prototype._containsPoint.call(this,t,!0)}}),jn=An.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,r,i=g(t)?t:t.features;if(i){for(e=0,n=i.length;e0?i:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var a=0;ai?(e.height=i+"px",ce(t,o)):le(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();me(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ne(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,r=this._containerWidth,i=new D(this._containerLeft,-n-this._containerBottom);i._add(ge(this._container));var o=t.layerPointToContainerPoint(i),a=N(this.options.autoPanPadding),s=N(this.options.autoPanPaddingTopLeft||a),u=N(this.options.autoPanPaddingBottomRight||a),c=t.getSize(),l=0,h=0;o.x+r+u.x>c.x&&(l=o.x+r-c.x+u.x),o.x-l-s.x<0&&(l=o.x-s.x),o.y+n+u.y>c.y&&(h=o.y+n-c.y+u.y),o.y-h-s.y<0&&(h=o.y-s.y),(l||h)&&t.fire("autopanstart").panBy([l,h])}},_onCloseButtonClick:function(t){this._close(),ze(t)},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ze.mergeOptions({closePopupOnClick:!0}),Ze.include({openPopup:function(t,e,n){return t instanceof er||(t=new er(n).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),En.include({bindPopup:function(t,e){return t instanceof er?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new er(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(ze(t),e instanceof Nn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var nr=tr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){tr.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){tr.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=tr.prototype.getEvents.call(this);return kt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=re("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,r=this._map,i=this._container,o=r.latLngToContainerPoint(r.getCenter()),a=r.layerPointToContainerPoint(t),s=this.options.direction,u=i.offsetWidth,c=i.offsetHeight,l=N(this.options.offset),h=this._getAnchor();"top"===s?(e=u/2,n=c):"bottom"===s?(e=u/2,n=0):"center"===s?(e=u/2,n=c/2):"right"===s?(e=0,n=c/2):"left"===s?(e=u,n=c/2):a.xthis.options.maxZoom||nr&&this._retainParent(i,o,a,r))},_retainChildren:function(t,e,n,r){for(var i=2*t;i<2*t+2;i++)for(var o=2*e;o<2*e+2;o++){var a=new D(i,o);a.z=n+1;var s=this._tileCoordsToKey(a),u=this._tiles[s];u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),n+1this.options.maxZoom||void 0!==this.options.minZoom&&i1)this._setView(t,n);else{for(var h=i.min.y;h<=i.max.y;h++)for(var f=i.min.x;f<=i.max.x;f++){var d=new D(f,h);if(d.z=this._tileZoom,this._isValidTile(d)){var p=this._tiles[this._tileCoordsToKey(d)];p?p.current=!0:a.push(d)}}if(a.sort((function(t,e){return t.distanceTo(o)-e.distanceTo(o)})),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var v=document.createDocumentFragment();for(f=0;fn.max.x)||!e.wrapLat&&(t.yn.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(t);return B(this.options.bounds).overlaps(r)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),r=t.scaleBy(n),i=r.add(n);return[e.unproject(r,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new z(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new D(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(ie(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ce(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,tt&&this.options.opacity<1&&de(t,this.options.opacity),rt&&!it&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),r(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&C(r(this._tileReady,this,t,null,o)),me(o,n),this._tiles[i]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(de(n.el,0),M(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(ce(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),tt||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new D(this._wrapX?u(t.x,this._wrapX):t.x,this._wrapY?u(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new R(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),or=ir.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&Mt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"===typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),rt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return Me(n,"load",r(this._tileOnLoad,this,e,n)),Me(n,"error",r(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var n={r:Mt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=r),n["-y"]=r}return m(this._url,e(n,this.options))},_tileOnLoad:function(t,e){tt?setTimeout(r(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var r=this.options.errorTileUrl;r&&e.getAttribute("src")!==r&&(e.src=r),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=b,ie(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",b),ir.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==b))return ir.prototype._tileReady.call(this,t,e,n)}});function ar(t,e){return new or(t,e)}var sr=or.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var r=e({},this.defaultWmsParams);for(var i in n)i in this.options||(r[i]=n[i]);var o=(n=d(this,n)).detectRetina&&Mt?2:1,a=this.getTileSize();r.width=a.x*o,r.height=a.y*o,this.wmsParams=r},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,or.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,r=I(n.project(e[0]),n.project(e[1])),i=r.min,o=r.max,a=(this._wmsVersion>=1.3&&this._crs===Cn?[i.y,i.x,o.y,o.x]:[i.x,i.y,o.x,o.y]).join(","),s=or.prototype.getTileUrl.call(this,t);return s+p(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});or.WMS=sr,ar.wms=function(t,e){return new sr(t,e)};var ur=En.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),o(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ce(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),r=ge(this._container),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),a=this._map.project(t,e).subtract(o),s=i.multiplyBy(-n).add(r).add(i).subtract(a);gt?ve(this._container,s,n):me(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new R(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),cr=ur.extend({getEvents:function(){var t=ur.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ur.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Me(t,"mousemove",this._onMouseMove,this),Me(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Me(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){M(this._redrawRequest),delete this._ctx,ie(this._container),Te(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ur.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),r=Mt?2:1;me(e,t.min),e.width=r*n.x,e.height=r*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Mt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ur.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[o(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,r=e.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete t._order,delete this._layers[o(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"===typeof t.options.dashArray){var e,n,r=t.options.dashArray.split(/[, ]+/),i=[];for(n=0;n')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),fr={_initContainer:function(){this._container=re("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ur.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=hr("shape");ce(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=hr("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ie(e),t.removeInteractiveTarget(e),delete this._layers[o(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,r=t.options,i=t._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(e||(e=t._stroke=hr("stroke")),i.appendChild(e),e.weight=r.weight+"px",e.color=r.color,e.opacity=r.opacity,r.dashArray?e.dashStyle=g(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=r.lineCap.replace("butt","flat"),e.joinstyle=r.lineJoin):e&&(i.removeChild(e),t._stroke=null),r.fill?(n||(n=t._fill=hr("fill")),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),r=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+r+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ae(t._container)},_bringToBack:function(t){se(t._container)}},dr=Ot?hr:K,pr=ur.extend({getEvents:function(){var t=ur.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=dr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ie(this._container),Te(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){ur.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),me(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=dr("path");t.options.className&&ce(e,t.options.className),t.options.interactive&&ce(e,"leaflet-interactive"),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ie(t._path),t.removeInteractiveTarget(t._path),delete this._layers[o(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,G(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),r="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",i=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(t,i)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ae(t._path)},_bringToBack:function(t){se(t._path)}});function vr(t){return At||Ot?new pr(t):null}Ot&&pr.include(fr),Ze.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&lr(t)||vr(t)}});var mr=Bn.extend({initialize:function(t,e){Bn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=B(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pr.create=dr,pr.pointsToPath=G,jn.geometryToLayer=Fn,jn.coordsToLatLng=$n,jn.coordsToLatLngs=Vn,jn.latLngToCoords=Un,jn.latLngsToCoords=Hn,jn.getFeature=Wn,jn.asFeature=Zn,Ze.mergeOptions({boxZoom:!0});var gr=tn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Me(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Te(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ie(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Ut(),be(),this._startPoint=this._map.mouseEventToContainerPoint(t),Me(document,{contextmenu:ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=re("div","leaflet-zoom-box",this._container),ce(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new R(this._point,this._startPoint),n=e.getSize();me(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(ie(this._box),le(this._container,"leaflet-crosshair")),Ht(),we(),Te(document,{contextmenu:ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var e=new z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Ze.addInitHook("addHandler","boxZoom",gr),Ze.mergeOptions({doubleClickZoom:!0});var yr=tn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),r=e.options.zoomDelta,i=t.originalEvent.shiftKey?n-r:n+r;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}});Ze.addInitHook("addHandler","doubleClickZoom",yr),Ze.mergeOptions({dragging:!0,inertia:!it,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var br=tn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new sn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ce(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){le(this._map._container,"leaflet-grab"),le(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=B(this._map.options.maxBounds);this._offsetLimit=I(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-e+n)%t+e-n,o=(r+e+n)%t-e-n,a=Math.abs(i+n)0?o:-o))-e;this._delta=0,this._startTime=null,a&&("center"===t.options.scrollWheelZoom?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}});Ze.addInitHook("addHandler","scrollWheelZoom",_r),Ze.mergeOptions({tap:!0,tapTolerance:15});var xr=tn.extend({addHooks:function(){Me(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Te(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ie(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],n=e.target;this._startPos=this._newPos=new D(e.clientX,e.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&ce(n,"leaflet-active"),this._holdTimeout=setTimeout(r((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Me(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Te(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],n=e.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&le(n,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new D(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var n=document.createEvent("MouseEvents");n._simulated=!0,e.target._simulatedClick=!0,n.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(n)}});!kt||xt&&!lt||Ze.addInitHook("addHandler","tap",xr),Ze.mergeOptions({touchZoom:kt&&!it,bounceAtZoomLimits:!0});var kr=tn.extend({addHooks:function(){ce(this._map._container,"leaflet-touch-zoom"),Me(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){le(this._map._container,"leaflet-touch-zoom"),Te(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),r=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Me(document,"touchmove",this._onTouchMove,this),Me(document,"touchend",this._onTouchEnd,this),Ie(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]),o=n.distanceTo(i)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var a=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),M(this._animRequest);var s=r(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(s,this,!0),Ie(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,M(this._animRequest),Te(document,"touchmove",this._onTouchMove,this),Te(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Ze.addInitHook("addHandler","touchZoom",kr),Ze.BoxZoom=gr,Ze.DoubleClickZoom=yr,Ze.Drag=br,Ze.Keyboard=wr,Ze.ScrollWheelZoom=_r,Ze.Tap=xr,Ze.TouchZoom=kr,t.version="1.7.1",t.Control=Je,t.control=Ye,t.Browser=Pt,t.Evented=O,t.Mixin=nn,t.Util=E,t.Class=T,t.Handler=tn,t.extend=e,t.bind=r,t.stamp=o,t.setOptions=d,t.DomEvent=He,t.DomUtil=Ce,t.PosAnimation=We,t.Draggable=sn,t.LineUtil=yn,t.PolyUtil=wn,t.Point=D,t.point=N,t.Bounds=R,t.bounds=I,t.Transformation=W,t.transformation=Z,t.Projection=kn,t.LatLng=j,t.latLng=F,t.LatLngBounds=z,t.latLngBounds=B,t.CRS=$,t.GeoJSON=jn,t.geoJSON=Yn,t.geoJson=Kn,t.Layer=En,t.LayerGroup=Tn,t.layerGroup=function(t,e){return new Tn(t,e)},t.FeatureGroup=An,t.featureGroup=function(t,e){return new An(t,e)},t.ImageOverlay=Gn,t.imageOverlay=function(t,e,n){return new Gn(t,e,n)},t.VideoOverlay=Xn,t.videoOverlay=function(t,e,n){return new Xn(t,e,n)},t.SVGOverlay=Qn,t.svgOverlay=function(t,e,n){return new Qn(t,e,n)},t.DivOverlay=tr,t.Popup=er,t.popup=function(t,e){return new er(t,e)},t.Tooltip=nr,t.tooltip=function(t,e){return new nr(t,e)},t.Icon=On,t.icon=function(t){return new On(t)},t.DivIcon=rr,t.divIcon=function(t){return new rr(t)},t.Marker=Ln,t.marker=function(t,e){return new Ln(t,e)},t.TileLayer=or,t.tileLayer=ar,t.GridLayer=ir,t.gridLayer=function(t){return new ir(t)},t.SVG=pr,t.svg=vr,t.Renderer=ur,t.Canvas=cr,t.canvas=lr,t.Path=Nn,t.CircleMarker=Rn,t.circleMarker=function(t,e){return new Rn(t,e)},t.Circle=In,t.circle=function(t,e,n){return new In(t,e,n)},t.Polyline=zn,t.polyline=function(t,e){return new zn(t,e)},t.Polygon=Bn,t.polygon=function(t,e){return new Bn(t,e)},t.Rectangle=mr,t.rectangle=function(t,e){return new mr(t,e)},t.Map=Ze,t.map=function(t,e){return new Ze(t,e)};var Sr=window.L;t.noConflict=function(){return window.L=Sr,this},window.L=t},"object"===s(e)&&"undefined"!==typeof t?a(e):(i=[e],void 0===(o="function"===typeof(r=a)?r.apply(e,i):r)||(t.exports=o))},function(t,e,n){var r=n(3);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(121),i=n(2),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t])||o(i[t]):r[t]&&r[t][e]||i[t]&&i[t][e]}},function(t,e,n){var r=n(12),i=n(11),o=n(71),a=n(101),s=o("IE_PROTO"),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=i(t),r(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e){t.exports=!1},function(t,e,n){var r=n(10).f,i=n(12),o=n(7)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){"use strict";(function(t){var r=n(176),i=n(177);function o(t){return(o="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 a=setTimeout;function s(t){return Boolean(t&&"undefined"!==typeof t.length)}function u(){}function c(t){if(!(this instanceof c))throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],v(t,this)}function l(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,c._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(i){return void f(e.promise,i)}h(e.promise,r)}else(1===t._state?h:f)(e.promise,t._value)}))):t._deferreds.push(e)}function h(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===o(e)||"function"===typeof e)){var n=e.then;if(e instanceof c)return t._state=3,t._value=e,void d(t);if("function"===typeof n)return void v((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,d(t)}catch(a){f(t,a)}var r,i}function f(t,e){t._state=2,t._value=e,d(t)}function d(t){2===t._state&&0===t._deferreds.length&&c._immediateFn((function(){t._handled||c._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e"+t+""},p=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(i){}var t,e;p=r?function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e}(r):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F);for(var n=a.length;n--;)delete p.prototype[a[n]];return p()};s[h]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(f.prototype=i(t),n=new f,f.prototype=null,n[h]=t):n=p(),void 0===e?n:o(n,e)}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){throw 1},1)}))}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(5),a=n(113),s=n(8),u=n(75),c=n(41),l=n(36),h=n(17),f=n(9),d=n(136),p=n(155),v=n(27),m=n(12),g=n(67),y=n(3),b=n(33),w=n(48),_=n(45).f,x=n(156),k=n(13).forEach,S=n(52),C=n(10),M=n(14),E=n(20),T=n(77),A=E.get,O=E.set,D=C.f,P=M.f,L=Math.round,N=i.RangeError,R=u.ArrayBuffer,I=u.DataView,z=s.NATIVE_ARRAY_BUFFER_VIEWS,B=s.TYPED_ARRAY_TAG,j=s.TypedArray,F=s.TypedArrayPrototype,q=s.aTypedArrayConstructor,$=s.isTypedArray,V="BYTES_PER_ELEMENT",U="Wrong length",H=function(t,e){for(var n=0,r=e.length,i=new(q(t))(r);r>n;)i[n]=e[n++];return i},W=function(t,e){D(t,e,{get:function(){return A(this)[e]}})},Z=function(t){var e;return t instanceof R||"ArrayBuffer"==(e=g(t))||"SharedArrayBuffer"==e},J=function(t,e){return $(t)&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Y=function(t,e){return J(t,e=v(e,!0))?l(2,t[e]):P(t,e)},K=function(t,e,n){return!(J(t,e=v(e,!0))&&y(n)&&m(n,"value"))||m(n,"get")||m(n,"set")||n.configurable||m(n,"writable")&&!n.writable||m(n,"enumerable")&&!n.enumerable?D(t,e,n):(t[e]=n.value,t)};o?(z||(M.f=Y,C.f=K,W(F,"buffer"),W(F,"byteOffset"),W(F,"byteLength"),W(F,"length")),r({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:Y,defineProperty:K}),t.exports=function(t,e,n){var o=t.match(/\d+$/)[0]/8,s=t+(n?"Clamped":"")+"Array",u="get"+t,l="set"+t,v=i[s],m=v,g=m&&m.prototype,C={},M=function(t,e){D(t,e,{get:function(){return function(t,e){var n=A(t);return n.view[u](e*o+n.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,r){var i=A(t);n&&(r=(r=L(r))<0?0:r>255?255:255&r),i.view[l](e*o+i.byteOffset,r,!0)}(this,e,t)},enumerable:!0})};z?a&&(m=e((function(t,e,n,r){return c(t,m,s),T(y(e)?Z(e)?void 0!==r?new v(e,p(n,o),r):void 0!==n?new v(e,p(n,o)):new v(e):$(e)?H(m,e):x.call(m,e):new v(d(e)),t,m)})),w&&w(m,j),k(_(v),(function(t){t in m||h(m,t,v[t])})),m.prototype=g):(m=e((function(t,e,n,r){c(t,m,s);var i,a,u,l=0,h=0;if(y(e)){if(!Z(e))return $(e)?H(m,e):x.call(m,e);i=e,h=p(n,o);var v=e.byteLength;if(void 0===r){if(v%o)throw N(U);if((a=v-h)<0)throw N(U)}else if((a=f(r)*o)+h>v)throw N(U);u=a/o}else u=d(e),i=new R(a=u*o);for(O(t,{buffer:i,byteOffset:h,byteLength:a,length:u,view:new I(i)});lr?1:0}))},enumerable:!0,configurable:!0}),t}();var i=function(){function t(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}return t.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach((function(t){return t.connect()})))},t.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach((function(t){return t.disconnect()})))},Object.defineProperty(t.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce((function(t,e){return t.concat(Array.from(e.values()))}),[])},enumerable:!0,configurable:!0}),t.prototype.bindingConnected=function(t){this.fetchEventListenerForBinding(t).bindingConnected(t)},t.prototype.bindingDisconnected=function(t){this.fetchEventListenerForBinding(t).bindingDisconnected(t)},t.prototype.handleError=function(t,e,n){void 0===n&&(n={}),this.application.handleError(t,"Error "+e,n)},t.prototype.fetchEventListenerForBinding=function(t){var e=t.eventTarget,n=t.eventName;return this.fetchEventListener(e,n)},t.prototype.fetchEventListener=function(t,e){var n=this.fetchEventListenerMapForEventTarget(t),r=n.get(e);return r||(r=this.createEventListener(t,e),n.set(e,r)),r},t.prototype.createEventListener=function(t,e){var n=new r(t,e);return this.started&&n.connect(),n},t.prototype.fetchEventListenerMapForEventTarget=function(t){var e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e},t}(),o=/^((.+?)(@(window|document))?->)?(.+?)(#(.+))?$/;function a(t){return"window"==t?window:"document"==t?document:void 0}var s=function(){function t(t,e,n){this.element=t,this.index=e,this.eventTarget=n.eventTarget||t,this.eventName=n.eventName||function(t){var e=t.tagName.toLowerCase();if(e in u)return u[e](t)}(t)||c("missing event name"),this.identifier=n.identifier||c("missing identifier"),this.methodName=n.methodName||c("missing method name")}return t.forToken=function(t){return new this(t.element,t.index,(e=t.content,{eventTarget:a((n=e.trim().match(o)||[])[4]),eventName:n[2],identifier:n[5],methodName:n[7]}));var e,n},t.prototype.toString=function(){var t=this.eventTargetName?"@"+this.eventTargetName:"";return""+this.eventName+t+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(t.prototype,"eventTargetName",{get:function(){return(t=this.eventTarget)==window?"window":t==document?"document":void 0;var t},enumerable:!0,configurable:!0}),t}(),u={a:function(t){return"click"},button:function(t){return"click"},form:function(t){return"submit"},input:function(t){return"submit"==t.getAttribute("type")?"click":"change"},select:function(t){return"change"},textarea:function(t){return"change"}};function c(t){throw new Error(t)}var l=function(){function t(t,e){this.context=t,this.action=e}return Object.defineProperty(t.prototype,"index",{get:function(){return this.action.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.handleEvent=function(t){this.willBeInvokedByEvent(t)&&this.invokeWithEvent(t)},Object.defineProperty(t.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"method",{get:function(){var t=this.controller[this.methodName];if("function"==typeof t)return t;throw new Error('Action "'+this.action+'" references undefined method "'+this.methodName+'"')},enumerable:!0,configurable:!0}),t.prototype.invokeWithEvent=function(t){try{this.method.call(this.controller,t)}catch(c){var e=this,n={identifier:e.identifier,controller:e.controller,element:e.element,index:e.index,event:t};this.context.handleError(c,'invoking action "'+this.action+'"',n)}},t.prototype.willBeInvokedByEvent=function(t){var e=t.target;return this.element===e||(!(e instanceof Element&&this.element.contains(e))||this.scope.containsElement(e))},Object.defineProperty(t.prototype,"controller",{get:function(){return this.context.controller},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){return this.context.scope},enumerable:!0,configurable:!0}),t}(),h=function(){function t(t,e){var n=this;this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver((function(t){return n.processMutations(t)}))}return t.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},t.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},t.prototype.refresh=function(){if(this.started){for(var t=new Set(this.matchElementsInTree()),e=0,n=Array.from(this.elements);e0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,n){var r=n(1),i=/#|\.prototype\./,o=function(t,e){var n=s[a(t)];return n==c||n!=u&&("function"==typeof e?r(e):!!e)},a=o.normalize=function(t){return String(t).replace(i,".").toLowerCase()},s=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o},function(t,e,n){var r=n(122),i=n(93);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(3),i=n(46),o=n(7)("species");t.exports=function(t,e){var n;return i(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},function(t,e,n){var r=n(1),i=n(7),o=n(63),a=i("species");t.exports=function(t){return o>=51||!r((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e,n){var r,i,o=n(2),a=n(64),s=o.process,u=s&&s.versions,c=u&&u.v8;c?i=(r=c.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]),t.exports=i&&+i},function(t,e,n){var r=n(28);t.exports=r("navigator","userAgent")||""},function(t,e){t.exports={}},function(t,e,n){var r=n(67),i=n(65),o=n(7)("iterator");t.exports=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){var r=n(99),i=n(37),o=n(7)("toStringTag"),a="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=Object(t),o))?n:a?i(e):"Object"==(r=i(e))&&"function"==typeof e.callee?"Arguments":r}},function(t,e,n){var r=n(1);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(t,e,n){var r=n(4),i=n(98),o=n(9),a=n(39),s=n(66),u=n(131),c=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,n){var l,h,f,d,p,v,m,g=n&&n.that,y=!(!n||!n.AS_ENTRIES),b=!(!n||!n.IS_ITERATOR),w=!(!n||!n.INTERRUPTED),_=a(e,g,1+y+w),x=function(t){return l&&u(l),new c(!0,t)},k=function(t){return y?(r(t),w?_(t[0],t[1],x):_(t[0],t[1])):w?_(t,x):_(t)};if(b)l=t;else{if("function"!=typeof(h=s(t)))throw TypeError("Target is not iterable");if(i(h)){for(f=0,d=o(t.length);d>f;f++)if((p=k(t[f]))&&p instanceof c)return p;return new c(!1)}l=h.call(t)}for(v=l.next;!(m=v.call(l)).done;){try{p=k(m.value)}catch(S){throw u(l),S}if("object"==typeof p&&p&&p instanceof c)return p}return new c(!1)}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(91),i=n(56),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e,n){var r=n(7)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(s){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},t(o)}catch(s){}return n}},function(t,e,n){"use strict";var r=n(19),i=n(40),o=n(65),a=n(20),s=n(100),u="Array Iterator",c=a.set,l=a.getterFor(u);t.exports=s(Array,"Array",(function(t,e){c(this,{type:u,target:r(t),index:0,kind:e})}),(function(){var t=l(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){var r=n(25),i=n(11),o=n(55),a=n(9),s=function(t){return function(e,n,s,u){r(n);var c=i(e),l=o(c),h=a(c.length),f=t?h-1:0,d=t?-1:1;if(s<2)for(;;){if(f in l){u=l[f],f+=d;break}if(f+=d,t?f<0:h<=f)throw TypeError("Reduce of empty array with no initial value")}for(;t?f>=0:h>f;f+=d)f in l&&(u=n(u,l[f],f,c));return u}};t.exports={left:s(!1),right:s(!0)}},function(t,e,n){"use strict";var r=n(2),i=n(5),o=n(102),a=n(17),s=n(53),u=n(1),c=n(41),l=n(24),h=n(9),f=n(136),d=n(229),p=n(29),v=n(48),m=n(45).f,g=n(10).f,y=n(97),b=n(31),w=n(20),_=w.get,x=w.set,k="ArrayBuffer",S="DataView",C="Wrong index",M=r.ArrayBuffer,E=M,T=r.DataView,A=T&&T.prototype,O=Object.prototype,D=r.RangeError,P=d.pack,L=d.unpack,N=function(t){return[255&t]},R=function(t){return[255&t,t>>8&255]},I=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},z=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},B=function(t){return P(t,23,4)},j=function(t){return P(t,52,8)},F=function(t,e){g(t.prototype,e,{get:function(){return _(this)[e]}})},q=function(t,e,n,r){var i=f(n),o=_(t);if(i+e>o.byteLength)throw D(C);var a=_(o.buffer).bytes,s=i+o.byteOffset,u=a.slice(s,s+e);return r?u:u.reverse()},$=function(t,e,n,r,i,o){var a=f(n),s=_(t);if(a+e>s.byteLength)throw D(C);for(var u=_(s.buffer).bytes,c=a+s.byteOffset,l=r(+i),h=0;hW;)(V=H[W++])in E||a(E,V,M[V]);U.constructor=E}v&&p(A)!==O&&v(A,O);var Z=new T(new E(2)),J=A.setInt8;Z.setInt8(0,2147483648),Z.setInt8(1,2147483649),!Z.getInt8(0)&&Z.getInt8(1)||s(A,{setInt8:function(t,e){J.call(this,t,e<<24>>24)},setUint8:function(t,e){J.call(this,t,e<<24>>24)}},{unsafe:!0})}else E=function(t){c(this,E,k);var e=f(t);x(this,{bytes:y.call(new Array(e),0),byteLength:e}),i||(this.byteLength=e)},T=function(t,e,n){c(this,T,S),c(t,E,S);var r=_(t).byteLength,o=l(e);if(o<0||o>r)throw D("Wrong offset");if(o+(n=void 0===n?r-o:h(n))>r)throw D("Wrong length");x(this,{buffer:t,byteLength:n,byteOffset:o}),i||(this.buffer=t,this.byteLength=n,this.byteOffset=o)},i&&(F(E,"byteLength"),F(T,"buffer"),F(T,"byteLength"),F(T,"byteOffset")),s(T.prototype,{getInt8:function(t){return q(this,1,t)[0]<<24>>24},getUint8:function(t){return q(this,1,t)[0]},getInt16:function(t){var e=q(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=q(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return z(q(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return z(q(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return L(q(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return L(q(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){$(this,1,t,N,e)},setUint8:function(t,e){$(this,1,t,N,e)},setInt16:function(t,e){$(this,2,t,R,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){$(this,2,t,R,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){$(this,4,t,I,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){$(this,4,t,I,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){$(this,4,t,B,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){$(this,8,t,j,e,arguments.length>2?arguments[2]:void 0)}});b(E,k),b(T,S),t.exports={ArrayBuffer:E,DataView:T}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(59),a=n(15),s=n(49),u=n(69),c=n(41),l=n(3),h=n(1),f=n(72),d=n(31),p=n(77);t.exports=function(t,e,n){var v=-1!==t.indexOf("Map"),m=-1!==t.indexOf("Weak"),g=v?"set":"add",y=i[t],b=y&&y.prototype,w=y,_={},x=function(t){var e=b[t];a(b,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(m&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!l(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(m&&!l(t))&&e.call(this,0===t?0:t)}:function(t,n){return e.call(this,0===t?0:t,n),this})};if(o(t,"function"!=typeof y||!(m||b.forEach&&!h((function(){(new y).entries().next()})))))w=n.getConstructor(e,t,v,g),s.REQUIRED=!0;else if(o(t,!0)){var k=new w,S=k[g](m?{}:-0,1)!=k,C=h((function(){k.has(1)})),M=f((function(t){new y(t)})),E=!m&&h((function(){for(var t=new y,e=5;e--;)t[g](e,e);return!t.has(-0)}));M||((w=e((function(e,n){c(e,w,t);var r=p(new y,e,w);return void 0!=n&&u(n,r[g],{that:r,AS_ENTRIES:v}),r}))).prototype=b,b.constructor=w),(C||E)&&(x("delete"),x("has"),v&&x("get")),(E||S)&&x(g),m&&b.clear&&delete b.clear}return _[t]=w,r({global:!0,forced:w!=y},_),d(w,t),m||n.setStrong(w,t,v),w}},function(t,e,n){var r=n(3),i=n(48);t.exports=function(t,e,n){var o,a;return i&&"function"==typeof(o=e.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&i(t,a),t}},function(t,e){var n=Math.expm1,r=Math.exp;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:r(t)-1}:n},function(t,e){t.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},function(t,e,n){"use strict";var r=n(30),i=n(2),o=n(1);t.exports=r||!o((function(){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete i[t]}))},function(t,e,n){"use strict";var r=n(4);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";var r,i,o=n(81),a=n(108),s=RegExp.prototype.exec,u=String.prototype.replace,c=s,l=(r=/a/,i=/b*/g,s.call(r,"a"),s.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),h=a.UNSUPPORTED_Y||a.BROKEN_CARET,f=void 0!==/()??/.exec("")[1];(l||f||h)&&(c=function(t){var e,n,r,i,a=this,c=h&&a.sticky,d=o.call(a),p=a.source,v=0,m=t;return c&&(-1===(d=d.replace("y","")).indexOf("g")&&(d+="g"),m=String(t).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==t[a.lastIndex-1])&&(p="(?: "+p+")",m=" "+m,v++),n=new RegExp("^(?:"+p+")",d)),f&&(n=new RegExp("^"+p+"$(?!\\s)",d)),l&&(e=a.lastIndex),r=s.call(c?n:a,m),c?r?(r.input=r.input.slice(v),r[0]=r[0].slice(v),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:l&&r&&(a.lastIndex=a.global?r.index+r[0].length:e),f&&r&&r.length>1&&u.call(r[0],n,(function(){for(i=1;i=c?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},function(t,e,n){"use strict";n(152);var r=n(15),i=n(1),o=n(7),a=n(82),s=n(17),u=o("species"),c=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),l="$0"==="a".replace(/./,"$0"),h=o("replace"),f=!!/./[h]&&""===/./[h]("a","$0"),d=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,h){var p=o(t),v=!i((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),m=v&&!i((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!v||!m||"replace"===t&&(!c||!l||f)||"split"===t&&!d){var g=/./[p],y=n(p,""[t],(function(t,e,n,r,i){return e.exec===a?v&&!i?{done:!0,value:g.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:f}),b=y[0],w=y[1];r(String.prototype,t,b),r(RegExp.prototype,p,2==e?function(t,e){return w.call(t,this,e)}:function(t){return w.call(t,this)})}h&&s(RegExp.prototype[p],"sham",!0)}},function(t,e,n){var r=n(37),i=n(82);t.exports=function(t,e){var n=t.exec;if("function"===typeof n){var o=n.call(t,e);if("object"!==typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},function(t,e,n){var r,i,o,a;function s(t){return(s="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)}a=function(t){"use strict";var e=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(t,e){var n=t[0],r=t[1],i=t[2],o=t[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+e[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+e[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+e[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+e[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+e[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+e[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+e[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+e[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+e[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|r>>>11)+i|0,t[0]=n+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function i(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function o(t){var e,i,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,r(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function a(t){var e,r,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,i(t.subarray(e-64,e)));for(r=(t=e-64>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function s(t){var n,r="";for(n=0;n<4;n+=1)r+=e[t>>8*n+4&15]+e[t>>8*n&15];return r}function u(t){var e;for(e=0;el?new ArrayBuffer(0):(i=l-c,o=new ArrayBuffer(i),a=new Uint8Array(o),s=new Uint8Array(this,c,i),a.set(s),o)}}(),p.prototype.append=function(t){return this.appendBinary(c(t)),this},p.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)n(this._hash,r(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},p.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=r.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},p.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(t,e){var r,i,o,a=e;if(t[a>>2]|=128<<(a%4<<3),a>55)for(n(this._hash,t),a=0;a<16;a+=1)t[a]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,t[14]=i,t[15]=o,n(this._hash,t)},p.hash=function(t,e){return p.hashBinary(c(t),e)},p.hashBinary=function(t,e){var n=u(o(t));return e?d(n):n},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(t){var e,r=f(this._buff.buffer,t,!0),o=r.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)n(this._hash,i(r.subarray(e-64,e)));return this._buff=e-64>2]|=r[e]<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var t=p.prototype.getState.call(this);return t.buff=h(t.buff),t},p.ArrayBuffer.prototype.setState=function(t){return t.buff=l(t.buff,!0),p.prototype.setState.call(this,t)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(t,e){var n=u(a(new Uint8Array(t)));return e?d(n):n},p}()})),n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=t.disabled,i=n.bubbles,o=n.cancelable,a=n.detail,s=document.createEvent("Event");s.initEvent(e,i||!0,o||!0),s.detail=a||{};try{t.disabled=!1,t.dispatchEvent(s)}finally{t.disabled=r}return s}function u(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}var c=function(){function t(e,r,i){var o=this;n(this,t),this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:r},this.xhr=new XMLHttpRequest,this.xhr.open("POST",i,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");var s=function(t){var e=a(document.head,'meta[name="'+t+'"]');if(e)return e.getAttribute("content")}("csrf-token");void 0!=s&&this.xhr.setRequestHeader("X-CSRF-Token",s),this.xhr.addEventListener("load",(function(t){return o.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return o.requestDidError(t)}))}return r(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(JSON.stringify({blob:this.attributes}))}},{key:"requestDidLoad",value:function(t){if(this.status>=200&&this.status<300){var e=this.response,n=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=n,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function(){return this.xhr.status}},{key:"response",get:function(){var t=this.xhr,e=t.responseType,n=t.response;return"json"==e?n:JSON.parse(n)}}]),t}(),l=function(){function t(e){var r=this;n(this,t),this.blob=e,this.file=e.file;var i=e.directUploadData,o=i.url,a=i.headers;for(var s in this.xhr=new XMLHttpRequest,this.xhr.open("PUT",o,!0),this.xhr.responseType="text",a)this.xhr.setRequestHeader(s,a[s]);this.xhr.addEventListener("load",(function(t){return r.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return r.requestDidError(t)}))}return r(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(this.file.slice())}},{key:"requestDidLoad",value:function(t){var e=this.xhr,n=e.status,r=e.response;n>=200&&n<300?this.callback(null,r):this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),t}(),h=0,f=function(){function t(e,r,i){n(this,t),this.id=++h,this.file=e,this.url=r,this.delegate=i}return r(t,[{key:"create",value:function(t){var e=this;o.create(this.file,(function(n,r){if(n)t(n);else{var i=new c(e.file,r,e.url);d(e.delegate,"directUploadWillCreateBlobWithXHR",i.xhr),i.create((function(n){if(n)t(n);else{var r=new l(i);d(e.delegate,"directUploadWillStoreFileWithXHR",r.xhr),r.create((function(e){e?t(e):t(null,i.toJSON())}))}}))}}))}}]),t}();function d(t,e){if(t&&"function"==typeof t[e]){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i1&&void 0!==arguments[1]?arguments[1]:{};return e.file=this.file,e.id=this.directUpload.id,s(this.input,"direct-upload:"+t,{detail:e})}},{key:"dispatchError",value:function(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",(function(t){return e.uploadRequestDidProgress(t)}))}},{key:"url",get:function(){return this.input.getAttribute("data-direct-upload-url")}}]),t}(),v=function(){function t(e){var r,i;n(this,t),this.form=e,this.inputs=(r=e,i="input[type=file][data-direct-upload-url]:not([disabled])","string"==typeof r&&(i=r,r=document),u(r.querySelectorAll(i))).filter((function(t){return t.files.length}))}return r(t,[{key:"start",value:function(t){var e=this,n=this.createDirectUploadControllers();this.dispatch("start"),function r(){var i=n.shift();i?i.start((function(n){n?(t(n),e.dispatch("end")):r()})):(t(),e.dispatch("end"))}()}},{key:"createDirectUploadControllers",value:function(){var t=[];return this.inputs.forEach((function(e){u(e.files).forEach((function(n){var r=new p(e,n);t.push(r)}))})),t}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this.form,"direct-uploads:"+t,{detail:e})}}]),t}(),m="data-direct-uploads-processing",g=new WeakMap,y=!1;function b(){y||(y=!0,document.addEventListener("click",w,!0),document.addEventListener("submit",_),document.addEventListener("ajax:before",x))}function w(t){var e=t.target;"INPUT"!=e.tagName&&"BUTTON"!=e.tagName||"submit"!=e.type||!e.form||g.set(e.form,e)}function _(t){k(t)}function x(t){"FORM"==t.target.tagName&&k(t)}function k(t){var e=t.target;if(e.hasAttribute(m))t.preventDefault();else{var n=new v(e),r=n.inputs;r.length&&(t.preventDefault(),e.setAttribute(m,""),r.forEach(S),n.start((function(t){e.removeAttribute(m),t?r.forEach(C):function(t){var e=g.get(t)||a(t,"input[type=submit], button[type=submit]");if(e){var n=e.disabled;e.disabled=!1,e.focus(),e.click(),e.disabled=n}else(e=document.createElement("input")).type="submit",e.style.display="none",t.appendChild(e),e.click(),t.removeChild(e);g.delete(t)}(e)})))}}function S(t){t.disabled=!0}function C(t){t.disabled=!1}setTimeout((function(){window.ActiveStorage&&b()}),1),t.start=b,t.DirectUpload=f,Object.defineProperty(t,"__esModule",{value:!0})},"object"===s(e)&&"undefined"!==typeof t?a(e):(i=[e],void 0===(o="function"===typeof(r=a)?r.apply(e,i):r)||(t.exports=o))},function(t,e,n){var r=n(2),i=n(3),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,n){var r=n(2),i=n(17);t.exports=function(t,e){try{i(r,t,e)}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(90),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return i.call(t)}),t.exports=r.inspectSource},function(t,e,n){var r=n(2),i=n(88),o="__core-js_shared__",a=r[o]||i(o,{});t.exports=a},function(t,e,n){var r=n(30),i=n(90);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.3",mode:r?"pure":"global",copyright:"\xa9 2021 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(28),i=n(45),o=n(94),a=n(4);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=o.f;return n?e.concat(n(t)):e}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(1);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(t,e,n){var r=n(5),i=n(10),o=n(4),a=n(60);t.exports=r?Object.defineProperties:function(t,e){o(t);for(var n,r=a(e),s=r.length,u=0;s>u;)i.f(t,n=r[u++],e[n]);return t}},function(t,e,n){"use strict";var r=n(11),i=n(38),o=n(9);t.exports=function(t){for(var e=r(this),n=o(e.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)e[s++]=t;return e}},function(t,e,n){var r=n(7),i=n(65),o=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},function(t,e,n){var r={};r[n(7)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){"use strict";var r=n(0),i=n(132),o=n(29),a=n(48),s=n(31),u=n(17),c=n(15),l=n(7),h=n(30),f=n(65),d=n(133),p=d.IteratorPrototype,v=d.BUGGY_SAFARI_ITERATORS,m=l("iterator"),g="keys",y="values",b="entries",w=function(){return this};t.exports=function(t,e,n,l,d,_,x){i(n,e,l);var k,S,C,M=function(t){if(t===d&&D)return D;if(!v&&t in A)return A[t];switch(t){case g:case y:case b:return function(){return new n(this,t)}}return function(){return new n(this)}},E=e+" Iterator",T=!1,A=t.prototype,O=A[m]||A["@@iterator"]||d&&A[d],D=!v&&O||M(d),P="Array"==e&&A.entries||O;if(P&&(k=o(P.call(new t)),p!==Object.prototype&&k.next&&(h||o(k)===p||(a?a(k,p):"function"!=typeof k[m]&&u(k,m,w)),s(k,E,!0,!0),h&&(f[E]=w))),d==y&&O&&O.name!==y&&(T=!0,D=function(){return O.call(this)}),h&&!x||A[m]===D||u(A,m,D),f[e]=D,d)if(S={values:M(y),keys:_?D:M(g),entries:M(b)},x)for(C in S)(v||T||!(C in A))&&c(A,C,S[C]);else r({target:e,proto:!0,forced:v||T},S);return S}},function(t,e,n){var r=n(1);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e){t.exports="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView},function(t,e,n){var r=n(9),i=n(104),o=n(16),a=Math.ceil,s=function(t){return function(e,n,s){var u,c,l=String(o(e)),h=l.length,f=void 0===s?" ":String(s),d=r(n);return d<=h||""==f?l:(u=d-h,(c=i.call(f,a(u/f.length))).length>u&&(c=c.slice(0,u)),t?l+c:c+l)}};t.exports={start:s(!1),end:s(!0)}},function(t,e,n){"use strict";var r=n(24),i=n(16);t.exports="".repeat||function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e,n){var r,i,o,a=n(2),s=n(1),u=n(39),c=n(124),l=n(87),h=n(148),f=n(51),d=a.location,p=a.setImmediate,v=a.clearImmediate,m=a.process,g=a.MessageChannel,y=a.Dispatch,b=0,w={},_="onreadystatechange",x=function(t){if(w.hasOwnProperty(t)){var e=w[t];delete w[t],e()}},k=function(t){return function(){x(t)}},S=function(t){x(t.data)},C=function(t){a.postMessage(t+"",d.protocol+"//"+d.host)};p&&v||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return w[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(b),b},v=function(t){delete w[t]},f?r=function(t){m.nextTick(k(t))}:y&&y.now?r=function(t){y.now(k(t))}:g&&!h?(o=(i=new g).port2,i.port1.onmessage=S,r=u(o.postMessage,o,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&d&&"file:"!==d.protocol&&!s(C)?(r=C,a.addEventListener("message",S,!1)):r=_ in l("script")?function(t){c.appendChild(l("script")).onreadystatechange=function(){c.removeChild(this),x(t)}}:function(t){setTimeout(k(t),0)}),t.exports={set:p,clear:v}},function(t,e,n){var r=n(3),i=n(37),o=n(7)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){"use strict";var r=n(1);function i(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=r((function(){var t=i("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=r((function(){var t=i("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},function(t,e,n){var r=n(107);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(7)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(i){}}return!1}},function(t,e,n){"use strict";var r=n(83).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){var r=n(1),i=n(79);t.exports=function(t){return r((function(){return!!i[t]()||"\u200b\x85\u180e"!="\u200b\x85\u180e"[t]()||i[t].name!==t}))}},function(t,e,n){var r=n(2),i=n(1),o=n(72),a=n(8).NATIVE_ARRAY_BUFFER_VIEWS,s=r.ArrayBuffer,u=r.Int8Array;t.exports=!a||!i((function(){u(1)}))||!i((function(){new u(-1)}))||!o((function(t){new u,new u(null),new u(1.5),new u(t)}),!0)||i((function(){return 1!==new u(new s(2),1,void 0).length}))},function(t,e){t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(t,e,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(t){for(var e=0;e=0&&(n=this.attrs[e][1]),n},r.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(5),i=n(1),o=n(87);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(2),i=n(89),o=r.WeakMap;t.exports="function"===typeof o&&/native code/.test(i(o))},function(t,e,n){var r=n(12),i=n(92),o=n(14),a=n(10);t.exports=function(t,e){for(var n=i(e),s=a.f,u=o.f,c=0;cu;)r(s,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(95);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(28);t.exports=r("document","documentElement")},function(t,e,n){var r=n(19),i=n(45).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(e){return a.slice()}}(t):i(r(t))}},function(t,e,n){var r=n(7);e.f=r},function(t,e,n){"use strict";var r=n(11),i=n(38),o=n(9),a=Math.min;t.exports=[].copyWithin||function(t,e){var n=r(this),s=o(n.length),u=i(t,s),c=i(e,s),l=arguments.length>2?arguments[2]:void 0,h=a((void 0===l?s:i(l,s))-c,s-u),f=1;for(c0;)c in n?n[u]=n[c]:delete n[u],u+=f,c+=f;return n}},function(t,e,n){"use strict";var r=n(46),i=n(9),o=n(39),a=function(t,e,n,s,u,c,l,h){for(var f,d=u,p=0,v=!!l&&o(l,h,3);p0&&r(f))d=a(t,e,f,i(f.length),d,c-1)-1;else{if(d>=9007199254740991)throw TypeError("Exceed the acceptable array length");t[d]=f}d++}p++}return d};t.exports=a},function(t,e,n){"use strict";var r=n(13).forEach,i=n(34),o=n(18),a=i("forEach"),s=o("forEach");t.exports=a&&s?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},function(t,e,n){"use strict";var r=n(39),i=n(11),o=n(210),a=n(98),s=n(9),u=n(47),c=n(66);t.exports=function(t){var e,n,l,h,f,d,p=i(t),v="function"==typeof this?this:Array,m=arguments.length,g=m>1?arguments[1]:void 0,y=void 0!==g,b=c(p),w=0;if(y&&(g=r(g,m>2?arguments[2]:void 0,2)),void 0==b||v==Array&&a(b))for(n=new v(e=s(p.length));e>w;w++)d=y?g(p[w],w):p[w],u(n,w,d);else for(f=(h=b.call(p)).next,n=new v;!(l=f.call(h)).done;w++)d=y?o(h,g,[l.value,w],!0):l.value,u(n,w,d);return n.length=w,n}},function(t,e,n){var r=n(4);t.exports=function(t){var e=t.return;if(void 0!==e)return r(e.call(t)).value}},function(t,e,n){"use strict";var r=n(133).IteratorPrototype,i=n(33),o=n(36),a=n(31),s=n(65),u=function(){return this};t.exports=function(t,e,n){var c=e+" Iterator";return t.prototype=i(r,{next:o(1,n)}),a(t,c,!1,!0),s[c]=u,t}},function(t,e,n){"use strict";var r,i,o,a=n(1),s=n(29),u=n(17),c=n(12),l=n(7),h=n(30),f=l("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(i=s(s(o)))!==Object.prototype&&(r=i):d=!0);var p=void 0==r||a((function(){var t={};return r[f].call(t)!==t}));p&&(r={}),h&&!p||c(r,f)||u(r,f,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},function(t,e,n){var r=n(3);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,n){"use strict";var r=n(19),i=n(24),o=n(9),a=n(34),s=n(18),u=Math.min,c=[].lastIndexOf,l=!!c&&1/[1].lastIndexOf(1,-0)<0,h=a("lastIndexOf"),f=s("indexOf",{ACCESSORS:!0,1:0}),d=l||!h||!f;t.exports=d?function(t){if(l)return c.apply(this,arguments)||0;var e=r(this),n=o(e.length),a=n-1;for(arguments.length>1&&(a=u(a,i(arguments[1]))),a<0&&(a=n+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:c},function(t,e,n){var r=n(24),i=n(9);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length or index");return n}},function(t,e,n){"use strict";var r=n(25),i=n(3),o=[].slice,a={},s=function(t,e,n){if(!(e in a)){for(var r=[],i=0;i1?arguments[1]:void 0,3);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!g(this,t)}}),o(l.prototype,n?{get:function(t){var e=g(this,t);return e&&e.value},set:function(t,e){return m(this,0===t?0:t,e)}}:{add:function(t){return m(this,t=0===t?0:t,t)}}),h&&r(l.prototype,"size",{get:function(){return d(this).size}}),l},setStrong:function(t,e,n){var r=e+" Iterator",i=v(e),o=v(r);c(t,e,(function(t,e){p(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),l(e)}}},function(t,e){var n=Math.log;t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:n(1+t)}},function(t,e,n){var r=n(3),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},function(t,e,n){var r=n(2),i=n(54).trim,o=n(79),a=r.parseFloat,s=1/a(o+"-0")!==-1/0;t.exports=s?function(t){var e=i(String(t)),n=a(e);return 0===n&&"-"==e.charAt(0)?-0:n}:a},function(t,e,n){var r=n(2),i=n(54).trim,o=n(79),a=r.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(o+"08")||22!==a(o+"0x16");t.exports=u?function(t,e){var n=i(String(t));return a(n,e>>>0||(s.test(n)?16:10))}:a},function(t,e,n){var r=n(37);t.exports=function(t){if("number"!=typeof t&&"Number"!=r(t))throw TypeError("Incorrect invocation");return+t}},function(t,e,n){"use strict";var r=n(5),i=n(1),o=n(60),a=n(94),s=n(70),u=n(11),c=n(55),l=Object.assign,h=Object.defineProperty;t.exports=!l||i((function(){if(r&&1!==l({b:1},l(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=l({},t)[n]||o(l({},e)).join("")!=i}))?function(t,e){for(var n=u(t),i=arguments.length,l=1,h=a.f,f=s.f;i>l;)for(var d,p=c(arguments[l++]),v=h?o(p).concat(h(p)):o(p),m=v.length,g=0;m>g;)d=v[g++],r&&!f.call(p,d)||(n[d]=p[d]);return n}:l},function(t,e,n){var r=n(5),i=n(60),o=n(19),a=n(70).f,s=function(t){return function(e){for(var n,s=o(e),u=i(s),c=u.length,l=0,h=[];c>l;)n=u[l++],r&&!a.call(s,n)||h.push(t?[n,s[n]]:s[n]);return h}};t.exports={entries:s(!0),values:s(!1)}},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},function(t,e,n){var r=n(2);t.exports=r.Promise},function(t,e,n){var r=n(64);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(t,e,n){var r,i,o,a,s,u,c,l,h=n(2),f=n(14).f,d=n(106).set,p=n(148),v=n(306),m=n(51),g=h.MutationObserver||h.WebKitMutationObserver,y=h.document,b=h.process,w=h.Promise,_=f(h,"queueMicrotask"),x=_&&_.value;x||(r=function(){var t,e;for(m&&(t=b.domain)&&t.exit();i;){e=i.fn,i=i.next;try{e()}catch(n){throw i?a():o=void 0,n}}o=void 0,t&&t.enter()},p||m||v||!g||!y?w&&w.resolve?(c=w.resolve(void 0),l=c.then,a=function(){l.call(c,r)}):a=m?function(){b.nextTick(r)}:function(){d.call(h,r)}:(s=!0,u=y.createTextNode(""),new g(r).observe(u,{characterData:!0}),a=function(){u.data=s=!s})),t.exports=x||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,a()),o=e}},function(t,e,n){var r=n(4),i=n(3),o=n(151);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var r=n(25),i=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new i(t)}},function(t,e,n){"use strict";var r=n(0),i=n(82);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},function(t,e,n){"use strict";var r=n(83).charAt,i=n(20),o=n(100),a="String Iterator",s=i.set,u=i.getterFor(a);o(String,"String",(function(t){s(this,{type:a,string:String(t),index:0})}),(function(){var t,e=u(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=r(n,i),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){var r=n(64);t.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)},function(t,e,n){var r=n(358);t.exports=function(t,e){var n=r(t);if(n%e)throw RangeError("Wrong offset");return n}},function(t,e,n){var r=n(11),i=n(9),o=n(66),a=n(98),s=n(39),u=n(8).aTypedArrayConstructor;t.exports=function(t){var e,n,c,l,h,f,d=r(t),p=arguments.length,v=p>1?arguments[1]:void 0,m=void 0!==v,g=o(d);if(void 0!=g&&!a(g))for(f=(h=g.call(d)).next,d=[];!(l=f.call(h)).done;)d.push(l.value);for(m&&p>2&&(v=s(v,arguments[2],2)),n=i(d.length),c=new(u(this))(n),e=0;n>e;e++)c[e]=m?v(d[e],e):d[e];return c}},function(t,e,n){"use strict";var r=n(53),i=n(49).getWeakData,o=n(4),a=n(3),s=n(41),u=n(69),c=n(13),l=n(12),h=n(20),f=h.set,d=h.getterFor,p=c.find,v=c.findIndex,m=0,g=function(t){return t.frozen||(t.frozen=new y)},y=function(){this.entries=[]},b=function(t,e){return p(t.entries,(function(t){return t[0]===e}))};y.prototype={get:function(t){var e=b(this,t);if(e)return e[1]},has:function(t){return!!b(this,t)},set:function(t,e){var n=b(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=v(this.entries,(function(e){return e[0]===t}));return~e&&this.entries.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,c){var h=t((function(t,r){s(t,h,e),f(t,{type:e,id:m++,frozen:void 0}),void 0!=r&&u(r,t[c],{that:t,AS_ENTRIES:n})})),p=d(e),v=function(t,e,n){var r=p(t),a=i(o(e),!0);return!0===a?g(r).set(e,n):a[r.id]=n,t};return r(h.prototype,{delete:function(t){var e=p(this);if(!a(t))return!1;var n=i(t);return!0===n?g(e).delete(t):n&&l(n,e.id)&&delete n[e.id]},has:function(t){var e=p(this);if(!a(t))return!1;var n=i(t);return!0===n?g(e).has(t):n&&l(n,e.id)}}),r(h.prototype,n?{get:function(t){var e=p(this);if(a(t)){var n=i(t);return!0===n?g(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return v(this,t,e)}}:{add:function(t){return v(this,t,!0)}}),h}}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){var r=n(1),i=n(7),o=n(30),a=i("iterator");t.exports=!r((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),n+=r+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},function(t,e,n){"use strict";n(73);var r=n(0),i=n(28),o=n(159),a=n(15),s=n(53),u=n(31),c=n(132),l=n(20),h=n(41),f=n(12),d=n(39),p=n(67),v=n(4),m=n(3),g=n(33),y=n(36),b=n(401),w=n(66),_=n(7),x=i("fetch"),k=i("Headers"),S=_("iterator"),C="URLSearchParams",M="URLSearchParamsIterator",E=l.set,T=l.getterFor(C),A=l.getterFor(M),O=/\+/g,D=Array(4),P=function(t){return D[t-1]||(D[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},L=function(t){try{return decodeURIComponent(t)}catch(e){return t}},N=function(t){var e=t.replace(O," "),n=4;try{return decodeURIComponent(e)}catch(r){for(;n;)e=e.replace(P(n--),L);return e}},R=/[!'()~]|%20/g,I={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},z=function(t){return I[t]},B=function(t){return encodeURIComponent(t).replace(R,z)},j=function(t,e){if(e)for(var n,r,i=e.split("&"),o=0;o0?arguments[0]:void 0,l=this,d=[];if(E(l,{type:C,entries:d,updateURL:function(){},updateSearchParams:F}),void 0!==c)if(m(c))if("function"===typeof(t=w(c)))for(n=(e=t.call(c)).next;!(r=n.call(e)).done;){if((a=(o=(i=b(v(r.value))).next).call(i)).done||(s=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");d.push({key:a.value+"",value:s.value+""})}else for(u in c)f(c,u)&&d.push({key:u,value:c[u]+""});else j(d,"string"===typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},U=V.prototype;s(U,{append:function(t,e){q(arguments.length,2);var n=T(this);n.entries.push({key:t+"",value:e+""}),n.updateURL()},delete:function(t){q(arguments.length,1);for(var e=T(this),n=e.entries,r=t+"",i=0;it.key){i.splice(e,0,t);break}e===n&&i.push(t)}r.updateURL()},forEach:function(t){for(var e,n=T(this).entries,r=d(t,arguments.length>1?arguments[1]:void 0,3),i=0;i1&&(m(e=arguments[1])&&(n=e.body,p(n)===C&&((r=e.headers?new k(e.headers):new k).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=g(e,{body:y(0,String(n)),headers:y(0,r)}))),i.push(e)),x.apply(this,i)}}),t.exports={URLSearchParams:V,getState:T}},function(t,e){function n(){}function r(t){this._tree=t,this._ancestors=[],this._cursor=null}n.prototype.clear=function(){this._root=null,this.size=0},n.prototype.find=function(t){for(var e=this._root;null!==e;){var n=this._comparator(t,e.data);if(0===n)return e.data;e=e.get_child(n>0)}return null},n.prototype.findIter=function(t){for(var e=this._root,n=this.iterator();null!==e;){var r=this._comparator(t,e.data);if(0===r)return n._cursor=e,n;n._ancestors.push(e),e=e.get_child(r>0)}return null},n.prototype.lowerBound=function(t){for(var e=this._root,n=this.iterator(),r=this._comparator;null!==e;){var i=r(t,e.data);if(0===i)return n._cursor=e,n;n._ancestors.push(e),e=e.get_child(i>0)}for(var o=n._ancestors.length-1;o>=0;--o)if(r(t,(e=n._ancestors[o]).data)<0)return n._cursor=e,n._ancestors.length=o,n;return n._ancestors.length=0,n},n.prototype.upperBound=function(t){for(var e=this.lowerBound(t),n=this._comparator;null!==e.data()&&0===n(e.data(),t);)e.next();return e},n.prototype.min=function(){var t=this._root;if(null===t)return null;for(;null!==t.left;)t=t.left;return t.data},n.prototype.max=function(){var t=this._root;if(null===t)return null;for(;null!==t.right;)t=t.right;return t.data},n.prototype.iterator=function(){return new r(this)},n.prototype.each=function(t){for(var e,n=this.iterator();null!==(e=n.next());)t(e)},n.prototype.reach=function(t){for(var e,n=this.iterator();null!==(e=n.prev());)t(e)},r.prototype.data=function(){return null!==this._cursor?this._cursor.data:null},r.prototype.next=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._minNode(t)}else{var e;if(null===this._cursor.right)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.right===e);else this._ancestors.push(this._cursor),this._minNode(this._cursor.right)}return null!==this._cursor?this._cursor.data:null},r.prototype.prev=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._maxNode(t)}else{var e;if(null===this._cursor.left)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.left===e);else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left)}return null!==this._cursor?this._cursor.data:null},r.prototype._minNode=function(t){for(;null!==t.left;)this._ancestors.push(t),t=t.left;this._cursor=t},r.prototype._maxNode=function(t){for(;null!==t.right;)this._ancestors.push(t),t=t.right;this._cursor=t},t.exports=n},function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(D){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new T(r||[]);return o._invoke=function(t,e,n){var r=h;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=C(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=l(t,e,n);if("normal"===u.type){if(r=n.done?p:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(D){return{type:"throw",arg:D}}}t.wrap=c;var h="suspendedStart",f="suspendedYield",d="executing",p="completed",v={};function m(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,s){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"===typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function C(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=l(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function A(t){if(t){var n=t[o];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:A(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){},function(t,e,n){t.exports=n.p+"media/images/marker-icon-2x-680f69f3.png"},function(t,e,n){t.exports=n.p+"media/images/marker-icon-2b3e1faf.png"},function(t,e,n){t.exports=n.p+"media/images/marker-shadow-a0c6cc14.png"},function(t,e,n){"use strict";t.exports=n(420)},function(t,e,n){"use strict";t.exports.encode=n(421),t.exports.decode=n(422),t.exports.format=n(423),t.exports.parse=n(424)},function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},function(t,e,n){"use strict";var r="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",i="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",o=new RegExp("^(?:"+r+"|"+i+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|]*>|)"),a=new RegExp("^(?:"+r+"|"+i+")");t.exports.HTML_TAG_RE=o,t.exports.HTML_OPEN_CLOSE_TAG_RE=a},function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,s=[],u=e.length;for(n=0;n=0;n--)95!==(r=e[n]).marker&&42!==r.marker||-1!==r.end&&(i=e[r.end],s=n>0&&e[n-1].end===r.end+1&&e[n-1].token===r.token-1&&e[r.end+1].token===i.token+1&&e[n-1].marker===r.marker,a=String.fromCharCode(r.marker),(o=t.tokens[r.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",(o=t.tokens[i.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--))}t.exports.tokenize=function(t,e){var n,r,i=t.pos,o=t.src.charCodeAt(i);if(e)return!1;if(95!==o&&42!==o)return!1;for(r=t.scanDelims(t.pos,42===o),n=0;n-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=n.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(n=r?n.replace(r[0],""):n).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:i.pop()),a=i.join(" ")||void 0,s=["eval",""].indexOf(o[0])>-1?void 0:o[0];return new t({functionName:a,fileName:s,lineNumber:o[1],columnNumber:o[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(t){return!t.match(r)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t({functionName:e});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(n),i=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(n,""));return new t({functionName:i,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],o=2,a=r.length;o/,"$2").replace(/\([^)]*\)/g,"")||void 0;o.match(/\(([^)]*)\)/)&&(n=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new t({functionName:a,args:s,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})}),this)}}})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e){var n=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!==typeof self?self:this);!function(t){!function(e){var n="URLSearchParams"in t,r="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!==typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function v(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"===typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"===typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var t,e,n,r=d(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=p(e),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function _(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},_.error=function(){var t=new _(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];_.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new _(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(S){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function k(t,n){return new Promise((function(r,o){var a=new b(t,n);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,n={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}})),e)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new _(i,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}k.polyfill=!0,t.fetch||(t.fetch=k,t.Headers=f,t.Request=b,t.Response=_),e.Headers=f,e.Request=b,e.Response=_,e.fetch=k}({})}(n),delete n.fetch.polyfill,(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},function(t,e,n){"use strict";t.exports=n(419)},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return Rc}));var i,o,a=n(44),s=n.n(a);function u(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(c){return void n(c)}s.done?e(u):Promise.resolve(u).then(r,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){u(o,r,i,a,s,"next",t)}function s(t){u(o,r,i,a,s,"throw",t)}a(void 0)}))}}function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){throw t})),f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){s=!0,o=t})),f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?e-1:0),r=1;r7&&void 0!==arguments[7]?arguments[7]:[-1],c=o;nt(t);var l=t.$$={fragment:null,ctx:[],props:a,update:P,not_equal:i,bound:N(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:N(),dirty:u,skip_bound:!1,root:e.target||c.$$.root};s&&s(l.root);var h=!1;if(l.ctx=n?n(t,e.props||{},(function(e,n){var r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&i(l.ctx[e],l.ctx[e]=r)&&(!l.skip_bound&&l.bound[e]&&l.bound[e](r),h&&Mt(t,e)),n})):[],l.update(),h=!0,R(l.before_update),l.fragment=!!r&&r(l.ctx),e.target){if(e.hydrate){var f=X(e.target);l.fragment&&l.fragment.l(f),f.forEach(U)}else l.fragment&&l.fragment.c();e.intro&&_t(t.$$.fragment),St(t,e.target,e.anchor,e.customElement),vt()}nt(c)}var Tt=function(){function t(){C(this,t)}return E(t,[{key:"$destroy",value:function(){Ct(this,1),this.$destroy=P}},{key:"$on",value:function(t,e){if(!I(e))return P;var n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}}},{key:"$set",value:function(t){this.$$set&&!function(t){return 0===Object.keys(t).length}(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}]),t}(),At=[];function Ot(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P,r=new Set;function i(n){if(z(t,n)&&(t=n,e)){var i,o=!At.length,a=S(r);try{for(a.s();!(i=a.n()).done;){var s=i.value;s[1](),At.push(s,t)}}catch(c){a.e(c)}finally{a.f()}if(o){for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:P,s=[o,a];return r.add(s),1===r.size&&(e=n(i)||P),o(t),function(){r.delete(s),0===r.size&&e&&(e(),e=null)}}return{set:i,update:o,subscribe:a}}function Dt(t,e,n){var r=!Array.isArray(t),i=r?[t]:t,o=e.length<2;return function(t,e){return{subscribe:Ot(t,e).subscribe}}(n,(function(t){var n=!1,a=[],s=0,u=P,c=function(){if(!s){u();var n=e(r?a[0]:a,t);o?t(n):u=I(n)?n:P}},l=i.map((function(t,e){return j(t,(function(t){a[e]=t,s&=~(1<0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(t)).reduce((function(t,e){return t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"}),"")},Lt=200,Nt=function(){};Nt.prototype.append=function(t){return t.length?(t=Nt.from(t),!this.length&&t||t.length=e?Nt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Nt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Nt.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)},Nt.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},Nt.from=function(t){return t instanceof Nt?t:t&&t.length?new Rt(t):Nt.empty};var Rt=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Lt)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Lt)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}(Nt);Nt.empty=new Rt([]);var It=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return ti&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Nt),zt=Nt;function Bt(t){this.content=t}function jt(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var i=t.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(var a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){var s=jt(i.content,o.content,n+1);if(null!=s)return s}n+=i.nodeSize}else n+=i.nodeSize}}function Ft(t,e,n,r){for(var i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};var a=t.child(--i),s=e.child(--o),u=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var c=0,l=Math.min(a.text.length,s.text.length);c>1}},Bt.from=function(t){if(t instanceof Bt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Bt(e)};var qt=function(){function t(e,n){if(C(this,t),this.content=e,this.size=n||0,null==n)for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,o=0,a=0;at&&!1!==n(s,r+a,i||null,o)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,t-c),Math.min(s.content.size,e-c),n,r+c)}a=u}}},{key:"descendants",value:function(t){this.nodesBetween(0,this.size,t)}},{key:"textBetween",value:function(t,e,n,r){var i="",o=!0;return this.nodesBetween(t,e,(function(a,s){a.isText?(i+=a.text.slice(Math.max(t,s)-s,e-s),o=!n):a.isLeaf?(r?i+="function"==typeof r?r(a):r:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),o=!n):!o&&a.isBlock&&(i+=n,o=!0)}),0),i}},{key:"append",value:function(e){if(!e.size)return this;if(!this.size)return e;var n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==e&&n==this.size)return this;var r=[],i=0;if(n>e)for(var o=0,a=0;ae&&((an)&&(s=s.isText?s.cut(Math.max(0,e-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,e-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=u}return new t(r,i)}},{key:"cutByIndex",value:function(e,n){return e==n?t.empty:0==e&&n==this.content.length?this:new t(this.content.slice(e,n))}},{key:"replaceChild",value:function(e,n){var r=this.content[e];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}},{key:"addToStart",value:function(e){return new t([e].concat(this.content),this.size+e.nodeSize)}},{key:"addToEnd",value:function(e){return new t(this.content.concat(e),this.size+e.nodeSize)}},{key:"eq",value:function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:0;return jt(this,t,e)}},{key:"findDiffEnd",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.size;return Ft(this,t,e,n)}},{key:"findIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t)return Vt(0,t);if(t==this.size)return Vt(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position ".concat(t," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t||e>0?Vt(n+1,o):Vt(n,r);r=o}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}},{key:"fromArray",value:function(e){if(!e.length)return t.empty;for(var n,r=0,i=0;ithis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}},{key:"removeFromSet",value:function(t){for(var e=0;e0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new t(qt.fromJSON(e,n.content),r,i)}},{key:"maxOpen",value:function(e){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,i=0,o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var a=e.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new t(e,r,i)}}]),t}();function Jt(t,e,n){var r=t.findIndex(e),i=r.index,o=r.offset,a=t.maybeChild(i),s=t.findIndex(n),u=s.index,c=s.offset;if(o==e||a.isText){if(c!=n&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(i!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(Jt(a.content,e-o-1,n-o-1)))}function Yt(t,e,n,r){var i=t.findIndex(e),o=i.index,a=i.offset,s=t.maybeChild(o);if(a==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));var u=Yt(s.content,e-a-1,n);return u&&t.replaceChild(o,s.copy(u))}function Kt(t,e,n){if(n.openStart>t.depth)throw new Wt("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Wt("Inconsistent open depths");return Gt(t,e,n,0)}function Gt(t,e,n,r){var i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0;i--)r=e.node(i).copy(qt.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return ne(o,re(t,s.start,s.end,e,r))}var u=t.parent,c=u.content;return ne(u,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}return ne(o,ie(t,e,r))}function Xt(t,e){if(!e.type.compatibleContent(t.type))throw new Wt("Cannot join "+e.type.name+" onto "+t.type.name)}function Qt(t,e,n){var r=t.node(n);return Xt(r,e.node(n)),r}function te(t,e){var 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 ee(t,e,n,r){var i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(te(t.nodeAfter,r),o++));for(var s=o;si&&Qt(t,e,i+1),a=r.depth>i&&Qt(n,r,i+1),s=[];return ee(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(Xt(o,a),te(ne(o,re(t,e,n,r,i+1)),s)):(o&&te(ne(o,ie(t,e,i+1)),s),ee(e,n,i,s),a&&te(ne(a,ie(n,r,i+1)),s)),ee(r,null,i,s),new qt(s)}function ie(t,e,n){var r=[];(ee(null,t,n,r),t.depth>n)&&te(ne(Qt(t,e,n+1),ie(t,e,n+1)),r);return ee(e,null,n,r),new qt(r)}Zt.empty=new Zt(qt.empty,0,0);var oe=function(){function t(e,n,r){C(this,t),this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return E(t,[{key:"resolveDepth",value:function(t){return null==t?this.depth:t<0?this.depth+t:t}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(t){return this.path[3*this.resolveDepth(t)]}},{key:"index",value:function(t){return this.path[3*this.resolveDepth(t)+1]}},{key:"indexAfter",value:function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}},{key:"end",value:function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}},{key:"before",value:function(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]}},{key:"after",value:function(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}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}},{key:"nodeBefore",get:function(){var 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)}},{key:"posAtIndex",value:function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,i=0;i0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}},{key:"blockRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,e=arguments.length>1?arguments[1]:void 0;if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new ce(this,t,n);return null}},{key:"sameParent",value:function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}},{key:"max",value:function(t){return t.pos>this.pos?t:this}},{key:"min",value:function(t){return t.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,a=e;;){var s=a.content.findIndex(o),u=s.index,c=s.offset,l=o-c;if(r.push(a,u,i+c),!l||(a=a.child(u)).isText)break;o=l-1,i+=c+1}return new t(n,r,o)}},{key:"resolveCached",value:function(e,n){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:Ht.none;C(this,t),this.type=e,this.attrs=n,this.marks=i,this.content=r||qt.empty}return E(t,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(t){return this.content.child(t)}},{key:"maybeChild",value:function(t){return this.content.maybeChild(t)}},{key:"forEach",value:function(t){this.content.forEach(t)}},{key:"nodesBetween",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(t,e,n,r,this)}},{key:"descendants",value:function(t){this.nodesBetween(0,this.content.size,t)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(t,e,n,r){return this.content.textBetween(t,e,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}},{key:"sameMarkup",value:function(t){return this.hasMarkup(t.type,t.attrs,t.marks)}},{key:"hasMarkup",value:function(t,e,n){return this.type==t&&Ut(this.attrs,e||t.defaultAttrs||le)&&Ht.sameSet(this.marks,n||Ht.none)}},{key:"copy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}},{key:"cut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t==e)return Zt.empty;var r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),a=r.start(o),s=r.node(o).content.cut(r.pos-a,i.pos-a);return new Zt(s,r.depth-o,i.depth-o)}},{key:"replace",value:function(t,e,n){return Kt(this.resolve(t),this.resolve(e),n)}},{key:"nodeAt",value:function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,i=n.offset;if(!(e=e.maybeChild(r)))return null;if(i==t||e.isText)return e;t-=i+1}}},{key:"childAfter",value:function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(rt&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),de(this.marks,t)}},{key:"contentMatchAt",value:function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}},{key:"canReplace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qt.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,o=this.contentMatchAt(t).matchFragment(n,r,i),a=o&&o.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var s=r;s0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}},{key:"eq",value:function(t){return this.sameMarkup(t)&&this.text==t.text}},{key:"toJSON",value:function(){var t=p(k(n.prototype),"toJSON",this).call(this);return t.text=this.text,t}}]),n}(he);function de(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var pe=function(){function t(e){C(this,t),this.validEnd=e,this.next=[],this.wrapCache=[]}return E(t,[{key:"matchType",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.childCount,r=this,i=e;r&&i1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];function i(o,a){var s=o.matchFragment(t,n);if(s&&(!e||s.validEnd))return qt.from(a.map((function(t){return t.createAndFill()})));for(var u=0;u=this.next.length)throw new RangeError("There's no ".concat(t,"th edge in this content match"));return this.next[t]}},{key:"toString",value:function(){var t=[];return function e(n){t.push(n);for(var r=0;r"+t.indexOf(e.next[i].next);return r})).join("\n")}}],[{key:"parse",value:function(e,n){var r=new ve(e,n);if(null==r.next)return t.empty;var i=me(r);r.next&&r.err("Unexpected trailing text");var o=ke(function(t){var e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach((function(t){return t.to=e}))}function o(t,e){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(o(n,e))}),[]);if("seq"!=t.type){if("star"==t.type){var a=n();return r(e,a),i(o(t.expr,a),a),[r(a)]}if("plus"==t.type){var s=n();return i(o(t.expr,e),s),i(o(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){for(var u=e,c=0;c-1&&i.push(a)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i}(t,t.next).map((function(e){return 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==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)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=we(t,e)}return e}function be(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function we(t,e){var n=be(t),r=n;return t.eat(",")&&(r="}"!=t.next?be(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _e(t,e){return e-t}function xe(t,e){var n=[];return function e(r){var i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(var o=0;o-1),a=0;a0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new he(this,this.computeAttrs(t),qt.from(e),Ht.setFrom(n))}},{key:"createChecked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e=qt.from(e),this.checkContent(e),new he(this,this.computeAttrs(t),e,Ht.setFrom(n))}},{key:"createAndFill",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=this.computeAttrs(t),(e=qt.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var i=this.contentMatch.matchFragment(e),o=i&&i.fillBefore(qt.empty,!0);return o?new he(this,t,e.append(o),Ht.setFrom(n)):null}},{key:"validContent",value:function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n-1}},{key:"allowsMarks",value:function(t){if(null==this.markSet)return!0;for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:null;return!t&&this.instance?this.instance:new Ht(this,Ce(this.attrs,t))}},{key:"removeFromSet",value:function(t){for(var e=0;e-1}}],[{key:"compile",value:function(e,n){var r=Object.create(null),i=0;return e.forEach((function(e,o){return r[e]=new t(e,i++,n,o)})),r}}]),t}(),Oe=function(){function t(e){C(this,t),this.cached=Object.create(null);var n=this.spec={};for(var r in e)n[r]=e[r];n.nodes=Bt.from(e.nodes),n.marks=Bt.from(e.marks||{}),this.nodes=Ee.compile(this.spec.nodes,this),this.marks=Ae.compile(this.spec.marks,this);var i=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var a=this.nodes[o],s=a.spec.content||"",u=a.spec.marks;a.contentMatch=i[s]||(i[s]=pe.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==u?null:u?De(this,u.split(" ")):""!=u&&a.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],h=l.spec.excludes;l.excluded=null==h?[l]:""==h?[]:De(this,h.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)}return E(t,[{key:"node",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Ee))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)}},{key:"text",value:function(t,e){var n=this.nodes.text;return new fe(n,n.defaultAttrs,t,Ht.setFrom(e))}},{key:"mark",value:function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}},{key:"nodeFromJSON",value:function(t){return he.fromJSON(this,t)}},{key:"markFromJSON",value:function(t){return Ht.fromJSON(this,t)}},{key:"nodeType",value:function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}]),t}();function De(t,e){for(var n=[],r=0;r-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var Pe=function(){function t(e,n){var r=this;C(this,t),this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach((function(t){t.tag?r.tags.push(t):t.style&&r.styles.push(t)})),this.normalizeLists=!this.tags.some((function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}return E(t,[{key:"parse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Be(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}},{key:"parseSlice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Be(this,e,!0);return n.addAll(t,e.from,e.to),Zt.maxOpen(n.finish())}},{key:"matchTag",value:function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=a.charCodeAt(t.length)||a.slice(t.length+1)!=e))){if(o.getAttrs){var s=o.getAttrs(e);if(!1===s)continue;o.attrs=s||void 0}return o}}}}],[{key:"schemaRules",value:function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}},{key:"applyPending",value:function(t){for(var e=0,n=this.pendingMarks;e=0;r--){var i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length)||i.solid)break}if(!e)return!1;this.sync(n);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);var o=Ie(t,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new ze(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}},{key:"closeExtra",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}},{key:"findAtPoint",value:function(t,e){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1);return function t(a,s){for(;a>=0;a--){var u=n[a];if(""==u){if(a==n.length-1||0==a)continue;for(;s>=o;s--)if(t(a-1,s))return!0;return!1}var c=s>0||0==s&&i?e.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!c||c.name!=u&&-1==c.groups.indexOf(u))return!1;s--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}}},{key:"addPendingMark",value:function(t){var e=function(t,e){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var i=r.popFromStashMark(t);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==e)break}}}]),t}();function je(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Fe(t){var e={};for(var n in t)e[n]=t[n];return e}function qe(t,e){var n=e.schema.nodes,r=function(r){var i=n[r];if(!i.allowsMarkType(t))return"continue";var o=[];return function t(n){o.push(n);for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=Ue(n).createDocumentFragment());var i=r,o=[];return t.forEach((function(t){if(o.length||t.marks.length){for(var r=0,a=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.marks[e.type.name];return i&&t.renderSpec(Ue(r),i(e,n))}}],[{key:"renderSpec",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:e.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));var a,s=r?e.createElementNS(r,i):e.createElement(i),u=n[1],c=1;if(u&&"object"==D(u)&&null==u.nodeType&&!Array.isArray(u))for(var l in c=2,u)if(null!=u[l]){var h=l.indexOf(" ");h>0?s.setAttributeNS(l.slice(0,h),l.slice(h+1),u[l]):s.setAttribute(l,u[l])}for(var f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var p=t.renderSpec(e,d,r),v=p.dom,m=p.contentDOM;if(s.appendChild(v),m){if(a)throw new RangeError("Multiple content holes");a=m}}return{dom:s,contentDOM:a}}},{key:"fromSchema",value:function(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}},{key:"nodesFromSchema",value:function(t){var e=Ve(t.nodes);return e.text||(e.text=function(t){return t.text}),e}},{key:"marksFromSchema",value:function(t){return Ve(t.marks)}}]),t}();function Ve(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ue(t){return t.document||window.document}var He=Math.pow(2,16);function We(t,e){return t+e*He}function Ze(t){return 65535&t}var Je=function(){function t(e,n,r){C(this,t),this.pos=e,this.delInfo=n,this.recover=r}return E(t,[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}]),t}(),Ye=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(C(this,t),this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}return E(t,[{key:"recover",value:function(t){var e=0,n=Ze(t);if(!this.inverted)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!0)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,a=0;at)break;var u=this.ranges[a+i],c=this.ranges[a+o],l=s+u;if(t<=l){var h=s+r+((u?t==s?-1:t==l?1:e:e)<0?0:c);if(n)return h;var f=t==(e<0?s:l)?null:We(a/3,t-s),d=t==s?2:t==l?1:4;return(e<0?t!=s:t!=l)&&(d|=8),new Je(h,d,f)}r+=c-u}return n?t+r:new Je(t+r,0,null)}},{key:"touches",value:function(t,e){for(var n=0,r=Ze(e),i=this.inverted?2:1,o=this.inverted?1:2,a=0;at)break;var u=this.ranges[a+i];if(t<=s+u&&a==3*r)return!0;n+=this.ranges[a+o]-u}return!1}},{key:"forEach",value:function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;C(this,t),this.maps=e,this.mirror=n,this.from=r,this.to=i}return E(t,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new t(this.maps,this.mirror,e,n)}},{key:"copy",value:function(){return new t(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}},{key:"appendMapping",value:function(t){for(var e=0,n=this.maps.length;e=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}},{key:"invert",value:function(){var e=new t;return e.appendMappingInverted(this),e}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(var n=this.from;n1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.from;ii&&a=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(Xe);Xe.jsonID("addMark",en);var nn=function(t){v(n,t);var e=m(n);function n(t,r,i){var o;return C(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return E(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=new Zt(tn(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))}),t),n.openStart,n.openEnd);return Qe.fromReplace(t,this.from,this.to,r)}},{key:"invert",value:function(){return new en(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(Xe);Xe.jsonID("removeMark",nn);var rn=function(t){v(n,t);var e=m(n);function n(t,r){var i;return C(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return E(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return Qe.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Qe.fromReplace(t,this.pos,this.pos+1,new Zt(qt.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);if(e){var r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(var i=0;i3&&void 0!==arguments[3]&&arguments[3];return C(this,n),(o=e.call(this)).from=t,o.to=r,o.slice=i,o.structure=a,o}return E(n,[{key:"apply",value:function(t){return this.structure&&un(t,this.from,this.to)?Qe.fail("Structure replace would overwrite content"):Qe.fromReplace(t,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new Ye([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(t){return new n(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new n(e.pos,Math.max(e.pos,r.pos),this.slice)}},{key:"merge",value:function(t){if(!(t instanceof n)||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;var e=this.slice.size+t.slice.size==0?Zt.empty:new Zt(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new n(t.from,this.to,e,this.structure)}var r=this.slice.size+t.slice.size==0?Zt.empty:new Zt(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new n(this.from,this.to+(t.to-t.from),r,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new n(e.from,e.to,Zt.fromJSON(t,e.slice),!!e.structure)}}]),n}(Xe);Xe.jsonID("replace",an);var sn=function(t){v(n,t);var e=m(n);function n(t,r,i,o,a,s){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return C(this,n),(u=e.call(this)).from=t,u.to=r,u.gapFrom=i,u.gapTo=o,u.slice=a,u.insert=s,u.structure=c,u}return E(n,[{key:"apply",value:function(t){if(this.structure&&(un(t,this.from,this.gapFrom)||un(t,this.gapTo,this.to)))return Qe.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Qe.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?Qe.fromReplace(t,this.from,this.to,n):Qe.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new Ye([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(t){var e=this.gapTo-this.gapFrom;return new n(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)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||ir.pos?null:new n(e.pos,r.pos,i,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var 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}}],[{key:"fromJSON",value:function(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 n(e.from,e.to,e.gapFrom,e.gapTo,Zt.fromJSON(t,e.slice),e.insert,!!e.structure)}}]),n}(Xe);function un(t,e,n){for(var r=t.resolve(e),i=n-e,o=r.depth;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var a=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}return!1}function cn(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ln(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=dn(t,e),o=i&&pn(r,e);return o?i.map(fn).concat({type:e,attrs:n}).concat(o.map(fn)):null}function fn(t){return{type:t,attrs:null}}function dn(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;var a=o.length?o[0]:e;return n.canReplaceWith(r,i,a)?o:null}function pn(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:e).contentMatch,u=r;s&&u2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.resolve(e),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var s=i.depth-1,u=n-2;s>o;s--,u--){var c=i.node(s),l=i.index(s);if(c.type.spec.isolating)return!1;var h=c.content.cutByIndex(l,c.childCount),f=r&&r[u]||c;if(f!=c&&(h=h.replaceChild(0,f.type.create(f.attrs))),!c.canReplace(l+1,c.childCount)||!f.type.validContent(h))return!1}var d=i.indexAfter(o),p=r&&r[0];return i.node(o).canReplaceWith(d,d,p?p.type:i.node(o+1).type)}function yn(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.doc.resolve(e),o=qt.empty,a=qt.empty,s=i.depth,u=i.depth-n,c=n-1;s>u;s--,c--){o=qt.from(i.node(s).copy(o));var l=r&&r[c];a=qt.from(l?l.type.create(l.attrs,a):i.node(s).copy(a))}t.step(new an(e,e,new Zt(o.append(a),n,n),!0))}function bn(t,e){var n=t.resolve(e),r=n.index();return function(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function wn(t,e,n){var r=new an(e-n,e+n,Zt.empty,!0);t.step(r)}function _n(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s=0;s--){var u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(u>0?1:0),l=r.node(s),h=!1;if(1==a)h=l.canReplace(c,c,i);else{var f=l.contentMatchAt(c).findWrapping(i.firstChild.type);h=f&&l.canReplaceWith(c,c,f[0])}if(h)return 0==u?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}function kn(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Zt.empty;if(e==n&&!r.size)return null;var i=t.resolve(e),o=t.resolve(n);return Sn(i,o,r)?new an(e,n,r):new Cn(i,o,r).fit()}function Sn(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Xe.jsonID("replaceAround",sn);var Cn=function(){function t(e,n,r){C(this,t),this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=qt.empty;for(var i=0;i<=e.depth;i++){var o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(var a=e.depth;a>0;a--)this.placed=qt.from(e.node(a).copy(this.placed))}return E(t,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;for(var o=this.placed,a=r.depth,s=i.depth;a&&s&&1==o.childCount;)o=o.firstChild.content,a--,s--;var u=new Zt(o,a,s);return e>-1?new sn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new an(r.pos,i.pos,u):null}},{key:"findFittable",value:function(){for(var t=this.unplaced.openStart,e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(var o=1;o<=2;o++)for(var a=1==o?t:this.unplaced.openStart;a>=0;a--){var s=void 0,u=null;a?s=(u=Tn(this.unplaced.content,a-1).firstChild).content:s=this.unplaced.content;for(var c=s.firstChild,l=this.depth;l>=0;l--){var h=this.frontier[l],f=h.type,d=h.match,p=void 0,v=null;if(1==o&&(c?d.matchType(c.type)||(v=d.fillBefore(qt.from(c),!1)):u&&f.compatibleContent(u.type)))return{sliceDepth:a,frontierDepth:l,parent:u,inject:v};if(2==o&&c&&(p=d.findWrapping(c.type)))return{sliceDepth:a,frontierDepth:l,parent:u,wrap:p};if(u&&d.matchType(u.type))break}}}},{key:"openMore",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=Tn(e,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new Zt(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=Tn(e,n);if(i.childCount<=1&&n>0){var o=e.size-n<=n+i.size;this.unplaced=new Zt(Mn(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Zt(Mn(e,n,1),n,r)}},{key:"placeNodes",value:function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,i=t.inject,o=t.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var a=0;a1||0==c||g.content.size)&&(d=y,h.push(An(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==u.childCount?m:-1)))}var b=l==u.childCount;b||(m=-1),this.placed=En(this.placed,n,qt.from(h)),this.frontier[n].match=d,b&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,_=u;w1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,i=n.type,o=e=0;s--){var u=this.frontier[s],c=u.match,l=On(t,s,u.type,c,!0);if(!l||l.childCount)continue t}return{depth:e,fit:a,move:o?t.doc.resolve(t.after(e+1)):t}}}}},{key:"close",value:function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=En(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,i)}return t}},{key:"openFrontierNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=En(this.placed,this.depth,qt.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}},{key:"closeFrontierNode",value:function(){var t=this.frontier.pop().match.fillBefore(qt.empty,!0);t.childCount&&(this.placed=En(this.placed,this.frontier.length,t))}}]),t}();function Mn(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Mn(t.firstChild.content,e-1,n)))}function En(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(En(t.lastChild.content,e-1,n)))}function Tn(t,e){for(var n=0;n1&&(r=r.replaceChild(0,An(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(qt.empty,!0)))),t.copy(r)}function On(t,e,n,r,i){var o=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==o.childCount&&!n.compatibleContent(o.type))return null;var s=r.fillBefore(o.content,!0,a);return s&&!function(t,e,n){for(var r=n;rr){var a=i.contentMatchAt(0),s=a.fillBefore(t).append(t);t=s.append(a.matchFragment(s).fillBefore(qt.empty,!0))}return t}function Ln(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var i=t.start(r);if(ie.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&n.push(r)}return n}var Nn=function(t){v(n,t);var e=m(n);function n(t,r,i){var o;return C(this,n),(o=e.call(this)).pos=t,o.attr=r,o.value=i,o}return E(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return Qe.fail("No node at attribute step's position");var n=Object.create(null);for(var r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;var i=e.type.create(n,null,e.marks);return Qe.fromReplace(t,this.pos,this.pos+1,new Zt(qt.from(i),0,e.isLeaf?0:1))}},{key:"getMap",value:function(){return Ye.empty}},{key:"invert",value:function(t){return new n(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new n(e.pos,e.attr,e.value)}}]),n}(Xe);Xe.jsonID("attr",Nn);var Rn=Error;((Rn=function t(e){var n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype)).constructor=Rn,Rn.prototype.name="TransformError";var In=function(){function t(e){C(this,t),this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ke}return E(t,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(t){var e=this.maybeStep(t);if(e.failed)throw new Rn(e.failed);return this}},{key:"maybeStep",value:function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zt.empty,r=kn(this.doc,t,e,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(t,e,n){return this.replace(t,e,new Zt(qt.from(n),0,0))}},{key:"delete",value:function(t,e){return this.replace(t,e,Zt.empty)}},{key:"insert",value:function(t,e){return this.replaceWith(t,t,e)}},{key:"replaceRange",value:function(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);var i=t.doc.resolve(e),o=t.doc.resolve(n);if(Sn(i,o,r))return t.step(new an(e,n,r));var a=Ln(i,t.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(i.depth+1);a.unshift(s);for(var u=i.depth,c=i.pos-1;u>0;u--,c--){var l=i.node(u).type.spec;if(l.defining||l.definingAsContext||l.isolating)break;a.indexOf(u)>-1?s=u:i.before(u)==c&&a.splice(1,0,-u)}for(var h=a.indexOf(s),f=[],d=r.openStart,p=r.content,v=0;;v++){var m=p.firstChild;if(f.push(m),v==r.openStart)break;p=m.content}for(var g=d-1;g>=0;g--){var y=f[g].type,b=Dn(y);if(b&&i.node(h).type!=y)d=g;else if(b||!y.isTextblock)break}for(var w=r.openStart;w>=0;w--){var _=(w+d+1)%(r.openStart+1),x=f[_];if(x)for(var k=0;k=0&&(t.replace(e,n,r),!(t.steps.length>T));A--){var O=a[A];O<0||(e=i.before(O),n=o.after(O))}}(this,t,e,n),this}},{key:"replaceRangeWith",value:function(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){var i=_n(t.doc,e,r.type);null!=i&&(e=n=i)}t.replaceRange(e,n,new Zt(qt.from(r),0,0))}(this,t,e,n),this}},{key:"deleteRange",value:function(t,e){return function(t,e,n){for(var r=t.doc.resolve(e),i=t.doc.resolve(n),o=Ln(r,i),a=0;a0&&(u||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return t.delete(r.before(s),i.after(s))}for(var c=1;c<=r.depth&&c<=i.depth;c++)if(e-r.start(c)==r.depth-c&&n>r.end(c)&&i.end(c)-n!=i.depth-c)return t.delete(r.before(c),n);t.delete(e,n)}(this,t,e),this}},{key:"lift",value:function(t,e){return function(t,e,n){for(var r=e.$from,i=e.$to,o=e.depth,a=r.before(o+1),s=i.after(o+1),u=a,c=s,l=qt.empty,h=0,f=o,d=!1;f>n;f--)d||r.index(f)>0?(d=!0,l=qt.from(r.node(f).copy(l)),h++):u--;for(var p=qt.empty,v=0,m=o,g=!1;m>n;m--)g||i.after(m+1)1&&void 0!==arguments[1]?arguments[1]:1;return wn(this,t,e),this}},{key:"wrap",value:function(t,e){return function(t,e,n){for(var r=qt.empty,i=n.length-1;i>=0;i--){if(r.size){var o=n[i].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=qt.from(n[i].type.create(n[i].attrs,r))}var a=e.start,s=e.end;t.step(new sn(a,s,a,s,new Zt(r,0,0),n.length,!0))}(this,t,e),this}},{key:"setBlockType",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return vn(this,t,e,n,r),this}},{key:"setNodeMarkup",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return mn(this,t,e,n,r),this}},{key:"setNodeAttribute",value:function(t,e,n){return this.step(new Nn(t,e,n)),this}},{key:"addNodeMark",value:function(t,e){return this.step(new rn(t,e)),this}},{key:"removeNodeMark",value:function(t,e){if(!(e instanceof Ht)){var n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new on(t,e)),this}},{key:"split",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return yn(this,t,e,n),this}},{key:"addMark",value:function(t,e,n){return function(t,e,n,r){var i,o,a=[],s=[];t.doc.nodesBetween(e,n,(function(t,u,c){if(t.isInline){var l=t.marks;if(!r.isInSet(l)&&c.type.allowsMarkType(r.type)){for(var h=Math.max(u,e),f=Math.min(u+t.nodeSize,n),d=r.addToSet(l),p=0;p3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=t.doc.nodeAt(e),o=[],a=e+1,s=0;s=0;d--)t.step(o[d])}(this,t,e,n),this}}]),t}(),zn=Object.create(null),Bn=function(){function t(e,n,r){C(this,t),this.$anchor=e,this.$head=n,this.ranges=r||[new jn(e.min(n),e.max(n))]}return E(t,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var t=this.ranges,e=0;e1&&void 0!==arguments[1]?arguments[1]:Zt.empty,n=e.content.lastChild,r=null,i=0;i2&&void 0!==arguments[2]&&arguments[2],r=t.parent.inlineContent?new $n(t):Jn(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var i=t.depth-1;i>=0;i--){var o=e<0?Jn(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):Jn(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(o)return o}return null}},{key:"near",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(t,e)||this.findFrom(t,-e)||new Wn(t.node(0))}},{key:"atStart",value:function(t){return Jn(t,t,0,0,1)||new Wn(t)}},{key:"atEnd",value:function(t){return Jn(t,t,t.content.size,t.childCount,-1)||new Wn(t)}},{key:"fromJSON",value:function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=zn[e.type];if(!n)throw new RangeError("No selection type ".concat(e.type," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in zn)throw new RangeError("Duplicate use of selection JSON ID "+t);return zn[t]=e,e.prototype.jsonID=t,e}}]),t}();Bn.prototype.visible=!0;var jn=function t(e,n){C(this,t),this.$from=e,this.$to=n},Fn=!1;function qn(t){!Fn&&!t.parent.inlineContent&&(Fn=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var $n=function(t){v(n,t);var e=m(n);function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return C(this,n),qn(t),qn(r),e.call(this,t,r)}return E(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(t,e){var r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return Bn.near(r);var i=t.resolve(e.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.empty;if(p(k(n.prototype),"replace",this).call(this,t,e),e==Zt.empty){var r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor&&t.head==this.head}},{key:"getBookmark",value:function(){return new Vn(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(t.resolve(e.anchor),t.resolve(e.head))}},{key:"create",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}},{key:"between",value:function(t,e,r){var i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){var o=Bn.findFrom(e,r,!0)||Bn.findFrom(e,-r,!0);if(!o)return Bn.near(e,r);e=o.$head}return t.parent.inlineContent||(0==i?t=e:(t=(Bn.findFrom(t,-r,!0)||Bn.findFrom(t,r,!0)).$anchor).pos1&&void 0!==arguments[1]?arguments[1]:Zt.empty;if(e==Zt.empty){t.delete(0,t.doc.content.size);var r=Bn.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else p(k(n.prototype),"replace",this).call(this,t,e)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(t){return new n(t)}},{key:"eq",value:function(t){return t instanceof n}},{key:"getBookmark",value:function(){return Zn}}],[{key:"fromJSON",value:function(t){return new n(t)}}]),n}(Bn);Bn.jsonID("all",Wn);var Zn={map:function(){return this},resolve:function(t){return new Wn(t)}};function Jn(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.inlineContent)return $n.create(t,n);for(var a=r-(i>0?0:1);i>0?a=0;a+=i){var s=e.child(a);if(s.isAtom){if(!o&&Un.isSelectable(s))return Un.create(t,n-(i<0?s.nodeSize:0))}else{var u=Jn(t,s,n+i,i<0?s.childCount:0,i,o);if(u)return u}n+=s.nodeSize*i}return null}function Yn(t,e,n){var r=t.steps.length-1;if(!(r0}},{key:"setStoredMarks",value:function(t){return this.storedMarks=t,this.updated|=2,this}},{key:"ensureMarks",value:function(t){return Ht.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}},{key:"addStoredMark",value:function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(t,e){p(k(n.prototype),"addStep",this).call(this,t,e),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(t){return this.time=t,this}},{key:"replaceSelection",value:function(t){return this.selection.replace(this,t),this}},{key:"replaceSelectionWith",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ht.none))),n.replaceWith(this,t),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(t,e,n){var r,i=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();if(null==n&&(n=e),n=null!==(r=n)&&void 0!==r?r:e,!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var a=this.doc.resolve(e);o=n==e?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,i.text(t,o)),this.selection.empty||this.setSelection(Bn.near(this.selection.$to)),this}},{key:"setMeta",value:function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}},{key:"getMeta",value:function(t){return this.meta["string"==typeof t?t:t.key]}},{key:"isGeneric",get:function(){for(var t in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}]),n}(In);function Gn(t,e){return e&&t?t.bind(e):t}var Xn=function t(e,n,r){C(this,t),this.name=e,this.init=Gn(n.init,r),this.apply=Gn(n.apply,r)},Qn=[new Xn("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Xn("selection",{init:function(t,e){return t.selection||Bn.atStart(e.doc)},apply:function(t){return t.selection}}),new Xn("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Xn("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],tr=function t(e,n){var r=this;C(this,t),this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Qn.slice(),n&&n.forEach((function(t){if(r.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");r.plugins.push(t),r.pluginsByKey[t.key]=t,t.spec.state&&r.fields.push(new Xn(t.key,t.spec.state,t))}))},er=function(){function t(e){C(this,t),this.config=e}return E(t,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(t){return this.applyTransaction(t).state}},{key:"filterTransaction",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n0&&void 0!==arguments[0]?arguments[0]:"key";C(this,t),this.key=or(e)}return E(t,[{key:"get",value:function(t){return t.config.pluginsByKey[this.key]}},{key:"getState",value:function(t){return t[this.key]}}]),t}(),sr=function(){function t(e,n){C(this,t),this.items=e,this.eventCount=n}return E(t,[{key:"popEvent",value:function(e,n){var r=this;if(0==this.eventCount)return null;for(var i,o,a=this.items.length;;a--)if(this.items.get(a-1).selection){--a;break}n&&(i=this.remapping(a,this.items.length),o=i.maps.length);var s,u,c=e.tr,l=[],h=[];return this.items.forEach((function(e,n){if(!e.step)return i||(i=r.remapping(a,n+1),o=i.maps.length),o--,void h.push(e);if(i){h.push(new ur(e.map));var f,d=e.step.map(i.slice(o));d&&c.maybeStep(d).doc&&(f=c.mapping.maps[c.mapping.maps.length-1],l.push(new ur(f,void 0,void 0,l.length+h.length))),o--,f&&i.appendMap(f,o)}else c.maybeStep(e.step);return e.selection?(s=i?e.selection.map(i.slice(o)):e.selection,u=new t(r.items.slice(0,a).append(h.reverse().concat(l)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:u,transform:c,selection:s}}},{key:"addTransform",value:function(e,n,r,i){for(var o=[],a=this.eventCount,s=this.items,u=!i&&s.length?s.get(s.length-1):null,c=0;clr&&(s=function(t,e){var n;return t.forEach((function(t,r){if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,d),a-=d),new t(s.append(o),a)}},{key:"remapping",value:function(t,e){var n=new Ke;return this.items.forEach((function(e,r){var i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}},{key:"addMaps",value:function(e){return 0==this.eventCount?this:new t(this.items.append(e.map((function(t){return new ur(t)}))),this.eventCount)}},{key:"rebased",value:function(e,n){if(!this.eventCount)return this;var r=[],i=Math.max(0,this.items.length-n),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),i);var u=n;this.items.forEach((function(t){var n=o.getMirror(--u);if(null!=n){a=Math.min(a,n);var i=o.maps[n];if(t.step){var c=e.steps[n].invert(e.docs[n]),l=t.selection&&t.selection.map(o.slice(u+1,n));l&&s++,r.push(new ur(i,c,l))}else r.push(new ur(i))}}),i);for(var c=[],l=n;l500&&(h=h.compress(this.items.length-r.length)),h}},{key:"emptyItemCount",value:function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t}},{key:"compress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((function(t,a){if(a>=e)i.push(t),t.selection&&o++;else if(t.step){var s=t.step.map(n.slice(r)),u=s&&s.getMap();if(r--,u&&n.appendMap(u,r),s){var c=t.selection&&t.selection.map(n.slice(r));c&&o++;var l,h=new ur(u.invert(),s,c),f=i.length-1;(l=i.length&&i[f].merge(h))?i[f]=l:i.push(h)}}else t.map&&r--}),this.items.length,0),new t(zt.from(i.reverse()),o)}}]),t}();sr.empty=new sr(zt.empty,0);var ur=function(){function t(e,n,r,i){C(this,t),this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}return E(t,[{key:"merge",value:function(e){if(this.step&&e.step&&!e.selection){var n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}}]),t}(),cr=function t(e,n,r,i){C(this,t),this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i},lr=20;function hr(t,e,n,r){var i,o=n.getMeta(yr);if(o)return o.historyState;n.getMeta(br)&&(t=new cr(t.done,t.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(a&&a.getMeta(yr))return a.getMeta(yr).redo?new cr(t.done.addTransform(n,void 0,r,gr(e)),t.undone,fr(n.mapping.maps[n.steps.length-1]),t.prevTime):new cr(t.done,t.undone.addTransform(n,void 0,r,gr(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new cr(t.done.rebased(n,i),t.undone.rebased(n,i),dr(t.prevRanges,n.mapping),t.prevTime):new cr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),dr(t.prevRanges,n.mapping),t.prevTime);var s=0==t.prevTime||!a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var i=0;i=e[i]&&(n=!0)})),n}(n,t.prevRanges)),u=a?dr(t.prevRanges,n.mapping):fr(n.mapping.maps[n.steps.length-1]);return new cr(t.done.addTransform(n,s?e.selection.getBookmark():void 0,r,gr(e)),sr.empty,u,n.time)}function fr(t){var e=[];return t.forEach((function(t,n,r,i){return e.push(r,i)})),e}function dr(t,e){if(!t)return null;for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new rr({key:yr,state:{init:function(){return new cr(sr.empty,sr.empty,null,0)},apply:function(e,n,r){return hr(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput:function(t,e){var n=e.inputType,r="historyUndo"==n?_r:"historyRedo"==n?xr:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}for(var _r=function(t,e){var n=yr.getState(t);return!(!n||0==n.done.eventCount)&&(e&&pr(n,t,e,!1),!0)},xr=function(t,e){var n=yr.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&pr(n,t,e,!0),!0)},kr={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:"'"},Sr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Mr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/Mac/.test(navigator.platform),Er=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Tr=Mr||Cr&&+Cr[1]<57,Ar=0;Ar<10;Ar++)kr[48+Ar]=kr[96+Ar]=String(Ar);for(Ar=1;Ar<=24;Ar++)kr[Ar+111]="F"+Ar;for(Ar=65;Ar<=90;Ar++)kr[Ar]=String.fromCharCode(Ar+32),Sr[Ar]=String.fromCharCode(Ar);for(var Or in kr)Sr.hasOwnProperty(Or)||(Sr[Or]=kr[Or]);var Dr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Pr(t){var e,n,r,i,o=t.split(/-(?!$)/),a=o[o.length-1];"Space"==a&&(a=" ");for(var s=0;s2&&void 0!==arguments[2])||arguments[2];return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Nr(t){return new rr({props:{handleKeyDown:Rr(t)}})}function Rr(t){var e=function(t){var e=Object.create(null);for(var n in t)e[Pr(n)]=t[n];return e}(t);return function(t,n){var r,i=function(t){var e=!(Tr&&(t.ctrlKey||t.altKey||t.metaKey)||Er&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Sr:kr)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),o=e[Lr(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){var a=e[Lr(i,n,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=kr[n.keyCode])&&r!=i){var s=e[Lr(r,n)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}var Ir=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},zr=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},Br=null,jr=function(t,e,n){var r=Br||(Br=document.createRange());return r.setEnd(t,null!==n&&void 0!==n?n:t.nodeValue.length),r.setStart(t,e||0),r},Fr=function(t,e,n,r){return n&&($r(t,e,n,r,-1)||$r(t,e,n,r,1))},qr=/^(img|br|input|textarea|hr)$/i;function $r(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Vr(t))){var o=t.parentNode;if(!o||1!=o.nodeType||Hr(t)||qr.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Ir(t)+(i<0?0:1),t=o}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?Vr(t):0}}}function Vr(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ur(t,e,n){for(var r=0==e,i=e==Vr(t);r||i;){if(t==n)return!0;var o=Ir(t);if(!(t=t.parentNode))return!1;r=r&&0==o,i=i&&o==Vr(t)}}function Hr(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Wr=function(t){return t.focusNode&&Fr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Zr(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}var Jr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"?navigator:null,Yr=("undefined"===typeof document?"undefined":D(document))<"u"?document:null,Kr=Jr&&Jr.userAgent||"",Gr=/Edge\/(\d+)/.exec(Kr),Xr=/MSIE \d/.exec(Kr),Qr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kr),ti=!!(Xr||Qr||Gr),ei=Xr?document.documentMode:Qr?+Qr[1]:Gr?+Gr[1]:0,ni=!ti&&/gecko\/(\d+)/i.test(Kr);ni&&(/Firefox\/(\d+)/.exec(Kr)||[0,0])[1];var ri=!ti&&/Chrome\/(\d+)/.exec(Kr),ii=!!ri,oi=ri?+ri[1]:0,ai=!ti&&!!Jr&&/Apple Computer/.test(Jr.vendor),si=ai&&(/Mobile\/\w+/.test(Kr)||!!Jr&&Jr.maxTouchPoints>2),ui=si||!!Jr&&/Mac/.test(Jr.platform),ci=/Android \d/.test(Kr),li=!!Yr&&"webkitFontSmoothing"in Yr.documentElement.style,hi=li?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function fi(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function di(t,e){return"number"==typeof t?t:t[e]}function pi(t){var 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 vi(t,e,n){for(var r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument,a=n||t.dom;a;a=zr(a))if(1==a.nodeType){var s=a,u=s==o.body,c=u?fi(o):pi(s),l=0,h=0;if(e.topc.bottom-di(r,"bottom")&&(h=e.bottom-c.bottom+di(i,"bottom")),e.leftc.right-di(r,"right")&&(l=e.right-c.right+di(i,"right")),l||h)if(u)o.defaultView.scrollBy(l,h);else{var f=s.scrollLeft,d=s.scrollTop;h&&(s.scrollTop+=h),l&&(s.scrollLeft+=l);var p=s.scrollLeft-f,v=s.scrollTop-d;e={left:e.left-p,top:e.top-v,right:e.right-p,bottom:e.bottom-v}}if(u)break}}function mi(t){for(var e=[],n=t.ownerDocument,r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=zr(r));return e}function gi(t,e){for(var n=0;n=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);var d=f.left>e.left?f.left-e.left:f.right=(f.left+f.right)/2?1:0));continue}}!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:t,offset:o}:bi(n,r)}function wi(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function _i(t,e,n){var r=t.childNodes.length;if(r&&n.tope.top&&i++}n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?c=t.state.doc.content.size:(0==i||1!=n.nodeType||"BR"!=n.childNodes[i-1].nodeName)&&(c=function(t,e,n,r){for(var i=-1,o=e;o!=t.dom;){var a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)i=a.posBefore;else{if(!(s.right-1?i:t.docView.posFromDOM(e,n,1)}(t,n,i,e))}null==c&&(c=function(t,e,n){var r=bi(e,n),i=r.node,o=r.offset,a=-1;if(1==i.nodeType&&!i.firstChild){var s=i.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,l,e));var v=t.docView.nearestDesc(l,!0);return{pos:c,inside:v?v.posAtStart-v.border:-1}}function ki(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Si=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ci(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),i=r.node,o=r.offset,a=r.atom,s=li||ni;if(3==i.nodeType){if(!s||!Si.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){var u=o,c=o,l=n<0?1:-1;return n<0&&!o?(c++,l=-1):n>=0&&o==i.nodeValue.length?(u--,l=1):n<0?u--:c++,Mi(ki(jr(i,u,c),1),l<0)}var h=ki(jr(i,o,o),n);if(ni&&o&&/\s/.test(i.nodeValue[o-1])&&o=0)}if(null==a&&o&&(n<0||o==Vr(i))){var m=i.childNodes[o-1],g=3==m.nodeType?jr(m,Vr(m)-(s?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(g)return Mi(ki(g,1),!1)}if(null==a&&o=0)}function Mi(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ei(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ti(t,e,n){var r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}var Ai=/[\u0590-\u08ac]/;var Oi=null,Di=null,Pi=!1;function Li(t,e,n){return Oi==e&&Di==n?Pi:(Oi=e,Di=n,Pi="up"==n||"down"==n?function(t,e,n){var r=e.selection,i="up"==n?r.$from:r.$to;return Ti(t,e,(function(){for(var e=t.docView.domFromPos(i.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.contentDOM||r.dom;break}e=r.dom.parentNode}for(var o=Ci(t,i.pos,1),a=e.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=jr(a,0,a.nodeValue.length).getClientRects()}for(var u=0;uc.top+1&&("up"==n?o.top-c.top>2*(c.bottom-o.top):c.bottom-o.bottom>2*(o.bottom-c.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=t.domSelection();return Ai.test(r.parent.textContent)&&s.modify?Ti(t,e,(function(){var e=t.domSelectionRange(),i=e.focusNode,o=e.focusOffset,a=e.anchorNode,u=e.anchorOffset,c=s.caretBidiLevel;s.modify("move",n,"character");var l=r.depth?t.docView.domAfterPos(r.before()):t.dom,h=t.domSelectionRange(),f=h.focusNode,d=h.focusOffset,p=f&&!l.contains(1==f.nodeType?f:f.parentNode)||i==f&&o==d;try{s.collapse(a,u),i&&(i!=a||o!=u)&&s.extend&&s.extend(i,o)}catch(v){}return null!=c&&(s.caretBidiLevel=c),p})):"left"==n||"backward"==n?o:a}(t,e,n))}var Ni=function(){function t(e,n,r,i){C(this,t),this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}return E(t,[{key:"matchesWidget",value:function(t){return!1}},{key:"matchesMark",value:function(t){return!1}},{key:"matchesNode",value:function(t,e,n){return!1}},{key:"matchesHack",value:function(t){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(t){return!1}},{key:"size",get:function(){for(var t=0,e=0;eIr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){i=!1;break}if(c.previousSibling)break}if(null==i&&e==t.childNodes.length)for(var l=t;;l=l.parentNode){if(l==this.dom){i=!0;break}if(l.nextSibling)break}}return(null!==(r=i)&&void 0!==r?r:n>0)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=t;r;r=r.parentNode){var i=this.getDesc(r),o=void 0;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}}}},{key:"getDesc",value:function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e}},{key:"posFromDOM",value:function(t,e,n){for(var r=t;r;r=r.parentNode){var i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}},{key:"descAt",value:function(t){for(var e=0,n=0;et||a instanceof qi){i=t-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ri&&n.side>=0;r--);if(e<=0){for(var u,c=!0;(u=r?this.children[r-1]:null)&&u.dom.parentNode!=this.contentDOM;r--,c=!1);return u&&e&&c&&!u.border&&!u.domAtom?u.domFromPos(u.size,e):{node:this.contentDOM,offset:u?Ir(u.dom)+1:0}}for(var l,h=!0;(l=r2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,i=-1,o=n,a=0;;a++){var s=this.children[a],u=o+s.size;if(-1==r&&t<=u){var c=o+s.border;if(t>=c&&e<=u-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,e,c);t=o;for(var l=a;l>0;l--){var h=this.children[l-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){r=Ir(h.dom)+1;break}t-=h.size}-1==r&&(r=0)}if(r>-1&&(u>e||a==this.children.length-1)){e=u;for(var f=a+1;f3&&void 0!==arguments[3]&&arguments[3],i=Math.min(t,e),o=Math.max(t,e),a=0,s=0;as&&oe){var k=l;l=h,h=k}var S=document.createRange();S.setEnd(h.node,h.offset),S.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(S)}}}},{key:"ignoreMutation",value:function(t){return!this.contentDOM&&"selection"!=t.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(t,e){for(var n=0,r=0;r=n:tn){var a=n+i.border,s=o-i.border;if(t>=a&&e<=s)return this.dirty=t==n||e==o?2:1,void(t!=a||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-a,e-a):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty0&&(o=to(o,0,t,r));for(var s=0;s=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=function(){return qt.empty})}else e.contentElement=this.contentDOM;else e.getContent=function(){return t.node.content};return e}},{key:"matchesNode",value:function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&Ki(e,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(t,e){var n=this,r=this.node.inlineContent,i=e,o=t.composing?this.localCompositionInfo(t,e):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,u=new Xi(this,a&&a.node,t);(function(t,e,n,r){var i=e.locals(t),o=0;if(0==i.length){for(var a=0;ao;)c.push(i[u++]);var y=o+v.nodeSize;if(v.isText){var b=y;u=0&&!a&&u.syncToMarks(o==n.node.childCount?Ht.none:n.node.child(o).marks,r,t),u.placeWidget(e,t,i)}),(function(e,n,a,c){var l;u.syncToMarks(e.marks,r,t),u.findNodeMatch(e,n,a,c)||s&&t.state.selection.from>i&&t.state.selection.to-1&&u.updateNodeAt(e,n,a,l,t)||u.updateNextNode(e,n,a,t,c)||u.addNode(e,n,a,t,i),i+=e.nodeSize})),u.syncToMarks([],r,t),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),Vi(this.contentDOM,this.children,t),si&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}},{key:"localCompositionInfo",value:function(t,e){var n=t.state.selection,r=n.from,i=n.to;if(!(t.state.selection instanceof $n)||re+this.node.content.size)return null;var o=t.domSelectionRange(),a=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=Vr(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){var l=s=0&&l+e.length+s>=n)return s+l;if(n==r&&u.length>=r+e.length-s&&u.slice(r-s,r-s+e.length)==e)return r}}}return-1}(this.node.content,s,r-e,i-e);return u<0?null:{node:a,pos:u,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(t,e){var n=e.node,r=e.pos,i=e.text;if(!this.getDesc(n)){for(var o=n;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)}var a=new Ii(this,o,n,i);t.input.compositionNodes.push(a),this.children=to(this.children,r,r+i.length,t,a)}}},{key:"update",value:function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}},{key:"updateInner",value:function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(t){if(!Ki(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Zi(this.dom,this.nodeDOM,Wi(this.outerDeco,this.node,e),Wi(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(t,e,r,i,o,a){var s,u,c=o.nodeViews[e.type.name],l=c&&c(e,o,(function(){return u?u.parent?u.parent.posBeforeChild(u):void 0:a}),r,i),h=l&&l.dom,f=l&&l.contentDOM;if(e.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(e.text);else h||(h=(s=$e.renderSpec(document,e.type.spec.toDOM(e))).dom,f=s.contentDOM);!f&&!e.isText&&"BR"!=h.nodeName&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),e.type.spec.draggable&&(h.draggable=!0));var d=h;return h=Yi(h,r,e),l?u=new $i(t,e,r,i,h,f||null,d,l,o,a+1):e.isText?new Fi(t,e,r,i,h,d,o):new n(t,e,r,i,h,f||null,d,o,a+1)}}]),n}(Ni);function ji(t,e,n,r,i){return Yi(r,e,t),new Bi(void 0,t,e,n,r,r,r,i,0)}var Fi=function(t){v(n,t);var e=m(n);function n(t,r,i,o,a,s,u){return C(this,n),e.call(this,t,r,i,o,a,null,s,u,0)}return E(n,[{key:"parseRule",value:function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}},{key:"update",value:function(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)}},{key:"inParent",value:function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}},{key:"domFromPos",value:function(t){return{node:this.nodeDOM,offset:t}}},{key:"localPosFromDOM",value:function(t,e,r){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):p(k(n.prototype),"localPosFromDOM",this).call(this,t,e,r)}},{key:"ignoreMutation",value:function(t){return"characterData"!=t.type&&"selection"!=t.type}},{key:"slice",value:function(t,e,r){var i=this.node.cut(t,e),o=document.createTextNode(i.text);return new n(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}},{key:"markDirty",value:function(t,e){p(k(n.prototype),"markDirty",this).call(this,t,e),this.dom!=this.nodeDOM&&(0==t||e==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(Bi),qi=function(t){v(n,t);var e=m(n);function n(){return C(this,n),e.apply(this,arguments)}return E(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(t){return 0==this.dirty&&this.dom.nodeName==t}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(Ni),$i=function(t){v(n,t);var e=m(n);function n(t,r,i,o,a,s,u,c,l,h){var f;return C(this,n),(f=e.call(this,t,r,i,o,a,s,u,l,h)).spec=c,f}return E(n,[{key:"update",value:function(t,e,r,i){if(3==this.dirty)return!1;if(this.spec.update){var o=this.spec.update(t,e,r);return o&&this.updateInner(t,e,r,i),o}return!(!this.contentDOM&&!t.isLeaf)&&p(k(n.prototype),"update",this).call(this,t,e,r,i)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():p(k(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():p(k(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(t,e,r,i){this.spec.setSelection?this.spec.setSelection(t,e,r):p(k(n.prototype),"setSelection",this).call(this,t,e,r,i)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),p(k(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}},{key:"ignoreMutation",value:function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):p(k(n.prototype),"ignoreMutation",this).call(this,t)}}]),n}(Bi);function Vi(t,e,n){for(var r=t.firstChild,i=!1,o=0;o0;){for(var s=void 0;;)if(r){var u=n.children[r-1];if(!(u instanceof zi)){s=u,r--;break}n=u,r=u.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}var c=s.node;if(c){if(c!=t.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}(e.node.content,e)}return E(t,[{key:"destroyBetween",value:function(t,e){if(t!=e){for(var n=t;n>1,o=Math.min(i,t.length);r-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var c=zi.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}},{key:"findNodeMatch",value:function(t,e,n,r){var i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a=n||l<=e?o.push(u):(cn&&o.push(u.slice(n-c,u.size,r)))}return o}function eo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;var i=t.docView.nearestDesc(n.focusNode),o=i&&0==i.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,u,c=r.resolve(a);if(Wr(n)){for(s=c;i&&!i.node;)i=i.parent;var l=i.node;if(i&&l.isAtom&&Un.isSelectable(l)&&i.parent&&(!l.isInline||!Ur(n.focusNode,n.focusOffset,i.dom))){var h=i.posBefore;u=new Un(a==h?c:r.resolve(h))}}else{var f=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;s=r.resolve(f)}if(!u){var d="pointer"==e||t.state.selection.head1&&void 0!==arguments[1]&&arguments[1],n=t.state.selection;if(lo(t,n),no(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ii){var r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Fr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)co(t);else{var o,a,s=n.anchor,u=n.head;io&&!(n instanceof $n)&&(n.$from.parent.inlineContent||(o=oo(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=oo(t,n.to))),t.docView.setSelection(s,u,t.root,e),io&&(o&&so(o),a&&so(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&uo(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}var io=ai||ii&&oi<63;function oo(t,e){var n=t.docView.domFromPos(e,0),r=n.node,i=n.offset,o=i0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return a&&Bn.findFrom(a,e)}function go(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function yo(t,e,n){var r=t.state.selection;if(!(r instanceof $n)){if(r instanceof Un&&r.node.isInline)return go(t,new $n(e>0?r.$to:r.$from));var i=mo(t.state,e);return!!i&&go(t,i)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var o=mo(t.state,e);return!!(o&&o instanceof Un)&&go(t,o)}if(!(ui&&n.indexOf("m")>-1)){var a,s=r.$head,u=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!u||u.isText)return!1;var c=e<0?s.pos-u.nodeSize:s.pos;return!!(u.isAtom||(a=t.docView.descAt(c))&&!a.contentDOM)&&(Un.isSelectable(u)?go(t,new Un(e<0?t.state.doc.resolve(s.pos-u.nodeSize):s)):!!li&&go(t,new $n(t.state.doc.resolve(e<0?c:c+u.nodeSize))))}}function bo(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function wo(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function _o(t){var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(n){var i,o,a=!1;for(ni&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(wo(s))i=n,o=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(ko(n))break;for(var u=n.previousSibling;u&&wo(u);)i=n.parentNode,o=Ir(u),u=u.previousSibling;if(u)r=bo(n=u);else{if((n=n.parentNode)==t.dom)break;r=0}}a?So(t,n,r):i&&So(t,i,o)}}function xo(t){var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(n){for(var i,o,a=bo(n);;)if(r-1||ui&&n.indexOf("m")>-1)return!1;var i=r.$from,o=r.$to;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var a=mo(t.state,e);if(a&&a instanceof Un)return go(t,a)}if(!i.parent.inlineContent){var s=e<0?i:o,u=r instanceof Wn?Bn.near(s,e):Bn.findFrom(s,e);return!!u&&go(t,u)}return!1}function Mo(t,e){if(!(t.state.selection instanceof $n))return!0;var n=t.state.selection,r=n.$head,i=n.$anchor,o=n.empty;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var a=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=t.state.tr;return e<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),t.dispatch(s),!0}return!1}function Eo(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function To(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||ui&&72==n&&"c"==r?Mo(t,-1)||_o(t):46==n||ui&&68==n&&"c"==r?Mo(t,1)||xo(t):13==n||27==n||(37==n||ui&&66==n&&"c"==r?yo(t,-1,r)||_o(t):39==n||ui&&70==n&&"c"==r?yo(t,1,r)||xo(t):38==n||ui&&80==n&&"c"==r?Co(t,-1,r)||_o(t):40==n||ui&&78==n&&"c"==r?function(t){if(!ai||t.state.selection.$head.parentOffset>0)return!1;var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var i=n.firstChild;Eo(t,i,"true"),setTimeout((function(){return Eo(t,i,"false")}),20)}return!1}(t)||Co(t,1,r)||xo(t):r==(ui?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ao(t,e){t.someProp("transformCopied",(function(n){e=n(e,t)}));for(var n=[],r=e,i=r.content,o=r.openStart,a=r.openEnd;o>1&&a>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,a--;var s=i.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),i=s.content}var u=t.someProp("clipboardSerializer")||$e.fromSchema(t.state.schema),c=jo(),l=c.createElement("div");l.appendChild(u.serializeFragment(i,{document:c}));for(var h,f=l.firstChild,d=0;f&&1==f.nodeType&&(h=zo[f.nodeName.toLowerCase()]);){for(var p=h.length-1;p>=0;p--){for(var v=c.createElement(h[p]);l.firstChild;)v.appendChild(l.firstChild);l.appendChild(v),d++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice","".concat(o," ").concat(a).concat(d?" -".concat(d):""," ").concat(JSON.stringify(n))),{dom:l,text:t.someProp("clipboardTextSerializer",(function(n){return n(e,t)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Oo(t,e,n,r,i){var o,a,s=i.parent.type.spec.code;if(!n&&!e)return null;var u=e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",(function(n){e=n(e,s||r,t)})),s)return e?new Zt(qt.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):Zt.empty;var c=t.someProp("clipboardTextParser",(function(n){return n(e,i,r,t)}));if(c)a=c;else{var l=i.marks(),h=t.state.schema,f=$e.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((function(t){var e=o.appendChild(document.createElement("p"));t&&e.appendChild(f.serializeNode(h.text(t,l)))}))}}else t.someProp("transformPastedHTML",(function(e){n=e(n,t)})),o=function(t){var e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=jo().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);if((n=i&&zo[i[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return""})).reverse().join("")),r.innerHTML=t,n)for(var o=0;o0;v--){for(var m=o.firstChild;m&&1!=m.nodeType;)m=m.nextSibling;if(!m)break;o=m}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Pe.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!(!u&&!p),context:i,ruleFromNode:function(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Do.test(t.parentNode.nodeName)?null:{ignore:!0}}})),p)a=function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(c){return t}for(var i=t.content,o=t.openStart,a=t.openEnd,s=n.length-2;s>=0;s-=2){var u=r.nodes[n[s]];if(!u||u.hasRequiredAttrs())break;i=qt.from(u.create(n[s+1],i)),o++,a++}return new Zt(i,o,a)}(Io(a,+p[1],+p[2]),p[4]);else if((a=Zt.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var r=e.node(n).contentMatchAt(e.index(n)),i=void 0,o=[];if(t.forEach((function(t){if(o){var e,n=r.findWrapping(t.type);if(!n)return o=null;if(e=o.length&&i.length&&Lo(n,i,t,o[o.length-1],0))o[o.length-1]=e;else{o.length&&(o[o.length-1]=No(o[o.length-1],i.length));var a=Po(t,n);o.push(a),r=r.matchType(a.type),i=n}}})),o)return{v:qt.from(o)}},r=e.depth;r>=0;r--){var i=n(r);if("object"===D(i))return i.v}return t}(a.content,i),!0)).openStart||a.openEnd){for(var g=0,y=0,b=a.content.firstChild;g2&&void 0!==arguments[2]?arguments[2]:0,r=e.length-1;r>=n;r--)t=e[r].create(null,qt.from(t));return t}function Lo(t,e,n,r,i){if(i=n&&(s=e<0?a.contentMatchAt(0).fillBefore(s,t.childCount>1||o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(qt.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(s))}function Io(t,e,n){return eo.depth?e(t,n,o.nodeAfter,o.before(r),i,!0):e(t,n,o.node(r),o.before(r),i,!1)})))return{v:!0}},s=o.depth+1;s>0;s--){var u=a(s);if("object"===D(u))return u.v}return!1}function Yo(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Ko(t,e,n,r,i){return Jo(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(i?function(t,e){if(-1==e)return!1;var n,r,i=t.state.selection;i instanceof Un&&(n=i.node);for(var o=t.state.doc.resolve(e),a=o.depth+1;a>0;a--){var s=a>o.depth?o.nodeAfter:o.node(a);if(Un.isSelectable(s)){r=n&&i.$from.depth>0&&a>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(a);break}}return null!=r&&(Yo(t,Un.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Un.isSelectable(r))&&(Yo(t,new Un(n),"pointer"),!0)}(t,n))}function Go(t,e,n,r){return Jo(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function Xo(t,e,n,r){return Jo(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e,n){if(0!=n.button)return!1;var r=t.state.doc;if(-1==e)return!!r.inlineContent&&(Yo(t,$n.create(r,0,r.content.size),"pointer"),!0);for(var i=r.resolve(e),o=i.depth+1;o>0;o--){var a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)Yo(t,$n.create(r,s+1,s+1+a.content.size),"pointer");else{if(!Un.isSelectable(a))continue;Yo(t,Un.create(r,s),"pointer")}return!0}}(t,n,r)}function Qo(t){return aa(t)}qo.keydown=function(t,e){var n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!na(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!ci||!ii||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!si||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(function(e){return e(t,n)}))||To(t,n)?n.preventDefault():Uo(t,"key");else{var r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout((function(){t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",(function(e){return e(t,Zr(13,"Enter"))})),t.input.lastIOSEnter=0)}),200)}},qo.keyup=function(t,e){16==e.keyCode&&(t.input.shiftKey=!1)},qo.keypress=function(t,e){var n=e;if(!(na(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ui&&n.metaKey))if(t.someProp("handleKeyPress",(function(e){return e(t,n)})))n.preventDefault();else{var r=t.state.selection;if(!(r instanceof $n)||!r.$from.sameParent(r.$to)){var i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",(function(e){return e(t,r.$from.pos,r.$to.pos,i)}))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}}};var ta=ui?"metaKey":"ctrlKey";Fo.mousedown=function(t,e){var n=e;t.input.shiftKey=n.shiftKey;var r=Qo(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[ta]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};var a=t.posAtCoords(Zo(n));a&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ea(t,a,n,!!r)):("doubleClick"==o?Go:Xo)(t,a.pos,a.inside,n)?n.preventDefault():Uo(t,"pointer"))};var ea=function(){function t(e,n,r,i){var o,a,s=this;if(C(this,t),this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[ta],this.allowDefault=r.shiftKey,n.inside>-1)o=e.state.doc.nodeAt(n.inside),a=n.inside;else{var u=e.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}var c=i?null:r.target,l=c?e.docView.nearestDesc(c,!0):null;this.target=l?l.dom:null;var h=e.state.selection;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||h instanceof Un&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ni||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((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Uo(e,"pointer")}return E(t,[{key:"done",value:function(){var t=this;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((function(){return ro(t.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(t){if(this.done(),this.view.dom.contains(t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Zo(t))),this.updateAllowDefault(t),this.allowDefault||!e?Uo(this.view,"pointer"):Ko(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||ai&&this.mightDrag&&!this.mightDrag.node.isAtom||ii&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Yo(this.view,Bn.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Uo(this.view,"pointer")}}},{key:"move",value:function(t){this.updateAllowDefault(t),Uo(this.view,"pointer"),0==t.buttons&&this.done()}},{key:"updateAllowDefault",value:function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}]),t}();function na(t,e){return!!t.composing||!!(ai&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Fo.touchstart=function(t){t.input.lastTouch=Date.now(),Qo(t),Uo(t,"pointer")},Fo.touchmove=function(t){t.input.lastTouch=Date.now(),Uo(t,"pointer")},Fo.contextmenu=function(t){return Qo(t)};var ra=ci?5e3:-1;function ia(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((function(){return aa(t)}),e))}function oa(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){var t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function aa(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(ci&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),oa(t),e||t.docView&&t.docView.dirty){var n=eo(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}qo.compositionstart=qo.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),aa(t,!0),t.markCursor=null;else if(aa(t),ni&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){var a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(3==a.nodeType){t.domSelection().collapse(a,a.nodeValue.length);break}i=a,o=-1}t.input.composing=!0}ia(t,ra)},qo.compositionend=function(t,e){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,ia(t,20))};var sa=ti&&ei<15||si&&hi<604;function ua(t,e,n,r){var i=Oo(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,i||Zt.empty)})))return!0;if(!i)return!1;var o=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(i),a=o?t.state.tr.replaceSelectionWith(o,t.input.shiftKey):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Fo.copy=qo.cut=function(t,e){var n=e,r=t.state.selection,i="cut"==n.type;if(!r.empty){var o=sa?null:n.clipboardData,a=Ao(t,r.content()),s=a.dom,u=a.text;o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",u)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},qo.paste=function(t,e){var n=e;if(!t.composing||ci){var r=sa?null:n.clipboardData;r&&ua(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(t.dom.parentNode){var 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((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ua(t,r.value,null,e):ua(t,r.textContent,r.innerHTML,e)}),50)}}(t,n)}};var ca=function t(e,n){C(this,t),this.slice=e,this.move=n},la=ui?"altKey":"ctrlKey";for(var ha in Fo.dragstart=function(t,e){var n=e,r=t.input.mouseDown;if(r&&r.done(),n.dataTransfer){var i=t.state.selection,o=i.empty?null:t.posAtCoords(Zo(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Un?i.to-1:i.to)))if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Un.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=t.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=t.docView&&t.dispatch(t.state.tr.setSelection(Un.create(t.state.doc,a.posBefore)))}var s=t.state.selection.content(),u=Ao(t,s),c=u.dom,l=u.text;n.dataTransfer.clearData(),n.dataTransfer.setData(sa?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",sa||n.dataTransfer.setData("text/plain",l),t.dragging=new ca(s,!n[la])}},Fo.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},qo.dragover=qo.dragenter=function(t,e){return e.preventDefault()},qo.drop=function(t,e){var n=e,r=t.dragging;if(t.dragging=null,n.dataTransfer){var i=t.posAtCoords(Zo(n));if(i){var o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",(function(e){a=e(a,t)})):a=Oo(t,n.dataTransfer.getData(sa?"Text":"text/plain"),sa?null:n.dataTransfer.getData("text/html"),!1,o);var s=!(!r||n[la]);if(t.someProp("handleDrop",(function(e){return e(t,n,a||Zt.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var u=a?xn(t.state.doc,o.pos,a):o.pos;null==u&&(u=o.pos);var c=t.state.tr;s&&c.deleteSelection();var l=c.mapping.map(u),h=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=c.doc;if(h?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),!c.doc.eq(f)){var d=c.doc.resolve(l);if(h&&Un.isSelectable(a.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Un(d));else{var p=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach((function(t,e,n,r){return p=r})),c.setSelection(fo(t,d,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}},Fo.focus=function(t){t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&ro(t)}),20))},Fo.blur=function(t,e){var 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)},Fo.beforeinput=function(t,e){if(ii&&ci&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var n=t.input.domChangeCount;setTimeout((function(){if(t.input.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Zr(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},qo)Fo[ha]=qo[ha];function fa(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var da=function(){function t(e,n){C(this,t),this.toDOM=e,this.spec=n||ya,this.side=this.spec.side||0}return E(t,[{key:"map",value:function(t,e,n,r){var i=t.mapResult(e.from+r,this.side<0?-1:1),o=i.pos;return i.deleted?null:new ma(o-n,o-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&fa(this.spec,e.spec))}},{key:"destroy",value:function(t){this.spec.destroy&&this.spec.destroy(t)}}]),t}(),pa=function(){function t(e,n){C(this,t),this.attrs=e,this.spec=n||ya}return E(t,[{key:"map",value:function(t,e,n,r){var i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ma(i,o,this)}},{key:"valid",value:function(t,e){return e.from1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}},{key:"map",value:function(t,e,n){return this.type.map(t,this,e,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof pa}}],[{key:"widget",value:function(e,n,r){return new t(e,e,new da(n,r))}},{key:"inline",value:function(e,n,r,i){return new t(e,n,new pa(r,i))}},{key:"node",value:function(e,n,r,i){return new t(e,n,new va(r,i))}}]),t}(),ga=[],ya={},ba=function(){function t(e,n){C(this,t),this.local=e.length?e:ga,this.children=n.length?n:ga}return E(t,[{key:"find",value:function(t,e,n){var r=[];return this.findInner(null!==t&&void 0!==t?t:0,null!==e&&void 0!==e?e:1e9,r,0,n),r}},{key:"findInner",value:function(t,e,n,r,i){for(var o=0;o=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;st){var u=this.children[s]+1;this.children[s+2].findInner(t-u,e-u,n,r+u,i)}}},{key:"map",value:function(t,e,n){return this==wa||0==t.maps.length?this:this.mapInner(t,e,0,0,n||ya)}},{key:"mapInner",value:function(e,n,r,i,o){for(var a,s=0;su&&a.to=e){this.children[o]==e&&(r=this.children[o+2]);break}for(var a=e+1,s=a+n.content.size,u=0;ua&&c.type instanceof pa){var l=Math.max(a,c.from)-a,h=Math.min(s,c.to)-a;ll+e-r)){var h=s[c]+e-r;n>=h?s[c+1]=t<=h?-2:-1:o>=i&&u&&(s[c]+=u,s[c+1]+=u)}}r+=u})),e=n.maps[t].map(e,-1),l=e},c=0,l=o;c=r.content.size){h=!0;continue}var v=n.map(t[f+1]+o,-1)-i,m=r.content.findIndex(p),g=m.index,y=m.offset,b=r.maybeChild(g);if(b&&y==p&&y+b.nodeSize==v){var w=s[f+2].mapInner(n,b,d+1,t[f]+o+1,a);w!=wa?(s[f]=p,s[f+1]=v,s[f+2]=w):(s[f+1]=-2,h=!0)}else h=!0}if(h){var _=Ma(function(t,e,n,r,i,o,a){function s(t,e){for(var o=0;on&&r.to0;)e++;t.splice(e,0,n)}function Oa(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=wa&&e.push(r)})),t.cursorWrapper&&e.push(ba.create(t.state.doc,[t.cursorWrapper.deco])),_a.from(e)}var Da={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Pa=ti&&ei<=11,La=function(){function t(){C(this,t),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return E(t,[{key:"set",value:function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}]),t}(),Na=function(){function t(e,n){var r=this;C(this,t),this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new La,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;et.target.nodeValue.length}))?r.flushSoon():r.flush()})),Pa&&(this.onCharData=function(t){r.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return E(t,[{key:"flushSoon",value:function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Da)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&po(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,s=[];if(t.editable)for(var u=0;u1){var l=s.filter((function(t){return"BR"==t.nodeName}));if(2==l.length){var h=l[0],f=l[1];h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}}var d=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&t.input.lastTouch-1||r)&&(i>-1&&(t.docView.markDirty(i,o),function(t){if(!Ra.has(t)&&(Ra.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=ni,Ia)return;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."),Ia=!0}}(t)),this.handleDOMChange(i,o,a,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||ro(t),this.currentSelection.set(n))}}},{key:"registerMutation",value:function(t,e){if(e.indexOf(t.target)>-1)return null;var 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"))||!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var r=0;rDate.now()-50?t.input.lastSelectionOrigin:null,a=eo(t,o);if(a&&!t.state.selection.eq(a)){if(ii&&ci&&13===t.input.lastKeyCode&&Date.now()-100a;f--){var d=o.childNodes[f-1],p=d.pmViewDesc;if("BR"==d.nodeName&&!p){s=f;break}if(!p||p.size)break}var v=t.state.doc,m=t.someProp("domParser")||Pe.fromSchema(t.state.schema),g=v.resolve(u),y=null,b=m.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",findPositions:r,ruleFromNode:za,context:g});if(r&&null!=r[0].pos){var w=r[0].pos,_=r[1]&&r[1].pos;null==_&&(_=w),y={anchor:w+u,head:_+u}}return{doc:b,sel:y,from:u,to:c}}(t,e,n),p=t.state.doc,v=p.slice(d.from,d.to);8===t.input.lastKeyCode&&Date.now()-100=s?o-r:0)+(u-s),s=o}else if(u=u?o-r:0)+(s-u),u=o}return{start:o,endA:s,endB:u}}(v.content,d.doc.content,d.from,l,h);if((si&&t.input.lastIOSEnter>Date.now()-225||ci)&&i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName||"LI"==t.nodeName}))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",(function(e){return e(t,Zr(13,"Enter"))})))t.input.lastIOSEnter=0;else{if(!m){if(!(r&&f instanceof $n&&!f.empty&&f.$head.sameParent(f.$anchor))||t.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){var g=ja(t,t.state.doc,d.sel);g&&!g.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(g))}return}m={start:f.from,endA:f.to,endB:f.to}}if(ii&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){var y=m.endB-m.start;d.sel={anchor:d.sel.anchor+y,head:d.sel.anchor+y}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),ti&&ei<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&" \xa0"==d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)&&(m.start--,m.endA--,m.endB--);var b,w=d.doc.resolveNoCache(m.start-d.from),_=d.doc.resolveNoCache(m.endB-d.from),x=p.resolve(m.start),k=w.sameParent(_)&&w.parent.inlineContent&&x.end()>=m.endA;if((si&&t.input.lastIOSEnter>Date.now()-225&&(!k||i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!k&&w.posm.start&&function(t,e,n,r,i){if(!r.parent.isTextblock||n-e<=i.pos-r.pos||Fa(r,!0,!1)n||Fa(a,!0,!1)e.content.size?null:fo(t,e.resolve(n.anchor),e.resolve(n.head))}function Fa(t,e,n){for(var r=t.depth,i=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n)for(var o=t.node(r).maybeChild(t.indexAfter(r));o&&!o.isLeaf;)o=o.firstChild,i++;return i}var qa=function(){function t(e,n){var r=this;C(this,t),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Vo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Wa),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ua(this),Va(this),this.nodeViews=Ha(this),this.docView=ji(this.state.doc,$a(this),Oa(this),this.dom,this),this.domObserver=new Na(this,(function(t,e,n,i){return Ba(r,t,e,n,i)})),this.domObserver.start(),function(t){var e=function(e){var n=Fo[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=function(e){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0})(t,e)&&!Wo(t,e)&&(t.editable||!(e.type in qo))&&n(t,e)},$o[e]?{passive:!0}:void 0)};for(var n in Fo)e(n);ai&&t.dom.addEventListener("input",(function(){return null})),Ho(t)}(this),this.updatePluginViews()}return E(t,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props}},{key:"update",value:function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ho(this);var e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Wa),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}},{key:"setProps",value:function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)}},{key:"updateState",value:function(t){this.updateStateInner(t,this._props)}},{key:"updateStateInner",value:function(t,e){var n=this.state,r=!1,i=!1;t.storedMarks&&this.composing&&(oa(this),i=!0),this.state=t;var o=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(o||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){var a=Ha(this);(function(t,e){var n=0,r=0;for(var i in t){if(t[i]!=e[i])return!0;n++}for(var o in e)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,r=!0)}(o||e.handleDOMEvents!=this._props.handleDOMEvents)&&Ho(this),this.editable=Ua(this),Va(this);var s=Oa(this),u=$a(this),c=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",l=r||!this.docView.matchesNode(t.doc,u,s);(l||!t.selection.eq(n.selection))&&(i=!0);var h="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top),o=(r.left+r.right)/2,a=i+1;a=i-20){e=s,n=u.top;break}}}return{refDOM:e,refTop:n,stack:mi(t.dom)}}(this);if(i){this.domObserver.stop();var f=l&&(ti||ii)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){var 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){var d=ii?this.trackWrites=this.domSelectionRange().focusNode:null;(r||!this.docView.update(t.doc,u,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ji(t.doc,u,s,this.dom,this)),d&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){var e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Fr(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?ro(this,f):(lo(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():h&&function(t){var e=t.refDOM,n=t.refTop,r=t.stack,i=e?e.getBoundingClientRect().top:0;gi(r,0==i?0:i-n)}(h)}},{key:"scrollToSelection",value:function(){var t=this,e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",(function(e){return e(t)})))if(this.state.selection instanceof Un){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&vi(this,n.getBoundingClientRect(),e)}else vi(this,this.coordsAtPos(this.state.selection.head,1),e)}},{key:"destroyPluginViews",value:function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()}},{key:"updatePluginViews",value:function(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:1;return Ci(this,t,e)}},{key:"domAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(t,e)}},{key:"nodeDOM",value:function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null}},{key:"posAtDOM",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(t,e){return Li(this,e||this.state,t)}},{key:"destroy",value:function(){this.docView&&(function(t){for(var e in t.domObserver.stop(),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,[],Oa(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(t){return function(t,e){!Wo(t,e)&&Fo[e.type]&&(t.editable||!(e.type in qo))&&Fo[e.type](t,e)}(this,t)}},{key:"dispatch",value:function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}},{key:"domSelectionRange",value:function(){return ai&&11===this.root.nodeType&&function(t){for(var e=t.activeElement;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){var e,n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);var i=n.startContainer,o=n.startOffset,a=n.endContainer,s=n.endOffset,u=t.domAtPos(t.state.selection.anchor);return Fr(u.node,u.offset,a,s)&&(i=(e=[a,s,i,o])[0],o=e[1],a=e[2],s=e[3]),{anchorNode:i,anchorOffset:o,focusNode:a,focusOffset:s}}(this):this.domSelection()}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),t}();function $a(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r&&(e.class+=" "+n[r]),"style"==r?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&"contenteditable"!=r&&"nodeName"!=r&&(e[r]=String(n[r]))})),[ma.node(0,t.state.doc.content.size,e)]}function Va(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ma.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Ua(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function Ha(t){var e=Object.create(null);function n(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Wa(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")}function Za(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new rr({view:function(e){return new Ja(e,t)}})}var Ja=function(){function t(e,n){var r,i=this;C(this,t),this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(r=n.width)&&void 0!==r?r:1,this.color=!1===n.color?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var n=function(e){i[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}return E(t,[{key:"destroy",value:function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent;if(n){var r=e.nodeBefore,i=e.nodeAfter;if(r||i){var o=this.editorView.nodeDOM(this.cursorPos-(r?r.nodeSize:0));if(o){var a=o.getBoundingClientRect(),s=r?a.bottom:a.top;r&&i&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:a.left,right:a.right,top:s-this.width/2,bottom:s+this.width/2}}}}if(!t){var u=this.editorView.coordsAtPos(this.cursorPos);t={left:u.left-this.width/2,right:u.left+this.width/2,top:u.top,bottom:u.bottom}}var c,l,h=this.editorView.dom.offsetParent;if(this.element||(this.element=h.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!h||h==document.body&&"static"==getComputedStyle(h).position)c=-pageXOffset,l=-pageYOffset;else{var f=h.getBoundingClientRect();c=f.left-h.scrollLeft,l=f.top-h.scrollTop}this.element.style.left=t.left-c+"px",this.element.style.top=t.top-l+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}},{key:"scheduleRemoval",value:function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)}},{key:"dragover",value:function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){var o=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=xn(this.editorView.state.doc,o,this.editorView.dragging.slice);null!=a&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}]),t}(),Ya=function(t){v(n,t);var e=m(n);function n(t){return C(this,n),e.call(this,t,t)}return E(n,[{key:"map",value:function(t,e){var r=t.resolve(e.map(this.head));return n.valid(r)?new n(r):Bn.near(r)}},{key:"content",value:function(){return Zt.empty}},{key:"eq",value:function(t){return t instanceof n&&t.head==this.head}},{key:"toJSON",value:function(){return{type:"gapcursor",pos:this.head}}},{key:"getBookmark",value:function(){return new Ka(this.anchor)}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new n(t.resolve(e.pos))}},{key:"valid",value:function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e),r=t.node(e);if(0!=n)for(var i=r.child(n-1);;i=i.lastChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var i=r.child(n);;i=i.firstChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}},{key:"findGapCursorFrom",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t:for(;;){if(!r&&n.valid(t))return t;for(var i=t.pos,o=null,a=t.depth;;a--){var s=t.node(a);if(e>0?t.indexAfter(a)0){o=s.child(e>0?t.indexAfter(a):t.index(a)-1);break}if(0==a)return null;i+=e;var u=t.doc.resolve(i);if(n.valid(u))return u}for(;;){var c=e>0?o.firstChild:o.lastChild;if(!c){if(o.isAtom&&!o.isText&&!Un.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*e),r=!1;continue t}break}o=c,i+=e;var l=t.doc.resolve(i);if(n.valid(l))return l}return null}}}]),n}(Bn);Ya.prototype.visible=!1,Ya.findFrom=Ya.findGapCursorFrom,Bn.jsonID("gapcursor",Ya);var Ka=function(){function t(e){C(this,t),this.pos=e}return E(t,[{key:"map",value:function(e){return new t(e.map(this.pos))}},{key:"resolve",value:function(t){var e=t.resolve(this.pos);return Ya.valid(e)?new Ya(e):Bn.near(e)}}]),t}();var Ga=Rr({ArrowLeft:Xa("horiz",-1),ArrowRight:Xa("horiz",1),ArrowUp:Xa("vert",-1),ArrowDown:Xa("vert",1)});function Xa(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){var o=t.selection,a=e>0?o.$to:o.$from,s=o.empty;if(o instanceof $n){if(!i.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=t.doc.resolve(e>0?a.after():a.before())}var u=Ya.findGapCursorFrom(a,e,s);return!!u&&(r&&r(t.tr.setSelection(new Ya(u))),!0)}}function Qa(t,e,n){if(!t||!t.editable)return!1;var r=t.state.doc.resolve(e);if(!Ya.valid(r))return!1;var i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&Un.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new Ya(r))),!0)}function ts(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof Ya))return!1;var n=t.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;for(var i=qt.empty,o=r.length-1;o>=0;o--)i=qt.from(r[o].createAndFill(null,i));var a=t.state.tr.replace(n.pos,n.pos,new Zt(i,0,0));return a.setSelection($n.near(a.doc.resolve(n.pos+1))),t.dispatch(a),!1}function es(t){if(!(t.selection instanceof Ya))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",ba.create(t.doc,[ma.widget(t.selection.head,e,{key:"gapcursor"})])}("undefined"===typeof globalThis?"undefined":D(globalThis))<"u"?globalThis:("undefined"===typeof window?"undefined":D(window))<"u"?window:("undefined"===typeof t?"undefined":D(t))<"u"||("undefined"===typeof self?"undefined":D(self))<"u"&&self;var ns={};function rs(t,e){if(t===e)return!0;if(!t||"object"!=D(t)||!e||"object"!=D(e))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r"u"&&(u=!0),D(c)>"u"&&(c=1/0),function a(c,v){if(null===c)return null;if(0===v)return c;var m,g;if("object"!=D(c))return c;if(t(c,e))m=new e;else if(t(c,n))m=new n;else if(t(c,i))m=new i((function(t,e){c.then((function(e){t(a(e,v-1))}),(function(t){e(a(t,v-1))}))}));else if(o.__isArray(c))m=[];else if(o.__isRegExp(c))m=new RegExp(c.source,s(c)),c.lastIndex&&(m.lastIndex=c.lastIndex);else if(o.__isDate(c))m=new Date(c.getTime());else{if(p&&r.isBuffer(c))return m=r.allocUnsafe?r.allocUnsafe(c.length):new r(c.length),c.copy(m),m;t(c,Error)?m=Object.create(c):D(l)>"u"?(g=Object.getPrototypeOf(c),m=Object.create(g)):(m=Object.create(l),g=l)}if(u){var y=f.indexOf(c);if(-1!=y)return d[y];f.push(c),d.push(m)}for(var b in t(c,e)&&c.forEach((function(t,e){var n=a(e,v-1),r=a(t,v-1);m.set(n,r)})),t(c,n)&&c.forEach((function(t){var e=a(t,v-1);m.add(e)})),c){var w;g&&(w=Object.getOwnPropertyDescriptor(g,b)),(!w||null!=w.set)&&(m[b]=a(c[b],v-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(c);for(b=0;b<_.length;b++){var x=_[b];(S=Object.getOwnPropertyDescriptor(c,x))&&!S.enumerable&&!h||(m[x]=a(c[x],v-1),S.enumerable||Object.defineProperty(m,x,{enumerable:!1}))}}if(h){var k=Object.getOwnPropertyNames(c);for(b=0;b1?e-1:0),o=1;or&&(o+=c.attrs.colspan)}for(var l=0;l1&&(n=!0)}-1==e?e=o:e!=o&&(e=Math.max(e,o))}return e}(t),n=t.childCount,r=[],i=0,o=null,a=[],s=0,u=e*n;s=n){(o||(o=[])).push({type:"overlong_rowspan",pos:l,n:m-y});break}for(var b=i+y*e,w=0;w0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function bs(t){return"row"==t.parent.type.spec.tableRole&&!!t.nodeAfter}function ws(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _s(t,e,n){var r=t.node(-1),i=fs.get(r),o=t.start(-1),a=i.nextCell(t.pos-o,e,n);return null==a?null:t.node(0).resolve(o+a)}function xs(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=h(h({},t),{},{colspan:t.colspan-n});return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some((function(t){return t>0}))||(r.colwidth=null)),r}new ar("selectingCells");var ks=function(t){v(n,t);var e=m(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;C(this,n);var o=t.node(-1),a=fs.get(o),s=t.start(-1),u=a.rectBetween(t.pos-s,i.pos-s),c=t.node(0),l=a.cellsInRect(u).filter((function(t){return t!=i.pos-s}));l.unshift(i.pos-s);var h=l.map((function(t){var e=o.nodeAt(t);if(!e)throw RangeError("No cell with offset ".concat(t," found"));var n=s+t+1;return new jn(c.resolve(n),c.resolve(n+e.content.size))}));return(r=e.call(this,h[0].$from,h[0].$to,h)).$anchorCell=t,r.$headCell=i,r}return E(n,[{key:"map",value:function(t,e){var r=t.resolve(e.map(this.$anchorCell.pos)),i=t.resolve(e.map(this.$headCell.pos));if(bs(r)&&bs(i)&&ws(r,i)){var o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?n.rowSelection(r,i):o&&this.isColSelection()?n.colSelection(r,i):new n(r,i)}return $n.between(r,i)}},{key:"content",value:function(){for(var t=this.$anchorCell.node(-1),e=fs.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[],a=r.top;a0||v>0){var m=d.attrs;if(p>0&&(m=xs(m,0,p)),v>0&&(m=xs(m,m.colspan-v,v)),f.leftr.bottom){var g=h(h({},d.attrs),{},{rowspan:Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top)});d=f.top1&&void 0!==arguments[1]?arguments[1]:Zt.empty,n=t.steps.length,r=this.ranges,i=0;i0)return!1;var n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}},{key:"isRowSelection",value:function(){var t=this.$anchorCell.node(-1),e=fs.get(t),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),i=e.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;var o=r+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==e.width}},{key:"eq",value:function(t){return t instanceof n&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}},{key:"toJSON",value:function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}},{key:"getBookmark",value:function(){return new Ss(this.$anchorCell.pos,this.$headCell.pos)}}],[{key:"colSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=t.node(-1),i=fs.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(e.pos-o),u=t.node(0);return a.top<=s.top?(a.top>0&&(t=u.resolve(o+i.map[a.left])),s.bottom0&&(e=u.resolve(o+i.map[s.left])),a.bottom1&&void 0!==arguments[1]?arguments[1]:t,r=t.node(-1),i=fs.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(e.pos-o),u=t.node(0);return a.left<=s.left?(a.left>0&&(t=u.resolve(o+i.map[a.top*i.width])),s.right0&&(e=u.resolve(o+i.map[s.top*i.width])),a.right2&&void 0!==arguments[2]?arguments[2]:e;return new n(t.resolve(e),t.resolve(r))}}]),n}(Bn);ks.prototype.visible=!1,Bn.jsonID("cell",ks);var Ss=function(){function t(e,n){C(this,t),this.anchor=e,this.head=n}return E(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()=0;i--){var o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){var a=r.before(i),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?a:null}}return null}function Os(t){var e=t.selection,n=function(t){var e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&"cell"==e.node.type.spec.tableRole)return e.$anchor;var n=function(t){for(var e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}(e.$head)||function(t){for(var e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){var r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(var i=t.nodeBefore,o=t.pos;i;i=i.lastChild,o--){var a=i.type.spec.tableRole;if("cell"==a||"header_cell"==a)return t.doc.resolve(o-i.nodeSize)}}(e.$head);if(n)return n;throw new RangeError("No cell found around position ".concat(e.head))}(t),r=n.node(-1),i=n.start(-1),o=fs.get(r);return h(h({},e instanceof ks?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i)),{},{tableStart:i,map:o,table:r})}function Ds(t,e,n){for(var r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1}),i=0;i":"greater","|":"or","\xa2":"cent","\xa3":"pound","\xa4":"currency","\xa5":"yen","\xa9":"(c)","\xaa":"a","\xae":"(r)","\xba":"o","\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xc6":"AE","\xc7":"C","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xd0":"D","\xd1":"N","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xdd":"Y","\xde":"TH","\xdf":"ss","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xe6":"ae","\xe7":"c","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xf0":"d","\xf1":"n","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xfd":"y","\xfe":"th","\xff":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010c":"C","\u010d":"c","\u010e":"D","\u010f":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011a":"E","\u011b":"e","\u011e":"G","\u011f":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012a":"i","\u012b":"i","\u012e":"I","\u012f":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013b":"L","\u013c":"l","\u013d":"L","\u013e":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014c":"O","\u014d":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015a":"S","\u015b":"s","\u015e":"S","\u015f":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016a":"u","\u016b":"u","\u016e":"U","\u016f":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017a":"z","\u017b":"Z","\u017c":"z","\u017d":"Z","\u017e":"z","\u018f":"E","\u0192":"f","\u01a0":"O","\u01a1":"o","\u01af":"U","\u01b0":"u","\u01c8":"LJ","\u01c9":"lj","\u01cb":"NJ","\u01cc":"nj","\u0218":"S","\u0219":"s","\u021a":"T","\u021b":"t","\u0259":"e","\u02da":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038a":"I","\u038c":"O","\u038e":"Y","\u038f":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039a":"K","\u039b":"L","\u039c":"M","\u039d":"N","\u039e":"3","\u039f":"O","\u03a0":"P","\u03a1":"R","\u03a3":"S","\u03a4":"T","\u03a5":"Y","\u03a6":"F","\u03a7":"X","\u03a8":"PS","\u03a9":"W","\u03aa":"I","\u03ab":"Y","\u03ac":"a","\u03ad":"e","\u03ae":"h","\u03af":"i","\u03b0":"y","\u03b1":"a","\u03b2":"b","\u03b3":"g","\u03b4":"d","\u03b5":"e","\u03b6":"z","\u03b7":"h","\u03b8":"8","\u03b9":"i","\u03ba":"k","\u03bb":"l","\u03bc":"m","\u03bd":"n","\u03be":"3","\u03bf":"o","\u03c0":"p","\u03c1":"r","\u03c2":"s","\u03c3":"s","\u03c4":"t","\u03c5":"y","\u03c6":"f","\u03c7":"x","\u03c8":"ps","\u03c9":"w","\u03ca":"i","\u03cb":"y","\u03cc":"o","\u03cd":"y","\u03ce":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040a":"NJ","\u040b":"C","\u040f":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041a":"K","\u041b":"L","\u041c":"M","\u041d":"N","\u041e":"O","\u041f":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042a":"U","\u042b":"Y","\u042c":"","\u042d":"E","\u042e":"Yu","\u042f":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043a":"k","\u043b":"l","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044a":"u","\u044b":"y","\u044c":"","\u044d":"e","\u044e":"yu","\u044f":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045a":"nj","\u045b":"c","\u045d":"u","\u045f":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049a":"KH","\u049b":"kh","\u04a2":"NG","\u04a3":"ng","\u04ae":"UE","\u04af":"ue","\u04b0":"U","\u04b1":"u","\u04ba":"H","\u04bb":"h","\u04d8":"AE","\u04d9":"ae","\u04e8":"OE","\u04e9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E\'","\u0538":"Y\'","\u0539":"T\'","\u053a":"JH","\u053b":"I","\u053c":"L","\u053d":"X","\u053e":"C\'","\u053f":"K","\u0540":"H","\u0541":"D\'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054a":"P","\u054b":"J","\u054c":"R\'","\u054d":"S","\u054e":"V","\u054f":"T","\u0550":"R","\u0551":"C","\u0553":"P\'","\u0554":"Q\'","\u0555":"O\'\'","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062a":"t","\u062b":"th","\u062c":"j","\u062d":"h","\u062e":"kh","\u062f":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063a":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064a":"y","\u064b":"an","\u064c":"on","\u064d":"en","\u064e":"a","\u064f":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067e":"p","\u0686":"ch","\u0698":"zh","\u06a9":"k","\u06af":"g","\u06cc":"y","\u06f0":"0","\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9","\u0e3f":"baht","\u10d0":"a","\u10d1":"b","\u10d2":"g","\u10d3":"d","\u10d4":"e","\u10d5":"v","\u10d6":"z","\u10d7":"t","\u10d8":"i","\u10d9":"k","\u10da":"l","\u10db":"m","\u10dc":"n","\u10dd":"o","\u10de":"p","\u10df":"zh","\u10e0":"r","\u10e1":"s","\u10e2":"t","\u10e3":"u","\u10e4":"f","\u10e5":"k","\u10e6":"gh","\u10e7":"q","\u10e8":"sh","\u10e9":"ch","\u10ea":"ts","\u10eb":"dz","\u10ec":"ts","\u10ed":"ch","\u10ee":"kh","\u10ef":"j","\u10f0":"h","\u1e62":"S","\u1e63":"s","\u1e80":"W","\u1e81":"w","\u1e82":"W","\u1e83":"w","\u1e84":"W","\u1e85":"w","\u1e9e":"SS","\u1ea0":"A","\u1ea1":"a","\u1ea2":"A","\u1ea3":"a","\u1ea4":"A","\u1ea5":"a","\u1ea6":"A","\u1ea7":"a","\u1ea8":"A","\u1ea9":"a","\u1eaa":"A","\u1eab":"a","\u1eac":"A","\u1ead":"a","\u1eae":"A","\u1eaf":"a","\u1eb0":"A","\u1eb1":"a","\u1eb2":"A","\u1eb3":"a","\u1eb4":"A","\u1eb5":"a","\u1eb6":"A","\u1eb7":"a","\u1eb8":"E","\u1eb9":"e","\u1eba":"E","\u1ebb":"e","\u1ebc":"E","\u1ebd":"e","\u1ebe":"E","\u1ebf":"e","\u1ec0":"E","\u1ec1":"e","\u1ec2":"E","\u1ec3":"e","\u1ec4":"E","\u1ec5":"e","\u1ec6":"E","\u1ec7":"e","\u1ec8":"I","\u1ec9":"i","\u1eca":"I","\u1ecb":"i","\u1ecc":"O","\u1ecd":"o","\u1ece":"O","\u1ecf":"o","\u1ed0":"O","\u1ed1":"o","\u1ed2":"O","\u1ed3":"o","\u1ed4":"O","\u1ed5":"o","\u1ed6":"O","\u1ed7":"o","\u1ed8":"O","\u1ed9":"o","\u1eda":"O","\u1edb":"o","\u1edc":"O","\u1edd":"o","\u1ede":"O","\u1edf":"o","\u1ee0":"O","\u1ee1":"o","\u1ee2":"O","\u1ee3":"o","\u1ee4":"U","\u1ee5":"u","\u1ee6":"U","\u1ee7":"u","\u1ee8":"U","\u1ee9":"u","\u1eea":"U","\u1eeb":"u","\u1eec":"U","\u1eed":"u","\u1eee":"U","\u1eef":"u","\u1ef0":"U","\u1ef1":"u","\u1ef2":"Y","\u1ef3":"y","\u1ef4":"Y","\u1ef5":"y","\u1ef6":"Y","\u1ef7":"y","\u1ef8":"Y","\u1ef9":"y","\u2013":"-","\u2018":"\'","\u2019":"\'","\u201c":"\\"","\u201d":"\\"","\u201e":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20a0":"ecu","\u20a2":"cruzeiro","\u20a3":"french franc","\u20a4":"lira","\u20a5":"mill","\u20a6":"naira","\u20a7":"peseta","\u20a8":"rupee","\u20a9":"won","\u20aa":"new shequel","\u20ab":"dong","\u20ac":"euro","\u20ad":"kip","\u20ae":"tugrik","\u20af":"drachma","\u20b0":"penny","\u20b1":"peso","\u20b2":"guarani","\u20b3":"austral","\u20b4":"hryvnia","\u20b5":"cedi","\u20b8":"kazakhstani tenge","\u20b9":"indian rupee","\u20ba":"turkish lira","\u20bd":"russian ruble","\u20bf":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221e":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\ufdfc":"rial","\ufef5":"laa","\ufef7":"laa","\ufef9":"lai","\ufefb":"la"}'),e=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042a":"A","\u042c":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044a":"a","\u044c":"y"},"de":{"\xc4":"AE","\xe4":"ae","\xd6":"OE","\xf6":"oe","\xdc":"UE","\xfc":"ue","\xdf":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221e":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xa2":"centavos","\xa3":"libras","\xa4":"moneda","\u20a3":"francos","\u2211":"suma","\u221e":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xa2":"centime","\xa3":"livre","\xa4":"devise","\u20a3":"franc","\u2211":"somme","\u221e":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xa2":"centavo","\u2211":"soma","\xa3":"libra","\u221e":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xd8":"OE","\xf8":"oe","\xc5":"AA","\xe5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xf8rre end"},"nb":{"&":"og","\xc5":"AA","\xc6":"AE","\xd8":"OE","\xe5":"aa","\xe6":"ae","\xf8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xc5":"AA","\xc4":"AE","\xd6":"OE","\xe5":"aa","\xe4":"ae","\xf6":"oe"}}');function n(n,r){if("string"!=typeof n)throw new Error("slugify: string argument expected");var i=e[(r="string"==typeof r?{replacement:r}:r||{}).locale]||{},o=void 0===r.replacement?"-":r.replacement,a=void 0===r.trim||r.trim,s=n.normalize().split("").reduce((function(e,n){var a=i[n]||t[n]||n;return a===o&&(a=" "),e+a.replace(r.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")}),"");return r.strict&&(s=s.replace(/[^A-Za-z0-9\s]/g,"")),a&&(s=s.trim()),s=s.replace(/\s+/g,o),r.lower&&(s=s.toLowerCase()),s}return n.extend=function(e){Object.assign(t,e)},n},t.exports=n(),t.exports.default=n()}({get exports(){return Bs},set exports(t){Bs=t}});var js=Bs;function Fs(t){try{if(!(t instanceof HTMLAnchorElement))return null;for(var e=t.parentElement;e.parentElement;)e=e.parentElement;var n=new URL(t.href),r=n.hash.match(/^#fn([0-9]+)$/);if(!r||r.length<2)return null;var i=r[1],o=e.querySelector(n.hash);if(!o)return null;if(!((o=o.cloneNode(!0))instanceof HTMLElement))throw new Error("footnote no es HTMLElement");var a=o.querySelector('a[href="#fnef'.concat(i,'"]'));return null==a||a.remove(),o}catch(s){return null}}var qs=function(t){return("0"+parseInt(t).toString(16)).slice(-2)};function $s(t){var e=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!e)throw new Error("no pude parsear el rgb()");return"#"+qs(e[1])+qs(e[2])+qs(e[3])}function Vs(t){var e=t.style.textAlign||t.getAttribute("data-align")||"start";switch(!(t.style.textAlign||t.getAttribute("data-align"))&&"DIV"===t.parentElement.tagName&&t.parentElement.dataset.align&&(e=t.parentElement.dataset.align),e){case"left":return"start";case"right":return"end";case"justify":return null;default:return[null,"center","start","end"].includes(e)?e:(console.error("align invalido!",{node:t,align:e}),null)}}function Us(t){return function(e){return{level:t,align:Vs(e),id:e.id}}}var Hs=new Oe({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:{align:{default:"start"}},parseDOM:[{tag:"p",skip:!0,getAttrs:function(t){return!(1!==t.children.length||!["VIDEO","AUDIO","IFRAME","IMG"].includes(t.children[0].nodeName))&&null}},{tag:"p",getAttrs:function(t){return{align:Vs(t)}}}],toDOM:function(t){return["p",{style:"text-align: ".concat(t.attrs.align)},0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:function(){return["blockquote",{class:"blockquote"},0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return["div",["hr"]]}},heading:{attrs:{level:{default:1},align:{default:"start"},id:{default:null}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:Us(1)},{tag:"h2",getAttrs:Us(2)},{tag:"h3",getAttrs:Us(3)},{tag:"h4",getAttrs:Us(4)},{tag:"h5",getAttrs:Us(5)},{tag:"h6",getAttrs:Us(6)}],toDOM:function(t){var e,n,r=null==(n=null==(e=t.content)?void 0:e.firstChild)?void 0:n.textContent,i={style:"text-align: ".concat(t.attrs.align),id:r?js(r,{lower:!0}):null};return["h"+t.attrs.level,i,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(t){return{params:t.getAttribute("data-params")||""}}}],toDOM:function(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1}},parseDOM:[{tag:"ol",ignore:!0,getAttrs:function(t){var e,n=S(t.children);try{for(n.s();!(e=n.n()).done;){return!!e.value.id.match(/^fn([0-9]+)$/)&&null}}catch(r){n.e(r)}finally{n.f()}}},{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return 1==t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}},bullet_list:{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:function(){return["ul",0]}},list_item:{content:"paragraph block*",defining:!0,parseDOM:[{tag:"li",ignore:!0,getAttrs:function(t){return!!t.id.match(/^fn([0-9]+)$/)&&null}},{tag:"li"}],toDOM:function(){return["li",0]}},text:{group:"inline"},multimedia:{group:"block",attrs:{src:{},kind:{},alt:{default:""}},content:"text*",parseDOM:[{tag:"figure",getAttrs:function(t){var e=t.querySelector("img")||t.querySelector("video")||t.querySelector("audio")||t.querySelector("iframe");return e instanceof HTMLImageElement?{src:e.src,kind:"img"}:e instanceof HTMLVideoElement?{src:e.src,kind:"video"}:e instanceof HTMLAudioElement?{src:e.src,kind:"audio"}:e instanceof HTMLIFrameElement&&{src:e.src,kind:"iframe"}}},{tag:"img",getAttrs:function(t){return{src:t.src,kind:"img",alt:t.alt}}},{tag:"video",getAttrs:function(t){return{src:t.src,kind:"video"}},getContent:function(){return qt.empty}},{tag:"audio",getAttrs:function(t){return{src:t.src,kind:"audio"}},getContent:function(){return qt.empty}},{tag:"iframe",getAttrs:function(t){return{src:t.src,kind:"iframe"}}}],toDOM:function(t){var e=t.attrs,n=e.kind;return["figure",[n,{src:e.src,class:"iframe"===n?"w-100":"max-w-100",controls:["video","audio"].includes(n),alt:"img"===n&&t.attrs.alt||void 0}]]},draggable:!0},footnote:{group:"inline",content:"text*",inline:!0,atom:!0,toDOM:function(){return["footnote"]},parseDOM:[{tag:"footnote"},{tag:"a",priority:100,getAttrs:function(t){return!!Fs(t)&&{}},contentElement:function(t){return Fs(t)}}]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:function(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function(t){return"normal"!=t.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}],toDOM:function(){return["strong"]}},underline:{parseDOM:[{tag:"u"}],toDOM:function(){return["u"]}},strikethrough:{parseDOM:[{tag:"del"}],toDOM:function(){return["del"]}},sub:{parseDOM:[{tag:"sub"}],toDOM:function(){return["sub"]}},sup:{parseDOM:[{tag:"sup"}],toDOM:function(){return["sup"]}},small:{parseDOM:[{tag:"small"}],toDOM:function(){return["small"]}},mark:{attrs:{color:{default:null},backgroundColor:{default:null},outline:{default:null}},parseDOM:[{tag:"mark",getAttrs:function(t){for(var e={},n=t,r=0,i=["color","backgroundColor"];r2&&void 0!==arguments[2]&&arguments[2],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 Ks(t){if(!t.parent.type.spec.isolating)for(var 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 Gs(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1=0;l--)c=qt.from(r[l].create(null,c));c=qt.from(o.copy(c));var h=t.tr.step(new sn(e.pos-1,u,e.pos,u,new Zt(c,1,0),r.length,!0)),f=u+2*r.length;bn(h.doc,f)&&h.join(f),n(h.scrollIntoView())}return!0}var d=Bn.findFrom(e,1),p=d&&d.$from.blockRange(d.$to),v=p&&ln(p);if(null!=v&&v>=e.depth)return n&&n(t.tr.lift(p,v).scrollIntoView()),!0;if(s&&Ys(a,"start",!0)&&Ys(o,"end")){for(var m=o,g=[];g.push(m),!m.isTextblock;)m=m.lastChild;for(var y=a,b=1;!y.isTextblock;y=y.firstChild)b++;if(m.canReplace(m.childCount,m.childCount,y.content)){if(n){for(var w=qt.empty,_=g.length-1;_>=0;_--)w=qt.from(g[_].copy(w));n(t.tr.step(new sn(e.pos-g.length,e.pos+a.nodeSize,e.pos+b,e.pos+a.nodeSize-b,new Zt(w,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function eu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){for(var i=!1,o=0;o0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t||!e)return!1;var n=t.parent.childAfter(t.parentOffset);if(!n.node)return!1;var r=n.node.marks.find((function(t){return t.type===e}));if(!r)return!1;for(var i=t.index(),o=t.start()+n.offset,a=i+1,s=o+n.node.nodeSize;i>0&&r.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;a0;n-=1){var r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function yu(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=r.selection,o=i.$from;return i.to<=o.end()&&(n?!!gu(o,(function(e){return e.type==t})):o.parent.hasMarkup(t,e))}}function bu(t,e){var n=t.selection,r=n.empty,i=n.ranges;if(r)return!1;var o=0,a=[];if(i.forEach((function(e){var n=e.$from,r=e.$to,i=n.pos,s=r.pos;t.doc.nodesBetween(i,s,(function(t,e){if(t.isText||t.marks.length){var n=Math.max(i,e),r=Math.min(s,e+t.nodeSize);o+=r-n,a.push.apply(a,T(t.marks.map((function(t){return{mark:t,from:n,to:r}}))))}}))})),0===o)return!1;var s=a.filter((function(t){return e.name===t.mark.type.name})).reduce((function(t,e){return t+e.to-e.from}),0),u=a.filter((function(t){return t.mark.type!==e&&t.mark.type.excludes(e)})).reduce((function(t,e){return t+e.to-e.from}),0);return(s>0?s+u:s)>=o}function wu(t,e){var n,r=t.selection,i=r.to,o=r.from;if(!r.empty)return t.selection.$from.doc.nodesBetween(o,i,(function(r,i){if(!n){var o=e.isInSet(r.marks);if(!o||!bu(t,e))return;n={node:r,position:i,mark:o}}})),n}function _u(t){return function(e,n){var r=e.selection,i=r.from,o=r.to,a=null;return e.doc.nodesBetween(i,o,(function(t,n){if(a)return!1;t.isTextblock&&(t.type==e.schema.nodes.paragraph||t.type==e.schema.nodes.heading)&&(a=t)})),!!a&&(!n||eu(a.type,h(h({},a.attrs),{},{align:t}))(e,n))}}function xu(t,e,n){var r=t.slice();return r[9]=e[n],r}function ku(t,e,n){var r=t.slice();return r[9]=e[n],r}function Su(t){var e,n,r,i;return{c:function(){(e=W("input")).disabled=n=!t[1],G(e,"id",t[9].id),G(e,"name",t[3]),e.value=t[9].value[t[2]],G(e,"type","radio")},m:function(n,o){V(n,e,o),r||(i=Y(e,"change",t[5]),r=!0)},p:function(t,r){2&r&&n!==(n=!t[1])&&(e.disabled=n)},d:function(t){t&&U(e),r=!1,i()}}}function Cu(t){var e,n,r,i,o,a,s,u,c=t[9].label[t[2]]+"";return{c:function(){e=W("label"),n=W("i"),r=J(),i=W("span"),o=Z(c),a=J(),G(n,"aria-hidden","true"),G(n,"class","fa fa-"+t[9].icon),G(i,"class","sr-only"),G(e,"for",t[9].id),G(e,"title",t[9].label[t[2]]),G(e,"aria-pressed",s=t[0]===t[9].value[t[2]]),G(e,"class",u="btn btn-info mb-0 "+(t[0]===t[9].value[t[2]]?"active":"")),et(e,"disabled",!t[1])},m:function(t,s){V(t,e,s),$(e,n),$(e,r),$(e,i),$(i,o),$(e,a)},p:function(t,n){1&n&&s!==(s=t[0]===t[9].value[t[2]])&&G(e,"aria-pressed",s),1&n&&u!==(u="btn btn-info mb-0 "+(t[0]===t[9].value[t[2]]?"active":""))&&G(e,"class",u),3&n&&et(e,"disabled",!t[1])},d:function(t){t&&U(e)}}}function Mu(t){for(var e,n,r,i=t[4],o=[],a=0;a>>25)+r|0)&r|~n&i)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+e[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+e[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+e[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+e[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+e[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+e[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+e[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+e[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+e[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|r>>>11)+i|0,t[0]=n+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function i(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function o(t){var e,i,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,r(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function a(t){var e,r,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,i(t.subarray(e-64,e)));for(r=(t=e-64>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function s(t){var n,r="";for(n=0;n<4;n+=1)r+=e[t>>8*n+4&15]+e[t>>8*n&15];return r}function u(t){var e;for(e=0;el?new ArrayBuffer(0):(i=l-c,o=new ArrayBuffer(i),a=new Uint8Array(o),s=new Uint8Array(this,c,i),a.set(s),o)}}(),p.prototype.append=function(t){return this.appendBinary(c(t)),this},p.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)n(this._hash,r(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},p.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=r.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},p.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(t,e){var r,i,o,a=e;if(t[a>>2]|=128<<(a%4<<3),a>55)for(n(this._hash,t),a=0;a<16;a+=1)t[a]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,t[14]=i,t[15]=o,n(this._hash,t)},p.hash=function(t,e){return p.hashBinary(c(t),e)},p.hashBinary=function(t,e){var n=u(o(t));return e?d(n):n},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(t){var e,r=f(this._buff.buffer,t,!0),o=r.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)n(this._hash,i(r.subarray(e-64,e)));return this._buff=e-64>2]|=r[e]<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var t=p.prototype.getState.call(this);return t.buff=h(t.buff),t},p.ArrayBuffer.prototype.setState=function(t){return t.buff=l(t.buff,!0),p.prototype.setState.call(this,t)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(t,e){var n=u(a(new Uint8Array(t)));return e?d(n):n},p},t.exports=n()})),r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},r=t.disabled,i=n.bubbles,o=n.cancelable,a=n.detail,s=document.createEvent("Event");s.initEvent(e,i||!0,o||!0),s.detail=a||{};try{t.disabled=!1,t.dispatchEvent(s)}finally{t.disabled=r}return s}function h(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}var f=function(){function t(e,n,i){var o=this;r(this,t),this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:n},this.xhr=new XMLHttpRequest,this.xhr.open("POST",i,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");var a=s("csrf-token");null!=a&&this.xhr.setRequestHeader("X-CSRF-Token",a),this.xhr.addEventListener("load",(function(t){return o.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return o.requestDidError(t)}))}return i(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(JSON.stringify({blob:this.attributes}))}},{key:"requestDidLoad",value:function(t){if(this.status>=200&&this.status<300){var e=this.response,n=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=n,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function(){return this.xhr.status}},{key:"response",get:function(){var t=this.xhr,e=t.responseType,n=t.response;return"json"==e?n:JSON.parse(n)}}]),t}(),d=function(){function t(e){var n=this;r(this,t),this.blob=e,this.file=e.file;var i=e.directUploadData,o=i.url,a=i.headers;for(var s in this.xhr=new XMLHttpRequest,this.xhr.open("PUT",o,!0),this.xhr.responseType="text",a)this.xhr.setRequestHeader(s,a[s]);this.xhr.addEventListener("load",(function(t){return n.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return n.requestDidError(t)}))}return i(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(this.file.slice())}},{key:"requestDidLoad",value:function(t){var e=this.xhr,n=e.status,r=e.response;n>=200&&n<300?this.callback(null,r):this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),t}(),p=0,v=function(){function t(e,n,i){r(this,t),this.id=++p,this.file=e,this.url=n,this.delegate=i}return i(t,[{key:"create",value:function(t){var e=this;a.create(this.file,(function(n,r){if(n)t(n);else{var i=new f(e.file,r,e.url);m(e.delegate,"directUploadWillCreateBlobWithXHR",i.xhr),i.create((function(n){if(n)t(n);else{var r=new d(i);m(e.delegate,"directUploadWillStoreFileWithXHR",r.xhr),r.create((function(e){e?t(e):t(null,i.toJSON())}))}}))}}))}}]),t}();function m(t,e){if(t&&"function"==typeof t[e]){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i1&&void 0!==arguments[1]?arguments[1]:{};return e.file=this.file,e.id=this.directUpload.id,l(this.input,"direct-upload:"+t,{detail:e})}},{key:"dispatchError",value:function(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",(function(t){return e.uploadRequestDidProgress(t)}))}},{key:"url",get:function(){return this.input.getAttribute("data-direct-upload-url")}}]),t}(),y="input[type=file][data-direct-upload-url]:not([disabled])",b=function(){function t(e){r(this,t),this.form=e,this.inputs=u(e,y).filter((function(t){return t.files.length}))}return i(t,[{key:"start",value:function(t){var e=this,n=this.createDirectUploadControllers(),r=function r(){var i=n.shift();i?i.start((function(n){n?(t(n),e.dispatch("end")):r()})):(t(),e.dispatch("end"))};this.dispatch("start"),r()}},{key:"createDirectUploadControllers",value:function(){var t=[];return this.inputs.forEach((function(e){h(e.files).forEach((function(n){var r=new g(e,n);t.push(r)}))})),t}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this.form,"direct-uploads:"+t,{detail:e})}}]),t}(),w="data-direct-uploads-processing",_=new WeakMap,x=!1;function k(){x||(x=!0,document.addEventListener("click",S,!0),document.addEventListener("submit",C),document.addEventListener("ajax:before",M))}function S(t){var e=t.target;("INPUT"==e.tagName||"BUTTON"==e.tagName)&&"submit"==e.type&&e.form&&_.set(e.form,e)}function C(t){E(t)}function M(t){"FORM"==t.target.tagName&&E(t)}function E(t){var e=t.target;if(e.hasAttribute(w))t.preventDefault();else{var n=new b(e),r=n.inputs;r.length&&(t.preventDefault(),e.setAttribute(w,""),r.forEach(A),n.start((function(t){e.removeAttribute(w),t?r.forEach(O):T(e)})))}}function T(t){var e=_.get(t)||c(t,"input[type=submit], button[type=submit]");if(e){var n=e.disabled;e.disabled=!1,e.focus(),e.click(),e.disabled=n}else(e=document.createElement("input")).type="submit",e.style.display="none",t.appendChild(e),e.click(),t.removeChild(e);_.delete(t)}function A(t){t.disabled=!0}function O(t){t.disabled=!1}function P(){window.ActiveStorage&&k()}setTimeout(P,1),t.start=k,t.DirectUpload=v,Object.defineProperty(t,"__esModule",{value:!0})})(Au);var Du=function(t){return t[t.Unordered=0]="Unordered",t[t.Ordered=1]="Ordered",t}(Du||{}),Pu="".concat(origin,"/rails/active_storage");function Lu(t,e){return new Promise((function(n,r){new Au.DirectUpload(t,"".concat(Pu,"/direct_uploads"),{directUploadWillStoreFileWithXHR:function(t){t.upload.addEventListener("progress",(function(t){!function(t,e){var n=document.querySelector(".sutty-editor-placeholder-".concat(t," .progress-bar"));if(n){var r=""+100*e;n.style.width="".concat(r,"%"),n.setAttribute("aria-value-now",r)}}(e,t.loaded/t.total)}))}}).create(function(){var t=c(s.a.mark((function t(e,i){var o,a;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}r(e),t.next=15;break;case 4:return o="".concat(Pu,"/blobs/").concat(i.signed_id,"/").concat(i.filename),t.prev=5,t.next=8,fetch(o,{method:"HEAD"});case 8:a=t.sent,n({url:o,contentType:a.headers.get("content-type")}),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),r(t.t0);case 15:case"end":return t.stop()}}),t,null,[[5,12]])})));return function(e,n){return t.apply(this,arguments)}}())}))}var Nu=new rr({state:{init:function(){return ba.empty},apply:function(t,e){e=e.map(t.mapping,t.doc);var n=t.getMeta(this);if(n){var r,i=S(n);try{var o=function(){var n=r.value;if(n.add){var i=Ou("div",{class:"ProseMirror-placeholder sutty-editor-placeholder-".concat(n.add.id)},["Subiendo archivo...",Ou("div",{class:"progress"},[Ou("div",{class:"progress-bar ".concat(n.add.unknownProgress?"progress-bar-striped progress-bar-animated":""),attributes:{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":"100"},style:{width:"0%"}},[])])]),o=ma.widget(n.add.pos,i,{id:n.add.id});e=e.add(t.doc,[o])}else n.remove&&(e=e.remove(e.find(void 0,void 0,(function(t){return t.id==n.remove.id}))))};for(i.s();!(r=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}return e}},props:{decorations:function(t){return this.getState(t)}}});function Ru(t,e){var n;return null==(n=function(t,e){var n=Nu.getState(t).find(void 0,void 0,(function(t){return t.id==e}));return n.length?n[0]:null}(t,e))?void 0:n.from}function Iu(t){if(t.match(/^image\/.+$/))return"img";if(t.match(/^video\/.+$/))return"video";if(t.match(/^audio\/.+$/))return"audio";if(t.match(/^application\/pdf$/))return"iframe";throw new Error("Tipo de archivo no reconocido")}function zu(t){var e,n,r,i,o,a,s,u;return{c:function(){e=W("button"),n=W("i"),r=J(),(i=W("span")).textContent="".concat(t[2][t[1]]),o=J(),a=W("input"),G(n,"class","fa fa-upload"),G(i,"class","sr-only"),G(e,"type","button"),G(e,"title",t[2][t[1]]),G(e,"class","btn btn-info"),G(a,"type","file"),a.hidden=!0},m:function(c,l){V(c,e,l),$(e,n),$(e,r),$(e,i),V(c,o,l),V(c,a,l),t[7](a),s||(u=[Y(e,"mousedown",K(t[3])),Y(a,"change",K(t[4]))],s=!0)},p:P,i:P,o:P,d:function(n){n&&U(e),n&&U(o),n&&U(a),t[7](null),s=!1,R(u)}}}function Bu(t,e,n){var r,i=e.view,o=e.state,a=o.schema.nodes.multimedia,s=Zs();return t.$$set=function(t){"view"in t&&n(5,i=t.view),"state"in t&&n(6,o=t.state)},[r,s,{es:"Subir imagen, video, audio o PDF",en:"Upload image, video, audio or PDF"},function(){r.click()},function(){if(r.files.length>0&&o.selection.$from.parent.inlineContent){var t=Pt(),e=i.state.tr,n=_n(o.doc,o.selection.to,a);e.setMeta(Nu,[{add:{id:t,pos:n}}]),i.dispatch(e);var s=r.files[0];Lu(s,t).then((function(e){var n=e.url,r=Ru(i.state,t);if(null!=r){var a=o.schema.nodes.multimedia.createChecked({src:n,kind:Iu(s.type)});i.dispatch(i.state.tr.replaceWith(r,r,a).setMeta(Nu,[{remove:{id:t}}]))}})).catch((function(n){console.error(n),i.dispatch(e.setMeta(Nu,[{remove:{id:t}}]))}))}i.focus()},i,o,function(t){st[t?"unshift":"push"]((function(){n(0,r=t)}))}]}var ju=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Bu,zu,z,{view:5,state:6}),r}return n}(Tt);function Fu(t,e,n,r,i){for(var o=qt.empty,a=n.length-1;a>=0;a--)o=qt.from(n[a].type.create(n[a].attrs,o));t.step(new sn(e.start-(r?2:0),e.end,e.start,e.end,new Zt(o,0,0),n.length,!0));for(var s=0,u=0;u0&&e.firstChild.type==t}));return!!a&&(!n||(i.node(a.depth-1).type==t?function(t,e,n,r){var i=t.tr,o=r.end,a=r.$to.end(r.depth);os;a--)o-=i.child(a).nodeSize,r.delete(o-1,o+1);var u=r.doc.resolve(n.start),c=u.nodeAfter;if(r.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var l=0==n.startIndex,h=n.endIndex==i.childCount,f=u.node(-1),d=u.index(-1);if(!f.canReplace(d+(l?0:1),d+1,c.content.append(h?qt.empty:qt.from(i))))return!1;var p=u.pos,v=p+c.nodeSize;return r.step(new sn(p-(l?1:0),v+(h?1:0),p+1,v-1,new Zt((l?qt.empty:qt.from(i.copy(qt.empty))).append(h?qt.empty:qt.from(i.copy(qt.empty))),l?0:1,h?0:1),l?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}function $u(t){var e,n,r,i,o,a;return{c:function(){e=W("button"),G(n=W("i"),"class",r="fa ".concat(t[4])),G(e,"type","button"),G(e,"class","btn btn-info"),e.disabled=i=!t[2],et(e,"active",t[3](t[0]))},m:function(r,i){V(r,e,i),$(e,n),o||(a=Y(e,"mousedown",(function(){I(t[1])&&t[1].apply(this,arguments)})),o=!0)},p:function(o,a){var s=d(a,1)[0];t=o,16&s&&r!==(r="fa ".concat(t[4]))&&G(n,"class",r),4&s&&i!==(i=!t[2])&&(e.disabled=i),9&s&&et(e,"active",t[3](t[0]))},i:P,o:P,d:function(t){t&&U(e),o=!1,a()}}}function Vu(t,e,n){var r,i,o,a,s,u,c=e.view,l=e.state,h=e.kind,f=l.schema.nodes.list_item;return t.$$set=function(t){"view"in t&&n(5,c=t.view),"state"in t&&n(0,l=t.state),"kind"in t&&n(6,h=t.kind)},t.$$.update=function(){65&t.$$.dirty&&n(8,r=h===Du.Unordered?l.schema.nodes.bullet_list:h===Du.Ordered?l.schema.nodes.ordered_list:null),64&t.$$.dirty&&n(4,i=h===Du.Unordered?"fa-list-ul":h===Du.Ordered?"fa-list-ol":"fa-warning"),256&t.$$.dirty&&n(3,o=yu(r,null,!0)),256&t.$$.dirty&&n(7,a=ru(qu(f),function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.$from,a=i.$to,s=o.blockRange(a),u=!1,c=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;var l=n.doc.resolve(s.start-2);c=new ce(l,l,s.depth),s.endIndex1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.$from,a=i.$to,s=o.blockRange(a),u=s&&hn(s,t,e);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}(c)),[u,a,o,r,l,{es:"Bloque de cita",en:"Blockquote"},s,i]}var Zu=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Wu,Hu,z,{view:6,state:0}),r}return n}(Tt);function Ju(t){var e,n;return{c:function(){G(e=W("i"),"class",n="fa fa-".concat(t[2]))},m:function(t,n){V(t,e,n)},p:function(t,r){4&r&&n!==(n="fa fa-".concat(t[2]))&&G(e,"class",n)},d:function(t){t&&U(e)}}}function Yu(t){var e,n,r;return{c:function(){e=W("small"),G(n=W("i"),"class",r="fa fa-".concat(t[2]))},m:function(t,r){V(t,e,r),$(e,n)},p:function(t,e){4&e&&r!==(r="fa fa-".concat(t[2]))&&G(n,"class",r)},d:function(t){t&&U(e)}}}function Ku(t){var e,n,r,i,o,a,s,u=t[7][t[1].name][t[6]]+"";function c(t,e){return t[3]?Yu:Ju}var l=c(t),h=l(t);return{c:function(){e=W("button"),h.c(),n=J(),r=W("span"),i=Z(u),G(r,"class","sr-only"),G(e,"title",o=t[7][t[1].name][t[6]]),G(e,"type","button"),G(e,"class","btn btn-info"),et(e,"active",t[5])},m:function(o,u){V(o,e,u),h.m(e,null),$(e,n),$(e,r),$(r,i),a||(s=Y(e,"mousedown",(function(){I(t[4])&&t[4].apply(this,arguments)})),a=!0)},p:function(r,a){var s=d(a,1)[0];l===(l=c(t=r))&&h?h.p(t,s):(h.d(1),(h=l(t))&&(h.c(),h.m(e,n))),2&s&&u!==(u=t[7][t[1].name][t[6]]+"")&&Q(i,u),2&s&&o!==(o=t[7][t[1].name][t[6]])&&G(e,"title",o),32&s&&et(e,"active",t[5])},i:P,o:P,d:function(t){t&&U(e),h.d(),a=!1,s()}}}function Gu(t,e,n){var r,i,o,a=P,s=function(){return a(),a=j(c,(function(t){return n(10,o=t)})),c};t.$$.on_destroy.push((function(){return a()}));var u=e.view,c=e.alert;s();var l=e.state,h=e.type,f=e.faIcon,d=e.small,p=void 0!==d&&d,v=Zs(),m={es:"Perd\xf3n, no pude pintar esta selecci\xf3n porque contiene una nota al pie. Deseleccionala para poder pintar.",en:"Sorry, I couldn't mark this selection because it contains a footnote. Deselect it to be able to mark."},g=function(t){return function(e,n){var r=!1;return e.selection.content().content.descendants((function(t){return!r&&("footnote"===t.type.name?(r=!0,!1):void 0)})),r?(n&&q(c,o=m[Zs()],o),!1):function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.empty,a=i.$cursor,s=i.ranges;if(o&&!a||!nu(n.doc,s,t))return!1;if(r)if(a)t.isInSet(n.storedMarks||a.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{for(var u=!1,c=n.tr,l=0;!u&&l