@tryghost/comments-ui 0.6.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/umd/comments-ui.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see comments-ui.min.js.LICENSE.txt */
|
|
2
|
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=38)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(5);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){Object(r.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},function(e,t,n){"use strict";e.exports=n(34)},function(e,t,n){"use strict";e.exports=n(30)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(14);var o=n(13);function i(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(13);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(u){s=!0,o=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(13);function o(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},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 a,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return p})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return g})),n.d(t,"h",(function(){return y})),n.d(t,"i",(function(){return f})),n.d(t,"j",(function(){return l})),n.d(t,"k",(function(){return h})),n.d(t,"l",(function(){return c})),n.d(t,"m",(function(){return m})),n.d(t,"n",(function(){return v}));var r=Object.prototype.toString;function o(e){switch(r.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return g(e,Error)}}function i(e,t){return r.call(e)==="[object ".concat(t,"]")}function a(e){return i(e,"ErrorEvent")}function s(e){return i(e,"DOMError")}function u(e){return i(e,"DOMException")}function c(e){return i(e,"String")}function l(e){return null===e||"object"!==typeof e&&"function"!==typeof e}function f(e){return i(e,"Object")}function d(e){return"undefined"!==typeof Event&&g(e,Event)}function p(e){return"undefined"!==typeof Element&&g(e,Element)}function h(e){return i(e,"RegExp")}function v(e){return Boolean(e&&e.then&&"function"===typeof e.then)}function m(e){return f(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function y(e){return"number"===typeof e&&e!==e}function g(e,t){try{return e instanceof t}catch(n){return!1}}},,function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(15),o={};function i(){return Object(r.b)()?e:"undefined"!==typeof window?window:"undefined"!==typeof self?self:o}function a(e,t,n){var r=n||i(),o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}}).call(this,n(21))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return v})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return c})),n.d(t,"h",(function(){return f}));var r=n(0),o=n(25),i=n(7),a=n(12);function s(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"===typeof o)try{c(o,r)}catch(i){}e[t]=o}}function u(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function c(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,u(e,"__sentry_original__",t)}function l(e){return e.__sentry_original__}function f(e){return Object.keys(e).map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))})).join("&")}function d(e){if(Object(i.d)(e))return Object(r.a)({message:e.message,name:e.name,stack:e.stack},h(e));if(Object(i.f)(e)){var t=Object(r.a)({type:e.type,target:p(e.target),currentTarget:p(e.currentTarget)},h(e));return"undefined"!==typeof CustomEvent&&Object(i.g)(e,CustomEvent)&&(t.detail=e.detail),t}return e}function p(e){try{return Object(i.c)(e)?Object(o.b)(e):Object.prototype.toString.call(e)}catch(t){return"<unknown>"}}function h(e){if("object"===typeof e&&null!==e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return Object(a.d)(n[0],t);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:Object(a.d)(o,t)}return""}function m(e){return y(e,new Map)}function y(e,t){if(Object(i.i)(e)){if(void 0!==(s=t.get(e)))return s;var n={};t.set(e,n);for(var r=0,o=Object.keys(e);r<o.length;r++){var a=o[r];"undefined"!==typeof e[a]&&(n[a]=y(e[a],t))}return n}if(Array.isArray(e)){var s;if(void 0!==(s=t.get(e)))return s;n=[];return t.set(e,n),e.forEach((function(e){n.push(y(e,t))})),n}return e}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(31)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o}));var r=n(7);function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"string"!==typeof e||0===t||e.length<=t?e:"".concat(e.substr(0,t),"...")}function i(e,t){var n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);var o=Math.max(t-60,0);o<5&&(o=0);var i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n="'{snip} ".concat(n)),i<r&&(n+=" {snip}"),n}function a(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var o=e[r];try{n.push(String(o))}catch(i){n.push("[value cannot be serialized]")}}return n.join(t)}function s(e,t){return!!Object(r.l)(e)&&(Object(r.k)(t)?t.test(e):"string"===typeof t&&-1!==e.indexOf(t))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(14);function o(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var o=n(24);function i(){return!Object(o.a)()&&"[object process]"===Object.prototype.toString.call("undefined"!==typeof e?e:0)}function a(e,t){return e.require(t)}}).call(this,n(37),n(20)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return s}));var r=n(0),o=n(3),i=n(6);function a(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=[],a=Object(i.a)(e.split("\n").slice(n));try{for(a.s();!(t=a.n()).done;){var s,c=t.value,l=Object(i.a)(r);try{for(l.s();!(s=l.n()).done;){var f=s.value,d=f(c);if(d){o.push(d);break}}}catch(p){l.e(p)}finally{l.f()}}}catch(p){a.e(p)}finally{a.f()}return u(o)}}function s(e){return Array.isArray(e)?a.apply(void 0,Object(o.a)(e)):e}function u(e){if(!e.length)return[];var t=e,n=t[0].function||"",o=t[t.length-1].function||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==o.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return Object(r.a)(Object(r.a)({},e),{},{filename:e.filename||t[0].filename,function:e.function||"?"})})).reverse()}var c="<anonymous>";function l(e){try{return e&&"function"===typeof e&&e.name||c}catch(t){return c}}},,,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))o.call(n,l)&&(u[l]=n[l]);if(r){s=r(n);for(var f=0;f<s.length;f++)i.call(n,s[f])&&(u[s[f]]=n[s[f]])}}return u}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);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}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(35),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var a=l(n);f&&(a=a.concat(f(n)));for(var s=u(t),v=u(n),m=0;m<a.length;++m){var y=a[m];if(!i[y]&&(!r||!r[y])&&(!v||!v[y])&&(!s||!s[y])){var g=d(n,y);try{c(t,y,g)}catch(b){}}}}return t}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(9),o=n(15),i={nowSeconds:function(){return Date.now()/1e3}};var a=Object(o.b)()?function(){try{return Object(o.a)(e,"perf_hooks").performance}catch(t){return}}():function(){var e=Object(r.a)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),s=void 0===a?i:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},u=i.nowSeconds.bind(i),c=s.nowSeconds.bind(s);!function(){var e=Object(r.a)().performance;if(e&&e.now){var t=36e5,n=e.now(),o=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-o):t,a=i<t,s=e.timing&&e.timing.navigationStart,u="number"===typeof s?Math.abs(s+n-o):t;return a||u<t?i<=u?("timeOrigin",e.timeOrigin):("navigationStart",s):("dateNow",o)}"none"}()}).call(this,n(20)(e))},function(e,t,n){"use strict";function r(){return"undefined"!==typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i}));var r=n(9),o=n(7);function i(e,t){try{for(var n,r=e,o=[],i=0,s=0,u=" > ".length;r&&i++<5&&!("html"===(n=a(r,t))||i>1&&s+o.length*u+n.length>=80);)o.push(n),s+=n.length,r=r.parentNode;return o.reverse().join(" > ")}catch(c){return"<unknown>"}}function a(e,t){var n,r,i,a,s,u=e,c=[];if(!u||!u.tagName)return"";c.push(u.tagName.toLowerCase());var l=t&&t.length?t.filter((function(e){return u.getAttribute(e)})).map((function(e){return[e,u.getAttribute(e)]})):null;if(l&&l.length)l.forEach((function(e){c.push("[".concat(e[0],'="').concat(e[1],'"]'))}));else if(u.id&&c.push("#".concat(u.id)),(n=u.className)&&Object(o.l)(n))for(r=n.split(/\s+/),s=0;s<r.length;s++)c.push(".".concat(r[s]));var f=["type","name","title","alt"];for(s=0;s<f.length;s++)i=f[s],(a=u.getAttribute(i))&&c.push("[".concat(i,'="').concat(a,'"]'));return c.join("")}function s(){var e=Object(r.a)();try{return e.document.location.href}catch(t){return""}}},function(e,t,n){"use strict";function r(){var e="function"===typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(var r=0;r<t.length;r++){if(t[r]===n)return!0}return t.push(n),!1},function(n){if(e)t.delete(n);else for(var r=0;r<t.length;r++)if(t[r]===n){t.splice(r,1);break}}]}n.d(t,"a",(function(){return r}))},,,,function(e,t,n){"use strict";var r=n(19),o=60103,i=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,u=60112;t.Suspense=60113;var c=60115,l=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;o=f("react.element"),i=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),a=f("react.provider"),s=f("react.context"),u=f("react.forward_ref"),t.Suspense=f("react.suspense"),c=f("react.memo"),l=f("react.lazy")}var d="function"===typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v={};function m(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}function y(){}function g(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||h}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=m.prototype;var b=g.prototype=new y;b.constructor=g,r(b,m.prototype),b.isPureReactComponent=!0;var k={current:null},w=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function O(e,t,n){var r,i={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)w.call(t,r)&&!x.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];i.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:o,type:e,key:a,ref:s,props:i,_owner:k.current}}function E(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var D=/\/+/g;function S(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function C(e,t,n,r,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case o:case i:u=!0}}if(u)return a=a(u=e),e=""===r?"."+S(u,0):r,Array.isArray(a)?(n="",null!=e&&(n=e.replace(D,"$&/")+"/"),C(a,t,n,"",(function(e){return e}))):null!=a&&(E(a)&&(a=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||u&&u.key===a.key?"":(""+a.key).replace(D,"$&/")+"/")+e)),t.push(a)),1;if(u=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var l=r+S(s=e[c],c);u+=C(s,t,n,l,a)}else if(l=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"===typeof l)for(e=l.call(e),c=0;!(s=e.next()).done;)u+=C(s=s.value,t,n,l=r+S(s,c++),a);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return u}function j(e,t,n){if(null==e)return e;var r=[],o=0;return C(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function _(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var A={current:null};function N(){var e=A.current;if(null===e)throw Error(p(321));return e}var T={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:k,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:j,forEach:function(e,t,n){j(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return j(e,(function(){t++})),t},toArray:function(e){return j(e,(function(e){return e}))||[]},only:function(e){if(!E(e))throw Error(p(143));return e}},t.Component=m,t.PureComponent=g,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(p(267,e));var i=r({},e.props),a=e.key,s=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,u=k.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in t)w.call(t,l)&&!x.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==c?c[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=n;else if(1<l){c=Array(l);for(var f=0;f<l;f++)c[f]=arguments[f+2];i.children=c}return{$$typeof:o,type:e.type,key:a,ref:s,props:i,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=O,t.createFactory=function(e){var t=O.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=E,t.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:_}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return N().useCallback(e,t)},t.useContext=function(e,t){return N().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return N().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return N().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return N().useLayoutEffect(e,t)},t.useMemo=function(e,t){return N().useMemo(e,t)},t.useReducer=function(e,t,n){return N().useReducer(e,t,n)},t.useRef=function(e){return N().useRef(e)},t.useState=function(e){return N().useState(e)},t.version="17.0.2"},function(e,t,n){"use strict";var r=n(2),o=n(19),i=n(32);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));var s=new Set,u={};function c(e,t){l(e,t),l(e+"Capture",t)}function l(e,t){for(u[e]=t,e=0;e<t.length;e++)s.add(t[e])}var f=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,h={},v={};function m(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var g=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function k(e,t,n,r){var o=y.hasOwnProperty(t)?y[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!p.call(v,e)||!p.call(h,e)&&(d.test(e)?v[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(g,b);y[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(g,b);y[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(g,b);y[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=60103,O=60106,E=60107,D=60108,S=60114,C=60109,j=60110,_=60112,A=60113,N=60120,T=60115,M=60116,F=60121,R=60128,P=60129,B=60130,L=60131;if("function"===typeof Symbol&&Symbol.for){var I=Symbol.for;x=I("react.element"),O=I("react.portal"),E=I("react.fragment"),D=I("react.strict_mode"),S=I("react.profiler"),C=I("react.provider"),j=I("react.context"),_=I("react.forward_ref"),A=I("react.suspense"),N=I("react.suspense_list"),T=I("react.memo"),M=I("react.lazy"),F=I("react.block"),I("react.scope"),R=I("react.opaque.id"),P=I("react.debug_trace_mode"),B=I("react.offscreen"),L=I("react.legacy_hidden")}var z,U="function"===typeof Symbol&&Symbol.iterator;function V(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=U&&e[U]||e["@@iterator"])?e:null}function $(e){if(void 0===z)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||""}return"\n"+z+e}var H=!1;function q(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"===typeof u.stack){for(var o=u.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s])return"\n"+o[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$(e):""}function W(e){switch(e.tag){case 5:return $(e.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1);case 11:return e=q(e.type.render,!1);case 22:return e=q(e.type._render,!1);case 1:return e=q(e.type,!0);default:return""}}function K(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case E:return"Fragment";case O:return"Portal";case S:return"Profiler";case D:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case j:return(e.displayName||"Context")+".Consumer";case C:return(e._context.displayName||"Context")+".Provider";case _:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case T:return K(e.type);case F:return K(e._render);case M:t=e._payload,e=e._init;try{return K(e(t))}catch(n){}}return null}function G(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Y(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function J(e){e._valueTracker||(e._valueTracker=function(e){var t=Y(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return o({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=G(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&k(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=G(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?oe(e,t.type,n):t.hasOwnProperty("defaultValue")&&oe(e,t.type,G(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function oe(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ie(e,t){return e=o({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ae(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+G(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ue(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:G(n)}}function ce(e,t){var n=G(t.value),r=G(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function le(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var fe="http://www.w3.org/1999/xhtml",de="http://www.w3.org/2000/svg";function pe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ve,me,ye=(me=function(e,t){if(e.namespaceURI!==de||"innerHTML"in e)e.innerHTML=t;else{for((ve=ve||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ve.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return me(e,t)}))}:me);function ge(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ke=["Webkit","ms","Moz","O"];function we(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function xe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=we(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(be).forEach((function(e){ke.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var Oe=o({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ee(e,t){if(t){if(Oe[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function De(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ce=null,je=null,_e=null;function Ae(e){if(e=ro(e)){if("function"!==typeof Ce)throw Error(a(280));var t=e.stateNode;t&&(t=io(t),Ce(e.stateNode,e.type,t))}}function Ne(e){je?_e?_e.push(e):_e=[e]:je=e}function Te(){if(je){var e=je,t=_e;if(_e=je=null,Ae(e),t)for(e=0;e<t.length;e++)Ae(t[e])}}function Me(e,t){return e(t)}function Fe(e,t,n,r,o){return e(t,n,r,o)}function Re(){}var Pe=Me,Be=!1,Le=!1;function Ie(){null===je&&null===_e||(Re(),Te())}function ze(e,t){var n=e.stateNode;if(null===n)return null;var r=io(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var Ue=!1;if(f)try{var Ve={};Object.defineProperty(Ve,"passive",{get:function(){Ue=!0}}),window.addEventListener("test",Ve,Ve),window.removeEventListener("test",Ve,Ve)}catch(me){Ue=!1}function $e(e,t,n,r,o,i,a,s,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(l){this.onError(l)}}var He=!1,qe=null,We=!1,Ke=null,Ge={onError:function(e){He=!0,qe=e}};function Ye(e,t,n,r,o,i,a,s,u){He=!1,qe=null,$e.apply(Ge,arguments)}function Je(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Xe(e){if(Je(e)!==e)throw Error(a(188))}function Ze(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Je(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Xe(o),e;if(i===r)return Xe(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,u=o.child;u;){if(u===n){s=!0,n=o,r=i;break}if(u===r){s=!0,r=o,n=i;break}u=u.sibling}if(!s){for(u=i.child;u;){if(u===n){s=!0,n=i,r=o;break}if(u===r){s=!0,r=i,n=o;break}u=u.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,ot,it=!1,at=[],st=null,ut=null,ct=null,lt=new Map,ft=new Map,dt=[],pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ht(e,t,n,r,o){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:o,targetContainers:[r]}}function vt(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":ut=null;break;case"mouseover":case"mouseout":ct=null;break;case"pointerover":case"pointerout":lt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ft.delete(t.pointerId)}}function mt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e=ht(t,n,r,o,i),null!==t&&(null!==(t=ro(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function yt(e){var t=no(e.target);if(null!==t){var n=Je(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Qe(n)))return e.blockedOn=t,void ot(e.lanePriority,(function(){i.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function gt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ro(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){gt(e)&&n.delete(t)}function kt(){for(it=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ro(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==st&>(st)&&(st=null),null!==ut&>(ut)&&(ut=null),null!==ct&>(ct)&&(ct=null),lt.forEach(bt),ft.forEach(bt)}function wt(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,kt)))}function xt(e){function t(t){return wt(t,e)}if(0<at.length){wt(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&wt(st,e),null!==ut&&wt(ut,e),null!==ct&&wt(ct,e),lt.forEach(t),ft.forEach(t),n=0;n<dt.length;n++)(r=dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<dt.length&&null===(n=dt[0]).blockedOn;)yt(n),null===n.blockedOn&&dt.shift()}function Ot(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Et={animationend:Ot("Animation","AnimationEnd"),animationiteration:Ot("Animation","AnimationIteration"),animationstart:Ot("Animation","AnimationStart"),transitionend:Ot("Transition","TransitionEnd")},Dt={},St={};function Ct(e){if(Dt[e])return Dt[e];if(!Et[e])return e;var t,n=Et[e];for(t in n)if(n.hasOwnProperty(t)&&t in St)return Dt[e]=n[t];return e}f&&(St=document.createElement("div").style,"AnimationEvent"in window||(delete Et.animationend.animation,delete Et.animationiteration.animation,delete Et.animationstart.animation),"TransitionEvent"in window||delete Et.transitionend.transition);var jt=Ct("animationend"),_t=Ct("animationiteration"),At=Ct("animationstart"),Nt=Ct("transitionend"),Tt=new Map,Mt=new Map,Ft=["abort","abort",jt,"animationEnd",_t,"animationIteration",At,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Nt,"transitionEnd","waiting","waiting"];function Rt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];o="on"+(o[0].toUpperCase()+o.slice(1)),Mt.set(r,t),Tt.set(r,o),c(o,[r])}}(0,i.unstable_now)();var Pt=8;function Bt(e){if(0!==(1&e))return Pt=15,1;if(0!==(2&e))return Pt=14,2;if(0!==(4&e))return Pt=13,4;var t=24&e;return 0!==t?(Pt=12,t):0!==(32&e)?(Pt=11,32):0!==(t=192&e)?(Pt=10,t):0!==(256&e)?(Pt=9,256):0!==(t=3584&e)?(Pt=8,t):0!==(4096&e)?(Pt=7,4096):0!==(t=4186112&e)?(Pt=6,t):0!==(t=62914560&e)?(Pt=5,t):67108864&e?(Pt=4,67108864):0!==(134217728&e)?(Pt=3,134217728):0!==(t=805306368&e)?(Pt=2,t):0!==(1073741824&e)?(Pt=1,1073741824):(Pt=8,e)}function Lt(e,t){var n=e.pendingLanes;if(0===n)return Pt=0;var r=0,o=0,i=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==i)r=i,o=Pt=15;else if(0!==(i=134217727&n)){var u=i&~a;0!==u?(r=Bt(u),o=Pt):0!==(s&=i)&&(r=Bt(s),o=Pt)}else 0!==(i=n&~a)?(r=Bt(i),o=Pt):0!==s&&(r=Bt(s),o=Pt);if(0===r)return 0;if(r=n&((0>(r=31-Ht(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0===(t&a)){if(Bt(t),o<=Pt)return t;Pt=o}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-Ht(t)),r|=e[n],t&=~o;return r}function It(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function zt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Ut(24&~t))?zt(10,t):e;case 10:return 0===(e=Ut(192&~t))?zt(8,t):e;case 8:return 0===(e=Ut(3584&~t))&&(0===(e=Ut(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Ut(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function Ut(e){return e&-e}function Vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $t(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ht(t)]=n}var Ht=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(qt(e)/Wt|0)|0},qt=Math.log,Wt=Math.LN2;var Kt=i.unstable_UserBlockingPriority,Gt=i.unstable_runWithPriority,Yt=!0;function Jt(e,t,n,r){Be||Re();var o=Xt,i=Be;Be=!0;try{Fe(o,e,t,n,r)}finally{(Be=i)||Ie()}}function Qt(e,t,n,r){Gt(Kt,Xt.bind(null,e,t,n,r))}function Xt(e,t,n,r){var o;if(Yt)if((o=0===(4&t))&&0<at.length&&-1<pt.indexOf(e))e=ht(null,e,t,n,r),at.push(e);else{var i=Zt(e,t,n,r);if(null===i)o&&vt(e,r);else{if(o){if(-1<pt.indexOf(e))return e=ht(i,e,t,n,r),void at.push(e);if(function(e,t,n,r,o){switch(t){case"focusin":return st=mt(st,e,t,n,r,o),!0;case"dragenter":return ut=mt(ut,e,t,n,r,o),!0;case"mouseover":return ct=mt(ct,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return lt.set(i,mt(lt.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,ft.set(i,mt(ft.get(i)||null,e,t,n,r,o)),!0}return!1}(i,e,t,n,r))return;vt(e,r)}Rr(e,t,r,null,n)}}}function Zt(e,t,n,r){var o=Se(r);if(null!==(o=no(o))){var i=Je(o);if(null===i)o=null;else{var a=i.tag;if(13===a){if(null!==(o=Qe(i)))return o;o=null}else if(3===a){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null)}}return Rr(e,t,r,o,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,o="value"in en?en.value:en.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return nn=o.slice(e,1<t?1-t:void 0)}function on(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function sn(){return!1}function un(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?an:sn,this.isPropagationStopped=sn,this}return o(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var cn,ln,fn,dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=un(dn),hn=o({},dn,{view:0,detail:0}),vn=un(hn),mn=o({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fn&&(fn&&"mousemove"===e.type?(cn=e.screenX-fn.screenX,ln=e.screenY-fn.screenY):ln=cn=0,fn=e),cn)},movementY:function(e){return"movementY"in e?e.movementY:ln}}),yn=un(mn),gn=un(o({},mn,{dataTransfer:0})),bn=un(o({},hn,{relatedTarget:0})),kn=un(o({},dn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=o({},dn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xn=un(wn),On=un(o({},dn,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function jn(){return Cn}var _n=o({},hn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=on(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Dn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return"keypress"===e.type?on(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?on(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),An=un(_n),Nn=un(o({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tn=un(o({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Mn=un(o({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Fn=o({},mn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Rn=un(Fn),Pn=[9,13,27,32],Bn=f&&"CompositionEvent"in window,Ln=null;f&&"documentMode"in document&&(Ln=document.documentMode);var In=f&&"TextEvent"in window&&!Ln,zn=f&&(!Bn||Ln&&8<Ln&&11>=Ln),Un=String.fromCharCode(32),Vn=!1;function $n(e,t){switch(e){case"keyup":return-1!==Pn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var qn=!1;var Wn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Wn[e.type]:"textarea"===t}function Gn(e,t,n,r){Ne(r),0<(t=Br(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Jn=null;function Qn(e){_r(e,0)}function Xn(e){if(Q(oo(e)))return e}function Zn(e,t){if("change"===e)return t}var er=!1;if(f){var tr;if(f){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"===typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function or(){Yn&&(Yn.detachEvent("onpropertychange",ir),Jn=Yn=null)}function ir(e){if("value"===e.propertyName&&Xn(Jn)){var t=[];if(Gn(t,Jn,e,Se(e)),e=Qn,Be)e(t);else{Be=!0;try{Me(e,t)}finally{Be=!1,Ie()}}}}function ar(e,t,n){"focusin"===e?(or(),Jn=n,(Yn=t).attachEvent("onpropertychange",ir)):"focusout"===e&&or()}function sr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Jn)}function ur(e,t){if("click"===e)return Xn(t)}function cr(e,t){if("input"===e||"change"===e)return Xn(t)}var lr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},fr=Object.prototype.hasOwnProperty;function dr(e,t){if(lr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!fr.call(t,n[r])||!lr(e[n[r]],t[n[r]]))return!1;return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hr(e,t){var n,r=pr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=pr(r)}}function vr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?vr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function mr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var gr=f&&"documentMode"in document&&11>=document.documentMode,br=null,kr=null,wr=null,xr=!1;function Or(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;xr||null==br||br!==X(r)||("selectionStart"in(r=br)&&yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},wr&&dr(wr,r)||(wr=r,0<(r=Br(kr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}Rt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Rt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Rt(Ft,2);for(var Er="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Dr=0;Dr<Er.length;Dr++)Mt.set(Er[Dr],0);l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Sr));function jr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,i,s,u,c){if(Ye.apply(this,arguments),He){if(!He)throw Error(a(198));var l=qe;He=!1,qe=null,We||(We=!0,Ke=l)}}(r,t,void 0,e),e.currentTarget=null}function _r(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],u=s.instance,c=s.currentTarget;if(s=s.listener,u!==i&&o.isPropagationStopped())break e;jr(o,s,c),i=u}else for(a=0;a<r.length;a++){if(u=(s=r[a]).instance,c=s.currentTarget,s=s.listener,u!==i&&o.isPropagationStopped())break e;jr(o,s,c),i=u}}}if(We)throw e=Ke,We=!1,Ke=null,e}function Ar(e,t){var n=ao(t),r=e+"__bubble";n.has(r)||(Fr(t,e,2,!1),n.add(r))}var Nr="_reactListening"+Math.random().toString(36).slice(2);function Tr(e){e[Nr]||(e[Nr]=!0,s.forEach((function(t){Cr.has(t)||Mr(t,!1,e,null),Mr(t,!0,e,null)})))}function Mr(e,t,n,r){var o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,i=n;if("selectionchange"===e&&9!==n.nodeType&&(i=n.ownerDocument),null!==r&&!t&&Cr.has(e)){if("scroll"!==e)return;o|=2,i=r}var a=ao(i),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(o|=4),Fr(i,e,o,t),a.add(s))}function Fr(e,t,n,r){var o=Mt.get(t);switch(void 0===o?2:o){case 0:o=Jt;break;case 1:o=Qt;break;default:o=Xt}n=o.bind(null,t,n,e),o=void 0,!Ue||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Rr(e,t,n,r,o){var i=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var u=a.tag;if((3===u||4===u)&&((u=a.stateNode.containerInfo)===o||8===u.nodeType&&u.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=no(s)))return;if(5===(u=a.tag)||6===u){r=i=a;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Le)return e(t,n);Le=!0;try{Pe(e,t,n)}finally{Le=!1,Ie()}}((function(){var r=i,o=Se(n),a=[];e:{var s=Tt.get(e);if(void 0!==s){var u=pn,c=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":u=An;break;case"focusin":c="focus",u=bn;break;case"focusout":c="blur",u=bn;break;case"beforeblur":case"afterblur":u=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=yn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=gn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=Tn;break;case jt:case _t:case At:u=kn;break;case Nt:u=Mn;break;case"scroll":u=vn;break;case"wheel":u=Rn;break;case"copy":case"cut":case"paste":u=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=Nn}var l=0!==(4&t),f=!l&&"scroll"===e,d=l?null!==s?s+"Capture":null:s;l=[];for(var p,h=r;null!==h;){var v=(p=h).stateNode;if(5===p.tag&&null!==v&&(p=v,null!==d&&(null!=(v=ze(h,d))&&l.push(Pr(h,v,p)))),f)break;h=h.return}0<l.length&&(s=new u(s,c,null,n,o),a.push({event:s,listeners:l}))}}if(0===(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!==(16&t)||!(c=n.relatedTarget||n.fromElement)||!no(c)&&!c[eo])&&(u||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,u?(u=r,null!==(c=(c=n.relatedTarget||n.toElement)?no(c):null)&&(c!==(f=Je(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(u=null,c=r),u!==c)){if(l=yn,v="onMouseLeave",d="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(l=Nn,v="onPointerLeave",d="onPointerEnter",h="pointer"),f=null==u?s:oo(u),p=null==c?s:oo(c),(s=new l(v,h+"leave",u,n,o)).target=f,s.relatedTarget=p,v=null,no(o)===r&&((l=new l(d,h+"enter",c,n,o)).target=p,l.relatedTarget=f,v=l),f=v,u&&c)e:{for(d=c,h=0,p=l=u;p;p=Lr(p))h++;for(p=0,v=d;v;v=Lr(v))p++;for(;0<h-p;)l=Lr(l),h--;for(;0<p-h;)d=Lr(d),p--;for(;h--;){if(l===d||null!==d&&l===d.alternate)break e;l=Lr(l),d=Lr(d)}l=null}else l=null;null!==u&&Ir(a,s,u,l,!1),null!==c&&null!==f&&Ir(a,f,c,l,!0)}if("select"===(u=(s=r?oo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type)var m=Zn;else if(Kn(s))if(er)m=cr;else{m=sr;var y=ar}else(u=s.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=ur);switch(m&&(m=m(e,r))?Gn(a,m,n,o):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&oe(s,"number",s.value)),y=r?oo(r):window,e){case"focusin":(Kn(y)||"true"===y.contentEditable)&&(br=y,kr=r,wr=null);break;case"focusout":wr=kr=br=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,Or(a,n,o);break;case"selectionchange":if(gr)break;case"keydown":case"keyup":Or(a,n,o)}var g;if(Bn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else qn?$n(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(zn&&"ko"!==n.locale&&(qn||"onCompositionStart"!==b?"onCompositionEnd"===b&&qn&&(g=rn()):(tn="value"in(en=o)?en.value:en.textContent,qn=!0)),0<(y=Br(r,b)).length&&(b=new On(b,e,null,n,o),a.push({event:b,listeners:y}),g?b.data=g:null!==(g=Hn(n))&&(b.data=g))),(g=In?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(Vn=!0,Un);case"textInput":return(e=t.data)===Un&&Vn?null:e;default:return null}}(e,n):function(e,t){if(qn)return"compositionend"===e||!Bn&&$n(e,t)?(e=rn(),nn=tn=en=null,qn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Br(r,"onBeforeInput")).length&&(o=new On("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=g))}_r(a,t)}))}function Pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Br(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=ze(e,n))&&r.unshift(Pr(e,i,o)),null!=(i=ze(e,t))&&r.push(Pr(e,i,o))),e=e.return}return r}function Lr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Ir(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,u=s.alternate,c=s.stateNode;if(null!==u&&u===r)break;5===s.tag&&null!==c&&(s=c,o?null!=(u=ze(n,i))&&a.unshift(Pr(n,u,s)):o||null!=(u=ze(n,i))&&a.push(Pr(n,u,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function zr(){}var Ur=null,Vr=null;function $r(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Hr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var qr="function"===typeof setTimeout?setTimeout:void 0,Wr="function"===typeof clearTimeout?clearTimeout:void 0;function Kr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Gr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Yr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Jr=0;var Qr=Math.random().toString(36).slice(2),Xr="__reactFiber$"+Qr,Zr="__reactProps$"+Qr,eo="__reactContainer$"+Qr,to="__reactEvents$"+Qr;function no(e){var t=e[Xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||n[Xr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Yr(e);null!==e;){if(n=e[Xr])return n;e=Yr(e)}return t}n=(e=n).parentNode}return null}function ro(e){return!(e=e[Xr]||e[eo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function oo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function io(e){return e[Zr]||null}function ao(e){var t=e[to];return void 0===t&&(t=e[to]=new Set),t}var so=[],uo=-1;function co(e){return{current:e}}function lo(e){0>uo||(e.current=so[uo],so[uo]=null,uo--)}function fo(e,t){uo++,so[uo]=e.current,e.current=t}var po={},ho=co(po),vo=co(!1),mo=po;function yo(e,t){var n=e.type.contextTypes;if(!n)return po;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function go(e){return null!==(e=e.childContextTypes)&&void 0!==e}function bo(){lo(vo),lo(ho)}function ko(e,t,n){if(ho.current!==po)throw Error(a(168));fo(ho,t),fo(vo,n)}function wo(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(a(108,K(t)||"Unknown",i));return o({},n,r)}function xo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||po,mo=ho.current,fo(ho,e),fo(vo,vo.current),!0}function Oo(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=wo(e,t,mo),r.__reactInternalMemoizedMergedChildContext=e,lo(vo),lo(ho),fo(ho,e)):lo(vo),fo(vo,n)}var Eo=null,Do=null,So=i.unstable_runWithPriority,Co=i.unstable_scheduleCallback,jo=i.unstable_cancelCallback,_o=i.unstable_shouldYield,Ao=i.unstable_requestPaint,No=i.unstable_now,To=i.unstable_getCurrentPriorityLevel,Mo=i.unstable_ImmediatePriority,Fo=i.unstable_UserBlockingPriority,Ro=i.unstable_NormalPriority,Po=i.unstable_LowPriority,Bo=i.unstable_IdlePriority,Lo={},Io=void 0!==Ao?Ao:function(){},zo=null,Uo=null,Vo=!1,$o=No(),Ho=1e4>$o?No:function(){return No()-$o};function qo(){switch(To()){case Mo:return 99;case Fo:return 98;case Ro:return 97;case Po:return 96;case Bo:return 95;default:throw Error(a(332))}}function Wo(e){switch(e){case 99:return Mo;case 98:return Fo;case 97:return Ro;case 96:return Po;case 95:return Bo;default:throw Error(a(332))}}function Ko(e,t){return e=Wo(e),So(e,t)}function Go(e,t,n){return e=Wo(e),Co(e,t,n)}function Yo(){if(null!==Uo){var e=Uo;Uo=null,jo(e)}Jo()}function Jo(){if(!Vo&&null!==zo){Vo=!0;var e=0;try{var t=zo;Ko(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),zo=null}catch(n){throw null!==zo&&(zo=zo.slice(e+1)),Co(Mo,Yo),n}finally{Vo=!1}}}var Qo=w.ReactCurrentBatchConfig;function Xo(e,t){if(e&&e.defaultProps){for(var n in t=o({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Zo=co(null),ei=null,ti=null,ni=null;function ri(){ni=ti=ei=null}function oi(e){var t=Zo.current;lo(Zo),e.type._context._currentValue=t}function ii(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ai(e,t){ei=e,ni=ti=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Ba=!0),e.firstContext=null)}function si(e,t){if(ni!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(ni=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ti){if(null===ei)throw Error(a(308));ti=t,ei.dependencies={lanes:0,firstContext:t,responders:null}}else ti=ti.next=t;return e._currentValue}var ui=!1;function ci(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function li(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function di(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function pi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hi(e,t,n,r){var i=e.updateQueue;ui=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,u=i.shared.pending;if(null!==u){i.shared.pending=null;var c=u,l=c.next;c.next=null,null===s?a=l:s.next=l,s=c;var f=e.alternate;if(null!==f){var d=(f=f.updateQueue).lastBaseUpdate;d!==s&&(null===d?f.firstBaseUpdate=l:d.next=l,f.lastBaseUpdate=c)}}if(null!==a){for(d=i.baseState,s=0,f=l=c=null;;){u=a.lane;var p=a.eventTime;if((r&u)===u){null!==f&&(f=f.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,v=a;switch(u=t,p=n,v.tag){case 1:if("function"===typeof(h=v.payload)){d=h.call(p,d,u);break e}d=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null===(u="function"===typeof(h=v.payload)?h.call(p,d,u):h)||void 0===u)break e;d=o({},d,u);break e;case 2:ui=!0}}null!==a.callback&&(e.flags|=32,null===(u=i.effects)?i.effects=[a]:u.push(a))}else p={eventTime:p,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===f?(l=f=p,c=d):f=f.next=p,s|=u;if(null===(a=a.next)){if(null===(u=i.shared.pending))break;a=u.next,u.next=null,i.lastBaseUpdate=u,i.shared.pending=null}}null===f&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=f,Us|=s,e.lanes=s,e.memoizedState=d}}function vi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!==typeof o)throw Error(a(191,o));o.call(r)}}}var mi=(new r.Component).refs;function yi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:o({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var gi={isMounted:function(e){return!!(e=e._reactInternals)&&Je(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),o=pu(e),i=fi(r,o);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),di(e,i),hu(e,o,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),o=pu(e),i=fi(r,o);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),di(e,i),hu(e,o,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=pu(e),o=fi(n,r);o.tag=2,void 0!==t&&null!==t&&(o.callback=t),di(e,o),hu(e,r,n)}};function bi(e,t,n,r,o,i,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!dr(n,r)||!dr(o,i))}function ki(e,t,n){var r=!1,o=po,i=t.contextType;return"object"===typeof i&&null!==i?i=si(i):(o=go(t)?mo:ho.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?yo(e,o):po),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=gi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function wi(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&gi.enqueueReplaceState(t,t.state,null)}function xi(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=mi,ci(e);var i=t.contextType;"object"===typeof i&&null!==i?o.context=si(i):(i=go(t)?mo:ho.current,o.context=yo(e,i)),hi(e,n,o,r),o.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(yi(e,t,i,n),o.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(t=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&gi.enqueueReplaceState(o,o.state,null),hi(e,n,o,r),o.state=e.memoizedState),"function"===typeof o.componentDidMount&&(e.flags|=4)}var Oi=Array.isArray;function Ei(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=r.refs;t===mi&&(t=r.refs={}),null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!==typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Di(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Si(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Wu(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Ju(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=Ei(e,t,n),r.return=e,r):((r=Ku(n.type,n.key,n.props,null,e.mode,r)).ref=Ei(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=Gu(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function d(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Ju(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case x:return(n=Ku(t.type,t.key,t.props,null,e.mode,n)).ref=Ei(e,null,t),n.return=e,n;case O:return(t=Qu(t,e.mode,n)).return=e,t}if(Oi(t)||V(t))return(t=Gu(t,e.mode,n,null)).return=e,t;Di(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==o?null:u(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case x:return n.key===o?n.type===E?f(e,t,n.props.children,r,o):c(e,t,n,r):null;case O:return n.key===o?l(e,t,n,r):null}if(Oi(n)||V(n))return null!==o?null:f(e,t,n,r,null);Di(e,n)}return null}function h(e,t,n,r,o){if("string"===typeof r||"number"===typeof r)return u(t,e=e.get(n)||null,""+r,o);if("object"===typeof r&&null!==r){switch(r.$$typeof){case x:return e=e.get(null===r.key?n:r.key)||null,r.type===E?f(t,e,r.props.children,o,r.key):c(t,e,r,o);case O:return l(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(Oi(r)||V(r))return f(t,e=e.get(n)||null,r,o,null);Di(t,r)}return null}function v(o,a,s,u){for(var c=null,l=null,f=a,v=a=0,m=null;null!==f&&v<s.length;v++){f.index>v?(m=f,f=null):m=f.sibling;var y=p(o,f,s[v],u);if(null===y){null===f&&(f=m);break}e&&f&&null===y.alternate&&t(o,f),a=i(y,a,v),null===l?c=y:l.sibling=y,l=y,f=m}if(v===s.length)return n(o,f),c;if(null===f){for(;v<s.length;v++)null!==(f=d(o,s[v],u))&&(a=i(f,a,v),null===l?c=f:l.sibling=f,l=f);return c}for(f=r(o,f);v<s.length;v++)null!==(m=h(f,o,v,s[v],u))&&(e&&null!==m.alternate&&f.delete(null===m.key?v:m.key),a=i(m,a,v),null===l?c=m:l.sibling=m,l=m);return e&&f.forEach((function(e){return t(o,e)})),c}function m(o,s,u,c){var l=V(u);if("function"!==typeof l)throw Error(a(150));if(null==(u=l.call(u)))throw Error(a(151));for(var f=l=null,v=s,m=s=0,y=null,g=u.next();null!==v&&!g.done;m++,g=u.next()){v.index>m?(y=v,v=null):y=v.sibling;var b=p(o,v,g.value,c);if(null===b){null===v&&(v=y);break}e&&v&&null===b.alternate&&t(o,v),s=i(b,s,m),null===f?l=b:f.sibling=b,f=b,v=y}if(g.done)return n(o,v),l;if(null===v){for(;!g.done;m++,g=u.next())null!==(g=d(o,g.value,c))&&(s=i(g,s,m),null===f?l=g:f.sibling=g,f=g);return l}for(v=r(o,v);!g.done;m++,g=u.next())null!==(g=h(v,o,m,g.value,c))&&(e&&null!==g.alternate&&v.delete(null===g.key?m:g.key),s=i(g,s,m),null===f?l=g:f.sibling=g,f=g);return e&&v.forEach((function(e){return t(o,e)})),l}return function(e,r,i,u){var c="object"===typeof i&&null!==i&&i.type===E&&null===i.key;c&&(i=i.props.children);var l="object"===typeof i&&null!==i;if(l)switch(i.$$typeof){case x:e:{for(l=i.key,c=r;null!==c;){if(c.key===l){if(7===c.tag){if(i.type===E){n(e,c.sibling),(r=o(c,i.props.children)).return=e,e=r;break e}}else if(c.elementType===i.type){n(e,c.sibling),(r=o(c,i.props)).ref=Ei(e,c,i),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}i.type===E?((r=Gu(i.props.children,e.mode,u,i.key)).return=e,e=r):((u=Ku(i.type,i.key,i.props,null,e.mode,u)).ref=Ei(e,r,i),u.return=e,e=u)}return s(e);case O:e:{for(c=i.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=o(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Qu(i,e.mode,u)).return=e,e=r}return s(e)}if("string"===typeof i||"number"===typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,i)).return=e,e=r):(n(e,r),(r=Ju(i,e.mode,u)).return=e,e=r),s(e);if(Oi(i))return v(e,r,i,u);if(V(i))return m(e,r,i,u);if(l&&Di(e,i),"undefined"===typeof i&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,K(e.type)||"Component"))}return n(e,r)}}var Ci=Si(!0),ji=Si(!1),_i={},Ai=co(_i),Ni=co(_i),Ti=co(_i);function Mi(e){if(e===_i)throw Error(a(174));return e}function Fi(e,t){switch(fo(Ti,t),fo(Ni,e),fo(Ai,_i),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:he(null,"");break;default:t=he(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}lo(Ai),fo(Ai,t)}function Ri(){lo(Ai),lo(Ni),lo(Ti)}function Pi(e){Mi(Ti.current);var t=Mi(Ai.current),n=he(t,e.type);t!==n&&(fo(Ni,e),fo(Ai,n))}function Bi(e){Ni.current===e&&(lo(Ai),lo(Ni))}var Li=co(0);function Ii(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zi=null,Ui=null,Vi=!1;function $i(e,t){var n=Hu(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Hi(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function qi(e){if(Vi){var t=Ui;if(t){var n=t;if(!Hi(e,t)){if(!(t=Gr(n.nextSibling))||!Hi(e,t))return e.flags=-1025&e.flags|2,Vi=!1,void(zi=e);$i(zi,n)}zi=e,Ui=Gr(t.firstChild)}else e.flags=-1025&e.flags|2,Vi=!1,zi=e}}function Wi(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;zi=e}function Ki(e){if(e!==zi)return!1;if(!Vi)return Wi(e),Vi=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Hr(t,e.memoizedProps))for(t=Ui;t;)$i(e,t),t=Gr(t.nextSibling);if(Wi(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Ui=Gr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Ui=null}}else Ui=zi?Gr(e.stateNode.nextSibling):null;return!0}function Gi(){Ui=zi=null,Vi=!1}var Yi=[];function Ji(){for(var e=0;e<Yi.length;e++)Yi[e]._workInProgressVersionPrimary=null;Yi.length=0}var Qi=w.ReactCurrentDispatcher,Xi=w.ReactCurrentBatchConfig,Zi=0,ea=null,ta=null,na=null,ra=!1,oa=!1;function ia(){throw Error(a(321))}function aa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function sa(e,t,n,r,o,i){if(Zi=i,ea=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qi.current=null===e||null===e.memoizedState?Ma:Fa,e=n(r,o),oa){i=0;do{if(oa=!1,!(25>i))throw Error(a(301));i+=1,na=ta=null,t.updateQueue=null,Qi.current=Ra,e=n(r,o)}while(oa)}if(Qi.current=Ta,t=null!==ta&&null!==ta.next,Zi=0,na=ta=ea=null,ra=!1,t)throw Error(a(300));return e}function ua(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===na?ea.memoizedState=na=e:na=na.next=e,na}function ca(){if(null===ta){var e=ea.alternate;e=null!==e?e.memoizedState:null}else e=ta.next;var t=null===na?ea.memoizedState:na.next;if(null!==t)na=t,ta=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ta=e).memoizedState,baseState:ta.baseState,baseQueue:ta.baseQueue,queue:ta.queue,next:null},null===na?ea.memoizedState=na=e:na=na.next=e}return na}function la(e,t){return"function"===typeof t?t(e):t}function fa(e){var t=ca(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=ta,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var u=s=i=null,c=o;do{var l=c.lane;if((Zi&l)===l)null!==u&&(u=u.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var f={lane:l,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(s=u=f,i=r):u=u.next=f,ea.lanes|=l,Us|=l}c=c.next}while(null!==c&&c!==o);null===u?i=r:u.next=s,lr(r,t.memoizedState)||(Ba=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function da(e){var t=ca(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var s=o=o.next;do{i=e(i,s.action),s=s.next}while(s!==o);lr(i,t.memoizedState)||(Ba=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function pa(e,t,n){var r=t._getVersion;r=r(t._source);var o=t._workInProgressVersionPrimary;if(null!==o?e=o===r:(e=e.mutableReadLanes,(e=(Zi&e)===e)&&(t._workInProgressVersionPrimary=r,Yi.push(t))),e)return n(t._source);throw Yi.push(t),Error(a(350))}function ha(e,t,n,r){var o=Ms;if(null===o)throw Error(a(349));var i=t._getVersion,s=i(t._source),u=Qi.current,c=u.useState((function(){return pa(o,t,n)})),l=c[1],f=c[0];c=na;var d=e.memoizedState,p=d.refs,h=p.getSnapshot,v=d.source;d=d.subscribe;var m=ea;return e.memoizedState={refs:p,source:t,subscribe:r},u.useEffect((function(){p.getSnapshot=n,p.setSnapshot=l;var e=i(t._source);if(!lr(s,e)){e=n(t._source),lr(f,e)||(l(e),e=pu(m),o.mutableReadLanes|=e&o.pendingLanes),e=o.mutableReadLanes,o.entangledLanes|=e;for(var r=o.entanglements,a=e;0<a;){var u=31-Ht(a),c=1<<u;r[u]|=e,a&=~c}}}),[n,t,r]),u.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pu(m);o.mutableReadLanes|=r&o.pendingLanes}catch(i){n((function(){throw i}))}}))}),[t,r]),lr(h,n)&&lr(v,t)&&lr(d,r)||((e={pending:null,dispatch:null,lastRenderedReducer:la,lastRenderedState:f}).dispatch=l=Na.bind(null,ea,e),c.queue=e,c.baseQueue=null,f=pa(o,t,n),c.memoizedState=c.baseState=f),f}function va(e,t,n){return ha(ca(),e,t,n)}function ma(e){var t=ua();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:la,lastRenderedState:e}).dispatch=Na.bind(null,ea,e),[t.memoizedState,e]}function ya(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ea.updateQueue)?(t={lastEffect:null},ea.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ga(e){return e={current:e},ua().memoizedState=e}function ba(){return ca().memoizedState}function ka(e,t,n,r){var o=ua();ea.flags|=e,o.memoizedState=ya(1|t,n,void 0,void 0===r?null:r)}function wa(e,t,n,r){var o=ca();r=void 0===r?null:r;var i=void 0;if(null!==ta){var a=ta.memoizedState;if(i=a.destroy,null!==r&&aa(r,a.deps))return void ya(t,n,i,r)}ea.flags|=e,o.memoizedState=ya(1|t,n,i,r)}function xa(e,t){return ka(516,4,e,t)}function Oa(e,t){return wa(516,4,e,t)}function Ea(e,t){return wa(4,2,e,t)}function Da(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Sa(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,wa(4,2,Da.bind(null,t,e),n)}function Ca(){}function ja(e,t){var n=ca();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _a(e,t){var n=ca();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Aa(e,t){var n=qo();Ko(98>n?98:n,(function(){e(!0)})),Ko(97<n?97:n,(function(){var n=Xi.transition;Xi.transition=1;try{e(!1),t()}finally{Xi.transition=n}}))}function Na(e,t,n){var r=du(),o=pu(e),i={lane:o,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?i.next=i:(i.next=a.next,a.next=i),t.pending=i,a=e.alternate,e===ea||null!==a&&a===ea)oa=ra=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,u=a(s,n);if(i.eagerReducer=a,i.eagerState=u,lr(u,s))return}catch(c){}hu(e,o,r)}}var Ta={readContext:si,useCallback:ia,useContext:ia,useEffect:ia,useImperativeHandle:ia,useLayoutEffect:ia,useMemo:ia,useReducer:ia,useRef:ia,useState:ia,useDebugValue:ia,useDeferredValue:ia,useTransition:ia,useMutableSource:ia,useOpaqueIdentifier:ia,unstable_isNewReconciler:!1},Ma={readContext:si,useCallback:function(e,t){return ua().memoizedState=[e,void 0===t?null:t],e},useContext:si,useEffect:xa,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ka(4,2,Da.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ka(4,2,e,t)},useMemo:function(e,t){var n=ua();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ua();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Na.bind(null,ea,e),[r.memoizedState,e]},useRef:ga,useState:ma,useDebugValue:Ca,useDeferredValue:function(e){var t=ma(e),n=t[0],r=t[1];return xa((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=ma(!1),t=e[0];return ga(e=Aa.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=ua();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},ha(r,e,t,n)},useOpaqueIdentifier:function(){if(Vi){var e=!1,t=function(e){return{$$typeof:R,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Jr++).toString(36))),Error(a(355))})),n=ma(t)[1];return 0===(2&ea.mode)&&(ea.flags|=516,ya(5,(function(){n("r:"+(Jr++).toString(36))}),void 0,null)),t}return ma(t="r:"+(Jr++).toString(36)),t},unstable_isNewReconciler:!1},Fa={readContext:si,useCallback:ja,useContext:si,useEffect:Oa,useImperativeHandle:Sa,useLayoutEffect:Ea,useMemo:_a,useReducer:fa,useRef:ba,useState:function(){return fa(la)},useDebugValue:Ca,useDeferredValue:function(e){var t=fa(la),n=t[0],r=t[1];return Oa((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=fa(la)[0];return[ba().current,e]},useMutableSource:va,useOpaqueIdentifier:function(){return fa(la)[0]},unstable_isNewReconciler:!1},Ra={readContext:si,useCallback:ja,useContext:si,useEffect:Oa,useImperativeHandle:Sa,useLayoutEffect:Ea,useMemo:_a,useReducer:da,useRef:ba,useState:function(){return da(la)},useDebugValue:Ca,useDeferredValue:function(e){var t=da(la),n=t[0],r=t[1];return Oa((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=da(la)[0];return[ba().current,e]},useMutableSource:va,useOpaqueIdentifier:function(){return da(la)[0]},unstable_isNewReconciler:!1},Pa=w.ReactCurrentOwner,Ba=!1;function La(e,t,n,r){t.child=null===e?ji(t,null,n,r):Ci(t,e.child,n,r)}function Ia(e,t,n,r,o){n=n.render;var i=t.ref;return ai(t,o),r=sa(e,t,n,r,i,o),null===e||Ba?(t.flags|=1,La(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,is(e,t,o))}function za(e,t,n,r,o,i){if(null===e){var a=n.type;return"function"!==typeof a||qu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ku(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ua(e,t,a,r,o,i))}return a=e.child,0===(o&i)&&(o=a.memoizedProps,(n=null!==(n=n.compare)?n:dr)(o,r)&&e.ref===t.ref)?is(e,t,i):(t.flags|=1,(e=Wu(a,r)).ref=t.ref,e.return=t,t.child=e)}function Ua(e,t,n,r,o,i){if(null!==e&&dr(e.memoizedProps,r)&&e.ref===t.ref){if(Ba=!1,0===(i&o))return t.lanes=e.lanes,is(e,t,i);0!==(16384&e.flags)&&(Ba=!0)}return Ha(e,t,n,r,i)}function Va(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0===(4&t.mode))t.memoizedState={baseLanes:0},xu(t,n);else{if(0===(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},xu(t,e),null;t.memoizedState={baseLanes:0},xu(t,null!==i?i.baseLanes:n)}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,xu(t,r);return La(e,t,o,n),t.child}function $a(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ha(e,t,n,r,o){var i=go(n)?mo:ho.current;return i=yo(t,i),ai(t,o),n=sa(e,t,n,r,i,o),null===e||Ba?(t.flags|=1,La(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,is(e,t,o))}function qa(e,t,n,r,o){if(go(n)){var i=!0;xo(t)}else i=!1;if(ai(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),ki(t,n,r),xi(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,c=n.contextType;"object"===typeof c&&null!==c?c=si(c):c=yo(t,c=go(n)?mo:ho.current);var l=n.getDerivedStateFromProps,f="function"===typeof l||"function"===typeof a.getSnapshotBeforeUpdate;f||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==c)&&wi(t,a,r,c),ui=!1;var d=t.memoizedState;a.state=d,hi(t,r,a,o),u=t.memoizedState,s!==r||d!==u||vo.current||ui?("function"===typeof l&&(yi(t,n,l,r),u=t.memoizedState),(s=ui||bi(t,n,s,r,d,u,c))?(f||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4)):("function"===typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=s):("function"===typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,li(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Xo(t.type,s),a.props=c,f=t.pendingProps,d=a.context,"object"===typeof(u=n.contextType)&&null!==u?u=si(u):u=yo(t,u=go(n)?mo:ho.current);var p=n.getDerivedStateFromProps;(l="function"===typeof p||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==f||d!==u)&&wi(t,a,r,u),ui=!1,d=t.memoizedState,a.state=d,hi(t,r,a,o);var h=t.memoizedState;s!==f||d!==h||vo.current||ui?("function"===typeof p&&(yi(t,n,p,r),h=t.memoizedState),(c=ui||bi(t,n,c,r,d,h,u))?(l||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,u),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,u)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=u,r=c):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),r=!1)}return Wa(e,t,n,r,i,o)}function Wa(e,t,n,r,o,i){$a(e,t);var a=0!==(64&t.flags);if(!r&&!a)return o&&Oo(t,n,!1),is(e,t,i);r=t.stateNode,Pa.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Ci(t,e.child,null,i),t.child=Ci(t,null,s,i)):La(e,t,s,i),t.memoizedState=r.state,o&&Oo(t,n,!0),t.child}function Ka(e){var t=e.stateNode;t.pendingContext?ko(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ko(0,t.context,!1),Fi(e,t.containerInfo)}var Ga,Ya,Ja,Qa={dehydrated:null,retryLane:0};function Xa(e,t,n){var r,o=t.pendingProps,i=Li.current,a=!1;return(r=0!==(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!==(2&i)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(i|=1),fo(Li,1&i),null===e?(void 0!==o.fallback&&qi(t),e=o.children,i=o.fallback,a?(e=Za(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qa,e):"number"===typeof o.unstable_expectedLoadTime?(e=Za(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qa,t.lanes=33554432,e):((n=Yu({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(o=ts(e,t,o.children,o.fallback,n),a=t.child,i=e.child.memoizedState,a.memoizedState=null===i?{baseLanes:n}:{baseLanes:i.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=Qa,o):(n=es(e,t,o.children,n),t.memoizedState=null,n))}function Za(e,t,n,r){var o=e.mode,i=e.child;return t={mode:"hidden",children:t},0===(2&o)&&null!==i?(i.childLanes=0,i.pendingProps=t):i=Yu(t,o,0,null),n=Gu(n,o,r,null),i.return=e,n.return=e,i.sibling=n,e.child=i,n}function es(e,t,n,r){var o=e.child;return e=o.sibling,n=Wu(o,{mode:"visible",children:n}),0===(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ts(e,t,n,r,o){var i=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0===(2&i)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Wu(a,s),null!==e?r=Wu(e,r):(r=Gu(r,i,o,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ns(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ii(e.return,t)}function rs(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,lastEffect:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.lastEffect=i)}function os(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(La(e,t,r.children,n),0!==(2&(r=Li.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!==(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ns(e,n);else if(19===e.tag)ns(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(fo(Li,r),0===(2&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Ii(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),rs(t,!1,o,n,i,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Ii(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}rs(t,!0,n,null,i,t.lastEffect);break;case"together":rs(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function is(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Us|=t.lanes,0!==(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Wu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Wu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function as(e,t){if(!Vi)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ss(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return go(t.type)&&bo(),null;case 3:return Ri(),lo(vo),lo(ho),Ji(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ki(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Bi(t);var i=Mi(Ti.current);if(n=t.type,null!==e&&null!=t.stateNode)Ya(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=Mi(Ai.current),Ki(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xr]=t,r[Zr]=s,n){case"dialog":Ar("cancel",r),Ar("close",r);break;case"iframe":case"object":case"embed":Ar("load",r);break;case"video":case"audio":for(e=0;e<Sr.length;e++)Ar(Sr[e],r);break;case"source":Ar("error",r);break;case"img":case"image":case"link":Ar("error",r),Ar("load",r);break;case"details":Ar("toggle",r);break;case"input":ee(r,s),Ar("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ar("invalid",r);break;case"textarea":ue(r,s),Ar("invalid",r)}for(var c in Ee(n,s),e=null,s)s.hasOwnProperty(c)&&(i=s[c],"children"===c?"string"===typeof i?r.textContent!==i&&(e=["children",i]):"number"===typeof i&&r.textContent!==""+i&&(e=["children",""+i]):u.hasOwnProperty(c)&&null!=i&&"onScroll"===c&&Ar("scroll",r));switch(n){case"input":J(r),re(r,s,!0);break;case"textarea":J(r),le(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=zr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(c=9===i.nodeType?i:i.ownerDocument,e===fe&&(e=pe(n)),e===fe?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Xr]=t,e[Zr]=r,Ga(e,t),t.stateNode=e,c=De(n,r),n){case"dialog":Ar("cancel",e),Ar("close",e),i=r;break;case"iframe":case"object":case"embed":Ar("load",e),i=r;break;case"video":case"audio":for(i=0;i<Sr.length;i++)Ar(Sr[i],e);i=r;break;case"source":Ar("error",e),i=r;break;case"img":case"image":case"link":Ar("error",e),Ar("load",e),i=r;break;case"details":Ar("toggle",e),i=r;break;case"input":ee(e,r),i=Z(e,r),Ar("invalid",e);break;case"option":i=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=o({},r,{value:void 0}),Ar("invalid",e);break;case"textarea":ue(e,r),i=se(e,r),Ar("invalid",e);break;default:i=r}Ee(n,i);var l=i;for(s in l)if(l.hasOwnProperty(s)){var f=l[s];"style"===s?xe(e,f):"dangerouslySetInnerHTML"===s?null!=(f=f?f.__html:void 0)&&ye(e,f):"children"===s?"string"===typeof f?("textarea"!==n||""!==f)&&ge(e,f):"number"===typeof f&&ge(e,""+f):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(u.hasOwnProperty(s)?null!=f&&"onScroll"===s&&Ar("scroll",e):null!=f&&k(e,s,f,c))}switch(n){case"input":J(e),re(e,r,!1);break;case"textarea":J(e),le(e);break;case"option":null!=r.value&&e.setAttribute("value",""+G(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ae(e,!!r.multiple,s,!1):null!=r.defaultValue&&ae(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=zr)}$r(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Ja(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));n=Mi(Ti.current),Mi(Ai.current),Ki(t)?(r=t.stateNode,n=t.memoizedProps,r[Xr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Xr]=t,t.stateNode=r)}return null;case 13:return lo(Li),r=t.memoizedState,0!==(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Ki(t):n=null!==e.memoizedState,r&&!n&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Li.current)?0===Ls&&(Ls=3):(0!==Ls&&3!==Ls||(Ls=4),null===Ms||0===(134217727&Us)&&0===(134217727&Vs)||gu(Ms,Rs))),(r||n)&&(t.flags|=4),null);case 4:return Ri(),null===e&&Tr(t.stateNode.containerInfo),null;case 10:return oi(t),null;case 19:if(lo(Li),null===(r=t.memoizedState))return null;if(s=0!==(64&t.flags),null===(c=r.rendering))if(s)as(r,!1);else{if(0!==Ls||null!==e&&0!==(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=Ii(e))){for(t.flags|=64,as(r,!1),null!==(s=c.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(c=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fo(Li,1&Li.current|2),t.child}e=e.sibling}null!==r.tail&&Ho()>Ws&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Ii(c))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),as(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!Vi)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Ho()-r.renderingStartTime>Ws&&1073741824!==n&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432);r.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=r.last)?n.sibling=c:t.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ho(),n.sibling=null,t=Li.current,fo(Li,s?1&t|2:1&t),n):null;case 23:case 24:return Ou(),null!==e&&null!==e.memoizedState!==(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function us(e){switch(e.tag){case 1:go(e.type)&&bo();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ri(),lo(vo),lo(ho),Ji(),0!==(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Bi(e),null;case 13:return lo(Li),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return lo(Li),null;case 4:return Ri(),null;case 10:return oi(e),null;case 23:case 24:return Ou(),null;default:return null}}function cs(e,t){try{var n="",r=t;do{n+=W(r),r=r.return}while(r);var o=n}catch(i){o="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:o}}function ls(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Ga=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ya=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Mi(Ai.current);var a,s=null;switch(n){case"input":i=Z(e,i),r=Z(e,r),s=[];break;case"option":i=ie(e,i),r=ie(e,r),s=[];break;case"select":i=o({},i,{value:void 0}),r=o({},r,{value:void 0}),s=[];break;case"textarea":i=se(e,i),r=se(e,r),s=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=zr)}for(f in Ee(n,r),n=null,i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&null!=i[f])if("style"===f){var c=i[f];for(a in c)c.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(u.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var l=r[f];if(c=null!=i?i[f]:void 0,r.hasOwnProperty(f)&&l!==c&&(null!=l||null!=c))if("style"===f)if(c){for(a in c)!c.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&c[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(f,n)),n=l;else"dangerouslySetInnerHTML"===f?(l=l?l.__html:void 0,c=c?c.__html:void 0,null!=l&&c!==l&&(s=s||[]).push(f,l)):"children"===f?"string"!==typeof l&&"number"!==typeof l||(s=s||[]).push(f,""+l):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(u.hasOwnProperty(f)?(null!=l&&"onScroll"===f&&Ar("scroll",e),s||c===l||(s=[])):"object"===typeof l&&null!==l&&l.$$typeof===R?l.toString():(s=s||[]).push(f,l))}n&&(s=s||[]).push("style",n);var f=s;(t.updateQueue=f)&&(t.flags|=4)}},Ja=function(e,t,n,r){n!==r&&(t.flags|=4)};var fs="function"===typeof WeakMap?WeakMap:Map;function ds(e,t,n){(n=fi(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Js||(Js=!0,Qs=r),ls(0,t)},n}function ps(e,t,n){(n=fi(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var o=t.value;n.payload=function(){return ls(0,t),r(o)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Xs?Xs=new Set([this]):Xs.add(this),ls(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var hs="function"===typeof WeakSet?WeakSet:Set;function vs(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){zu(e,n)}else t.current=null}function ms(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Xo(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Kr(t.stateNode.containerInfo))}throw Error(a(163))}function ys(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3===(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var o=e;r=o.next,0!==(4&(o=o.tag))&&0!==(1&o)&&(Bu(n,e),Pu(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Xo(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&vi(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}vi(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&$r(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&xt(n)))))}throw Error(a(163))}function gs(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"===typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var o=n.memoizedProps.style;o=void 0!==o&&null!==o&&o.hasOwnProperty("display")?o.display:null,r.style.display=we("display",o)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function bs(e,t){if(Do&&"function"===typeof Do.onCommitFiberUnmount)try{Do.onCommitFiberUnmount(Eo,t)}catch(i){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,o=r.destroy;if(r=r.tag,void 0!==o)if(0!==(4&r))Bu(t,n);else{r=t;try{o()}catch(i){zu(r,i)}}n=n.next}while(n!==e)}break;case 1:if(vs(t),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){zu(t,i)}break;case 5:vs(t);break;case 4:Ds(e,t)}}function ks(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ws(e){return 5===e.tag||3===e.tag||4===e.tag}function xs(e){e:{for(var t=e.return;null!==t;){if(ws(t))break e;t=t.return}throw Error(a(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.flags&&(ge(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ws(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Os(e,n,t):Es(e,n,t)}function Os(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=zr));else if(4!==r&&null!==(e=e.child))for(Os(e,t,n),e=e.sibling;null!==e;)Os(e,t,n),e=e.sibling}function Es(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Es(e,t,n),e=e.sibling;null!==e;)Es(e,t,n),e=e.sibling}function Ds(e,t){for(var n,r,o=t,i=!1;;){if(!i){i=o.return;e:for(;;){if(null===i)throw Error(a(160));switch(n=i.stateNode,i.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}i=i.return}i=!0}if(5===o.tag||6===o.tag){e:for(var s=e,u=o,c=u;;)if(bs(s,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===u)break e;for(;null===c.sibling;){if(null===c.return||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(s=n,u=o.stateNode,8===s.nodeType?s.parentNode.removeChild(u):s.removeChild(u)):n.removeChild(o.stateNode)}else if(4===o.tag){if(null!==o.child){n=o.stateNode.containerInfo,r=!0,o.child.return=o,o=o.child;continue}}else if(bs(e,o),null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;4===(o=o.return).tag&&(i=!1)}o.sibling.return=o.return,o=o.sibling}}function Ss(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3===(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var o=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[Zr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),De(e,o),t=De(e,r),o=0;o<i.length;o+=2){var s=i[o],u=i[o+1];"style"===s?xe(n,u):"dangerouslySetInnerHTML"===s?ye(n,u):"children"===s?ge(n,u):k(n,s,u,t)}switch(e){case"input":ne(n,r);break;case"textarea":ce(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(i=r.value)?ae(n,!!r.multiple,i,!1):e!==!!r.multiple&&(null!=r.defaultValue?ae(n,!!r.multiple,r.defaultValue,!0):ae(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,xt(n.containerInfo)));case 13:return null!==t.memoizedState&&(qs=Ho(),gs(t.child,!0)),void Cs(t);case 19:return void Cs(t);case 23:case 24:return void gs(t,null!==t.memoizedState)}throw Error(a(163))}function Cs(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hs),t.forEach((function(t){var r=Vu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function js(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var _s=Math.ceil,As=w.ReactCurrentDispatcher,Ns=w.ReactCurrentOwner,Ts=0,Ms=null,Fs=null,Rs=0,Ps=0,Bs=co(0),Ls=0,Is=null,zs=0,Us=0,Vs=0,$s=0,Hs=null,qs=0,Ws=1/0;function Ks(){Ws=Ho()+500}var Gs,Ys=null,Js=!1,Qs=null,Xs=null,Zs=!1,eu=null,tu=90,nu=[],ru=[],ou=null,iu=0,au=null,su=-1,uu=0,cu=0,lu=null,fu=!1;function du(){return 0!==(48&Ts)?Ho():-1!==su?su:su=Ho()}function pu(e){if(0===(2&(e=e.mode)))return 1;if(0===(4&e))return 99===qo()?1:2;if(0===uu&&(uu=zs),0!==Qo.transition){0!==cu&&(cu=null!==Hs?Hs.pendingLanes:0),e=uu;var t=4186112&~cu;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=qo(),0!==(4&Ts)&&98===e?e=zt(12,uu):e=zt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),uu),e}function hu(e,t,n){if(50<iu)throw iu=0,au=null,Error(a(185));if(null===(e=vu(e,t)))return null;$t(e,t,n),e===Ms&&(Vs|=t,4===Ls&&gu(e,Rs));var r=qo();1===t?0!==(8&Ts)&&0===(48&Ts)?bu(e):(mu(e,n),0===Ts&&(Ks(),Yo())):(0===(4&Ts)||98!==r&&99!==r||(null===ou?ou=new Set([e]):ou.add(e)),mu(e,n)),Hs=e}function vu(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function mu(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var u=31-Ht(s),c=1<<u,l=i[u];if(-1===l){if(0===(c&r)||0!==(c&o)){l=t,Bt(c);var f=Pt;i[u]=10<=f?l+250:6<=f?l+5e3:-1}}else l<=t&&(e.expiredLanes|=c);s&=~c}if(r=Lt(e,e===Ms?Rs:0),t=Pt,0===r)null!==n&&(n!==Lo&&jo(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Lo&&jo(n)}15===t?(n=bu.bind(null,e),null===zo?(zo=[n],Uo=Co(Mo,Jo)):zo.push(n),n=Lo):14===t?n=Go(99,bu.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,e))}}(t),n=Go(n,yu.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function yu(e){if(su=-1,cu=uu=0,0!==(48&Ts))throw Error(a(327));var t=e.callbackNode;if(Ru()&&e.callbackNode!==t)return null;var n=Lt(e,e===Ms?Rs:0);if(0===n)return null;var r=n,o=Ts;Ts|=16;var i=Su();for(Ms===e&&Rs===r||(Ks(),Eu(e,r));;)try{_u();break}catch(u){Du(e,u)}if(ri(),As.current=i,Ts=o,null!==Fs?r=0:(Ms=null,Rs=0,r=Ls),0!==(zs&Vs))Eu(e,0);else if(0!==r){if(2===r&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Kr(e.containerInfo)),0!==(n=It(e))&&(r=Cu(e,n))),1===r)throw t=Is,Eu(e,0),gu(e,n),mu(e,Ho()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:case 5:Tu(e);break;case 3:if(gu(e,n),(62914560&n)===n&&10<(r=qs+500-Ho())){if(0!==Lt(e,0))break;if(((o=e.suspendedLanes)&n)!==n){du(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=qr(Tu.bind(null,e),r);break}Tu(e);break;case 4:if(gu(e,n),(4186112&n)===n)break;for(r=e.eventTimes,o=-1;0<n;){var s=31-Ht(n);i=1<<s,(s=r[s])>o&&(o=s),n&=~i}if(n=o,10<(n=(120>(n=Ho()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*_s(n/1960))-n)){e.timeoutHandle=qr(Tu.bind(null,e),n);break}Tu(e);break;default:throw Error(a(329))}}return mu(e,Ho()),e.callbackNode===t?yu.bind(null,e):null}function gu(e,t){for(t&=~$s,t&=~Vs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ht(t),r=1<<n;e[n]=-1,t&=~r}}function bu(e){if(0!==(48&Ts))throw Error(a(327));if(Ru(),e===Ms&&0!==(e.expiredLanes&Rs)){var t=Rs,n=Cu(e,t);0!==(zs&Vs)&&(n=Cu(e,t=Lt(e,t)))}else n=Cu(e,t=Lt(e,0));if(0!==e.tag&&2===n&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Kr(e.containerInfo)),0!==(t=It(e))&&(n=Cu(e,t))),1===n)throw n=Is,Eu(e,0),gu(e,t),mu(e,Ho()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Tu(e),mu(e,Ho()),null}function ku(e,t){var n=Ts;Ts|=1;try{return e(t)}finally{0===(Ts=n)&&(Ks(),Yo())}}function wu(e,t){var n=Ts;Ts&=-2,Ts|=8;try{return e(t)}finally{0===(Ts=n)&&(Ks(),Yo())}}function xu(e,t){fo(Bs,Ps),Ps|=t,zs|=t}function Ou(){Ps=Bs.current,lo(Bs)}function Eu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Wr(n)),null!==Fs)for(n=Fs.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&bo();break;case 3:Ri(),lo(vo),lo(ho),Ji();break;case 5:Bi(r);break;case 4:Ri();break;case 13:case 19:lo(Li);break;case 10:oi(r);break;case 23:case 24:Ou()}n=n.return}Ms=e,Fs=Wu(e.current,null),Rs=Ps=zs=t,Ls=0,Is=null,$s=Vs=Us=0}function Du(e,t){for(;;){var n=Fs;try{if(ri(),Qi.current=Ta,ra){for(var r=ea.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}ra=!1}if(Zi=0,na=ta=ea=null,oa=!1,Ns.current=null,null===n||null===n.return){Ls=1,Is=t,Fs=null;break}e:{var i=e,a=n.return,s=n,u=t;if(t=Rs,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==u&&"object"===typeof u&&"function"===typeof u.then){var c=u;if(0===(2&s.mode)){var l=s.alternate;l?(s.updateQueue=l.updateQueue,s.memoizedState=l.memoizedState,s.lanes=l.lanes):(s.updateQueue=null,s.memoizedState=null)}var f=0!==(1&Li.current),d=a;do{var p;if(p=13===d.tag){var h=d.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var v=d.memoizedProps;p=void 0!==v.fallback&&(!0!==v.unstable_avoidThisFallback||!f)}}if(p){var m=d.updateQueue;if(null===m){var y=new Set;y.add(c),d.updateQueue=y}else m.add(c);if(0===(2&d.mode)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var g=fi(-1,1);g.tag=2,di(s,g)}s.lanes|=1;break e}u=void 0,s=t;var b=i.pingCache;if(null===b?(b=i.pingCache=new fs,u=new Set,b.set(c,u)):void 0===(u=b.get(c))&&(u=new Set,b.set(c,u)),!u.has(s)){u.add(s);var k=Uu.bind(null,i,c,s);c.then(k,k)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);u=Error((K(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Ls&&(Ls=2),u=cs(u,s),d=a;do{switch(d.tag){case 3:i=u,d.flags|=4096,t&=-t,d.lanes|=t,pi(d,ds(0,i,t));break e;case 1:i=u;var w=d.type,x=d.stateNode;if(0===(64&d.flags)&&("function"===typeof w.getDerivedStateFromError||null!==x&&"function"===typeof x.componentDidCatch&&(null===Xs||!Xs.has(x)))){d.flags|=4096,t&=-t,d.lanes|=t,pi(d,ps(d,i,t));break e}}d=d.return}while(null!==d)}Nu(n)}catch(O){t=O,Fs===n&&null!==n&&(Fs=n=n.return);continue}break}}function Su(){var e=As.current;return As.current=Ta,null===e?Ta:e}function Cu(e,t){var n=Ts;Ts|=16;var r=Su();for(Ms===e&&Rs===t||Eu(e,t);;)try{ju();break}catch(o){Du(e,o)}if(ri(),Ts=n,As.current=r,null!==Fs)throw Error(a(261));return Ms=null,Rs=0,Ls}function ju(){for(;null!==Fs;)Au(Fs)}function _u(){for(;null!==Fs&&!_o();)Au(Fs)}function Au(e){var t=Gs(e.alternate,e,Ps);e.memoizedProps=e.pendingProps,null===t?Nu(e):Fs=t,Ns.current=null}function Nu(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(2048&t.flags)){if(null!==(n=ss(n,t,Ps)))return void(Fs=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!==(1073741824&Ps)||0===(4&n.mode)){for(var r=0,o=n.child;null!==o;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}null!==e&&0===(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=us(t)))return n.flags&=2047,void(Fs=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Fs=t);Fs=t=e}while(null!==t);0===Ls&&(Ls=5)}function Tu(e){var t=qo();return Ko(99,Mu.bind(null,e,t)),null}function Mu(e,t){do{Ru()}while(null!==eu);if(0!==(48&Ts))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,u=e.expirationTimes;0<i;){var c=31-Ht(i),l=1<<c;o[c]=0,s[c]=-1,u[c]=-1,i&=~l}if(null!==ou&&0===(24&r)&&ou.has(e)&&ou.delete(e),e===Ms&&(Fs=Ms=null,Rs=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(o=Ts,Ts|=32,Ns.current=null,Ur=Yt,yr(s=mr())){if("selectionStart"in s)u={start:s.selectionStart,end:s.selectionEnd};else e:if(u=(u=s.ownerDocument)&&u.defaultView||window,(l=u.getSelection&&u.getSelection())&&0!==l.rangeCount){u=l.anchorNode,i=l.anchorOffset,c=l.focusNode,l=l.focusOffset;try{u.nodeType,c.nodeType}catch(S){u=null;break e}var f=0,d=-1,p=-1,h=0,v=0,m=s,y=null;t:for(;;){for(var g;m!==u||0!==i&&3!==m.nodeType||(d=f+i),m!==c||0!==l&&3!==m.nodeType||(p=f+l),3===m.nodeType&&(f+=m.nodeValue.length),null!==(g=m.firstChild);)y=m,m=g;for(;;){if(m===s)break t;if(y===u&&++h===i&&(d=f),y===c&&++v===l&&(p=f),null!==(g=m.nextSibling))break;y=(m=y).parentNode}m=g}u=-1===d||-1===p?null:{start:d,end:p}}else u=null;u=u||{start:0,end:0}}else u=null;Vr={focusedElem:s,selectionRange:u},Yt=!1,lu=null,fu=!1,Ys=r;do{try{Fu()}catch(S){if(null===Ys)throw Error(a(330));zu(Ys,S),Ys=Ys.nextEffect}}while(null!==Ys);lu=null,Ys=r;do{try{for(s=e;null!==Ys;){var b=Ys.flags;if(16&b&&ge(Ys.stateNode,""),128&b){var k=Ys.alternate;if(null!==k){var w=k.ref;null!==w&&("function"===typeof w?w(null):w.current=null)}}switch(1038&b){case 2:xs(Ys),Ys.flags&=-3;break;case 6:xs(Ys),Ys.flags&=-3,Ss(Ys.alternate,Ys);break;case 1024:Ys.flags&=-1025;break;case 1028:Ys.flags&=-1025,Ss(Ys.alternate,Ys);break;case 4:Ss(Ys.alternate,Ys);break;case 8:Ds(s,u=Ys);var x=u.alternate;ks(u),null!==x&&ks(x)}Ys=Ys.nextEffect}}catch(S){if(null===Ys)throw Error(a(330));zu(Ys,S),Ys=Ys.nextEffect}}while(null!==Ys);if(w=Vr,k=mr(),b=w.focusedElem,s=w.selectionRange,k!==b&&b&&b.ownerDocument&&vr(b.ownerDocument.documentElement,b)){null!==s&&yr(b)&&(k=s.start,void 0===(w=s.end)&&(w=k),"selectionStart"in b?(b.selectionStart=k,b.selectionEnd=Math.min(w,b.value.length)):(w=(k=b.ownerDocument||document)&&k.defaultView||window).getSelection&&(w=w.getSelection(),u=b.textContent.length,x=Math.min(s.start,u),s=void 0===s.end?x:Math.min(s.end,u),!w.extend&&x>s&&(u=s,s=x,x=u),u=hr(b,x),i=hr(b,s),u&&i&&(1!==w.rangeCount||w.anchorNode!==u.node||w.anchorOffset!==u.offset||w.focusNode!==i.node||w.focusOffset!==i.offset)&&((k=k.createRange()).setStart(u.node,u.offset),w.removeAllRanges(),x>s?(w.addRange(k),w.extend(i.node,i.offset)):(k.setEnd(i.node,i.offset),w.addRange(k))))),k=[];for(w=b;w=w.parentNode;)1===w.nodeType&&k.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"===typeof b.focus&&b.focus(),b=0;b<k.length;b++)(w=k[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Yt=!!Ur,Vr=Ur=null,e.current=n,Ys=r;do{try{for(b=e;null!==Ys;){var O=Ys.flags;if(36&O&&ys(b,Ys.alternate,Ys),128&O){k=void 0;var E=Ys.ref;if(null!==E){var D=Ys.stateNode;Ys.tag,k=D,"function"===typeof E?E(k):E.current=k}}Ys=Ys.nextEffect}}catch(S){if(null===Ys)throw Error(a(330));zu(Ys,S),Ys=Ys.nextEffect}}while(null!==Ys);Ys=null,Io(),Ts=o}else e.current=n;if(Zs)Zs=!1,eu=e,tu=t;else for(Ys=r;null!==Ys;)t=Ys.nextEffect,Ys.nextEffect=null,8&Ys.flags&&((O=Ys).sibling=null,O.stateNode=null),Ys=t;if(0===(r=e.pendingLanes)&&(Xs=null),1===r?e===au?iu++:(iu=0,au=e):iu=0,n=n.stateNode,Do&&"function"===typeof Do.onCommitFiberRoot)try{Do.onCommitFiberRoot(Eo,n,void 0,64===(64&n.current.flags))}catch(S){}if(mu(e,Ho()),Js)throw Js=!1,e=Qs,Qs=null,e;return 0!==(8&Ts)||Yo(),null}function Fu(){for(;null!==Ys;){var e=Ys.alternate;fu||null===lu||(0!==(8&Ys.flags)?et(Ys,lu)&&(fu=!0):13===Ys.tag&&js(e,Ys)&&et(Ys,lu)&&(fu=!0));var t=Ys.flags;0!==(256&t)&&ms(e,Ys),0===(512&t)||Zs||(Zs=!0,Go(97,(function(){return Ru(),null}))),Ys=Ys.nextEffect}}function Ru(){if(90!==tu){var e=97<tu?97:tu;return tu=90,Ko(e,Lu)}return!1}function Pu(e,t){nu.push(t,e),Zs||(Zs=!0,Go(97,(function(){return Ru(),null})))}function Bu(e,t){ru.push(t,e),Zs||(Zs=!0,Go(97,(function(){return Ru(),null})))}function Lu(){if(null===eu)return!1;var e=eu;if(eu=null,0!==(48&Ts))throw Error(a(331));var t=Ts;Ts|=32;var n=ru;ru=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,"function"===typeof s)try{s()}catch(c){if(null===i)throw Error(a(330));zu(i,c)}}for(n=nu,nu=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var u=o.create;o.destroy=u()}catch(c){if(null===i)throw Error(a(330));zu(i,c)}}for(u=e.current.firstEffect;null!==u;)e=u.nextEffect,u.nextEffect=null,8&u.flags&&(u.sibling=null,u.stateNode=null),u=e;return Ts=t,Yo(),!0}function Iu(e,t,n){di(e,t=ds(0,t=cs(n,t),1)),t=du(),null!==(e=vu(e,1))&&($t(e,1,t),mu(e,t))}function zu(e,t){if(3===e.tag)Iu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Iu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Xs||!Xs.has(r))){var o=ps(n,e=cs(t,e),1);if(di(n,o),o=du(),null!==(n=vu(n,1)))$t(n,1,o),mu(n,o);else if("function"===typeof r.componentDidCatch&&(null===Xs||!Xs.has(r)))try{r.componentDidCatch(t,e)}catch(i){}break}}n=n.return}}function Uu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=du(),e.pingedLanes|=e.suspendedLanes&n,Ms===e&&(Rs&n)===n&&(4===Ls||3===Ls&&(62914560&Rs)===Rs&&500>Ho()-qs?Eu(e,0):$s|=n),mu(e,t)}function Vu(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0===(2&(t=e.mode))?t=1:0===(4&t)?t=99===qo()?1:2:(0===uu&&(uu=zs),0===(t=Ut(62914560&~uu))&&(t=4194304))),n=du(),null!==(e=vu(e,t))&&($t(e,t,n),mu(e,n))}function $u(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Hu(e,t,n,r){return new $u(e,t,n,r)}function qu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Wu(e,t){var n=e.alternate;return null===n?((n=Hu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ku(e,t,n,r,o,i){var s=2;if(r=e,"function"===typeof e)qu(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case E:return Gu(n.children,o,i,t);case P:s=8,o|=16;break;case D:s=8,o|=1;break;case S:return(e=Hu(12,n,t,8|o)).elementType=S,e.type=S,e.lanes=i,e;case A:return(e=Hu(13,n,t,o)).type=A,e.elementType=A,e.lanes=i,e;case N:return(e=Hu(19,n,t,o)).elementType=N,e.lanes=i,e;case B:return Yu(n,o,i,t);case L:return(e=Hu(24,n,t,o)).elementType=L,e.lanes=i,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case C:s=10;break e;case j:s=9;break e;case _:s=11;break e;case T:s=14;break e;case M:s=16,r=null;break e;case F:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Hu(s,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function Gu(e,t,n,r){return(e=Hu(7,e,r,t)).lanes=n,e}function Yu(e,t,n,r){return(e=Hu(23,e,r,t)).elementType=B,e.lanes=n,e}function Ju(e,t,n){return(e=Hu(6,e,null,t)).lanes=n,e}function Qu(e,t,n){return(t=Hu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xu(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Vt(0),this.expirationTimes=Vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.mutableSourceEagerHydrationData=null}function Zu(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:O,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function ec(e,t,n,r){var o=t.current,i=du(),s=pu(o);e:if(n){t:{if(Je(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(go(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(a(171))}if(1===n.tag){var c=n.type;if(go(c)){n=wo(n,c,u);break e}}n=u}else n=po;return null===t.context?t.context=n:t.pendingContext=n,(t=fi(i,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),di(o,t),hu(o,s,i),s}function tc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function nc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function rc(e,t){nc(e,t),(e=e.alternate)&&nc(e,t)}function oc(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xu(e,t,null!=n&&!0===n.hydrate),t=Hu(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,ci(t),e[eo]=n.current,Tr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var o=(t=r[e])._getVersion;o=o(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}function ic(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ac(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i._internalRoot;if("function"===typeof o){var s=o;o=function(){var e=tc(a);s.call(e)}}ec(t,a,e,o)}else{if(i=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new oc(e,0,t?{hydrate:!0}:void 0)}(n,r),a=i._internalRoot,"function"===typeof o){var u=o;o=function(){var e=tc(a);u.call(e)}}wu((function(){ec(t,a,e,o)}))}return tc(a)}function sc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ic(t))throw Error(a(200));return Zu(e,t,null,n)}Gs=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||vo.current)Ba=!0;else{if(0===(n&r)){switch(Ba=!1,t.tag){case 3:Ka(t),Gi();break;case 5:Pi(t);break;case 1:go(t.type)&&xo(t);break;case 4:Fi(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;fo(Zo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(n&t.child.childLanes)?Xa(e,t,n):(fo(Li,1&Li.current),null!==(t=is(e,t,n))?t.sibling:null);fo(Li,1&Li.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(64&e.flags)){if(r)return os(e,t,n);t.flags|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),fo(Li,Li.current),r)break;return null;case 23:case 24:return t.lanes=0,Va(e,t,n)}return is(e,t,n)}Ba=0!==(16384&e.flags)}else Ba=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=yo(t,ho.current),ai(t,n),o=sa(null,t,r,e,o,n),t.flags|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,go(r)){var i=!0;xo(t)}else i=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ci(t);var s=r.getDerivedStateFromProps;"function"===typeof s&&yi(t,r,s,e),o.updater=gi,t.stateNode=o,o._reactInternals=t,xi(t,r,e,n),t=Wa(null,t,r,!0,i,n)}else t.tag=0,La(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"===typeof e)return qu(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===_)return 11;if(e===T)return 14}return 2}(o),e=Xo(o,e),i){case 0:t=Ha(null,t,o,e,n);break e;case 1:t=qa(null,t,o,e,n);break e;case 11:t=Ia(null,t,o,e,n);break e;case 14:t=za(null,t,o,Xo(o.type,e),r,n);break e}throw Error(a(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,Ha(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 1:return r=t.type,o=t.pendingProps,qa(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 3:if(Ka(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,li(e,t),hi(t,r,null,n),(r=t.memoizedState.element)===o)Gi(),t=is(e,t,n);else{if((i=(o=t.stateNode).hydrate)&&(Ui=Gr(t.stateNode.containerInfo.firstChild),zi=t,i=Vi=!0),i){if(null!=(e=o.mutableSourceEagerHydrationData))for(o=0;o<e.length;o+=2)(i=e[o])._workInProgressVersionPrimary=e[o+1],Yi.push(i);for(n=ji(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else La(e,t,r,n),Gi();t=t.child}return t;case 5:return Pi(t),null===e&&qi(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,s=o.children,Hr(r,o)?s=null:null!==i&&Hr(r,i)&&(t.flags|=16),$a(e,t),La(e,t,s,n),t.child;case 6:return null===e&&qi(t),null;case 13:return Xa(e,t,n);case 4:return Fi(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ci(t,null,r,n):La(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Ia(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 7:return La(e,t,t.pendingProps,n),t.child;case 8:case 12:return La(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var u=t.type._context;if(fo(Zo,u._currentValue),u._currentValue=i,null!==s)if(u=s.value,0===(i=lr(u,i)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,i):1073741823))){if(s.children===o.children&&!vo.current){t=is(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){s=u.child;for(var l=c.firstContext;null!==l;){if(l.context===r&&0!==(l.observedBits&i)){1===u.tag&&((l=fi(-1,n&-n)).tag=2,di(u,l)),u.lanes|=n,null!==(l=u.alternate)&&(l.lanes|=n),ii(u.return,n),c.lanes|=n;break}l=l.next}}else s=10===u.tag&&u.type===t.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===t){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}La(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(i=t.pendingProps).children,ai(t,n),r=r(o=si(o,i.unstable_observedBits)),t.flags|=1,La(e,t,r,n),t.child;case 14:return i=Xo(o=t.type,t.pendingProps),za(e,t,o,i=Xo(o.type,i),r,n);case 15:return Ua(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Xo(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,go(r)?(e=!0,xo(t)):e=!1,ai(t,n),ki(t,r,o),xi(t,r,o,n),Wa(null,t,r,!0,e,n);case 19:return os(e,t,n);case 23:case 24:return Va(e,t,n)}throw Error(a(156,t.tag))},oc.prototype.render=function(e){ec(e,this._internalRoot,null,null)},oc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;ec(null,e,null,(function(){t[eo]=null}))},tt=function(e){13===e.tag&&(hu(e,4,du()),rc(e,4))},nt=function(e){13===e.tag&&(hu(e,67108864,du()),rc(e,67108864))},rt=function(e){if(13===e.tag){var t=du(),n=pu(e);hu(e,n,t),rc(e,n)}},ot=function(e,t){return t()},Ce=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=io(r);if(!o)throw Error(a(90));Q(r),ne(r,o)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},Me=ku,Fe=function(e,t,n,r,o){var i=Ts;Ts|=4;try{return Ko(98,e.bind(null,t,n,r,o))}finally{0===(Ts=i)&&(Ks(),Yo())}},Re=function(){0===(49&Ts)&&(function(){if(null!==ou){var e=ou;ou=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,mu(e,Ho())}))}Yo()}(),Ru())},Pe=function(e,t){var n=Ts;Ts|=2;try{return e(t)}finally{0===(Ts=n)&&(Ks(),Yo())}};var uc={Events:[ro,oo,io,Ne,Te,Ru,{current:!1}]},cc={findFiberByHostInstance:no,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},lc={bundleType:cc.bundleType,version:cc.version,rendererPackageName:cc.rendererPackageName,rendererConfig:cc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:cc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{Eo=fc.inject(lc),Do=fc}catch(me){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uc,t.createPortal=sc,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ts;if(0!==(48&n))return e(t);Ts|=1;try{if(e)return Ko(99,e.bind(null,t))}finally{Ts=n,Yo()}},t.hydrate=function(e,t,n){if(!ic(t))throw Error(a(200));return ac(null,e,t,!0,n)},t.render=function(e,t,n){if(!ic(t))throw Error(a(200));return ac(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!ic(e))throw Error(a(40));return!!e._reactRootContainer&&(wu((function(){ac(null,null,e,!1,(function(){e._reactRootContainer=null,e[eo]=null}))})),!0)},t.unstable_batchedUpdates=ku,t.unstable_createPortal=function(e,t){return sc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ic(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return ac(e,t,n,!1,r)},t.version="17.0.2"},function(e,t,n){"use strict";e.exports=n(33)},function(e,t,n){"use strict";var r,o,i,a;if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var u=Date,c=u.now();t.unstable_now=function(){return u.now()-c}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var l=null,f=null,d=function e(){if(null!==l)try{var n=t.unstable_now();l(!0,n),l=null}catch(r){throw setTimeout(e,0),r}};r=function(e){null!==l?setTimeout(r,0,e):(l=e,setTimeout(d,0))},o=function(e,t){f=setTimeout(e,t)},i=function(){clearTimeout(f)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var p=window.setTimeout,h=window.clearTimeout;if("undefined"!==typeof console){var v=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var m=!1,y=null,g=-1,b=5,k=0;t.unstable_shouldYield=function(){return t.unstable_now()>=k},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,x=w.port2;w.port1.onmessage=function(){if(null!==y){var e=t.unstable_now();k=e+b;try{y(!0,e)?x.postMessage(null):(m=!1,y=null)}catch(n){throw x.postMessage(null),n}}else m=!1},r=function(e){y=e,m||(m=!0,x.postMessage(null))},o=function(e,n){g=p((function(){e(t.unstable_now())}),n)},i=function(){h(g),g=-1}}function O(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<S(o,t)))break e;e[r]=t,e[n]=o,n=r}}function E(e){return void 0===(e=e[0])?null:e}function D(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,a=e[i],s=i+1,u=e[s];if(void 0!==a&&0>S(a,n))void 0!==u&&0>S(u,a)?(e[r]=u,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==u&&0>S(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],j=[],_=1,A=null,N=3,T=!1,M=!1,F=!1;function R(e){for(var t=E(j);null!==t;){if(null===t.callback)D(j);else{if(!(t.startTime<=e))break;D(j),t.sortIndex=t.expirationTime,O(C,t)}t=E(j)}}function P(e){if(F=!1,R(e),!M)if(null!==E(C))M=!0,r(B);else{var t=E(j);null!==t&&o(P,t.startTime-e)}}function B(e,n){M=!1,F&&(F=!1,i()),T=!0;var r=N;try{for(R(n),A=E(C);null!==A&&(!(A.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=A.callback;if("function"===typeof a){A.callback=null,N=A.priorityLevel;var s=a(A.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?A.callback=s:A===E(C)&&D(C),R(n)}else D(C);A=E(C)}if(null!==A)var u=!0;else{var c=E(j);null!==c&&o(P,c.startTime-n),u=!1}return u}finally{A=null,N=r,T=!1}}var L=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){M||T||(M=!0,r(B))},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_getFirstCallbackNode=function(){return E(C)},t.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var n=N;N=t;try{return e()}finally{N=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=L,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=N;N=e;try{return t()}finally{N=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var u=-1;break;case 2:u=250;break;case 5:u=1073741823;break;case 4:u=1e4;break;default:u=5e3}return e={id:_++,callback:n,priorityLevel:e,startTime:a,expirationTime:u=a+u,sortIndex:-1},a>s?(e.sortIndex=a,O(j,e),null===E(C)&&e===E(j)&&(F?i():F=!0,o(P,a-s))):(e.sortIndex=u,O(C,e),M||T||(M=!0,r(B))),e},t.unstable_wrapCallback=function(e){var t=N;return function(){var n=N;N=t;try{return e.apply(this,arguments)}finally{N=n}}}},function(e,t,n){"use strict";n(19);var r=n(2),o=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,l=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)s.call(t,r)&&!u.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:l,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},function(e,t,n){"use strict";e.exports=n(36)},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,v=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,k=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function x(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case f:case d:case a:case u:case s:case h:return e;default:switch(e=e&&e.$$typeof){case l:case p:case y:case m:case c:return e;default:return t}}case i:return t}}}function O(e){return x(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=o,t.ForwardRef=p,t.Fragment=a,t.Lazy=y,t.Memo=m,t.Portal=i,t.Profiler=u,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return O(e)||x(e)===f},t.isConcurrentMode=O,t.isContextConsumer=function(e){return x(e)===l},t.isContextProvider=function(e){return x(e)===c},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return x(e)===p},t.isFragment=function(e){return x(e)===a},t.isLazy=function(e){return x(e)===y},t.isMemo=function(e){return x(e)===m},t.isPortal=function(e){return x(e)===i},t.isProfiler=function(e){return x(e)===u},t.isStrictMode=function(e){return x(e)===s},t.isSuspense=function(e){return x(e)===h},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===d||e===u||e===s||e===h||e===v||"object"===typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===c||e.$$typeof===l||e.$$typeof===p||e.$$typeof===b||e.$$typeof===k||e.$$typeof===w||e.$$typeof===g)},t.typeOf=x},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||l||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"FunctionToString",(function(){return ye})),n.d(r,"InboundFilters",(function(){return be}));var o=n(0);function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var a=n(2),s=n.n(a),u=n(11),c=n.n(u),l=n(4);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(){d=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(j){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),a=new D(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return C()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(j){return{type:"throw",arg:j}}}e.wrap=u;var l={};function p(){}function h(){}function v(){}var m={};s(m,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==t&&n.call(g,o)&&(m=g);var b=v.prototype=p.prototype=Object.create(m);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(o,i,a,s){var u=c(e[o],e,i);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==f(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:C}}function C(){return{value:void 0,done:!0}}return h.prototype=v,s(b,"constructor",v),s(v,"constructor",h),h.displayName=s(v,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s(e,a,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},k(w.prototype),s(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new w(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(b),s(b,a,"Generator"),s(b,o,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function p(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,o)}function h(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,s,"next",e)}function s(e){p(i,r,o,a,s,"throw",e)}a(void 0)}))}}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function b(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function w(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(cr){return!1}}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e,t){if(t&&("object"===f(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return x(e)}function E(e){var t=w();return function(){var n,r=k(e);if(t){var o=k(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}var D=n(2).createContext({site:{},member:{},action:"",brandColor:"",pageData:{},onAction:function(e,t){return{action:e,data:t}}}),S=n(1),C=["children","head","title","style","onResize"],j=function(e){b(n,e);var t=E(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).handleLoad=function(){e.setupFrameBaseStyle()},e}return y(n,[{key:"componentDidMount",value:function(){this.node.addEventListener("load",this.handleLoad)}},{key:"componentWillUnmout",value:function(){this.node.removeEventListener("load",this.handleLoad)}},{key:"setupFrameBaseStyle",value:function(){var e=this;if(this.node.contentDocument){var t,n;if(this.iframeHtml=this.node.contentDocument.documentElement,this.iframeHead=this.node.contentDocument.head,this.iframeRoot=this.node.contentDocument.body,this.forceUpdate(),this.props.onResize)null===(t=new ResizeObserver((function(t){return e.props.onResize(e.iframeRoot)})))||void 0===t||null===(n=t.observe)||void 0===n||n.call(t,this.iframeRoot);this.node.contentWindow.addEventListener("keydown",(function(e){window.dispatchEvent(new KeyboardEvent("keydown",e))}))}}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.head,a=t.title,s=void 0===a?"":a,c=t.style,l=void 0===c?{}:c,f=(t.onResize,i(t,C));return Object(S.jsxs)("iframe",Object(o.a)(Object(o.a)({srcDoc:"<!DOCTYPE html>"},f),{},{ref:function(t){return e.node=t},title:s,style:l,frameBorder:"0",children:[this.iframeHead&&Object(u.createPortal)(r,this.iframeHead),this.iframeRoot&&Object(u.createPortal)(n,this.iframeRoot)]}))}}]),n}(a.Component),_=["children","type","style"],A=function(e){var t,n=e.children,r=e.type,s=e.style,u=i(e,_),c=Object(a.useContext)(D).stylesUrl,f="dynamic"===(r=null!==(t=r)&&void 0!==t?t:"dynamic")?{width:"100%",height:"400px"}:{zIndex:"3999999",position:"fixed",left:"0",top:"0",width:"100%",height:"100%",overflow:"hidden"},d=Object(a.useState)(f),p=Object(l.a)(d,2),h=p[0],v=p[1],m=Object(a.useState)(!1),y=Object(l.a)(m,2),g=y[0],b=y[1],k=Object(S.jsxs)(S.Fragment,{children:[Object(S.jsx)("link",{rel:"stylesheet",href:c,onLoad:function(){b(!0)}}),Object(S.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n body, html {\n overflow: hidden;\n }\n "}}),Object(S.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0, maximum-scale=1.0"})]}),w=Object(o.a)(Object(o.a)({},h),s);return Object(S.jsx)(j,Object(o.a)(Object(o.a)({},u),{},{head:k,style:w,onResize:"dynamic"===r?function(e){v((function(t){return Object(o.a)(Object(o.a)({},t),{},{height:"".concat(e.scrollHeight,"px")})}))}:null,children:g&&n}))},N=n(9),T=n(10),M=n(12);function F(){var e=Object(N.a)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0".concat(t);return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function R(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function P(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function B(e){var t=e.message,n=e.event_id;if(t)return t;var r=P(e);return r?r.type&&r.value?"".concat(r.type,": ").concat(r.value):r.type||r.value||n||"<unknown>":n||"<unknown>"}function L(e,t,n){var r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function I(e,t){var n=P(e);if(n){var r=n.mechanism;if(n.mechanism=Object(o.a)(Object(o.a)(Object(o.a)({},{type:"generic",handled:!0}),r),t),t&&"data"in t){var i=Object(o.a)(Object(o.a)({},r&&r.data),t.data);n.mechanism.data=i}}}function z(e){if(e&&e.__sentry_captured__)return!0;try{Object(T.a)(e,"__sentry_captured__",!0)}catch(t){}return!1}var U,V=n(23),$=Object(N.a)(),H="Sentry Logger ",q=["debug","info","warn","error","log","assert","trace"];function W(e){var t=Object(N.a)();if(!("console"in t))return e();var n=t.console,r={};q.forEach((function(e){var o=n[e]&&n[e].__sentry_original__;e in t.console&&o&&(r[e]=n[e],n[e]=o)}));try{return e()}finally{Object.keys(r).forEach((function(e){n[e]=r[e]}))}}function K(){var e=!1,t={enable:function(){e=!0},disable:function(){e=!1}};return"undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?q.forEach((function(n){t[n]=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];e&&W((function(){var e;(e=$.console)[n].apply(e,["".concat(H,"[").concat(n,"]:")].concat(r))}))}})):q.forEach((function(e){t[e]=function(){}})),t}U="undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?Object(N.b)("logger",K):K();var G,Y=n(15),J=n(3),Q=n(5),X=n(7);function Z(e){return new te((function(t){t(e)}))}function ee(e){return new te((function(t,n){n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(G||(G={}));var te=function(){function e(t){v(this,e),e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this),e.prototype.__init6.call(this);try{t(this._resolve,this._reject)}catch(cr){this._reject(cr)}}return y(e,[{key:"__init",value:function(){this._state=G.PENDING}},{key:"__init2",value:function(){this._handlers=[]}},{key:"then",value:function(t,n){var r=this;return new e((function(e,o){r._handlers.push([!1,function(n){if(t)try{e(t(n))}catch(cr){o(cr)}else e(n)},function(t){if(n)try{e(n(t))}catch(cr){o(cr)}else o(t)}]),r._executeHandlers()}))}},{key:"catch",value:function(e){return this.then((function(e){return e}),e)}},{key:"finally",value:function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))}},{key:"__init3",value:function(){var e=this;this._resolve=function(t){e._setResult(G.RESOLVED,t)}}},{key:"__init4",value:function(){var e=this;this._reject=function(t){e._setResult(G.REJECTED,t)}}},{key:"__init5",value:function(){var e=this;this._setResult=function(t,n){e._state===G.PENDING&&(Object(X.n)(n)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))}}},{key:"__init6",value:function(){var e=this;this._executeHandlers=function(){if(e._state!==G.PENDING){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t[0]||(e._state===G.RESOLVED&&t[1](e._value),e._state===G.REJECTED&&t[2](e._value),t[0]=!0)}))}}}}]),e}();function ne(e){var t=Object(V.b)(),n={sid:F(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:function(){return function(e){return Object(T.c)({sid:"".concat(e.sid),init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"===typeof e.did||"string"===typeof e.did?"".concat(e.did):void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)}};return e&&re(n,e),n}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Object(V.b)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:F()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did="".concat(t.did)),"number"===typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"===typeof t.duration)e.duration=t.duration;else{var n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"===typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}var oe=function(){function e(){v(this,e),this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return y(e,[{key:"addScopeListener",value:function(e){this._scopeListeners.push(e)}},{key:"addEventProcessor",value:function(e){return this._eventProcessors.push(e),this}},{key:"setUser",value:function(e){return this._user=e||{},this._session&&re(this._session,{user:e}),this._notifyScopeListeners(),this}},{key:"getUser",value:function(){return this._user}},{key:"getRequestSession",value:function(){return this._requestSession}},{key:"setRequestSession",value:function(e){return this._requestSession=e,this}},{key:"setTags",value:function(e){return this._tags=Object(o.a)(Object(o.a)({},this._tags),e),this._notifyScopeListeners(),this}},{key:"setTag",value:function(e,t){return this._tags=Object(o.a)(Object(o.a)({},this._tags),{},Object(Q.a)({},e,t)),this._notifyScopeListeners(),this}},{key:"setExtras",value:function(e){return this._extra=Object(o.a)(Object(o.a)({},this._extra),e),this._notifyScopeListeners(),this}},{key:"setExtra",value:function(e,t){return this._extra=Object(o.a)(Object(o.a)({},this._extra),{},Object(Q.a)({},e,t)),this._notifyScopeListeners(),this}},{key:"setFingerprint",value:function(e){return this._fingerprint=e,this._notifyScopeListeners(),this}},{key:"setLevel",value:function(e){return this._level=e,this._notifyScopeListeners(),this}},{key:"setTransactionName",value:function(e){return this._transactionName=e,this._notifyScopeListeners(),this}},{key:"setContext",value:function(e,t){return null===t?delete this._contexts[e]:this._contexts=Object(o.a)(Object(o.a)({},this._contexts),{},Object(Q.a)({},e,t)),this._notifyScopeListeners(),this}},{key:"setSpan",value:function(e){return this._span=e,this._notifyScopeListeners(),this}},{key:"getSpan",value:function(){return this._span}},{key:"getTransaction",value:function(){var e=this.getSpan();return e&&e.transaction}},{key:"setSession",value:function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}},{key:"getSession",value:function(){return this._session}},{key:"update",value:function(t){if(!t)return this;if("function"===typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=Object(o.a)(Object(o.a)({},this._tags),t._tags),this._extra=Object(o.a)(Object(o.a)({},this._extra),t._extra),this._contexts=Object(o.a)(Object(o.a)({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):Object(X.i)(t)&&(this._tags=Object(o.a)(Object(o.a)({},this._tags),t.tags),this._extra=Object(o.a)(Object(o.a)({},this._extra),t.extra),this._contexts=Object(o.a)(Object(o.a)({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this}},{key:"clear",value:function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}},{key:"addBreadcrumb",value:function(e,t){var n="number"===typeof t?Math.min(t,100):100;if(n<=0)return this;var r=Object(o.a)({timestamp:Object(V.a)()},e);return this._breadcrumbs=[].concat(Object(J.a)(this._breadcrumbs),[r]).slice(-n),this._notifyScopeListeners(),this}},{key:"clearBreadcrumbs",value:function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}},{key:"addAttachment",value:function(e){return this._attachments.push(e),this}},{key:"getAttachments",value:function(){return this._attachments}},{key:"clearAttachments",value:function(){return this._attachments=[],this}},{key:"applyToEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._extra&&Object.keys(this._extra).length&&(e.extra=Object(o.a)(Object(o.a)({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=Object(o.a)(Object(o.a)({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=Object(o.a)(Object(o.a)({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=Object(o.a)(Object(o.a)({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=Object(o.a)({trace:this._span.getTraceContext()},e.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags=Object(o.a)({transaction:n},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=[].concat(Object(J.a)(e.breadcrumbs||[]),Object(J.a)(this._breadcrumbs)),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=Object(o.a)(Object(o.a)({},e.sdkProcessingMetadata),this._sdkProcessingMetadata),this._notifyEventProcessors([].concat(Object(J.a)(ie()),Object(J.a)(this._eventProcessors)),e,t)}},{key:"setSDKProcessingMetadata",value:function(e){return this._sdkProcessingMetadata=Object(o.a)(Object(o.a)({},this._sdkProcessingMetadata),e),this}},{key:"_notifyEventProcessors",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return new te((function(a,s){var u=e[i];if(null===t||"function"!==typeof u)a(t);else{var c=u(Object(o.a)({},t),n);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&u.id&&null===c&&U.log('Event processor "'.concat(u.id,'" dropped event')),Object(X.n)(c)?c.then((function(t){return r._notifyEventProcessors(e,t,n,i+1).then(a)})).then(null,s):r._notifyEventProcessors(e,c,n,i+1).then(a).then(null,s)}}))}},{key:"_notifyScopeListeners",value:function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)}},{key:"_applyFingerprint",value:function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}],[{key:"clone",value:function(t){var n=new e;return t&&(n._breadcrumbs=Object(J.a)(t._breadcrumbs),n._tags=Object(o.a)({},t._tags),n._extra=Object(o.a)({},t._extra),n._contexts=Object(o.a)({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=Object(J.a)(t._eventProcessors),n._requestSession=t._requestSession,n._attachments=Object(J.a)(t._attachments)),n}}]),e}();function ie(){return Object(N.b)("globalEventProcessors",(function(){return[]}))}function ae(e){ie().push(e)}var se,ue=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new oe,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;v(this,e),this._version=r,e.prototype.__init.call(this),this.getStackTop().scope=n,t&&this.bindClient(t)}return y(e,[{key:"__init",value:function(){this._stack=[{}]}},{key:"isOlderThan",value:function(e){return this._version<e}},{key:"bindClient",value:function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}},{key:"pushScope",value:function(){var e=oe.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}},{key:"popScope",value:function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}},{key:"withScope",value:function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}},{key:"getClient",value:function(){return this.getStackTop().client}},{key:"getScope",value:function(){return this.getStackTop().scope}},{key:"getStack",value:function(){return this._stack}},{key:"getStackTop",value:function(){return this._stack[this._stack.length-1]}},{key:"captureException",value:function(e,t){var n=this._lastEventId=t&&t.event_id?t.event_id:F(),r=new Error("Sentry syntheticException");return this._withClient((function(i,a){i.captureException(e,Object(o.a)(Object(o.a)({originalException:e,syntheticException:r},t),{},{event_id:n}),a)})),n}},{key:"captureMessage",value:function(e,t,n){var r=this._lastEventId=n&&n.event_id?n.event_id:F(),i=new Error(e);return this._withClient((function(a,s){a.captureMessage(e,t,Object(o.a)(Object(o.a)({originalException:e,syntheticException:i},n),{},{event_id:r}),s)})),r}},{key:"captureEvent",value:function(e,t){var n=t&&t.event_id?t.event_id:F();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient((function(r,i){r.captureEvent(e,Object(o.a)(Object(o.a)({},t),{},{event_id:n}),i)})),n}},{key:"lastEventId",value:function(){return this._lastEventId}},{key:"addBreadcrumb",value:function(e,t){var n=this.getStackTop(),r=n.scope,i=n.client;if(r&&i){var a=i.getOptions&&i.getOptions()||{},s=a.beforeBreadcrumb,u=void 0===s?null:s,c=a.maxBreadcrumbs,l=void 0===c?100:c;if(!(l<=0)){var f=Object(V.a)(),d=Object(o.a)({timestamp:f},e),p=u?W((function(){return u(d,t)})):d;null!==p&&r.addBreadcrumb(p,l)}}}},{key:"setUser",value:function(e){var t=this.getScope();t&&t.setUser(e)}},{key:"setTags",value:function(e){var t=this.getScope();t&&t.setTags(e)}},{key:"setExtras",value:function(e){var t=this.getScope();t&&t.setExtras(e)}},{key:"setTag",value:function(e,t){var n=this.getScope();n&&n.setTag(e,t)}},{key:"setExtra",value:function(e,t){var n=this.getScope();n&&n.setExtra(e,t)}},{key:"setContext",value:function(e,t){var n=this.getScope();n&&n.setContext(e,t)}},{key:"configureScope",value:function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)}},{key:"run",value:function(e){var t=le(this);try{e(this)}finally{le(t)}}},{key:"getIntegration",value:function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Cannot retrieve integration ".concat(e.id," from the current Hub")),null}}},{key:"startTransaction",value:function(e,t){return this._callExtensionMethod("startTransaction",e,t)}},{key:"traceHeaders",value:function(){return this._callExtensionMethod("traceHeaders")}},{key:"captureSession",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e)return this.endSession();this._sendSessionUpdate()}},{key:"endSession",value:function(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e,t){var n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),re(e,n)}(n),this._sendSessionUpdate(),t&&t.setSession()}},{key:"startSession",value:function(e){var t=this.getStackTop(),n=t.scope,r=t.client,i=r&&r.getOptions()||{},a=i.release,s=i.environment,u=(Object(N.a)().navigator||{}).userAgent,c=ne(Object(o.a)(Object(o.a)(Object(o.a)({release:a,environment:s},n&&{user:n.getUser()}),u&&{userAgent:u}),e));if(n){var l=n.getSession&&n.getSession();l&&"ok"===l.status&&re(l,{status:"exited"}),this.endSession(),n.setSession(c)}return c}},{key:"shouldSendDefaultPii",value:function(){var e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}},{key:"_sendSessionUpdate",value:function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}}},{key:"_withClient",value:function(e){var t=this.getStackTop(),n=t.scope,r=t.client;r&&e(r,n)}},{key:"_callExtensionMethod",value:function(e){var t=ce(),n=t.__SENTRY__;if(n&&n.extensions&&"function"===typeof n.extensions[e]){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return n.extensions[e].apply(this,o)}("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Extension method ".concat(e," couldn't be found, doing nothing."))}}]),e}();function ce(){var e=Object(N.a)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function le(e){var t=ce(),n=pe(t);return he(t,e),n}function fe(){var e=ce();return de(e)&&!pe(e).isOlderThan(4)||he(e,new ue),Object(Y.b)()?function(e){try{var t=ce().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return pe(e);if(!de(n)||pe(n).isOlderThan(4)){var r=pe(e).getStackTop();he(n,new ue(r.client,oe.clone(r.scope)))}return pe(n)}catch(o){return pe(e)}}(e):pe(e)}function de(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function pe(e){return Object(N.b)("hub",(function(){return new ue}),e)}function he(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function ve(e,t){return fe().captureException(e,{captureContext:t})}function me(e){fe().withScope(e)}var ye=function(){function e(){v(this,e),e.prototype.__init.call(this)}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"setupOnce",value:function(){se=Function.prototype.toString,Function.prototype.toString=function(){for(var e=Object(T.f)(this)||this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return se.apply(e,n)}}}],[{key:"__initStatic",value:function(){this.id="FunctionToString"}}]),e}();ye.__initStatic();var ge=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],be=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),this._options=t,e.prototype.__init.call(this)}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"setupOnce",value:function(t,n){var r=function(t){var r=n();if(r){var o=r.getIntegration(e);if(o){var i=r.getClient(),a=i?i.getOptions():{},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{allowUrls:[].concat(Object(J.a)(e.allowUrls||[]),Object(J.a)(t.allowUrls||[])),denyUrls:[].concat(Object(J.a)(e.denyUrls||[]),Object(J.a)(t.denyUrls||[])),ignoreErrors:[].concat(Object(J.a)(e.ignoreErrors||[]),Object(J.a)(t.ignoreErrors||[]),ge),ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(o._options,a);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(cr){}return!1}(e))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Event dropped due to being internal Sentry Error.\nEvent: ".concat(B(e))),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,o=t.value,i=void 0===o?"":o;return["".concat(i),"".concat(r,": ").concat(i)]}catch(a){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Cannot extract message for event ".concat(B(e))),[]}return[]}(e).some((function(e){return t.some((function(t){return Object(M.a)(e,t)}))}))}(e,t.ignoreErrors))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: ".concat(B(e))),!0;if(function(e,t){if(!t||!t.length)return!1;var n=ke(e);return!!n&&t.some((function(e){return Object(M.a)(n,e)}))}(e,t.denyUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: ".concat(B(e),".\nUrl: ").concat(ke(e))),!0;if(!function(e,t){if(!t||!t.length)return!0;var n=ke(e);return!n||t.some((function(e){return Object(M.a)(n,e)}))}(e,t.allowUrls))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: ".concat(B(e),".\nUrl: ").concat(ke(e))),!0;return!1}(t,s)?null:t}}return t};r.id=this.name,t(r)}}],[{key:"__initStatic",value:function(){this.id="InboundFilters"}}]),e}();function ke(e){try{var t;try{t=e.exception.values[0].stacktrace.frames}catch(cr){}return t?function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length-1;t>=0;t--){var n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(n){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Cannot extract url for event ".concat(B(e))),null}}be.__initStatic();var we=[];function xe(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function Oe(e){var t=e.defaultIntegrations&&Object(J.a)(e.defaultIntegrations)||[],n=e.integrations,r=Object(J.a)(xe(t));Array.isArray(n)?r=[].concat(Object(J.a)(r.filter((function(e){return n.every((function(t){return t.name!==e.name}))}))),Object(J.a)(xe(n))):"function"===typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o,i=r.map((function(e){return e.name})),a="Debug";-1!==i.indexOf(a)&&(o=r).push.apply(o,Object(J.a)(r.splice(i.indexOf(a),1)));return r}function Ee(e,t){!0===t.debug&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?U.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var n=fe(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}function De(e,t,n){return De=w()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o},De.apply(null,arguments)}function Se(e){var t="function"===typeof Map?new Map:void 0;return Se=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return De(e,arguments,k(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g(r,e)},Se(e)}var Ce=function(e){b(n,e);var t=E(n);function n(e){var r;return v(this,n),(r=t.call(this,e)).message=e,r.name=(this instanceof n?this.constructor:void 0).prototype.constructor.name,Object.setPrototypeOf(x(r),(this instanceof n?this.constructor:void 0).prototype),r}return y(n)}(Se(Error)),je=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function _e(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.host,r=e.path,o=e.pass,i=e.port,a=e.projectId,s=e.protocol,u=e.publicKey;return"".concat(s,"://").concat(u).concat(t&&o?":".concat(o):"")+"@".concat(n).concat(i?":".concat(i):"","/").concat(r?"".concat(r,"/"):r).concat(a)}function Ae(e){var t=je.exec(e);if(!t)throw new Ce("Invalid Sentry Dsn: ".concat(e));var n=t.slice(1),r=Object(l.a)(n,6),o=r[0],i=r[1],a=r[2],s=void 0===a?"":a,u=r[3],c=r[4],f=void 0===c?"":c,d="",p=r[5],h=p.split("/");if(h.length>1&&(d=h.slice(0,-1).join("/"),p=h.pop()),p){var v=p.match(/^\d+/);v&&(p=v[0])}return Ne({host:u,pass:s,path:d,projectId:p,port:f,protocol:o,publicKey:i})}function Ne(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Te(e){var t="string"===typeof e?Ae(e):Ne(e);return function(e){if("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){var t=e.port,n=e.projectId,r=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Ce("Invalid Sentry Dsn: ".concat(t," missing"))})),!n.match(/^\d+$/))throw new Ce("Invalid Sentry Dsn: Invalid projectId ".concat(n));if(!function(e){return"http"===e||"https"===e}(r))throw new Ce("Invalid Sentry Dsn: Invalid protocol ".concat(r));if(t&&isNaN(parseInt(t,10)))throw new Ce("Invalid Sentry Dsn: Invalid port ".concat(t))}}(t),t}function Me(e){var t=e.protocol?"".concat(e.protocol,":"):"",n=e.port?":".concat(e.port):"";return"".concat(t,"//").concat(e.host).concat(n).concat(e.path?"/".concat(e.path):"","/api/")}function Fe(e,t){return t||"".concat(function(e){return"".concat(Me(e)).concat(e.projectId,"/envelope/")}(e),"?").concat(function(e){return Object(T.h)({sentry_key:e.publicKey,sentry_version:"7"})}(e))}function Re(e,t){var n=Te(e),r="".concat(Me(n),"embed/error-page/"),o="dsn=".concat(_e(n));for(var i in t)if("dsn"!==i)if("user"===i){var a=t.user;if(!a)continue;a.name&&(o+="&name=".concat(encodeURIComponent(a.name))),a.email&&(o+="&email=".concat(encodeURIComponent(a.email)))}else o+="&".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(t[i]));return"".concat(r,"?").concat(o)}var Pe=n(16);function Be(){if(!("fetch"in Object(N.a)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(cr){return!1}}function Le(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}var Ie,ze=n(6),Ue=Object(N.a)(),Ve={},$e={};function He(e){if(!$e[e])switch($e[e]=!0,e){case"console":!function(){if(!("console"in Ue))return;q.forEach((function(e){e in Ue.console&&Object(T.e)(Ue.console,e,(function(t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];We("console",{args:r,level:e}),t&&t.apply(Ue.console,r)}}))}))}();break;case"dom":!function(){if(!("document"in Ue))return;var e=We.bind(null,"dom"),t=Ze(e,!0);Ue.document.addEventListener("click",t,!1),Ue.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){var n=Ue[t]&&Ue[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Object(T.e)(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this,a=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var u=Ze(e);s.handler=u,t.call(this,n,u,o)}s.refCount+=1}catch(cr){}return t.call(this,n,r,o)}})),Object(T.e)(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var o=this,i=o.__sentry_instrumentation_handlers__||{},a=i[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete o.__sentry_instrumentation_handlers__)}catch(cr){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in Ue))return;var e=XMLHttpRequest.prototype;Object(T.e)(e,"open",(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=this,i=n[1],a=o.__sentry_xhr__={method:Object(X.l)(n[0])?n[0].toUpperCase():n[0],url:n[1]};Object(X.l)(i)&&"POST"===a.method&&i.match(/sentry_key/)&&(o.__sentry_own_request__=!0);var s=function(){if(4===o.readyState){try{a.status_code=o.status}catch(cr){}We("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:o})}};return"onreadystatechange"in o&&"function"===typeof o.onreadystatechange?Object(T.e)(o,"onreadystatechange",(function(e){return function(){s();for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(o,n)}})):o.addEventListener("readystatechange",s),e.apply(o,n)}})),Object(T.e)(e,"send",(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.__sentry_xhr__&&void 0!==n[0]&&(this.__sentry_xhr__.body=n[0]),We("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),e.apply(this,n)}}))}();break;case"fetch":!function(){if(!function(){if(!Be())return!1;var e=Object(N.a)();if(Le(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"===typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=Le(r.contentWindow.fetch)),n.head.removeChild(r)}catch(o){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",o)}return t}())return;Object(T.e)(Ue,"fetch",(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i={args:n,fetchData:{method:Ke(n),url:Ge(n)},startTimestamp:Date.now()};return We("fetch",Object(o.a)({},i)),e.apply(Ue,n).then((function(e){return We("fetch",Object(o.a)(Object(o.a)({},i),{},{endTimestamp:Date.now(),response:e})),e}),(function(e){throw We("fetch",Object(o.a)(Object(o.a)({},i),{},{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!function(){var e=Object(N.a)(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}())return;var e=Ue.onpopstate;function t(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n.length>2?n[2]:void 0;if(o){var i=Ie,a=String(o);Ie=a,We("history",{from:i,to:a})}return e.apply(this,n)}}Ue.onpopstate=function(){var t=Ue.location.href,n=Ie;if(Ie=t,We("history",{from:n,to:t}),e)try{for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e.apply(this,o)}catch(a){}},Object(T.e)(Ue.history,"pushState",t),Object(T.e)(Ue.history,"replaceState",t)}();break;case"error":et=Ue.onerror,Ue.onerror=function(e,t,n,r,o){return We("error",{column:r,error:o,line:n,msg:e,url:t}),!!et&&et.apply(this,arguments)};break;case"unhandledrejection":tt=Ue.onunhandledrejection,Ue.onunhandledrejection=function(e){return We("unhandledrejection",e),!tt||tt.apply(this,arguments)};break;default:return void(("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("unknown instrumentation type:",e))}}function qe(e,t){Ve[e]=Ve[e]||[],Ve[e].push(t),He(e)}function We(e,t){if(e&&Ve[e]){var n,r=Object(ze.a)(Ve[e]||[]);try{for(r.s();!(n=r.n()).done;){var o=n.value;try{o(t)}catch(cr){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Error while triggering instrumentation handler.\nType: ".concat(e,"\nName: ").concat(Object(Pe.b)(o),"\nError:"),cr)}}}catch(i){r.e(i)}finally{r.f()}}}function Ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"Request"in Ue&&Object(X.g)(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function Ge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"string"===typeof e[0]?e[0]:"Request"in Ue&&Object(X.g)(e[0],Request)?e[0].url:String(e[0])}var Ye,Je;function Qe(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(cr){}return!1}function Xe(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(cr){}return!0}function Ze(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){if(n&&Je!==n&&!Xe(n)){var r="keypress"===n.type?"input":n.type;(void 0===Ye||Qe(Je,n))&&(e({event:n,name:r,global:t}),Je=n),clearTimeout(Ye),Ye=Ue.setTimeout((function(){Ye=void 0}),1e3)}}}var et=null;var tt=null;function nt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=k(e)););return e}function rt(){return rt="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=nt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},rt.apply(this,arguments)}var ot="7.5.0";function it(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return[e,t]}function at(e,t){var n=Object(l.a)(e,2),r=n[0],o=n[1];return[r,[].concat(Object(J.a)(o),[t])]}function st(e,t){e[1].forEach((function(e){var n=e[0].type;t(e,n)}))}function ut(e,t){return(t||new TextEncoder).encode(e)}function ct(e,t){var n=Object(l.a)(e,2),r=n[0],o=n[1],i=JSON.stringify(r);function a(e){"string"===typeof i?i="string"===typeof e?i+e:[ut(i,t),e]:i.push("string"===typeof e?ut(e,t):e)}var s,u=Object(ze.a)(o);try{for(u.s();!(s=u.n()).done;){var c=s.value,f=Object(l.a)(c,2),d=f[0],p=f[1];a("\n".concat(JSON.stringify(d),"\n")),a("string"===typeof p||p instanceof Uint8Array?p:JSON.stringify(p))}}catch(h){u.e(h)}finally{u.f()}return"string"===typeof i?i:function(e){var t,n=e.reduce((function(e,t){return e+t.length}),0),r=new Uint8Array(n),o=0,i=Object(ze.a)(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;r.set(a,o),o+=a.length}}catch(h){i.e(h)}finally{i.f()}return r}(i)}function lt(e,t){var n="string"===typeof e.data?ut(e.data,t):e.data;return[Object(T.c)({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}var ft={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function dt(e){return ft[e]}var pt=n(46);function ht(e){if(e&&e.sdk){var t=e.sdk;return{name:t.name,version:t.version}}}function vt(e,t,n,r){var i=ht(n),a=e.type||"event",s=(e.sdkProcessingMetadata||{}).transactionSampling||{},u=s.method,c=s.rate;!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[].concat(Object(J.a)(e.sdk.integrations||[]),Object(J.a)(t.integrations||[])),e.sdk.packages=[].concat(Object(J.a)(e.sdk.packages||[]),Object(J.a)(t.packages||[])))}(e,n&&n.sdk);var l=function(e,t,n,r){var i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baggage,a=i&&function(e){return e[0]}(i);return Object(o.a)(Object(o.a)(Object(o.a)({event_id:e.event_id,sent_at:(new Date).toISOString()},t&&{sdk:t}),!!n&&{dsn:_e(r)}),"transaction"===e.type&&a&&{trace:Object(T.c)(Object(o.a)({},a))})}(e,i,r,t);return delete e.sdkProcessingMetadata,it(l,[[{type:a,sample_rates:[{id:u,rate:c}]},e]])}var mt="Not capturing exception because it's already been captured.",yt=function(){function e(t){if(v(this,e),e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),this._options=t,t.dsn){this._dsn=Te(t.dsn);var n=Fe(this._dsn,t.tunnel);this._transport=t.transport(Object(o.a)(Object(o.a)({recordDroppedEvent:this.recordDroppedEvent.bind(this)},t.transportOptions),{},{url:n}))}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("No DSN provided, client will not do anything.")}return y(e,[{key:"__init",value:function(){this._integrations={}}},{key:"__init2",value:function(){this._integrationsInitialized=!1}},{key:"__init3",value:function(){this._numProcessing=0}},{key:"__init4",value:function(){this._outcomes={}}},{key:"captureException",value:function(e,t,n){var r=this;if(!z(e)){var o=t&&t.event_id;return this._process(this.eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){o=e}))),o}("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log(mt)}},{key:"captureMessage",value:function(e,t,n,r){var o=this,i=n&&n.event_id,a=Object(X.j)(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(a.then((function(e){return o._captureEvent(e,n,r)})).then((function(e){i=e}))),i}},{key:"captureEvent",value:function(e,t,n){if(!(t&&t.originalException&&z(t.originalException))){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r}("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log(mt)}},{key:"captureSession",value:function(e){this._isEnabled()?"string"!==typeof e.release?("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),re(e,{init:!1})):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("SDK not enabled, will not capture session.")}},{key:"getDsn",value:function(){return this._dsn}},{key:"getOptions",value:function(){return this._options}},{key:"getTransport",value:function(){return this._transport}},{key:"flush",value:function(e){var t=this._transport;return t?this._isClientDoneProcessing(e).then((function(n){return t.flush(e).then((function(e){return n&&e}))})):Z(!0)}},{key:"close",value:function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))}},{key:"setupIntegrations",value:function(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){var t={};return e.forEach((function(e){t[e.name]=e,-1===we.indexOf(e.name)&&(e.setupOnce(ae,fe),we.push(e.name),("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log("Integration installed: ".concat(e.name)))})),t}(this._options.integrations),this._integrationsInitialized=!0)}},{key:"getIntegrationById",value:function(e){return this._integrations[e]}},{key:"getIntegration",value:function(e){try{return this._integrations[e.id]||null}catch(t){return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Cannot retrieve integration ".concat(e.id," from the current Client")),null}}},{key:"sendEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._dsn){var n,r=vt(e,this._dsn,this._options._metadata,this._options.tunnel),o=Object(ze.a)(t.attachments||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value;r=at(r,lt(i,this._options.transportOptions&&this._options.transportOptions.textEncoder))}}catch(a){o.e(a)}finally{o.f()}this._sendEnvelope(r)}}},{key:"sendSession",value:function(e){if(this._dsn){var t=function(e,t,n,r){var i=ht(n);return it(Object(o.a)(Object(o.a)({sent_at:(new Date).toISOString()},i&&{sdk:i}),!!r&&{dsn:_e(t)}),["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}},{key:"recordDroppedEvent",value:function(e,t){if(this._options.sendClientReports){var n="".concat(e,":").concat(t);("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log('Adding outcome: "'.concat(n,'"')),this._outcomes[n]=this._outcomes[n]+1||1}}},{key:"_updateSessionFromEvent",value:function(e,t){var n=!1,r=!1,i=t.exception&&t.exception.values;if(i){r=!0;var a,s=Object(ze.a)(i);try{for(s.s();!(a=s.n()).done;){var u=a.value.mechanism;if(u&&!1===u.handled){n=!0;break}}}catch(l){s.e(l)}finally{s.f()}}var c="ok"===e.status;(c&&0===e.errors||c&&n)&&(re(e,Object(o.a)(Object(o.a)({},n&&{status:"crashed"}),{},{errors:e.errors||Number(r||n)})),this.captureSession(e))}},{key:"_isClientDoneProcessing",value:function(e){var t=this;return new te((function(n){var r=0,o=setInterval((function(){0==t._numProcessing?(clearInterval(o),n(!0)):(r+=1,e&&r>=e&&(clearInterval(o),n(!1)))}),1)}))}},{key:"_isEnabled",value:function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}},{key:"_prepareEvent",value:function(e,t,n){var r=this,i=this.getOptions(),a=i.normalizeDepth,s=void 0===a?3:a,u=i.normalizeMaxBreadth,c=void 0===u?1e3:u,l=Object(o.a)(Object(o.a)({},e),{},{event_id:e.event_id||t.event_id||F(),timestamp:e.timestamp||Object(V.a)()});this._applyClientOptions(l),this._applyIntegrationsMetadata(l);var f=n;t.captureContext&&(f=oe.clone(f).update(t.captureContext));var d=Z(l);if(f){var p=[].concat(Object(J.a)(t.attachments||[]),Object(J.a)(f.getAttachments()));p.length&&(t.attachments=p),d=f.applyToEvent(l,t)}return d.then((function(e){return"number"===typeof s&&s>0?r._normalizeEvent(e,s,c):e}))}},{key:"_normalizeEvent",value:function(e,t,n){if(!e)return null;var r=Object(o.a)(Object(o.a)(Object(o.a)(Object(o.a)(Object(o.a)({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return Object(o.a)(Object(o.a)({},e),e.data&&{data:Object(pt.a)(e.data,t,n)})}))}),e.user&&{user:Object(pt.a)(e.user,t,n)}),e.contexts&&{contexts:Object(pt.a)(e.contexts,t,n)}),e.extra&&{extra:Object(pt.a)(e.extra,t,n)});return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Object(pt.a)(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map((function(e){return e.data&&(e.data=Object(pt.a)(e.data,t,n)),e}))),r}},{key:"_applyClientOptions",value:function(e){var t=this.getOptions(),n=t.environment,r=t.release,o=t.dist,i=t.maxValueLength,a=void 0===i?250:i;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==o&&(e.dist=o),e.message&&(e.message=Object(M.d)(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=Object(M.d)(s.value,a));var u=e.request;u&&u.url&&(u.url=Object(M.d)(u.url,a))}},{key:"_applyIntegrationsMetadata",value:function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[].concat(Object(J.a)(e.sdk.integrations||[]),Object(J.a)(t)))}},{key:"_captureEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn(e)}))}},{key:"_processEvent",value:function(e,t,n){var r=this,o=this.getOptions(),i=o.beforeSend,a=o.sampleRate;if(!this._isEnabled())return ee(new Ce("SDK not enabled, will not capture event."));var s="transaction"===e.type;return!s&&"number"===typeof a&&Math.random()>a?(this.recordDroppedEvent("sample_rate","error"),ee(new Ce("Discarding event because it's not included in the random sample (sampling rate = ".concat(a,")")))):this._prepareEvent(e,t,n).then((function(n){if(null===n)throw r.recordDroppedEvent("event_processor",e.type||"error"),new Ce("An event processor returned null, will not send event.");return t.data&&!0===t.data.__sentry__||s||!i?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(Object(X.n)(e))return e.then((function(e){if(!Object(X.i)(e)&&null!==e)throw new Ce(t);return e}),(function(e){throw new Ce("beforeSend rejected with ".concat(e))}));if(!Object(X.i)(e)&&null!==e)throw new Ce(t);return e}(i(n,t))})).then((function(o){if(null===o)throw r.recordDroppedEvent("before_send",e.type||"error"),new Ce("`beforeSend` returned `null`, will not send event.");var i=n&&n.getSession();return!s&&i&&r._updateSessionFromEvent(i,o),r.sendEvent(o,t),o})).then(null,(function(e){if(e instanceof Ce)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ce("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ".concat(e))}))}},{key:"_process",value:function(e){var t=this;this._numProcessing+=1,e.then((function(e){return t._numProcessing-=1,e}),(function(e){return t._numProcessing-=1,e}))}},{key:"_sendEnvelope",value:function(e){this._transport&&this._dsn?this._transport.send(e).then(null,(function(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Error while sending event:",e)})):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Transport disabled")}},{key:"_clearOutcomes",value:function(){var e=this._outcomes;return this._outcomes={},Object.keys(e).map((function(t){var n=t.split(":"),r=Object(l.a)(n,2);return{reason:r[0],category:r[1],quantity:e[t]}}))}}]),e}();function gt(e,t){var n=kt(e,t),r={type:t&&t.name,value:xt(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function bt(e,t){return{exception:{values:[gt(e,t)]}}}function kt(e,t){var n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"===typeof e.framesToPop)return e.framesToPop;if(wt.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(cr){}return[]}var wt=/Minified React error #\d+;/i;function xt(e){var t=e&&e.message;return t?t.error&&"string"===typeof t.error.message?t.error.message:t:"No error message"}function Ot(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=r&&r.syntheticException||void 0,a=Dt(e,t,i,o);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Z(a)}function Et(e,t,n,r,i){var a;if(Object(X.e)(t)&&t.error)return bt(e,t.error);if(Object(X.a)(t)||Object(X.b)(t)){var s=t;if("stack"in t)a=bt(e,t);else{var u=s.name||(Object(X.a)(s)?"DOMError":"DOMException"),c=s.message?"".concat(u,": ").concat(s.message):u;L(a=Dt(e,c,n,r),c)}return"code"in s&&(a.tags=Object(o.a)(Object(o.a)({},a.tags),{},{"DOMException.code":"".concat(s.code)})),a}return Object(X.d)(t)?bt(e,t):Object(X.i)(t)||Object(X.f)(t)?(a=function(e,t,n,r){var o={exception:{values:[{type:Object(X.f)(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:"Non-Error ".concat(r?"promise rejection":"exception"," captured with keys: ").concat(Object(T.d)(t))}]},extra:{__serialized__:Object(pt.b)(t)}};if(n){var i=kt(e,n);i.length&&(o.exception.values[0].stacktrace={frames:i})}return o}(e,t,n,i),I(a,{synthetic:!0}),a):(L(a=Dt(e,t,n,r),"".concat(t),void 0),I(a,{synthetic:!0}),a)}function Dt(e,t,n,r){var o={message:t};if(r&&n){var i=kt(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]})}return o}var St=n(25),Ct=["fatal","error","warning","log","info","debug"];function jt(e){return"warn"===e?"warning":Ct.includes(e)?e:"log"}var _t="Breadcrumbs",At=function(){function e(t){v(this,e),e.prototype.__init.call(this),this.options=Object(o.a)({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"setupOnce",value:function(){this.options.console&&qe("console",Nt),this.options.dom&&qe("dom",function(e){function t(t){var n,r="object"===typeof e?e.serializeAttribute:void 0;"string"===typeof r&&(r=[r]);try{n=t.event.target?Object(St.b)(t.event.target,r):Object(St.b)(t.event,r)}catch(cr){n="<unknown>"}0!==n.length&&fe().addBreadcrumb({category:"ui.".concat(t.name),message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&qe("xhr",Tt),this.options.fetch&&qe("fetch",Mt),this.options.history&&qe("history",Ft)}}],[{key:"__initStatic",value:function(){this.id=_t}}]),e}();function Nt(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:jt(e.level),message:Object(M.b)(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: ".concat(Object(M.b)(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}fe().addBreadcrumb(t,{input:e.args,level:e.level})}function Tt(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,o=t.status_code,i=t.body;fe().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:o},type:"http"},{xhr:e.xhr,input:i})}else;}function Mt(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?fe().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):fe().addBreadcrumb({category:"fetch",data:Object(o.a)(Object(o.a)({},e.fetchData),{},{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))}function Ft(e){var t=Object(N.a)(),n=e.from,r=e.to,o=R(t.location.href),i=R(n),a=R(r);i.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),fe().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}At.__initStatic();var Rt,Pt=Object(N.a)();function Bt(){if(Rt)return Rt;if(Le(Pt.fetch))return Rt=Pt.fetch.bind(Pt);var e=Pt.document,t=Pt.fetch;if(e&&"function"===typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(cr){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",cr)}return Rt=t.bind(Pt)}var Lt=Object(N.a)(),It=function(e){b(n,e);var t=E(n);function n(e){var r;return v(this,n),e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:ot}],version:ot},r=t.call(this,e),e.sendClientReports&&Lt.document&&Lt.document.addEventListener("visibilitychange",(function(){"hidden"===Lt.document.visibilityState&&r._flushOutcomes()})),r}return y(n,[{key:"eventFromException",value:function(e,t){return function(e,t,n,r){var o=Et(e,t,n&&n.syntheticException||void 0,r);return I(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),Z(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}},{key:"eventFromMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2?arguments[2]:void 0;return Ot(this._options.stackParser,e,t,n,this._options.attachStacktrace)}},{key:"sendEvent",value:function(e,t){var r=this.getIntegrationById(_t);r&&r.options&&r.options.sentry&&fe().addBreadcrumb({category:"sentry.".concat("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:B(e)},{event:e}),rt(k(n.prototype),"sendEvent",this).call(this,e,t)}},{key:"_prepareEvent",value:function(e,t,r){return e.platform=e.platform||"javascript",rt(k(n.prototype),"_prepareEvent",this).call(this,e,t,r)}},{key:"_flushOutcomes",value:function(){var e=this._clearOutcomes();if(0!==e.length)if(this._dsn){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log("Sending outcomes:",e);var t,n,r,o=Fe(this._dsn,this._options.tunnel),i=(t=e,it((n=this._options.tunnel&&_e(this._dsn))?{dsn:n}:{},[[{type:"client_report"},{timestamp:r||Object(V.a)(),discarded_events:t}]]));try{!function(e,t){"[object Navigator]"===Object.prototype.toString.call(Pt&&Pt.navigator)&&"function"===typeof Pt.navigator.sendBeacon?Pt.navigator.sendBeacon.bind(Pt.navigator)(e,t):Be()&&Bt()(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error(e)}))}(o,ct(i))}catch(cr){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error(cr)}}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log("No dsn provided, will not send outcomes");else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log("No outcomes to send")}}]),n}(yt),zt=0;function Ut(){return zt>0}function Vt(){zt+=1,setTimeout((function(){zt-=1}))}function $t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("function"!==typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(Object(T.f)(e))return e}catch(cr){return e}var i=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);var i=r.map((function(e){return $t(e,t)}));return e.apply(this,i)}catch(a){throw Vt(),me((function(e){e.addEventProcessor((function(e){return t.mechanism&&(L(e,void 0,void 0),I(e,t.mechanism)),e.extra=Object(o.a)(Object(o.a)({},e.extra),{},{arguments:r}),e})),ve(a)})),a}};try{for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(i[a]=e[a])}catch(u){}Object(T.g)(i,e),Object(T.a)(e,"__sentry_wrapped__",i);try{var s=Object.getOwnPropertyDescriptor(i,"name");s.configurable&&Object.defineProperty(i,"name",{get:function(){return e.name}})}catch(u){}return i}var Ht="?";function qt(e,t,n,r){var o={filename:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}var Wt=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Kt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Gt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Yt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Jt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Qt=[[30,function(e){var t=Wt.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=Kt.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=Zt(t[1]||Ht,t[2]),o=Object(l.a)(r,2),i=o[0];return qt(o[1],i,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,function(e){var t=Gt.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=Yt.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],o=t[1]||Ht,i=Zt(o,r),a=Object(l.a)(i,2);return o=a[0],qt(r=a[1],o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,function(e){var t=Jt.exec(e);return t?qt(t[2],t[1]||Ht,+t[3],t[4]?+t[4]:void 0):void 0}]],Xt=Pe.a.apply(void 0,Qt),Zt=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Ht,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},en=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],tn=function(){function e(t){v(this,e),e.prototype.__init.call(this),this._options=Object(o.a)({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"setupOnce",value:function(){var e=Object(N.a)();this._options.setTimeout&&Object(T.e)(e,"setTimeout",nn),this._options.setInterval&&Object(T.e)(e,"setInterval",nn),this._options.requestAnimationFrame&&Object(T.e)(e,"requestAnimationFrame",rn),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&Object(T.e)(XMLHttpRequest.prototype,"send",on);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:en).forEach(an)}}],[{key:"__initStatic",value:function(){this.id="TryCatch"}}]),e}();function nn(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];return n[0]=$t(o,{mechanism:{data:{function:Object(Pe.b)(e)},handled:!0,type:"instrument"}}),e.apply(this,n)}}function rn(e){return function(t){return e.apply(this,[$t(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Object(Pe.b)(e)},handled:!0,type:"instrument"}})])}}function on(e){return function(){var t=this,n=["onload","onerror","onprogress","onreadystatechange"];n.forEach((function(e){e in t&&"function"===typeof t[e]&&Object(T.e)(t,e,(function(t){var n={mechanism:{data:{function:e,handler:Object(Pe.b)(t)},handled:!0,type:"instrument"}},r=Object(T.f)(t);return r&&(n.mechanism.data.handler=Object(Pe.b)(r)),$t(t,n)}))}));for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e.apply(this,o)}}function an(e){var t=Object(N.a)(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Object(T.e)(n,"addEventListener",(function(t){return function(n,r,o){try{"function"===typeof r.handleEvent&&(r.handleEvent=$t(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Object(Pe.b)(r),target:e},handled:!0,type:"instrument"}}))}catch(i){}return t.apply(this,[n,$t(r,{mechanism:{data:{function:"addEventListener",handler:Object(Pe.b)(r),target:e},handled:!0,type:"instrument"}}),o])}})),Object(T.e)(n,"removeEventListener",(function(e){return function(t,n,r){var o=n;try{var i=o&&o.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(cr){}return e.call(this,t,o,r)}})))}tn.__initStatic();var sn=function(){function e(t){v(this,e),e.prototype.__init.call(this),e.prototype.__init2.call(this),this._options=Object(o.a)({onerror:!0,onunhandledrejection:!0},t)}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"__init2",value:function(){this._installFunc={onerror:un,onunhandledrejection:cn}}},{key:"setupOnce",value:function(){Error.stackTraceLimit=50;var e,t=this._options;for(var n in t){var r=this._installFunc[n];r&&t[n]&&(e=n,("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.log("Global Handler attached: ".concat(e)),r(),this._installFunc[n]=void 0)}}}],[{key:"__initStatic",value:function(){this.id="GlobalHandlers"}}]),e}();function un(){qe("error",(function(e){var t=dn(),n=Object(l.a)(t,3),r=n[0],o=n[1],i=n[2];if(r.getIntegration(sn)){var a=e.msg,s=e.url,u=e.line,c=e.column,f=e.error;if(!(Ut()||f&&f.__sentry_own_request__)){var d=void 0===f&&Object(X.l)(a)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=Object(X.e)(e)?e.message:e,a="Error",s=i.match(o);s&&(a=s[1],i=s[2]);return ln({exception:{values:[{type:a,value:i}]}},t,n,r)}(a,s,u,c):ln(Et(o,f||a,void 0,i,!1),s,u,c);d.level="error",fn(r,f,d,"onerror")}}}))}function cn(){qe("unhandledrejection",(function(e){var t=dn(),n=Object(l.a)(t,3),r=n[0],o=n[1],i=n[2];if(r.getIntegration(sn)){var a=e;try{"reason"in e?a=e.reason:"detail"in e&&"reason"in e.detail&&(a=e.detail.reason)}catch(u){}if(Ut()||a&&a.__sentry_own_request__)return!0;var s=Object(X.j)(a)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: ".concat(String(a))}]}}:Et(o,a,void 0,i,!0);s.level="error",fn(r,a,s,"onunhandledrejection")}}))}function ln(e,t,n,r){var o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},u=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,l=isNaN(parseInt(n,10))?void 0:n,f=Object(X.l)(t)&&t.length>0?t:Object(St.a)();return 0===u.length&&u.push({colno:c,filename:f,function:"?",in_app:!0,lineno:l}),e}function fn(e,t,n,r){I(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function dn(){var e=fe(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:function(){return[]},attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}sn.__initStatic();var pn="cause",hn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),e.prototype.__init.call(this),this._key=t.key||pn,this._limit=t.limit||5}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"setupOnce",value:function(){var t=fe().getClient();t&&ae((function(n,r){var o=fe().getIntegration(e);return o?function(e,t,n,r,o){if(!r.exception||!r.exception.values||!o||!Object(X.g)(o.originalException,Error))return r;var i=vn(e,n,o.originalException,t);return r.exception.values=[].concat(Object(J.a)(i),Object(J.a)(r.exception.values)),r}(t.getOptions().stackParser,o._key,o._limit,n,r):n}))}}],[{key:"__initStatic",value:function(){this.id="LinkedErrors"}}]),e}();function vn(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!Object(X.g)(n[r],Error)||o.length+1>=t)return o;var i=gt(e,n[r]);return vn(e,t,n[r],r,[i].concat(Object(J.a)(o)))}hn.__initStatic();var mn=function(){function e(){v(this,e),e.prototype.__init.call(this)}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"setupOnce",value:function(t,n){var r=function(t){var r=n().getIntegration(e);if(r){try{if(function(e,t){if(!t)return!1;if(function(e,t){var n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!gn(e,t))return!1;if(!yn(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var n=bn(t),r=bn(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!gn(e,t))return!1;if(!yn(e,t))return!1;return!0}(e,t))return!0;return!1}(t,r._previousEvent))return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(o){return r._previousEvent=t}return r._previousEvent=t}return t};r.id=this.name,t(r)}}],[{key:"__initStatic",value:function(){this.id="Dedupe"}}]),e}();function yn(e,t){var n=kn(e),r=kn(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function gn(e,t){var n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(o){return!1}}function bn(e){return e.exception&&e.exception.values&&e.exception.values[0]}function kn(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(n){return}}mn.__initStatic();var wn=Object(N.a)(),xn=function(){function e(){v(this,e),e.prototype.__init.call(this)}return y(e,[{key:"__init",value:function(){this.name=e.id}},{key:"setupOnce",value:function(){ae((function(t){if(fe().getIntegration(e)){if(!wn.navigator&&!wn.location&&!wn.document)return t;var n=t.request&&t.request.url||wn.location&&wn.location.href,r=(wn.document||{}).referrer,i=(wn.navigator||{}).userAgent,a=Object(o.a)(Object(o.a)(Object(o.a)({},t.request&&t.request.headers),r&&{Referer:r}),i&&{"User-Agent":i}),s=Object(o.a)(Object(o.a)({},n&&{url:n}),{},{headers:a});return Object(o.a)(Object(o.a)({},t),{},{request:s})}return t}))}}],[{key:"__initStatic",value:function(){this.id="HttpContext"}}]),e}();function On(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return ee(new Ce("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((function(){return n(o)})).then(null,(function(){return n(o).then(null,(function(){}))})),o},drain:function(e){return new te((function(n,r){var o=t.length;if(!o)return n(!0);var i=setTimeout((function(){e&&e>0&&n(!1)}),e);t.forEach((function(e){Z(e).then((function(){--o||(clearTimeout(i),n(!0))}),r)}))}))}}}xn.__initStatic();function En(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=parseInt("".concat(e),10);if(!isNaN(n))return 1e3*n;var r=Date.parse("".concat(e));return isNaN(r)?6e4:r-t}function Dn(e,t){return e[t]||e.all||0}function Sn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();return Dn(e,t)>n}function Cn(e,t){var n=t.statusCode,r=t.headers,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=Object(o.a)({},e),s=r&&r["x-sentry-rate-limits"],u=r&&r["retry-after"];if(s){var c,f=Object(ze.a)(s.trim().split(","));try{for(f.s();!(c=f.n()).done;){var d=c.value,p=d.split(":",2),h=Object(l.a)(p,2),v=h[0],m=h[1],y=parseInt(v,10),g=1e3*(isNaN(y)?60:y);if(m){var b,k=Object(ze.a)(m.split(";"));try{for(k.s();!(b=k.n()).done;){var w=b.value;a[w]=i+g}}catch(x){k.e(x)}finally{k.f()}}else a.all=i+g}}catch(x){f.e(x)}finally{f.f()}}else u?a.all=i+En(u,i):429===n&&(a.all=i+6e4);return a}function jn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:On(e.bufferSize||30),r={},o=function(e){return n.drain(e)};function i(o){var i=[];if(st(o,(function(t,n){var o=dt(n);Sn(r,o)?e.recordDroppedEvent("ratelimit_backoff",o):i.push(t)})),0===i.length)return Z();var a=it(o[0],i),s=function(t){st(a,(function(n,r){e.recordDroppedEvent(t,dt(r))}))};return n.add((function(){return t({body:ct(a,e.textEncoder)}).then((function(e){void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Sentry responded with status code ".concat(e.statusCode," to sent event.")),r=Cn(r,e)}),(function(e){("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Failed while sending event:",e),s("network_error")}))})).then((function(e){return e}),(function(e){if(e instanceof Ce)return("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Skipped sending event due to full buffer"),s("queue_overflow"),Z();throw e}))}return{send:i,flush:o}}function _n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bt();function n(n){var r=Object(o.a)({body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers},e.fetchOptions);return t(e.url,r).then((function(e){return{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}}))}return jn(e,n)}function An(e){return jn(e,(function(t){return new te((function(n,r){var o=new XMLHttpRequest;for(var i in o.onerror=r,o.onreadystatechange=function(){4===o.readyState&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url),e.headers)Object.prototype.hasOwnProperty.call(e.headers,i)&&o.setRequestHeader(i,e.headers[i]);o.send(t.body)}))}))}var Nn=[new r.InboundFilters,new r.FunctionToString,new tn,new At,new sn,new hn,new mn,new xn];function Tn(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function Mn(){if("undefined"!==typeof Object(N.a)().document){var e=fe();e.captureSession&&(Tn(e),qe("history",(function(e){var t=e.from,n=e.to;void 0!==t&&t!==n&&Tn(fe())})))}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("Session tracking in non-browser environment with @sentry/browser is not supported.")}n(22);var Fn={componentStack:null,error:null,eventId:null},Rn=function(e){b(n,e);var t=E(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),n.prototype.__init.call(x(e)),n.prototype.__init2.call(x(e)),e}return y(n,[{key:"__init",value:function(){this.state=Fn}},{key:"componentDidCatch",value:function(e,t){var n=this,r=t.componentStack,i=this.props,s=i.beforeCapture,u=i.onError,c=i.showDialog,l=i.dialogOptions;me((function(t){if(function(e){var t=e.match(/^([^.]+)/);return null!==t&&parseInt(t[0])>=17}(a.version)){var i=new Error(e.message);i.name="React ErrorBoundary ".concat(i.name),i.stack=r,e.cause=i}s&&s(t,e,r);var f=ve(e,{contexts:{react:{componentStack:r}}});u&&u(e,r,f),c&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe(),n=Object(N.a)();if(n.document){var r=t.getStackTop(),i=r.client,a=r.scope,s=e.dsn||i&&i.getDsn();if(s){a&&(e.user=Object(o.a)(Object(o.a)({},a.getUser()),e.user)),e.eventId||(e.eventId=t.lastEventId());var u=n.document.createElement("script");u.async=!0,u.src=Re(s,e),e.onLoad&&(u.onload=e.onLoad);var c=n.document.head||n.document.body;c?c.appendChild(u):("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Not injecting report dialog. No injection point found in HTML")}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("DSN not configured for showReportDialog call")}else("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.error("Global document not defined in showReportDialog call")}(Object(o.a)(Object(o.a)({},l),{},{eventId:f})),n.setState({error:e,componentStack:r,eventId:f})}))}},{key:"componentDidMount",value:function(){var e=this.props.onMount;e&&e()}},{key:"componentWillUnmount",value:function(){var e=this.state,t=e.error,n=e.componentStack,r=e.eventId,o=this.props.onUnmount;o&&o(t,n,r)}},{key:"__init2",value:function(){var e=this;this.resetErrorBoundary=function(){var t=e.props.onReset,n=e.state,r=n.error,o=n.componentStack,i=n.eventId;t&&t(r,o,i),e.setState(Fn)}}},{key:"render",value:function(){var e=this.props,t=e.fallback,n=e.children,r=this.state,o=r.error,i=r.componentStack,s=r.eventId;if(o){var u=void 0;return u="function"===typeof t?t({error:o,componentStack:i,resetError:this.resetErrorBoundary,eventId:s}):t,a.isValidElement(u)?u:(t&&("undefined"===typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&U.warn("fallback did not produce a valid ReactElement"),null)}return"function"===typeof n?n():n}}]),n}(a.Component);function Pn(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:ot}],version:ot},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===e.defaultIntegrations&&(e.defaultIntegrations=Nn),void 0===e.release){var t=Object(N.a)();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);var n=Object(o.a)(Object(o.a)({},e),{},{stackParser:Object(Pe.c)(e.stackParser||Xt),integrations:Oe(e),transport:e.transport||(Be()?_n:An)});Ee(It,n),e.autoSessionTracking&&Mn()}(e)}function Bn(){return(Bn=h(d().mark((function e(t){var n,r,o,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=1,n.pagination&&n.pagination.page&&(o=n.pagination.page+1),e.next=5,r.comments.browse({page:o,postId:n.postId});case 5:return i=e.sent,e.abrupt("return",{comments:[].concat(Object(J.a)(n.comments),Object(J.a)(i.comments)),pagination:i.meta.pagination});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ln(){return(Ln=h(d().mark((function e(t){var n,r,i,a,s,u,c;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.state,i=t.api,a=t.data,s=a.comment,u=a.limit,e.next=3,i.comments.replies({commentId:s.id,afterReplyId:null===(n=s.replies[s.replies.length-1])||void 0===n?void 0:n.id,limit:u});case 3:return c=e.sent,e.abrupt("return",{comments:r.comments.map((function(e){return e.id===s.id?Object(o.a)(Object(o.a)({},s),{},{replies:[].concat(Object(J.a)(s.replies),Object(J.a)(c.comments))}):e}))});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function In(){return(In=h(d().mark((function e(t){var n,r,o,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.data,e.next=3,r.comments.add({comment:o});case 3:return i=e.sent,o=i.comments[0],e.abrupt("return",{comments:[o].concat(Object(J.a)(n.comments)),commentCount:n.commentCount+1});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zn(){return(zn=h(d().mark((function e(t){var n,r,i,a,s,u,c;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,i=t.data,a=i.reply,s=i.parent,(u=a).parent_id=s.id,e.next=5,r.comments.add({comment:u});case 5:return c=e.sent,u=c.comments[0],e.abrupt("return",{comments:n.comments.map((function(e){return e.id===s.id?Object(o.a)(Object(o.a)({},s),{},{replies:[].concat(Object(J.a)(s.replies),[u]),count:Object(o.a)(Object(o.a)({},s.count),{},{replies:s.count.replies+1})}):e})),commentCount:n.commentCount+1});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Un(){return(Un=h(d().mark((function e(t){var n,r,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.adminApi,i=t.data,e.next=3,r.hideComment(i.id);case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{status:"hidden"}):e}));return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{status:"hidden",replies:t}):Object(o.a)(Object(o.a)({},e),{},{replies:t})})),commentCount:n.commentCount-1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vn(){return(Vn=h(d().mark((function e(t){var n,r,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.adminApi,i=t.data,e.next=3,r.showComment(i.id);case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{status:"published"}):e}));return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{status:"published",replies:t}):Object(o.a)(Object(o.a)({},e),{},{replies:t})})),commentCount:n.commentCount+1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $n(){return($n=h(d().mark((function e(t){var n,r,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,i=t.data,e.next=3,r.comments.like({comment:i});case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{liked:!0,count:Object(o.a)(Object(o.a)({},e.count),{},{likes:e.count.likes+1})}):e}));return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{liked:!0,replies:t,count:Object(o.a)(Object(o.a)({},e.count),{},{likes:e.count.likes+1})}):Object(o.a)(Object(o.a)({},e),{},{replies:t})}))});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Hn(){return(Hn=h(d().mark((function e(t){var n,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.state,n=t.api,r=t.data,e.next=3,n.comments.report({comment:r});case 3:return e.abrupt("return",{});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qn(){return(qn=h(d().mark((function e(t){var n,r,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,i=t.data,e.next=3,r.comments.unlike({comment:i});case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{liked:!1,count:Object(o.a)(Object(o.a)({},e.count),{},{likes:e.count.likes-1})}):e}));return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{liked:!1,replies:t,count:Object(o.a)(Object(o.a)({},e.count),{},{likes:e.count.likes-1})}):Object(o.a)(Object(o.a)({},e),{},{replies:t})}))});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wn(){return(Wn=h(d().mark((function e(t){var n,r,i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,i=t.data,e.next=3,r.comments.edit({comment:{id:i.id,status:"deleted"}});case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{status:"deleted"}):e}));return e.id===i.id?Object(o.a)(Object(o.a)({},e),{},{status:"deleted",replies:t}):Object(o.a)(Object(o.a)({},e),{},{replies:t})})),commentCount:n.commentCount-1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Kn(){return(Kn=h(d().mark((function e(t){var n,r,i,a,s,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,i=t.data,a=i.comment,s=i.parent,e.next=3,r.comments.edit({comment:a});case 3:return u=e.sent,a=u.comments[0],e.abrupt("return",{comments:n.comments.map((function(e){return s&&s.id===e.id?Object(o.a)(Object(o.a)({},e),{},{replies:e.replies.map((function(e){return e.id===a.id?a:e}))}):e.id===a.id?a:e}))});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gn(){return(Gn=h(d().mark((function e(t){var n,r,o,i,a,s,u,c,l,f,p;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.data,i=t.state,a=t.api,s=o.name,u=o.bio,c={},l=null===i||void 0===i||null===(n=i.member)||void 0===n?void 0:n.name,s&&l!==s&&(c.name=s),f=null===i||void 0===i||null===(r=i.member)||void 0===r?void 0:r.bio,void 0!==u&&f!==u&&(c.bio=u),!(Object.keys(c).length>0)){e.next=20;break}return e.prev=8,e.next=11,a.member.update(c);case 11:if(p=e.sent){e.next=14;break}throw new Error("Failed to update member");case 14:return e.abrupt("return",{member:p,success:!0});case 17:return e.prev=17,e.t0=e.catch(8),e.abrupt("return",{success:!1,error:e.t0});case 20:return e.abrupt("return",null);case 21:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}var Yn={addComment:function(e){return In.apply(this,arguments)},editComment:function(e){return Kn.apply(this,arguments)},hideComment:function(e){return Un.apply(this,arguments)},deleteComment:function(e){return Wn.apply(this,arguments)},showComment:function(e){return Vn.apply(this,arguments)},likeComment:function(e){return $n.apply(this,arguments)},unlikeComment:function(e){return qn.apply(this,arguments)},reportComment:function(e){return Hn.apply(this,arguments)},addReply:function(e){return zn.apply(this,arguments)},loadMoreComments:function(e){return Bn.apply(this,arguments)},loadMoreReplies:function(e){return Ln.apply(this,arguments)},updateMember:function(e){return Gn.apply(this,arguments)},openPopup:function(e){return{popup:e.data}},closePopup:function(){return{popup:null}}};function Jn(e){return Qn.apply(this,arguments)}function Qn(){return(Qn=h(d().mark((function e(t){var n,r,o,i,a,s;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.action,r=t.data,o=t.state,i=t.api,a=t.adminApi,!(s=Yn[n])){e.next=9;break}return e.next=5,s({data:r,state:o,api:i,adminApi:a});case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:return e.abrupt("return",e.t0);case 9:return e.abrupt("return",{});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Xn=function(e){var t=e.type,n=e.status,r=e.autoHide,o=e.duration,i=void 0===o?2600:o,a=e.closeable,s=e.state,u=e.message,c=e.meta,l=void 0===c?{}:c,f=0;return s&&s.popupNotification&&(f=(s.popupNotification.count||0)+1),{type:t,status:n,autoHide:r,closeable:a,duration:i,meta:l,message:u,count:f}};function Zn(e){var t=e.site;return t||null}function er(e){var t=new Date(e),n=new Date,r=Math.round((n.getTime()-t.getTime())/1e3);if(r<5)return"Just now";if(r<60)return"".concat(r," seconds ago");if((r/=60)<60)return 1===Math.floor(r)?"One minute ago":"".concat(Math.floor(r)," minutes ago");var o=new Date(n.getFullYear(),n.getMonth(),n.getDate()-1);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()&&t.getDate()===o.getDate()?"Yesterday":(r/=60)<24?1===Math.floor(r)?"One hour ago":"".concat(Math.floor(r)," hours ago"):(r/=24)<7?1===Math.floor(r)?"One day ago":"".concat(Math.floor(r)," days ago"):(r/=7,1===Math.floor(r)?"One week ago":"".concat(Math.floor(r)," weeks ago"))}function tr(e){var t=new Date(e),n=t.toLocaleDateString("en-us",{day:"2-digit"}),r=t.toLocaleString("en-us",{month:"short"}),o=t.getFullYear(),i=(t.getHours()<10?"0":"")+t.getHours(),a=(t.getMinutes()<10?"0":"")+t.getMinutes();return"".concat(n," ").concat(r," ").concat(o," ").concat(i,":").concat(a)}function nr(e){if(!e)return"";var t=e.split(" ");return 0===t.length?"":1===t.length?t[0].substring(0,1).toLocaleUpperCase():t[0].substring(0,1).toLocaleUpperCase()+t[t.length-1].substring(0,1).toLocaleUpperCase()}function rr(){return Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)<480}var or={dev:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.customSiteUrl;return!1},test:function(){return!1}},ir=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.some((function(e){var n=or[e];return!(!n||!n(t))}))};var ar=function(e){var t=e.siteUrl,n=void 0===t?window.location.origin:t,r=e.apiUrl,i=e.apiKey;function a(e){var t=e.type,r=e.resource,o=e.params,i=void 0===o?"":o;if("members"===t)return"".concat(n.replace(/\/$/,""),"/").concat("members/api","/").concat(r,"/").concat(i)}function s(e){var t=e.url,n=e.method,r=void 0===n?"GET":n,o=e.headers,i=void 0===o?{}:o,a=e.credentials,s=void 0===a?void 0:a,u=e.body;return fetch(t,{method:r,headers:i,credentials:s,body:void 0===u?void 0:u})}var u={};u.site={settings:function(){return s({url:function(e){var t=e.resource,n=e.params,o=void 0===n?"":n;return r&&i?"".concat(r.replace(/\/$/,""),"/").concat(t,"/?key=").concat(i,"&limit=all").concat(o):""}({resource:"settings"}),method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to fetch site data")}))}},u.member={identity:function(){return s({url:a({type:"members",resource:"session"}),credentials:"same-origin"}).then((function(e){return e.ok&&204!==e.status?e.text():null}))},sessionData:function(){return s({url:a({type:"members",resource:"member"}),credentials:"same-origin"}).then((function(e){return e.ok&&204!==e.status?e.json():null}))},update:function(e){var t={name:e.name,bio:e.bio};return s({url:a({type:"members",resource:"member"}),method:"PUT",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)}).then((function(e){return e.ok?e.json():null}))}};var c=null;return u.comments={count:function(e){return h(d().mark((function t(){var n,r,o,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.postId,r=a({type:"members",resource:"comments/counts"}),t.next=4,s({url:r,method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({ids:[n]})});case 4:return o=t.sent,t.next=7,o.json();case 7:return i=t.sent,t.abrupt("return",i[n]);case 9:case"end":return t.stop()}}),t)})))()},browse:function(e){var t,n=e.page,r=e.postId;c=null!==(t=c)&&void 0!==t?t:(new Date).toISOString();var o=encodeURIComponent("post_id:".concat(r,"+created_at:<=").concat(c)),i=encodeURIComponent("created_at DESC, id DESC");return s({url:a({type:"members",resource:"comments",params:"?limit=5&order=".concat(i,"&filter=").concat(o,"&page=").concat(n)}),method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to fetch comments")}))},replies:function(e){return h(d().mark((function t(){var n,r,o,i,u,c,l;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.page,n=e.commentId,r=e.afterReplyId,o=e.limit,i=encodeURIComponent("id:>".concat(r)),u=encodeURIComponent("created_at ASC, id ASC"),c=a({type:"members",resource:"comments/".concat(n,"/replies"),params:"?limit=".concat(null!==o&&void 0!==o?o:5,"&order=").concat(u,"&filter=").concat(i)}),t.next=6,s({url:c,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"});case 6:if(!(l=t.sent).ok){t.next=11;break}return t.abrupt("return",l.json());case 11:throw new Error("Failed to fetch replies");case 12:case"end":return t.stop()}}),t)})))()},add:function(e){var t={comments:[e.comment]};return s({url:a({type:"members",resource:"comments"}),method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to add comment")}))},edit:function(e){var t=e.comment,n={comments:[t]};return s({url:a({type:"members",resource:"comments/".concat(t.id)}),method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to edit comment")}))},like:function(e){var t=e.comment;return s({url:a({type:"members",resource:"comments/".concat(t.id,"/like")}),method:"POST",headers:{"Content-Type":"application/json"}}).then((function(e){if(e.ok)return"Success";throw new Error("Failed to like comment")}))},unlike:function(e){var t=e.comment,n={comments:[t]};return s({url:a({type:"members",resource:"comments/".concat(t.id,"/like")}),method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((function(e){if(e.ok)return"Success";throw new Error("Failed to unlike comment")}))},report:function(e){var t=e.comment;return s({url:a({type:"members",resource:"comments/".concat(t.id,"/report")}),method:"POST",headers:{"Content-Type":"application/json"}}).then((function(e){if(e.ok)return"Success";throw new Error("Failed to report comment")}))}},u.init=h(d().mark((function e(){var t,n,r,i,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([u.member.sessionData()]);case 2:t=e.sent,n=Object(l.a)(t,1),r=n[0],i={},a={};try{i=Object(o.a)({},a)}catch(cr){}return i=Zn({site:i}),e.abrupt("return",{site:i,member:r});case 10:case"end":return e.stop()}}),e)}))),u},sr=function(e){var t=Object(a.useContext)(D),n=t.accentColor,r=t.publication,o=t.member,i={backgroundColor:n},s={color:n},u=e.isFirst?"Start the conversation":"Join the discussion";return Object(S.jsxs)("section",{className:"flex flex-col items-center pt-[40px] ".concat(o?"pb-[32px]":"pb-[48px]"," px-8 border-t-2 border-gray-100 dark:border-gray-100/10 border-b-2"),children:[Object(S.jsx)("h1",{className:"mb-[8px] text-center text-black text-[24px] font-sans tracking-tight dark:text-[rgba(255,255,255,0.85)] ".concat(e.isFirst?"font-semibold":"font-bold"),children:u}),Object(S.jsxs)("p",{className:"mb-[28px] px-0 sm:px-8 max-w-screen-sm font-sans text-[16px] text-center leading-normal text-neutral-600 dark:text-[rgba(255,255,255,0.85)]",children:["Become a ",e.isPaid&&"paid"," member of ",Object(S.jsx)("span",{className:"font-semibold",children:r})," to start commenting."]}),Object(S.jsx)("button",{onClick:function(t){window.location.href=e.isPaid&&o?"#/portal/account/plans":"#/portal/signup"},className:"mb-[12px] text-white font-san py-[14px] px-5 rounded inline-block font-medium leading-none hover:opacity-90 transition-all",style:i,children:e.isPaid&&o?"Upgrade now":"Sign up now"}),!o&&Object(S.jsxs)("p",{className:"text-sm font-sans text-center text-neutral-400 dark:text-[rgba(255,255,255,0.5)]",children:[Object(S.jsx)("span",{className:"inline-block mr-1 text-[15px]",children:"Already a member?"}),Object(S.jsx)("button",{onClick:function(e){window.location.href="#/portal/signin"},className:"rounded-md hover:opacity-90 transition-all text-sm font-semibold",style:s,children:"Sign in"})]})]})};function ur(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var a=new Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map((function(e){return'"'.concat(e,'"')})).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(a,ur),a}var cr,lr,fr=["static"],dr=["unmount"],pr=["as","children","refName"],hr=((lr=hr||{})[lr.None=0]="None",lr[lr.RenderStrategy=1]="RenderStrategy",lr[lr.Static=2]="Static",lr),vr=((cr=vr||{})[cr.Unmount=0]="Unmount",cr[cr.Hidden=1]="Hidden",cr);function mr(e){var t=e.ourProps,n=e.theirProps,r=e.slot,a=e.defaultTag,s=e.features,u=e.visible,c=void 0===u||u,l=e.name,f=gr(n,t);if(c)return yr(f,r,a,l);var d=null!=s?s:0;if(2&d){var p=f.static,h=void 0!==p&&p,v=i(f,fr);if(h)return yr(v,r,a,l)}if(1&d){var m,y=f.unmount,g=void 0===y||y,b=i(f,dr);return ur(g?0:1,(m={},Object(Q.a)(m,0,(function(){return null})),Object(Q.a)(m,1,(function(){return yr(Object(o.a)(Object(o.a)({},b),{},{hidden:!0,style:{display:"none"}}),r,a,l)})),m))}return yr(f,r,a,l)}function yr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=wr(e,["unmount","static"]),s=o.as,u=void 0===s?n:s,c=o.children,l=o.refName,f=void 0===l?"ref":l,d=i(o,pr),p=void 0!==e.ref?Object(Q.a)({},f,e.ref):{},h="function"==typeof c?c(t):c;d.className&&"function"==typeof d.className&&(d.className=d.className(t));var v={};if(u===a.Fragment&&Object.keys(kr(d)).length>0){if(!Object(a.isValidElement)(h)||Array.isArray(h)&&h.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <".concat(r,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(d).map((function(e){return" - ".concat(e)})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - ".concat(e)})).join("\n")].join("\n"));return Object(a.cloneElement)(h,Object.assign({},gr(h.props,kr(wr(d,["ref"]))),v,p))}return Object(a.createElement)(u,Object.assign({},wr(d,["ref"]),u!==a.Fragment&&p,u!==a.Fragment&&v),h)}function gr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];for(var r={},o={},i=0,a=t;i<a.length;i++){var s=a[i];for(var u in s)u.startsWith("on")&&"function"==typeof s[u]?(null!=o[u]||(o[u]=[]),o[u].push(s[u])):r[u]=s[u]}if(r.disabled||r["aria-disabled"])return Object.assign(r,Object.fromEntries(Object.keys(o).map((function(e){return[e,void 0]}))));var c=function(e){Object.assign(r,Object(Q.a)({},e,(function(t){for(var n=o[e],r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var s,u=Object(ze.a)(n);try{for(u.s();!(s=u.n()).done;){var c=s.value;if(t.defaultPrevented)return;c.apply(void 0,[t].concat(i))}}catch(l){u.e(l)}finally{u.f()}})))};for(var l in o)c(l);return r}function br(e){var t;return Object.assign(Object(a.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function kr(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}function wr(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=Object(ze.a)(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}var xr=Object(a.createContext)(null);xr.displayName="OpenClosedContext";var Or=function(e){return e[e.Open=0]="Open",e[e.Closed=1]="Closed",e}(Or||{});function Er(){return Object(a.useContext)(xr)}function Dr(e){var t=e.value,n=e.children;return s.a.createElement(xr.Provider,{value:t},n)}function Sr(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((function(e){return setTimeout((function(){throw e}))}))}var Cr,jr="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,_r={serverHandoffComplete:!1};function Ar(){var e=Object(a.useState)(_r.serverHandoffComplete),t=Object(l.a)(e,2),n=t[0],r=t[1];return Object(a.useEffect)((function(){!0!==n&&r(!0)}),[n]),Object(a.useEffect)((function(){!1===_r.serverHandoffComplete&&(_r.serverHandoffComplete=!0)}),[]),n}var Nr=0;function Tr(){return++Nr}var Mr=null!=(Cr=s.a.useId)?Cr:function(){var e=Ar(),t=s.a.useState(e?Tr:null),n=Object(l.a)(t,2),r=n[0],o=n[1];return jr((function(){null===r&&o(Tr())}),[r]),null!=r?""+r:void 0};function Fr(){var e=Object(a.useRef)(!1);return jr((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function Rr(e){var t=Object(a.useRef)(e);return jr((function(){t.current=e}),[e]),t}var Pr=function(e){var t=Rr(e);return s.a.useCallback((function(){return t.current.apply(t,arguments)}),[t])},Br=Symbol();function Lr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Object(a.useRef)(t);Object(a.useEffect)((function(){r.current=t}),[t]);var o=Pr((function(e){var t,n=Object(ze.a)(r.current);try{for(n.s();!(t=n.n()).done;){var o=t.value;null!=o&&("function"==typeof o?o(e):o.current=e)}}catch(i){n.e(i)}finally{n.f()}}));return t.every((function(e){return null==e||(null==e?void 0:e[Br])}))?void 0:o}function Ir(){var e=[],t=[],n={enqueue:function(e){t.push(e)},addEventListener:function(e,t,r,o){return e.addEventListener(t,r,o),n.add((function(){return e.removeEventListener(t,r,o)}))},requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);return n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.requestAnimationFrame((function(){return n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);return n.add((function(){return clearTimeout(e)}))})),add:function(t){return e.push(t),function(){var n=e.indexOf(t);if(n>=0){var r=e.splice(n,1);(0,Object(l.a)(r,1)[0])()}}},dispose:function(){var t,n=Object(ze.a)(e.splice(0));try{for(n.s();!(t=n.n()).done;){(0,t.value)()}}catch(r){n.e(r)}finally{n.f()}},workQueue:function(){return h(d().mark((function e(){var n,r,o;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object(ze.a)(t.splice(0)),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return o=r.value,e.next=7,o();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))()}};return n}function zr(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function Ur(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}var Vr=function(e){return e.Ended="ended",e.Cancelled="cancelled",e}(Vr||{});function $r(e,t,n,r){var o=n?"enter":"leave",i=Ir(),a=void 0!==r?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(r):function(){},s=ur(o,{enter:function(){return t.enter},leave:function(){return t.leave}}),u=ur(o,{enter:function(){return t.enterTo},leave:function(){return t.leaveTo}}),c=ur(o,{enter:function(){return t.enterFrom},leave:function(){return t.leaveFrom}});return Ur.apply(void 0,[e].concat(Object(J.a)(t.enter),Object(J.a)(t.enterTo),Object(J.a)(t.enterFrom),Object(J.a)(t.leave),Object(J.a)(t.leaveFrom),Object(J.a)(t.leaveTo),Object(J.a)(t.entered))),zr.apply(void 0,[e].concat(Object(J.a)(s),Object(J.a)(c))),i.nextFrame((function(){Ur.apply(void 0,[e].concat(Object(J.a)(c))),zr.apply(void 0,[e].concat(Object(J.a)(u))),function(e,t){var n=Ir();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e})),n=Object(l.a)(t,1)[0];return void 0===n?0:n})),i=Object(l.a)(o,2);if(i[0]+i[1]!==0){var a=[];a.push(n.addEventListener(e,"transitionrun",(function(r){r.target===r.currentTarget&&(a.splice(0).forEach((function(e){return e()})),a.push(n.addEventListener(e,"transitionend",(function(e){e.target===e.currentTarget&&(t("ended"),a.splice(0).forEach((function(e){return e()})))})),n.addEventListener(e,"transitioncancel",(function(e){e.target===e.currentTarget&&(t("cancelled"),a.splice(0).forEach((function(e){return e()})))}))))})))}else t("ended");n.add((function(){return t("cancelled")})),n.dispose}(e,(function(n){return"ended"===n&&(Ur.apply(void 0,[e].concat(Object(J.a)(s))),zr.apply(void 0,[e].concat(Object(J.a)(t.entered)))),a(n)}))})),i.dispose}function Hr(e){var t=e.container,n=e.direction,r=e.classes,o=e.events,i=e.onStart,s=e.onStop,u=Fr(),c=function(){var e=Object(a.useState)(Ir),t=Object(l.a)(e,1)[0];return Object(a.useEffect)((function(){return function(){return t.dispose()}}),[t]),t}(),f=Rr(n),d=Pr((function(){return ur(f.current,{enter:function(){return o.current.beforeEnter()},leave:function(){return o.current.beforeLeave()},idle:function(){}})})),p=Pr((function(){return ur(f.current,{enter:function(){return o.current.afterEnter()},leave:function(){return o.current.afterLeave()},idle:function(){}})}));jr((function(){var e=Ir();c.add(e.dispose);var n=t.current;if(n&&"idle"!==f.current&&u.current)return e.dispose(),d(),i.current(f.current),e.add($r(n,r.current,"enter"===f.current,(function(t){var n;e.dispose(),ur(t,(n={},Object(Q.a)(n,Vr.Ended,(function(){p(),s.current(f.current)})),Object(Q.a)(n,Vr.Cancelled,(function(){})),n))}))),e.dispose}),[n])}var qr=["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"],Wr=["show","appear","unmount"];function Kr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(" ").filter((function(e){return e.trim().length>1}))}var Gr=Object(a.createContext)(null);Gr.displayName="TransitionContext";var Yr,Jr=((Yr=Jr||{}).Visible="visible",Yr.Hidden="hidden",Yr);var Qr=Object(a.createContext)(null);function Xr(e){return"children"in e?Xr(e.children):e.current.filter((function(e){return"visible"===e.state})).length>0}function Zr(e){var t=Rr(e),n=Object(a.useRef)([]),r=Fr(),o=Pr((function(e){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vr.Hidden,a=n.current.findIndex((function(t){return t.id===e}));-1!==a&&(ur(i,(o={},Object(Q.a)(o,vr.Unmount,(function(){n.current.splice(a,1)})),Object(Q.a)(o,vr.Hidden,(function(){n.current[a].state="hidden"})),o)),Sr((function(){var e;!Xr(n)&&r.current&&(null==(e=t.current)||e.call(t))})))})),i=Pr((function(e){var t=n.current.find((function(t){return t.id===e}));return t?"visible"!==t.state&&(t.state="visible"):n.current.push({id:e,state:"visible"}),function(){return o(e,vr.Unmount)}}));return Object(a.useMemo)((function(){return{children:n,register:i,unregister:o}}),[i,o,n])}function eo(){}Qr.displayName="NestingContext";var to=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function no(e){var t,n,r={},o=Object(ze.a)(to);try{for(o.s();!(n=o.n()).done;){var i=n.value;r[i]=null!=(t=e[i])?t:eo}}catch(a){o.e(a)}finally{o.f()}return r}var ro,oo,io,ao=hr.RenderStrategy,so=br((function(e,t){var n,r=e.beforeEnter,o=e.afterEnter,u=e.beforeLeave,c=e.afterLeave,f=e.enter,d=e.enterFrom,p=e.enterTo,h=e.entered,v=e.leave,m=e.leaveFrom,y=e.leaveTo,g=i(e,qr),b=Object(a.useRef)(null),k=Lr(b,t),w=Object(a.useState)("visible"),x=Object(l.a)(w,2),O=x[0],E=x[1],D=g.unmount?vr.Unmount:vr.Hidden,S=function(){var e=Object(a.useContext)(Gr);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),C=S.show,j=S.appear,_=S.initial,A=function(){var e=Object(a.useContext)(Qr);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),N=A.register,T=A.unregister,M=Object(a.useRef)(null),F=Mr();Object(a.useEffect)((function(){if(F)return N(F)}),[N,F]),Object(a.useEffect)((function(){if(D===vr.Hidden&&F){var e;if(C&&"visible"!==O)return void E("visible");ur(O,(e={},Object(Q.a)(e,"hidden",(function(){return T(F)})),Object(Q.a)(e,"visible",(function(){return N(F)})),e))}}),[O,F,N,T,C,D]);var R=Rr({enter:Kr(f),enterFrom:Kr(d),enterTo:Kr(p),entered:Kr(h),leave:Kr(v),leaveFrom:Kr(m),leaveTo:Kr(y)}),P=function(e){var t=Object(a.useRef)(no(e));return Object(a.useEffect)((function(){t.current=no(e)}),[e]),t}({beforeEnter:r,afterEnter:o,beforeLeave:u,afterLeave:c}),B=Ar();Object(a.useEffect)((function(){if(B&&"visible"===O&&null===b.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[b,O,B]);var L=_&&!j,I=!B||L||M.current===C?"idle":C?"enter":"leave",z=Object(a.useRef)(!1),U=Zr((function(){z.current||(E("hidden"),T(F))}));Hr({container:b,classes:R,events:P,direction:I,onStart:Rr((function(){z.current=!0})),onStop:Rr((function(e){z.current=!1,"leave"===e&&!Xr(U)&&(E("hidden"),T(F))}))}),Object(a.useEffect)((function(){!L||(D===vr.Hidden?M.current=null:M.current=C)}),[C,L,O]);var V=g,$={ref:k};return s.a.createElement(Qr.Provider,{value:U},s.a.createElement(Dr,{value:ur(O,(n={},Object(Q.a)(n,"visible",Or.Open),Object(Q.a)(n,"hidden",Or.Closed),n))},mr({ourProps:$,theirProps:V,defaultTag:"div",features:ao,visible:"visible"===O,name:"Transition.Child"})))})),uo=br((function(e,t){var n,r=e.show,u=e.appear,c=void 0!==u&&u,f=e.unmount,d=i(e,Wr),p=Object(a.useRef)(null),h=Lr(p,t);Ar();var v=Er();if(void 0===r&&null!==v&&(r=ur(v,(n={},Object(Q.a)(n,Or.Open,!0),Object(Q.a)(n,Or.Closed,!1),n))),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var m=Object(a.useState)(r?"visible":"hidden"),y=Object(l.a)(m,2),g=y[0],b=y[1],k=Zr((function(){b("hidden")})),w=Object(a.useState)(!0),x=Object(l.a)(w,2),O=x[0],E=x[1],D=Object(a.useRef)([r]);jr((function(){!1!==O&&D.current[D.current.length-1]!==r&&(D.current.push(r),E(!1))}),[D,r]);var S=Object(a.useMemo)((function(){return{show:r,appear:c,initial:O}}),[r,c,O]);Object(a.useEffect)((function(){if(r)b("visible");else if(Xr(k)){var e=p.current;if(!e)return;var t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&b("hidden")}else b("hidden")}),[r,k]);var C={unmount:f};return s.a.createElement(Qr.Provider,{value:k},s.a.createElement(Gr.Provider,{value:S},mr({ourProps:Object(o.a)(Object(o.a)({},C),{},{as:a.Fragment,children:s.a.createElement(so,Object(o.a)(Object(o.a)({ref:h},C),d))}),theirProps:{},defaultTag:a.Fragment,features:ao,visible:"visible"===g,name:"Transition"})))})),co=br((function(e,t){var n=null!==Object(a.useContext)(Gr),r=null!==Er();return s.a.createElement(s.a.Fragment,null,!n&&r?s.a.createElement(uo,Object(o.a)({ref:t},e)):s.a.createElement(so,Object(o.a)({ref:t},e)))})),lo=Object.assign(uo,{Child:co,Root:uo}),fo=["title","titleId"];function po(){return po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},po.apply(this,arguments)}function ho(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function vo(e,t){var n=e.title,r=e.titleId,o=ho(e,fo);return a.createElement("svg",po({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,ro||(ro=a.createElement("path",{d:"M7 9.5C7 10.1566 7.12933 10.8068 7.3806 11.4134C7.63188 12.02 8.00017 12.5712 8.46447 13.0355C8.92876 13.4998 9.47995 13.8681 10.0866 14.1194C10.6932 14.3707 11.3434 14.5 12 14.5C12.6566 14.5 13.3068 14.3707 13.9134 14.1194C14.52 13.8681 15.0712 13.4998 15.5355 13.0355C15.9998 12.5712 16.3681 12.02 16.6194 11.4134C16.8707 10.8068 17 10.1566 17 9.5C17 8.84339 16.8707 8.19321 16.6194 7.58658C16.3681 6.97995 15.9998 6.42876 15.5355 5.96447C15.0712 5.50017 14.52 5.13188 13.9134 4.8806C13.3068 4.62933 12.6566 4.5 12 4.5C11.3434 4.5 10.6932 4.62933 10.0866 4.8806C9.47995 5.13188 8.92876 5.50017 8.46447 5.96447C8.00017 6.42876 7.63188 6.97995 7.3806 7.58658C7.12933 8.19321 7 8.84339 7 9.5V9.5Z",stroke:"white",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})),oo||(oo=a.createElement("circle",{cx:12,cy:12,r:11.375,stroke:"white",strokeWidth:1.25})),io||(io=a.createElement("path",{d:"M19.5 20C19.092 19.6069 18.4941 19.2498 17.7403 18.9489C16.9864 18.6481 16.0915 18.4094 15.1066 18.2466C14.1217 18.0838 13.0661 18 12 18C10.9339 18 9.87831 18.0838 8.8934 18.2466C7.90848 18.4094 7.01357 18.6481 6.25975 18.9489C5.50593 19.2498 4.90796 19.6069 4.5 20",stroke:"white",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})))}var mo=a.forwardRef(vo),yo=(n.p,function(e){var t,n,r,o,i=Object(a.useContext)(D).member,s=null!==(t=null===i||void 0===i?void 0:i.name)&&void 0!==t?t:null===(n=e.comment)||void 0===n||null===(r=n.member)||void 0===r?void 0:r.name,u=function(e,t,n){return Math.floor(e%(n-t)+t)},c="small"===e.size?"w-6 h-6 sm:w-8 sm:h-8":"w-9 h-9 sm:w-[40px] sm:h-[40px]",l="small"===e.size?"text-sm":"text-lg",f=e.comment?e.comment.member:i,d=(o=function(){var t=e.comment?e.comment.member:i;if(!t||!t.name)return[0,0,10];var n=isNaN(e.saturation)?50:e.saturation,r=[0,360],o=Math.round(n/(100/30))+30,a=[o-20,o],s=function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}(t.name);return[u(s,r[0],r[1]),n,u(s,a[0],a[1])]}(),"hsl(".concat(o[0],", ").concat(o[1],"%, ").concat(o[2],"%)")),p={background:d},h=Object(S.jsxs)(S.Fragment,{children:[s?Object(S.jsx)("div",{className:"flex justify-center items-center rounded-full ".concat(c),style:p,children:Object(S.jsx)("p",{className:"text-white font-sans font-semibold ".concat(l),children:function(){if(e.comment&&!e.comment.member)return nr("Deleted member");var t=e.comment?e.comment.member:i;return t&&t.name?nr(t.name):nr("Anonymous")}()})}):Object(S.jsx)("div",{className:"flex justify-center items-center rounded-full bg-neutral-900 dark:bg-[rgba(255,255,255,0.7)] ".concat(c),children:Object(S.jsx)(mo,{className:"stroke-white dark:stroke-[rgba(0,0,0,0.6)]"})}),f&&Object(S.jsx)("img",{className:"absolute top-0 left-0 rounded-full ".concat(c),src:f.avatar_image,alt:"Avatar"})]});return e.isBlank&&(h=Object(S.jsx)("div",{className:"flex justify-center items-center rounded-full bg-neutral-300 dark:opacity-70 ".concat(c),children:Object(S.jsx)(mo,{className:"stroke-white dark:stroke-neutral-600"})})),Object(S.jsx)("figure",{className:"relative ".concat(c),children:h})});function go(e){this.content=e}go.prototype={constructor:go,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new go(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new go(n)},addToStart:function(e,t){return new go([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new go(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new go(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=go.from(e)).size?new go(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=go.from(e)).size?new go(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=go.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},go.from=function(e){if(e instanceof go)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new go(t)};var bo=go;function ko(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){var s=ko(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function wo(e,t,n,r){for(var o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=e.child(--o),s=t.child(--i),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<l&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){var f=wo(a.content,s.content,n-1,r-1);if(f)return f}n-=u,r-=u}else n-=u,r-=u}}var xo=function(){function e(t,n){if(v(this,e),this.content=t,this.size=n||0,null==n)for(var r=0;r<t.length;r++)this.size+=t[r].nodeSize}return y(e,[{key:"nodesBetween",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=0,a=0;a<t;i++){var s=this.content[i],u=a+s.nodeSize;if(u>e&&!1!==n(s,r+a,o||null,i)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,e-c),Math.min(s.content.size,t-c),n,r+c)}a=u}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf?(r?o+="function"===typeof r?r(a):r:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),i=!n):!i&&a.isBlock&&(o+=n,i=!0)}),0),o}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new e(o,this.size+t.size)}},{key:"cut",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],o=0;if(n>t)for(var i=0,a=0;a<n;i++){var s=this.content[i],u=a+s.nodeSize;u>t&&((a<t||u>n)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),o+=s.nodeSize),a=u}return new e(r,o)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,i)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}},{key:"maybeChild",value:function(e){return this.content[e]||null}},{key:"forEach",value:function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}}},{key:"findDiffStart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return ko(this,e,t)}},{key:"findDiffEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size;return wo(this,e,t,n)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return Eo(0,e);if(e==this.size)return Eo(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e||t>0?Eo(n+1,i):Eo(n,r);r=i}}},{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(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,o=0;o<t.length;o++){var i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}},{key:"from",value:function(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),e}();xo.empty=new xo([],0);var Oo={index:0,offset:0};function Eo(e,t){return Oo.index=e,Oo.offset=t,Oo}function Do(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!Do(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t)||!Do(e[o],t[o]))return!1;for(var i in t)if(!(i in e))return!1}return!0}var So=function(){function e(t,n){v(this,e),this.type=t,this.attrs=n}return y(e,[{key:"addToSet",value:function(e){for(var t,n=!1,r=0;r<e.length;r++){var o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}},{key:"eq",value:function(e){return this==e||this.type==e.type&&Do(this.attrs,e.attrs)}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type ".concat(t.type," in this schema"));return n.create(t.attrs)}},{key:"sameSet",value:function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}},{key:"setFrom",value:function(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];var n=t.slice();return n.sort((function(e,t){return e.type.rank-t.type.rank})),n}}]),e}();So.none=[];var Co=function(e){b(n,e);var t=E(n);function n(){return v(this,n),t.apply(this,arguments)}return y(n)}(Se(Error)),jo=function(){function e(t,n,r){v(this,e),this.content=t,this.openStart=n,this.openEnd=r}return y(e,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(t,n){var r=Ao(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(_o(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(xo.fromJSON(t,n.content),r,o)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(var a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)o++;return new e(t,r,o)}}]),e}();function _o(e,t,n){var r=e.findIndex(t),o=r.index,i=r.offset,a=e.maybeChild(o),s=e.findIndex(n),u=s.index,c=s.offset;if(i==t||a.isText){if(c!=n&&!e.child(u).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(o!=u)throw new RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(_o(a.content,t-i-1,n-i-1)))}function Ao(e,t,n,r){var o=e.findIndex(t),i=o.index,a=o.offset,s=e.maybeChild(i);if(a==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));var u=Ao(s.content,t-a-1,n);return u&&e.replaceChild(i,s.copy(u))}function No(e,t,n){if(n.openStart>e.depth)throw new Co("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Co("Inconsistent open depths");return To(e,t,n,0)}function To(e,t,n,r){var o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){var a=To(e,t,n,r+1);return i.copy(i.content.replaceChild(o,a))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){var s=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(xo.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Bo(i,Lo(e,s.start,s.end,t,r))}var u=e.parent,c=u.content;return Bo(u,c.cut(0,e.parentOffset).append(n.content).append(c.cut(t.parentOffset)))}return Bo(i,Io(e,t,r))}function Mo(e,t){if(!t.type.compatibleContent(e.type))throw new Co("Cannot join "+t.type.name+" onto "+e.type.name)}function Fo(e,t,n){var r=e.node(n);return Mo(r,t.node(n)),r}function Ro(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Po(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Ro(e.nodeAfter,r),i++));for(var s=i;s<a;s++)Ro(o.child(s),r);t&&t.depth==n&&t.textOffset&&Ro(t.nodeBefore,r)}function Bo(e,t){if(!e.type.validContent(t))throw new Co("Invalid content for node "+e.type.name);return e.copy(t)}function Lo(e,t,n,r,o){var i=e.depth>o&&Fo(e,t,o+1),a=r.depth>o&&Fo(n,r,o+1),s=[];return Po(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(Mo(i,a),Ro(Bo(i,Lo(e,t,n,r,o+1)),s)):(i&&Ro(Bo(i,Io(e,t,o+1)),s),Po(t,n,o,s),a&&Ro(Bo(a,Io(n,r,o+1)),s)),Po(r,null,o,s),new xo(s)}function Io(e,t,n){var r=[];(Po(null,e,n,r),e.depth>n)&&Ro(Bo(Fo(e,t,n+1),Io(e,t,n+1)),r);return Po(t,null,n,r),new xo(r)}jo.empty=new jo(xo.empty,0,0);var zo=function(){function e(t,n,r){v(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return y(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o<e;o++)r+=n.child(o).nodeSize;return r}},{key:"marks",value:function(){var e=this.parent,t=this.index();if(0==e.content.size)return So.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var o=n;n=r,r=o}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}},{key:"marksAcross",value:function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ho(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos<this.pos?e:this}},{key:"toString",value:function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}}],[{key:"resolve",value:function(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],o=0,i=n,a=t;;){var s=a.content.findIndex(i),u=s.index,c=s.offset,l=i-c;if(r.push(a,u,o+c),!l)break;if((a=a.child(u)).isText)break;i=l-1,o+=c+1}return new e(n,r,i)}},{key:"resolveCached",value:function(t,n){for(var r=0;r<Uo.length;r++){var o=Uo[r];if(o.pos==n&&o.doc==t)return o}var i=Uo[Vo]=e.resolve(t,n);return Vo=(Vo+1)%$o,i}}]),e}(),Uo=[],Vo=0,$o=12,Ho=function(){function e(t,n,r){v(this,e),this.$from=t,this.$to=n,this.depth=r}return y(e,[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}]),e}(),qo=Object.create(null),Wo=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:So.none;v(this,e),this.type=t,this.attrs=n,this.marks=o,this.content=r||xo.empty}return y(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{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(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&Do(this.attrs,t||e.defaultAttrs||qo)&&So.sameSet(this.marks,n||So.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return jo.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i),u=s.content.cut(r.pos-a,o.pos-a);return new jo(u,r.depth-i,o.depth-i)}},{key:"replace",value:function(e,t,n){return No(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}},{key:"resolve",value:function(e){return zo.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return zo.resolve(this,e)}},{key:"rangeHasMark",value:function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Go(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:xo.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,i=this.contentMatchAt(e).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=r;s<o;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}},{key:"canReplaceWith",value:function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}},{key:"canAppend",value:function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}},{key:"check",value:function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node ".concat(this.type.name,": ").concat(this.content.toString().slice(0,50)));for(var e=So.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!So.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(e){return e.type.name}))));this.content.forEach((function(e){return e.check()}))}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=xo.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}]),e}();Wo.prototype.text=void 0;var Ko=function(e){b(n,e);var t=E(n);function n(e,r,o,i){var a;if(v(this,n),a=t.call(this,e,r,null,i),!o)throw new RangeError("Empty text nodes are not allowed");return a.text=o,a}return y(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Go(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(e,t){return this.text.slice(e,t)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}},{key:"withText",value:function(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}},{key:"cut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=rt(k(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(Wo);function Go(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var Yo=function(){function e(t){v(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return y(e,[{key:"matchType",value:function(e){for(var t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}},{key:"matchFragment",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}},{key:"inlineContent",get:function(){return this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var e=0;e<this.next.length;e++){var t=this.next[e].type;if(!t.isText&&!t.hasRequiredAttrs())return t}return null}},{key:"compatible",value:function(e){for(var t=0;t<this.next.length;t++)for(var n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];function o(i,a){var s=i.matchFragment(e,n);if(s&&(!t||s.validEnd))return xo.from(a.map((function(e){return e.createAndFill()})));for(var u=0;u<i.next.length;u++){var c=i.next[u],l=c.type,f=c.next;if(!l.isText&&!l.hasRequiredAttrs()&&-1==r.indexOf(f)){r.push(f);var d=o(f,a.concat(l));if(d)return d}}return null}return o(this,[])}},{key:"findWrapping",value:function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}},{key:"computeWrapping",value:function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(e)){for(var i=[],a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<o.next.length;s++){var u=o.next[s],c=u.type,l=u.next;c.isLeaf||c.hasRequiredAttrs()||c.name in t||r.type&&!l.validEnd||(n.push({match:c.contentMatch,type:c,via:r}),t[c.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o++)r+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return r})).join("\n")}}],[{key:"parse",value:function(t,n){var r=new Jo(t,n);if(null==r.next)return e.empty;var o=Qo(r);r.next&&r.err("Unexpected trailing text");var i=function(e){var t=Object.create(null);return n(ri(e,0));function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){for(var i,a=0;a<o.length;a++)o[a][0]==n&&(i=o[a][1]);ri(e,r).forEach((function(e){i||o.push([n,i=[]]),-1==i.indexOf(e)&&i.push(e)}))}}))}));for(var i=t[r.join(",")]=new Yo(r.indexOf(e.length-1)>-1),a=0;a<o.length;a++){var s=o[a][1].sort(ni);i.next.push({type:o[a][0],next:t[s.join(",")]||n(s)})}return i}}(function(e){var t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((function(e){return e.to=t}))}function i(e,t){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(i(n,t))}),[]);if("seq"!=e.type){if("star"==e.type){var a=n();return r(t,a),o(i(e.expr,a),a),[r(a)]}if("plus"==e.type){var s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){for(var u=t,c=0;c<e.min;c++){var l=n();o(i(e.expr,u),l),u=l}if(-1==e.max)o(i(e.expr,u),u);else for(var f=e.min;f<e.max;f++){var d=n();r(u,d),o(i(e.expr,u),d),u=d}return[r(u)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(var p=0;;p++){var h=i(e.exprs[p],t);if(p==e.exprs.length-1)return h;o(h,t=n())}}}(o));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var o=r[n],i=!o.validEnd,a=[],s=0;s<o.next.length;s++){var u=o.next[s],c=u.type,l=u.next;a.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(l)&&r.push(l)}i&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,r),i}}]),e}();Yo.empty=new Yo(!0);var Jo=function(){function e(t,n){v(this,e),this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return y(e,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(e){return this.next==e&&(this.pos++||!0)}},{key:"err",value:function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}]),e}();function Qo(e){var t=[];do{t.push(Xo(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Xo(e){var t=[];do{t.push(Zo(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Zo(e){for(var t=function(e){if(e.eat("(")){var t=Qo(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.groups.indexOf(t)>-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=ti(e,t)}return t}function ei(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function ti(e,t){var n=ei(e),r=n;return e.eat(",")&&(r="}"!=e.next?ei(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function ni(e,t){return t-e}function ri(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var a=o[i],s=a.term,u=a.to;s||-1!=n.indexOf(u)||t(u)}}(t),n.sort(ni)}function oi(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function ii(e,t){var n=Object.create(null);for(var r in e){var o=t&&t[r];if(void 0===o){var i=e[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function ai(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new ui(e[n]);return t}var si=function(){function e(t,n,r){v(this,e),this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ai(r.attrs),this.defaultAttrs=oi(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}return y(e,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==Yo.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(e){return this==e||this.contentMatch.compatible(e.contentMatch)}},{key:"computeAttrs",value:function(e){return!e&&this.defaultAttrs?this.defaultAttrs:ii(this.attrs,e)}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=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 Wo(this,this.computeAttrs(e),xo.from(t),So.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=xo.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Wo(this,this.computeAttrs(e),t,So.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=xo.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(xo.empty,!0);return i?new Wo(this,e,t.append(i),So.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}},{key:"allowsMarkType",value:function(e){return null==this.markSet||this.markSet.indexOf(e)>-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}},{key:"allowedMarks",value:function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:So.none:e}}],[{key:"compile",value:function(t,n){var r=Object.create(null);t.forEach((function(t,o){return r[t]=new e(t,n,o)}));var o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}]),e}(),ui=function(){function e(t){v(this,e),this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}return y(e,[{key:"isRequired",get:function(){return!this.hasDefault}}]),e}(),ci=function(){function e(t,n,r,o){v(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=ai(o.attrs),this.excluded=null;var i=oi(this.attrs);this.instance=i?new So(this,i):null}return y(e,[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new So(this,ii(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]}},{key:"excludes",value:function(e){return this.excluded.indexOf(e)>-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),o=0;return t.forEach((function(t,i){return r[t]=new e(t,o++,n,i)})),r}}]),e}(),li=function(){function e(t){v(this,e),this.cached=Object.create(null),this.spec={nodes:bo.from(t.nodes),marks:bo.from(t.marks||{}),topNode:t.topNode},this.nodes=si.compile(this.spec.nodes,this),this.marks=ci.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var o=this.nodes[r],i=o.spec.content||"",a=o.spec.marks;o.contentMatch=n[i]||(n[i]=Yo.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==a?null:a?fi(this,a.split(" ")):""!=a&&o.inlineContent?null:[]}for(var s in this.marks){var u=this.marks[s],c=u.spec.excludes;u.excluded=null==c?[u]:""==c?[]:fi(this,c.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 y(e,[{key:"node",value:function(e){var t=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 e)e=this.nodeType(e);else{if(!(e instanceof si))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new Ko(n,n.defaultAttrs,e,So.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return Wo.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return So.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}]),e}();function fi(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(var s in e.marks){var u=e.marks[s];("_"==o||u.spec.group&&u.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var di=function(){function e(t,n){var r=this;v(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach((function(e){e.tag?r.tags.push(e):e.style&&r.styles.push(e)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}return y(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new gi(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new gi(this,t,!0);return n.addAll(e,t.from,t.to),jo.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(bi(e,o.tag)&&(void 0===o.namespace||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(e);if(!1===i)continue;o.attrs=i||void 0}return o}}}},{key:"matchStyle",value:function(e,t,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o],a=i.style;if(!(0!=a.indexOf(e)||i.context&&!n.matchesContext(i.context)||a.length>e.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(i.getAttrs){var s=i.getAttrs(t);if(!1===s)continue;i.attrs=s||void 0}return i}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var o=t[r];if((null==o.priority?50:o.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ki(e)),e.mark=t}))};for(var o in e.marks)r(o);var i=function(t){var r=e.nodes[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ki(e)),e.node=t}))};for(var a in e.nodes)i(a);return t}},{key:"fromSchema",value:function(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}}]),e}(),pi={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},hi={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},vi={ol:!0,ul:!0};function mi(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var yi=function(){function e(t,n,r,o,i,a,s){v(this,e),this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=s,this.content=[],this.activeMarks=So.none,this.stashMarks=[],this.match=a||(4&s?null:t.contentMatch)}return y(e,[{key:"findWrapping",value:function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(xo.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}},{key:"finish",value:function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];if(n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-t[0].length))}}var o=xo.from(this.content);return!e&&this.match&&(o=o.append(this.match.fillBefore(xo.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o}},{key:"popFromStashMark",value:function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}},{key:"applyPending",value:function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var r=n[t];(this.type?this.type.allowsMarkType(r.type):wi(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!pi.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}]),e}(),gi=function(){function e(t,n,r){v(this,e),this.parser=t,this.options=n,this.isOpen=r,this.open=0;var o,i=n.topNode,a=mi(null,n.preserveWhitespace,0)|(r?4:0);o=i?new yi(i.type,i.attrs,So.none,So.none,!0,n.topMatch||i.type.contentMatch,a):new yi(r?null:t.schema.topNodeType,null,So.none,So.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}return y(e,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(e),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],r)}}},{key:"addTextNode",value:function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}},{key:"addElement",value:function(e,t){var n,r=e.nodeName.toLowerCase();vi.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&vi.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:hi.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);var i,a=this.top,s=this.needsBlock;if(pi.hasOwnProperty(r))i=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),i&&this.sync(a),this.needsBlock=s}else this.addElementByRule(e,o,!1===o.consuming?n:void 0)}},{key:"leafFallback",value:function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(e){var t=So.none;e:for(var n=0;n<e.length;n+=2)for(var r=void 0;;){var o=this.parser.matchStyle(e[n],e[n+1],this,r);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;r=o}return t}},{key:"addElementByRule",value:function(e,t,n){var r,o,i,a=this;t.node?(o=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace):(i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i));var s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return a.insertNode(e)}));else{var u=e;"string"==typeof t.contentElement?u=e.querySelector(t.contentElement):"function"==typeof t.contentElement?u=t.contentElement(e):t.contentElement&&(u=t.contentElement),this.findAround(e,u,!0),this.addAll(u)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}},{key:"addAll",value:function(e,t,n){for(var r=t||0,o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}},{key:"findPlace",value:function(e){for(var t,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a<t.length;a++)this.enterInner(t[a],null,!1);return!0}},{key:"insertNode",value:function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,o=0;o<e.marks.length;o++)n.type&&!n.type.allowsMarkType(e.marks[o].type)||(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}},{key:"enter",value:function(e,t,n){var r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}},{key:"enterInner",value:function(e){var t=arguments.length>1&&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 o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);var i=mi(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new yi(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}},{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(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}},{key:"findAround",value:function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}},{key:"findInText",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}},{key:"matchesContext",value:function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1);return function e(a,s){for(;a>=0;a--){var u=n[a];if(""==u){if(a==n.length-1||0==a)continue;for(;s>=i;s--)if(e(a-1,s))return!0;return!1}var c=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).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 e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}}},{key:"addPendingMark",value:function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var o=r.popFromStashMark(e);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==t)break}}}]),e}();function bi(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ki(e){var t={};for(var n in e)t[n]=e[n];return t}function wi(e,t){var n=t.schema.nodes,r=function(r){var o=n[r];if(!o.allowsMarkType(e))return"continue";var i=[];return function e(n){i.push(n);for(var r=0;r<n.edgeCount;r++){var o=n.edge(r),a=o.type,s=o.next;if(a==t)return!0;if(i.indexOf(s)<0&&e(s))return!0}}(o.contentMatch)?{v:!0}:void 0};for(var o in n){var i=r(o);if("continue"!==i&&"object"===typeof i)return i.v}}var xi=function(){function e(t,n){v(this,e),this.nodes=t,this.marks=n}return y(e,[{key:"serializeFragment",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=Ei(n).createDocumentFragment());var o=r,i=[];return e.forEach((function(e){if(i.length||e.marks.length){for(var r=0,a=0;r<i.length&&a<e.marks.length;){var s=e.marks[a];if(t.marks[s.type.name]){if(!s.eq(i[r][0])||!1===s.type.spec.spanning)break;r++,a++}else a++}for(;r<i.length;)o=i.pop()[1];for(;a<e.marks.length;){var u=e.marks[a++],c=t.serializeMark(u,e.isInline,n);c&&(i.push([u,o]),o.appendChild(c.dom),o=c.contentDOM||c.dom)}}o.appendChild(t.serializeNodeInner(e,n))})),r}},{key:"serializeNodeInner",value:function(t,n){var r=e.renderSpec(Ei(n),this.nodes[t.type.name](t)),o=r.dom,i=r.contentDOM;if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return o}},{key:"serializeNode",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}},{key:"serializeMark",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.marks[t.type.name];return o&&e.renderSpec(Ei(r),o(t,n))}}],[{key:"renderSpec",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var o,i=n[0],a=i.indexOf(" ");a>0&&(r=i.slice(0,a),i=i.slice(a+1));var s=r?t.createElementNS(r,i):t.createElement(i),u=n[1],c=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u))for(var l in c=2,u)if(null!=u[l]){var f=l.indexOf(" ");f>0?s.setAttributeNS(l.slice(0,f),l.slice(f+1),u[l]):s.setAttribute(l,u[l])}for(var d=c;d<n.length;d++){var p=n[d];if(0===p){if(d<n.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=e.renderSpec(t,p,r),v=h.dom,m=h.contentDOM;if(s.appendChild(v),m){if(o)throw new RangeError("Multiple content holes");o=m}}return{dom:s,contentDOM:o}}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=Oi(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return Oi(e.marks)}}]),e}();function Oi(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ei(e){return e.document||window.document}var Di=Math.pow(2,16);function Si(e){return 65535&e}var Ci=function(){function e(t,n,r){v(this,e),this.pos=t,this.delInfo=n,this.recover=r}return y(e,[{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}}]),e}(),ji=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(v(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return y(e,[{key:"recover",value:function(e){var t=0,n=Si(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Di}(e)}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?r:0);if(s>e)break;var u=this.ranges[a+o],c=this.ranges[a+i],l=s+u;if(e<=l){var f=s+r+((u?e==s?-1:e==l?1:t:t)<0?0:c);if(n)return f;var d=e==(t<0?s:l)?null:a/3+(e-s)*Di,p=e==s?2:e==l?1:4;return(t<0?e!=s:e!=l)&&(p|=8),new Ci(f,p,d)}r+=c-u}return n?e+r:new Ci(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=Si(t),o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>e)break;var u=this.ranges[a+o];if(e<=s+u&&a==3*r)return!0;n+=this.ranges[a+i]-u}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],a=i-(this.inverted?o:0),s=i+(this.inverted?0:o),u=this.ranges[r+t],c=this.ranges[r+n];e(a,a+u,s,s+c),o+=c-u}}},{key:"invert",value:function(){return new e(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}}]),e}();ji.empty=new ji([]);var _i=function(){function e(){var t=arguments.length>0&&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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;v(this,e),this.maps=t,this.mirror=n,this.from=r,this.to=o}return y(e,[{key:"slice",value:function(){var t=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 e(this.maps,this.mirror,t,n)}},{key:"copy",value:function(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}},{key:"appendMapping",value:function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}},{key:"getMirror",value:function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}},{key:"setMirror",value:function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}},{key:"appendMappingInverted",value:function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}},{key:"invert",value:function(){var t=new e;return t.appendMappingInverted(this),t}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(e,t);if(null!=i.recover){var a=this.getMirror(o);if(null!=a&&a>o&&a<this.to){o=a,e=this.maps[a].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Ci(e,r,null)}}]),e}(),Ai=Object.create(null),Ni=function(){function e(){v(this,e)}return y(e,[{key:"getMap",value:function(){return ji.empty}},{key:"merge",value:function(e){return null}}],[{key:"fromJSON",value:function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Ai[t.stepType];if(!n)throw new RangeError("No step type ".concat(t.stepType," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in Ai)throw new RangeError("Duplicate use of step JSON ID "+e);return Ai[e]=t,t.prototype.jsonID=e,t}}]),e}(),Ti=function(){function e(t,n){v(this,e),this.doc=t,this.failed=n}return y(e,null,[{key:"ok",value:function(t){return new e(t,null)}},{key:"fail",value:function(t){return new e(null,t)}},{key:"fromReplace",value:function(t,n,r,o){try{return e.ok(t.replace(n,r,o))}catch(cr){if(cr instanceof Co)return e.fail(cr.message);throw cr}}}]),e}();function Mi(e,t,n){for(var r=[],o=0;o<e.childCount;o++){var i=e.child(o);i.content.size&&(i=i.copy(Mi(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return xo.fromArray(r)}var Fi=function(e){b(n,e);var t=E(n);function n(e,r,o){var i;return v(this,n),(i=t.call(this)).from=e,i.to=r,i.mark=o,i}return y(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new jo(Mi(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),o),n.openStart,n.openEnd);return Ti.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new Ri(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(Ni);Ni.jsonID("addMark",Fi);var Ri=function(e){b(n,e);var t=E(n);function n(e,r,o){var i;return v(this,n),(i=t.call(this)).from=e,i.to=r,i.mark=o,i}return y(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=new jo(Mi(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return Ti.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new Fi(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(Ni);Ni.jsonID("removeMark",Ri);var Pi=function(e){b(n,e);var t=E(n);function n(e,r,o){var i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return v(this,n),(i=t.call(this)).from=e,i.to=r,i.slice=o,i.structure=a,i}return y(n,[{key:"apply",value:function(e){return this.structure&&Li(e,this.from,this.to)?Ti.fail("Structure replace would overwrite content"):Ti.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new ji([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new n(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new n(t.pos,Math.max(t.pos,r.pos),this.slice)}},{key:"merge",value:function(e){if(!(e instanceof n)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var t=this.slice.size+e.slice.size==0?jo.empty:new jo(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new n(e.from,this.to,t,this.structure)}var r=this.slice.size+e.slice.size==0?jo.empty:new jo(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new n(this.from,this.to+(e.to-e.from),r,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new n(t.from,t.to,jo.fromJSON(e,t.slice),!!t.structure)}}]),n}(Ni);Ni.jsonID("replace",Pi);var Bi=function(e){b(n,e);var t=E(n);function n(e,r,o,i,a,s){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return v(this,n),(u=t.call(this)).from=e,u.to=r,u.gapFrom=o,u.gapTo=i,u.slice=a,u.insert=s,u.structure=c,u}return y(n,[{key:"apply",value:function(e){if(this.structure&&(Li(e,this.from,this.gapFrom)||Li(e,this.gapTo,this.to)))return Ti.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ti.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?Ti.fromReplace(e,this.from,this.to,n):Ti.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new ji([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var t=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new n(t.pos,r.pos,o,i,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(t.from,t.to,t.gapFrom,t.gapTo,jo.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(Ni);function Li(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function Ii(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function zi(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!Ii(r,o,i))break}return null}function Ui(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=$i(e,t),i=o&&Hi(r,t);return i?o.map(Vi).concat({type:t,attrs:n}).concat(i.map(Vi)):null}function Vi(e){return{type:e,attrs:null}}function $i(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}function Hi(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,u=r;s&&u<o;u++)s=s.matchType(n.child(u).type);return s&&s.validEnd?a:null}function qi(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=e.steps.length;e.doc.nodesBetween(t,n,(function(t,n){if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);var a=e.mapping.slice(i),s=a.map(n,1),u=a.map(n+t.nodeSize,1);return e.step(new Bi(s,u,s+1,u-1,new jo(xo.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}function Wi(e,t,n,r,o){var i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);var a=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,a);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Bi(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new jo(xo.from(a),0,0),1,!0))}function Ki(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,u=n-2;s>i;s--,u--){var c=o.node(s),l=o.index(s);if(c.type.spec.isolating)return!1;var f=c.content.cutByIndex(l,c.childCount),d=r&&r[u]||c;if(d!=c&&(f=f.replaceChild(0,d.type.create(d.attrs))),!c.canReplace(l+1,c.childCount)||!d.type.validContent(f))return!1}var p=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(p,p,h?h.type:o.node(i+1).type)}function Gi(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.doc.resolve(t),i=xo.empty,a=xo.empty,s=o.depth,u=o.depth-n,c=n-1;s>u;s--,c--){i=xo.from(o.node(s).copy(i));var l=r&&r[c];a=xo.from(l?l.type.create(l.attrs,a):o.node(s).copy(a))}e.step(new Pi(t,t,new jo(i.append(a),n,n),!0))}function Yi(e,t){var n=e.resolve(t),r=n.index();return Ji(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Ji(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function Qi(e,t,n){var r=new Pi(t-n,t+n,jo.empty,!0);e.step(r)}function Xi(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:jo.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return Zi(o,i,r)?new Pi(t,n,r):new ea(o,i,r).fit()}function Zi(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ni.jsonID("replaceAround",Bi);var ea=function(){function e(t,n,r){v(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=xo.empty;for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(var a=t.depth;a>0;a--)this.placed=xo.from(t.node(a).copy(this.placed))}return y(e,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;for(var i=this.placed,a=r.depth,s=o.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var u=new jo(i,a,s);return t>-1?new Bi(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Pi(r.pos,o.pos,u):null}},{key:"findFittable",value:function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=null,r=(t?(n=ra(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var i=this.frontier[o],a=i.type,s=i.match,u=void 0,c=null;if(1==e&&(r?s.matchType(r.type)||(c=s.fillBefore(xo.from(r),!1)):n&&a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:o,parent:n,inject:c};if(2==e&&r&&(u=s.findWrapping(r.type)))return{sliceDepth:t,frontierDepth:o,parent:n,wrap:u};if(n&&s.matchType(n.type))break}}},{key:"openMore",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=ra(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new jo(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=ra(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new jo(ta(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new jo(ta(t,n,1),n,r)}},{key:"placeNodes",value:function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,o=e.inject,i=e.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var a=0;a<i.length;a++)this.openFrontierNode(i[a]);var s=this.unplaced,u=r?r.content:s.content,c=s.openStart-t,l=0,f=[],d=this.frontier[n],p=d.match,h=d.type;if(o){for(a=0;a<o.childCount;a++)f.push(o.child(a));p=p.matchFragment(o)}for(var v=u.size+t-(s.content.size-s.openEnd);l<u.childCount;){var m=u.child(l),y=p.matchType(m.type);if(!y)break;(++l>1||0==c||m.content.size)&&(p=y,f.push(oa(m.mark(h.allowedMarks(m.marks)),1==l?c:0,l==u.childCount?v:-1)))}var g=l==u.childCount;g||(v=-1),this.placed=na(this.placed,n,xo.from(f)),this.frontier[n].match=p,g&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var b=0,k=u;b<v;b++){var w=k.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),k=w.content}this.unplaced=g?0==t?jo.empty:new jo(ta(s.content,t-1,1),t-1,v<0?s.openEnd:t-1):new jo(ta(s.content,t,l),s.openStart,s.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!ia(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=ia(e,t,o,r,i);if(a){for(var s=t-1;s>=0;s--){var u=this.frontier[s],c=u.match,l=ia(e,s,u.type,c,!0);if(!l||l.childCount)continue e}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}},{key:"close",value:function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=na(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e}},{key:"openFrontierNode",value:function(e){var t=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(e),this.placed=na(this.placed,this.depth,xo.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(xo.empty,!0);e.childCount&&(this.placed=na(this.placed,this.frontier.length,e))}}]),e}();function ta(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ta(e.firstChild.content,t-1,n)))}function na(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(na(e.lastChild.content,t-1,n)))}function ra(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function oa(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,oa(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(xo.empty,!0)))),e.copy(r)}function ia(e,t,n,r,o){var i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=r.fillBefore(i.content,!0,a);return s&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,a)?s:null}function aa(e){return e.spec.defining||e.spec.definingForContent}function sa(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(sa(i.content,t+1,n,r,i)))}if(t>r){var a=o.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(xo.empty,!0))}return e}function ua(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}var ca=Error;((ca=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=ca,ca.prototype.name="TransformError";var la=function(){function e(t){v(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new _i}return y(e,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(e){var t=this.maybeStep(e);if(t.failed)throw new ca(t.failed);return this}},{key:"maybeStep",value:function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jo.empty,r=Xi(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new jo(xo.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,jo.empty)}},{key:"insert",value:function(e,t){return this.replaceWith(e,e,t)}},{key:"replaceRange",value:function(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);var o=e.doc.resolve(t),i=e.doc.resolve(n);if(Zi(o,i,r))return e.step(new Pi(t,n,r));var a=ua(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var u=o.depth,c=o.pos-1;u>0;u--,c--){var l=o.node(u).type.spec;if(l.defining||l.definingAsContext||l.isolating)break;a.indexOf(u)>-1?s=u:o.before(u)==c&&a.splice(1,0,-u)}for(var f=a.indexOf(s),d=[],p=r.openStart,h=r.content,v=0;;v++){var m=h.firstChild;if(d.push(m),v==r.openStart)break;h=m.content}for(var y=p-1;y>=0;y--){var g=d[y].type,b=aa(g);if(b&&o.node(f).type!=g)p=y;else if(b||!g.isTextblock)break}for(var k=r.openStart;k>=0;k--){var w=(k+p+1)%(r.openStart+1),x=d[w];if(x)for(var O=0;O<a.length;O++){var E=a[(O+f)%a.length],D=!0;E<0&&(D=!1,E=-E);var S=o.node(E-1),C=o.index(E-1);if(S.canReplaceWith(C,C,x.type,x.marks))return e.replace(o.before(E),D?i.after(E):n,new jo(sa(r.content,0,r.openStart,w),w,r.openEnd))}}for(var j=e.steps.length,_=a.length-1;_>=0&&(e.replace(t,n,r),!(e.steps.length>j));_--){var A=a[_];A<0||(t=o.before(A),n=i.after(A))}}(this,e,t,n),this}},{key:"replaceRangeWith",value:function(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>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<r.node(a).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new jo(xo.from(r),0,0))}(this,e,t,n),this}},{key:"deleteRange",value:function(e,t){return function(e,t,n){for(var r=e.doc.resolve(t),o=e.doc.resolve(n),i=ua(r,o),a=0;a<i.length;a++){var s=i[a],u=a==i.length-1;if(u&&0==s||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),o.end(s));if(s>0&&(u||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return e.delete(r.before(s),o.after(s))}for(var c=1;c<=r.depth&&c<=o.depth;c++)if(t-r.start(c)==r.depth-c&&n>r.end(c)&&o.end(c)-n!=o.depth-c)return e.delete(r.before(c),n);e.delete(t,n)}(this,e,t),this}},{key:"lift",value:function(e,t){return function(e,t,n){for(var r=t.$from,o=t.$to,i=t.depth,a=r.before(i+1),s=o.after(i+1),u=a,c=s,l=xo.empty,f=0,d=i,p=!1;d>n;d--)p||r.index(d)>0?(p=!0,l=xo.from(r.node(d).copy(l)),f++):u--;for(var h=xo.empty,v=0,m=i,y=!1;m>n;m--)y||o.after(m+1)<o.end(m)?(y=!0,h=xo.from(o.node(m).copy(h)),v++):c++;e.step(new Bi(u,c,a,s,new jo(l.append(h),f,v),l.size-f,!0))}(this,e,t),this}},{key:"join",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Qi(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=xo.empty,o=n.length-1;o>=0;o--){if(r.size){var i=n[o].type.contentMatch.matchFragment(r);if(!i||!i.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=xo.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new Bi(a,s,a,s,new jo(r,0,0),n.length,!0))}(this,e,t),this}},{key:"setBlockType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return qi(this,e,t,n,r),this}},{key:"setNodeMarkup",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Wi(this,e,t,n,r),this}},{key:"split",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return Gi(this,e,t,n),this}},{key:"addMark",value:function(e,t,n){return function(e,t,n,r){var o,i,a=[],s=[];e.doc.nodesBetween(t,n,(function(e,u,c){if(e.isInline){var l=e.marks;if(!r.isInSet(l)&&c.type.allowsMarkType(r.type)){for(var f=Math.max(u,t),d=Math.min(u+e.nodeSize,n),p=r.addToSet(l),h=0;h<l.length;h++)l[h].isInSet(p)||(o&&o.to==f&&o.mark.eq(l[h])?o.to=d:a.push(o=new Ri(f,d,l[h])));i&&i.to==f?i.to=d:s.push(i=new Fi(f,d,r))}}})),a.forEach((function(t){return e.step(t)})),s.forEach((function(t){return e.step(t)}))}(this,e,t,n),this}},{key:"removeMark",value:function(e,t,n){return function(e,t,n,r){var o=[],i=0;e.doc.nodesBetween(t,n,(function(e,a){if(e.isInline){i++;var s=null;if(r instanceof ci)for(var u,c=e.marks;u=r.isInSet(c);)(s||(s=[])).push(u),c=u.removeFromSet(c);else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length)for(var l=Math.min(a+e.nodeSize,n),f=0;f<s.length;f++){for(var d=s[f],p=void 0,h=0;h<o.length;h++){var v=o[h];v.step==i-1&&d.eq(o[h].style)&&(p=v)}p?(p.to=l,p.step=i):o.push({style:d,from:Math.max(a,t),to:l,step:i})}}})),o.forEach((function(t){return e.step(new Ri(t.from,t.to,t.style))}))}(this,e,t,n),this}},{key:"clearIncompatible",value:function(e,t,n){return function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,o=e.doc.nodeAt(t),i=[],a=t+1,s=0;s<o.childCount;s++){var u=o.child(s),c=a+u.nodeSize,l=r.matchType(u.type);if(l){r=l;for(var f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||e.step(new Ri(a,c,u.marks[f]))}else i.push(new Pi(a,c,jo.empty));a=c}if(!r.validEnd){var d=r.fillBefore(xo.empty,!0);e.replace(a,a,new jo(d,0,0))}for(var p=i.length-1;p>=0;p--)e.step(i[p])}(this,e,t,n),this}}]),e}(),fa=Object.create(null),da=function(){function e(t,n,r){v(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new pa(t.min(n),t.max(n))]}return y(e,[{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 e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jo.empty,n=t.content.lastChild,r=null,o=0;o<t.openEnd;o++)r=n,n=n.lastChild;for(var i=e.steps.length,a=this.ranges,s=0;s<a.length;s++){var u=a[s],c=u.$from,l=u.$to,f=e.mapping.slice(i);e.replaceRange(f.map(c.pos),f.map(l.pos),s?jo.empty:t),0==s&&Oa(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,s=i.$to,u=e.mapping.slice(n),c=u.map(a.pos),l=u.map(s.pos);o?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Oa(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return ma.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new ma(e):xa(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?xa(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):xa(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new ka(e.node(0))}},{key:"atStart",value:function(e){return xa(e,e,0,0,1)||new ka(e)}},{key:"atEnd",value:function(e){return xa(e,e,e.content.size,e.childCount,-1)||new ka(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=fa[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in fa)throw new RangeError("Duplicate use of selection JSON ID "+e);return fa[e]=t,t.prototype.jsonID=e,t}}]),e}();da.prototype.visible=!0;var pa=y((function e(t,n){v(this,e),this.$from=t,this.$to=n})),ha=!1;function va(e){ha||e.parent.inlineContent||(ha=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var ma=function(e){b(n,e);var t=E(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return v(this,n),va(e),va(r),t.call(this,e,r)}return y(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,t){var r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return da.near(r);var o=e.resolve(t.map(this.anchor));return new n(o.parent.inlineContent?o:r,r)}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jo.empty;if(rt(k(n.prototype),"replace",this).call(this,e,t),t==jo.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new ya(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(e.resolve(t.anchor),e.resolve(t.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,t,r){var o=e.pos-t.pos;if(r&&!o||(r=o>=0?1:-1),!t.parent.inlineContent){var i=da.findFrom(t,r,!0)||da.findFrom(t,-r,!0);if(!i)return da.near(t,r);t=i.$head}return e.parent.inlineContent||(0==o||(e=(da.findFrom(e,-r,!0)||da.findFrom(e,r,!0)).$anchor).pos<t.pos!=o<0)&&(e=t),new n(e,t)}}]),n}(da);da.jsonID("text",ma);var ya=function(){function e(t,n){v(this,e),this.anchor=t,this.head=n}return y(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){return ma.between(e.resolve(this.anchor),e.resolve(this.head))}}]),e}(),ga=function(e){b(n,e);var t=E(n);function n(e){var r;v(this,n);var o=e.nodeAfter,i=e.node(0).resolve(e.pos+o.nodeSize);return(r=t.call(this,e,i)).node=o,r}return y(n,[{key:"map",value:function(e,t){var r=t.mapResult(this.anchor),o=r.deleted,i=r.pos,a=e.resolve(i);return o?da.near(a):new n(a)}},{key:"content",value:function(){return new jo(xo.from(this.node),0,0)}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new ba(this.anchor)}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new n(e.resolve(t.anchor))}},{key:"create",value:function(e,t){return new n(e.resolve(t))}},{key:"isSelectable",value:function(e){return!e.isText&&!1!==e.type.spec.selectable}}]),n}(da);ga.prototype.visible=!1,da.jsonID("node",ga);var ba=function(){function e(t){v(this,e),this.anchor=t}return y(e,[{key:"map",value:function(t){var n=t.mapResult(this.anchor),r=n.deleted,o=n.pos;return r?new ya(o,o):new e(o)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ga.isSelectable(n)?new ga(t):da.near(t)}}]),e}(),ka=function(e){b(n,e);var t=E(n);function n(e){return v(this,n),t.call(this,e.resolve(0),e.resolve(e.content.size))}return y(n,[{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jo.empty;if(t==jo.empty){e.delete(0,e.doc.content.size);var r=da.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else rt(k(n.prototype),"replace",this).call(this,e,t)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new n(e)}},{key:"eq",value:function(e){return e instanceof n}},{key:"getBookmark",value:function(){return wa}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(da);da.jsonID("all",ka);var wa={map:function(){return this},resolve:function(e){return new ka(e)}};function xa(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return ma.create(e,n);for(var a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&ga.isSelectable(s))return ga.create(e,n-(o<0?s.nodeSize:0))}else{var u=xa(e,s,n+o,o<0?s.childCount:0,o,i);if(u)return u}n+=s.nodeSize*o}return null}function Oa(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o,i=e.steps[r];if(i instanceof Pi||i instanceof Bi)e.mapping.maps[r].forEach((function(e,t,n,r){null==o&&(o=r)})),e.setSelection(da.near(e.doc.resolve(o),n))}}var Ea=function(e){b(n,e);var t=E(n);function n(e){var r;return v(this,n),(r=t.call(this,e.doc)).curSelectionFor=0,r.updated=0,r.meta=Object.create(null),r.time=Date.now(),r.curSelection=e.selection,r.storedMarks=e.storedMarks,r}return y(n,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=2,this}},{key:"ensureMarks",value:function(e){return So.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(e,t){rt(k(n.prototype),"addStep",this).call(this,e,t),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||So.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(da.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e 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}(la);function Da(e,t){return t&&e?e.bind(t):e}var Sa=y((function e(t,n,r){v(this,e),this.name=t,this.init=Da(n.init,r),this.apply=Da(n.apply,r)})),Ca=[new Sa("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Sa("selection",{init:function(e,t){return e.selection||da.atStart(t.doc)},apply:function(e){return e.selection}}),new Sa("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Sa("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],ja=y((function e(t,n){var r=this;v(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ca.slice(),n&&n.forEach((function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new Sa(e.key,e.spec.state,e))}))})),_a=function(){function e(t){v(this,e),this.config=t}return y(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}},{key:"applyTransaction",value:function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=r?r[i].n:0,u=r?r[i].state:this,c=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,u,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}},{key:"applyInner",value:function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new e(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}},{key:"tr",get:function(){return new Ea(this)}},{key:"reconfigure",value:function(t){for(var n=new ja(this.schema,t.plugins),r=n.fields,o=new e(n),i=0;i<r.length;i++){var a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(t,o)}return o}},{key:"toJSON",value:function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}}],[{key:"create",value:function(t){for(var n=new ja(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n),o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}},{key:"fromJSON",value:function(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new ja(t.schema,t.plugins),i=new e(o);return o.fields.forEach((function(e){if("doc"==e.name)i.doc=Wo.fromJSON(t.schema,n.doc);else if("selection"==e.name)i.selection=da.fromJSON(i.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(var o in r){var a=r[o],s=a.spec.state;if(a.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,o))return void(i[e.name]=s.fromJSON.call(a,t,n[o],i))}i[e.name]=e.init(t,i)}})),i}}]),e}();function Aa(e,t,n){for(var r in e){var o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Aa(o,t,{})),n[r]=o}return n}var Na=function(){function e(t){v(this,e),this.spec=t,this.props={},t.props&&Aa(t.props,this,this.props),this.key=t.key?t.key.key:Ma("plugin")}return y(e,[{key:"getState",value:function(e){return e[this.key]}}]),e}(),Ta=Object.create(null);function Ma(e){return e in Ta?e+"$"+ ++Ta[e]:(Ta[e]=0,e+"$")}var Fa=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";v(this,e),this.key=Ma(t)}return y(e,[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}]),e}(),Ra="undefined"!=typeof navigator?navigator:null,Pa="undefined"!=typeof document?document:null,Ba=Ra&&Ra.userAgent||"",La=/Edge\/(\d+)/.exec(Ba),Ia=/MSIE \d/.exec(Ba),za=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ba),Ua=!!(Ia||za||La),Va=Ia?document.documentMode:za?+za[1]:La?+La[1]:0,$a=!Ua&&/gecko\/(\d+)/i.test(Ba);$a&&(/Firefox\/(\d+)/.exec(Ba)||[0,0])[1];var Ha=!Ua&&/Chrome\/(\d+)/.exec(Ba),qa=!!Ha,Wa=Ha?+Ha[1]:0,Ka=!Ua&&!!Ra&&/Apple Computer/.test(Ra.vendor),Ga=Ka&&(/Mobile\/\w+/.test(Ba)||!!Ra&&Ra.maxTouchPoints>2),Ya=Ga||!!Ra&&/Mac/.test(Ra.platform),Ja=/Android \d/.test(Ba),Qa=!!Pa&&"webkitFontSmoothing"in Pa.documentElement.style,Xa=Qa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Za=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},es=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},ts=null,ns=function(e,t,n){var r=ts||(ts=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},rs=function(e,t,n,r){return n&&(as(e,t,n,r,-1)||as(e,t,n,r,1))},is=/^(img|br|input|textarea|hr)$/i;function as(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:ss(e))){var i=e.parentNode;if(!i||1!=i.nodeType||cs(e)||is.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Za(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?ss(e):0}}}function ss(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function us(e,t,n){for(var r=0==t,o=t==ss(e);r||o;){if(e==n)return!0;var i=Za(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==ss(e)}}function cs(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var ls=function(e){var t=e.isCollapsed;return t&&qa&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function fs(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ds(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ps(e,t){return"number"==typeof e?e:e[t]}function hs(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function vs(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=es(a))if(1==a.nodeType){var s=a,u=s==i.body,c=u?ds(i):hs(s),l=0,f=0;if(t.top<c.top+ps(r,"top")?f=-(c.top-t.top+ps(o,"top")):t.bottom>c.bottom-ps(r,"bottom")&&(f=t.bottom-c.bottom+ps(o,"bottom")),t.left<c.left+ps(r,"left")?l=-(c.left-t.left+ps(o,"left")):t.right>c.right-ps(r,"right")&&(l=t.right-c.right+ps(o,"right")),l||f)if(u)i.defaultView.scrollBy(l,f);else{var d=s.scrollLeft,p=s.scrollTop;f&&(s.scrollTop+=f),l&&(s.scrollLeft+=l);var h=s.scrollLeft-d,v=s.scrollTop-p;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(u)break}}function ms(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=es(r));return t}function ys(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=r.dom,i=r.top,a=r.left;o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=a&&(o.scrollLeft=a)}}var gs=null;function bs(e,t){for(var n,r,o=2e8,i=0,a=t.top,s=t.top,u=e.firstChild,c=0;u;u=u.nextSibling,c++){var l=void 0;if(1==u.nodeType)l=u.getClientRects();else{if(3!=u.nodeType)continue;l=ns(u).getClientRects()}for(var f=0;f<l.length;f++){var d=l[f];if(d.top<=a&&d.bottom>=s){a=Math.max(d.bottom,a),s=Math.min(d.top,s);var p=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(p<o){n=u,o=p,r=p&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==u.nodeType&&p&&(i=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);var i=Os(r,1);if(i.top!=i.bottom&&ks(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:bs(n,r)}function ks(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ws(e,t,n){var r=e.childNodes.length;if(r&&n.top<n.bottom)for(var o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){var a=e.childNodes[i];if(1==a.nodeType)for(var s=a.getClientRects(),u=0;u<s.length;u++){var c=s[u];if(ks(t,c))return ws(a,t,c)}if((i=(i+1)%r)==o)break}return e}function xs(e,t){var n,r=e.dom.ownerDocument,o=0;if(r.caretPositionFromPoint)try{var i=r.caretPositionFromPoint(t.left,t.top);i&&(n=i.offsetNode,o=i.offset)}catch(h){}if(!n&&r.caretRangeFromPoint){var a=r.caretRangeFromPoint(t.left,t.top);a&&(n=a.startContainer,o=a.startOffset)}var s,u=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!u||!e.dom.contains(1!=u.nodeType?u.parentNode:u)){var c=e.dom.getBoundingClientRect();if(!ks(t,c))return null;if(!(u=ws(e.dom,t,c)))return null}if(Ka)for(var l=u;n&&l;l=es(l))l.draggable&&(n=void 0);if(u=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(u,t),n){if($a&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length))<n.childNodes.length){var f,d=n.childNodes[o];"IMG"==d.nodeName&&(f=d.getBoundingClientRect()).right<=t.left&&f.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!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)o=a.posBefore;else{if(!(s.right<r.left||s.bottom<r.top))break;o=a.posAfter}}i=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==s&&(s=function(e,t,n){var r=bs(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,u,t));var p=e.docView.nearestDesc(u,!0);return{pos:s,inside:p?p.posAtStart-p.border:-1}}function Os(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var Es=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ds(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=Qa||$a;if(3==o.nodeType){if(!a||!Es.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var s=i,u=i,c=n<0?1:-1;return n<0&&!i?(u++,c=-1):n>=0&&i==o.nodeValue.length?(s--,c=1):n<0?s--:u++,Ss(Os(ns(o,s,u),c),c<0)}var l=Os(ns(o,i,i),n);if($a&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var f=Os(ns(o,i-1,i-1),-1);if(f.top==l.top){var d=Os(ns(o,i,i+1),-1);if(d.top!=l.top)return Ss(d,d.left<f.left)}}return l}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==ss(o))){var p=o.childNodes[i-1];if(1==p.nodeType)return Cs(p.getBoundingClientRect(),!1)}if(i<ss(o)){var h=o.childNodes[i];if(1==h.nodeType)return Cs(h.getBoundingClientRect(),!0)}return Cs(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==ss(o))){var v=o.childNodes[i-1],m=3==v.nodeType?ns(v,ss(v)-(a?0:1)):1!=v.nodeType||"BR"==v.nodeName&&v.nextSibling?null:v;if(m)return Ss(Os(m,1),!1)}if(i<ss(o)){for(var y=o.childNodes[i];y.pmViewDesc&&y.pmViewDesc.ignoreForCoords;)y=y.nextSibling;var g=y?3==y.nodeType?ns(y,0,a?0:1):1==y.nodeType?y:null:null;if(g)return Ss(Os(g,-1),!0)}return Ss(Os(3==o.nodeType?ns(o):o,-n),n>=0)}function Ss(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Cs(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function js(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var _s=/[\u0590-\u08ac]/;var As=null,Ns=null,Ts=!1;function Ms(e,t,n){return As==t&&Ns==n?Ts:(As=t,Ns=n,Ts="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return js(e,t,(function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=Ds(e,o.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=ns(a,0,a.nodeValue.length).getClientRects()}for(var u=0;u<s.length;u++){var c=s[u];if(c.bottom>c.top+1&&("up"==n?i.top-c.top>2*(c.bottom-i.top):c.bottom-i.bottom>2*(i.bottom-c.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return _s.test(r.parent.textContent)&&s.modify?js(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var u=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),u})):"left"==n||"backward"==n?i:a}(e,t,n))}var Fs=function(){function e(t,n,r,o){v(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=0,r.pmViewDesc=this}return y(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var e=0;e<this.children.length;e++)this.children[e].destroy()}},{key:"posBeforeChild",value:function(e){for(var t=0,n=this.posAtStart;;t++){var r=this.children[t];if(r==e)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,o;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,a;if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}var s;if(e==this.dom&&this.contentDOM)s=t>Za(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var u=e;;u=u.parentNode){if(u==this.dom){s=!1;break}if(u.previousSibling)break}if(null==s&&t==e.childNodes.length)for(var c=e;;c=c.parentNode){if(c==this.dom){s=!0;break}if(c.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}},{key:"domFromPos",value:function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n,r=0,o=0,i=0;r<this.children.length;r++){var a=this.children[r],s=i+a.size;if(s>e||a instanceof Us){o=e-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Rs&&n.side>=0;r--);if(t<=0){for(var u,c=!0;(u=r?this.children[r-1]:null)&&u.dom.parentNode!=this.contentDOM;r--,c=!1);return u&&t&&c&&!u.border&&!u.domAtom?u.domFromPos(u.size,t):{node:this.contentDOM,offset:u?Za(u.dom)+1:0}}for(var l,f=!0;(l=r<this.children.length?this.children[r]:null)&&l.dom.parentNode!=this.contentDOM;r++,f=!1);return l&&f&&!l.border&&!l.domAtom?l.domFromPos(0,t):{node:this.contentDOM,offset:l?Za(l.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],u=i+s.size;if(-1==r&&e<=u){var c=i+s.border;if(e>=c&&t<=u-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,c);e=i;for(var l=a;l>0;l--){var f=this.children[l-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=Za(f.dom)+1;break}e-=f.size}-1==r&&(r=0)}if(r>-1&&(u>t||a==this.children.length-1)){t=u;for(var d=a+1;d<this.children.length;d++){var p=this.children[d];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){o=Za(p.dom);break}t+=p.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}},{key:"emptyChildAt",value:function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}},{key:"domAfterPos",value:function(e){var t=this.domFromPos(e,0),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}},{key:"setSelection",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;a<this.children.length;a++){var u=this.children[a],c=s+u.size;if(o>s&&i<c)return u.setSelection(e-s-u.border,t-s-u.border,n,r);s=c}var l=this.domFromPos(e,e?-1:1),f=t==e?l:this.domFromPos(t,t?-1:1),d=n.getSelection(),p=!1;if(($a||Ka)&&e==t){var h=l,v=h.node,m=h.offset;if(3==v.nodeType){if((p=!(!m||"\n"!=v.nodeValue[m-1]))&&m==v.nodeValue.length)for(var y,g=v;g;g=g.parentNode){if(y=g.nextSibling){"BR"==y.nodeName&&(l=f={node:y.parentNode,offset:Za(y)+1});break}var b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{var k=v.childNodes[m-1];p=k&&("BR"==k.nodeName||"false"==k.contentEditable)}}if($a&&d.focusNode&&d.focusNode!=f.node&&1==d.focusNode.nodeType){var w=d.focusNode.childNodes[d.focusOffset];w&&"false"==w.contentEditable&&(r=!0)}if(r||p&&Ka||!rs(l.node,l.offset,d.anchorNode,d.anchorOffset)||!rs(f.node,f.offset,d.focusNode,d.focusOffset)){var x=!1;if((d.extend||e==t)&&!p){d.collapse(l.node,l.offset);try{e!=t&&d.extend(f.node,f.offset),x=!0}catch(D){if(!(D instanceof DOMException))throw D}}if(!x){if(e>t){var O=l;l=f,f=O}var E=document.createRange();E.setEnd(f.node,f.offset),E.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(E)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}}]),e}(),Rs=function(e){b(n,e);var t=E(n);function n(e,r,o,i){var a;v(this,n);var s,u=r.type.toDOM;if("function"==typeof u&&(u=u(o,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:i}))),!r.type.spec.raw){if(1!=u.nodeType){var c=document.createElement("span");c.appendChild(u),u=c}u.contentEditable="false",u.classList.add("ProseMirror-widget")}return(a=t.call(this,e,[],u,null)).widget=r,a.widget=r,s=x(a),a}return y(n,[{key:"matchesWidget",value:function(e){return 0==this.dirty&&e.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)}},{key:"ignoreMutation",value:function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),rt(k(n.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}]),n}(Fs),Ps=function(e){b(n,e);var t=E(n);function n(e,r,o,i){var a;return v(this,n),(a=t.call(this,e,[],r,null)).textDOM=o,a.text=i,a}return y(n,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}},{key:"domFromPos",value:function(e){return{node:this.textDOM,offset:e}}},{key:"ignoreMutation",value:function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}]),n}(Fs),Bs=function(e){b(n,e);var t=E(n);function n(e,r,o,i){var a;return v(this,n),(a=t.call(this,e,[],o,i)).mark=r,a}return y(n,[{key:"parseRule",value:function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}},{key:"matchesMark",value:function(e){return 3!=this.dirty&&this.mark.eq(e)}},{key:"markDirty",value:function(e,t){if(rt(k(n.prototype),"markDirty",this).call(this,e,t),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function(e,t,r){var o=n.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;t<a&&(i=eu(i,t,a,r)),e>0&&(i=eu(i,0,e,r));for(var s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o}}],[{key:"create",value:function(e,t,r,o){var i=o.nodeViews[t.type.name],a=i&&i(t,o,r);return a&&a.dom||(a=xi.renderSpec(document,t.type.spec.toDOM(t,r))),new n(e,t,a.dom,a.contentDOM||a.dom)}}]),n}(Fs),Ls=function(e){b(n,e);var t=E(n);function n(e,r,o,i,a,s,u,c,l){var f;return v(this,n),(f=t.call(this,e,[],a,s)).node=r,f.outerDeco=o,f.innerDeco=i,f.nodeDOM=u,s&&f.updateChildren(c,l),f}return y(n,[{key:"parseRule",value:function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return xo.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Js(t,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(e,t){var n=this,r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,u=new Xs(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;a<e.childCount;a++){var s=e.child(a);r(s,o,t.forChild(i,s),a),i+=s.nodeSize}return}for(var u=0,c=[],l=null,f=0;;){if(u<o.length&&o[u].to==i){for(var d=o[u++],p=void 0;u<o.length&&o[u].to==i;)(p||(p=[d])).push(o[u++]);if(p){p.sort(Zs);for(var h=0;h<p.length;h++)n(p[h],f,!!l)}else n(d,f,!!l)}var v=void 0,m=void 0;if(l)m=-1,v=l,l=null;else{if(!(f<e.childCount))break;m=f,v=e.child(f++)}for(var y=0;y<c.length;y++)c[y].to<=i&&c.splice(y--,1);for(;u<o.length&&o[u].from<=i&&o[u].to>i;)c.push(o[u++]);var g=i+v.nodeSize;if(v.isText){var b=g;u<o.length&&o[u].from<b&&(b=o[u].from);for(var k=0;k<c.length;k++)c[k].to<b&&(b=c[k].to);b<g&&(l=v.cut(b-i),v=v.cut(0,b-i),g=b,m=-1)}r(v,v.isInline&&!v.isLeaf?c.filter((function(e){return!e.inline})):c.slice(),t.forChild(i,v),m),i=g}}(this.node,this.innerDeco,(function(t,i,a){t.spec.marks?u.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&u.syncToMarks(i==n.node.childCount?So.none:n.node.child(i).marks,r,e),u.placeWidget(t,e,o)}),(function(t,n,a,c){var l;u.syncToMarks(t.marks,r,e),u.findNodeMatch(t,n,a,c)||s&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(l=u.findIndexWithChild(i.node))>-1&&u.updateNodeAt(t,n,a,l,e)||u.updateNextNode(t,n,a,e,c)||u.addNode(t,n,a,e,o),o+=t.nodeSize})),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),$s(this.contentDOM,this.children,e),Ga&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(e.state.selection instanceof ma)||r<t||o>t+this.node.content.size)return null;var i=e.domSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=ss(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){var s=a.nodeValue,u=function(e,t,n,r){for(var o=0,i=0;o<e.childCount&&i<=r;){var a=e.child(o++),s=i;if(i+=a.nodeSize,a.isText){for(var u=a.text;o<e.childCount;){var c=e.child(o++);if(i+=c.nodeSize,!c.isText)break;u+=c.text}if(i>=n){var l=s<r?u.lastIndexOf(t,r-s-1):-1;if(l>=0&&l+t.length+s>=n)return s+l;if(n==r&&u.length>=r+t.length-s&&u.slice(r-s,r-s+t.length)==t)return r}}}return-1}(this.node.content,s,r-t,o-t);return u<0?null:{node:a,pos:u,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new Ps(this,i,n,o);e.input.compositionNodes.push(a),this.children=eu(this.children,r,r+o.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!Js(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ks(this.dom,this.nodeDOM,Ws(this.outerDeco,this.node,t),Ws(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{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(e,t,r,o,i,a){var s,u=i.nodeViews[t.type.name],c=u&&u(t,i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:a}),r,o),l=c&&c.dom,f=c&&c.contentDOM;if(t.isText)if(l){if(3!=l.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(t.text);else if(!l){var d=xi.renderSpec(document,t.type.spec.toDOM(t));l=d.dom,f=d.contentDOM}f||t.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),t.type.spec.draggable&&(l.draggable=!0));var p=l;return l=Ys(l,r,t),c?s=new Vs(e,t,r,o,l,f||null,p,c,i,a+1):t.isText?new zs(e,t,r,o,l,p,i):new n(e,t,r,o,l,f||null,p,i,a+1)}}]),n}(Fs);function Is(e,t,n,r,o){return Ys(r,t,e),new Ls(void 0,e,t,n,r,r,r,o,0)}var zs=function(e){b(n,e);var t=E(n);function n(e,r,o,i,a,s,u){return v(this,n),t.call(this,e,r,o,i,a,null,s,u,0)}return y(n,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):rt(k(n.prototype),"localPosFromDOM",this).call(this,e,t,r)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,t,r){var o=this.node.cut(e,t),i=document.createTextNode(o.text);return new n(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(e,t){rt(k(n.prototype),"markDirty",this).call(this,e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(Ls),Us=function(e){b(n,e);var t=E(n);function n(){return v(this,n),t.apply(this,arguments)}return y(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(Fs),Vs=function(e){b(n,e);var t=E(n);function n(e,r,o,i,a,s,u,c,l,f){var d;return v(this,n),(d=t.call(this,e,r,o,i,a,s,u,l,f)).spec=c,d}return y(n,[{key:"update",value:function(e,t,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&rt(k(n.prototype),"update",this).call(this,e,t,r,o)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():rt(k(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():rt(k(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):rt(k(n.prototype),"setSelection",this).call(this,e,t,r,o)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),rt(k(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):rt(k(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(Ls);function $s(e,t,n){for(var r=e.firstChild,o=!1,i=0;i<t.length;i++){var a=t[i],s=a.dom;if(s.parentNode==e){for(;s!=r;)r=Qs(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(s,r);if(a instanceof Bs){var u=r?r.previousSibling:e.lastChild;$s(a.contentDOM,a.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=Qs(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var Hs=function(e){e&&(this.nodeName=e)};Hs.prototype=Object.create(null);var qs=[new Hs];function Ws(e,t,n){if(0==e.length)return qs;for(var r=n?qs[0]:new Hs,o=[r],i=0;i<e.length;i++){var a=e[i].type.attrs;if(a)for(var s in a.nodeName&&o.push(r=new Hs(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==o.length&&o.push(r=new Hs(t.isInline?"span":"div")),"class"==s?r.class=(r.class?r.class+" ":"")+u:"style"==s?r.style=(r.style?r.style+";":"")+u:"nodeName"!=s&&(r[s]=u))}}return o}function Ks(e,t,n,r){if(n==qs&&r==qs)return t;for(var o=t,i=0;i<r.length;i++){var a=r[i],s=n[i];if(i){var u=void 0;s&&s.nodeName==a.nodeName&&o!=e&&(u=o.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||((u=document.createElement(a.nodeName)).pmIsDeco=!0,u.appendChild(o),s=qs[0]),o=u}Gs(o,s||qs[0],a)}return o}function Gs(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" ").filter(Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[],s=0;s<i.length;s++)-1==a.indexOf(i[s])&&e.classList.remove(i[s]);for(var u=0;u<a.length;u++)-1==i.indexOf(a[u])&&e.classList.add(a[u]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style)for(var c,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=l.exec(t.style);)e.style.removeProperty(c[1]);n.style&&(e.style.cssText+=n.style)}}function Ys(e,t,n){return Ks(e,e,qs,Ws(t,n,1!=e.nodeType))}function Js(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Qs(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var Xs=function(){function e(t,n){v(this,e),this.lock=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(e,t){var n=t,r=n.children.length,o=e.childCount,i=new Map,a=[];e:for(;o>0;){for(var s=void 0;;)if(r){var u=n.children[r-1];if(!(u instanceof Bs)){s=u,r--;break}n=u,r=u.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var c=s.node;if(c){if(c!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}(t.node.content,t)}return y(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(e,t,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,e.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(e[o])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var u=Bs.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}},{key:"findNodeMatch",value:function(e,t,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var u=this.top.children[a];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}},{key:"updateNodeAt",value:function(e,t,n,r,o){var i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}},{key:"findIndexWithChild",value:function(e){for(;;){var t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){var n=e.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}e=t}}},{key:"updateNextNode",value:function(e,t,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var a=this.top.children[i];if(a instanceof Ls){var s=this.preMatch.matched.get(a);if(null!=s&&s!=o)return!1;var u=a.dom;if(!(this.lock&&(u==this.lock||1==u.nodeType&&u.contains(this.lock.parentNode))&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&Js(t,a.outerDeco)))&&a.update(e,t,n,r))return this.destroyBetween(this.index,i),a.dom!=u&&(this.changed=!0),this.index++,!0;break}}return!1}},{key:"addNode",value:function(e,t,n,r,o){this.top.children.splice(this.index++,0,Ls.create(this.top,e,t,n,r,o)),this.changed=!0}},{key:"placeWidget",value:function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Rs(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){for(var e=this.top.children[this.index-1],t=this.top;e instanceof Bs;)e=(t=e).children[t.children.length-1];e&&e instanceof zs&&!/\n$/.test(e.node.text)||((Ka||qa)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{var n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");var r=new Us(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}]),e}();function Zs(e,t){return e.type.side-t.type.side}function eu(e,t,n,r,o){for(var i=[],a=0,s=0;a<e.length;a++){var u=e[a],c=s,l=s+=u.size;c>=n||l<=t?i.push(u):(c<t&&i.push(u.slice(0,t-c,r)),o&&(i.push(o),o=void 0),l>n&&i.push(u.slice(n-c,u.size,r)))}return i}function tu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,u,c=r.resolve(a);if(ls(n)){for(s=c;o&&!o.node;)o=o.parent;var l=o.node;if(o&&l.isAtom&&ga.isSelectable(l)&&o.parent&&(!l.isInline||!us(n.focusNode,n.focusOffset,o.dom))){var f=o.posBefore;u=new ga(a==f?c:r.resolve(f))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;s=r.resolve(d)}if(!u){var p="pointer"==t||e.state.selection.head<c.pos&&!i?1:-1;u=du(e,s,c,p)}return u}function nu(e){return e.editable?e.hasFocus():hu(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ru(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(lu(e,n),nu(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&qa){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&rs(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)cu(e);else{var i,a,s=n.anchor,u=n.head;!ou||n instanceof ma||(n.$from.parent.inlineContent||(i=iu(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=iu(e,n.to))),e.docView.setSelection(s,u,e.root,t),ou&&(i&&su(i),a&&su(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&uu(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var ou=Ka||qa&&Wa<63;function iu(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(Ka&&i&&"false"==i.contentEditable)return au(i);if((!i||"false"==i.contentEditable)&&(!a||"false"==a.contentEditable)){if(i)return au(i);if(a)return au(a)}}function au(e){return e.contentEditable="true",Ka&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function su(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function uu(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);var n=e.domSelection(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((function(){nu(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}function cu(e){var t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,Za(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Ua&&Va<=11&&(r.disabled=!0,r.disabled=!1)}function lu(e,t){if(t instanceof ga){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(fu(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else fu(e)}function fu(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function du(e,t,n,r){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||ma.between(t,n,r)}function pu(e){return(!e.editable||e.root.activeElement==e.dom)&&hu(e)}function hu(e){var t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function vu(e,t){var n=e.selection,r=n.$anchor,o=n.$head,i=t>0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&da.findFrom(a,t)}function mu(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function yu(e,t,n){var r=e.state.selection;if(!(r instanceof ma)){if(r instanceof ga&&r.node.isInline)return mu(e,new ma(t>0?r.$to:r.$from));var o=vu(e.state,t);return!!o&&mu(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=vu(e.state,t);return!!(i&&i instanceof ga)&&mu(e,i)}if(!(Ya&&n.indexOf("m")>-1)){var a,s=r.$head,u=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!u||u.isText)return!1;var c=t<0?s.pos-u.nodeSize:s.pos;return!!(u.isAtom||(a=e.docView.descAt(c))&&!a.contentDOM)&&(ga.isSelectable(u)?mu(e,new ga(t<0?e.state.doc.resolve(s.pos-u.nodeSize):s)):!!Qa&&mu(e,new ma(e.state.doc.resolve(t<0?c:c+u.nodeSize))))}}function gu(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function bu(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function ku(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for($a&&1==n.nodeType&&r<gu(n)&&bu(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(bu(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(xu(n))break;for(var u=n.previousSibling;u&&bu(u);)o=n.parentNode,i=Za(u),u=u.previousSibling;if(u)r=gu(n=u);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Ou(e,t,n,r):o&&Ou(e,t,o,i)}}function wu(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=gu(n);;)if(r<a){if(1!=n.nodeType)break;if(!bu(n.childNodes[r]))break;o=n,i=++r}else{if(xu(n))break;for(var s=n.nextSibling;s&&bu(s);)o=s.parentNode,i=Za(s)+1,s=s.nextSibling;if(s)r=0,a=gu(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}o&&Ou(e,t,o,i)}}function xu(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ou(e,t,n,r){if(ls(t)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();var i=e.state;setTimeout((function(){e.state==i&&ru(e)}),50)}function Eu(e,t,n){var r=e.state.selection;if(r instanceof ma&&!r.empty||n.indexOf("s")>-1)return!1;if(Ya&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=vu(e.state,t);if(a&&a instanceof ga)return mu(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,u=r instanceof ka?da.near(s,t):da.findFrom(s,t);return!!u&&mu(e,u)}return!1}function Du(e,t){if(!(e.state.selection instanceof ma))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function Su(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Cu(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Ya&&72==n&&"c"==r?Du(e,-1)||ku(e):46==n||Ya&&68==n&&"c"==r?Du(e,1)||wu(e):13==n||27==n||(37==n||Ya&&66==n&&"c"==r?yu(e,-1,r)||ku(e):39==n||Ya&&70==n&&"c"==r?yu(e,1,r)||wu(e):38==n||Ya&&80==n&&"c"==r?Eu(e,-1,r)||ku(e):40==n||Ya&&78==n&&"c"==r?function(e){if(!Ka||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Su(e,o,"true"),setTimeout((function(){return Su(e,o,"false")}),20)}return!1}(e)||Eu(e,1,r)||wu(e):r==(Ya?"m":"c")&&(66==n||73==n||89==n||90==n))}function ju(e,t){for(var n=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||xi.fromSchema(e.state.schema),u=Lu(),c=u.createElement("div");c.appendChild(s.serializeFragment(r,{document:u}));for(var l,f=c.firstChild,d=0;f&&1==f.nodeType&&(l=Pu[f.nodeName.toLowerCase()]);){for(var p=l.length-1;p>=0;p--){for(var h=u.createElement(l[p]);c.firstChild;)h.appendChild(c.firstChild);c.appendChild(h),d++}f=c.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice","".concat(o," ").concat(i).concat(d?" -".concat(d):""," ").concat(JSON.stringify(n))),{dom:c,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function _u(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var u=t&&(r||s||!n);if(u){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return t?new jo(xo.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):jo.empty;var c=e.someProp("clipboardTextParser",(function(e){return e(t,o,r)}));if(c)a=c;else{var l=o.marks(),f=e.state.schema,d=xi.fromSchema(f);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(d.serializeNode(f.text(e,l)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),i=function(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=Lu().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Pu[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return"</"+e+">"})).reverse().join(""));if(r.innerHTML=e,n)for(var i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),Qa&&function(e){for(var t=e.querySelectorAll(qa?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<t.length;n++){var r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);var p=i&&i.querySelector("[data-pm-slice]"),h=p&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(p.getAttribute("data-pm-slice")||"");if(h&&h[3])for(var v=+h[3];v>0&&i.firstChild;v--)i=i.firstChild;if(!a){var m=e.someProp("clipboardParser")||e.someProp("domParser")||di.fromSchema(e.state.schema);a=m.parseSlice(i,{preserveWhitespace:!(!u&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Au.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(h)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(cr){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var u=r.nodes[n[s]];if(!u||u.hasRequiredAttrs())break;o=xo.from(u.create(n[s+1],o)),i++,a++}return new jo(o,i,a)}(Ru(a,+h[1],+h[2]),h[4]);else if(a=jo.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n).contentMatchAt(t.index(n)),o=void 0,i=[];if(e.forEach((function(e){if(i){var t,n=r.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&o.length&&Tu(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Mu(i[i.length-1],o.length));var a=Nu(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:xo.from(i)}},r=t.depth;r>=0;r--){var o=n(r);if("object"===typeof o)return o.v}return e}(a.content,o),!0),a.openStart||a.openEnd){for(var y=0,g=0,b=a.content.firstChild;y<a.openStart&&!b.type.spec.isolating;y++,b=b.firstChild);for(var k=a.content.lastChild;g<a.openEnd&&!k.type.spec.isolating;g++,k=k.lastChild);a=Ru(a,y,g)}return e.someProp("transformPasted",(function(e){a=e(a)})),a}var Au=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Nu(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,xo.from(e));return e}function Tu(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var i=Tu(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(xo.from(Nu(n,e,o+1))))}}function Mu(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,Mu(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(xo.empty,!0);return e.copy(n.append(r))}function Fu(e,t,n,r,o,i){var a=t<0?e.firstChild:e.lastChild,s=a.content;return o<r-1&&(s=Fu(s,t,n,r,o+1,i)),o>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(xo.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function Ru(e,t,n){return t<e.openStart&&(e=new jo(Fu(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new jo(Fu(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Pu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Bu=null;function Lu(){return Bu||(Bu=document.implementation.createHTMLDocument("title"))}var Iu={},zu={},Uu=y((function e(){v(this,e),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}));function Vu(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function $u(e){e.someProp("handleDOMEvents",(function(t){for(var n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=function(t){return Hu(e,t)})}))}function Hu(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function qu(e){return{left:e.clientX,top:e.clientY}}function Wu(e,t,n,r,o){if(-1==r)return!1;for(var i=e.state.doc.resolve(r),a=function(r){if(e.someProp(t,(function(t){return r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var u=a(s);if("object"===typeof u)return u.v}return!1}function Ku(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Gu(e,t,n,r,o){return Wu(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof ga&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(ga.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(Ku(e,ga.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ga.isSelectable(r))&&(Ku(e,new ga(n),"pointer"),!0)}(e,n))}function Yu(e,t,n,r){return Wu(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function Ju(e,t,n,r){return Wu(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Ku(e,ma.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)Ku(e,ma.create(r,s+1,s+1+a.content.size),"pointer");else{if(!ga.isSelectable(a))continue;Ku(e,ga.create(r,s),"pointer")}return!0}}(e,n,r)}function Qu(e){return oc(e)}zu.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!ec(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Ja||!qa||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Ga||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||Cu(e,n)?n.preventDefault():Vu(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,fs(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},zu.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},zu.keypress=function(e,t){var n=t;if(!(ec(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ya&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof ma)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var Xu=Ya?"metaKey":"ctrlKey";Iu.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=Qu(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Xu]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};var a=e.posAtCoords(qu(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Zu(e,a,n,!!r)):("doubleClick"==i?Yu:Ju)(e,a.pos,a.inside,n)?n.preventDefault():Vu(e,"pointer"))};var Zu=function(){function e(t,n,r,o){var i,a,s=this;if(v(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Xu],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var u=t.state.doc.resolve(n.pos);i=u.parent,a=u.depth?u.before():0}var c=o?null:r.target,l=c?t.docView.nearestDesc(c,!0):null;this.target=l?l.dom:null;var f=t.state.selection;(0==r.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||f instanceof ga&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!$a||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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Vu(t,"pointer")}return y(e,[{key:"done",value:function(){var e=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 ru(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(qu(e))),this.allowDefault||!t?Vu(this.view,"pointer"):Gu(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Ka&&this.mightDrag&&!this.mightDrag.node.isAtom||qa&&!(this.view.state.selection instanceof ma)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ku(this.view,da.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Vu(this.view,"pointer")}}},{key:"move",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Vu(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function ec(e,t){return!!e.composing||!!(Ka&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Iu.touchdown=function(e){Qu(e),Vu(e,"pointer")},Iu.contextmenu=function(e){return Qu(e)};var tc=Ja?5e3:-1;function nc(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return oc(e)}),t))}function rc(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function oc(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(Ja&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),rc(e),t||e.docView&&e.docView.dirty){var n=tu(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}zu.compositionstart=zu.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),oc(e,!0),e.markCursor=null;else if(oc(e),$a&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}nc(e,tc)},zu.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,nc(e,20))};var ic=Ua&&Va<15||Ga&&Xa<604;function ac(e,t,n,r){var o=_u(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||jo.empty)})))return!0;if(!o)return!1;var i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Iu.copy=zu.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=ic?null:n.clipboardData,a=ju(e,r.content()),s=a.dom,u=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",u)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},zu.paste=function(e,t){var n=t;if(!e.composing||Ja){var r=ic?null:n.clipboardData;r&&ac(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ac(e,r.value,null,t):ac(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var sc=y((function e(t,n){v(this,e),this.slice=t,this.move=n})),uc=Ya?"altKey":"ctrlKey";for(var cc in Iu.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(qu(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof ga?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ga.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=e.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=e.docView&&e.dispatch(e.state.tr.setSelection(ga.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),u=ju(e,s),c=u.dom,l=u.text;n.dataTransfer.clearData(),n.dataTransfer.setData(ic?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ic||n.dataTransfer.setData("text/plain",l),e.dragging=new sc(s,!n[uc])}},Iu.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},zu.dragover=zu.dragenter=function(e,t){return t.preventDefault()},zu.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(qu(n));if(o){var i=e.state.doc.resolve(o.pos);if(i){var a=r&&r.slice;a?e.someProp("transformPasted",(function(e){a=e(a)})):a=_u(e,n.dataTransfer.getData(ic?"Text":"text/plain"),ic?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[uc]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||jo.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var u=a?function(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;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),f=!1;if(1==a)f=l.canReplace(c,c,o);else{var d=l.contentMatchAt(c).findWrapping(o.firstChild.type);f=d&&l.canReplaceWith(c,c,d[0])}if(f)return 0==u?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}(e.state.doc,i.pos,a):i.pos;null==u&&(u=i.pos);var c=e.state.tr;s&&c.deleteSelection();var l=c.mapping.map(u),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),!c.doc.eq(d)){var p=c.doc.resolve(l);if(f&&ga.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ga(p));else{var h=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach((function(e,t,n,r){return h=r})),c.setSelection(du(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}}}}}},Iu.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&ru(e)}),20))},Iu.blur=function(e,t){var n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Iu.beforeinput=function(e,t){if(qa&&Ja&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,fs(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},zu)Iu[cc]=zu[cc];function lc(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var fc=function(){function e(t,n){v(this,e),this.toDOM=t,this.spec=n||mc,this.side=this.spec.side||0}return y(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new hc(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&lc(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),dc=function(){function e(t,n){v(this,e),this.attrs=t,this.spec=n||mc}return y(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new hc(o,i,this)}},{key:"valid",value:function(e,t){return t.from<t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&lc(this.attrs,t.attrs)&&lc(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}]),e}(),pc=function(){function e(t,n){v(this,e),this.attrs=t,this.spec=n||mc}return y(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new hc(o.pos-n,i.pos-n,this)}},{key:"valid",value:function(e,t){var n,r=e.content.findIndex(t.from),o=r.index,i=r.offset;return i==t.from&&!(n=e.child(o)).isText&&i+n.nodeSize==t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&lc(this.attrs,t.attrs)&&lc(this.spec,t.spec)}},{key:"destroy",value:function(){}}]),e}(),hc=function(){function e(t,n,r){v(this,e),this.from=t,this.to=n,this.type=r}return y(e,[{key:"copy",value:function(t,n){return new e(t,n,this.type)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof dc}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new fc(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new dc(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new pc(r,o))}}]),e}(),vc=[],mc={},yc=function(){function e(t,n){v(this,e),this.local=t.length?t:vc,this.children=n.length?n:vc}return y(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){var u=this.children[s]+1;this.children[s+2].findInner(e-u,t-u,n,r+u,o)}}},{key:"map",value:function(e,t,n){return this==gc||0==e.maps.length?this:this.mapInner(e,t,0,0,n||mc)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,s=0;s<this.local.length;s++){var u=this.local[s].map(t,r,o);u&&u.type.valid(n,u)?(a||(a=[])).push(u):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,a){for(var s=e.slice(),u=function(e,t,n,r){for(var a=0;a<s.length;a+=3){var u=s[a+1],c=void 0;if(!(u<0||e>u+i)){var l=s[a]+i;t>=l?s[a+1]=e<=l?-2:-1:n>=o&&(c=r-n-(t-e))&&(s[a]+=c,s[a+1]+=c)}}},c=0;c<n.maps.length;c++)n.maps[c].forEach(u);for(var l=!1,f=0;f<s.length;f+=3)if(s[f+1]<0){if(-2==s[f+1]){l=!0,s[f+1]=-1;continue}var d=n.map(e[f]+i),p=d-o;if(p<0||p>=r.content.size){l=!0;continue}var h=n.map(e[f+1]+i,-1)-o,v=r.content.findIndex(p),m=v.index,y=v.offset,g=r.maybeChild(m);if(g&&y==p&&y+g.nodeSize==h){var b=s[f+2].mapInner(n,g,d+1,e[f]+i+1,a);b!=gc?(s[f]=p,s[f+1]=h,s[f+2]=b):(s[f+1]=-2,l=!0)}else l=!0}if(l){var k=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;i<e.local.length;i++){var u=e.local[i].map(r,o,t);u?n.push(u):a.onRemove&&a.onRemove(e.local[i].spec)}for(var c=0;c<e.children.length;c+=3)s(e.children[c+2],e.children[c]+t+1)}for(var u=0;u<e.length;u+=3)-1==e[u+1]&&s(e[u+2],t[u]+i+1);return n}(s,e,t,n,o,i,a),w=Oc(k,r,0,a);t=w.local;for(var x=0;x<s.length;x+=3)s[x+1]<0&&(s.splice(x,3),x-=3);for(var O=0,E=0;O<w.children.length;O+=3){for(var D=w.children[O];E<s.length&&s[E]<D;)E+=3;s.splice(E,0,w.children[O],w.children[O+1],w.children[O+2])}}return new yc(t.sort(Ec),s)}(this.children,a||[],t,n,r,o,i):a?new e(a.sort(Ec),vc):gc}},{key:"add",value:function(t,n){return n.length?this==gc?e.create(t,n):this.addInner(t,n,0):this}},{key:"addInner",value:function(t,n,r){var o,i=this,a=0;t.forEach((function(e,t){var s,u=t+r;if(s=wc(n,e,u)){for(o||(o=i.children.slice());a<o.length&&o[a]<t;)a+=3;o[a]==t?o[a+2]=o[a+2].addInner(e,s,u+1):o.splice(a,0,t,t+e.nodeSize,Oc(s,e,u+1,mc)),a+=3}}));for(var s=kc(a?xc(n):n,-r),u=0;u<s.length;u++)s[u].type.valid(t,s[u])||s.splice(u--,1);return new e(s.length?this.local.concat(s).sort(Ec):this.local,o||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==gc?this:this.removeInner(e,0)}},{key:"removeInner",value:function(t,n){for(var r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var a,s=void 0,u=r[i]+n,c=r[i+1]+n,l=0;l<t.length;l++)(a=t[l])&&a.from>u&&a.to<c&&(t[l]=null,(s||(s=[])).push(a));if(s){r==this.children&&(r=this.children.slice());var f=r[i+2].removeInner(s,u+1);f!=gc?r[i+2]=f:(r.splice(i,3),i-=3)}}if(o.length)for(var d,p=0;p<t.length;p++)if(d=t[p])for(var h=0;h<o.length;h++)o[h].eq(d,n)&&(o==this.local&&(o=this.local.slice()),o.splice(h--,1));return r==this.children&&o==this.local?this:o.length||r.length?new e(o,r):gc}},{key:"forChild",value:function(t,n){if(this==gc)return this;if(n.isLeaf)return e.empty;for(var r,o,i=0;i<this.children.length;i+=3)if(this.children[i]>=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,s=a+n.content.size,u=0;u<this.local.length;u++){var c=this.local[u];if(c.from<s&&c.to>a&&c.type instanceof dc){var l=Math.max(a,c.from)-a,f=Math.min(s,c.to)-a;l<f&&(o||(o=[])).push(c.copy(l,f))}}if(o){var d=new e(o.sort(Ec),vc);return r?new bc([d,r]):d}return r||gc}},{key:"eq",value:function(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}},{key:"locals",value:function(e){return Dc(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==gc)return vc;if(e.inlineContent||!this.local.some(dc.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof dc||t.push(this.local[n]);return t}}],[{key:"create",value:function(e,t){return t.length?Oc(t,e,0,mc):gc}}]),e}();yc.empty=new yc([],[]),yc.removeOverlap=Dc;var gc=yc.empty,bc=function(){function e(t){v(this,e),this.members=t}return y(e,[{key:"map",value:function(t,n){var r=this.members.map((function(e){return e.map(t,n,mc)}));return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return yc.empty;for(var r=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(t,n);i!=gc&&(i instanceof e?r=r.concat(i.members):r.push(i))}return e.from(r)}},{key:"eq",value:function(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}},{key:"locals",value:function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?Dc(n?t:t.sort(Ec)):vc}}],[{key:"from",value:function(t){switch(t.length){case 0:return gc;case 1:return t[0];default:return new e(t)}}}]),e}();function kc(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new hc(o.from+t,o.to+t,o.type))}return n}function wc(e,t,n){if(t.isLeaf)return null;for(var r,o=n+t.nodeSize,i=null,a=0;a<e.length;a++)(r=e[a])&&r.from>n&&r.to<o&&((i||(i=[])).push(r),e[a]=null);return i}function xc(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Oc(e,t,n,r){var o=[],i=!1;t.forEach((function(t,a){var s=wc(e,t,a+n);if(s){i=!0;var u=Oc(s,t,n+a+1,r);u!=gc&&o.push(a,a+t.nodeSize,u)}}));for(var a=kc(i?xc(e):e,-n).sort(Ec),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new yc(a,o):gc}function Ec(e,t){return e.from-t.from||e.to-t.to}function Dc(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Sc(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Sc(t,o+1,i.copy(r.to,i.to)))}}return t}function Sc(e,t,n){for(;t<e.length&&Ec(n,e[t])>0;)t++;e.splice(t,0,n)}function Cc(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=gc&&t.push(r)})),e.cursorWrapper&&t.push(yc.create(e.state.doc,[e.cursorWrapper.deco])),bc.from(t)}var jc={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_c=Ua&&Va<=11,Ac=function(){function e(){v(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return y(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}]),e}(),Nc=function(){function e(t,n){var r=this;v(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ac,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;t<e.length;t++)r.queue.push(e[t]);Ua&&Va<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?r.flushSoon():r.flush()})),_c&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return y(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.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.observe(this.view.dom,jc),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout((function(){return e.flush()}),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return e.suppressingSelectionUpdates=!1}),50)}},{key:"onSelectionChange",value:function(){if(pu(this.view)){if(this.suppressingSelectionUpdates)return ru(this.view);if(Ua&&Va<=11&&!this.view.state.selection.empty){var e=this.view.domSelection();if(e.focusNode&&rs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelection())}},{key:"ignoreSelectionChange",value:function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}},{key:"flush",value:function(){if(this.view.docView&&!(this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&pu(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s<e.length;s++){var u=this.registerMutation(e[s],a);u&&(r=r<0?u.from:Math.min(u.from,r),o=o<0?u.to:Math.max(u.to,o),u.typeOver&&(i=!0))}if($a&&a.length>1){var c=a.filter((function(e){return"BR"==e.nodeName}));if(2==c.length){var l=c[0],f=c[1];l.parentNode&&l.parentNode.parentNode==f.parentNode?f.remove():l.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(Tc)return;Tc=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ru(this.view),this.currentSelection.set(t))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var r=0;r<e.addedNodes.length;r++)t.push(e.addedNodes[r]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var o=e.previousSibling,i=e.nextSibling;if(Ua&&Va<=11&&e.addedNodes.length)for(var a=0;a<e.addedNodes.length;a++){var s=e.addedNodes[a],u=s.previousSibling,c=s.nextSibling;(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(o=u),(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(i=c)}var l=o&&o.parentNode==e.target?Za(o)+1:0,f=n.localPosFromDOM(e.target,l,-1),d=i&&i.parentNode==e.target?Za(i):e.target.childNodes.length;return{from:f,to:n.localPosFromDOM(e.target,d,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}]),e}(),Tc=!1;function Mc(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Ka&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||Ka&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Fc(e,t,n,r,o){if(t<0){var i=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,a=tu(e,i);if(a&&!e.state.selection.eq(a)){var s=e.state.tr.setSelection(a);"pointer"==i?s.setMeta("pointer",!0):"key"==i&&s.scrollIntoView(),e.dispatch(s)}}else{var u=e.state.doc.resolve(t),c=u.sharedDepth(n);t=u.before(c+1),n=e.state.doc.resolve(n).after(c+1);var l=e.state.selection,f=function(e,t,n){var r,o=e.docView.parseRange(t,n),i=o.node,a=o.fromOffset,s=o.toOffset,u=o.from,c=o.to,l=e.domSelection(),f=l.anchorNode;if(f&&e.dom.contains(1==f.nodeType?f:f.parentNode)&&(r=[{node:f,offset:l.anchorOffset}],ls(l)||r.push({node:l.focusNode,offset:l.focusOffset})),qa&&8===e.input.lastKeyCode)for(var d=s;d>a;d--){var p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){s=d;break}if(!h||h.size)break}var v=e.state.doc,m=e.someProp("domParser")||di.fromSchema(e.state.schema),y=v.resolve(u),g=null,b=m.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Mc,context:y});if(r&&null!=r[0].pos){var k=r[0].pos,w=r[1]&&r[1].pos;null==w&&(w=k),g={anchor:k+u,head:w+u}}return{doc:b,sel:g,from:u,to:c}}(e,t,n);if(qa&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from){var d=e.cursorWrapper.deco.type.toDOM.nextSibling,p=d&&d.nodeValue?d.nodeValue.length:1;f.sel={anchor:f.sel.anchor+p,head:f.sel.anchor+p}}var h,v,m=e.state.doc,y=m.slice(f.from,f.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(h=e.state.selection.to,v="end"):(h=e.state.selection.from,v="start"),e.input.lastKeyCode=null;var g=function(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),s=a.a,u=a.b;if("end"==o){r-=s+Math.max(0,i-Math.min(s,u))-i}if(s<i&&e.size<t.size){u=(i-=r<=i&&r>=s?i-r:0)+(u-s),s=i}else if(u<i){s=(i-=r<=i&&r>=u?i-r:0)+(s-u),u=i}return{start:i,endA:s,endB:u}}(y.content,f.doc.content,f.from,h,v);if((Ga&&e.input.lastIOSEnter>Date.now()-225||Ja)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!g||g.endA>=g.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,fs(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!g){if(!(r&&l instanceof ma&&!l.empty&&l.$head.sameParent(l.$anchor))||e.composing||f.sel&&f.sel.anchor!=f.sel.head){if(f.sel){var b=Rc(e,e.state.doc,f.sel);b&&!b.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(b))}return}g={start:l.from,endA:l.to,endB:l.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof ma&&(g.start>e.state.selection.from&&g.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?g.start=e.state.selection.from:g.endA<e.state.selection.to&&g.endA>=e.state.selection.to-2&&e.state.selection.to<=f.to&&(g.endB+=e.state.selection.to-g.endA,g.endA=e.state.selection.to)),Ua&&Va<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>f.from&&" \xa0"==f.doc.textBetween(g.start-f.from-1,g.start-f.from+1)&&(g.start--,g.endA--,g.endB--);var k,w=f.doc.resolveNoCache(g.start-f.from),x=f.doc.resolveNoCache(g.endB-f.from),O=m.resolve(g.start),E=w.sameParent(x)&&w.parent.inlineContent&&O.end()>=g.endA;if((Ga&&e.input.lastIOSEnter>Date.now()-225&&(!E||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!E&&w.pos<f.doc.content.size&&(k=da.findFrom(f.doc.resolve(w.pos+1),1,!0))&&k.head==x.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,fs(13,"Enter"))})))e.input.lastIOSEnter=0;else if(e.state.selection.anchor>g.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Pc(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var a=e.resolve(Pc(i,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Pc(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(m,g.start,g.endA,w,x)&&e.someProp("handleKeyDown",(function(t){return t(e,fs(8,"Backspace"))})))Ja&&qa&&e.domObserver.suppressSelectionUpdates();else{qa&&Ja&&g.endB==g.start&&(e.input.lastAndroidDelete=Date.now()),Ja&&!E&&w.start()!=x.start()&&0==x.parentOffset&&w.depth==x.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==g.endA&&(g.endB-=2,x=f.doc.resolveNoCache(g.endB-f.from),setTimeout((function(){e.someProp("handleKeyDown",(function(t){return t(e,fs(13,"Enter"))}))}),20));var D,S,C,j=g.start,_=g.endA;if(E)if(w.pos==x.pos)Ua&&Va<=11&&0==w.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return ru(e)}),20)),D=e.state.tr.delete(j,_),S=m.resolve(g.start).marksAcross(m.resolve(g.endA));else if(g.endA==g.endB&&(C=function(e,t){for(var n,r,o,i=e.firstChild.marks,a=t.firstChild.marks,s=i,u=a,c=0;c<a.length;c++)s=a[c].removeFromSet(s);for(var l=0;l<i.length;l++)u=i[l].removeFromSet(u);if(1==s.length&&0==u.length)r=s[0],n="add",o=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=s.length||1!=u.length)return null;r=u[0],n="remove",o=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var f=[],d=0;d<t.childCount;d++)f.push(o(t.child(d)));if(xo.from(f).eq(e))return{mark:r,type:n}}(w.parent.content.cut(w.parentOffset,x.parentOffset),O.parent.content.cut(O.parentOffset,g.endA-O.start()))))D=e.state.tr,"add"==C.type?D.addMark(j,_,C.mark):D.removeMark(j,_,C.mark);else if(w.parent.child(w.index()).isText&&w.index()==x.index()-(x.textOffset?0:1)){var A=w.parent.textBetween(w.parentOffset,x.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,j,_,A)})))return;D=e.state.tr.insertText(A,j,_)}if(D||(D=e.state.tr.replace(j,_,f.doc.slice(g.start-f.from,g.endB-f.from))),f.sel){var N=Rc(e,D.doc,f.sel);N&&!(qa&&Ja&&e.composing&&N.empty&&(g.start!=g.endB||e.input.lastAndroidDelete<Date.now()-100)&&(N.head==j||N.head==D.mapping.map(_)-1)||Ua&&N.empty&&N.head==j)&&D.setSelection(N)}S&&D.ensureMarks(S),e.dispatch(D.scrollIntoView())}}}}function Rc(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:du(e,t.resolve(n.anchor),t.resolve(n.head))}function Pc(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}var Bc=function(){function e(t,n){var r=this;v(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Uu,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Vc),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=zc(this),Ic(this),this.nodeViews=Uc(this),this.docView=Is(this.state.doc,Lc(this),Cc(this),this.dom,this),this.domObserver=new Nc(this,(function(e,t,n,o){return Fc(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(t){var n=Iu[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||Hu(e,t)||!e.editable&&t.type in zu||n(e,t)})};for(var n in Iu)t(n);Ka&&e.dom.addEventListener("input",(function(){return null})),$u(e)}(this),this.updatePluginViews()}return y(e,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$u(this),this._props=e,e.plugins&&(e.plugins.forEach(Vc),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}},{key:"updateStateInner",value:function(e,t){var n=this,r=this.state,o=!1,i=!1;if(e.storedMarks&&this.composing&&(rc(this),i=!0),this.state=e,t){var a=Uc(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,o=!0),$u(this)}this.editable=zc(this),Ic(this);var s=Cc(this),u=Lc(this),c=t?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=o||!this.docView.matchesNode(e.doc,u,s);!l&&e.selection.eq(r.selection)||(i=!0);var f="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a<Math.min(innerHeight,r.bottom);a+=5){var s=e.root.elementFromPoint(i,a);if(s&&s!=e.dom&&e.dom.contains(s)){var u=s.getBoundingClientRect();if(u.top>=o-20){t=s,n=u.top;break}}}return{refDOM:t,refTop:n,stack:ms(e.dom)}}(this);if(i){this.domObserver.stop();var d=l&&(Ua||qa)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(l){var p=qa?this.trackWrites=this.domSelection().focusNode:null;!o&&this.docView.update(e.doc,u,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Is(e.doc,u,s,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return rs(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ru(this,d):(lu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==c)this.dom.scrollTop=0;else if("to selection"==c){var h=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(function(e){return e(n)})));else if(e.selection instanceof ga){var v=this.docView.domAfterPos(e.selection.from);1==v.nodeType&&vs(this,v.getBoundingClientRect(),h)}else vs(this,this.coordsAtPos(e.selection.head,1),h)}else f&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;ys(r,0==o?0:o-n)}(f)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var o=this.directPlugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var a=this.state.plugins[i];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}}},{key:"someProp",value:function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(var o=0;o<this.directPlugins.length;o++){var i=this.directPlugins[o].props[e];if(null!=i&&(n=t?t(i):i))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var u=a[s].props[e];if(null!=u&&(n=t?t(u):u))return n}}},{key:"hasFocus",value:function(){return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(gs)return e.focus(gs);var t=ms(e);e.focus(null==gs?{get preventScroll(){return gs={preventScroll:!0},!0}}:void 0),gs||(gs=!1,ys(t,0))}(this.dom),ru(this),this.domObserver.start()}},{key:"root",get:function(){var e=this,t=this._root;if(null==t)for(var n=function(t){if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return t.ownerDocument.getSelection()}),{v:e._root=t}},r=this.dom.parentNode;r;r=r.parentNode){var o=n(r);if("object"===typeof o)return o.v}return t||document}},{key:"posAtCoords",value:function(e){return xs(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Ds(this,e,t)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return Ms(this,t||this.state,e)}},{key:"destroy",value:function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Cc(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(e){return function(e,t){Hu(e,t)||!Iu[t.type]||!e.editable&&t.type in zu||Iu[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),e}();function Lc(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r&&(t.class+=" "+n[r]),"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),[hc.node(0,e.state.doc.content.size,t)]}function Ic(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:hc.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function zc(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Uc(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Vc(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var $c={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Hc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},qc="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Wc="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Kc="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Gc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Yc="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Jc=qc&&(Gc||+qc[1]<57)||Kc&&Gc,Qc=0;Qc<10;Qc++)$c[48+Qc]=$c[96+Qc]=String(Qc);for(Qc=1;Qc<=24;Qc++)$c[Qc+111]="F"+Qc;for(Qc=65;Qc<=90;Qc++)$c[Qc]=String.fromCharCode(Qc+32),Hc[Qc]=String.fromCharCode(Qc);for(var Xc in $c)Hc.hasOwnProperty(Xc)||(Hc[Xc]=$c[Xc]);var Zc="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function el(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s<i.length-1;s++){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);Zc?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function tl(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function nl(e){var t=function(e){var t=Object.create(null);for(var n in e)t[el(n)]=e[n];return t}(e);return function(e,n){var r,o=function(e){var t=!(Jc&&(e.ctrlKey||e.altKey||e.metaKey)||(Wc||Yc)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Hc:$c)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=1==o.length&&" "!=o,a=t[tl(o,n,!i)];if(a&&a(e.state,e.dispatch,e))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=$c[n.keyCode])&&r!=o){var s=t[tl(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){var u=t[tl(o,n,!0)];if(u&&u(e.state,e.dispatch,e))return!0}return!1}}var rl=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)},ol=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=sl(r);if(!o){var i=r.blockRange(),a=i&&zi(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&gl(e,o,t))return!0;if(0==r.parent.content.size&&(il(s,"end")||ga.isSelectable(s))){var u=Xi(e.doc,r.before(),r.after(),jo.empty);if(u&&u.slice.size<u.to-u.from){if(t){var c=e.tr.step(u);c.setSelection(il(s,"end")?da.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):ga.create(c.doc,o.pos-s.nodeSize)),t(c.scrollIntoView())}return!0}}return!(!s.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function il(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var al=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;i=sl(o)}var a=i&&i.nodeBefore;return!(!a||!ga.isSelectable(a))&&(t&&t(e.tr.setSelection(ga.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function sl(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}var ul=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=ll(r);if(!o)return!1;var i=o.nodeAfter;if(gl(e,o,t))return!0;if(0==r.parent.content.size&&(il(i,"start")||ga.isSelectable(i))){var a=Xi(e.doc,r.before(),r.after(),jo.empty);if(a&&a.slice.size<a.to-a.from){if(t){var s=e.tr.step(a);s.setSelection(il(i,"start")?da.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):ga.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},cl=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;i=ll(o)}var a=i&&i.nodeAfter;return!(!a||!ga.isSelectable(a))&&(t&&t(e.tr.setSelection(ga.create(e.doc,i.pos)).scrollIntoView()),!0)};function ll(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var fl=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=r.blockRange(o),a=i&&zi(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},dl=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function pl(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var hl=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var i=r.node(-1),a=r.indexAfter(-1),s=pl(i.contentMatchAt(a));if(!s||!i.canReplaceWith(a,a,s))return!1;if(t){var u=r.after(),c=e.tr.replaceWith(u,u,s.createAndFill());c.setSelection(da.near(c.doc.resolve(u),1)),t(c.scrollIntoView())}return!0},vl=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof ka||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=pl(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(a,i.createAndFill());s.setSelection(ma.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},ml=function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(Ki(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&zi(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},yl=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof ga&&e.selection.node.isBlock)return!(!r.parentOffset||!Ki(e.doc,r.pos))&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof ma||e.selection instanceof ka)&&a.deleteSelection();var s=0==r.depth?null:pl(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=i&&s?[{type:s}]:void 0,c=Ki(a.doc,a.mapping.map(r.pos),1,u);if(u||c||!Ki(a.doc,a.mapping.map(r.pos),1,s?[{type:s}]:void 0)||(s&&(u=[{type:s}]),c=!0),c&&(a.split(a.mapping.map(r.pos),1,u),!i&&!r.parentOffset&&r.parent.type!=s)){var l=a.mapping.map(r.before()),f=a.doc.resolve(l);s&&r.node(-1).canReplaceWith(f.index(),f.index()+1,s)&&a.setNodeMarkup(a.mapping.map(r.before()),s)}t(a.scrollIntoView())}return!0};function gl(e,t,n){var r,o,i=t.nodeBefore,a=t.nodeAfter;if(i.type.spec.isolating||a.type.spec.isolating)return!1;if(function(e,t,n){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Yi(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var u=t.pos+a.nodeSize,c=xo.empty,l=r.length-1;l>=0;l--)c=xo.from(r[l].create(null,c));c=xo.from(i.copy(c));var f=e.tr.step(new Bi(t.pos-1,u,t.pos,u,new jo(c,1,0),r.length,!0)),d=u+2*r.length;Yi(f.doc,d)&&f.join(d),n(f.scrollIntoView())}return!0}var p=da.findFrom(t,1),h=p&&p.$from.blockRange(p.$to),v=h&&zi(h);if(null!=v&&v>=t.depth)return n&&n(e.tr.lift(h,v).scrollIntoView()),!0;if(s&&il(a,"start",!0)&&il(i,"end")){for(var m=i,y=[];y.push(m),!m.isTextblock;)m=m.lastChild;for(var g=a,b=1;!g.isTextblock;g=g.firstChild)b++;if(m.canReplace(m.childCount,m.childCount,g.content)){if(n){for(var k=xo.empty,w=y.length-1;w>=0;w--)k=xo.from(y[w].copy(k));n(e.tr.step(new Bi(t.pos-y.length,t.pos+a.nodeSize,t.pos+b,t.pos+a.nodeSize-b,new jo(k,y.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function bl(e){return function(t,n){for(var r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(ma.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var kl=bl(-1),wl=bl(1);function xl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),u=s&&Ui(s,e,t);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}function Ol(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(r,o){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var i=n.doc.resolve(o),a=i.index();s=i.parent.canReplaceWith(a,a+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}}function El(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var Dl=El(rl,ol,al),Sl=El(rl,ul,cl),Cl={Enter:El(dl,vl,ml,yl),"Mod-Enter":hl,Backspace:Dl,"Mod-Backspace":Dl,"Shift-Backspace":Dl,Delete:Sl,"Mod-Delete":Sl,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new ka(e.doc))),!0}},jl={"Ctrl-h":Cl.Backspace,"Alt-Backspace":Cl["Mod-Backspace"],"Ctrl-d":Cl.Delete,"Ctrl-Alt-Backspace":Cl["Mod-Delete"],"Alt-Delete":Cl["Mod-Delete"],"Alt-d":Cl["Mod-Delete"],"Ctrl-a":kl,"Ctrl-e":wl};for(var _l in Cl)jl[_l]=Cl[_l];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function Al(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),u=!1,c=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;var l=n.doc.resolve(s.start-2);c=new Ho(l,l,s.depth),s.endIndex<s.parent.childCount&&(s=new Ho(i,n.doc.resolve(a.end(s.depth)),s.depth)),u=!0}var f=Ui(c,e,t,s);return!!f&&(r&&r(Nl(n.tr,s,f,u,e).scrollIntoView()),!0)}}function Nl(e,t,n,r,o){for(var i=xo.empty,a=n.length-1;a>=0;a--)i=xo.from(n[a].type.create(n[a].attrs,i));e.step(new Bi(t.start-(r?2:0),t.end,t.start,t.end,new jo(i,0,0),n.length,!0));for(var s=0,u=0;u<n.length;u++)n[u].type==o&&(s=u+1);for(var c=n.length-s,l=t.start+n.length-(r?2:0),f=t.parent,d=t.startIndex,p=t.endIndex,h=!0;d<p;d++,h=!1)!h&&Ki(e.doc,l,c)&&(e.split(l,c),l+=2*c),l+=f.child(d).nodeSize;return e}function Tl(e){return function(t,n){var r=t.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(t){return t.childCount>0&&t.firstChild.type==e}));return!!a&&(!n||(o.node(a.depth-1).type==e?function(e,t,n,r){var o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new Bi(i-1,a,i,a,new jo(xo.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ho(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));return t(o.lift(r,zi(r)).scrollIntoView()),!0}(t,n,e,a):function(e,t,n){for(var r=e.tr,o=n.parent,i=n.end,a=n.endIndex-1,s=n.startIndex;a>s;a--)i-=o.child(a).nodeSize,r.delete(i-1,i+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,f=n.endIndex==o.childCount,d=u.node(-1),p=u.index(-1);if(!d.canReplace(p+(l?0:1),p+1,c.content.append(f?xo.empty:xo.from(o))))return!1;var h=u.pos,v=h+c.nodeSize;return r.step(new Bi(h-(l?1:0),v+(f?1:0),h+1,v-1,new jo((l?xo.empty:xo.from(o.copy(xo.empty))).append(f?xo.empty:xo.from(o.copy(xo.empty))),l?0:1,f?0:1),l?0:1)),t(r.scrollIntoView()),!0}(t,n,a)))}}function Ml(e){var t=e.state,n=e.transaction,r=n.selection,i=n.doc,a=n.storedMarks;return Object(o.a)(Object(o.a)({},t),{},{apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}})}var Fl=function(){function e(t){v(this,e),this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}return y(e,[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var e=this,t=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,a=this.buildProps(i);return Object.fromEntries(Object.entries(t).map((function(t){var n=Object(l.a)(t,2),r=n[0],s=n[1];return[r,function(){var t=s.apply(void 0,arguments)(a);return i.getMeta("preventDispatch")||e.hasCustomState||o.dispatch(i),t}]})))}},{key:"chain",get:function(){var e=this;return function(){return e.createChain()}}},{key:"can",get:function(){var e=this;return function(){return e.createCan()}}},{key:"createChain",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,i=this.editor,a=this.state,s=i.view,u=[],c=!!e,f=e||a.tr,d=function(){return c||!n||f.getMeta("preventDispatch")||t.hasCustomState||s.dispatch(f),u.every((function(e){return!0===e}))},p=Object(o.a)(Object(o.a)({},Object.fromEntries(Object.entries(r).map((function(e){var r=Object(l.a)(e,2),o=r[0],i=r[1];return[o,function(){var e=t.buildProps(f,n),r=i.apply(void 0,arguments)(e);return u.push(r),p}]})))),{},{run:d});return p}},{key:"createCan",value:function(e){var t=this,n=this.rawCommands,r=this.state,i=void 0,a=e||r.tr,s=this.buildProps(a,i),u=Object.fromEntries(Object.entries(n).map((function(e){var t=Object(l.a)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(Object(o.a)(Object(o.a)({},s),{},{dispatch:i}))}]})));return Object(o.a)(Object(o.a)({},u),{},{chain:function(){return t.createChain(a,i)}})}},{key:"buildProps",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view;i.storedMarks&&e.setStoredMarks(i.storedMarks);var s={tr:e,editor:o,view:a,state:Ml({state:i,transaction:e}),dispatch:n?function(){}:void 0,chain:function(){return t.createChain(e)},can:function(){return t.createCan(e)},get commands(){return Object.fromEntries(Object.entries(r).map((function(e){var t=Object(l.a)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(s)}]})))}};return s}}]),e}(),Rl=function(){function e(){v(this,e),this.callbacks={}}return y(e,[{key:"on",value:function(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=this.callbacks[e];return i&&i.forEach((function(e){return e.apply(t,r)})),this}},{key:"off",value:function(e,t){var n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((function(e){return e!==t})):delete this.callbacks[e]),this}},{key:"removeAllListeners",value:function(){this.callbacks={}}}]),e}();function Pl(e,t,n){return void 0===e.config[t]&&e.parent?Pl(e.parent,t,n):"function"===typeof e.config[t]?e.config[t].bind(Object(o.a)(Object(o.a)({},n),{},{parent:e.parent?Pl(e.parent,t,n):null})):e.config[t]}function Bl(e){return{baseExtensions:e.filter((function(e){return"extension"===e.type})),nodeExtensions:e.filter((function(e){return"node"===e.type})),markExtensions:e.filter((function(e){return"mark"===e.type}))}}function Ll(e){var t=[],n=Bl(e),r=n.nodeExtensions,i=n.markExtensions,a=[].concat(Object(J.a)(r),Object(J.a)(i)),s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((function(e){var n=Pl(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});n&&n().forEach((function(e){e.types.forEach((function(n){Object.entries(e.attributes).forEach((function(e){var r=Object(l.a)(e,2),i=r[0],a=r[1];t.push({type:n,name:i,attribute:Object(o.a)(Object(o.a)({},s),a)})}))}))}))})),a.forEach((function(e){var n={name:e.name,options:e.options,storage:e.storage},r=Pl(e,"addAttributes",n);if(r){var i=r();Object.entries(i).forEach((function(n){var r=Object(l.a)(n,2),i=r[0],a=r[1],u=Object(o.a)(Object(o.a)({},s),a);a.isRequired&&void 0===a.default&&delete u.default,t.push({type:e.name,name:i,attribute:u})}))}})),t}function Il(e,t){if("string"===typeof e){if(!t.nodes[e])throw Error("There is no node type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.nodes[e]}return e}function zl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return!!e})).reduce((function(e,t){var n=Object(o.a)({},e);return Object.entries(t).forEach((function(e){var t=Object(l.a)(e,2),r=t[0],o=t[1];n[r]?n[r]="class"===r?[n[r],o].join(" "):"style"===r?[n[r],o].join("; "):o:n[r]=o})),n}),{})}function Ul(e,t){return t.filter((function(e){return e.attribute.rendered})).map((function(t){return t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:Object(Q.a)({},t.name,e.attrs[t.name])})).reduce((function(e,t){return zl(e,t)}),{})}function Vl(e){return"function"===typeof e}function $l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Vl(e)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t?e.bind(t).apply(void 0,r):e.apply(void 0,r)}return e}function Hl(e,t){return e.style?e:Object(o.a)(Object(o.a)({},e),{},{getAttrs:function(n){var r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;var i=t.reduce((function(e,t){var r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!==typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null===r||void 0===r?e:Object(o.a)(Object(o.a)({},e),{},Object(Q.a)({},t.name,r))}),{});return Object(o.a)(Object(o.a)({},r),i)}})}function ql(e){return Object.fromEntries(Object.entries(e).filter((function(e){var t=Object(l.a)(e,2),n=t[0],r=t[1];return("attrs"!==n||!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}(r))&&(null!==r&&void 0!==r)})))}function Wl(e){var t,n=Ll(e),r=Bl(e),i=r.nodeExtensions,a=r.markExtensions,s=null===(t=i.find((function(e){return Pl(e,"topNode")})))||void 0===t?void 0:t.name,u=Object.fromEntries(i.map((function(t){var r=n.filter((function(e){return e.type===t.name})),i={name:t.name,options:t.options,storage:t.storage},a=e.reduce((function(e,n){var r=Pl(n,"extendNodeSchema",i);return Object(o.a)(Object(o.a)({},e),r?r(t):{})}),{}),s=ql(Object(o.a)(Object(o.a)({},a),{},{content:$l(Pl(t,"content",i)),marks:$l(Pl(t,"marks",i)),group:$l(Pl(t,"group",i)),inline:$l(Pl(t,"inline",i)),atom:$l(Pl(t,"atom",i)),selectable:$l(Pl(t,"selectable",i)),draggable:$l(Pl(t,"draggable",i)),code:$l(Pl(t,"code",i)),defining:$l(Pl(t,"defining",i)),isolating:$l(Pl(t,"isolating",i)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),u=$l(Pl(t,"parseHTML",i));u&&(s.parseDOM=u.map((function(e){return Hl(e,r)})));var c=Pl(t,"renderHTML",i);c&&(s.toDOM=function(e){return c({node:e,HTMLAttributes:Ul(e,r)})});var l=Pl(t,"renderText",i);return l&&(s.toText=l),[t.name,s]}))),c=Object.fromEntries(a.map((function(t){var r=n.filter((function(e){return e.type===t.name})),i={name:t.name,options:t.options,storage:t.storage},a=e.reduce((function(e,n){var r=Pl(n,"extendMarkSchema",i);return Object(o.a)(Object(o.a)({},e),r?r(t):{})}),{}),s=ql(Object(o.a)(Object(o.a)({},a),{},{inclusive:$l(Pl(t,"inclusive",i)),excludes:$l(Pl(t,"excludes",i)),group:$l(Pl(t,"group",i)),spanning:$l(Pl(t,"spanning",i)),code:$l(Pl(t,"code",i)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),u=$l(Pl(t,"parseHTML",i));u&&(s.parseDOM=u.map((function(e){return Hl(e,r)})));var c=Pl(t,"renderHTML",i);return c&&(s.toDOM=function(e){return c({mark:e,HTMLAttributes:Ul(e,r)})}),[t.name,s]})));return new li({topNode:s,nodes:u,marks:c})}function Kl(e,t){return t.nodes[e]||t.marks[e]||null}function Gl(e,t){return Array.isArray(t)?t.some((function(t){return("string"===typeof t?t:t.name)===e.name})):t}function Yl(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Jl=y((function e(t){v(this,e),this.find=t.find,this.handler=t.handler}));function Ql(e){var t,n=e.editor,r=e.from,o=e.to,i=e.text,a=e.rules,s=e.plugin,u=n.view;if(u.composing)return!1;var c=u.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((function(e){return e.type.spec.code}))))return!1;var l=!1,f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,(function(t,r,o,i){var a,s,u;n+=(null===(s=(a=t.type.spec).toText)||void 0===s?void 0:s.call(a,{node:t,pos:r,parent:o,index:i}))||(null===(u=e.nodeBefore)||void 0===u?void 0:u.text)||"%leaf%"})),n}(c)+i;return a.forEach((function(e){if(!l){var t=function(e,t){if(Yl(t))return t.exec(e);var n=t(e);if(!n)return null;var r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r}(f,e.find);if(t){var a=u.state.tr,c=Ml({state:u.state,transaction:a}),d={from:r-(t[0].length-i.length),to:o},p=new Fl({editor:n,state:c}),h=p.commands,v=p.chain,m=p.can;null!==e.handler({state:c,range:d,match:t,commands:h,chain:v,can:m})&&a.steps.length&&(a.setMeta(s,{transform:a,from:r,to:o,text:i}),u.dispatch(a),l=!0)}}})),l}function Xl(e){var t=e.editor,n=e.rules,r=new Na({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,o,i,a){return Ql({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:function(e){return setTimeout((function(){var o=e.state.selection.$cursor;o&&Ql({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1}},handleKeyDown:function(e,o){if("Enter"!==o.key)return!1;var i=e.state.selection.$cursor;return!!i&&Ql({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var Zl=y((function e(t){v(this,e),this.find=t.find,this.handler=t.handler}));function ef(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=new Fl({editor:t,state:n}),s=a.commands,u=a.chain,c=a.can,l=[];return n.doc.nodesBetween(r,o,(function(e,t){if(e.isTextblock&&!e.type.spec.code){var a=Math.max(r,t),f=Math.min(o,t+e.content.size);(function(e,t){if(Yl(t))return Object(J.a)(e.matchAll(t));var n=t(e);return n?n.map((function(t){var n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(a-t,f-t,void 0,"\ufffc"),i.find).forEach((function(e){if(void 0!==e.index){var t=a+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=i.handler({state:n,range:o,match:e,commands:s,chain:u,can:c});l.push(f)}}))}})),l.every((function(e){return null!==e}))}var tf=function(){function e(t,n){var r=this;v(this,e),this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=Wl(this.extensions),this.extensions.forEach((function(e){var t;r.editor.extensionStorage[e.name]=e.storage;var n={name:e.name,options:e.options,storage:e.storage,editor:r.editor,type:Kl(e.name,r.schema)};"mark"===e.type&&((null===(t=$l(Pl(e,"keepOnSplit",n)))||void 0===t||t)&&r.splittableMarks.push(e.name));var o=Pl(e,"onBeforeCreate",n);o&&r.editor.on("beforeCreate",o);var i=Pl(e,"onCreate",n);i&&r.editor.on("create",i);var a=Pl(e,"onUpdate",n);a&&r.editor.on("update",a);var s=Pl(e,"onSelectionUpdate",n);s&&r.editor.on("selectionUpdate",s);var u=Pl(e,"onTransaction",n);u&&r.editor.on("transaction",u);var c=Pl(e,"onFocus",n);c&&r.editor.on("focus",c);var l=Pl(e,"onBlur",n);l&&r.editor.on("blur",l);var f=Pl(e,"onDestroy",n);f&&r.editor.on("destroy",f)}))}return y(e,[{key:"commands",get:function(){var e=this;return this.extensions.reduce((function(t,n){var r=Pl(n,"addCommands",{name:n.name,options:n.options,storage:n.storage,editor:e.editor,type:Kl(n.name,e.schema)});return r?Object(o.a)(Object(o.a)({},t),r()):t}),{})}},{key:"plugins",get:function(){var t=this,n=this.editor,r=e.sort(Object(J.a)(this.extensions).reverse()),o=[],i=[],a=r.map((function(e){var r={name:e.name,options:e.options,storage:e.storage,editor:n,type:Kl(e.name,t.schema)},a=[],s=Pl(e,"addKeyboardShortcuts",r);if(s){var u=function(e){return new Na({props:{handleKeyDown:nl(e)}})}(Object.fromEntries(Object.entries(s()).map((function(e){var t=Object(l.a)(e,2),r=t[0],o=t[1];return[r,function(){return o({editor:n})}]}))));a.push(u)}var c=Pl(e,"addInputRules",r);Gl(e,n.options.enableInputRules)&&c&&o.push.apply(o,Object(J.a)(c()));var f=Pl(e,"addPasteRules",r);Gl(e,n.options.enablePasteRules)&&f&&i.push.apply(i,Object(J.a)(f()));var d=Pl(e,"addProseMirrorPlugins",r);if(d){var p=d();a.push.apply(a,Object(J.a)(p))}return a})).flat();return[Xl({editor:n,rules:o})].concat(Object(J.a)(function(e){var t=e.editor,n=e.rules,r=null,o=!1,i=!1;return n.map((function(e){return new Na({view:function(e){var t=function(t){var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy:function(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:function(e){return i=r===e.dom.parentElement,!1},paste:function(e,t){var n,r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null===r||void 0===r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(n,r,a){var s=n[0],u="paste"===s.getMeta("uiEvent")&&!o,c="drop"===s.getMeta("uiEvent")&&!i;if(u||c){var l=r.doc.content.findDiffStart(a.doc.content),f=r.doc.content.findDiffEnd(a.doc.content);if("number"===typeof l&&f&&l!==f.b){var d=a.tr,p=Ml({state:a,transaction:d});if(ef({editor:t,state:p,from:Math.max(l-1,0),to:f.b,rule:e})&&d.steps.length)return d}}}})}))}({editor:n,rules:i})),Object(J.a)(a))}},{key:"attributes",get:function(){return Ll(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=Bl(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(e){return!!Pl(e,"addNodeView")})).map((function(n){var r=e.attributes.filter((function(e){return e.type===n.name})),o={name:n.name,options:n.options,storage:n.storage,editor:t,type:Il(n.name,e.schema)},i=Pl(n,"addNodeView",o);if(!i)return[];return[n.name,function(e,o,a,s){var u=Ul(e,r);return i()({editor:t,node:e,getPos:a,decorations:s,HTMLAttributes:u,extension:n})}]})))}}],[{key:"resolve",value:function(t){var n=e.sort(e.flatten(t)),r=function(e){var t=e.filter((function(t,n){return e.indexOf(t)!==n}));return Object(J.a)(new Set(t))}(n.map((function(e){return e.name})));return r.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"]. This can lead to issues.")),n}},{key:"flatten",value:function(e){var t=this;return e.map((function(e){var n=Pl(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e].concat(Object(J.a)(t.flatten(n()))):e})).flat(10)}},{key:"sort",value:function(e){return e.sort((function(e,t){var n=Pl(e,"priority")||100,r=Pl(t,"priority")||100;return n>r?-1:n<r?1:0}))}}]),e}();function nf(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function rf(e,t){var n=Object(o.a)({},e);return nf(e)&&nf(t)&&Object.keys(t).forEach((function(r){nf(t[r])&&r in e?n[r]=rf(e[r],t[r]):Object.assign(n,Object(Q.a)({},r,t[r]))})),n}var of=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(o.a)(Object(o.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=$l(Pl(this,"addOptions",{name:this.name}))),this.storage=$l(Pl(this,"addStorage",{name:this.name,options:this.options}))||{}}return y(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=rf(this.options,e),t.storage=$l(Pl(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=$l(Pl(n,"addOptions",{name:n.name})),n.storage=$l(Pl(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function af(e,t,n){var r=t.from,o=t.to,i=n||{},a=i.blockSeparator,s=void 0===a?"\n\n":a,u=i.textSerializers,c=void 0===u?{}:u,l="",f=!0;return e.nodesBetween(r,o,(function(e,n,i,a){var u,d=null===c||void 0===c?void 0:c[e.type.name];d?(e.isBlock&&!f&&(l+=s,f=!0),i&&(l+=d({node:e,pos:n,parent:i,index:a,range:t}))):e.isText?(l+=null===(u=null===e||void 0===e?void 0:e.text)||void 0===u?void 0:u.slice(Math.max(r,n)-n,o-n),f=!1):e.isBlock&&!f&&(l+=s,f=!0)})),l}function sf(e){return Object.fromEntries(Object.entries(e.nodes).filter((function(e){return Object(l.a)(e,2)[1].spec.toText})).map((function(e){var t=Object(l.a)(e,2);return[t[0],t[1].spec.toText]})))}var uf=of.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var e=this;return[new Na({key:new Fa("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var t=e.editor,n=t.state,r=t.schema,o=n.doc,i=n.selection.ranges,a=Math.min.apply(Math,Object(J.a)(i.map((function(e){return e.$from.pos})))),s=Math.max.apply(Math,Object(J.a)(i.map((function(e){return e.$to.pos}))));return af(o,{from:a,to:s},{textSerializers:sf(r)})}}})]}});function cf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every((function(r){return n.strict?t[r]===e[r]:Yl(t[r])?t[r].test(e[r]):t[r]===e[r]}))}function lf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find((function(e){return e.type===t&&cf(e.attrs,n)}))}function ff(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!lf(e,t,n)}function df(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t){var r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),r.node){var o=lf(Object(J.a)(r.node.marks),t,n);if(o){var i=r.index,a=e.start()+r.offset,s=i+1,u=a+r.node.nodeSize;for(lf(Object(J.a)(r.node.marks),t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,a-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&ff(Object(J.a)(e.parent.child(s).marks),t,n);)u+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}}}}function pf(e,t){if("string"===typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}function hf(e){return e&&"object"===typeof e&&!Array.isArray(e)&&!function(e){var t;return"class"===(null===(t=e.constructor)||void 0===t?void 0:t.toString().substring(0,5))}(e)}function vf(e){return hf(e)&&e instanceof ma}function mf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function yf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=da.atStart(e),r=da.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?ma.create(e,mf(0,o,i),mf(e.content.size,o,i)):ma.create(e,mf(t,o,i),mf(t,o,i))}function gf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function bf(e){var t="<body>".concat(e,"</body>");return(new window.DOMParser).parseFromString(t,"text/html").body}function kf(e,t,n){if(n=Object(o.a)({slice:!0,parseOptions:{}},n),"object"===typeof e&&null!==e)try{return Array.isArray(e)?xo.fromArray(e.map((function(e){return t.nodeFromJSON(e)}))):t.nodeFromJSON(e)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),kf("",t,n)}if("string"===typeof e){var r=di.fromSchema(t);return n.slice?r.parseSlice(bf(e),n.parseOptions).content:r.parse(bf(e),n.parseOptions)}return kf("",t,n)}function wf(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function xf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.from,i=r.to,a=r.empty,s=t?Il(t,e.schema):null,u=[];e.doc.nodesBetween(o,i,(function(e,t){if(!e.isText){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);u.push({node:e,from:n,to:r})}}));var c=i-o,l=u.filter((function(e){return!s||s.name===e.node.type.name})).filter((function(e){return cf(e.node.attrs,n,{strict:!1})}));if(a)return!!l.length;var f=l.reduce((function(e,t){return e+t.to-t.from}),0);return f>=c}function Of(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Ef(e,t){var n="string"===typeof t?[t]:t;return Object.keys(e).reduce((function(t,r){return n.includes(r)||(t[r]=e[r]),t}),{})}function Df(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return kf(e,t,{slice:!1,parseOptions:n})}function Sf(e,t){var n=pf(t,e.schema),r=e.selection,i=r.from,a=r.to,s=r.empty,u=[];s?(e.storedMarks&&u.push.apply(u,Object(J.a)(e.storedMarks)),u.push.apply(u,Object(J.a)(e.selection.$head.marks()))):e.doc.nodesBetween(i,a,(function(e){u.push.apply(u,Object(J.a)(e.marks))}));var c=u.find((function(e){return e.type.name===n.name}));return c?Object(o.a)({},c.attrs):{}}function Cf(e,t,n){return Object.fromEntries(Object.entries(n).filter((function(n){var r=Object(l.a)(n,1)[0],o=e.find((function(e){return e.type===t&&e.name===r}));return!!o&&o.attribute.keepOnSplit})))}function jf(e){for(var t=0;t<e.edgeCount;t+=1){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function _f(e,t){var n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){var r=n.filter((function(e){return null===t||void 0===t?void 0:t.includes(e.type.name)}));e.tr.ensureMarks(r)}}function Af(e){return function(t){return function(e,t){for(var n=e.depth;n>0;n-=1){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}}function Nf(e,t){var n=Bl(t).nodeExtensions.find((function(t){return t.name===e}));if(!n)return!1;var r=$l(Pl(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"===typeof r&&r.split(" ").includes("list")}var Tf=function(e,t){var n=Af((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Yi(e.doc,n.pos)||(e.join(n.pos),!0)},Mf=function(e,t){var n=Af((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Yi(e.doc,r)||(e.join(r),!0)};function Ff(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?pf(t,e.schema):null;if(o)return!!(e.storedMarks||e.selection.$from.marks()).filter((function(e){return!a||a.name===e.type.name})).find((function(e){return cf(e.attrs,n,{strict:!1})}));var s=0,u=[];if(i.forEach((function(t){var n=t.$from,r=t.$to,o=n.pos,i=r.pos;e.doc.nodesBetween(o,i,(function(e,t){if(e.isText||e.marks.length){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);s+=r-n,u.push.apply(u,Object(J.a)(e.marks.map((function(e){return{mark:e,from:n,to:r}}))))}}))})),0===s)return!1;var c=u.filter((function(e){return!a||a.name===e.mark.type.name})).filter((function(e){return cf(e.mark.attrs,n,{strict:!1})})).reduce((function(e,t){return e+t.to-t.from}),0),l=u.filter((function(e){return!a||e.mark.type!==a&&e.mark.type.excludes(a)})).reduce((function(e,t){return e+t.to-t.from}),0),f=c>0?c+l:c;return f>=s}var Rf=Object.freeze({__proto__:null,blur:function(){return function(e){var t=e.editor,n=e.view;return requestAnimationFrame((function(){var e;t.isDestroyed||(n.dom.blur(),null===(e=null===window||void 0===window?void 0:window.getSelection())||void 0===e||e.removeAllRanges())})),!0}},clearContent:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){return t.commands.setContent("",e)}},clearNodes:function(){return function(e){var t=e.state,n=e.tr,r=e.dispatch,o=n.selection.ranges;return!r||(o.forEach((function(e){var r=e.$from,o=e.$to;t.doc.nodesBetween(r.pos,o.pos,(function(e,t){if(!e.type.isText){var r=n.doc,o=n.mapping,i=r.resolve(o.map(t)),a=r.resolve(o.map(t+e.nodeSize)),s=i.blockRange(a);if(s){var u=zi(s);if(e.type.isTextblock){var c=i.parent.contentMatchAt(i.index()).defaultType;n.setNodeMarkup(s.start,c)}(u||0===u)&&n.lift(s,u)}}}))})),!0)}},command:function(e){return function(t){return e(t)}},createParagraphNear:function(){return function(e){var t=e.state,n=e.dispatch;return vl(t,n)}},deleteNode:function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=Il(e,r.schema),a=n.selection.$anchor,s=a.depth;s>0;s-=1){if(a.node(s).type===i){if(o){var u=a.before(s),c=a.after(s);n.delete(u,c).scrollIntoView()}return!0}}return!1}},deleteRange:function(e){return function(t){var n=t.tr,r=t.dispatch,o=e.from,i=e.to;return r&&n.delete(o,i),!0}},deleteSelection:function(){return function(e){var t=e.state,n=e.dispatch;return rl(t,n)}},enter:function(){return function(e){return e.commands.keyboardShortcut("Enter")}},exitCode:function(){return function(e){var t=e.state,n=e.dispatch;return hl(t,n)}},extendMarkRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=pf(e,o.schema),s=r.doc,u=r.selection,c=u.$from,l=u.from,f=u.to;if(i){var d=df(c,a,t);if(d&&d.from<=l&&d.to>=f){var p=ma.create(s,d.from,d.to);r.setSelection(p)}}return!0}},first:function(e){return function(t){for(var n="function"===typeof e?e(t):e,r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1}},focus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.editor,i=n.view,a=n.tr,s=n.dispatch;t=Object(o.a)({scrollIntoView:!0},t);var u=function(){gf()&&i.dom.focus(),requestAnimationFrame((function(){r.isDestroyed||(i.focus(),(null===t||void 0===t?void 0:t.scrollIntoView)&&r.commands.scrollIntoView())}))};if(i.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!vf(r.state.selection))return u(),!0;var c=yf(a.doc,e)||r.state.selection,l=r.state.selection.eq(c);return s&&(l||a.setSelection(c),l&&a.storedMarks&&a.setStoredMarks(a.storedMarks),u()),!0}},forEach:function(e,t){return function(n){return e.every((function(e,r){return t(e,Object(o.a)(Object(o.a)({},n),{},{index:r}))}))}},insertContent:function(e,t){return function(n){var r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)}},insertContentAt:function(e,t,n){return function(r){var i=r.tr,a=r.dispatch,s=r.editor;if(a){n=Object(o.a)({parseOptions:{},updateSelection:!0},n);var u=kf(t,s.schema,{parseOptions:Object(o.a)({preserveWhitespace:"full"},n.parseOptions)});if("<>"===u.toString())return!0;var c="number"===typeof e?{from:e,to:e}:e,l=c.from,f=c.to,d=!0,p=!0;if((u.toString().startsWith("<")?u:[u]).forEach((function(e){e.check(),d=!!d&&(e.isText&&0===e.marks.length),p=!!p&&e.isBlock})),l===f&&p){var h=i.doc.resolve(l).parent;h.isTextblock&&!h.type.spec.code&&!h.childCount&&(l-=1,f+=1)}d?i.insertText(t,l,f):i.replaceWith(l,f,u),n.updateSelection&&function(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o=e.steps[r];if(o instanceof Pi||o instanceof Bi){var i=e.mapping.maps[r],a=0;i.forEach((function(e,t,n,r){0===a&&(a=r)})),e.setSelection(da.near(e.doc.resolve(a),n))}}}(i,i.steps.length-1,-1)}return!0}},joinBackward:function(){return function(e){var t=e.state,n=e.dispatch;return ol(t,n)}},joinForward:function(){return function(e){var t=e.state,n=e.dispatch;return ul(t,n)}},keyboardShortcut:function(e){return function(t){var n=t.editor,r=t.view,o=t.tr,i=t.dispatch,a=function(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"===a&&(a=" ");for(var s=0;s<i.length-1;s+=1){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: ".concat(u));gf()||wf()?o=!0:n=!0}}return t&&(a="Alt-".concat(a)),n&&(a="Ctrl-".concat(a)),o&&(a="Meta-".concat(a)),r&&(a="Shift-".concat(a)),a}(e).split(/-(?!$)/),s=a.find((function(e){return!["Alt","Ctrl","Meta","Shift"].includes(e)})),u=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction((function(){r.someProp("handleKeyDown",(function(e){return e(r,u)}))}));return null===c||void 0===c||c.steps.forEach((function(e){var t=e.map(o.mapping);t&&i&&o.maybeStep(t)})),!0}},lift:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return!!xf(r,Il(e,r.schema),t)&&fl(r,o)}},liftEmptyBlock:function(){return function(e){var t=e.state,n=e.dispatch;return ml(t,n)}},liftListItem:function(e){return function(t){var n=t.state,r=t.dispatch;return Tl(Il(e,n.schema))(n,r)}},newlineInCode:function(){return function(e){var t=e.state,n=e.dispatch;return dl(t,n)}},resetAttributes:function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=Of("string"===typeof e?e:e.name,o.schema);return!!u&&("node"===u&&(a=Il(e,o.schema)),"mark"===u&&(s=pf(e,o.schema)),i&&r.selection.ranges.forEach((function(e){o.doc.nodesBetween(e.$from.pos,e.$to.pos,(function(e,n){a&&a===e.type&&r.setNodeMarkup(n,void 0,Ef(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((function(o){s===o.type&&r.addMark(n,n+e.nodeSize,s.create(Ef(o.attrs,t)))}))}))})),!0)}},scrollIntoView:function(){return function(e){var t=e.tr;return e.dispatch&&t.scrollIntoView(),!0}},selectAll:function(){return function(e){var t=e.tr;return e.commands.setTextSelection({from:0,to:t.doc.content.size})}},selectNodeBackward:function(){return function(e){var t=e.state,n=e.dispatch;return al(t,n)}},selectNodeForward:function(){return function(e){var t=e.state,n=e.dispatch;return cl(t,n)}},selectParentNode:function(){return function(e){return function(e,t){var n,r=e.selection,o=r.$from,i=r.to,a=o.sharedDepth(i);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(ga.create(e.doc,n))),!0)}(e.state,e.dispatch)}},selectTextblockEnd:function(){return function(e){var t=e.state,n=e.dispatch;return wl(t,n)}},selectTextblockStart:function(){return function(e){var t=e.state,n=e.dispatch;return kl(t,n)}},setContent:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.tr,i=r.editor,a=r.dispatch,s=o.doc,u=Df(e,i.schema,n);return a&&o.replaceWith(0,s.content.size,u).setMeta("preventUpdate",!t),!0}},setMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,i=n.state,a=n.dispatch,s=r.selection,u=s.empty,c=s.ranges,l=pf(e,i.schema);if(a)if(u){var f=Sf(i,l);r.addStoredMark(l.create(Object(o.a)(Object(o.a)({},f),t)))}else c.forEach((function(e){var n=e.$from.pos,a=e.$to.pos;i.doc.nodesBetween(n,a,(function(e,i){var s=Math.max(i,n),u=Math.min(i+e.nodeSize,a);e.marks.find((function(e){return e.type===l}))?e.marks.forEach((function(e){l===e.type&&r.addMark(s,u,l.create(Object(o.a)(Object(o.a)({},e.attrs),t)))})):r.addMark(s,u,l.create(t))}))}));return!0}},setMeta:function(e,t){return function(n){return n.tr.setMeta(e,t),!0}},setNode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=n.chain,a=Il(e,r.schema);return a.isTextblock?i().command((function(e){var n=e.commands;return!!Ol(a,t)(r)||n.clearNodes()})).command((function(e){var n=e.state;return Ol(a,t)(n,o)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},setNodeSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o=da.atStart(r).from,i=da.atEnd(r).to,a=mf(e,o,i),s=ga.create(r,a);n.setSelection(s)}return!0}},setTextSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o="number"===typeof e?{from:e,to:e}:e,i=o.from,a=o.to,s=ma.atStart(r).from,u=ma.atEnd(r).to,c=mf(i,s,u),l=mf(a,s,u),f=ma.create(r,c,l);n.setSelection(f)}return!0}},sinkListItem:function(e){return function(t){var n,r=t.state,o=t.dispatch,i=Il(e,r.schema);return(n=i,function(e,t){var r=e.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(e){return e.childCount>0&&e.firstChild.type==n}));if(!a)return!1;var s=a.startIndex;if(0==s)return!1;var u=a.parent,c=u.child(s-1);if(c.type!=n)return!1;if(t){var l=c.lastChild&&c.lastChild.type==u.type,f=xo.from(l?n.create():null),d=new jo(xo.from(n.create(null,xo.from(u.type.create(null,f)))),l?3:1,0),p=a.start,h=a.end;t(e.tr.step(new Bi(p-(l?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0})(r,o)}},splitBlock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.keepMarks,n=void 0===t||t;return function(e){var t=e.tr,r=e.state,o=e.dispatch,i=e.editor,a=t.selection,s=t.doc,u=a.$from,c=a.$to,l=Cf(i.extensionManager.attributes,u.node().type.name,u.node().attrs);if(a instanceof ga&&a.node.isBlock)return!(!u.parentOffset||!Ki(s,u.pos))&&(o&&(n&&_f(r,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(o){var f=c.parentOffset===c.parent.content.size;a instanceof ma&&t.deleteSelection();var d=0===u.depth?void 0:jf(u.node(-1).contentMatchAt(u.indexAfter(-1))),p=f&&d?[{type:d,attrs:l}]:void 0,h=Ki(t.doc,t.mapping.map(u.pos),1,p);if(p||h||!Ki(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)||(h=!0,p=d?[{type:d,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){var v=t.mapping.map(u.before()),m=t.doc.resolve(v);u.node(-1).canReplaceWith(m.index(),m.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}n&&_f(r,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0}},splitListItem:function(e){return function(t){var n,r=t.tr,o=t.state,i=t.dispatch,a=t.editor,s=Il(e,o.schema),u=o.selection,c=u.$from,l=u.$to,f=o.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(l))return!1;var d=c.node(-1);if(d.type!==s)return!1;var p=a.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==s||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){for(var h=xo.empty,v=c.index(-1)?1:c.index(-2)?2:3,m=c.depth-v;m>=c.depth-3;m-=1)h=xo.from(c.node(m).copy(h));var y=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,g=Cf(p,c.node().type.name,c.node().attrs),b=(null===(n=s.contentMatch.defaultType)||void 0===n?void 0:n.createAndFill(g))||void 0;h=h.append(xo.from(s.createAndFill(null,b)||void 0));var k=c.before(c.depth-(v-1));r.replace(k,c.after(-y),new jo(h,4-v,0));var w=-1;r.doc.nodesBetween(k,r.doc.content.size,(function(e,t){if(w>-1)return!1;e.isTextblock&&0===e.content.size&&(w=t+1)})),w>-1&&r.setSelection(ma.near(r.doc.resolve(w))),r.scrollIntoView()}return!0}var x=l.pos===c.end()?d.contentMatchAt(0).defaultType:null,O=Cf(p,d.type.name,d.attrs),E=Cf(p,c.node().type.name,c.node().attrs);r.delete(c.pos,l.pos);var D=x?[{type:s,attrs:O},{type:x,attrs:E}]:[{type:s,attrs:O}];return!!Ki(r.doc,c.pos,2)&&(i&&r.split(c.pos,2,D).scrollIntoView(),!0)}},toggleList:function(e,t){return function(n){var r=n.editor,o=n.tr,i=n.state,a=n.dispatch,s=n.chain,u=n.commands,c=n.can,l=r.extensionManager.extensions,f=Il(e,i.schema),d=Il(t,i.schema),p=i.selection,h=p.$from,v=p.$to,m=h.blockRange(v);if(!m)return!1;var y=Af((function(e){return Nf(e.type.name,l)}))(p);if(m.depth>=1&&y&&m.depth-y.depth<=1){if(y.node.type===f)return u.liftListItem(d);if(Nf(y.node.type.name,l)&&f.validContent(y.node.content)&&a)return s().command((function(){return o.setNodeMarkup(y.pos,f),!0})).command((function(){return Tf(o,f)})).command((function(){return Mf(o,f)})).run()}return s().command((function(){return!!c().wrapInList(f)||u.clearNodes()})).wrapInList(f).command((function(){return Tf(o,f)})).command((function(){return Mf(o,f)})).run()}},toggleMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=n.extendEmptyMarkRange,s=void 0!==a&&a,u=pf(e,o.schema);return Ff(o,u,t)?i.unsetMark(u,{extendEmptyMarkRange:s}):i.setMark(u,t)}},toggleNode:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=Il(e,o.schema),s=Il(t,o.schema);return xf(o,a,n)?i.setNode(s):i.setNode(a,n)}},toggleWrap:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=Il(e,r.schema);return xf(r,i,t)?o.lift(i):o.wrapIn(i,t)}},undoInputRule:function(){return function(e){for(var t=e.state,n=e.dispatch,r=t.plugins,o=0;o<r.length;o+=1){var i=r[o],a=void 0;if(i.spec.isInputRules&&(a=i.getState(t))){if(n){for(var s=t.tr,u=a.transform,c=u.steps.length-1;c>=0;c-=1)s.step(u.steps[c].invert(u.docs[c]));if(a.text){var l=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else s.delete(a.from,a.to)}return!0}}return!1}},unsetAllMarks:function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach((function(e){t.removeMark(e.$from.pos,e.$to.pos)})),!0}},unsetMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,s=t.extendEmptyMarkRange,u=void 0!==s&&s,c=o.selection,l=pf(e,i.schema),f=c.$from,d=c.empty,p=c.ranges;if(!a)return!0;if(d&&u){var h=c.from,v=c.to,m=null===(r=f.marks().find((function(e){return e.type===l})))||void 0===r?void 0:r.attrs,y=df(f,l,m);y&&(h=y.from,v=y.to),o.removeMark(h,v,l)}else p.forEach((function(e){o.removeMark(e.$from.pos,e.$to.pos,l)}));return o.removeStoredMark(l),!0}},updateAttributes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,i=n.state,a=n.dispatch,s=null,u=null,c=Of("string"===typeof e?e:e.name,i.schema);return!!c&&("node"===c&&(s=Il(e,i.schema)),"mark"===c&&(u=pf(e,i.schema)),a&&r.selection.ranges.forEach((function(e){var n=e.$from.pos,a=e.$to.pos;i.doc.nodesBetween(n,a,(function(e,i){s&&s===e.type&&r.setNodeMarkup(i,void 0,Object(o.a)(Object(o.a)({},e.attrs),t)),u&&e.marks.length&&e.marks.forEach((function(s){if(u===s.type){var c=Math.max(i,n),l=Math.min(i+e.nodeSize,a);r.addMark(c,l,u.create(Object(o.a)(Object(o.a)({},s.attrs),t)))}}))}))})),!0)}},wrapIn:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return xl(Il(e,r.schema),t)(r,o)}},wrapInList:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return Al(Il(e,r.schema),t)(r,o)}}}),Pf=of.create({name:"commands",addCommands:function(){return Object(o.a)({},Rf)}}),Bf=of.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new Na({key:new Fa("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),Lf=of.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new Na({key:new Fa("focusEvents"),props:{handleDOMEvents:{focus:function(t,n){e.isFocused=!0;var r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:function(t,n){e.isFocused=!1;var r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),If=of.create({name:"keymap",addKeyboardShortcuts:function(){var e=this,t=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.undoInputRule()},function(){return t.command((function(e){var n=e.tr,r=n.selection,o=n.doc,i=r.empty,a=r.$anchor,s=a.pos,u=a.parent,c=da.atStart(o).from===s;return!(!(i&&c&&u.type.isTextblock)||u.textContent.length)&&t.clearNodes()}))},function(){return t.deleteSelection()},function(){return t.joinBackward()},function(){return t.selectNodeBackward()}]}))},n=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.deleteSelection()},function(){return t.joinForward()},function(){return t.selectNodeForward()}]}))},r={Enter:function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.newlineInCode()},function(){return t.createParagraphNear()},function(){return t.liftEmptyBlock()},function(){return t.splitBlock()}]}))},"Mod-Enter":function(){return e.editor.commands.exitCode()},Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":function(){return e.editor.commands.selectAll()}},i=Object(o.a)({},r),a=Object(o.a)(Object(o.a)({},r),{},{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":function(){return e.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return e.editor.commands.selectTextblockEnd()}});return gf()||wf()?a:i},addProseMirrorPlugins:function(){var e=this;return[new Na({key:new Fa("clearDocument"),appendTransaction:function(t,n,r){if(t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc)){var o=n.selection,i=o.empty,a=o.from,s=o.to,u=da.atStart(n.doc).from,c=da.atEnd(n.doc).to,l=a===u&&s===c,f=0===r.doc.textBetween(0,r.doc.content.size," "," ").length;if(!i&&l&&f){var d=r.tr,p=Ml({state:r,transaction:d});if(new Fl({editor:e.editor,state:p}).commands.clearNodes(),d.steps.length)return d}}}})]}}),zf=of.create({name:"tabindex",addProseMirrorPlugins:function(){return[new Na({key:new Fa("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Uf=Object.freeze({__proto__:null,ClipboardTextSerializer:uf,Commands:Pf,Editable:Bf,FocusEvents:Lf,Keymap:If,Tabindex:zf});function Vf(e,t){var n=Of("string"===typeof t?t:t.name,e.schema);return"node"===n?function(e,t){var n=Il(t,e.schema),r=e.selection,i=r.from,a=r.to,s=[];e.doc.nodesBetween(i,a,(function(e){s.push(e)}));var u=s.reverse().find((function(e){return e.type.name===n.name}));return u?Object(o.a)({},u.attrs):{}}(e,t):"mark"===n?Sf(e,t):{}}function $f(e,t){var n=xi.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Hf(e,t){return af(e,{from:0,to:e.content.size},t)}var qf=function(e){b(n,e);var t=E(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v(this,n),(e=t.call(this)).isFocused=!1,e.extensionStorage={},e.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:function(){return null},onCreate:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null}},e.isCapturingTransaction=!1,e.capturedTransaction=null,e.setOptions(r),e.createExtensionManager(),e.createCommandManager(),e.createSchema(),e.on("beforeCreate",e.options.onBeforeCreate),e.emit("beforeCreate",{editor:x(e)}),e.createView(),e.injectCSS(),e.on("create",e.options.onCreate),e.on("update",e.options.onUpdate),e.on("selectionUpdate",e.options.onSelectionUpdate),e.on("transaction",e.options.onTransaction),e.on("focus",e.options.onFocus),e.on("blur",e.options.onBlur),e.on("destroy",e.options.onDestroy),window.setTimeout((function(){e.isDestroyed||(e.commands.focus(e.options.autofocus),e.emit("create",{editor:x(e)}))}),0),e}return y(n,[{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&document&&(this.css=function(e,t){var n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Object(o.a)(Object(o.a)({},this.options),e),this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(e){this.setOptions({editable:e})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"state",get:function(){return this.view.state}},{key:"registerPlugin",value:function(e,t){var n=Vl(t)?t(e,Object(J.a)(this.state.plugins)):[].concat(Object(J.a)(this.state.plugins),[e]),r=this.state.reconfigure({plugins:n});this.view.updateState(r)}},{key:"unregisterPlugin",value:function(e){if(!this.isDestroyed){var t="string"===typeof e?"".concat(e,"$"):e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((function(e){return!e.key.startsWith(t)}))});this.view.updateState(n)}}},{key:"createExtensionManager",value:function(){var e=this.options.enableCoreExtensions?Object.values(Uf):[],t=[].concat(Object(J.a)(e),Object(J.a)(this.options.extensions)).filter((function(e){return["extension","node","mark"].includes(null===e||void 0===e?void 0:e.type)}));this.extensionManager=new tf(t,this)}},{key:"createCommandManager",value:function(){this.commandManager=new Fl({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var e=Df(this.options.content,this.schema,this.options.parseOptions),t=yf(e,this.options.autofocus);this.view=new Bc(this.options.element,Object(o.a)(Object(o.a)({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:_a.create({doc:e,selection:t||void 0})}));var n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.view.dom.editor=this}},{key:"createNodeViews",value:function(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}},{key:"captureTransaction",value:function(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;var t=this.capturedTransaction;return this.capturedTransaction=null,t}},{key:"dispatchTransaction",value:function(e){var t=this;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((function(e){var n;return null===(n=t.capturedTransaction)||void 0===n?void 0:n.step(e)})):void(this.capturedTransaction=e);var n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});var o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}},{key:"getAttributes",value:function(e){return Vf(this.state,e)}},{key:"isActive",value:function(e,t){var n="string"===typeof e?e:null,r="string"===typeof e?t:e;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return xf(e,null,n)||Ff(e,null,n);var r=Of(t,e.schema);return"node"===r?xf(e,t,n):"mark"===r&&Ff(e,t,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return $f(this.state.doc.content,this.schema)}},{key:"getText",value:function(e){var t=e||{},n=t.blockSeparator,r=void 0===n?"\n\n":n,i=t.textSerializers,a=void 0===i?{}:i;return Hf(this.state.doc,{blockSeparator:r,textSerializers:Object(o.a)(Object(o.a)({},a),sf(this.schema))})}},{key:"isEmpty",get:function(){return function(e){var t,n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}},{key:"getCharacterCount",value:function(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}},{key:"destroy",value:function(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}},{key:"isDestroyed",get:function(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}]),n}(Rl);function Wf(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter((function(e){var r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter((function(e,n){return!t.filter((function(e,t){return t!==n})).some((function(t){return e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to}))}))}function Kf(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach((function(t){var i=df(n.resolve(e-1),t.type);i&&r.push(Object(o.a)({mark:t},i))})):n.nodesBetween(e,t,(function(e,t){r.push.apply(r,Object(J.a)(e.marks.map((function(n){return{from:t,to:t+e.nodeSize,mark:n}}))))})),r}function Gf(e,t,n){var r=e.state.doc.content.size,i=mf(t,0,r),a=mf(n,0,r),s=e.coordsAtPos(i),u=e.coordsAtPos(a,-1),c=Math.min(s.top,u.top),l=Math.max(s.bottom,u.bottom),f=Math.min(s.left,u.left),d=Math.max(s.right,u.right),p={top:c,bottom:l,left:f,right:d,width:d-f,height:l-c,x:f,y:c};return Object(o.a)(Object(o.a)({},p),{},{toJSON:function(){return p}})}var Yf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(o.a)(Object(o.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=$l(Pl(this,"addOptions",{name:this.name}))),this.storage=$l(Pl(this,"addStorage",{name:this.name,options:this.options}))||{}}return y(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=rf(this.options,e),t.storage=$l(Pl(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=$l(Pl(n,"addOptions",{name:n.name})),n.storage=$l(Pl(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}(),Jf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,e),this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(o.a)(Object(o.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=$l(Pl(this,"addOptions",{name:this.name}))),this.storage=$l(Pl(this,"addStorage",{name:this.name,options:this.options}))||{}}return y(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=rf(this.options,e),t.storage=$l(Pl(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=$l(Pl(n,"addOptions",{name:n.name})),n.storage=$l(Pl(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function Qf(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xf(e){return e instanceof Qf(e).Element||e instanceof Element}function Zf(e){return e instanceof Qf(e).HTMLElement||e instanceof HTMLElement}function ed(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Qf(e).ShadowRoot||e instanceof ShadowRoot)}var td=Math.max,nd=Math.min,rd=Math.round;function od(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(Zf(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(r=rd(n.width)/a||1),i>0&&(o=rd(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function id(e){var t=Qf(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ad(e){return e?(e.nodeName||"").toLowerCase():null}function sd(e){return((Xf(e)?e.ownerDocument:e.document)||window.document).documentElement}function ud(e){return od(sd(e)).left+id(e).scrollLeft}function cd(e){return Qf(e).getComputedStyle(e)}function ld(e){var t=cd(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function fd(e,t,n){void 0===n&&(n=!1);var r=Zf(t),o=Zf(t)&&function(e){var t=e.getBoundingClientRect(),n=rd(t.width)/e.offsetWidth||1,r=rd(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=sd(t),a=od(e,o),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==ad(t)||ld(i))&&(s=function(e){return e!==Qf(e)&&Zf(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:id(e);var t}(t)),Zf(t)?((u=od(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=ud(i))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function dd(e){var t=od(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function pd(e){return"html"===ad(e)?e:e.assignedSlot||e.parentNode||(ed(e)?e.host:null)||sd(e)}function hd(e){return["html","body","#document"].indexOf(ad(e))>=0?e.ownerDocument.body:Zf(e)&&ld(e)?e:hd(pd(e))}function vd(e,t){var n;void 0===t&&(t=[]);var r=hd(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Qf(r),a=o?[i].concat(i.visualViewport||[],ld(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(vd(pd(a)))}function md(e){return["table","td","th"].indexOf(ad(e))>=0}function yd(e){return Zf(e)&&"fixed"!==cd(e).position?e.offsetParent:null}function gd(e){for(var t=Qf(e),n=yd(e);n&&md(n)&&"static"===cd(n).position;)n=yd(n);return n&&("html"===ad(n)||"body"===ad(n)&&"static"===cd(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Zf(e)&&"fixed"===cd(e).position)return null;var n=pd(e);for(ed(n)&&(n=n.host);Zf(n)&&["html","body"].indexOf(ad(n))<0;){var r=cd(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var bd="top",kd="bottom",wd="right",xd="left",Od="auto",Ed=[bd,kd,wd,xd],Dd="start",Sd="end",Cd="viewport",jd="popper",_d=Ed.reduce((function(e,t){return e.concat([t+"-"+Dd,t+"-"+Sd])}),[]),Ad=[].concat(Ed,[Od]).reduce((function(e,t){return e.concat([t,t+"-"+Dd,t+"-"+Sd])}),[]),Nd=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Td(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function Md(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var Fd={placement:"bottom",modifiers:[],strategy:"absolute"};function Rd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"===typeof e.getBoundingClientRect)}))}function Pd(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Fd:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Fd,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,u={state:o,setOptions:function(n){var s="function"===typeof n?n(o.options):n;c(),o.options=Object.assign({},i,o.options,s),o.scrollParents={reference:Xf(e)?vd(e):e.contextElement?vd(e.contextElement):[],popper:vd(t)};var l=function(e){var t=Td(e);return Nd.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,o.options.modifiers)));return o.orderedModifiers=l.filter((function(e){return e.enabled})),o.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"===typeof i){var s=i({state:o,name:t,instance:u,options:r}),c=function(){};a.push(s||c)}})),u.update()},forceUpdate:function(){if(!s){var e=o.elements,t=e.reference,n=e.popper;if(Rd(t,n)){o.rects={reference:fd(t,gd(n),"fixed"===o.options.strategy),popper:dd(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach((function(e){return o.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var i=o.orderedModifiers[r],a=i.fn,c=i.options,l=void 0===c?{}:c,f=i.name;"function"===typeof a&&(o=a({state:o,options:l,name:f,instance:u})||o)}else o.reset=!1,r=-1}}},update:Md((function(){return new Promise((function(e){u.forceUpdate(),e(o)}))})),destroy:function(){c(),s=!0}};if(!Rd(e,t))return u;function c(){a.forEach((function(e){return e()})),a=[]}return u.setOptions(n).then((function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var Bd={passive:!0};function Ld(e){return e.split("-")[0]}function Id(e){return e.split("-")[1]}function zd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ud(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Ld(o):null,a=o?Id(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case bd:t={x:s,y:n.y-r.height};break;case kd:t={x:s,y:n.y+n.height};break;case wd:t={x:n.x+n.width,y:u};break;case xd:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var c=i?zd(i):null;if(null!=c){var l="y"===c?"height":"width";switch(a){case Dd:t[c]=t[c]-(n[l]/2-r[l]/2);break;case Sd:t[c]=t[c]+(n[l]/2-r[l]/2)}}return t}var Vd={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $d(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=a.x,p=void 0===d?0:d,h=a.y,v=void 0===h?0:h,m="function"===typeof l?l({x:p,y:v}):{x:p,y:v};p=m.x,v=m.y;var y=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),b=xd,k=bd,w=window;if(c){var x=gd(n),O="clientHeight",E="clientWidth";if(x===Qf(n)&&"static"!==cd(x=sd(n)).position&&"absolute"===s&&(O="scrollHeight",E="scrollWidth"),o===bd||(o===xd||o===wd)&&i===Sd)k=kd,v-=(f&&x===w&&w.visualViewport?w.visualViewport.height:x[O])-r.height,v*=u?1:-1;if(o===xd||(o===bd||o===kd)&&i===Sd)b=wd,p-=(f&&x===w&&w.visualViewport?w.visualViewport.width:x[E])-r.width,p*=u?1:-1}var D,S=Object.assign({position:s},c&&Vd),C=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:rd(t*r)/r||0,y:rd(n*r)/r||0}}({x:p,y:v}):{x:p,y:v};return p=C.x,v=C.y,u?Object.assign({},S,((D={})[k]=g?"0":"",D[b]=y?"0":"",D.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",D)):Object.assign({},S,((t={})[k]=g?v+"px":"",t[b]=y?p+"px":"",t.transform="",t))}var Hd={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];Zf(o)&&ad(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Zf(r)&&ad(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var qd={left:"right",right:"left",bottom:"top",top:"bottom"};function Wd(e){return e.replace(/left|right|bottom|top/g,(function(e){return qd[e]}))}var Kd={start:"end",end:"start"};function Gd(e){return e.replace(/start|end/g,(function(e){return Kd[e]}))}function Yd(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ed(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Jd(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Qd(e,t){return t===Cd?Jd(function(e){var t=Qf(e),n=sd(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+ud(e),y:s}}(e)):Xf(t)?function(e){var t=od(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Jd(function(e){var t,n=sd(e),r=id(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=td(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=td(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+ud(e),u=-r.scrollTop;return"rtl"===cd(o||n).direction&&(s+=td(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(sd(e)))}function Xd(e,t,n){var r="clippingParents"===t?function(e){var t=vd(pd(e)),n=["absolute","fixed"].indexOf(cd(e).position)>=0&&Zf(e)?gd(e):e;return Xf(n)?t.filter((function(e){return Xf(e)&&Yd(e,n)&&"body"!==ad(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=Qd(e,n);return t.top=td(r.top,t.top),t.right=nd(r.right,t.right),t.bottom=nd(r.bottom,t.bottom),t.left=td(r.left,t.left),t}),Qd(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Zd(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ep(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function tp(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,s=n.rootBoundary,u=void 0===s?Cd:s,c=n.elementContext,l=void 0===c?jd:c,f=n.altBoundary,d=void 0!==f&&f,p=n.padding,h=void 0===p?0:p,v=Zd("number"!==typeof h?h:ep(h,Ed)),m=l===jd?"reference":jd,y=e.rects.popper,g=e.elements[d?m:l],b=Xd(Xf(g)?g:g.contextElement||sd(e.elements.popper),a,u),k=od(e.elements.reference),w=Ud({reference:k,element:y,strategy:"absolute",placement:o}),x=Jd(Object.assign({},y,w)),O=l===jd?x:k,E={top:b.top-O.top+v.top,bottom:O.bottom-b.bottom+v.bottom,left:b.left-O.left+v.left,right:O.right-b.right+v.right},D=e.modifiersData.offset;if(l===jd&&D){var S=D[o];Object.keys(E).forEach((function(e){var t=[wd,kd].indexOf(e)>=0?1:-1,n=[bd,kd].indexOf(e)>=0?"y":"x";E[e]+=S[n]*t}))}return E}function np(e,t,n){return td(e,nd(t,n))}function rp(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function op(e){return[bd,wd,kd,xd].some((function(t){return e[t]>=0}))}var ip=Pd({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,u=Qf(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,Bd)})),s&&u.addEventListener("resize",n.update,Bd),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Bd)})),s&&u.removeEventListener("resize",n.update,Bd)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ud({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,u=void 0===s||s,c={placement:Ld(t.placement),variation:Id(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,$d(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,$d(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Hd,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=Ad.reduce((function(e,n){return e[n]=function(e,t,n){var r=Ld(e),o=[xd,bd].indexOf(r)>=0?-1:1,i="function"===typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[xd,wd].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],u=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,v=n.allowedAutoPlacements,m=t.options.placement,y=Ld(m),g=u||(y===m||!h?[Wd(m)]:function(e){if(Ld(e)===Od)return[];var t=Wd(e);return[Gd(e),t,Gd(t)]}(m)),b=[m].concat(g).reduce((function(e,n){return e.concat(Ld(n)===Od?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?Ad:u,l=Id(r),f=l?s?_d:_d.filter((function(e){return Id(e)===l})):Ed,d=f.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=f);var p=d.reduce((function(t,n){return t[n]=tp(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[Ld(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):n)}),[]),k=t.rects.reference,w=t.rects.popper,x=new Map,O=!0,E=b[0],D=0;D<b.length;D++){var S=b[D],C=Ld(S),j=Id(S)===Dd,_=[bd,kd].indexOf(C)>=0,A=_?"width":"height",N=tp(t,{placement:S,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),T=_?j?wd:xd:j?kd:bd;k[A]>w[A]&&(T=Wd(T));var M=Wd(T),F=[];if(i&&F.push(N[C]<=0),s&&F.push(N[T]<=0,N[M]<=0),F.every((function(e){return e}))){E=S,O=!1;break}x.set(S,F)}if(O)for(var R=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},P=h?3:1;P>0;P--){if("break"===R(P))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=void 0===d||d,h=n.tetherOffset,v=void 0===h?0:h,m=tp(t,{boundary:u,rootBoundary:c,padding:f,altBoundary:l}),y=Ld(t.placement),g=Id(t.placement),b=!g,k=zd(y),w="x"===k?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,D="function"===typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,S="number"===typeof D?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(x){if(i){var _,A="y"===k?bd:xd,N="y"===k?kd:wd,T="y"===k?"height":"width",M=x[k],F=M+m[A],R=M-m[N],P=p?-E[T]/2:0,B=g===Dd?O[T]:E[T],L=g===Dd?-E[T]:-O[T],I=t.elements.arrow,z=p&&I?dd(I):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=U[A],$=U[N],H=np(0,O[T],z[T]),q=b?O[T]/2-P-H-V-S.mainAxis:B-H-V-S.mainAxis,W=b?-O[T]/2+P+H+$+S.mainAxis:L+H+$+S.mainAxis,K=t.elements.arrow&&gd(t.elements.arrow),G=K?"y"===k?K.clientTop||0:K.clientLeft||0:0,Y=null!=(_=null==C?void 0:C[k])?_:0,J=M+W-Y,Q=np(p?nd(F,M+q-Y-G):F,M,p?td(R,J):R);x[k]=Q,j[k]=Q-M}if(s){var X,Z="x"===k?bd:xd,ee="x"===k?kd:wd,te=x[w],ne="y"===w?"height":"width",re=te+m[Z],oe=te-m[ee],ie=-1!==[bd,xd].indexOf(y),ae=null!=(X=null==C?void 0:C[w])?X:0,se=ie?re:te-O[ne]-E[ne]-ae+S.altAxis,ue=ie?te+O[ne]+E[ne]-ae-S.altAxis:oe,ce=p&&ie?function(e,t,n){var r=np(e,t,n);return r>n?n:r}(se,te,ue):np(p?se:re,te,p?ue:oe);x[w]=ce,j[w]=ce-te}t.modifiersData[r]=j}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Ld(n.placement),u=zd(s),c=[xd,wd].indexOf(s)>=0?"height":"width";if(i&&a){var l=function(e,t){return Zd("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ep(e,Ed))}(o.padding,n),f=dd(i),d="y"===u?bd:xd,p="y"===u?kd:wd,h=n.rects.reference[c]+n.rects.reference[u]-a[u]-n.rects.popper[c],v=a[u]-n.rects.reference[u],m=gd(i),y=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,g=h/2-v/2,b=l[d],k=y-f[c]-l[p],w=y/2-f[c]/2+g,x=np(b,w,k),O=u;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!==typeof r||(r=t.elements.popper.querySelector(r)))&&Yd(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=tp(t,{elementContext:"reference"}),s=tp(t,{altBoundary:!0}),u=rp(a,r),c=rp(s,o,i),l=op(u),f=op(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}}]}),ap="tippy-content",sp="tippy-backdrop",up="tippy-arrow",cp="tippy-svg-arrow",lp={passive:!0,capture:!0},fp=function(){return document.body};function dp(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function pp(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function hp(e,t){return"function"===typeof e?e.apply(void 0,t):e}function vp(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function mp(e){return[].concat(e)}function yp(e,t){-1===e.indexOf(t)&&e.push(t)}function gp(e){return e.split("-")[0]}function bp(e){return[].slice.call(e)}function kp(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function wp(){return document.createElement("div")}function xp(e){return["Element","Fragment"].some((function(t){return pp(e,t)}))}function Op(e){return pp(e,"MouseEvent")}function Ep(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Dp(e){return xp(e)?[e]:function(e){return pp(e,"NodeList")}(e)?bp(e):Array.isArray(e)?e:bp(document.querySelectorAll(e))}function Sp(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Cp(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function jp(e){var t,n=mp(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function _p(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Ap(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Np={isTouch:!1},Tp=0;function Mp(){Np.isTouch||(Np.isTouch=!0,window.performance&&document.addEventListener("mousemove",Fp))}function Fp(){var e=performance.now();e-Tp<20&&(Np.isTouch=!1,document.removeEventListener("mousemove",Fp)),Tp=e}function Rp(){var e=document.activeElement;if(Ep(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Pp=!!("undefined"!==typeof window&&"undefined"!==typeof document)&&!!window.msCrypto;var Bp={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Lp=Object.assign({appendTo:fp,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Bp,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Ip=Object.keys(Lp);function zp(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=Lp[o])?r:i);return t}),{});return Object.assign({},e,t)}function Up(e,t){var n=Object.assign({},t,{content:hp(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(zp(Object.assign({},Lp,{plugins:t}))):Ip).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(cr){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Lp.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Vp(e,t){e.innerHTML=t}function $p(e){var t=wp();return!0===e?t.className=up:(t.className=cp,xp(e)?t.appendChild(e):Vp(t,e)),t}function Hp(e,t){xp(t.content)?(Vp(e,""),e.appendChild(t.content)):"function"!==typeof t.content&&(t.allowHTML?Vp(e,t.content):e.textContent=t.content)}function qp(e){var t=e.firstElementChild,n=bp(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ap)})),arrow:n.find((function(e){return e.classList.contains(up)||e.classList.contains(cp)})),backdrop:n.find((function(e){return e.classList.contains(sp)}))}}function Wp(e){var t=wp(),n=wp();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=wp();function o(n,r){var o=qp(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"===typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"===typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Hp(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild($p(r.arrow))):i.appendChild($p(r.arrow)):s&&i.removeChild(s)}return r.className=ap,r.setAttribute("data-state","hidden"),Hp(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Wp.$$tippy=!0;var Kp=1,Gp=[],Yp=[];function Jp(e,t){var n,r,o,i,a,s,u,c,l=Up(e,Object.assign({},Lp,zp(kp(t)))),f=!1,d=!1,p=!1,h=!1,v=[],m=vp(K,l.interactiveDebounce),y=Kp++,g=(c=l.plugins).filter((function(e,t){return c.indexOf(e)===t})),b={id:y,reference:e,popper:wp(),popperInstance:null,props:l,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;M("onBeforeUpdate",[b,t]),q();var n=b.props,r=Up(e,Object.assign({},n,kp(t),{ignoreAttributes:!0}));b.props=r,H(),n.interactiveDebounce!==r.interactiveDebounce&&(P(),m=vp(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?mp(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");R(),T(),x&&x(n,r);b.popperInstance&&(Q(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));M("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Np.isTouch&&!b.props.touch,o=dp(b.props.duration,0,Lp.duration);if(e||t||n||r)return;if(j().hasAttribute("disabled"))return;if(M("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,C()&&(w.style.visibility="visible");T(),z(),b.state.isMounted||(w.style.transition="none");if(C()){var i=A(),a=i.box,u=i.content;Sp([a,u],0)}s=function(){var e;if(b.state.isVisible&&!h){if(h=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,C()&&b.props.animation){var t=A(),n=t.box,r=t.content;Sp([n,r],o),Cp([n,r],"visible")}F(),R(),yp(Yp,b),null==(e=b.popperInstance)||e.forceUpdate(),M("onMount",[b]),b.props.animation&&C()&&function(e,t){V(e,t)}(o,(function(){b.state.isShown=!0,M("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=j();e=b.props.interactive&&t===fp||"parent"===t?n.parentNode:hp(t,[n]);e.contains(w)||e.appendChild(w);b.state.isMounted=!0,Q(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=dp(b.props.duration,1,Lp.duration);if(e||t||n)return;if(M("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,h=!1,f=!1,C()&&(w.style.visibility="hidden");if(P(),U(),T(!0),C()){var o=A(),i=o.box,a=o.content;b.props.animation&&(Sp([i,a],r),Cp([i,a],"hidden"))}F(),R(),b.props.animation?C()&&function(e,t){V(e,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;_().addEventListener("mousemove",m),yp(Gp,m),m(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;X(),Z().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);Yp=Yp.filter((function(e){return e!==b})),b.state.isMounted=!1,M("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),q(),delete e._tippy,b.state.isDestroyed=!0,M("onDestroy",[b])}};if(!l.render)return b;var k=l.render(b),w=k.popper,x=k.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,e._tippy=b,w._tippy=b;var O=g.map((function(e){return e.fn(b)})),E=e.hasAttribute("aria-expanded");return H(),R(),T(),M("onCreate",[b]),l.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&_().addEventListener("mousemove",m)})),b;function D(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function S(){return"hold"===D()[0]}function C(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function j(){return u||e}function _(){var e=j().parentNode;return e?jp(e):document}function A(){return qp(w)}function N(e){return b.state.isMounted&&!b.state.isVisible||Np.isTouch||i&&"focus"===i.type?0:dp(b.props.delay,e?0:1,Lp.delay)}function T(e){void 0===e&&(e=!1),w.style.pointerEvents=b.props.interactive&&!e?"":"none",w.style.zIndex=""+b.props.zIndex}function M(e,t,n){var r;(void 0===n&&(n=!0),O.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function F(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;mp(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function R(){!E&&b.props.aria.expanded&&mp(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===j()?"true":"false"):e.removeAttribute("aria-expanded")}))}function P(){_().removeEventListener("mousemove",m),Gp=Gp.filter((function(e){return e!==m}))}function B(t){if(!Np.isTouch||!p&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ap(w,n)){if(mp(b.props.triggerTarget||e).some((function(e){return Ap(e,n)}))){if(Np.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else M("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout((function(){d=!1})),b.state.isMounted||U())}}}function L(){p=!0}function I(){p=!1}function z(){var e=_();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,lp),e.addEventListener("touchstart",I,lp),e.addEventListener("touchmove",L,lp)}function U(){var e=_();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,lp),e.removeEventListener("touchstart",I,lp),e.removeEventListener("touchmove",L,lp)}function V(e,t){var n=A().box;function r(e){e.target===n&&(_p(n,"remove",r),t())}if(0===e)return t();_p(n,"remove",a),_p(n,"add",r),a=r}function $(t,n,r){void 0===r&&(r=!1),mp(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function H(){var e;S()&&($("touchstart",W,{passive:!0}),$("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch($(e,W),e){case"mouseenter":$("mouseleave",G);break;case"focus":$(Pp?"focusout":"blur",Y);break;case"focusin":$("focusout",Y)}}))}function q(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),v=[]}function W(e){var t,n=!1;if(b.state.isEnabled&&!J(e)&&!d){var r="focus"===(null==(t=i)?void 0:t.type);i=e,u=e.currentTarget,R(),!b.state.isVisible&&Op(e)&&Gp.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||f)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(f=!n),n&&!r&&te(e)}}function K(e){var t=e.target,n=j().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:l}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=gp(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,l="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+u>i,p=r-t.bottom-c>i,h=t.left-n+l>i,v=n-t.right-f>i;return d||p||h||v}))})(r,e)&&(P(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&f||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function Y(e){b.props.trigger.indexOf("focusin")<0&&e.target!==j()||b.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function J(e){return!!Np.isTouch&&S()!==e.type.indexOf("touch")>=0}function Q(){X();var t=b.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,u=C()?qp(w).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||j()}:e,l={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},f=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},l];C()&&u&&f.push({name:"arrow",options:{element:u,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),b.popperInstance=ip(c,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function X(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return bp(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&M("onTrigger",[b,e]),z();var t=N(!0),r=D(),o=r[0],i=r[1];Np.isTouch&&"hold"===o&&i&&(t=i),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),M("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=N(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):o=requestAnimationFrame((function(){b.hide()}))}}else U()}}function Qp(e,t){void 0===t&&(t={});var n=Lp.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Mp,lp),window.addEventListener("blur",Rp);var r=Object.assign({},t,{plugins:n}),o=Dp(e).reduce((function(e,t){var n=t&&Jp(t,r);return n&&e.push(n),e}),[]);return xp(e)?o[0]:o}Qp.defaultProps=Lp,Qp.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Lp[t]=e[t]}))},Qp.currentInput=Np;Object.assign({},Hd,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Qp.setDefaultProps({render:Wp});var Xp=Qp,Zp=function(){function e(t){var n=this,r=t.editor,o=t.element,i=t.view,a=t.tippyOptions,s=void 0===a?{}:a,u=t.shouldShow;v(this,e),this.preventHide=!1,this.shouldShow=function(e){var t=e.view,n=e.state,r=e.from,o=e.to,i=n.doc,a=n.selection.empty,s=!i.textBetween(r,o).length&&vf(n.selection);return!(!t.hasFocus()||a||s)},this.mousedownHandler=function(){n.preventHide=!0},this.dragstartHandler=function(){n.hide()},this.focusHandler=function(){setTimeout((function(){return n.update(n.editor.view)}))},this.blurHandler=function(e){var t,r=e.event;n.preventHide?n.preventHide=!1:(null===r||void 0===r?void 0:r.relatedTarget)&&(null===(t=n.element.parentNode)||void 0===t?void 0:t.contains(r.relatedTarget))||n.hide()},this.editor=r,this.element=o,this.view=i,u&&(this.shouldShow=u),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=s,this.element.remove(),this.element.style.visibility="visible"}return y(e,[{key:"createTooltip",value:function(){var e=this,t=this.editor.options.element,n=!!t.parentElement;!this.tippy&&n&&(this.tippy=Xp(t,Object(o.a)({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},this.tippyOptions)),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(function(t){e.blurHandler({event:t})})))}},{key:"update",value:function(e,t){var n,r,o,i=e.state,a=e.composing,s=i.doc,u=i.selection,c=t&&t.doc.eq(s)&&t.selection.eq(u);if(!a&&!c){this.createTooltip();var l=u.ranges,f=Math.min.apply(Math,Object(J.a)(l.map((function(e){return e.$from.pos})))),d=Math.max.apply(Math,Object(J.a)(l.map((function(e){return e.$to.pos}))));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:t,from:f,to:d}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||function(){if(hf(n=i.selection)&&n instanceof ga){var t=e.nodeDOM(f);if(t)return t.getBoundingClientRect()}var n;return Gf(e,f,d)}}),this.show()):this.hide()}}},{key:"show",value:function(){var e;null===(e=this.tippy)||void 0===e||e.show()}},{key:"hide",value:function(){var e;null===(e=this.tippy)||void 0===e||e.hide()}},{key:"destroy",value:function(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}]),e}(),eh=function(e){return new Na({key:"string"===typeof e.pluginKey?new Fa(e.pluginKey):e.pluginKey,view:function(t){return new Zp(Object(o.a)({view:t},e))}})},th=(of.create({name:"bubbleMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[eh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),function(){function e(t){var n=this,r=t.editor,o=t.element,i=t.view,a=t.tippyOptions,s=void 0===a?{}:a,u=t.shouldShow;v(this,e),this.preventHide=!1,this.shouldShow=function(e){var t=e.view,n=e.state.selection,r=n.$anchor,o=n.empty,i=1===r.depth,a=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(t.hasFocus()&&o&&i&&a)},this.mousedownHandler=function(){n.preventHide=!0},this.focusHandler=function(){setTimeout((function(){return n.update(n.editor.view)}))},this.blurHandler=function(e){var t,r=e.event;n.preventHide?n.preventHide=!1:(null===r||void 0===r?void 0:r.relatedTarget)&&(null===(t=n.element.parentNode)||void 0===t?void 0:t.contains(r.relatedTarget))||n.hide()},this.editor=r,this.element=o,this.view=i,u&&(this.shouldShow=u),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=s,this.element.remove(),this.element.style.visibility="visible"}return y(e,[{key:"createTooltip",value:function(){var e=this,t=this.editor.options.element,n=!!t.parentElement;!this.tippy&&n&&(this.tippy=Xp(t,Object(o.a)({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},this.tippyOptions)),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(function(t){e.blurHandler({event:t})})))}},{key:"update",value:function(e,t){var n,r,o,i=e.state,a=i.doc,s=i.selection,u=s.from,c=s.to;t&&t.doc.eq(a)&&t.selection.eq(s)||(this.createTooltip(),(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||function(){return Gf(e,u,c)}}),this.show()):this.hide())}},{key:"show",value:function(){var e;null===(e=this.tippy)||void 0===e||e.show()}},{key:"hide",value:function(){var e;null===(e=this.tippy)||void 0===e||e.hide()}},{key:"destroy",value:function(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}]),e}()),nh=function(e){return new Na({key:"string"===typeof e.pluginKey?new Fa(e.pluginKey):e.pluginKey,view:function(t){return new th(Object(o.a)({view:t},e))}})},rh=(of.create({name:"floatingMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[nh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),["editor"]),oh=function(e){b(n,e);var t=E(n);function n(){var e;return v(this,n),(e=t.apply(this,arguments)).contentComponent=null,e}return y(n)}(qf),ih=function(e){var t=e.renderers;return s.a.createElement(s.a.Fragment,null,Array.from(t).map((function(e){var t=Object(l.a)(e,2),n=t[0],r=t[1];return c.a.createPortal(r.reactElement,r.element,n)})))},ah=function(e){b(n,e);var t=E(n);function n(e){var r;return v(this,n),(r=t.call(this,e)).editorContentRef=s.a.createRef(),r.state={renderers:new Map},r}return y(n,[{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(){this.init()}},{key:"init",value:function(){var e=this.props.editor;if(e&&e.options.element){if(e.contentComponent)return;var t=this.editorContentRef.current;t.append.apply(t,Object(J.a)(e.options.element.childNodes)),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}},{key:"componentWillUnmount",value:function(){var e=this.props.editor;if(e&&(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,e.options.element.firstChild)){var t=document.createElement("div");t.append.apply(t,Object(J.a)(e.options.element.childNodes)),e.setOptions({element:t})}}},{key:"render",value:function(){var e=this.props,t=(e.editor,i(e,rh));return s.a.createElement(s.a.Fragment,null,s.a.createElement("div",Object(o.a)({ref:this.editorContentRef},t)),s.a.createElement(ih,{renderers:this.state.renderers}))}}]),n}(s.a.Component),sh=s.a.memo(ah),uh=Object(a.createContext)({onDragStart:void 0}),ch=function(){return Object(a.useContext)(uh)};s.a.forwardRef((function(e,t){var n=ch().onDragStart,r=e.as||"div";return s.a.createElement(r,Object(o.a)(Object(o.a)({},e),{},{ref:t,"data-node-view-wrapper":"",onDragStart:n,style:Object(o.a)({whiteSpace:"normal"},e.style)}))}));function lh(){var e=Object(a.useState)(0),t=Object(l.a)(e,2)[1];return function(){return t((function(e){return e+1}))}}var fh=of.create({name:"placeholder",addOptions:function(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Na({props:{decorations:function(t){var n=t.doc,r=t.selection,o=e.editor.isEditable||!e.options.showOnlyWhenEditable,i=r.anchor,a=[];return o?(n.descendants((function(t,n){var r=i>=n&&i<=n+t.nodeSize,o=!t.isLeaf&&!t.childCount;if((r||!e.options.showOnlyCurrent)&&o){var s=[e.options.emptyNodeClass];e.editor.isEmpty&&s.push(e.options.emptyEditorClass);var u=hc.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"===typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n,hasAnchor:r}):e.options.placeholder});a.push(u)}return e.options.includeChildren})),yc.create(n,a)):null}}})]}}),dh=Jf.create({name:"text",group:"inline"});function ph(e){this.j={},this.jr=[],this.jd=null,this.t=e}ph.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=hh();var o=gh(this,e);return o?(Object.assign(r.j,o.j),r.jr.append(o.jr),r.jr=o.jd,r.t=n||o.t):r.t=n,this.j[e]=r,r}};var hh=function(){return new ph},vh=function(e){return new ph(e)},mh=function(e,t,n){e.j[t]||(e.j[t]=n)},yh=function(e,t,n){e.jr.push([t,n])},gh=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var o=e.jr[r][0],i=e.jr[r][1];if(o.test(t))return i}return e.jd},bh=function(e,t,n){for(var r=0;r<t.length;r++)mh(e,t[r],n)},kh=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],o=t[n][1];mh(e,r,o)}},wh=function(e,t,n,r){for(var o,i=0,a=t.length;i<a&&(o=e.j[t[i]]);)e=o,i++;if(i>=a)return[];for(;i<a-1;)o=r(),mh(e,t[i],o),e=o,i++;mh(e,t[a-1],n)},xh="DOMAIN",Oh="LOCALHOST",Eh="TLD",Dh="NUM",Sh="PROTOCOL",Ch="MAILTO",jh="WS",_h="NL",Ah="OPENBRACE",Nh="OPENBRACKET",Th="OPENANGLEBRACKET",Mh="OPENPAREN",Fh="CLOSEBRACE",Rh="CLOSEBRACKET",Ph="CLOSEANGLEBRACKET",Bh="CLOSEPAREN",Lh="AMPERSAND",Ih="APOSTROPHE",zh="ASTERISK",Uh="AT",Vh="BACKSLASH",$h="BACKTICK",Hh="CARET",qh="COLON",Wh="COMMA",Kh="DOLLAR",Gh="DOT",Yh="EQUALS",Jh="EXCLAMATION",Qh="HYPHEN",Xh="PERCENT",Zh="PIPE",ev="PLUS",tv="POUND",nv="QUERY",rv="QUOTE",ov="SEMI",iv="SLASH",av="TILDE",sv="UNDERSCORE",uv="SYM",cv=Object.freeze({__proto__:null,DOMAIN:xh,LOCALHOST:Oh,TLD:Eh,NUM:Dh,PROTOCOL:Sh,MAILTO:Ch,WS:jh,NL:_h,OPENBRACE:Ah,OPENBRACKET:Nh,OPENANGLEBRACKET:Th,OPENPAREN:Mh,CLOSEBRACE:Fh,CLOSEBRACKET:Rh,CLOSEANGLEBRACKET:Ph,CLOSEPAREN:Bh,AMPERSAND:Lh,APOSTROPHE:Ih,ASTERISK:zh,AT:Uh,BACKSLASH:Vh,BACKTICK:$h,CARET:Hh,COLON:qh,COMMA:Wh,DOLLAR:Kh,DOT:Gh,EQUALS:Yh,EXCLAMATION:Jh,HYPHEN:Qh,PERCENT:Xh,PIPE:Zh,PLUS:ev,POUND:tv,QUERY:nv,QUOTE:rv,SEMI:ov,SLASH:iv,TILDE:av,UNDERSCORE:sv,SYM:uv}),lv="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw verm\xf6gensberater-ctb verm\xf6gensberatung-pwb \u03b5\u03bb \u03b5\u03c5 \u0431\u0433 \u0431\u0435\u043b \u0434\u0435\u0442\u0438 \u0435\u044e \u043a\u0430\u0442\u043e\u043b\u0438\u043a \u043a\u043e\u043c \u049b\u0430\u0437 \u043c\u043a\u0434 \u043c\u043e\u043d \u043c\u043e\u0441\u043a\u0432\u0430 \u043e\u043d\u043b\u0430\u0439\u043d \u043e\u0440\u0433 \u0440\u0443\u0441 \u0440\u0444 \u0441\u0430\u0439\u0442 \u0441\u0440\u0431 \u0443\u043a\u0440 \u10d2\u10d4 \u0570\u0561\u0575 \u05d9\u05e9\u05e8\u05d0\u05dc \u05e7\u05d5\u05dd \u0627\u0628\u0648\u0638\u0628\u064a \u0627\u062a\u0635\u0627\u0644\u0627\u062a \u0627\u0631\u0627\u0645\u0643\u0648 \u0627\u0644\u0627\u0631\u062f\u0646 \u0627\u0644\u0628\u062d\u0631\u064a\u0646 \u0627\u0644\u062c\u0632\u0627\u0626\u0631 \u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629 \u0627\u0644\u0639\u0644\u064a\u0627\u0646 \u0627\u0644\u0645\u063a\u0631\u0628 \u0627\u0645\u0627\u0631\u0627\u062a \u0627\u06cc\u0631\u0627\u0646 \u0628\u0627\u0631\u062a \u0628\u0627\u0632\u0627\u0631 \u0628\u06be\u0627\u0631\u062a \u0628\u064a\u062a\u0643 \u067e\u0627\u06a9\u0633\u062a\u0627\u0646 \u0680\u0627\u0631\u062a \u062a\u0648\u0646\u0633 \u0633\u0648\u062f\u0627\u0646 \u0633\u0648\u0631\u064a\u0629 \u0634\u0628\u0643\u0629 \u0639\u0631\u0627\u0642 \u0639\u0631\u0628 \u0639\u0645\u0627\u0646 \u0641\u0644\u0633\u0637\u064a\u0646 \u0642\u0637\u0631 \u0643\u0627\u062b\u0648\u0644\u064a\u0643 \u0643\u0648\u0645 \u0645\u0635\u0631 \u0645\u0644\u064a\u0633\u064a\u0627 \u0645\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u0627 \u0645\u0648\u0642\u0639 \u0647\u0645\u0631\u0627\u0647 \u0915\u0949\u092e \u0928\u0947\u091f \u092d\u093e\u0930\u0924 \u092d\u093e\u0930\u0924\u092e\u094d \u092d\u093e\u0930\u094b\u0924 \u0938\u0902\u0917\u0920\u0928 \u09ac\u09be\u0982\u09b2\u09be \u09ad\u09be\u09b0\u09a4 \u09ad\u09be\u09f0\u09a4 \u0a2d\u0a3e\u0a30\u0a24 \u0aad\u0abe\u0ab0\u0aa4 \u0b2d\u0b3e\u0b30\u0b24 \u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe \u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8 \u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd \u0c2d\u0c3e\u0c30\u0c24\u0c4d \u0cad\u0cbe\u0cb0\u0ca4 \u0d2d\u0d3e\u0d30\u0d24\u0d02 \u0dbd\u0d82\u0d9a\u0dcf \u0e04\u0e2d\u0e21 \u0e44\u0e17\u0e22 \u0ea5\u0eb2\u0ea7 \ub2f7\ub137 \ub2f7\ucef4 \uc0bc\uc131 \ud55c\uad6d \u30a2\u30de\u30be\u30f3 \u30b0\u30fc\u30b0\u30eb \u30af\u30e9\u30a6\u30c9 \u30b3\u30e0 \u30b9\u30c8\u30a2 \u30bb\u30fc\u30eb \u30d5\u30a1\u30c3\u30b7\u30e7\u30f3 \u30dd\u30a4\u30f3\u30c8 \u307f\u3093\u306a \u4e16\u754c \u4e2d\u4fe1 \u4e2d\u56fd \u4e2d\u570b \u4e2d\u6587\u7f51 \u4e9a\u9a6c\u900a \u4f01\u4e1a \u4f5b\u5c71 \u4fe1\u606f \u5065\u5eb7 \u516b\u5366 \u516c\u53f8 \u516c\u76ca \u53f0\u6e7e \u53f0\u7063 \u5546\u57ce \u5546\u5e97 \u5546\u6807 \u5609\u91cc \u5609\u91cc\u5927\u9152\u5e97 \u5728\u7ebf \u5927\u4f17\u6c7d\u8f66 \u5927\u62ff \u5929\u4e3b\u6559 \u5a31\u4e50 \u5bb6\u96fb \u5e7f\u4e1c \u5fae\u535a \u6148\u5584 \u6211\u7231\u4f60 \u624b\u673a \u62db\u8058 \u653f\u52a1 \u653f\u5e9c \u65b0\u52a0\u5761 \u65b0\u95fb \u65f6\u5c1a \u66f8\u7c4d \u673a\u6784 \u6de1\u9a6c\u9521 \u6e38\u620f \u6fb3\u9580 \u70b9\u770b \u79fb\u52a8 \u7ec4\u7ec7\u673a\u6784 \u7f51\u5740 \u7f51\u5e97 \u7f51\u7ad9 \u7f51\u7edc \u8054\u901a \u8bfa\u57fa\u4e9a \u8c37\u6b4c \u8d2d\u7269 \u901a\u8ca9 \u96c6\u56e2 \u96fb\u8a0a\u76c8\u79d1 \u98de\u5229\u6d66 \u98df\u54c1 \u9910\u5385 \u9999\u683c\u91cc\u62c9 \u9999\u6e2f".split(" "),fv=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,dv=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,pv=/\uFE0F/,hv=/\d/,vv=/\s/;function mv(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=hh(),n=vh(Dh),r=vh(xh),o=hh(),i=vh(jh),a=[[hv,r],[fv,r],[dv,r],[pv,r]],s=function(){var e=vh(xh);return e.j={"-":o},e.jr=[].concat(a),e},u=function(e){var t=s();return t.t=e,t};kh(t,[["'",vh(Ih)],["{",vh(Ah)],["[",vh(Nh)],["<",vh(Th)],["(",vh(Mh)],["}",vh(Fh)],["]",vh(Rh)],[">",vh(Ph)],[")",vh(Bh)],["&",vh(Lh)],["*",vh(zh)],["@",vh(Uh)],["`",vh($h)],["^",vh(Hh)],[":",vh(qh)],[",",vh(Wh)],["$",vh(Kh)],[".",vh(Gh)],["=",vh(Yh)],["!",vh(Jh)],["-",vh(Qh)],["%",vh(Xh)],["|",vh(Zh)],["+",vh(ev)],["#",vh(tv)],["?",vh(nv)],['"',vh(rv)],["/",vh(iv)],[";",vh(ov)],["~",vh(av)],["_",vh(sv)],["\\",vh(Vh)]]),mh(t,"\n",vh(_h)),yh(t,vv,i),mh(i,"\n",hh()),yh(i,vv,i);for(var c=0;c<lv.length;c++)wh(t,lv[c],u(Eh),s);var l=s(),f=s(),d=s(),p=s();wh(t,"file",l,s),wh(t,"ftp",f,s),wh(t,"http",d,s),wh(t,"mailto",p,s);var h=s(),v=vh(Sh),m=vh(Ch);mh(f,"s",h),mh(f,":",v),mh(d,"s",h),mh(d,":",v),mh(l,":",v),mh(h,":",v),mh(p,":",m);for(var y=s(),g=0;g<e.length;g++)wh(t,e[g],y,s);return mh(y,":",v),wh(t,"localhost",u(Oh),s),yh(t,hv,n),yh(t,fv,r),yh(t,dv,r),yh(t,pv,r),yh(n,hv,n),yh(n,fv,r),yh(n,dv,r),yh(n,pv,r),mh(n,"-",o),mh(r,"-",o),mh(o,"-",o),yh(r,hv,r),yh(r,fv,r),yh(r,dv,r),yh(r,pv,r),yh(o,hv,r),yh(o,fv,r),yh(o,dv,r),yh(o,pv,r),t.jd=vh(uv),t}function yv(e){return yv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yv(e)}var gv={defaultProtocol:"http",events:null,format:kv,formatHref:kv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function bv(e){e=e||{},this.defaultProtocol="defaultProtocol"in e?e.defaultProtocol:gv.defaultProtocol,this.events="events"in e?e.events:gv.events,this.format="format"in e?e.format:gv.format,this.formatHref="formatHref"in e?e.formatHref:gv.formatHref,this.nl2br="nl2br"in e?e.nl2br:gv.nl2br,this.tagName="tagName"in e?e.tagName:gv.tagName,this.target="target"in e?e.target:gv.target,this.rel="rel"in e?e.rel:gv.rel,this.validate="validate"in e?e.validate:gv.validate,this.truncate="truncate"in e?e.truncate:gv.truncate,this.className="className"in e?e.className:gv.className,this.attributes=e.attributes||gv.attributes,this.ignoreTags=[];for(var t=("ignoreTags"in e?e.ignoreTags:gv.ignoreTags),n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function kv(e){return e}bv.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),rel:this.get("rel",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e),truncate:this.get("truncate",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var r,o=this[e];if(!o)return o;switch(yv(o)){case"function":return o(t,n.t);case"object":return"function"===typeof(r=n.t in o?o[n.t]:gv[e])?r(t,n.t):r}return o},getObject:function(e,t,n){var r=this[e];return"function"===typeof r?r(t,n.t):r}};function wv(){}function xv(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var o in n)r[o]=n[o];r.constructor=t,t.prototype=r}(wv,n,t),n}wv.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gv.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var Ov=xv("email",{isLink:!0}),Ev=xv("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Dv=xv("text"),Sv=xv("nl"),Cv=xv("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gv.defaultProtocol,t=this.tk,n=!1,r=!1,o=[],i=0;t[i].t===Sh;)n=!0,o.push(t[i].v),i++;for(;t[i].t===iv;)r=!0,o.push(t[i].v),i++;for(;i<t.length;i++)o.push(t[i].v);return o=o.join(""),n||r||(o="".concat(e,"://").concat(o)),o},hasProtocol:function(){return this.tk[0].t===Sh}}),jv=Object.freeze({__proto__:null,MultiToken:wv,Base:wv,createTokenClass:xv,MailtoEmail:Ov,Email:Ev,Text:Dv,Nl:Sv,Url:Cv});function _v(){var e=hh(),t=hh(),n=hh(),r=hh(),o=hh(),i=hh(),a=hh(),s=vh(Cv),u=hh(),c=vh(Cv),l=vh(Cv),f=hh(),d=hh(),p=hh(),h=hh(),v=hh(),m=vh(Cv),y=vh(Cv),g=vh(Cv),b=vh(Cv),k=hh(),w=hh(),x=hh(),O=hh(),E=hh(),D=hh(),S=vh(Ev),C=hh(),j=vh(Ev),_=vh(Ov),A=hh(),N=hh(),T=hh(),M=hh(),F=vh(Sv);mh(e,_h,F),mh(e,Sh,t),mh(e,Ch,n),mh(t,iv,r),mh(r,iv,o),mh(e,Eh,i),mh(e,xh,i),mh(e,Oh,s),mh(e,Dh,i),mh(o,Eh,l),mh(o,xh,l),mh(o,Dh,l),mh(o,Oh,l),mh(i,Gh,a),mh(E,Gh,D),mh(a,Eh,s),mh(a,xh,i),mh(a,Dh,i),mh(a,Oh,i),mh(D,Eh,S),mh(D,xh,E),mh(D,Dh,E),mh(D,Oh,E),mh(s,Gh,a),mh(S,Gh,D),mh(s,qh,u),mh(s,iv,l),mh(u,Dh,c),mh(c,iv,l),mh(S,qh,C),mh(C,Dh,j);var R=[Lh,zh,Uh,Vh,$h,Hh,Kh,xh,Yh,Qh,Oh,Dh,Xh,Zh,ev,tv,Sh,iv,uv,av,Eh,sv],P=[Ih,Ph,Fh,Rh,Bh,qh,Wh,Gh,Jh,Th,Ah,Nh,Mh,nv,rv,ov];mh(l,Ah,d),mh(l,Nh,p),mh(l,Th,h),mh(l,Mh,v),mh(f,Ah,d),mh(f,Nh,p),mh(f,Th,h),mh(f,Mh,v),mh(d,Fh,l),mh(p,Rh,l),mh(h,Ph,l),mh(v,Bh,l),mh(m,Fh,l),mh(y,Rh,l),mh(g,Ph,l),mh(b,Bh,l),mh(k,Fh,l),mh(w,Rh,l),mh(x,Ph,l),mh(O,Bh,l),bh(d,R,m),bh(p,R,y),bh(h,R,g),bh(v,R,b),bh(d,P,k),bh(p,P,w),bh(h,P,x),bh(v,P,O),bh(m,R,m),bh(y,R,y),bh(g,R,g),bh(b,R,b),bh(m,P,m),bh(y,P,y),bh(g,P,g),bh(b,P,b),bh(k,R,m),bh(w,R,y),bh(x,R,g),bh(O,R,b),bh(k,P,k),bh(w,P,w),bh(x,P,x),bh(O,P,O),bh(l,R,l),bh(f,R,l),bh(l,P,f),bh(f,P,f),mh(n,Eh,_),mh(n,xh,_),mh(n,Dh,_),mh(n,Oh,_),bh(_,R,_),bh(_,P,A),bh(A,R,_),bh(A,P,A);var B=[Lh,Ih,zh,Vh,$h,Hh,Fh,Kh,xh,Yh,Qh,Dh,Ah,Xh,Zh,ev,tv,nv,iv,uv,av,Eh,sv];return bh(i,B,N),mh(i,Uh,T),bh(s,B,N),mh(s,Uh,T),bh(a,B,N),bh(N,B,N),mh(N,Uh,T),mh(N,Gh,M),bh(M,B,N),mh(T,Eh,E),mh(T,xh,E),mh(T,Dh,E),mh(T,Oh,S),e}function Av(e,t,n){var r=n[0].s,o=n[n.length-1].e;return new e(t.substr(r,o-r),n)}var Nv="undefined"!==typeof console&&console&&console.warn||function(){},Tv={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function Mv(e){if(Tv.initialized&&Nv('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");Tv.customProtocols.push(e)}function Fv(e){return Tv.initialized||function(){Tv.scanner={start:mv(Tv.customProtocols),tokens:cv},Tv.parser={start:_v(),tokens:jv};for(var e={createTokenClass:xv},t=0;t<Tv.pluginQueue.length;t++)Tv.pluginQueue[t][1]({scanner:Tv.scanner,parser:Tv.parser,utils:e});Tv.initialized=!0}(),function(e,t,n){for(var r=n.length,o=0,i=[],a=[];o<r;){for(var s=e,u=null,c=null,l=0,f=null,d=-1;o<r&&!(u=gh(s,n[o].t));)a.push(n[o++]);for(;o<r&&(c=u||gh(s,n[o].t));)u=null,(s=c).accepts()?(d=0,f=s):d>=0&&d++,o++,l++;if(d<0)for(var p=o-l;p<o;p++)a.push(n[p]);else{a.length>0&&(i.push(Av(Dv,t,a)),a=[]),o-=d,l-=d;var h=f.t,v=n.slice(o-l,o);i.push(Av(h,t,v))}}return a.length>0&&i.push(Av(Dv,t,a)),i}(Tv.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var o=e.charCodeAt(r),i=void 0,a=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,o=[],i=0,a=0;a<r;){for(var s=e,u=null,c=0,l=null,f=-1,d=-1;a<r&&(u=gh(s,n[a]));)(s=u).accepts()?(f=0,d=0,l=s):f>=0&&(f+=n[a].length,d++),c+=n[a].length,i+=n[a].length,a++;i-=f,a-=d,c-=f,o.push({t:l.t,v:t.substr(i-c,c),s:i-c,e:i})}return o}(Tv.scanner.start,e))}function Rv(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Fv(e),r=[],o=0;o<n.length;o++){var i=n[o];!i.isLink||t&&i.t!==t||r.push(i.toObject())}return r}function Pv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Fv(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function Bv(e){return new Na({key:new Fa("autolink"),appendTransaction:function(t,n,r){var i=t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc),a=t.some((function(e){return e.getMeta("preventAutolink")}));if(i&&!a){var s=r.tr,u=function(e,t){var n=new la(e);return t.forEach((function(e){e.steps.forEach((function(e){n.step(e)}))})),n}(n.doc,Object(J.a)(t)),c=u.mapping,l=function(e){var t=e.mapping,n=e.steps,r=[];return t.maps.forEach((function(e,o){var i=[];if(e.ranges.length)e.forEach((function(e,t){i.push({from:e,to:t})}));else{var a=n[o],s=a.from,u=a.to;if(void 0===s||void 0===u)return;i.push({from:s,to:u})}i.forEach((function(e){var n=e.from,i=e.to,a=t.slice(o).map(n,-1),s=t.slice(o).map(i),u=t.invert().map(a,-1),c=t.invert().map(s);r.push({oldRange:{from:u,to:c},newRange:{from:a,to:s}})}))})),Wf(r)}(u);if(l.forEach((function(t){var i=t.oldRange,a=t.newRange;Kf(i.from,i.to,n.doc).filter((function(t){return t.mark.type===e.type})).forEach((function(t){var o=Kf(c.map(t.from),c.map(t.to),r.doc).filter((function(t){return t.mark.type===e.type}));if(o.length){var i=o[0],a=n.doc.textBetween(t.from,t.to,void 0," "),u=r.doc.textBetween(i.from,i.to,void 0," "),l=Pv(a),f=Pv(u);l&&!f&&s.removeMark(i.from,i.to,e.type)}})),function(e,t,n){var r=[];return e.nodesBetween(t.from,t.to,(function(e,t){n(e)&&r.push({node:e,pos:t})})),r}(r.doc,a,(function(e){return e.isTextblock})).forEach((function(t){Rv(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((function(e){return e.isLink})).filter((function(t){return!e.validate||e.validate(t.value)})).map((function(e){return Object(o.a)(Object(o.a)({},e),{},{from:t.pos+e.start+1,to:t.pos+e.end+1})})).filter((function(e){var t=a.from>=e.from&&a.from<=e.to,n=a.to>=e.from&&a.to<=e.to;return t||n})).forEach((function(t){s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),s.steps.length)return s}}})}var Lv,Iv=Yf.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate:function(){this.options.protocols.forEach(Mv)},inclusive:function(){return this.options.autolink},addOptions:function(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes:function(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:function(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["a",zl(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setLink:function(t){return function(n){return(0,n.chain)().setMark(e.name,t).setMeta("preventAutolink",!0).run()}},toggleLink:function(t){return function(n){return(0,n.chain)().toggleMark(e.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},unsetLink:function(){return function(t){return(0,t.chain)().unsetMark(e.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}},addPasteRules:function(){var e,t=this;return[(e={find:function(e){return Rv(e).filter((function(e){return!t.options.validate||t.options.validate(e.value)})).filter((function(e){return e.isLink})).map((function(e){return{text:e.value,index:e.start,data:e}}))},type:this.type,getAttributes:function(e){var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}},new Zl({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=$l(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],u=o[0],c=r.to;if(s){var l=u.search(/\S/),f=r.from+u.indexOf(s),d=f+s.length;if(Kf(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>f})).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+s.length,a.addMark(r.from+l,c,e.type.create(i||{})),a.removeStoredMark(e.type)}}}))]},addProseMirrorPlugins:function(){var e,t=[];return this.options.autolink&&t.push(Bv({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new Na({key:new Fa("handleClickLink"),props:{handleClick:function(t,n,r){var o,i=Vf(t.state,e.type.name);return!(!(null===(o=r.target)||void 0===o?void 0:o.closest("a"))||!i.href)&&(window.open(i.href,i.target),!0)}}}))),this.options.linkOnPaste&&t.push(function(e){return new Na({key:new Fa("handlePasteLink"),props:{handlePaste:function(t,n,r){if(t.state.selection.empty)return!1;var o="";r.content.forEach((function(e){o+=e.textContent}));var i=Rv(o).find((function(e){return e.isLink&&e.value===o}));return!(!o||!i)&&(e.editor.commands.setMark(e.type,{href:i.href}),!0)}}})}({editor:this.editor,type:this.type})),t}}),zv=Jf.create({name:"paragraph",priority:1e3,addOptions:function(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML:function(){return[{tag:"p"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["p",zl(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setParagraph:function(){return function(t){return t.commands.setNode(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-0":function(){return e.editor.commands.setParagraph()}}}}),Uv=Jf.create({name:"doc",topNode:!0,content:"block+"}),Vv=/^\s*>\s$/,$v=Jf.create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["blockquote",zl(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBlockquote:function(){return function(t){return t.commands.wrapIn(e.name)}},toggleBlockquote:function(){return function(t){return t.commands.toggleWrap(e.name)}},unsetBlockquote:function(){return function(t){return t.commands.lift(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-b":function(){return e.editor.commands.toggleBlockquote()}}},addInputRules:function(){return[(e={find:Vv,type:this.type},new Jl({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=$l(e.getAttributes,void 0,o)||{},a=n.tr.delete(r.from,r.to),s=a.doc.resolve(r.from).blockRange(),u=s&&Ui(s,e.type,i);if(!u)return null;a.wrap(s,u);var c=a.doc.resolve(r.from-1).nodeBefore;c&&c.type===e.type&&Yi(a.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,c))&&a.join(r.from-1)}}))];var e}});var Hv=["title","titleId"];function qv(){return qv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qv.apply(this,arguments)}function Wv(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Kv(e,t){var n=e.title,r=e.titleId,o=Wv(e,Hv);return a.createElement("svg",qv({id:"loader-1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"40px",height:"40px",viewBox:"0 0 50 50",style:{enableBackground:"new 0 0 50 50"},xmlSpace:"preserve",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,Lv||(Lv=a.createElement("path",{d:"M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"},a.createElement("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"0.6s",repeatCount:"indefinite"}))))}var Gv,Yv=a.forwardRef(Kv),Jv=(n.p,["title","titleId"]);function Qv(){return Qv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qv.apply(this,arguments)}function Xv(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Zv(e,t){var n=e.title,r=e.titleId,o=Xv(e,Jv);return a.createElement("svg",Qv({xmlns:"http://www.w3.org/2000/svg",height:24,width:24,viewBox:"0 0 24 24",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,Gv||(Gv=a.createElement("g",{strokeLinecap:"round",strokeWidth:2,fill:"none",strokeLinejoin:"round",className:"nc-icon-wrapper"},a.createElement("polygon",{points:"7 21 2 22 3 17 18 2 22 6 7 21"}))))}var em,tm=a.forwardRef(Zv),nm=(n.p,function(e){var t,n,r,i,s,u=Object(a.useContext)(D),c=u.member,f=u.postId,p=u.dispatchAction,v=u.avatarSaturation,m=Object(a.useState)(!(!e.isReply&&!e.isEdit)),y=Object(l.a)(m,2),g=y[0],b=y[1],k=Object(a.useRef)(null),w=Object(a.useState)("default"),x=Object(l.a)(w,2),O=x[0],E=x[1],C=Object(a.useState)(!1),j=Object(l.a)(C,2),_=j[0],A=j[1],N=e.comment,T=e.commentsCount,M=null!==(t=null===c||void 0===c?void 0:c.name)&&void 0!==t?t:null===N||void 0===N||null===(n=N.member)||void 0===n?void 0:n.name,F=null!==(r=null===c||void 0===c?void 0:c.bio)&&void 0!==r?r:null===N||void 0===N||null===(i=N.member)||void 0===i?void 0:i.bio,R=null;"sending"===O?R=Object(S.jsx)(Yv,{className:"w-[24px] h-[24px] fill-white"}):"sent"===O&&(R=null),s=e.isReply?{placeholder:"Reply to comment",autofocus:!0}:e.isEdit?{placeholder:"Edit this comment",autofocus:!1,content:e.comment.html}:{placeholder:0===T?"Start the conversation":"Join the discussion",autofocus:!1};var P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(a.useState)(null),r=Object(l.a)(n,2),o=r[0],i=r[1],s=lh();return Object(a.useEffect)((function(){var t=!0,n=new oh(e);return i(n),n.on("transaction",(function(){requestAnimationFrame((function(){requestAnimationFrame((function(){t&&s()}))}))})),function(){n.destroy(),t=!1}}),t),o}(Object(o.a)({},function(e){var t=e.placeholder,n=e.autofocus,r=void 0!==n&&n,o=e.content,i=void 0===o?"":o;return{extensions:[Uv,dh,zv,Iv.configure({openOnClick:!1}),fh.configure({placeholder:t}),$v.configure({})],content:i,autofocus:r,editorProps:{attributes:{class:"gh-comment-content focus:outline-0"}},parseOptions:{preserveWhitespace:"full"}}}(s))),B=function(){for(var e=-100,t=k.current,n=t.ownerDocument.defaultView;n!==window;)for(var r=n.parent,o=0;o<r.frames.length;o++)if(r.frames[o]===n){var i,a=Object(ze.a)(r.document.getElementsByTagName("iframe"));try{for(a.s();!(i=a.n()).done;){var s=i.value;if(s.contentWindow===n)e+=s.getBoundingClientRect().top+n.pageYOffset}}catch(u){a.e(u)}finally{a.f()}n=r;break}return t.getBoundingClientRect().top+window.pageYOffset+e},L=Object(a.useCallback)((function(){M||e.isEdit?b(!0):(A(!0),P.commands.blur(),p("openPopup",{type:"addDetailsDialog",callback:function(t){t?P.commands.focus():e.close&&e.close(),A(!1)}}))}),[P,p,M,e]);Object(a.useEffect)((function(){var t;if(P)return e.isReply&&(t=setTimeout((function(){window.scrollTo({top:B(),left:0,behavior:"smooth"})}),100)),e.isEdit?(P.chain().focus().command((function(e){var t=e.tr;return e.commands.setTextSelection({from:t.doc.content.size,to:t.doc.content.size})})).run(),function(){t&&clearTimeout(t)}):function(){t&&clearTimeout(t)}}),[P,e]);var I=Object(a.useCallback)(h(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!P.isEmpty){t.next=2;break}return t.abrupt("return");case 2:if(E("sending"),!e.isReply){t.next=17;break}return t.prev=4,t.next=7,p("addReply",{parent:e.parent,reply:{post_id:f,status:"published",html:P.getHTML()}});case 7:P.chain().clearContent().blur().run(),E("sent"),e.close(),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(4),console.error(t.t0);case 15:t.next=35;break;case 17:if(!e.isEdit){t.next=24;break}return t.next=20,p("editComment",{comment:{id:e.comment.id,html:P.getHTML()},parent:e.parent});case 20:E("sent"),e.close(),t.next=35;break;case 24:return t.prev=24,t.next=27,p("addComment",{post_id:f,status:"published",html:P.getHTML()});case 27:P.chain().clearContent().blur().run(),b(!1),E("sent"),t.next=35;break;case 32:t.prev=32,t.t1=t.catch(24),console.error(t.t1);case 35:return t.abrupt("return",!1);case 36:case"end":return t.stop()}}),t,null,[[4,12],[24,32]])}))),[P,e,p,f]);Object(a.useEffect)((function(){if(P){P.on("focus",(function(){L()})),P.on("blur",(function(){null!==P&&void 0!==P&&P.isEmpty&&(b(!1),e.isReply&&e.close&&!_&&e.close())}));var t=function(t){if(t.metaKey||t.ctrlKey)"Enter"===t.key&&null!==P&&void 0!==P&&P.isFocused&&I();else{if("Escape"!==t.key){for(var n=document.activeElement;n&&"IFRAME"===n.tagName&&n.contentDocument;)n=n.contentDocument.activeElement;var r=n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"IFRAME"===n.tagName||"true"===n.contentEditable);return"c"!==t.key||e.isEdit||e.isReply||null!==P&&void 0!==P&&P.isFocused||r?void 0:(null===P||void 0===P||P.commands.focus(),void window.scrollTo({top:B(),left:0,behavior:"smooth"}))}null!==P&&void 0!==P&&P.isFocused&&!_&&(e.close?e.close():null===P||void 0===P||P.commands.blur())}};return window.addEventListener("keydown",t,{passive:!0}),function(){window.removeEventListener("keydown",t,{passive:!0}),null===P||void 0===P||P.off("focus"),null===P||void 0===P||P.off("blur")}}}),[P,e,L,_,I]);var z,U=function(e){P.isFocused&&e.preventDefault()},V=function(e){P.isFocused&&e.stopPropagation()},$=function(e,t){var n;e.preventDefault(),A(!0),null===P||void 0===P||P.commands.blur(),p("openPopup",{type:"addDetailsDialog",bioAutofocus:null!==(n=t.bioAutofocus)&&void 0!==n&&n,callback:function(){null===P||void 0===P||P.commands.focus(),A(!1)}})};z=e.isReply?Object(S.jsxs)(S.Fragment,{children:[Object(S.jsx)("span",{className:"hidden sm:inline",children:"Add "}),Object(S.jsx)("span",{className:"capitalize sm:normal-case",children:"reply"})]}):e.isEdit?"Save":Object(S.jsxs)(S.Fragment,{children:[Object(S.jsx)("span",{className:"hidden sm:inline",children:"Add "}),Object(S.jsx)("span",{className:"capitalize sm:normal-case",children:"comment"})]}),"sending"===O&&(z=null);var H=rr()&&e.isReply||rr()&&e.isEdit,q=e.isReply||e.isEdit||g||_;return Object(S.jsx)(S.Fragment,{children:Object(S.jsx)("form",{ref:k,onClick:function(e){P.isFocused||P.commands.focus()},onMouseDown:U,onTouchStart:U,className:"\n transition duration-200\n pt-3 pb-2 px-3\n -mt-[12px] -mx-3 mb-10\n rounded-md\n ".concat(q?"cursor-default":"cursor-pointer","\n ").concat(!e.isReply&&!e.isEdit&&"-mt-[4px]","\n ").concat((e.isReply||e.isEdit)&&"-mt-[16px]","\n ").concat(H&&"pl-1","\n "),children:Object(S.jsxs)("div",{className:"w-full relative",children:[Object(S.jsx)("div",{className:"pr-[1px] font-sans leading-normal dark:text-neutral-300",children:Object(S.jsxs)("div",{className:"transition-[padding] duration-150 delay-100 relative w-full pl-[52px] ".concat(H&&"pl-0"," ").concat(q&&"pt-[64px] pl-[1px] sm:pl-[52px]"),children:[Object(S.jsx)("div",{className:"\n transition-all duration-150 delay-100\n w-full px-3 py-4\n bg-transparent dark:bg-[rgba(255,255,255,0.08)]\n rounded-md border-none border border-slate-50 dark:border-none\n font-sans text-[16.5px] leading-normal dark:text-neutral-300 \n focus:outline-0\n shadow-form hover:shadow-formxl dark:shadow-transparent\n ".concat(0===T&&"placeholder:text-neutral-700","\n ").concat(q?"cursor-text min-h-[144px] pb-[68px] pt-2":"cursor-pointer overflow-hidden min-h-[48px] hover:border-slate-300","\n ").concat(e.isEdit&&"cursor-text","\n ").concat(!M&&"pointer-events-none","\n "),children:Object(S.jsx)(sh,{onMouseDown:V,onTouchStart:V,editor:P})}),Object(S.jsxs)("div",{className:" absolute right-[9px] bottom-[9px] flex space-x-4 transition-[opacity] duration-150 ",children:[(e.isEdit||e.isReply)&&Object(S.jsx)("button",{type:"button",onClick:e.close,className:"font-sans text-sm font-medium ml-2.5 text-neutral-500 dark:text-neutral-400",children:"Cancel"}),Object(S.jsxs)("button",{className:"\n flex items-center justify-center w-auto sm:w-32 h-[39px]\n transition-[opacity] duration-150\n bg-neutral-900 dark:bg-[rgba(255,255,255,0.9)]\n rounded-[6px] border\n py-2 px-3\n text-sm text-center font-sans font-semibold\n text-white dark:text-neutral-800\n ",type:"button",onClick:I,children:[Object(S.jsx)("span",{children:R}),z&&Object(S.jsx)("span",{children:z})]})]})]})}),Object(S.jsxs)("div",{className:"absolute top-1 left-0 flex justify-start items-center h-12",children:[Object(S.jsx)("div",{className:"mr-3",children:Object(S.jsx)(yo,{comment:N,saturation:v,className:"pointer-events-none"})}),Object(S.jsx)("div",{children:Object(S.jsxs)(lo,{show:q,enter:"transition duration-500 delay-100 ease-in-out",enterFrom:"opacity-0 -translate-x-2",enterTo:"opacity-100 translate-x-0",leave:"transition-none duration-0",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:[Object(S.jsx)("div",{className:"text-[17px] font-sans font-bold tracking-tight text-[rgb(23,23,23)] dark:text-[rgba(255,255,255,0.85)]",onClick:function(e){$(e,{bioAutofocus:!1})},children:M||"Anonymous"}),Object(S.jsx)("div",{className:"flex items-baseline",children:Object(S.jsxs)("button",{className:"group transition duration-150 flex justify-start items-center font-sans text-[14px] tracking-tight text-neutral-400 hover:text-neutral-500 dark:text-[rgba(255,255,255,0.5)] ".concat(!F&&"text-neutral-300 hover:text-neutral-400"),onClick:function(e){$(e,{bioAutofocus:!0})},children:[F||"Add your expertise",F&&Object(S.jsx)(tm,{className:"transition-all duration-100 ease-out opacity-0 -translate-x-[6px] group-hover:opacity-100 group-hover:translate-x-0 w-[12px] h-[12px] stroke-neutral-500 ml-1"})]})})]})})]})]})})})}),rm=["title","titleId"];function om(){return om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},om.apply(this,arguments)}function im(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function am(e,t){var n=e.title,r=e.titleId,o=im(e,rm);return a.createElement("svg",om({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"black",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,em||(em=a.createElement("path",{d:"M8.00025 13.8739L2.46073 8.09636C1.97388 7.60989 1.65255 6.98248 1.54231 6.30312C1.43208 5.62376 1.53853 4.92694 1.84658 4.31148V4.31148C2.07887 3.84703 2.41819 3.44443 2.83659 3.13684C3.25499 2.82925 3.74049 2.62547 4.25308 2.54231C4.76567 2.45914 5.29069 2.49896 5.78488 2.65849C6.27906 2.81802 6.72827 3.09269 7.09549 3.45987L8.00025 4.36406L8.90502 3.45987C9.27224 3.09269 9.72145 2.81802 10.2156 2.65849C10.7098 2.49896 11.2348 2.45914 11.7474 2.54231C12.26 2.62547 12.7455 2.82925 13.1639 3.13684C13.5823 3.44443 13.9216 3.84703 14.1539 4.31148C14.4616 4.9267 14.5678 5.62311 14.4577 6.30208C14.3476 6.98105 14.0267 7.60817 13.5404 8.09462L8.00025 13.8739Z",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})))}var sm=a.forwardRef(am);n.p;var um,cm=function(e){var t=Object(a.useContext)(D),n=t.dispatchAction,r=t.member,o=t.commentsEnabled,i=Object(a.useState)(""),s=Object(l.a)(i,2),u=s[0],c=s[1],f="paid"===o,d=r&&!!r.paid,p=r&&(d||!f),h=p?"button":"span",v="cursor-pointer";return p||(v="cursor-text"),Object(S.jsxs)(h,{className:"group transition-all duration-50 ease-linear flex font-sans items-center text-sm outline-0 ".concat(e.comment.liked?"text-neutral-900 dark:text-[rgba(255,255,255,0.9)]":"text-neutral-400 dark:text-[rgba(255,255,255,0.5)]"," ").concat(!e.comment.liked&&p&&"hover:text-neutral-600"," ").concat(v),onClick:function(){p&&(e.comment.liked?n("unlikeComment",e.comment):(n("likeComment",e.comment),c("animate-heartbeat"),setTimeout((function(){c("")}),400)))},children:[Object(S.jsx)(sm,{className:u+" mr-[6px] ".concat(e.comment.liked?"fill-neutral-900 stroke-neutral-900 dark:fill-white dark:stroke-white":"stroke-neutral-400 dark:stroke-[rgba(255,255,255,0.5)"," ").concat(!e.comment.liked&&p&&"group-hover:stroke-neutral-600"," transition duration-50 ease-linear")}),e.comment.count.likes]})},lm=["title","titleId"];function fm(){return fm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fm.apply(this,arguments)}function dm(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function pm(e,t){var n=e.title,r=e.titleId,o=dm(e,lm);return a.createElement("svg",fm({width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"black",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,um||(um=a.createElement("path",{d:"M7.17463 2.98741C7.17439 2.7888 7.11434 2.59487 7.00229 2.43088C6.89025 2.26689 6.73141 2.14046 6.54647 2.06805C6.36153 1.99564 6.15907 1.98061 5.96546 2.02492C5.77186 2.06923 5.5961 2.17083 5.46107 2.31648L1.86192 6.21418C1.69351 6.39677 1.60001 6.63606 1.60001 6.88445C1.60001 7.13284 1.69351 7.37213 1.86192 7.55472L5.45909 11.4524C5.59412 11.5981 5.76988 11.6997 5.96349 11.744C6.15709 11.7883 6.35955 11.7733 6.54449 11.7009C6.72943 11.6284 6.88827 11.502 7.00032 11.338C7.11236 11.174 7.17242 10.9801 7.17265 10.7815V8.86164H9.12703C10.438 8.86164 11.6953 9.38241 12.6222 10.3094C13.5492 11.2364 14.07 12.4937 14.07 13.8046V9.85023C14.07 8.53927 13.5492 7.28201 12.6222 6.35502C11.6953 5.42803 10.438 4.90726 9.12703 4.90726H7.17265L7.17463 2.98741Z",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})))}var hm=a.forwardRef(pm);n.p;var vm,mm,ym,gm=function(e){return Object(a.useContext)(D).member?Object(S.jsxs)("button",{disabled:!!e.disabled,className:"group transition-all duration-50 ease-linear flex font-sans items-center text-sm outline-0 ".concat(e.isReplying?"text-neutral-900 dark:text-[rgba(255,255,255,0.9)]":"text-neutral-400 dark:text-[rgba(255,255,255,0.5)] hover:text-neutral-600"),onMouseDown:function(e){e.preventDefault()},onClick:e.toggleReply,children:[Object(S.jsx)(hm,{className:"mr-[6px] ".concat(e.isReplying?"fill-neutral-900 stroke-neutral-900 dark:fill-white dark:stroke-white":"stroke-neutral-400 dark:stroke-[rgba(255,255,255,0.5)] group-hover:stroke-neutral-600"," transition duration-50 ease-linear")}),"Reply"]}):null},bm=function(e){var t=Object(a.useContext)(D).dispatchAction,n="published"!==e.comment.status;return Object(S.jsx)("div",{className:"flex flex-col",children:n?Object(S.jsxs)("button",{className:"w-full text-left text-[14px]",onClick:function(n){t("showComment",e.comment),e.close()},children:[Object(S.jsx)("span",{children:"Show "}),Object(S.jsx)("span",{className:"hidden sm:inline",children:"comment"})]}):Object(S.jsxs)("button",{className:"w-full text-left text-[14px]",onClick:function(n){t("hideComment",e.comment),e.close()},children:[Object(S.jsx)("span",{children:"Hide "}),Object(S.jsx)("span",{className:"hidden sm:inline",children:"comment"})]})})},km=function(e){var t=Object(a.useContext)(D).dispatchAction;return Object(S.jsxs)("div",{className:"flex flex-col",children:[Object(S.jsx)("button",{className:"w-full mb-3 text-left text-[14px]",onClick:e.toggleEdit,disabled:e.disableEditing,children:"Edit"}),Object(S.jsx)("button",{className:"w-full text-left text-[14px] text-red-600",onClick:function(n){t("deleteComment",e.comment),e.close()},children:"Delete"})]})},wm=function(e){var t=Object(a.useContext)(D).dispatchAction;return Object(S.jsx)("div",{className:"flex flex-col",children:Object(S.jsxs)("button",{className:"w-full text-left text-[14px]",onClick:function(){t("openPopup",{type:"reportDialog",comment:e.comment}),e.close()},children:[Object(S.jsx)("span",{children:"Report "}),Object(S.jsx)("span",{className:"hidden sm:inline",children:"comment"})]})})},xm=function(e){var t,n=Object(a.useContext)(D),r=n.member,o=n.admin,i=e.comment,s=r&&(null===(t=i.member)||void 0===t?void 0:t.uuid)===(null===r||void 0===r?void 0:r.uuid),u=!!o,c=Object(a.useRef)();Object(a.useEffect)((function(){var t,n,r=function(){e.close()};window.addEventListener("click",r,{passive:!0});var o=null===(t=c.current)||void 0===t||null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;return o&&o!==window&&o.addEventListener("click",r,{passive:!0}),function(){window.removeEventListener("click",r,{passive:!0}),o&&o!==window&&o.removeEventListener("click",r,{passive:!0})}}),[e]),Object(a.useEffect)((function(){var t=function(t){"Escape"===t.key&&e.close()};return window.addEventListener("keydown",t,{passive:!0}),function(){window.removeEventListener("keydown",t,{passive:!0})}}));var l=null;if("published"===i.status)l=s?Object(S.jsx)(km,{comment:i,close:e.close,toggleEdit:e.toggleEdit,disableEditing:e.disableEditing}):u?Object(S.jsx)(bm,{comment:i,close:e.close}):Object(S.jsx)(wm,{comment:i,close:e.close});else{if(!u)return null;l=Object(S.jsx)(bm,{comment:i,close:e.close})}return Object(S.jsx)("div",{ref:c,onClick:function(e){e.stopPropagation()},children:Object(S.jsx)("div",{className:"min-w-min sm:min-w-[150px] bg-white absolute font-sans rounded py-3 pl-4 pr-8 shadow-lg text-sm whitespace-nowrap z-10 dark:bg-zinc-900 dark:text-white outline-0",children:l})})},Om=["title","titleId"];function Em(){return Em=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Em.apply(this,arguments)}function Dm(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Sm(e,t){var n=e.title,r=e.titleId,o=Dm(e,Om);return a.createElement("svg",Em({width:16,height:16,viewBox:"0 0 16 16",fill:"black",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,vm||(vm=a.createElement("path",{d:"M3 12C3.82843 12 4.5 11.3284 4.5 10.5C4.5 9.67157 3.82843 9 3 9C2.17157 9 1.5 9.67157 1.5 10.5C1.5 11.3284 2.17157 12 3 12Z"})),mm||(mm=a.createElement("path",{d:"M8 12C8.82843 12 9.5 11.3284 9.5 10.5C9.5 9.67157 8.82843 9 8 9C7.17157 9 6.5 9.67157 6.5 10.5C6.5 11.3284 7.17157 12 8 12Z"})),ym||(ym=a.createElement("path",{d:"M13 12C13.8284 12 14.5 11.3284 14.5 10.5C14.5 9.67157 13.8284 9 13 9C12.1716 9 11.5 9.67157 11.5 10.5C11.5 11.3284 12.1716 12 13 12Z"})))}var Cm=a.forwardRef(Sm),jm=(n.p,function(e){var t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],o=n[1],i=Object(a.useContext)(D),s=i.member,u=i.admin,c=e.comment,f=!!s&&"published"===c.status||!!u;return s?Object(S.jsxs)("div",{className:"relative",children:[f?Object(S.jsx)("button",{onClick:function(){o((function(e){return!e}))},className:"outline-0",children:Object(S.jsx)(Cm,{className:"transition duration-50 ease-linear gh-comments-icon gh-comments-icon-more outline-0 fill-neutral-400 dark:fill-rgba(255,255,255,0.5) hover:fill-neutral-600"})}):null,r?Object(S.jsx)(xm,{comment:c,close:function(){o(!1)},toggleEdit:e.toggleEdit,disableEditing:e.disableEditing}):null]}):null}),_m=function(e){var t=e.loadMore,n=e.count;return Object(S.jsxs)("button",{className:"group w-full text-neutral-700 font-semibold px-0 pt-0 pb-3 mt-10 sm:mt-0 mb-10 font-sans text-md text-left dark:text-white flex items-center ",onClick:t,children:[Object(S.jsxs)("span",{className:"whitespace-nowrap mr-4",children:["\u2193 Show ",n," more replies"]}),Object(S.jsx)("span",{className:"transition-[background-color] duration-200 ease-out inline-block w-full bg-neutral-100 dark:bg-[rgba(255,255,255,0.08)] group-hover:bg-neutral-200 rounded h-[2px] mt-[3px]"})]})},Am=function(e){var t=e.comment,n=Object(a.useContext)(D).dispatchAction,r=t.count.replies-t.replies.length;return Object(S.jsxs)("div",{children:[t.replies.map((function(e){return Object(S.jsx)(Mm,{comment:e,parent:t,isReply:!0},e.id)})),r>0&&Object(S.jsx)(_m,{count:r,loadMore:function(){n("loadMoreReplies",{comment:t})}})]})},Nm=["updateIsEditing","isEditing"];function Tm(e){return e.comment.edited_at?Object(S.jsxs)("span",{children:[Object(S.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"}),"Edited"]}):null}var Mm=function(e){var t,n=e.updateIsEditing,r=void 0===n?null:n,o=e.isEditing,s=i(e,Nm),u=Object(a.useState)(!1),c=Object(l.a)(u,2),f=c[0],p=c[1],v=Object(a.useState)(!1),m=Object(l.a)(v,2),y=m[0],g=m[1],b=Object(a.useContext)(D),k=b.admin,w=b.avatarSaturation,x=b.member,O=b.commentsEnabled,E=b.dispatchAction,C=s.comment;Object(a.useEffect)((function(){null===r||void 0===r||r(y||f)}),[r,y,f]);var j,_=function(){var e=h(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(y){e.next=3;break}return e.next=3,E("loadMoreReplies",{comment:C,limit:"all"});case 3:g((function(e){return!e}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=C.replies&&C.replies.length>0,N="published"!==C.status,T={__html:C.html};N&&(j=k&&"hidden"===C.status?"This comment has been hidden.":"This comment has been removed.");var M="paid"===O,F=x&&!!x.paid,R=x&&(F||!M),P=x&&C.member&&C.member.uuid===x.uuid?x.bio:null===C||void 0===C||null===(t=C.member)||void 0===t?void 0:t.bio;return f?Object(S.jsx)(nm,{comment:C,close:function(){p(!1)},parent:s.parent,isEdit:!0}):Object(S.jsxs)(lo,{appear:!0,show:!0,enter:"transition-opacity duration-300 ease-out",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:[Object(S.jsx)("div",{className:"flex flex-row ".concat(A?"mb-2 sm:mb-4":"mb-6 sm:mb-10"),children:Object(S.jsxs)("div",{children:[Object(S.jsxs)("div",{className:"flex items-center mb-2 h-12",children:[Object(S.jsx)("div",{className:"mr-3",children:Object(S.jsx)(yo,{comment:C,saturation:w,isBlank:N})}),N?Object(S.jsx)("div",{children:Object(S.jsx)("p",{className:"font-sans text-[16px] leading-normal text-neutral-400 italic mt-[4px]",children:j})}):Object(S.jsxs)("div",{children:[Object(S.jsx)("h4",{className:"text-[17px] font-sans font-bold tracking-tight text-[rgb(23,23,23] dark:text-[rgba(255,255,255,0.85)]",children:C.member?C.member.name?C.member.name:"Anonymous":"Deleted member"}),Object(S.jsx)("div",{className:"flex items-baseline font-sans text-[14px] tracking-tight text-neutral-400 dark:text-[rgba(255,255,255,0.5)]",children:Object(S.jsxs)("span",{className:"inline-block max-w-full text-ellipsis overflow-hidden ...",children:[P&&Object(S.jsxs)("span",{children:[P,Object(S.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"})]}),Object(S.jsx)("span",{title:tr(C.created_at),children:er(C.created_at)}),Object(S.jsx)(Tm,{comment:C})]})})]})]}),!N&&Object(S.jsx)("div",{className:"ml-12 sm:ml-[52px] mb-2 pr-4",children:Object(S.jsx)("p",{dangerouslySetInnerHTML:T,className:"gh-comment-content font-sans leading-normal text-[16px] text-neutral-900 dark:text-[rgba(255,255,255,0.85)]"})}),Object(S.jsxs)("div",{className:"ml-12 sm:ml-[52px] flex gap-5 items-center",children:[!N&&Object(S.jsx)(cm,{comment:C}),!N&&R&&(N||!s.parent)&&Object(S.jsx)(gm,{disabled:!!o,comment:C,toggleReply:_,isReplying:y}),Object(S.jsx)(jm,{comment:C,toggleEdit:function(){p((function(e){return!e}))},disableEditing:o})]})]})}),A&&Object(S.jsx)("div",{className:"ml-11 sm:ml-14 mt-8 sm:mt-10 mb-4 sm:mb-0",children:Object(S.jsx)(Am,{comment:C})}),y&&Object(S.jsx)("div",{className:"ml-14 my-10",children:Object(S.jsx)(nm,{parent:C,close:function(){g(!1)},isReply:!0})})]})},Fm=function(e){var t=Object(a.useContext)(D),n=t.pagination,r=t.dispatchAction;if(!n)return null;var o=n.total-n.page*n.limit;return o<=0?null:Object(S.jsxs)("button",{className:"group w-full text-neutral-700 font-semibold px-0 pt-0 pb-2 mb-10 font-sans text-md text-left dark:text-white flex items-center ",onClick:function(){r("loadMoreComments")},children:[Object(S.jsxs)("span",{className:"whitespace-nowrap mr-4",children:["\u2191 Show ",o," previous comments"]}),Object(S.jsx)("span",{className:"transition-[background-color] duration-200 ease-out inline-block w-full bg-neutral-100 group-hover:bg-neutral-200 dark:bg-[rgba(255,255,255,0.05)] rounded h-[2px] mt-[3px]"})]})};var Rm,Pm,Bm=function(){return Object(S.jsx)("div",{className:"flex items-center justify-center w-full h-32",children:Object(S.jsx)(Yv,{className:"w-12 h-12 mb-6 fill-[rgb(225,225,225,0.9)] dark:fill-[rgba(255,255,255,0.6)]"})})},Lm="ghost-comments-root",Im=function(e){var t=e.title,n=e.showCount,r=e.count;if(!t&&!n&&null!==t)return null;var o=function(e){var t=e.title;return null===t?Object(S.jsxs)(S.Fragment,{children:[Object(S.jsx)("span",{className:"hidden sm:inline",children:"Member "}),Object(S.jsx)("span",{className:"capitalize sm:normal-case",children:"discussion"})]}):t},i=function(e){var t=e.showCount,n=e.count;return t?1===n?Object(S.jsx)("div",{className:"text-neutral-400 text-[1.6rem]",children:"1 comment"}):Object(S.jsxs)("div",{className:"text-neutral-400 text-[1.6rem]",children:[n," comments"]}):null};return Object(S.jsxs)("div",{className:"w-full flex justify-between items-baseline font-sans mb-10",children:[Object(S.jsx)("h2",{className:"font-bold text-[2.8rem] tracking-tight dark:text-[rgba(255,255,255,0.85)]",children:Object(S.jsx)(o,{title:t})}),Object(S.jsx)(i,{showCount:n,count:r})]})},zm=function(e){var t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],o=n[1],i=Object(a.useContext)(D),s=i.pagination,u=i.member,c=i.comments,f=i.commentCount,d=i.commentsEnabled,p=i.title,h=i.showCount,v=c.slice().reverse().map((function(e){return Object(S.jsx)(Mm,{isEditing:r,comment:e,updateIsEditing:o},e.id)})),m="paid"===d,y=u&&!!u.paid;return Object(a.useEffect)((function(){var e=document.getElementById(Lm);e&&"#ghost-comments"===window.location.hash&&0===window.scrollY&&requestAnimationFrame((function(){requestAnimationFrame((function(){e.scrollIntoView()}))}))}),[]),Object(S.jsxs)(S.Fragment,{children:[Object(S.jsx)(Im,{title:p,showCount:h,count:f}),Object(S.jsx)(Fm,{}),Object(S.jsx)("div",{className:s?"":"mt-4",children:v}),Object(S.jsx)("div",{children:r?null:u&&(y||!m)?Object(S.jsx)(nm,{commentsCount:f}):Object(S.jsx)(sr,{isFirst:0===(null===s||void 0===s?void 0:s.total),isPaid:m})})]})},Um=function(e){var t=function(e,t,n){var r=[e,t,n].map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}));return.2126*r[0]+.7152*r[1]+.0722*r[2]},n=Object(a.useContext)(D),r=n.accentColor,o=n.colorScheme,i=function(){if("light"===o)return!1;if("dark"===o)return!0;var e=getComputedStyle(document.getElementById(Lm).parentNode).getPropertyValue("color"),n=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(/,\s*/);return function(e,n){var r=t(e[0],e[1],e[2]),o=t(n[0],n[1],n[2]);return(Math.max(r,o)+.05)/(Math.min(r,o)+.05)}([255,255,255],[n[0],n[1],n[2]])<5}()?"dark":"",s={"--gh-accent-color":null!==r&&void 0!==r?r:"blue",paddingTop:0,paddingBottom:24};return Object(S.jsx)("section",{className:"ghost-display "+i,style:s,children:e.done?Object(S.jsx)(S.Fragment,{children:Object(S.jsx)(zm,{})}):Object(S.jsx)(Bm,{})})},Vm=["title","titleId"];function $m(){return $m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$m.apply(this,arguments)}function Hm(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function qm(e,t){var n=e.title,r=e.titleId,o=Hm(e,Vm);return a.createElement("svg",$m({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"gh-portal-closeicon",alt:"Close",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,Rm||(Rm=a.createElement("defs",null,a.createElement("style",null,".a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.2px !important;}"))),Pm||(Pm=a.createElement("path",{className:"a",d:"M.75 23.249l22.5-22.5M23.25 23.249L.75.749"})))}var Wm,Km=a.forwardRef(qm),Gm=(n.p,function(e){return Object(S.jsx)("button",{className:"transition-opacity duration-100 ease-out absolute top-[36px] sm:top-10 right-8 sm:right-8 opacity-20 hover:opacity-40",onClick:e.close,children:Object(S.jsx)(Km,{className:"w-[20px] h-[20px]"})})}),Ym=function(e){var t,n,r=Object(a.useRef)(null),o=Object(a.useRef)(null),i=Object(a.useContext)(D),s=i.dispatchAction,u=i.member,c=i.accentColor,f=Object(a.useState)(null!==(t=u.name)&&void 0!==t?t:""),p=Object(l.a)(f,2),v=p[0],m=p[1],y=Object(a.useState)(null!==(n=u.bio)&&void 0!==n?n:""),g=Object(l.a)(y,2),b=g[0],k=g[1],w=50;u.bio&&(w-=u.bio.length);var x=Object(a.useState)(w),O=Object(l.a)(x,2),E=O[0],C=O[1],j=Object(a.useState)({name:"",bio:""}),_=Object(l.a)(j,2),A=_[0],N=_[1],T=function(t){s("closePopup"),e.callback(t)},M=function(){var e=h(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""===v.trim()){e.next=6;break}return e.next=3,s("updateMember",{name:v,bio:b});case 3:T(!0),e.next=9;break;case 6:N({name:"Enter your name"}),m(""),null===(t=r.current)||void 0===t||t.focus();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(a.useEffect)((function(){if(!rr()){var t=setTimeout((function(){var t,n;e.bioAutofocus?null===(t=o.current)||void 0===t||t.focus():null===(n=r.current)||void 0===n||n.focus()}),200);return function(){clearTimeout(t)}}}),[r,o]);return Object(S.jsx)("div",{className:"overflow-hidden relative bg-white w-screen sm:w-[720px] h-screen sm:h-auto p-[28px] sm:p-0 rounded-none sm:rounded-xl text-center shadow-modal",onMouseDown:function(e){e.stopPropagation()},children:Object(S.jsxs)("div",{className:"flex",children:[!rr()&&Object(S.jsx)("div",{className:"flex flex-col justify-center items-center w-[40%] bg-[#1C1C1C]",children:Object(S.jsx)("div",{className:"flex flex-col",children:function(e){for(var t,n=[],r=[{avatar:"https://randomuser.me/api/portraits/men/32.jpg",name:"James Fletcher",expertise:"Full-time parent"},{avatar:"https://randomuser.me/api/portraits/women/30.jpg",name:"Naomi Schiff",expertise:"Founder @ Acme Inc"},{avatar:"https://randomuser.me/api/portraits/men/4.jpg",name:"Franz Tost",expertise:"Neurosurgeon"},{avatar:"https://randomuser.me/api/portraits/women/51.jpg",name:"Katrina Klosp",expertise:"Local resident"}],o=0;o<r.length;o++)n.push((t=r[o],Object(S.jsx)(lo,{appear:!0,enter:"transition duration-200 delay-[400ms] ease-out",enterFrom:"opacity-0 translate-y-2",enterTo:"opacity-100 translate-y-0",leave:"transition duration-200 ease-in",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-2",children:Object(S.jsxs)("div",{className:"flex flex-row justify-start items-center gap-3 my-4 pr-4",children:[Object(S.jsx)("div",{className:"w-10 h-10 rounded-full border-2 border-white bg-no-repeat bg-cover",style:{backgroundImage:"url(".concat(t.avatar,")")}}),Object(S.jsxs)("div",{className:"flex flex-col justify-center items-start",children:[Object(S.jsx)("div",{className:"text-base font-sans font-semibold tracking-tight text-white",children:t.name}),Object(S.jsx)("div",{className:"font-sans text-[14px] tracking-tight text-neutral-400",children:t.expertise})]})]})},t.name)));return n}()})}),Object(S.jsxs)("div",{className:"".concat(rr()?"w-full":"w-[60%]"," p-0 sm:p-8"),children:[Object(S.jsxs)("h1",{className:"font-sans font-bold tracking-tight text-[24px] mb-1 text-black text-center sm:text-left",children:["Complete your profile",Object(S.jsx)("span",{className:"hidden sm:inline",children:"."})]}),Object(S.jsx)("p",{className:"font-sans text-base text-neutral-500 pr-0 sm:pr-10 leading-9 text-center sm:text-left",children:"Add context to your comment, share your name and expertise to foster a healthy discussion."}),Object(S.jsxs)("section",{className:"mt-8 text-left",children:[Object(S.jsxs)("div",{className:"flex flex-row mb-2 justify-between",children:[Object(S.jsx)("label",{htmlFor:"comments-name",className:"font-sans font-medium text-sm",children:"Name"}),Object(S.jsx)(lo,{show:!!A.name,enter:"transition duration-300 ease-out",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-100 ease-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:Object(S.jsx)("div",{className:"font-sans text-sm text-red-500",children:A.name})})]}),Object(S.jsx)("input",{id:"comments-name",className:"transition-[border-color] duration-200 font-sans px-3 rounded border border-neutral-200 focus:border-neutral-300 w-full outline-0 h-[42px] flex items-center ".concat(A.name&&"border-red-500 focus:border-red-500"),type:"text",name:"name",ref:r,value:v,placeholder:"Jamie Larson",onChange:function(e){m(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(m(e.target.value),M())},maxLength:"64"}),Object(S.jsxs)("div",{className:"flex flex-row mt-6 mb-2 justify-between",children:[Object(S.jsx)("label",{htmlFor:"comments-name",className:"font-sans font-medium text-sm",children:"Expertise"}),Object(S.jsxs)("div",{className:"font-sans text-sm text-neutral-400 ".concat(0===E&&"text-red-500"),children:[Object(S.jsx)("b",{children:E})," characters left"]})]}),Object(S.jsx)("input",{id:"comments-bio",className:"transition-[border-color] duration-200 font-sans px-3 rounded border border-neutral-200 focus:border-neutral-300 w-full outline-0 h-[42px] flex items-center ".concat(0===E&&"border-red-500 focus:border-red-500"),type:"text",name:"bio",ref:o,value:b,placeholder:"Head of Marketing at Acme, Inc",onChange:function(e){var t=e.target.value;C(50-t.length),k(t)},onKeyDown:function(e){"Enter"===e.key&&(k(e.target.value),M())},maxLength:50}),Object(S.jsx)("button",{className:"transition-opacity duration-200 ease-linear w-full h-[44px] mt-8 px-8 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] opacity-100 hover:opacity-90",style:{backgroundColor:null!==c&&void 0!==c?c:"#000000"},onClick:M,children:"Save"})]})]}),Object(S.jsx)(Gm,{close:function(){return T(!1)}})]})})},Jm=["title","titleId"];function Qm(){return Qm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qm.apply(this,arguments)}function Xm(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Zm(e,t){var n=e.title,r=e.titleId,o=Xm(e,Jm);return a.createElement("svg",Qm({width:"26px",height:"26px",viewBox:"-1 -1 26 26",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},o),n?a.createElement("title",{id:r},n):null,Wm||(Wm=a.createElement("g",{id:"check-circle",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{className:"animated-check-circle",d:"M19.6004116,2.71490714 C17.5353801,1.0196018 14.8927356,0 12,0 C5.38938053,0 0,5.38938053 0,12 C0,18.6106195 5.38938053,24 12,24 C18.6106195,24 24,18.6106195 24,12 C24,9.71681416 23.3628319,7.59292035 22.2743363,5.78761062 L11.0442478,17.0442478 L5.49557522,11.4955752",id:"Shape",stroke:"#FFFFFF",strokeWidth:2}))))}var ey=a.forwardRef(Zm),ty=(n.p,{addDetailsDialog:Ym,reportDialog:function(e){var t=Object(a.useState)("default"),n=Object(l.a)(t,2),r=n[0],o=n[1],i="bg-red-600";"sent"===r&&(i="bg-green-600");var s="Yes";"sending"===r?s="Sending":"sent"===r&&(s="Sent");var u=null;"sending"===r?u=Object(S.jsx)(Yv,{className:"w-[24px] h-[24px] mr-2 fill-white"}):"sent"===r&&(u=Object(S.jsx)(ey,{className:"w-[16px] h-[16px] mr-2"}));var c=Object(a.useContext)(D).dispatchAction,f=function(e){c("closePopup")};return Object(S.jsxs)("div",{className:"relative bg-white w-screen sm:w-[500px] h-screen sm:h-auto p-[28px] sm:p-8 rounded-none sm:rounded-xl text-center shadow-modal",onMouseDown:function(e){e.stopPropagation()},children:[Object(S.jsx)("h1",{className:"font-sans font-bold tracking-tight text-[24px] mb-1 text-black",children:"You sure you want to report?"}),Object(S.jsx)("p",{className:"font-sans text-base text-neutral-500 px-4 leading-9",children:"Your request will be sent to the owner of this site."}),Object(S.jsxs)("div",{className:"mt-10",children:[Object(S.jsxs)("button",{className:"transition duration-200 ease-linear w-full h-[44px] px-8 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] ".concat(i),onClick:function(t){t.stopPropagation(),o("sending"),setTimeout((function(){o("sent"),c("reportComment",e.comment),setTimeout((function(){f()}),750)}),1e3)},children:[u,s]}),Object(S.jsxs)("p",{className:"font-sans font-medium text-[1.45rem] text-neutral-500 mt-4 -mb-1",children:["No, ",Object(S.jsx)("button",{className:"font-sans underline",onClick:f,children:"I've changed my mind"})]})]})]})}}),ny=function(e){var t=Object(a.useContext)(D).dispatchAction,n=function(n){t("closePopup"),e.callback&&e.callback(!1)};return Object(a.useEffect)((function(){var e=function(e){"Escape"===e.key&&n()};return window.addEventListener("keydown",e,{passive:!0}),function(){window.removeEventListener("keydown",e,{passive:!0})}})),Object(S.jsx)(lo,{show:e.show,appear:!0,children:Object(S.jsx)(A,{type:"fixed",children:Object(S.jsx)("div",{children:Object(S.jsx)(lo.Child,{enter:"transition duration-200 linear",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-200 linear",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:Object(S.jsx)("div",{className:"fixed top-0 left-0 overflow-hidden w-screen h-screen flex pt-0 sm:pt-12 justify-center bg-gradient-to-b from-[rgba(0,0,0,0.2)] to-rgba(0,0,0,0.1) backdrop-blur-[2px]",onMouseDown:n,children:Object(S.jsx)(lo.Child,{enter:"transition duration-200 delay-150 linear",enterFrom:"translate-y-4 opacity-0",enterTo:"translate-y-0 opacity-100",leave:"transition duration-200 linear",leaveFrom:"translate-y-0 opacity-100",leaveTo:"translate-y-4 opacity-0",children:e.children})})})})})})},ry=["type"];function oy(e){var t=Object(a.useContext)(D).popup,n=Object(a.useState)(t),r=Object(l.a)(n,2),s=r[0],u=r[1];if(Object(a.useEffect)((function(){null!==t&&u(t)}),[t,u]),!s||!s.type)return null;var c=null!==t&&void 0!==t?t:s,f=c.type,d=i(c,ry),p=ty[f];if(!p)return console.warn("Unknown popup of type ",f),null;var h=t===s;return Object(S.jsx)(ny,{show:h,callback:d.callback,children:Object(S.jsx)(p,Object(o.a)({},d))})}function iy(e){var t=e.adminUrl,n=e.onLoad;return Object(S.jsx)("iframe",{"data-frame":"admin-auth",src:t+"auth-frame/",style:{display:"none"},title:"auth-frame",onLoad:n})}function ay(e){var t=e.done;e.appVersion;return Object(S.jsx)(A,{children:Object(S.jsx)(Um,{done:t})})}function sy(e){var t=e.dsn,n=e.children;return t?Object(S.jsx)(Rn,{children:n}):Object(S.jsx)(S.Fragment,{children:n})}var uy=function(e){b(n,e);var t=E(n);function n(e){var r;return v(this,n),(r=t.call(this,e)).state={action:"init:running",initStatus:"running",member:null,admin:null,comments:null,pagination:null,popupNotification:null,customSiteUrl:e.customSiteUrl,postId:e.postId,popup:null,accentColor:e.accentColor},r.adminApi=null,r.GhostApi=null,r}return y(n,[{key:"initSetup",value:function(){var e=h(d().mark((function e(){var t,n,r,o,i,a,s,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.fetchApiData();case 3:return t=e.sent,n=t.site,r=t.member,e.next=8,this.fetchComments();case 8:o=e.sent,i=o.comments,a=o.pagination,s=o.count,u={site:n,member:r,action:"init:success",initStatus:"success",comments:i,pagination:a,commentCount:s},this.setState(u),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),console.error("[Comments] Failed to initialize:",e.t0),this.setState({action:"init:failed",initStatus:"failed"});case 20:case"end":return e.stop()}}),e,this,[[0,16]])})));return function(){return e.apply(this,arguments)}}()},{key:"initAdminAuth",value:function(){var e=h(d().mark((function e(){var t,n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.adminApi=this.setupAdminAPI(),t=null,e.prev=3,e.next=6,this.adminApi.getUser();case 6:t=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),console.warn("[Comments] Failed to fetch current admin user:",e.t0);case 12:n={admin:t},this.setState(n),e.next=19;break;case 16:e.prev=16,e.t1=e.catch(0),console.error("[Comments] Failed to initialize admin authentication:",e.t1);case 19:case"end":return e.stop()}}),e,this,[[0,16],[3,9]])})));return function(){return e.apply(this,arguments)}}()},{key:"dispatchAction",value:function(){var e=h(d().mark((function e(t,n){var r,o,i=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this.timeoutId),this.setState({action:"".concat(t,":running")}),e.prev=2,e.next=5,Jn({action:t,data:n,state:this.state,api:this.GhostApi,adminApi:this.adminApi});case 5:r=e.sent,this.setState(r),r&&r.action&&!r.action.includes(":failed")&&(this.timeoutId=setTimeout((function(){i.setState({action:""})}),2e3)),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(2),console.error(e.t0),o=Xn({type:"".concat(t,":failed"),autoHide:!0,closeable:!0,status:"error",state:this.state,meta:{error:e.t0}}),this.setState({action:"".concat(t,":failed"),popupNotification:o});case 15:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fetchApiData",value:function(){var e=h(d().mark((function e(){var t,n,r,o,i,a,s,u;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.siteUrl,r=t.customSiteUrl,o=t.apiUrl,i=t.apiKey,e.prev=1,this.GhostApi=this.props.api||ar({siteUrl:n,apiUrl:o,apiKey:i}),e.next=5,this.GhostApi.init();case 5:return a=e.sent,s=a.site,u=a.member,this.setupSentry({site:s}),e.abrupt("return",{site:s,member:u});case 12:if(e.prev=12,e.t0=e.catch(1),!ir(["dev","test"],{customSiteUrl:r})){e.next=16;break}return e.abrupt("return",{});case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[1,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"fetchComments",value:function(){var e=h(d().mark((function e(){var t,n,r,o,i,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.GhostApi.comments.browse({page:1,postId:this.state.postId}),n=this.GhostApi.comments.count({postId:this.state.postId}),e.next=4,Promise.all([t,n]);case 4:return r=e.sent,o=Object(l.a)(r,2),i=o[0],a=o[1],e.abrupt("return",{comments:i.comments,pagination:i.meta.pagination,count:a});case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setupAdminAPI",value:function(){var e=document.querySelector('iframe[data-frame="admin-auth"]'),t=1,n={},r=new URL(this.props.adminUrl).origin;function i(i,a){return new Promise((function(s,u){n[t+=1]=function(e,t){return e?u(e):s(t)},e.contentWindow.postMessage(JSON.stringify(Object(o.a)({uid:t,action:i},a)),r)}))}return window.addEventListener("message",(function(e){if(e.origin===r){var t=null;try{t=JSON.parse(e.data)}catch(i){return void console.error("Error parsing event data",i)}var o=n[t.uid];o&&(delete n[t.uid],o(t.error,t.result))}})),{getUser:function(){return h(d().mark((function e(){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("getUser");case 2:return t=e.sent,e.abrupt("return",t.users[0]);case 4:case"end":return e.stop()}}),e)})))()},hideComment:function(e){return h(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i("hideComment",{id:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},showComment:function(e){return h(d().mark((function t(){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i("showComment",{id:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()}}}},{key:"setupSentry",value:function(e){var t=e.site;if(ir(["test"]))return null;var n=t.portal_sentry,r=(t.portal_version,t.version),o="comments@".concat("0.6.0","|ghost@").concat(r);n&&n.dsn&&Pn({dsn:n.dsn,environment:n.env||"development",release:o,beforeSend:function(e){return function(e){var t,n,r,o,i=e.event,a=((null===i||void 0===i||null===(t=i.exception)||void 0===t||null===(n=t.values)||void 0===n||null===(r=n[0])||void 0===r||null===(o=r.stacktrace)||void 0===o?void 0:o.frames)||[]).map((function(e){return e.filename})).filter((function(e){return!!e}));return(a[a.length-1]||"").includes("@tryghost/comments")}({event:e})?e:null},allowUrls:[/https?:\/\/((www)\.)?unpkg\.com\/@tryghost\/comments/,/https?:\/\/((cdn)\.)?jsdelivr\.net\/npm\/@tryghost\/comments/]})}},{key:"getContextFromState",value:function(){var e=this,t=this.state,n=t.action,r=t.popupNotification,o=t.customSiteUrl,i=t.member,a=t.comments,s=t.pagination,u=t.commentCount,c=t.postId,l=t.admin,f=t.popup;return{action:n,popupNotification:r,customSiteUrl:o,member:i,admin:l,comments:a,pagination:s,commentCount:u,postId:c,title:this.props.title,showCount:this.props.showCount,colorScheme:this.props.colorScheme,avatarSaturation:this.props.avatarSaturation,accentColor:this.props.accentColor,commentsEnabled:this.props.commentsEnabled,appVersion:this.props.appVersion,stylesUrl:this.props.stylesUrl,publication:this.props.publication,popup:f,dispatchAction:function(t,n){return e.dispatchAction(t,n)},onAction:function(t,n){return e.dispatchAction(t,n)}}}},{key:"componentDidMount",value:function(){this.initSetup()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeoutId)}},{key:"render",value:function(){var e="success"===this.state.initStatus;return Object(S.jsx)(sy,{dsn:this.props.sentryDsn,children:Object(S.jsxs)(D.Provider,{value:this.getContextFromState(),children:[Object(S.jsx)(ay,{done:e}),Object(S.jsx)(iy,{adminUrl:this.props.adminUrl,onLoad:this.initAdminAuth.bind(this)}),Object(S.jsx)(oy,{})]})})}}]),n}(s.a.Component),cy=["siteUrl"];function ly(e){e.siteUrl;!function(){var e=document.querySelector("script[data-ghost-comments]");if(e){var t=document.createElement("div");t.id=Lm,e.parentElement.insertBefore(t,e)}else console.warn("[Comments] Comment box location was not found: could not load comments box.")}(),function(){var e=new URL(window.location.href);e.searchParams.get("token")&&(e.searchParams.delete("token"),window.history.replaceState({},document.title,e.href))}()}!function(){var e=function(){var e=document.querySelector("script[data-ghost-comments]");if(e){var t,n=e.dataset.ghostComments,r=e.dataset.key,o=e.dataset.api,i=e.dataset.admin,a=e.dataset.sentryDsn,s=e.dataset.postId,u=e.dataset.colorScheme,c=e.dataset.avatarSaturation,l=e.dataset.accentColor,f=e.dataset.appVersion,d=e.dataset.commentsEnabled;return{siteUrl:n,stylesUrl:e.dataset.styles,apiKey:r,apiUrl:o,sentryDsn:a,postId:s,adminUrl:i,colorScheme:u,avatarSaturation:c,accentColor:l,appVersion:f,commentsEnabled:d,title:"null"===e.dataset.title?null:e.dataset.title,showCount:"true"===e.dataset.count,publication:null!==(t=e.dataset.publication)&&void 0!==t?t:""}}return{}}(),t=e.siteUrl,n=i(e,cy),r=t||window.location.origin;ly({siteUrl:r}),c.a.render(Object(S.jsx)(s.a.StrictMode,{children:Object(S.jsx)(uy,Object(o.a)({siteUrl:r,customSiteUrl:t},n))}),document.getElementById(Lm))}()},,,,,,,,function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(4),o=n(7),i=n(26),a=n(10),s=n(16);function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;try{return l("",e,t,n)}catch(r){return{ERROR:"**non-serializable** (".concat(r,")")}}}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:102400,r=u(e,t);return d(r)>n?c(e,t-1,n):r}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Object(i.a)(),c=Object(r.a)(u,2),d=c[0],p=c[1];if(null===t||["number","boolean","string"].includes(typeof t)&&!Object(o.h)(t))return t;var h=f(e,t);if(!h.startsWith("[object "))return h;if(t.__sentry_skip_normalization__)return t;if(0===n)return h.replace("object ","");if(d(t))return"[Circular ~]";var v=t;if(v&&"function"===typeof v.toJSON)try{var m=v.toJSON();return l("",m,n-1,s,u)}catch(x){}var y=Array.isArray(t)?[]:{},g=0,b=Object(a.b)(t);for(var k in b)if(Object.prototype.hasOwnProperty.call(b,k)){if(g>=s){y[k]="[MaxProperties ~]";break}var w=b[k];y[k]=l(k,w,n-1,s,u),g+=1}return p(t),y}function f(t,n){try{return"domain"===t&&n&&"object"===typeof n&&n._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!==typeof e&&n===e?"[Global]":"undefined"!==typeof window&&n===window?"[Window]":"undefined"!==typeof document&&n===document?"[Document]":Object(o.m)(n)?"[SyntheticEvent]":"number"===typeof n&&n!==n?"[NaN]":void 0===n?"[undefined]":"function"===typeof n?"[Function: ".concat(Object(s.b)(n),"]"):"symbol"===typeof n?"[".concat(String(n),"]"):"bigint"===typeof n?"[BigInt: ".concat(String(n),"]"):"[object ".concat(Object.getPrototypeOf(n).constructor.name,"]")}catch(r){return"**non-serializable** (".concat(r,")")}}function d(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}}).call(this,n(21))}]);
|
|
2
|
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=12)}([function(e,t,n){"use strict";e.exports=n(11)},function(e,t,n){"use strict";e.exports=n(7)},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(8)},,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))o.call(n,c)&&(u[c]=n[c]);if(r){s=r(n);for(var f=0;f<s.length;f++)i.call(n,s[f])&&(u[s[f]]=n[s[f]])}}return u}},,,function(e,t,n){"use strict";var r=n(4),o=60103,i=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,u=60112;t.Suspense=60113;var l=60115,c=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;o=f("react.element"),i=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),a=f("react.provider"),s=f("react.context"),u=f("react.forward_ref"),t.Suspense=f("react.suspense"),l=f("react.memo"),c=f("react.lazy")}var d="function"===typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m={};function v(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function g(){}function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=v.prototype;var b=y.prototype=new g;b.constructor=y,r(b,v.prototype),b.isPureReactComponent=!0;var k={current:null},w=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function D(e,t,n){var r,i={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)w.call(t,r)&&!x.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var l=Array(u),c=0;c<u;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:o,type:e,key:a,ref:s,props:i,_owner:k.current}}function E(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var C=/\/+/g;function O(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function S(e,t,n,r,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case o:case i:u=!0}}if(u)return a=a(u=e),e=""===r?"."+O(u,0):r,Array.isArray(a)?(n="",null!=e&&(n=e.replace(C,"$&/")+"/"),S(a,t,n,"",(function(e){return e}))):null!=a&&(E(a)&&(a=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||u&&u.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+e)),t.push(a)),1;if(u=0,r=""===r?".":r+":",Array.isArray(e))for(var l=0;l<e.length;l++){var c=r+O(s=e[l],l);u+=S(s,t,n,c,a)}else if(c=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"===typeof c)for(e=c.call(e),l=0;!(s=e.next()).done;)u+=S(s=s.value,t,n,c=r+O(s,l++),a);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return u}function A(e,t,n){if(null==e)return e;var r=[],o=0;return S(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function j(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var N={current:null};function M(){var e=N.current;if(null===e)throw Error(p(321));return e}var T={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:k,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:A,forEach:function(e,t,n){A(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return A(e,(function(){t++})),t},toArray:function(e){return A(e,(function(e){return e}))||[]},only:function(e){if(!E(e))throw Error(p(143));return e}},t.Component=v,t.PureComponent=y,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(p(267,e));var i=r({},e.props),a=e.key,s=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,u=k.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)w.call(t,c)&&!x.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){l=Array(c);for(var f=0;f<c;f++)l[f]=arguments[f+2];i.children=l}return{$$typeof:o,type:e.type,key:a,ref:s,props:i,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=D,t.createFactory=function(e){var t=D.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=E,t.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:j}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return M().useCallback(e,t)},t.useContext=function(e,t){return M().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return M().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return M().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return M().useLayoutEffect(e,t)},t.useMemo=function(e,t){return M().useMemo(e,t)},t.useReducer=function(e,t,n){return M().useReducer(e,t,n)},t.useRef=function(e){return M().useRef(e)},t.useState=function(e){return M().useState(e)},t.version="17.0.2"},function(e,t,n){"use strict";var r=n(1),o=n(4),i=n(9);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));var s=new Set,u={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(u[e]=t,e=0;e<t.length;e++)s.add(t[e])}var f=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,h={},m={};function v(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new v(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new v(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new v(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new v(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new v(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new v(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function k(e,t,n,r){var o=g.hasOwnProperty(t)?g[t]:null;(null!==o?0===o.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!p.call(m,e)||!p.call(h,e)&&(d.test(e)?m[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new v(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new v(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,b);g[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=60103,D=60106,E=60107,C=60108,O=60114,S=60109,A=60110,j=60112,N=60113,M=60120,T=60115,F=60116,P=60121,R=60128,B=60129,L=60130,I=60131;if("function"===typeof Symbol&&Symbol.for){var z=Symbol.for;x=z("react.element"),D=z("react.portal"),E=z("react.fragment"),C=z("react.strict_mode"),O=z("react.profiler"),S=z("react.provider"),A=z("react.context"),j=z("react.forward_ref"),N=z("react.suspense"),M=z("react.suspense_list"),T=z("react.memo"),F=z("react.lazy"),P=z("react.block"),z("react.scope"),R=z("react.opaque.id"),B=z("react.debug_trace_mode"),L=z("react.offscreen"),I=z("react.legacy_hidden")}var _,V="function"===typeof Symbol&&Symbol.iterator;function $(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=V&&e[V]||e["@@iterator"])?e:null}function H(e){if(void 0===_)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_=t&&t[1]||""}return"\n"+_+e}var U=!1;function W(e,t){if(!e||U)return"";U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"===typeof u.stack){for(var o=u.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s])return"\n"+o[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?H(e):""}function q(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1);case 11:return e=W(e.type.render,!1);case 22:return e=W(e.type._render,!1);case 1:return e=W(e.type,!0);default:return""}}function K(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case E:return"Fragment";case D:return"Portal";case O:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case M:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case S:return(e._context.displayName||"Context")+".Provider";case j:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case T:return K(e.type);case P:return K(e._render);case F:t=e._payload,e=e._init;try{return K(e(t))}catch(n){}}return null}function J(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function G(e){e._valueTracker||(e._valueTracker=function(e){var t=Q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Y(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return o({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=J(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&k(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=J(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?oe(e,t.type,n):t.hasOwnProperty("defaultValue")&&oe(e,t.type,J(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function oe(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ie(e,t){return e=o({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ae(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+J(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return o({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ue(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:J(n)}}function le(e,t){var n=J(t.value),r=J(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ce(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var fe="http://www.w3.org/1999/xhtml",de="http://www.w3.org/2000/svg";function pe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var me,ve,ge=(ve=function(e,t){if(e.namespaceURI!==de||"innerHTML"in e)e.innerHTML=t;else{for((me=me||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=me.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ve(e,t)}))}:ve);function ye(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ke=["Webkit","ms","Moz","O"];function we(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function xe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=we(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(be).forEach((function(e){ke.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var De=o({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ee(e,t){if(t){if(De[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function Ce(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Oe(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,Ae=null,je=null;function Ne(e){if(e=ro(e)){if("function"!==typeof Se)throw Error(a(280));var t=e.stateNode;t&&(t=io(t),Se(e.stateNode,e.type,t))}}function Me(e){Ae?je?je.push(e):je=[e]:Ae=e}function Te(){if(Ae){var e=Ae,t=je;if(je=Ae=null,Ne(e),t)for(e=0;e<t.length;e++)Ne(t[e])}}function Fe(e,t){return e(t)}function Pe(e,t,n,r,o){return e(t,n,r,o)}function Re(){}var Be=Fe,Le=!1,Ie=!1;function ze(){null===Ae&&null===je||(Re(),Te())}function _e(e,t){var n=e.stateNode;if(null===n)return null;var r=io(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var Ve=!1;if(f)try{var $e={};Object.defineProperty($e,"passive",{get:function(){Ve=!0}}),window.addEventListener("test",$e,$e),window.removeEventListener("test",$e,$e)}catch(ve){Ve=!1}function He(e,t,n,r,o,i,a,s,u){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(c){this.onError(c)}}var Ue=!1,We=null,qe=!1,Ke=null,Je={onError:function(e){Ue=!0,We=e}};function Qe(e,t,n,r,o,i,a,s,u){Ue=!1,We=null,He.apply(Je,arguments)}function Ge(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ye(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Xe(e){if(Ge(e)!==e)throw Error(a(188))}function Ze(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ge(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Xe(o),e;if(i===r)return Xe(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,u=o.child;u;){if(u===n){s=!0,n=o,r=i;break}if(u===r){s=!0,r=o,n=i;break}u=u.sibling}if(!s){for(u=i.child;u;){if(u===n){s=!0,n=i,r=o;break}if(u===r){s=!0,r=i,n=o;break}u=u.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,ot,it=!1,at=[],st=null,ut=null,lt=null,ct=new Map,ft=new Map,dt=[],pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ht(e,t,n,r,o){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:o,targetContainers:[r]}}function mt(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":ut=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ft.delete(t.pointerId)}}function vt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e=ht(t,n,r,o,i),null!==t&&(null!==(t=ro(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function gt(e){var t=no(e.target);if(null!==t){var n=Ge(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ye(n)))return e.blockedOn=t,void ot(e.lanePriority,(function(){i.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function yt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ro(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){yt(e)&&n.delete(t)}function kt(){for(it=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ro(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==st&&yt(st)&&(st=null),null!==ut&&yt(ut)&&(ut=null),null!==lt&&yt(lt)&&(lt=null),ct.forEach(bt),ft.forEach(bt)}function wt(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,kt)))}function xt(e){function t(t){return wt(t,e)}if(0<at.length){wt(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&wt(st,e),null!==ut&&wt(ut,e),null!==lt&&wt(lt,e),ct.forEach(t),ft.forEach(t),n=0;n<dt.length;n++)(r=dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<dt.length&&null===(n=dt[0]).blockedOn;)gt(n),null===n.blockedOn&&dt.shift()}function Dt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Et={animationend:Dt("Animation","AnimationEnd"),animationiteration:Dt("Animation","AnimationIteration"),animationstart:Dt("Animation","AnimationStart"),transitionend:Dt("Transition","TransitionEnd")},Ct={},Ot={};function St(e){if(Ct[e])return Ct[e];if(!Et[e])return e;var t,n=Et[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ot)return Ct[e]=n[t];return e}f&&(Ot=document.createElement("div").style,"AnimationEvent"in window||(delete Et.animationend.animation,delete Et.animationiteration.animation,delete Et.animationstart.animation),"TransitionEvent"in window||delete Et.transitionend.transition);var At=St("animationend"),jt=St("animationiteration"),Nt=St("animationstart"),Mt=St("transitionend"),Tt=new Map,Ft=new Map,Pt=["abort","abort",At,"animationEnd",jt,"animationIteration",Nt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Mt,"transitionEnd","waiting","waiting"];function Rt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];o="on"+(o[0].toUpperCase()+o.slice(1)),Ft.set(r,t),Tt.set(r,o),l(o,[r])}}(0,i.unstable_now)();var Bt=8;function Lt(e){if(0!==(1&e))return Bt=15,1;if(0!==(2&e))return Bt=14,2;if(0!==(4&e))return Bt=13,4;var t=24&e;return 0!==t?(Bt=12,t):0!==(32&e)?(Bt=11,32):0!==(t=192&e)?(Bt=10,t):0!==(256&e)?(Bt=9,256):0!==(t=3584&e)?(Bt=8,t):0!==(4096&e)?(Bt=7,4096):0!==(t=4186112&e)?(Bt=6,t):0!==(t=62914560&e)?(Bt=5,t):67108864&e?(Bt=4,67108864):0!==(134217728&e)?(Bt=3,134217728):0!==(t=805306368&e)?(Bt=2,t):0!==(1073741824&e)?(Bt=1,1073741824):(Bt=8,e)}function It(e,t){var n=e.pendingLanes;if(0===n)return Bt=0;var r=0,o=0,i=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==i)r=i,o=Bt=15;else if(0!==(i=134217727&n)){var u=i&~a;0!==u?(r=Lt(u),o=Bt):0!==(s&=i)&&(r=Lt(s),o=Bt)}else 0!==(i=n&~a)?(r=Lt(i),o=Bt):0!==s&&(r=Lt(s),o=Bt);if(0===r)return 0;if(r=n&((0>(r=31-Ut(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0===(t&a)){if(Lt(t),o<=Bt)return t;Bt=o}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-Ut(t)),r|=e[n],t&=~o;return r}function zt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function _t(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Vt(24&~t))?_t(10,t):e;case 10:return 0===(e=Vt(192&~t))?_t(8,t):e;case 8:return 0===(e=Vt(3584&~t))&&(0===(e=Vt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Vt(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function Vt(e){return e&-e}function $t(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ht(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-Ut(t)]=n}var Ut=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Wt(e)/qt|0)|0},Wt=Math.log,qt=Math.LN2;var Kt=i.unstable_UserBlockingPriority,Jt=i.unstable_runWithPriority,Qt=!0;function Gt(e,t,n,r){Le||Re();var o=Xt,i=Le;Le=!0;try{Pe(o,e,t,n,r)}finally{(Le=i)||ze()}}function Yt(e,t,n,r){Jt(Kt,Xt.bind(null,e,t,n,r))}function Xt(e,t,n,r){var o;if(Qt)if((o=0===(4&t))&&0<at.length&&-1<pt.indexOf(e))e=ht(null,e,t,n,r),at.push(e);else{var i=Zt(e,t,n,r);if(null===i)o&&mt(e,r);else{if(o){if(-1<pt.indexOf(e))return e=ht(i,e,t,n,r),void at.push(e);if(function(e,t,n,r,o){switch(t){case"focusin":return st=vt(st,e,t,n,r,o),!0;case"dragenter":return ut=vt(ut,e,t,n,r,o),!0;case"mouseover":return lt=vt(lt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ct.set(i,vt(ct.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,ft.set(i,vt(ft.get(i)||null,e,t,n,r,o)),!0}return!1}(i,e,t,n,r))return;mt(e,r)}Rr(e,t,r,null,n)}}}function Zt(e,t,n,r){var o=Oe(r);if(null!==(o=no(o))){var i=Ge(o);if(null===i)o=null;else{var a=i.tag;if(13===a){if(null!==(o=Ye(i)))return o;o=null}else if(3===a){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;o=null}else i!==o&&(o=null)}}return Rr(e,t,r,o,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,o="value"in en?en.value:en.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return nn=o.slice(e,1<t?1-t:void 0)}function on(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function sn(){return!1}function un(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?an:sn,this.isPropagationStopped=sn,this}return o(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var ln,cn,fn,dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=un(dn),hn=o({},dn,{view:0,detail:0}),mn=un(hn),vn=o({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:An,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==fn&&(fn&&"mousemove"===e.type?(ln=e.screenX-fn.screenX,cn=e.screenY-fn.screenY):cn=ln=0,fn=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),gn=un(vn),yn=un(o({},vn,{dataTransfer:0})),bn=un(o({},hn,{relatedTarget:0})),kn=un(o({},dn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=o({},dn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xn=un(wn),Dn=un(o({},dn,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},On={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=On[e])&&!!t[e]}function An(){return Sn}var jn=o({},hn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=on(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Cn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:An,charCode:function(e){return"keypress"===e.type?on(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?on(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Nn=un(jn),Mn=un(o({},vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Tn=un(o({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:An})),Fn=un(o({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=o({},vn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Rn=un(Pn),Bn=[9,13,27,32],Ln=f&&"CompositionEvent"in window,In=null;f&&"documentMode"in document&&(In=document.documentMode);var zn=f&&"TextEvent"in window&&!In,_n=f&&(!Ln||In&&8<In&&11>=In),Vn=String.fromCharCode(32),$n=!1;function Hn(e,t){switch(e){case"keyup":return-1!==Bn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Un(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1;var qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function Jn(e,t,n,r){Me(r),0<(t=Lr(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qn=null,Gn=null;function Yn(e){jr(e,0)}function Xn(e){if(Y(oo(e)))return e}function Zn(e,t){if("change"===e)return t}var er=!1;if(f){var tr;if(f){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"===typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function or(){Qn&&(Qn.detachEvent("onpropertychange",ir),Gn=Qn=null)}function ir(e){if("value"===e.propertyName&&Xn(Gn)){var t=[];if(Jn(t,Gn,e,Oe(e)),e=Yn,Le)e(t);else{Le=!0;try{Fe(e,t)}finally{Le=!1,ze()}}}}function ar(e,t,n){"focusin"===e?(or(),Gn=n,(Qn=t).attachEvent("onpropertychange",ir)):"focusout"===e&&or()}function sr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Gn)}function ur(e,t){if("click"===e)return Xn(t)}function lr(e,t){if("input"===e||"change"===e)return Xn(t)}var cr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},fr=Object.prototype.hasOwnProperty;function dr(e,t){if(cr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!fr.call(t,n[r])||!cr(e[n[r]],t[n[r]]))return!1;return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hr(e,t){var n,r=pr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=pr(r)}}function mr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?mr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function vr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var yr=f&&"documentMode"in document&&11>=document.documentMode,br=null,kr=null,wr=null,xr=!1;function Dr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;xr||null==br||br!==X(r)||("selectionStart"in(r=br)&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},wr&&dr(wr,r)||(wr=r,0<(r=Lr(kr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}Rt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Rt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Rt(Pt,2);for(var Er="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Cr=0;Cr<Er.length;Cr++)Ft.set(Er[Cr],0);c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Or="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Sr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Or));function Ar(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,i,s,u,l){if(Qe.apply(this,arguments),Ue){if(!Ue)throw Error(a(198));var c=We;Ue=!1,We=null,qe||(qe=!0,Ke=c)}}(r,t,void 0,e),e.currentTarget=null}function jr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],u=s.instance,l=s.currentTarget;if(s=s.listener,u!==i&&o.isPropagationStopped())break e;Ar(o,s,l),i=u}else for(a=0;a<r.length;a++){if(u=(s=r[a]).instance,l=s.currentTarget,s=s.listener,u!==i&&o.isPropagationStopped())break e;Ar(o,s,l),i=u}}}if(qe)throw e=Ke,qe=!1,Ke=null,e}function Nr(e,t){var n=ao(t),r=e+"__bubble";n.has(r)||(Pr(t,e,2,!1),n.add(r))}var Mr="_reactListening"+Math.random().toString(36).slice(2);function Tr(e){e[Mr]||(e[Mr]=!0,s.forEach((function(t){Sr.has(t)||Fr(t,!1,e,null),Fr(t,!0,e,null)})))}function Fr(e,t,n,r){var o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,i=n;if("selectionchange"===e&&9!==n.nodeType&&(i=n.ownerDocument),null!==r&&!t&&Sr.has(e)){if("scroll"!==e)return;o|=2,i=r}var a=ao(i),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(o|=4),Pr(i,e,o,t),a.add(s))}function Pr(e,t,n,r){var o=Ft.get(t);switch(void 0===o?2:o){case 0:o=Gt;break;case 1:o=Yt;break;default:o=Xt}n=o.bind(null,t,n,e),o=void 0,!Ve||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Rr(e,t,n,r,o){var i=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var u=a.tag;if((3===u||4===u)&&((u=a.stateNode.containerInfo)===o||8===u.nodeType&&u.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=no(s)))return;if(5===(u=a.tag)||6===u){r=i=a;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Ie)return e(t,n);Ie=!0;try{Be(e,t,n)}finally{Ie=!1,ze()}}((function(){var r=i,o=Oe(n),a=[];e:{var s=Tt.get(e);if(void 0!==s){var u=pn,l=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":u=Nn;break;case"focusin":l="focus",u=bn;break;case"focusout":l="blur",u=bn;break;case"beforeblur":case"afterblur":u=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=Tn;break;case At:case jt:case Nt:u=kn;break;case Mt:u=Fn;break;case"scroll":u=mn;break;case"wheel":u=Rn;break;case"copy":case"cut":case"paste":u=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=Mn}var c=0!==(4&t),f=!c&&"scroll"===e,d=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==d&&(null!=(m=_e(h,d))&&c.push(Br(h,m,p)))),f)break;h=h.return}0<c.length&&(s=new u(s,l,null,n,o),a.push({event:s,listeners:c}))}}if(0===(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!==(16&t)||!(l=n.relatedTarget||n.fromElement)||!no(l)&&!l[eo])&&(u||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,u?(u=r,null!==(l=(l=n.relatedTarget||n.toElement)?no(l):null)&&(l!==(f=Ge(l))||5!==l.tag&&6!==l.tag)&&(l=null)):(u=null,l=r),u!==l)){if(c=gn,m="onMouseLeave",d="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=Mn,m="onPointerLeave",d="onPointerEnter",h="pointer"),f=null==u?s:oo(u),p=null==l?s:oo(l),(s=new c(m,h+"leave",u,n,o)).target=f,s.relatedTarget=p,m=null,no(o)===r&&((c=new c(d,h+"enter",l,n,o)).target=p,c.relatedTarget=f,m=c),f=m,u&&l)e:{for(d=l,h=0,p=c=u;p;p=Ir(p))h++;for(p=0,m=d;m;m=Ir(m))p++;for(;0<h-p;)c=Ir(c),h--;for(;0<p-h;)d=Ir(d),p--;for(;h--;){if(c===d||null!==d&&c===d.alternate)break e;c=Ir(c),d=Ir(d)}c=null}else c=null;null!==u&&zr(a,s,u,c,!1),null!==l&&null!==f&&zr(a,f,l,c,!0)}if("select"===(u=(s=r?oo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type)var v=Zn;else if(Kn(s))if(er)v=lr;else{v=sr;var g=ar}else(u=s.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(v=ur);switch(v&&(v=v(e,r))?Jn(a,v,n,o):(g&&g(e,s,r),"focusout"===e&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&oe(s,"number",s.value)),g=r?oo(r):window,e){case"focusin":(Kn(g)||"true"===g.contentEditable)&&(br=g,kr=r,wr=null);break;case"focusout":wr=kr=br=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,Dr(a,n,o);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":Dr(a,n,o)}var y;if(Ln)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Wn?Hn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(_n&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Wn&&(y=rn()):(tn="value"in(en=o)?en.value:en.textContent,Wn=!0)),0<(g=Lr(r,b)).length&&(b=new Dn(b,e,null,n,o),a.push({event:b,listeners:g}),y?b.data=y:null!==(y=Un(n))&&(b.data=y))),(y=zn?function(e,t){switch(e){case"compositionend":return Un(t);case"keypress":return 32!==t.which?null:($n=!0,Vn);case"textInput":return(e=t.data)===Vn&&$n?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!Ln&&Hn(e,t)?(e=rn(),nn=tn=en=null,Wn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _n&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Lr(r,"onBeforeInput")).length&&(o=new Dn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=y))}jr(a,t)}))}function Br(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Lr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=_e(e,n))&&r.unshift(Br(e,i,o)),null!=(i=_e(e,t))&&r.push(Br(e,i,o))),e=e.return}return r}function Ir(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function zr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,u=s.alternate,l=s.stateNode;if(null!==u&&u===r)break;5===s.tag&&null!==l&&(s=l,o?null!=(u=_e(n,i))&&a.unshift(Br(n,u,s)):o||null!=(u=_e(n,i))&&a.push(Br(n,u,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function _r(){}var Vr=null,$r=null;function Hr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Ur(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Wr="function"===typeof setTimeout?setTimeout:void 0,qr="function"===typeof clearTimeout?clearTimeout:void 0;function Kr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Jr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Qr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Gr=0;var Yr=Math.random().toString(36).slice(2),Xr="__reactFiber$"+Yr,Zr="__reactProps$"+Yr,eo="__reactContainer$"+Yr,to="__reactEvents$"+Yr;function no(e){var t=e[Xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||n[Xr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Qr(e);null!==e;){if(n=e[Xr])return n;e=Qr(e)}return t}n=(e=n).parentNode}return null}function ro(e){return!(e=e[Xr]||e[eo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function oo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function io(e){return e[Zr]||null}function ao(e){var t=e[to];return void 0===t&&(t=e[to]=new Set),t}var so=[],uo=-1;function lo(e){return{current:e}}function co(e){0>uo||(e.current=so[uo],so[uo]=null,uo--)}function fo(e,t){uo++,so[uo]=e.current,e.current=t}var po={},ho=lo(po),mo=lo(!1),vo=po;function go(e,t){var n=e.type.contextTypes;if(!n)return po;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function yo(e){return null!==(e=e.childContextTypes)&&void 0!==e}function bo(){co(mo),co(ho)}function ko(e,t,n){if(ho.current!==po)throw Error(a(168));fo(ho,t),fo(mo,n)}function wo(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in e))throw Error(a(108,K(t)||"Unknown",i));return o({},n,r)}function xo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||po,vo=ho.current,fo(ho,e),fo(mo,mo.current),!0}function Do(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=wo(e,t,vo),r.__reactInternalMemoizedMergedChildContext=e,co(mo),co(ho),fo(ho,e)):co(mo),fo(mo,n)}var Eo=null,Co=null,Oo=i.unstable_runWithPriority,So=i.unstable_scheduleCallback,Ao=i.unstable_cancelCallback,jo=i.unstable_shouldYield,No=i.unstable_requestPaint,Mo=i.unstable_now,To=i.unstable_getCurrentPriorityLevel,Fo=i.unstable_ImmediatePriority,Po=i.unstable_UserBlockingPriority,Ro=i.unstable_NormalPriority,Bo=i.unstable_LowPriority,Lo=i.unstable_IdlePriority,Io={},zo=void 0!==No?No:function(){},_o=null,Vo=null,$o=!1,Ho=Mo(),Uo=1e4>Ho?Mo:function(){return Mo()-Ho};function Wo(){switch(To()){case Fo:return 99;case Po:return 98;case Ro:return 97;case Bo:return 96;case Lo:return 95;default:throw Error(a(332))}}function qo(e){switch(e){case 99:return Fo;case 98:return Po;case 97:return Ro;case 96:return Bo;case 95:return Lo;default:throw Error(a(332))}}function Ko(e,t){return e=qo(e),Oo(e,t)}function Jo(e,t,n){return e=qo(e),So(e,t,n)}function Qo(){if(null!==Vo){var e=Vo;Vo=null,Ao(e)}Go()}function Go(){if(!$o&&null!==_o){$o=!0;var e=0;try{var t=_o;Ko(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),_o=null}catch(n){throw null!==_o&&(_o=_o.slice(e+1)),So(Fo,Qo),n}finally{$o=!1}}}var Yo=w.ReactCurrentBatchConfig;function Xo(e,t){if(e&&e.defaultProps){for(var n in t=o({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Zo=lo(null),ei=null,ti=null,ni=null;function ri(){ni=ti=ei=null}function oi(e){var t=Zo.current;co(Zo),e.type._context._currentValue=t}function ii(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ai(e,t){ei=e,ni=ti=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(La=!0),e.firstContext=null)}function si(e,t){if(ni!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(ni=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ti){if(null===ei)throw Error(a(308));ti=t,ei.dependencies={lanes:0,firstContext:t,responders:null}}else ti=ti.next=t;return e._currentValue}var ui=!1;function li(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ci(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function di(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function pi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hi(e,t,n,r){var i=e.updateQueue;ui=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,u=i.shared.pending;if(null!==u){i.shared.pending=null;var l=u,c=l.next;l.next=null,null===s?a=c:s.next=c,s=l;var f=e.alternate;if(null!==f){var d=(f=f.updateQueue).lastBaseUpdate;d!==s&&(null===d?f.firstBaseUpdate=c:d.next=c,f.lastBaseUpdate=l)}}if(null!==a){for(d=i.baseState,s=0,f=c=l=null;;){u=a.lane;var p=a.eventTime;if((r&u)===u){null!==f&&(f=f.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,m=a;switch(u=t,p=n,m.tag){case 1:if("function"===typeof(h=m.payload)){d=h.call(p,d,u);break e}d=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null===(u="function"===typeof(h=m.payload)?h.call(p,d,u):h)||void 0===u)break e;d=o({},d,u);break e;case 2:ui=!0}}null!==a.callback&&(e.flags|=32,null===(u=i.effects)?i.effects=[a]:u.push(a))}else p={eventTime:p,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===f?(c=f=p,l=d):f=f.next=p,s|=u;if(null===(a=a.next)){if(null===(u=i.shared.pending))break;a=u.next,u.next=null,i.lastBaseUpdate=u,i.shared.pending=null}}null===f&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=f,Vs|=s,e.lanes=s,e.memoizedState=d}}function mi(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!==typeof o)throw Error(a(191,o));o.call(r)}}}var vi=(new r.Component).refs;function gi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:o({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var yi={isMounted:function(e){return!!(e=e._reactInternals)&&Ge(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),o=pu(e),i=fi(r,o);i.payload=t,void 0!==n&&null!==n&&(i.callback=n),di(e,i),hu(e,o,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),o=pu(e),i=fi(r,o);i.tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),di(e,i),hu(e,o,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=pu(e),o=fi(n,r);o.tag=2,void 0!==t&&null!==t&&(o.callback=t),di(e,o),hu(e,r,n)}};function bi(e,t,n,r,o,i,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!dr(n,r)||!dr(o,i))}function ki(e,t,n){var r=!1,o=po,i=t.contextType;return"object"===typeof i&&null!==i?i=si(i):(o=yo(t)?vo:ho.current,i=(r=null!==(r=t.contextTypes)&&void 0!==r)?go(e,o):po),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=yi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function wi(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yi.enqueueReplaceState(t,t.state,null)}function xi(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=vi,li(e);var i=t.contextType;"object"===typeof i&&null!==i?o.context=si(i):(i=yo(t)?vo:ho.current,o.context=go(e,i)),hi(e,n,o,r),o.state=e.memoizedState,"function"===typeof(i=t.getDerivedStateFromProps)&&(gi(e,t,i,n),o.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof o.getSnapshotBeforeUpdate||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||(t=o.state,"function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&yi.enqueueReplaceState(o,o.state,null),hi(e,n,o,r),o.state=e.memoizedState),"function"===typeof o.componentDidMount&&(e.flags|=4)}var Di=Array.isArray;function Ei(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=r.refs;t===vi&&(t=r.refs={}),null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!==typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Ci(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Oi(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=qu(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Gu(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function l(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=Ei(e,t,n),r.return=e,r):((r=Ku(n.type,n.key,n.props,null,e.mode,r)).ref=Ei(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Yu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function f(e,t,n,r,i){return null===t||7!==t.tag?((t=Ju(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function d(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Gu(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case x:return(n=Ku(t.type,t.key,t.props,null,e.mode,n)).ref=Ei(e,null,t),n.return=e,n;case D:return(t=Yu(t,e.mode,n)).return=e,t}if(Di(t)||$(t))return(t=Ju(t,e.mode,n,null)).return=e,t;Ci(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==o?null:u(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case x:return n.key===o?n.type===E?f(e,t,n.props.children,r,o):l(e,t,n,r):null;case D:return n.key===o?c(e,t,n,r):null}if(Di(n)||$(n))return null!==o?null:f(e,t,n,r,null);Ci(e,n)}return null}function h(e,t,n,r,o){if("string"===typeof r||"number"===typeof r)return u(t,e=e.get(n)||null,""+r,o);if("object"===typeof r&&null!==r){switch(r.$$typeof){case x:return e=e.get(null===r.key?n:r.key)||null,r.type===E?f(t,e,r.props.children,o,r.key):l(t,e,r,o);case D:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(Di(r)||$(r))return f(t,e=e.get(n)||null,r,o,null);Ci(t,r)}return null}function m(o,a,s,u){for(var l=null,c=null,f=a,m=a=0,v=null;null!==f&&m<s.length;m++){f.index>m?(v=f,f=null):v=f.sibling;var g=p(o,f,s[m],u);if(null===g){null===f&&(f=v);break}e&&f&&null===g.alternate&&t(o,f),a=i(g,a,m),null===c?l=g:c.sibling=g,c=g,f=v}if(m===s.length)return n(o,f),l;if(null===f){for(;m<s.length;m++)null!==(f=d(o,s[m],u))&&(a=i(f,a,m),null===c?l=f:c.sibling=f,c=f);return l}for(f=r(o,f);m<s.length;m++)null!==(v=h(f,o,m,s[m],u))&&(e&&null!==v.alternate&&f.delete(null===v.key?m:v.key),a=i(v,a,m),null===c?l=v:c.sibling=v,c=v);return e&&f.forEach((function(e){return t(o,e)})),l}function v(o,s,u,l){var c=$(u);if("function"!==typeof c)throw Error(a(150));if(null==(u=c.call(u)))throw Error(a(151));for(var f=c=null,m=s,v=s=0,g=null,y=u.next();null!==m&&!y.done;v++,y=u.next()){m.index>v?(g=m,m=null):g=m.sibling;var b=p(o,m,y.value,l);if(null===b){null===m&&(m=g);break}e&&m&&null===b.alternate&&t(o,m),s=i(b,s,v),null===f?c=b:f.sibling=b,f=b,m=g}if(y.done)return n(o,m),c;if(null===m){for(;!y.done;v++,y=u.next())null!==(y=d(o,y.value,l))&&(s=i(y,s,v),null===f?c=y:f.sibling=y,f=y);return c}for(m=r(o,m);!y.done;v++,y=u.next())null!==(y=h(m,o,v,y.value,l))&&(e&&null!==y.alternate&&m.delete(null===y.key?v:y.key),s=i(y,s,v),null===f?c=y:f.sibling=y,f=y);return e&&m.forEach((function(e){return t(o,e)})),c}return function(e,r,i,u){var l="object"===typeof i&&null!==i&&i.type===E&&null===i.key;l&&(i=i.props.children);var c="object"===typeof i&&null!==i;if(c)switch(i.$$typeof){case x:e:{for(c=i.key,l=r;null!==l;){if(l.key===c){if(7===l.tag){if(i.type===E){n(e,l.sibling),(r=o(l,i.props.children)).return=e,e=r;break e}}else if(l.elementType===i.type){n(e,l.sibling),(r=o(l,i.props)).ref=Ei(e,l,i),r.return=e,e=r;break e}n(e,l);break}t(e,l),l=l.sibling}i.type===E?((r=Ju(i.props.children,e.mode,u,i.key)).return=e,e=r):((u=Ku(i.type,i.key,i.props,null,e.mode,u)).ref=Ei(e,r,i),u.return=e,e=u)}return s(e);case D:e:{for(l=i.key;null!==r;){if(r.key===l){if(4===r.tag&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),(r=o(r,i.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Yu(i,e.mode,u)).return=e,e=r}return s(e)}if("string"===typeof i||"number"===typeof i)return i=""+i,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,i)).return=e,e=r):(n(e,r),(r=Gu(i,e.mode,u)).return=e,e=r),s(e);if(Di(i))return m(e,r,i,u);if($(i))return v(e,r,i,u);if(c&&Ci(e,i),"undefined"===typeof i&&!l)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,K(e.type)||"Component"))}return n(e,r)}}var Si=Oi(!0),Ai=Oi(!1),ji={},Ni=lo(ji),Mi=lo(ji),Ti=lo(ji);function Fi(e){if(e===ji)throw Error(a(174));return e}function Pi(e,t){switch(fo(Ti,t),fo(Mi,e),fo(Ni,ji),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:he(null,"");break;default:t=he(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}co(Ni),fo(Ni,t)}function Ri(){co(Ni),co(Mi),co(Ti)}function Bi(e){Fi(Ti.current);var t=Fi(Ni.current),n=he(t,e.type);t!==n&&(fo(Mi,e),fo(Ni,n))}function Li(e){Mi.current===e&&(co(Ni),co(Mi))}var Ii=lo(0);function zi(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _i=null,Vi=null,$i=!1;function Hi(e,t){var n=Uu(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ui(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Wi(e){if($i){var t=Vi;if(t){var n=t;if(!Ui(e,t)){if(!(t=Jr(n.nextSibling))||!Ui(e,t))return e.flags=-1025&e.flags|2,$i=!1,void(_i=e);Hi(_i,n)}_i=e,Vi=Jr(t.firstChild)}else e.flags=-1025&e.flags|2,$i=!1,_i=e}}function qi(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;_i=e}function Ki(e){if(e!==_i)return!1;if(!$i)return qi(e),$i=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Ur(t,e.memoizedProps))for(t=Vi;t;)Hi(e,t),t=Jr(t.nextSibling);if(qi(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Vi=Jr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Vi=null}}else Vi=_i?Jr(e.stateNode.nextSibling):null;return!0}function Ji(){Vi=_i=null,$i=!1}var Qi=[];function Gi(){for(var e=0;e<Qi.length;e++)Qi[e]._workInProgressVersionPrimary=null;Qi.length=0}var Yi=w.ReactCurrentDispatcher,Xi=w.ReactCurrentBatchConfig,Zi=0,ea=null,ta=null,na=null,ra=!1,oa=!1;function ia(){throw Error(a(321))}function aa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function sa(e,t,n,r,o,i){if(Zi=i,ea=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yi.current=null===e||null===e.memoizedState?Fa:Pa,e=n(r,o),oa){i=0;do{if(oa=!1,!(25>i))throw Error(a(301));i+=1,na=ta=null,t.updateQueue=null,Yi.current=Ra,e=n(r,o)}while(oa)}if(Yi.current=Ta,t=null!==ta&&null!==ta.next,Zi=0,na=ta=ea=null,ra=!1,t)throw Error(a(300));return e}function ua(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===na?ea.memoizedState=na=e:na=na.next=e,na}function la(){if(null===ta){var e=ea.alternate;e=null!==e?e.memoizedState:null}else e=ta.next;var t=null===na?ea.memoizedState:na.next;if(null!==t)na=t,ta=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ta=e).memoizedState,baseState:ta.baseState,baseQueue:ta.baseQueue,queue:ta.queue,next:null},null===na?ea.memoizedState=na=e:na=na.next=e}return na}function ca(e,t){return"function"===typeof t?t(e):t}function fa(e){var t=la(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=ta,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var u=s=i=null,l=o;do{var c=l.lane;if((Zi&c)===c)null!==u&&(u=u.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===e?l.eagerState:e(r,l.action);else{var f={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===u?(s=u=f,i=r):u=u.next=f,ea.lanes|=c,Vs|=c}l=l.next}while(null!==l&&l!==o);null===u?i=r:u.next=s,cr(r,t.memoizedState)||(La=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function da(e){var t=la(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var s=o=o.next;do{i=e(i,s.action),s=s.next}while(s!==o);cr(i,t.memoizedState)||(La=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function pa(e,t,n){var r=t._getVersion;r=r(t._source);var o=t._workInProgressVersionPrimary;if(null!==o?e=o===r:(e=e.mutableReadLanes,(e=(Zi&e)===e)&&(t._workInProgressVersionPrimary=r,Qi.push(t))),e)return n(t._source);throw Qi.push(t),Error(a(350))}function ha(e,t,n,r){var o=Fs;if(null===o)throw Error(a(349));var i=t._getVersion,s=i(t._source),u=Yi.current,l=u.useState((function(){return pa(o,t,n)})),c=l[1],f=l[0];l=na;var d=e.memoizedState,p=d.refs,h=p.getSnapshot,m=d.source;d=d.subscribe;var v=ea;return e.memoizedState={refs:p,source:t,subscribe:r},u.useEffect((function(){p.getSnapshot=n,p.setSnapshot=c;var e=i(t._source);if(!cr(s,e)){e=n(t._source),cr(f,e)||(c(e),e=pu(v),o.mutableReadLanes|=e&o.pendingLanes),e=o.mutableReadLanes,o.entangledLanes|=e;for(var r=o.entanglements,a=e;0<a;){var u=31-Ut(a),l=1<<u;r[u]|=e,a&=~l}}}),[n,t,r]),u.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pu(v);o.mutableReadLanes|=r&o.pendingLanes}catch(i){n((function(){throw i}))}}))}),[t,r]),cr(h,n)&&cr(m,t)&&cr(d,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ca,lastRenderedState:f}).dispatch=c=Ma.bind(null,ea,e),l.queue=e,l.baseQueue=null,f=pa(o,t,n),l.memoizedState=l.baseState=f),f}function ma(e,t,n){return ha(la(),e,t,n)}function va(e){var t=ua();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ca,lastRenderedState:e}).dispatch=Ma.bind(null,ea,e),[t.memoizedState,e]}function ga(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ea.updateQueue)?(t={lastEffect:null},ea.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ya(e){return e={current:e},ua().memoizedState=e}function ba(){return la().memoizedState}function ka(e,t,n,r){var o=ua();ea.flags|=e,o.memoizedState=ga(1|t,n,void 0,void 0===r?null:r)}function wa(e,t,n,r){var o=la();r=void 0===r?null:r;var i=void 0;if(null!==ta){var a=ta.memoizedState;if(i=a.destroy,null!==r&&aa(r,a.deps))return void ga(t,n,i,r)}ea.flags|=e,o.memoizedState=ga(1|t,n,i,r)}function xa(e,t){return ka(516,4,e,t)}function Da(e,t){return wa(516,4,e,t)}function Ea(e,t){return wa(4,2,e,t)}function Ca(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Oa(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,wa(4,2,Ca.bind(null,t,e),n)}function Sa(){}function Aa(e,t){var n=la();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ja(e,t){var n=la();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&aa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Na(e,t){var n=Wo();Ko(98>n?98:n,(function(){e(!0)})),Ko(97<n?97:n,(function(){var n=Xi.transition;Xi.transition=1;try{e(!1),t()}finally{Xi.transition=n}}))}function Ma(e,t,n){var r=du(),o=pu(e),i={lane:o,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?i.next=i:(i.next=a.next,a.next=i),t.pending=i,a=e.alternate,e===ea||null!==a&&a===ea)oa=ra=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,u=a(s,n);if(i.eagerReducer=a,i.eagerState=u,cr(u,s))return}catch(l){}hu(e,o,r)}}var Ta={readContext:si,useCallback:ia,useContext:ia,useEffect:ia,useImperativeHandle:ia,useLayoutEffect:ia,useMemo:ia,useReducer:ia,useRef:ia,useState:ia,useDebugValue:ia,useDeferredValue:ia,useTransition:ia,useMutableSource:ia,useOpaqueIdentifier:ia,unstable_isNewReconciler:!1},Fa={readContext:si,useCallback:function(e,t){return ua().memoizedState=[e,void 0===t?null:t],e},useContext:si,useEffect:xa,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ka(4,2,Ca.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ka(4,2,e,t)},useMemo:function(e,t){var n=ua();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ua();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ma.bind(null,ea,e),[r.memoizedState,e]},useRef:ya,useState:va,useDebugValue:Sa,useDeferredValue:function(e){var t=va(e),n=t[0],r=t[1];return xa((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=va(!1),t=e[0];return ya(e=Na.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=ua();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},ha(r,e,t,n)},useOpaqueIdentifier:function(){if($i){var e=!1,t=function(e){return{$$typeof:R,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Gr++).toString(36))),Error(a(355))})),n=va(t)[1];return 0===(2&ea.mode)&&(ea.flags|=516,ga(5,(function(){n("r:"+(Gr++).toString(36))}),void 0,null)),t}return va(t="r:"+(Gr++).toString(36)),t},unstable_isNewReconciler:!1},Pa={readContext:si,useCallback:Aa,useContext:si,useEffect:Da,useImperativeHandle:Oa,useLayoutEffect:Ea,useMemo:ja,useReducer:fa,useRef:ba,useState:function(){return fa(ca)},useDebugValue:Sa,useDeferredValue:function(e){var t=fa(ca),n=t[0],r=t[1];return Da((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=fa(ca)[0];return[ba().current,e]},useMutableSource:ma,useOpaqueIdentifier:function(){return fa(ca)[0]},unstable_isNewReconciler:!1},Ra={readContext:si,useCallback:Aa,useContext:si,useEffect:Da,useImperativeHandle:Oa,useLayoutEffect:Ea,useMemo:ja,useReducer:da,useRef:ba,useState:function(){return da(ca)},useDebugValue:Sa,useDeferredValue:function(e){var t=da(ca),n=t[0],r=t[1];return Da((function(){var t=Xi.transition;Xi.transition=1;try{r(e)}finally{Xi.transition=t}}),[e]),n},useTransition:function(){var e=da(ca)[0];return[ba().current,e]},useMutableSource:ma,useOpaqueIdentifier:function(){return da(ca)[0]},unstable_isNewReconciler:!1},Ba=w.ReactCurrentOwner,La=!1;function Ia(e,t,n,r){t.child=null===e?Ai(t,null,n,r):Si(t,e.child,n,r)}function za(e,t,n,r,o){n=n.render;var i=t.ref;return ai(t,o),r=sa(e,t,n,r,i,o),null===e||La?(t.flags|=1,Ia(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,is(e,t,o))}function _a(e,t,n,r,o,i){if(null===e){var a=n.type;return"function"!==typeof a||Wu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ku(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Va(e,t,a,r,o,i))}return a=e.child,0===(o&i)&&(o=a.memoizedProps,(n=null!==(n=n.compare)?n:dr)(o,r)&&e.ref===t.ref)?is(e,t,i):(t.flags|=1,(e=qu(a,r)).ref=t.ref,e.return=t,t.child=e)}function Va(e,t,n,r,o,i){if(null!==e&&dr(e.memoizedProps,r)&&e.ref===t.ref){if(La=!1,0===(i&o))return t.lanes=e.lanes,is(e,t,i);0!==(16384&e.flags)&&(La=!0)}return Ua(e,t,n,r,i)}function $a(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0===(4&t.mode))t.memoizedState={baseLanes:0},xu(t,n);else{if(0===(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},xu(t,e),null;t.memoizedState={baseLanes:0},xu(t,null!==i?i.baseLanes:n)}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,xu(t,r);return Ia(e,t,o,n),t.child}function Ha(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ua(e,t,n,r,o){var i=yo(n)?vo:ho.current;return i=go(t,i),ai(t,o),n=sa(e,t,n,r,i,o),null===e||La?(t.flags|=1,Ia(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,is(e,t,o))}function Wa(e,t,n,r,o){if(yo(n)){var i=!0;xo(t)}else i=!1;if(ai(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),ki(t,n,r),xi(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,l=n.contextType;"object"===typeof l&&null!==l?l=si(l):l=go(t,l=yo(n)?vo:ho.current);var c=n.getDerivedStateFromProps,f="function"===typeof c||"function"===typeof a.getSnapshotBeforeUpdate;f||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||u!==l)&&wi(t,a,r,l),ui=!1;var d=t.memoizedState;a.state=d,hi(t,r,a,o),u=t.memoizedState,s!==r||d!==u||mo.current||ui?("function"===typeof c&&(gi(t,n,c,r),u=t.memoizedState),(s=ui||bi(t,n,s,r,d,u,l))?(f||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4)):("function"===typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=l,r=s):("function"===typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,ci(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Xo(t.type,s),a.props=l,f=t.pendingProps,d=a.context,"object"===typeof(u=n.contextType)&&null!==u?u=si(u):u=go(t,u=yo(n)?vo:ho.current);var p=n.getDerivedStateFromProps;(c="function"===typeof p||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==f||d!==u)&&wi(t,a,r,u),ui=!1,d=t.memoizedState,a.state=d,hi(t,r,a,o);var h=t.memoizedState;s!==f||d!==h||mo.current||ui?("function"===typeof p&&(gi(t,n,p,r),h=t.memoizedState),(l=ui||bi(t,n,l,r,d,h,u))?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,u),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,u)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=u,r=l):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),r=!1)}return qa(e,t,n,r,i,o)}function qa(e,t,n,r,o,i){Ha(e,t);var a=0!==(64&t.flags);if(!r&&!a)return o&&Do(t,n,!1),is(e,t,i);r=t.stateNode,Ba.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Si(t,e.child,null,i),t.child=Si(t,null,s,i)):Ia(e,t,s,i),t.memoizedState=r.state,o&&Do(t,n,!0),t.child}function Ka(e){var t=e.stateNode;t.pendingContext?ko(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ko(0,t.context,!1),Pi(e,t.containerInfo)}var Ja,Qa,Ga,Ya={dehydrated:null,retryLane:0};function Xa(e,t,n){var r,o=t.pendingProps,i=Ii.current,a=!1;return(r=0!==(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!==(2&i)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(i|=1),fo(Ii,1&i),null===e?(void 0!==o.fallback&&Wi(t),e=o.children,i=o.fallback,a?(e=Za(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,e):"number"===typeof o.unstable_expectedLoadTime?(e=Za(t,e,i,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,t.lanes=33554432,e):((n=Qu({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(o=ts(e,t,o.children,o.fallback,n),a=t.child,i=e.child.memoizedState,a.memoizedState=null===i?{baseLanes:n}:{baseLanes:i.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=Ya,o):(n=es(e,t,o.children,n),t.memoizedState=null,n))}function Za(e,t,n,r){var o=e.mode,i=e.child;return t={mode:"hidden",children:t},0===(2&o)&&null!==i?(i.childLanes=0,i.pendingProps=t):i=Qu(t,o,0,null),n=Ju(n,o,r,null),i.return=e,n.return=e,i.sibling=n,e.child=i,n}function es(e,t,n,r){var o=e.child;return e=o.sibling,n=qu(o,{mode:"visible",children:n}),0===(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ts(e,t,n,r,o){var i=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0===(2&i)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=qu(a,s),null!==e?r=qu(e,r):(r=Ju(r,i,o,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function ns(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),ii(e.return,t)}function rs(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,lastEffect:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.lastEffect=i)}function os(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ia(e,t,r.children,n),0!==(2&(r=Ii.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!==(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ns(e,n);else if(19===e.tag)ns(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(fo(Ii,r),0===(2&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===zi(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),rs(t,!1,o,n,i,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===zi(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}rs(t,!0,n,null,i,t.lastEffect);break;case"together":rs(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function is(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Vs|=t.lanes,0!==(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=qu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=qu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function as(e,t){if(!$i)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ss(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return yo(t.type)&&bo(),null;case 3:return Ri(),co(mo),co(ho),Gi(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ki(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Li(t);var i=Fi(Ti.current);if(n=t.type,null!==e&&null!=t.stateNode)Qa(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=Fi(Ni.current),Ki(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xr]=t,r[Zr]=s,n){case"dialog":Nr("cancel",r),Nr("close",r);break;case"iframe":case"object":case"embed":Nr("load",r);break;case"video":case"audio":for(e=0;e<Or.length;e++)Nr(Or[e],r);break;case"source":Nr("error",r);break;case"img":case"image":case"link":Nr("error",r),Nr("load",r);break;case"details":Nr("toggle",r);break;case"input":ee(r,s),Nr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Nr("invalid",r);break;case"textarea":ue(r,s),Nr("invalid",r)}for(var l in Ee(n,s),e=null,s)s.hasOwnProperty(l)&&(i=s[l],"children"===l?"string"===typeof i?r.textContent!==i&&(e=["children",i]):"number"===typeof i&&r.textContent!==""+i&&(e=["children",""+i]):u.hasOwnProperty(l)&&null!=i&&"onScroll"===l&&Nr("scroll",r));switch(n){case"input":G(r),re(r,s,!0);break;case"textarea":G(r),ce(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=_r)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(l=9===i.nodeType?i:i.ownerDocument,e===fe&&(e=pe(n)),e===fe?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),"select"===n&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Xr]=t,e[Zr]=r,Ja(e,t),t.stateNode=e,l=Ce(n,r),n){case"dialog":Nr("cancel",e),Nr("close",e),i=r;break;case"iframe":case"object":case"embed":Nr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Or.length;i++)Nr(Or[i],e);i=r;break;case"source":Nr("error",e),i=r;break;case"img":case"image":case"link":Nr("error",e),Nr("load",e),i=r;break;case"details":Nr("toggle",e),i=r;break;case"input":ee(e,r),i=Z(e,r),Nr("invalid",e);break;case"option":i=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=o({},r,{value:void 0}),Nr("invalid",e);break;case"textarea":ue(e,r),i=se(e,r),Nr("invalid",e);break;default:i=r}Ee(n,i);var c=i;for(s in c)if(c.hasOwnProperty(s)){var f=c[s];"style"===s?xe(e,f):"dangerouslySetInnerHTML"===s?null!=(f=f?f.__html:void 0)&&ge(e,f):"children"===s?"string"===typeof f?("textarea"!==n||""!==f)&&ye(e,f):"number"===typeof f&&ye(e,""+f):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(u.hasOwnProperty(s)?null!=f&&"onScroll"===s&&Nr("scroll",e):null!=f&&k(e,s,f,l))}switch(n){case"input":G(e),re(e,r,!1);break;case"textarea":G(e),ce(e);break;case"option":null!=r.value&&e.setAttribute("value",""+J(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ae(e,!!r.multiple,s,!1):null!=r.defaultValue&&ae(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=_r)}Hr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Ga(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));n=Fi(Ti.current),Fi(Ni.current),Ki(t)?(r=t.stateNode,n=t.memoizedProps,r[Xr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Xr]=t,t.stateNode=r)}return null;case 13:return co(Ii),r=t.memoizedState,0!==(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Ki(t):n=null!==e.memoizedState,r&&!n&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Ii.current)?0===Is&&(Is=3):(0!==Is&&3!==Is||(Is=4),null===Fs||0===(134217727&Vs)&&0===(134217727&$s)||yu(Fs,Rs))),(r||n)&&(t.flags|=4),null);case 4:return Ri(),null===e&&Tr(t.stateNode.containerInfo),null;case 10:return oi(t),null;case 19:if(co(Ii),null===(r=t.memoizedState))return null;if(s=0!==(64&t.flags),null===(l=r.rendering))if(s)as(r,!1);else{if(0!==Is||null!==e&&0!==(64&e.flags))for(e=t.child;null!==e;){if(null!==(l=zi(e))){for(t.flags|=64,as(r,!1),null!==(s=l.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fo(Ii,1&Ii.current|2),t.child}e=e.sibling}null!==r.tail&&Uo()>qs&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=zi(l))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),as(r,!0),null===r.tail&&"hidden"===r.tailMode&&!l.alternate&&!$i)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Uo()-r.renderingStartTime>qs&&1073741824!==n&&(t.flags|=64,s=!0,as(r,!1),t.lanes=33554432);r.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=r.last)?n.sibling=l:t.child=l,r.last=l)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Uo(),n.sibling=null,t=Ii.current,fo(Ii,s?1&t|2:1&t),n):null;case 23:case 24:return Du(),null!==e&&null!==e.memoizedState!==(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function us(e){switch(e.tag){case 1:yo(e.type)&&bo();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ri(),co(mo),co(ho),Gi(),0!==(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Li(e),null;case 13:return co(Ii),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return co(Ii),null;case 4:return Ri(),null;case 10:return oi(e),null;case 23:case 24:return Du(),null;default:return null}}function ls(e,t){try{var n="",r=t;do{n+=q(r),r=r.return}while(r);var o=n}catch(i){o="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:o}}function cs(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Ja=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Qa=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Fi(Ni.current);var a,s=null;switch(n){case"input":i=Z(e,i),r=Z(e,r),s=[];break;case"option":i=ie(e,i),r=ie(e,r),s=[];break;case"select":i=o({},i,{value:void 0}),r=o({},r,{value:void 0}),s=[];break;case"textarea":i=se(e,i),r=se(e,r),s=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=_r)}for(f in Ee(n,r),n=null,i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&null!=i[f])if("style"===f){var l=i[f];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(u.hasOwnProperty(f)?s||(s=[]):(s=s||[]).push(f,null));for(f in r){var c=r[f];if(l=null!=i?i[f]:void 0,r.hasOwnProperty(f)&&c!==l&&(null!=c||null!=l))if("style"===f)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(f,n)),n=c;else"dangerouslySetInnerHTML"===f?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(f,c)):"children"===f?"string"!==typeof c&&"number"!==typeof c||(s=s||[]).push(f,""+c):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(u.hasOwnProperty(f)?(null!=c&&"onScroll"===f&&Nr("scroll",e),s||l===c||(s=[])):"object"===typeof c&&null!==c&&c.$$typeof===R?c.toString():(s=s||[]).push(f,c))}n&&(s=s||[]).push("style",n);var f=s;(t.updateQueue=f)&&(t.flags|=4)}},Ga=function(e,t,n,r){n!==r&&(t.flags|=4)};var fs="function"===typeof WeakMap?WeakMap:Map;function ds(e,t,n){(n=fi(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gs||(Gs=!0,Ys=r),cs(0,t)},n}function ps(e,t,n){(n=fi(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var o=t.value;n.payload=function(){return cs(0,t),r(o)}}var i=e.stateNode;return null!==i&&"function"===typeof i.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Xs?Xs=new Set([this]):Xs.add(this),cs(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var hs="function"===typeof WeakSet?WeakSet:Set;function ms(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){_u(e,n)}else t.current=null}function vs(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Xo(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Kr(t.stateNode.containerInfo))}throw Error(a(163))}function gs(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3===(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var o=e;r=o.next,0!==(4&(o=o.tag))&&0!==(1&o)&&(Lu(n,e),Bu(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Xo(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&mi(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}mi(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Hr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&xt(n)))))}throw Error(a(163))}function ys(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"===typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var o=n.memoizedProps.style;o=void 0!==o&&null!==o&&o.hasOwnProperty("display")?o.display:null,r.style.display=we("display",o)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function bs(e,t){if(Co&&"function"===typeof Co.onCommitFiberUnmount)try{Co.onCommitFiberUnmount(Eo,t)}catch(i){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,o=r.destroy;if(r=r.tag,void 0!==o)if(0!==(4&r))Lu(t,n);else{r=t;try{o()}catch(i){_u(r,i)}}n=n.next}while(n!==e)}break;case 1:if(ms(t),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){_u(t,i)}break;case 5:ms(t);break;case 4:Cs(e,t)}}function ks(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ws(e){return 5===e.tag||3===e.tag||4===e.tag}function xs(e){e:{for(var t=e.return;null!==t;){if(ws(t))break e;t=t.return}throw Error(a(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ws(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Ds(e,n,t):Es(e,n,t)}function Ds(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=_r));else if(4!==r&&null!==(e=e.child))for(Ds(e,t,n),e=e.sibling;null!==e;)Ds(e,t,n),e=e.sibling}function Es(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Es(e,t,n),e=e.sibling;null!==e;)Es(e,t,n),e=e.sibling}function Cs(e,t){for(var n,r,o=t,i=!1;;){if(!i){i=o.return;e:for(;;){if(null===i)throw Error(a(160));switch(n=i.stateNode,i.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}i=i.return}i=!0}if(5===o.tag||6===o.tag){e:for(var s=e,u=o,l=u;;)if(bs(s,l),null!==l.child&&4!==l.tag)l.child.return=l,l=l.child;else{if(l===u)break e;for(;null===l.sibling;){if(null===l.return||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}r?(s=n,u=o.stateNode,8===s.nodeType?s.parentNode.removeChild(u):s.removeChild(u)):n.removeChild(o.stateNode)}else if(4===o.tag){if(null!==o.child){n=o.stateNode.containerInfo,r=!0,o.child.return=o,o=o.child;continue}}else if(bs(e,o),null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;4===(o=o.return).tag&&(i=!1)}o.sibling.return=o.return,o=o.sibling}}function Os(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3===(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var o=null!==e?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,null!==i){for(n[Zr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Ce(e,o),t=Ce(e,r),o=0;o<i.length;o+=2){var s=i[o],u=i[o+1];"style"===s?xe(n,u):"dangerouslySetInnerHTML"===s?ge(n,u):"children"===s?ye(n,u):k(n,s,u,t)}switch(e){case"input":ne(n,r);break;case"textarea":le(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(i=r.value)?ae(n,!!r.multiple,i,!1):e!==!!r.multiple&&(null!=r.defaultValue?ae(n,!!r.multiple,r.defaultValue,!0):ae(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,xt(n.containerInfo)));case 13:return null!==t.memoizedState&&(Ws=Uo(),ys(t.child,!0)),void Ss(t);case 19:return void Ss(t);case 23:case 24:return void ys(t,null!==t.memoizedState)}throw Error(a(163))}function Ss(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hs),t.forEach((function(t){var r=$u.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function As(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var js=Math.ceil,Ns=w.ReactCurrentDispatcher,Ms=w.ReactCurrentOwner,Ts=0,Fs=null,Ps=null,Rs=0,Bs=0,Ls=lo(0),Is=0,zs=null,_s=0,Vs=0,$s=0,Hs=0,Us=null,Ws=0,qs=1/0;function Ks(){qs=Uo()+500}var Js,Qs=null,Gs=!1,Ys=null,Xs=null,Zs=!1,eu=null,tu=90,nu=[],ru=[],ou=null,iu=0,au=null,su=-1,uu=0,lu=0,cu=null,fu=!1;function du(){return 0!==(48&Ts)?Uo():-1!==su?su:su=Uo()}function pu(e){if(0===(2&(e=e.mode)))return 1;if(0===(4&e))return 99===Wo()?1:2;if(0===uu&&(uu=_s),0!==Yo.transition){0!==lu&&(lu=null!==Us?Us.pendingLanes:0),e=uu;var t=4186112&~lu;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Wo(),0!==(4&Ts)&&98===e?e=_t(12,uu):e=_t(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),uu),e}function hu(e,t,n){if(50<iu)throw iu=0,au=null,Error(a(185));if(null===(e=mu(e,t)))return null;Ht(e,t,n),e===Fs&&($s|=t,4===Is&&yu(e,Rs));var r=Wo();1===t?0!==(8&Ts)&&0===(48&Ts)?bu(e):(vu(e,n),0===Ts&&(Ks(),Qo())):(0===(4&Ts)||98!==r&&99!==r||(null===ou?ou=new Set([e]):ou.add(e)),vu(e,n)),Us=e}function mu(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function vu(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var u=31-Ut(s),l=1<<u,c=i[u];if(-1===c){if(0===(l&r)||0!==(l&o)){c=t,Lt(l);var f=Bt;i[u]=10<=f?c+250:6<=f?c+5e3:-1}}else c<=t&&(e.expiredLanes|=l);s&=~l}if(r=It(e,e===Fs?Rs:0),t=Bt,0===r)null!==n&&(n!==Io&&Ao(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Io&&Ao(n)}15===t?(n=bu.bind(null,e),null===_o?(_o=[n],Vo=So(Fo,Go)):_o.push(n),n=Io):14===t?n=Jo(99,bu.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,e))}}(t),n=Jo(n,gu.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function gu(e){if(su=-1,lu=uu=0,0!==(48&Ts))throw Error(a(327));var t=e.callbackNode;if(Ru()&&e.callbackNode!==t)return null;var n=It(e,e===Fs?Rs:0);if(0===n)return null;var r=n,o=Ts;Ts|=16;var i=Ou();for(Fs===e&&Rs===r||(Ks(),Eu(e,r));;)try{ju();break}catch(u){Cu(e,u)}if(ri(),Ns.current=i,Ts=o,null!==Ps?r=0:(Fs=null,Rs=0,r=Is),0!==(_s&$s))Eu(e,0);else if(0!==r){if(2===r&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Kr(e.containerInfo)),0!==(n=zt(e))&&(r=Su(e,n))),1===r)throw t=zs,Eu(e,0),yu(e,n),vu(e,Uo()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:case 5:Tu(e);break;case 3:if(yu(e,n),(62914560&n)===n&&10<(r=Ws+500-Uo())){if(0!==It(e,0))break;if(((o=e.suspendedLanes)&n)!==n){du(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Wr(Tu.bind(null,e),r);break}Tu(e);break;case 4:if(yu(e,n),(4186112&n)===n)break;for(r=e.eventTimes,o=-1;0<n;){var s=31-Ut(n);i=1<<s,(s=r[s])>o&&(o=s),n&=~i}if(n=o,10<(n=(120>(n=Uo()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*js(n/1960))-n)){e.timeoutHandle=Wr(Tu.bind(null,e),n);break}Tu(e);break;default:throw Error(a(329))}}return vu(e,Uo()),e.callbackNode===t?gu.bind(null,e):null}function yu(e,t){for(t&=~Hs,t&=~$s,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ut(t),r=1<<n;e[n]=-1,t&=~r}}function bu(e){if(0!==(48&Ts))throw Error(a(327));if(Ru(),e===Fs&&0!==(e.expiredLanes&Rs)){var t=Rs,n=Su(e,t);0!==(_s&$s)&&(n=Su(e,t=It(e,t)))}else n=Su(e,t=It(e,0));if(0!==e.tag&&2===n&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Kr(e.containerInfo)),0!==(t=zt(e))&&(n=Su(e,t))),1===n)throw n=zs,Eu(e,0),yu(e,t),vu(e,Uo()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Tu(e),vu(e,Uo()),null}function ku(e,t){var n=Ts;Ts|=1;try{return e(t)}finally{0===(Ts=n)&&(Ks(),Qo())}}function wu(e,t){var n=Ts;Ts&=-2,Ts|=8;try{return e(t)}finally{0===(Ts=n)&&(Ks(),Qo())}}function xu(e,t){fo(Ls,Bs),Bs|=t,_s|=t}function Du(){Bs=Ls.current,co(Ls)}function Eu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,qr(n)),null!==Ps)for(n=Ps.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&bo();break;case 3:Ri(),co(mo),co(ho),Gi();break;case 5:Li(r);break;case 4:Ri();break;case 13:case 19:co(Ii);break;case 10:oi(r);break;case 23:case 24:Du()}n=n.return}Fs=e,Ps=qu(e.current,null),Rs=Bs=_s=t,Is=0,zs=null,Hs=$s=Vs=0}function Cu(e,t){for(;;){var n=Ps;try{if(ri(),Yi.current=Ta,ra){for(var r=ea.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}ra=!1}if(Zi=0,na=ta=ea=null,oa=!1,Ms.current=null,null===n||null===n.return){Is=1,zs=t,Ps=null;break}e:{var i=e,a=n.return,s=n,u=t;if(t=Rs,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==u&&"object"===typeof u&&"function"===typeof u.then){var l=u;if(0===(2&s.mode)){var c=s.alternate;c?(s.updateQueue=c.updateQueue,s.memoizedState=c.memoizedState,s.lanes=c.lanes):(s.updateQueue=null,s.memoizedState=null)}var f=0!==(1&Ii.current),d=a;do{var p;if(p=13===d.tag){var h=d.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var m=d.memoizedProps;p=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!f)}}if(p){var v=d.updateQueue;if(null===v){var g=new Set;g.add(l),d.updateQueue=g}else v.add(l);if(0===(2&d.mode)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var y=fi(-1,1);y.tag=2,di(s,y)}s.lanes|=1;break e}u=void 0,s=t;var b=i.pingCache;if(null===b?(b=i.pingCache=new fs,u=new Set,b.set(l,u)):void 0===(u=b.get(l))&&(u=new Set,b.set(l,u)),!u.has(s)){u.add(s);var k=Vu.bind(null,i,l,s);l.then(k,k)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);u=Error((K(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Is&&(Is=2),u=ls(u,s),d=a;do{switch(d.tag){case 3:i=u,d.flags|=4096,t&=-t,d.lanes|=t,pi(d,ds(0,i,t));break e;case 1:i=u;var w=d.type,x=d.stateNode;if(0===(64&d.flags)&&("function"===typeof w.getDerivedStateFromError||null!==x&&"function"===typeof x.componentDidCatch&&(null===Xs||!Xs.has(x)))){d.flags|=4096,t&=-t,d.lanes|=t,pi(d,ps(d,i,t));break e}}d=d.return}while(null!==d)}Mu(n)}catch(D){t=D,Ps===n&&null!==n&&(Ps=n=n.return);continue}break}}function Ou(){var e=Ns.current;return Ns.current=Ta,null===e?Ta:e}function Su(e,t){var n=Ts;Ts|=16;var r=Ou();for(Fs===e&&Rs===t||Eu(e,t);;)try{Au();break}catch(o){Cu(e,o)}if(ri(),Ts=n,Ns.current=r,null!==Ps)throw Error(a(261));return Fs=null,Rs=0,Is}function Au(){for(;null!==Ps;)Nu(Ps)}function ju(){for(;null!==Ps&&!jo();)Nu(Ps)}function Nu(e){var t=Js(e.alternate,e,Bs);e.memoizedProps=e.pendingProps,null===t?Mu(e):Ps=t,Ms.current=null}function Mu(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(2048&t.flags)){if(null!==(n=ss(n,t,Bs)))return void(Ps=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!==(1073741824&Bs)||0===(4&n.mode)){for(var r=0,o=n.child;null!==o;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}null!==e&&0===(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=us(t)))return n.flags&=2047,void(Ps=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ps=t);Ps=t=e}while(null!==t);0===Is&&(Is=5)}function Tu(e){var t=Wo();return Ko(99,Fu.bind(null,e,t)),null}function Fu(e,t){do{Ru()}while(null!==eu);if(0!==(48&Ts))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,u=e.expirationTimes;0<i;){var l=31-Ut(i),c=1<<l;o[l]=0,s[l]=-1,u[l]=-1,i&=~c}if(null!==ou&&0===(24&r)&&ou.has(e)&&ou.delete(e),e===Fs&&(Ps=Fs=null,Rs=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(o=Ts,Ts|=32,Ms.current=null,Vr=Qt,gr(s=vr())){if("selectionStart"in s)u={start:s.selectionStart,end:s.selectionEnd};else e:if(u=(u=s.ownerDocument)&&u.defaultView||window,(c=u.getSelection&&u.getSelection())&&0!==c.rangeCount){u=c.anchorNode,i=c.anchorOffset,l=c.focusNode,c=c.focusOffset;try{u.nodeType,l.nodeType}catch(O){u=null;break e}var f=0,d=-1,p=-1,h=0,m=0,v=s,g=null;t:for(;;){for(var y;v!==u||0!==i&&3!==v.nodeType||(d=f+i),v!==l||0!==c&&3!==v.nodeType||(p=f+c),3===v.nodeType&&(f+=v.nodeValue.length),null!==(y=v.firstChild);)g=v,v=y;for(;;){if(v===s)break t;if(g===u&&++h===i&&(d=f),g===l&&++m===c&&(p=f),null!==(y=v.nextSibling))break;g=(v=g).parentNode}v=y}u=-1===d||-1===p?null:{start:d,end:p}}else u=null;u=u||{start:0,end:0}}else u=null;$r={focusedElem:s,selectionRange:u},Qt=!1,cu=null,fu=!1,Qs=r;do{try{Pu()}catch(O){if(null===Qs)throw Error(a(330));_u(Qs,O),Qs=Qs.nextEffect}}while(null!==Qs);cu=null,Qs=r;do{try{for(s=e;null!==Qs;){var b=Qs.flags;if(16&b&&ye(Qs.stateNode,""),128&b){var k=Qs.alternate;if(null!==k){var w=k.ref;null!==w&&("function"===typeof w?w(null):w.current=null)}}switch(1038&b){case 2:xs(Qs),Qs.flags&=-3;break;case 6:xs(Qs),Qs.flags&=-3,Os(Qs.alternate,Qs);break;case 1024:Qs.flags&=-1025;break;case 1028:Qs.flags&=-1025,Os(Qs.alternate,Qs);break;case 4:Os(Qs.alternate,Qs);break;case 8:Cs(s,u=Qs);var x=u.alternate;ks(u),null!==x&&ks(x)}Qs=Qs.nextEffect}}catch(O){if(null===Qs)throw Error(a(330));_u(Qs,O),Qs=Qs.nextEffect}}while(null!==Qs);if(w=$r,k=vr(),b=w.focusedElem,s=w.selectionRange,k!==b&&b&&b.ownerDocument&&mr(b.ownerDocument.documentElement,b)){null!==s&&gr(b)&&(k=s.start,void 0===(w=s.end)&&(w=k),"selectionStart"in b?(b.selectionStart=k,b.selectionEnd=Math.min(w,b.value.length)):(w=(k=b.ownerDocument||document)&&k.defaultView||window).getSelection&&(w=w.getSelection(),u=b.textContent.length,x=Math.min(s.start,u),s=void 0===s.end?x:Math.min(s.end,u),!w.extend&&x>s&&(u=s,s=x,x=u),u=hr(b,x),i=hr(b,s),u&&i&&(1!==w.rangeCount||w.anchorNode!==u.node||w.anchorOffset!==u.offset||w.focusNode!==i.node||w.focusOffset!==i.offset)&&((k=k.createRange()).setStart(u.node,u.offset),w.removeAllRanges(),x>s?(w.addRange(k),w.extend(i.node,i.offset)):(k.setEnd(i.node,i.offset),w.addRange(k))))),k=[];for(w=b;w=w.parentNode;)1===w.nodeType&&k.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"===typeof b.focus&&b.focus(),b=0;b<k.length;b++)(w=k[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Qt=!!Vr,$r=Vr=null,e.current=n,Qs=r;do{try{for(b=e;null!==Qs;){var D=Qs.flags;if(36&D&&gs(b,Qs.alternate,Qs),128&D){k=void 0;var E=Qs.ref;if(null!==E){var C=Qs.stateNode;Qs.tag,k=C,"function"===typeof E?E(k):E.current=k}}Qs=Qs.nextEffect}}catch(O){if(null===Qs)throw Error(a(330));_u(Qs,O),Qs=Qs.nextEffect}}while(null!==Qs);Qs=null,zo(),Ts=o}else e.current=n;if(Zs)Zs=!1,eu=e,tu=t;else for(Qs=r;null!==Qs;)t=Qs.nextEffect,Qs.nextEffect=null,8&Qs.flags&&((D=Qs).sibling=null,D.stateNode=null),Qs=t;if(0===(r=e.pendingLanes)&&(Xs=null),1===r?e===au?iu++:(iu=0,au=e):iu=0,n=n.stateNode,Co&&"function"===typeof Co.onCommitFiberRoot)try{Co.onCommitFiberRoot(Eo,n,void 0,64===(64&n.current.flags))}catch(O){}if(vu(e,Uo()),Gs)throw Gs=!1,e=Ys,Ys=null,e;return 0!==(8&Ts)||Qo(),null}function Pu(){for(;null!==Qs;){var e=Qs.alternate;fu||null===cu||(0!==(8&Qs.flags)?et(Qs,cu)&&(fu=!0):13===Qs.tag&&As(e,Qs)&&et(Qs,cu)&&(fu=!0));var t=Qs.flags;0!==(256&t)&&vs(e,Qs),0===(512&t)||Zs||(Zs=!0,Jo(97,(function(){return Ru(),null}))),Qs=Qs.nextEffect}}function Ru(){if(90!==tu){var e=97<tu?97:tu;return tu=90,Ko(e,Iu)}return!1}function Bu(e,t){nu.push(t,e),Zs||(Zs=!0,Jo(97,(function(){return Ru(),null})))}function Lu(e,t){ru.push(t,e),Zs||(Zs=!0,Jo(97,(function(){return Ru(),null})))}function Iu(){if(null===eu)return!1;var e=eu;if(eu=null,0!==(48&Ts))throw Error(a(331));var t=Ts;Ts|=32;var n=ru;ru=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,"function"===typeof s)try{s()}catch(l){if(null===i)throw Error(a(330));_u(i,l)}}for(n=nu,nu=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var u=o.create;o.destroy=u()}catch(l){if(null===i)throw Error(a(330));_u(i,l)}}for(u=e.current.firstEffect;null!==u;)e=u.nextEffect,u.nextEffect=null,8&u.flags&&(u.sibling=null,u.stateNode=null),u=e;return Ts=t,Qo(),!0}function zu(e,t,n){di(e,t=ds(0,t=ls(n,t),1)),t=du(),null!==(e=mu(e,1))&&(Ht(e,1,t),vu(e,t))}function _u(e,t){if(3===e.tag)zu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){zu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Xs||!Xs.has(r))){var o=ps(n,e=ls(t,e),1);if(di(n,o),o=du(),null!==(n=mu(n,1)))Ht(n,1,o),vu(n,o);else if("function"===typeof r.componentDidCatch&&(null===Xs||!Xs.has(r)))try{r.componentDidCatch(t,e)}catch(i){}break}}n=n.return}}function Vu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=du(),e.pingedLanes|=e.suspendedLanes&n,Fs===e&&(Rs&n)===n&&(4===Is||3===Is&&(62914560&Rs)===Rs&&500>Uo()-Ws?Eu(e,0):Hs|=n),vu(e,t)}function $u(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0===(2&(t=e.mode))?t=1:0===(4&t)?t=99===Wo()?1:2:(0===uu&&(uu=_s),0===(t=Vt(62914560&~uu))&&(t=4194304))),n=du(),null!==(e=mu(e,t))&&(Ht(e,t,n),vu(e,n))}function Hu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Uu(e,t,n,r){return new Hu(e,t,n,r)}function Wu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function qu(e,t){var n=e.alternate;return null===n?((n=Uu(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ku(e,t,n,r,o,i){var s=2;if(r=e,"function"===typeof e)Wu(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case E:return Ju(n.children,o,i,t);case B:s=8,o|=16;break;case C:s=8,o|=1;break;case O:return(e=Uu(12,n,t,8|o)).elementType=O,e.type=O,e.lanes=i,e;case N:return(e=Uu(13,n,t,o)).type=N,e.elementType=N,e.lanes=i,e;case M:return(e=Uu(19,n,t,o)).elementType=M,e.lanes=i,e;case L:return Qu(n,o,i,t);case I:return(e=Uu(24,n,t,o)).elementType=I,e.lanes=i,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case S:s=10;break e;case A:s=9;break e;case j:s=11;break e;case T:s=14;break e;case F:s=16,r=null;break e;case P:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Uu(s,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function Ju(e,t,n,r){return(e=Uu(7,e,r,t)).lanes=n,e}function Qu(e,t,n,r){return(e=Uu(23,e,r,t)).elementType=L,e.lanes=n,e}function Gu(e,t,n){return(e=Uu(6,e,null,t)).lanes=n,e}function Yu(e,t,n){return(t=Uu(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xu(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=$t(0),this.expirationTimes=$t(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$t(0),this.mutableSourceEagerHydrationData=null}function Zu(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:D,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function el(e,t,n,r){var o=t.current,i=du(),s=pu(o);e:if(n){t:{if(Ge(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(yo(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(a(171))}if(1===n.tag){var l=n.type;if(yo(l)){n=wo(n,l,u);break e}}n=u}else n=po;return null===t.context?t.context=n:t.pendingContext=n,(t=fi(i,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),di(o,t),hu(o,s,i),s}function tl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function nl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function rl(e,t){nl(e,t),(e=e.alternate)&&nl(e,t)}function ol(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xu(e,t,null!=n&&!0===n.hydrate),t=Uu(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,li(t),e[eo]=n.current,Tr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var o=(t=r[e])._getVersion;o=o(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}function il(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function al(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i._internalRoot;if("function"===typeof o){var s=o;o=function(){var e=tl(a);s.call(e)}}el(t,a,e,o)}else{if(i=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new ol(e,0,t?{hydrate:!0}:void 0)}(n,r),a=i._internalRoot,"function"===typeof o){var u=o;o=function(){var e=tl(a);u.call(e)}}wu((function(){el(t,a,e,o)}))}return tl(a)}function sl(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!il(t))throw Error(a(200));return Zu(e,t,null,n)}Js=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||mo.current)La=!0;else{if(0===(n&r)){switch(La=!1,t.tag){case 3:Ka(t),Ji();break;case 5:Bi(t);break;case 1:yo(t.type)&&xo(t);break;case 4:Pi(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;fo(Zo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(n&t.child.childLanes)?Xa(e,t,n):(fo(Ii,1&Ii.current),null!==(t=is(e,t,n))?t.sibling:null);fo(Ii,1&Ii.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(64&e.flags)){if(r)return os(e,t,n);t.flags|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),fo(Ii,Ii.current),r)break;return null;case 23:case 24:return t.lanes=0,$a(e,t,n)}return is(e,t,n)}La=0!==(16384&e.flags)}else La=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=go(t,ho.current),ai(t,n),o=sa(null,t,r,e,o,n),t.flags|=1,"object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,yo(r)){var i=!0;xo(t)}else i=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,li(t);var s=r.getDerivedStateFromProps;"function"===typeof s&&gi(t,r,s,e),o.updater=yi,t.stateNode=o,o._reactInternals=t,xi(t,r,e,n),t=qa(null,t,r,!0,i,n)}else t.tag=0,Ia(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"===typeof e)return Wu(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===j)return 11;if(e===T)return 14}return 2}(o),e=Xo(o,e),i){case 0:t=Ua(null,t,o,e,n);break e;case 1:t=Wa(null,t,o,e,n);break e;case 11:t=za(null,t,o,e,n);break e;case 14:t=_a(null,t,o,Xo(o.type,e),r,n);break e}throw Error(a(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,Ua(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 1:return r=t.type,o=t.pendingProps,Wa(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 3:if(Ka(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,ci(e,t),hi(t,r,null,n),(r=t.memoizedState.element)===o)Ji(),t=is(e,t,n);else{if((i=(o=t.stateNode).hydrate)&&(Vi=Jr(t.stateNode.containerInfo.firstChild),_i=t,i=$i=!0),i){if(null!=(e=o.mutableSourceEagerHydrationData))for(o=0;o<e.length;o+=2)(i=e[o])._workInProgressVersionPrimary=e[o+1],Qi.push(i);for(n=Ai(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Ia(e,t,r,n),Ji();t=t.child}return t;case 5:return Bi(t),null===e&&Wi(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,s=o.children,Ur(r,o)?s=null:null!==i&&Ur(r,i)&&(t.flags|=16),Ha(e,t),Ia(e,t,s,n),t.child;case 6:return null===e&&Wi(t),null;case 13:return Xa(e,t,n);case 4:return Pi(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Si(t,null,r,n):Ia(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,za(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 7:return Ia(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ia(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var u=t.type._context;if(fo(Zo,u._currentValue),u._currentValue=i,null!==s)if(u=s.value,0===(i=cr(u,i)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,i):1073741823))){if(s.children===o.children&&!mo.current){t=is(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var l=u.dependencies;if(null!==l){s=u.child;for(var c=l.firstContext;null!==c;){if(c.context===r&&0!==(c.observedBits&i)){1===u.tag&&((c=fi(-1,n&-n)).tag=2,di(u,c)),u.lanes|=n,null!==(c=u.alternate)&&(c.lanes|=n),ii(u.return,n),l.lanes|=n;break}c=c.next}}else s=10===u.tag&&u.type===t.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===t){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}Ia(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(i=t.pendingProps).children,ai(t,n),r=r(o=si(o,i.unstable_observedBits)),t.flags|=1,Ia(e,t,r,n),t.child;case 14:return i=Xo(o=t.type,t.pendingProps),_a(e,t,o,i=Xo(o.type,i),r,n);case 15:return Va(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Xo(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,yo(r)?(e=!0,xo(t)):e=!1,ai(t,n),ki(t,r,o),xi(t,r,o,n),qa(null,t,r,!0,e,n);case 19:return os(e,t,n);case 23:case 24:return $a(e,t,n)}throw Error(a(156,t.tag))},ol.prototype.render=function(e){el(e,this._internalRoot,null,null)},ol.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;el(null,e,null,(function(){t[eo]=null}))},tt=function(e){13===e.tag&&(hu(e,4,du()),rl(e,4))},nt=function(e){13===e.tag&&(hu(e,67108864,du()),rl(e,67108864))},rt=function(e){if(13===e.tag){var t=du(),n=pu(e);hu(e,n,t),rl(e,n)}},ot=function(e,t){return t()},Se=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=io(r);if(!o)throw Error(a(90));Y(r),ne(r,o)}}}break;case"textarea":le(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},Fe=ku,Pe=function(e,t,n,r,o){var i=Ts;Ts|=4;try{return Ko(98,e.bind(null,t,n,r,o))}finally{0===(Ts=i)&&(Ks(),Qo())}},Re=function(){0===(49&Ts)&&(function(){if(null!==ou){var e=ou;ou=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,vu(e,Uo())}))}Qo()}(),Ru())},Be=function(e,t){var n=Ts;Ts|=2;try{return e(t)}finally{0===(Ts=n)&&(Ks(),Qo())}};var ul={Events:[ro,oo,io,Me,Te,Ru,{current:!1}]},ll={findFiberByHostInstance:no,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},cl={bundleType:ll.bundleType,version:ll.version,rendererPackageName:ll.rendererPackageName,rendererConfig:ll.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:ll.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var fl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fl.isDisabled&&fl.supportsFiber)try{Eo=fl.inject(cl),Co=fl}catch(ve){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ul,t.createPortal=sl,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ts;if(0!==(48&n))return e(t);Ts|=1;try{if(e)return Ko(99,e.bind(null,t))}finally{Ts=n,Qo()}},t.hydrate=function(e,t,n){if(!il(t))throw Error(a(200));return al(null,e,t,!0,n)},t.render=function(e,t,n){if(!il(t))throw Error(a(200));return al(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!il(e))throw Error(a(40));return!!e._reactRootContainer&&(wu((function(){al(null,null,e,!1,(function(){e._reactRootContainer=null,e[eo]=null}))})),!0)},t.unstable_batchedUpdates=ku,t.unstable_createPortal=function(e,t){return sl(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!il(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return al(e,t,n,!1,r)},t.version="17.0.2"},function(e,t,n){"use strict";e.exports=n(10)},function(e,t,n){"use strict";var r,o,i,a;if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var u=Date,l=u.now();t.unstable_now=function(){return u.now()-l}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var c=null,f=null,d=function e(){if(null!==c)try{var n=t.unstable_now();c(!0,n),c=null}catch(r){throw setTimeout(e,0),r}};r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(d,0))},o=function(e,t){f=setTimeout(e,t)},i=function(){clearTimeout(f)},t.unstable_shouldYield=function(){return!1},a=t.unstable_forceFrameRate=function(){}}else{var p=window.setTimeout,h=window.clearTimeout;if("undefined"!==typeof console){var m=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof m&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var v=!1,g=null,y=-1,b=5,k=0;t.unstable_shouldYield=function(){return t.unstable_now()>=k},a=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,x=w.port2;w.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();k=e+b;try{g(!0,e)?x.postMessage(null):(v=!1,g=null)}catch(n){throw x.postMessage(null),n}}else v=!1},r=function(e){g=e,v||(v=!0,x.postMessage(null))},o=function(e,n){y=p((function(){e(t.unstable_now())}),n)},i=function(){h(y),y=-1}}function D(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<O(o,t)))break e;e[r]=t,e[n]=o,n=r}}function E(e){return void 0===(e=e[0])?null:e}function C(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var i=2*(r+1)-1,a=e[i],s=i+1,u=e[s];if(void 0!==a&&0>O(a,n))void 0!==u&&0>O(u,a)?(e[r]=u,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==u&&0>O(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function O(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var S=[],A=[],j=1,N=null,M=3,T=!1,F=!1,P=!1;function R(e){for(var t=E(A);null!==t;){if(null===t.callback)C(A);else{if(!(t.startTime<=e))break;C(A),t.sortIndex=t.expirationTime,D(S,t)}t=E(A)}}function B(e){if(P=!1,R(e),!F)if(null!==E(S))F=!0,r(L);else{var t=E(A);null!==t&&o(B,t.startTime-e)}}function L(e,n){F=!1,P&&(P=!1,i()),T=!0;var r=M;try{for(R(n),N=E(S);null!==N&&(!(N.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=N.callback;if("function"===typeof a){N.callback=null,M=N.priorityLevel;var s=a(N.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?N.callback=s:N===E(S)&&C(S),R(n)}else C(S);N=E(S)}if(null!==N)var u=!0;else{var l=E(A);null!==l&&o(B,l.startTime-n),u=!1}return u}finally{N=null,M=r,T=!1}}var I=a;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){F||T||(F=!0,r(L))},t.unstable_getCurrentPriorityLevel=function(){return M},t.unstable_getFirstCallbackNode=function(){return E(S)},t.unstable_next=function(e){switch(M){case 1:case 2:case 3:var t=3;break;default:t=M}var n=M;M=t;try{return e()}finally{M=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=I,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=M;M=e;try{return t()}finally{M=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var u=-1;break;case 2:u=250;break;case 5:u=1073741823;break;case 4:u=1e4;break;default:u=5e3}return e={id:j++,callback:n,priorityLevel:e,startTime:a,expirationTime:u=a+u,sortIndex:-1},a>s?(e.sortIndex=a,D(A,e),null===E(S)&&e===E(A)&&(P?i():P=!0,o(B,a-s))):(e.sortIndex=u,D(S,e),F||T||(F=!0,r(L))),e},t.unstable_wrapCallback=function(e){var t=M;return function(){var n=M;M=t;try{return e.apply(this,arguments)}finally{M=n}}}},function(e,t,n){"use strict";n(4);var r=n(1),o=60103;if(t.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,i={},l=null,c=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)s.call(t,r)&&!u.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:l,ref:c,props:i,_owner:a.current}}t.jsx=l,t.jsxs=l},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}n.r(t);var s=n(1),u=n.n(s),l=n(2),c=n.n(l);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){if(e){if("string"===typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(u){s=!0,o=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function m(){m=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(A){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new C(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return S()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(A){return{type:"throw",arg:A}}}e.wrap=u;var c={};function f(){}function d(){}function p(){}var v={};s(v,o,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(O([])));y&&y!==t&&n.call(y,o)&&(v=y);var b=p.prototype=f.prototype=Object.create(v);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(o,i,a,s){var u=l(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==h(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=p,s(b,"constructor",p),s(p,"constructor",d),d.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},k(w.prototype),s(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new w(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(b),s(b,a,"Generator"),s(b,o,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function v(e,t,n,r,o,i,a){try{var s=e[i](a),u=s.value}catch(l){return void n(l)}s.done?t(u):Promise.resolve(u).then(r,o)}function g(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){v(i,r,o,a,s,"next",e)}function s(e){v(i,r,o,a,s,"throw",e)}a(void 0)}))}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function k(e,t,n){return t&&b(e.prototype,t),n&&b(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function x(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},D(e)}function E(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(se){return!1}}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e,t){if(t&&("object"===h(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}function S(e){var t=E();return function(){var n,r=D(e);if(t){var o=D(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}var A=n(1).createContext({site:{},member:{},action:"",brandColor:"",pageData:{},onAction:function(e,t){return{action:e,data:t}}}),j=n(0),N=["children","head","title","style","onResize"],M=function(e){x(n,e);var t=S(n);function n(){var e;y(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).handleLoad=function(){e.setupFrameBaseStyle()},e}return k(n,[{key:"componentDidMount",value:function(){this.node.addEventListener("load",this.handleLoad)}},{key:"componentWillUnmout",value:function(){this.node.removeEventListener("load",this.handleLoad)}},{key:"setupFrameBaseStyle",value:function(){var e=this;if(this.node.contentDocument){var t,n;if(this.iframeHtml=this.node.contentDocument.documentElement,this.iframeHead=this.node.contentDocument.head,this.iframeRoot=this.node.contentDocument.body,this.forceUpdate(),this.props.onResize)null===(t=new ResizeObserver((function(t){return e.props.onResize(e.iframeRoot)})))||void 0===t||null===(n=t.observe)||void 0===n||n.call(t,this.iframeRoot);this.node.contentWindow.addEventListener("keydown",(function(e){window.dispatchEvent(new KeyboardEvent("keydown",e))}))}}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.head,o=t.title,s=void 0===o?"":o,u=t.style,c=void 0===u?{}:u,f=(t.onResize,a(t,N));return Object(j.jsxs)("iframe",i(i({srcDoc:"<!DOCTYPE html>"},f),{},{ref:function(t){return e.node=t},title:s,style:c,frameBorder:"0",children:[this.iframeHead&&Object(l.createPortal)(r,this.iframeHead),this.iframeRoot&&Object(l.createPortal)(n,this.iframeRoot)]}))}}]),n}(s.Component),T=["children","type","style"],F=function(e){var t,n=e.children,r=e.type,o=e.style,u=a(e,T),l=Object(s.useContext)(A).stylesUrl,c="dynamic"===(r=null!==(t=r)&&void 0!==t?t:"dynamic")?{width:"100%",height:"400px"}:{zIndex:"3999999",position:"fixed",left:"0",top:"0",width:"100%",height:"100%",overflow:"hidden"},f=p(Object(s.useState)(c),2),d=f[0],h=f[1],m=p(Object(s.useState)(!l),2),v=m[0],g=m[1],y=Object(j.jsxs)(j.Fragment,{children:[l?Object(j.jsx)("link",{rel:"stylesheet",href:l,onLoad:function(){g(!0)}}):null,Object(j.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n body, html {\n overflow: hidden;\n }\n "}}),Object(j.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0, maximum-scale=1.0"})]}),b=i(i({},d),o);return Object(j.jsx)(M,i(i({},u),{},{head:y,style:b,onResize:"dynamic"===r?function(e){h((function(t){return i(i({},t),{},{height:"".concat(e.scrollHeight,"px")})}))}:null,children:v&&n}))};function P(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(){return(R=g(m().mark((function e(t){var n,r,o,i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=1,n.pagination&&n.pagination.page&&(o=n.pagination.page+1),e.next=5,r.comments.browse({page:o,postId:n.postId});case 5:return i=e.sent,e.abrupt("return",{comments:[].concat(P(n.comments),P(i.comments)),pagination:i.meta.pagination});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(){return(B=g(m().mark((function e(t){var n,r,o,a,s,u,l;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.state,o=t.api,a=t.data,s=a.comment,u=a.limit,e.next=3,o.comments.replies({commentId:s.id,afterReplyId:null===(n=s.replies[s.replies.length-1])||void 0===n?void 0:n.id,limit:u});case 3:return l=e.sent,e.abrupt("return",{comments:r.comments.map((function(e){return e.id===s.id?i(i({},s),{},{replies:[].concat(P(s.replies),P(l.comments))}):e}))});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return(L=g(m().mark((function e(t){var n,r,o,i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.data,e.next=3,r.comments.add({comment:o});case 3:return i=e.sent,o=i.comments[0],e.abrupt("return",{comments:[o].concat(P(n.comments)),commentCount:n.commentCount+1});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(){return(I=g(m().mark((function e(t){var n,r,o,a,s,u,l;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.data,a=o.reply,s=o.parent,(u=a).parent_id=s.id,e.next=5,r.comments.add({comment:u});case 5:return l=e.sent,u=l.comments[0],e.abrupt("return",{comments:n.comments.map((function(e){return e.id===s.id?i(i({},s),{},{replies:[].concat(P(s.replies),[u]),count:i(i({},s.count),{},{replies:s.count.replies+1})}):e})),commentCount:n.commentCount+1});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return(z=g(m().mark((function e(t){var n,r,o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.adminApi,o=t.data,e.next=3,r.hideComment(o.id);case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===o.id?i(i({},e),{},{status:"hidden"}):e}));return e.id===o.id?i(i({},e),{},{status:"hidden",replies:t}):i(i({},e),{},{replies:t})})),commentCount:n.commentCount-1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){return(_=g(m().mark((function e(t){var n,r,o,a,s,u;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.adminApi,a=t.data,e.next=3,o.showComment(a.id);case 3:return e.next=5,r.comments.read(a.id);case 5:return s=e.sent,u=s.comments[0],e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===a.id?u:e}));return e.id===a.id?u:i(i({},e),{},{replies:t})})),commentCount:n.commentCount+1});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=g(m().mark((function e(t){var n,r,o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.data,e.next=3,r.comments.like({comment:o});case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===o.id?i(i({},e),{},{liked:!0,count:i(i({},e.count),{},{likes:e.count.likes+1})}):e}));return e.id===o.id?i(i({},e),{},{liked:!0,replies:t,count:i(i({},e.count),{},{likes:e.count.likes+1})}):i(i({},e),{},{replies:t})}))});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return($=g(m().mark((function e(t){var n,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.state,n=t.api,r=t.data,e.next=3,n.comments.report({comment:r});case 3:return e.abrupt("return",{});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=g(m().mark((function e(t){var n,r,o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.data,e.next=3,r.comments.unlike({comment:o});case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===o.id?i(i({},e),{},{liked:!1,count:i(i({},e.count),{},{likes:e.count.likes-1})}):e}));return e.id===o.id?i(i({},e),{},{liked:!1,replies:t,count:i(i({},e.count),{},{likes:e.count.likes-1})}):i(i({},e),{},{replies:t})}))});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(){return(U=g(m().mark((function e(t){var n,r,o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.data,e.next=3,r.comments.edit({comment:{id:o.id,status:"deleted"}});case 3:return e.abrupt("return",{comments:n.comments.map((function(e){var t=e.replies.map((function(e){return e.id===o.id?i(i({},e),{},{status:"deleted"}):e}));return e.id===o.id?i(i({},e),{},{status:"deleted",replies:t}):i(i({},e),{},{replies:t})})),commentCount:n.commentCount-1});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return(W=g(m().mark((function e(t){var n,r,o,a,s,u;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.state,r=t.api,o=t.data,a=o.comment,s=o.parent,e.next=3,r.comments.edit({comment:a});case 3:return u=e.sent,a=u.comments[0],e.abrupt("return",{comments:n.comments.map((function(e){return s&&s.id===e.id?i(i({},e),{},{replies:e.replies.map((function(e){return e.id===a.id?a:e}))}):e.id===a.id?a:e}))});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=g(m().mark((function e(t){var n,r,o,i,a,s,u,l,c,f,d;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.data,i=t.state,a=t.api,s=o.name,u=o.bio,l={},c=null===i||void 0===i||null===(n=i.member)||void 0===n?void 0:n.name,s&&c!==s&&(l.name=s),f=null===i||void 0===i||null===(r=i.member)||void 0===r?void 0:r.bio,void 0!==u&&f!==u&&(l.bio=u),!(Object.keys(l).length>0)){e.next=20;break}return e.prev=8,e.next=11,a.member.update(l);case 11:if(d=e.sent){e.next=14;break}throw new Error("Failed to update member");case 14:return e.abrupt("return",{member:d,success:!0});case 17:return e.prev=17,e.t0=e.catch(8),e.abrupt("return",{success:!1,error:e.t0});case 20:return e.abrupt("return",null);case 21:case"end":return e.stop()}}),e,null,[[8,17]])})))).apply(this,arguments)}var K={addComment:function(e){return L.apply(this,arguments)},editComment:function(e){return W.apply(this,arguments)},hideComment:function(e){return z.apply(this,arguments)},deleteComment:function(e){return U.apply(this,arguments)},showComment:function(e){return _.apply(this,arguments)},likeComment:function(e){return V.apply(this,arguments)},unlikeComment:function(e){return H.apply(this,arguments)},reportComment:function(e){return $.apply(this,arguments)},addReply:function(e){return I.apply(this,arguments)},loadMoreComments:function(e){return R.apply(this,arguments)},loadMoreReplies:function(e){return B.apply(this,arguments)},updateMember:function(e){return q.apply(this,arguments)},openPopup:function(e){return{popup:e.data}},closePopup:function(){return{popup:null}}};function J(e){return Q.apply(this,arguments)}function Q(){return(Q=g(m().mark((function e(t){var n,r,o,i,a,s;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.action,r=t.data,o=t.state,i=t.api,a=t.adminApi,!(s=K[n])){e.next=9;break}return e.next=5,s({data:r,state:o,api:i,adminApi:a});case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:return e.abrupt("return",e.t0);case 9:return e.abrupt("return",{});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var G=function(e){var t=e.type,n=e.status,r=e.autoHide,o=e.duration,i=void 0===o?2600:o,a=e.closeable,s=e.state,u=e.message,l=e.meta,c=void 0===l?{}:l,f=0;return s&&s.popupNotification&&(f=(s.popupNotification.count||0)+1),{type:t,status:n,autoHide:r,closeable:a,duration:i,meta:c,message:u,count:f}};function Y(e){var t=new Date(e),n=new Date,r=Math.round((n.getTime()-t.getTime())/1e3);if(r<5)return"Just now";if(r<60)return"".concat(r," seconds ago");if((r/=60)<60)return 1===Math.floor(r)?"One minute ago":"".concat(Math.floor(r)," minutes ago");var o=new Date(n.getFullYear(),n.getMonth(),n.getDate()-1);return t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()&&t.getDate()===o.getDate()?"Yesterday":(r/=60)<24?1===Math.floor(r)?"One hour ago":"".concat(Math.floor(r)," hours ago"):(r/=24)<7?1===Math.floor(r)?"One day ago":"".concat(Math.floor(r)," days ago"):(r/=7,1===Math.floor(r)?"One week ago":"".concat(Math.floor(r)," weeks ago"))}function X(e){var t=new Date(e),n=t.toLocaleDateString("en-us",{day:"2-digit"}),r=t.toLocaleString("en-us",{month:"short"}),o=t.getFullYear(),i=(t.getHours()<10?"0":"")+t.getHours(),a=(t.getMinutes()<10?"0":"")+t.getMinutes();return"".concat(n," ").concat(r," ").concat(o," ").concat(i,":").concat(a)}function Z(e){if(!e)return"";var t=e.split(" ");return 0===t.length?"":1===t.length?t[0].substring(0,1).toLocaleUpperCase():t[0].substring(0,1).toLocaleUpperCase()+t[t.length-1].substring(0,1).toLocaleUpperCase()}function ee(){return Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)<480}var te={dev:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.customSiteUrl;return!1},test:function(){return!1}},ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.some((function(e){var n=te[e];return!(!n||!n(t))}))};var re=function(e){var t=e.siteUrl,n=void 0===t?window.location.origin:t,r=e.apiUrl,o=e.apiKey;function i(e){var t=e.type,r=e.resource,o=e.params,i=void 0===o?"":o;if("members"===t)return"".concat(n.replace(/\/$/,""),"/").concat("members/api","/").concat(r,"/").concat(i)}function a(e){var t=e.url,n=e.method,r=void 0===n?"GET":n,o=e.headers,i=void 0===o?{}:o,a=e.credentials,s=void 0===a?void 0:a,u=e.body;return fetch(t,{method:r,headers:i,credentials:s,body:void 0===u?void 0:u})}var s={};s.site={settings:function(){return a({url:function(e){var t=e.resource,n=e.params,i=void 0===n?"":n;return r&&o?"".concat(r.replace(/\/$/,""),"/").concat(t,"/?key=").concat(o,"&limit=all").concat(i):""}({resource:"settings"}),method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to fetch site data")}))}},s.member={identity:function(){return a({url:i({type:"members",resource:"session"}),credentials:"same-origin"}).then((function(e){return e.ok&&204!==e.status?e.text():null}))},sessionData:function(){return a({url:i({type:"members",resource:"member"}),credentials:"same-origin"}).then((function(e){return e.ok&&204!==e.status?e.json():null}))},update:function(e){var t={name:e.name,bio:e.bio};return a({url:i({type:"members",resource:"member"}),method:"PUT",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)}).then((function(e){return e.ok?e.json():null}))}};var u=null;return s.comments={count:function(e){return g(m().mark((function t(){var n,r,o,s;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.postId,r=i({type:"members",resource:"comments/counts"}),t.next=4,a({url:r,method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({ids:[n]})});case 4:return o=t.sent,t.next=7,o.json();case 7:return s=t.sent,t.abrupt("return",s[n]);case 9:case"end":return t.stop()}}),t)})))()},browse:function(e){var t,n=e.page,r=e.postId;u=null!==(t=u)&&void 0!==t?t:(new Date).toISOString();var o=encodeURIComponent("post_id:".concat(r,"+created_at:<=").concat(u)),s=encodeURIComponent("created_at DESC, id DESC");return a({url:i({type:"members",resource:"comments",params:"?limit=5&order=".concat(s,"&filter=").concat(o,"&page=").concat(n)}),method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to fetch comments")}))},replies:function(e){return g(m().mark((function t(){var n,r,o,s,u,l,c;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.page,n=e.commentId,r=e.afterReplyId,o=e.limit,s=encodeURIComponent("id:>".concat(r)),u=encodeURIComponent("created_at ASC, id ASC"),l=i({type:"members",resource:"comments/".concat(n,"/replies"),params:"?limit=".concat(null!==o&&void 0!==o?o:5,"&order=").concat(u,"&filter=").concat(s)}),t.next=6,a({url:l,method:"GET",headers:{"Content-Type":"application/json"},credentials:"same-origin"});case 6:if(!(c=t.sent).ok){t.next=11;break}return t.abrupt("return",c.json());case 11:throw new Error("Failed to fetch replies");case 12:case"end":return t.stop()}}),t)})))()},add:function(e){var t={comments:[e.comment]};return a({url:i({type:"members",resource:"comments"}),method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to add comment")}))},edit:function(e){var t=e.comment,n={comments:[t]};return a({url:i({type:"members",resource:"comments/".concat(t.id)}),method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to edit comment")}))},read:function(e){return a({url:i({type:"members",resource:"comments/".concat(e)}),method:"GET",credentials:"same-origin"}).then((function(e){if(e.ok)return e.json();throw new Error("Failed to read comment")}))},like:function(e){var t=e.comment;return a({url:i({type:"members",resource:"comments/".concat(t.id,"/like")}),method:"POST",headers:{"Content-Type":"application/json"}}).then((function(e){if(e.ok)return"Success";throw new Error("Failed to like comment")}))},unlike:function(e){var t=e.comment,n={comments:[t]};return a({url:i({type:"members",resource:"comments/".concat(t.id,"/like")}),method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((function(e){if(e.ok)return"Success";throw new Error("Failed to unlike comment")}))},report:function(e){var t=e.comment;return a({url:i({type:"members",resource:"comments/".concat(t.id,"/report")}),method:"POST",headers:{"Content-Type":"application/json"}}).then((function(e){if(e.ok)return"Success";throw new Error("Failed to report comment")}))}},s.init=g(m().mark((function e(){var t,n,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([s.member.sessionData()]);case 2:return t=e.sent,n=p(t,1),r=n[0],e.abrupt("return",{member:r});case 6:case"end":return e.stop()}}),e)}))),s},oe=function(e){var t=Object(s.useContext)(A),n=t.accentColor,r=t.publication,o=t.member,i={backgroundColor:n},a={color:n},u=e.isFirst?"Start the conversation":"Join the discussion";return Object(j.jsxs)("section",{className:"flex flex-col items-center pt-[40px] ".concat(o?"pb-[32px]":"pb-[48px]"," ").concat(!e.isFirst&&"mt-4"," px-2 sm:px-8 border-t-2 border-gray-100 dark:border-gray-100/10 border-b-2"),children:[Object(j.jsx)("h1",{className:"mb-[8px] text-center text-black text-[24px] font-sans tracking-tight dark:text-[rgba(255,255,255,0.85)] ".concat(e.isFirst?"font-semibold":"font-bold"),children:u}),Object(j.jsxs)("p",{className:"mb-[28px] px-0 sm:px-8 w-full sm:max-w-screen-sm font-sans text-[16px] text-center leading-normal text-neutral-600 dark:text-[rgba(255,255,255,0.85)]",children:["Become a ",e.isPaid&&"paid"," member of ",Object(j.jsx)("span",{className:"font-semibold",children:r})," to start commenting."]}),Object(j.jsx)("button",{onClick:function(t){window.location.href=e.isPaid&&o?"#/portal/account/plans":"#/portal/signup"},className:"mb-[12px] text-white font-san py-[14px] px-5 rounded inline-block font-medium leading-none hover:opacity-90 transition-all",style:i,children:e.isPaid&&o?"Upgrade now":"Sign up now"}),!o&&Object(j.jsxs)("p",{className:"text-sm font-sans text-center text-neutral-400 dark:text-[rgba(255,255,255,0.5)]",children:[Object(j.jsx)("span",{className:"inline-block mr-1 text-[15px]",children:"Already a member?"}),Object(j.jsx)("button",{onClick:function(e){window.location.href="#/portal/signin"},className:"rounded-md hover:opacity-90 transition-all text-sm font-semibold",style:a,children:"Sign in"})]})]})};function ie(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ae(e,t){if(e in t){for(var n=t[e],r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return"function"==typeof n?n.apply(void 0,o):n}var a=new Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map((function(e){return'"'.concat(e,'"')})).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(a,ae),a}var se,ue,le=["static"],ce=["unmount"],fe=["as","children","refName"],de=((ue=de||{})[ue.None=0]="None",ue[ue.RenderStrategy=1]="RenderStrategy",ue[ue.Static=2]="Static",ue),pe=((se=pe||{})[se.Unmount=0]="Unmount",se[se.Hidden=1]="Hidden",se);function he(e){var t=e.ourProps,n=e.theirProps,o=e.slot,s=e.defaultTag,u=e.features,l=e.visible,c=void 0===l||l,f=e.name,d=ve(n,t);if(c)return me(d,o,s,f);var p=null!=u?u:0;if(2&p){var h=d.static,m=void 0!==h&&h,v=a(d,le);if(m)return me(v,o,s,f)}if(1&p){var g,y=d.unmount,b=void 0===y||y,k=a(d,ce);return ae(b?0:1,(r(g={},0,(function(){return null})),r(g,1,(function(){return me(i(i({},k),{},{hidden:!0,style:{display:"none"}}),o,s,f)})),g))}return me(d,o,s,f)}function me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=be(e,["unmount","static"]),u=i.as,l=void 0===u?n:u,c=i.children,f=i.refName,d=void 0===f?"ref":f,p=a(i,fe),h=void 0!==e.ref?r({},d,e.ref):{},m="function"==typeof c?c(t):c;p.className&&"function"==typeof p.className&&(p.className=p.className(t));var v={};if(l===s.Fragment&&Object.keys(ye(p)).length>0){if(!Object(s.isValidElement)(m)||Array.isArray(m)&&m.length>1)throw new Error(['Passing props on "Fragment"!',"","The current component <".concat(o,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(p).map((function(e){return" - ".concat(e)})).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((function(e){return" - ".concat(e)})).join("\n")].join("\n"));return Object(s.cloneElement)(m,Object.assign({},ve(m.props,ye(be(p,["ref"]))),v,h))}return Object(s.createElement)(l,Object.assign({},be(p,["ref"]),l!==s.Fragment&&h,l!==s.Fragment&&v),m)}function ve(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];for(var o={},i={},a=0,s=t;a<s.length;a++){var u=s[a];for(var l in u)l.startsWith("on")&&"function"==typeof u[l]?(null!=i[l]||(i[l]=[]),i[l].push(u[l])):o[l]=u[l]}if(o.disabled||o["aria-disabled"])return Object.assign(o,Object.fromEntries(Object.keys(i).map((function(e){return[e,void 0]}))));var c=function(e){Object.assign(o,r({},e,(function(t){for(var n=i[e],r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];var s,u=ie(n);try{for(u.s();!(s=u.n()).done;){var l=s.value;if(t.defaultPrevented)return;l.apply(void 0,[t].concat(o))}}catch(c){u.e(c)}finally{u.f()}})))};for(var f in i)c(f);return o}function ge(e){var t;return Object.assign(Object(s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function ye(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}function be(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=ie(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}var ke=Object(s.createContext)(null);ke.displayName="OpenClosedContext";var we=function(e){return e[e.Open=0]="Open",e[e.Closed=1]="Closed",e}(we||{});function xe(){return Object(s.useContext)(ke)}function De(e){var t=e.value,n=e.children;return u.a.createElement(ke.Provider,{value:t},n)}function Ee(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((function(e){return setTimeout((function(){throw e}))}))}var Ce,Oe="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,Se={serverHandoffComplete:!1};function Ae(){var e=p(Object(s.useState)(Se.serverHandoffComplete),2),t=e[0],n=e[1];return Object(s.useEffect)((function(){!0!==t&&n(!0)}),[t]),Object(s.useEffect)((function(){!1===Se.serverHandoffComplete&&(Se.serverHandoffComplete=!0)}),[]),t}var je=0;function Ne(){return++je}var Me=null!=(Ce=u.a.useId)?Ce:function(){var e=Ae(),t=p(u.a.useState(e?Ne:null),2),n=t[0],r=t[1];return Oe((function(){null===n&&r(Ne())}),[n]),null!=n?""+n:void 0};function Te(){var e=Object(s.useRef)(!1);return Oe((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function Fe(e){var t=Object(s.useRef)(e);return Oe((function(){t.current=e}),[e]),t}var Pe=function(e){var t=Fe(e);return u.a.useCallback((function(){return t.current.apply(t,arguments)}),[t])},Re=Symbol();function Be(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Object(s.useRef)(t);Object(s.useEffect)((function(){r.current=t}),[t]);var o=Pe((function(e){var t,n=ie(r.current);try{for(n.s();!(t=n.n()).done;){var o=t.value;null!=o&&("function"==typeof o?o(e):o.current=e)}}catch(i){n.e(i)}finally{n.f()}}));return t.every((function(e){return null==e||(null==e?void 0:e[Re])}))?void 0:o}function Le(){var e=[],t=[],n={enqueue:function(e){t.push(e)},addEventListener:function(e,t,r,o){return e.addEventListener(t,r,o),n.add((function(){return e.removeEventListener(t,r,o)}))},requestAnimationFrame:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=requestAnimationFrame.apply(void 0,arguments);return n.add((function(){return cancelAnimationFrame(e)}))})),nextFrame:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.requestAnimationFrame((function(){return n.requestAnimationFrame.apply(n,t)}))},setTimeout:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){var e=setTimeout.apply(void 0,arguments);return n.add((function(){return clearTimeout(e)}))})),add:function(t){return e.push(t),function(){var n=e.indexOf(t);n>=0&&(0,p(e.splice(n,1),1)[0])()}},dispose:function(){var t,n=ie(e.splice(0));try{for(n.s();!(t=n.n()).done;){(0,t.value)()}}catch(r){n.e(r)}finally{n.f()}},workQueue:function(){return g(m().mark((function e(){var n,r,o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=ie(t.splice(0)),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=9;break}return o=r.value,e.next=7,o();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})))()}};return n}function Ie(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).add.apply(t,r)}function ze(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e&&r.length>0&&(t=e.classList).remove.apply(t,r)}var _e=function(e){return e.Ended="ended",e.Cancelled="cancelled",e}(_e||{});function Ve(e,t,n,r){var o=n?"enter":"leave",i=Le(),a=void 0!==r?function(e){var t={called:!1};return function(){if(!t.called)return t.called=!0,e.apply(void 0,arguments)}}(r):function(){},s=ae(o,{enter:function(){return t.enter},leave:function(){return t.leave}}),u=ae(o,{enter:function(){return t.enterTo},leave:function(){return t.leaveTo}}),l=ae(o,{enter:function(){return t.enterFrom},leave:function(){return t.leaveFrom}});return ze.apply(void 0,[e].concat(P(t.enter),P(t.enterTo),P(t.enterFrom),P(t.leave),P(t.leaveFrom),P(t.leaveTo),P(t.entered))),Ie.apply(void 0,[e].concat(P(s),P(l))),i.nextFrame((function(){ze.apply(void 0,[e].concat(P(l))),Ie.apply(void 0,[e].concat(P(u))),function(e,t){var n=Le();if(!e)return n.dispose;var r=getComputedStyle(e),o=[r.transitionDuration,r.transitionDelay].map((function(e){var t=p(e.split(",").filter(Boolean).map((function(e){return e.includes("ms")?parseFloat(e):1e3*parseFloat(e)})).sort((function(e,t){return t-e})),1)[0];return void 0===t?0:t})),i=p(o,2);if(i[0]+i[1]!==0){var a=[];a.push(n.addEventListener(e,"transitionrun",(function(r){r.target===r.currentTarget&&(a.splice(0).forEach((function(e){return e()})),a.push(n.addEventListener(e,"transitionend",(function(e){e.target===e.currentTarget&&(t("ended"),a.splice(0).forEach((function(e){return e()})))})),n.addEventListener(e,"transitioncancel",(function(e){e.target===e.currentTarget&&(t("cancelled"),a.splice(0).forEach((function(e){return e()})))}))))})))}else t("ended");n.add((function(){return t("cancelled")})),n.dispose}(e,(function(n){return"ended"===n&&(ze.apply(void 0,[e].concat(P(s))),Ie.apply(void 0,[e].concat(P(t.entered)))),a(n)}))})),i.dispose}function $e(e){var t=e.container,n=e.direction,o=e.classes,i=e.events,a=e.onStart,u=e.onStop,l=Te(),c=function(){var e=p(Object(s.useState)(Le),1)[0];return Object(s.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}(),f=Fe(n),d=Pe((function(){return ae(f.current,{enter:function(){return i.current.beforeEnter()},leave:function(){return i.current.beforeLeave()},idle:function(){}})})),h=Pe((function(){return ae(f.current,{enter:function(){return i.current.afterEnter()},leave:function(){return i.current.afterLeave()},idle:function(){}})}));Oe((function(){var e=Le();c.add(e.dispose);var n=t.current;if(n&&"idle"!==f.current&&l.current)return e.dispose(),d(),a.current(f.current),e.add(Ve(n,o.current,"enter"===f.current,(function(t){var n;e.dispose(),ae(t,(r(n={},_e.Ended,(function(){h(),u.current(f.current)})),r(n,_e.Cancelled,(function(){})),n))}))),e.dispose}),[n])}var He=["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"],Ue=["show","appear","unmount"];function We(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(" ").filter((function(e){return e.trim().length>1}))}var qe=Object(s.createContext)(null);qe.displayName="TransitionContext";var Ke,Je=((Ke=Je||{}).Visible="visible",Ke.Hidden="hidden",Ke);var Qe=Object(s.createContext)(null);function Ge(e){return"children"in e?Ge(e.children):e.current.filter((function(e){return"visible"===e.state})).length>0}function Ye(e){var t=Fe(e),n=Object(s.useRef)([]),o=Te(),i=Pe((function(e){var i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe.Hidden,s=n.current.findIndex((function(t){return t.id===e}));-1!==s&&(ae(a,(r(i={},pe.Unmount,(function(){n.current.splice(s,1)})),r(i,pe.Hidden,(function(){n.current[s].state="hidden"})),i)),Ee((function(){var e;!Ge(n)&&o.current&&(null==(e=t.current)||e.call(t))})))})),a=Pe((function(e){var t=n.current.find((function(t){return t.id===e}));return t?"visible"!==t.state&&(t.state="visible"):n.current.push({id:e,state:"visible"}),function(){return i(e,pe.Unmount)}}));return Object(s.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function Xe(){}Qe.displayName="NestingContext";var Ze=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function et(e){var t,n,r={},o=ie(Ze);try{for(o.s();!(n=o.n()).done;){var i=n.value;r[i]=null!=(t=e[i])?t:Xe}}catch(a){o.e(a)}finally{o.f()}return r}var tt,nt,rt,ot=de.RenderStrategy,it=ge((function(e,t){var n,o=e.beforeEnter,i=e.afterEnter,l=e.beforeLeave,c=e.afterLeave,f=e.enter,d=e.enterFrom,h=e.enterTo,m=e.entered,v=e.leave,g=e.leaveFrom,y=e.leaveTo,b=a(e,He),k=Object(s.useRef)(null),w=Be(k,t),x=p(Object(s.useState)("visible"),2),D=x[0],E=x[1],C=b.unmount?pe.Unmount:pe.Hidden,O=function(){var e=Object(s.useContext)(qe);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),S=O.show,A=O.appear,j=O.initial,N=function(){var e=Object(s.useContext)(Qe);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),M=N.register,T=N.unregister,F=Object(s.useRef)(null),P=Me();Object(s.useEffect)((function(){if(P)return M(P)}),[M,P]),Object(s.useEffect)((function(){if(C===pe.Hidden&&P){var e;if(S&&"visible"!==D)return void E("visible");ae(D,(r(e={},"hidden",(function(){return T(P)})),r(e,"visible",(function(){return M(P)})),e))}}),[D,P,M,T,S,C]);var R=Fe({enter:We(f),enterFrom:We(d),enterTo:We(h),entered:We(m),leave:We(v),leaveFrom:We(g),leaveTo:We(y)}),B=function(e){var t=Object(s.useRef)(et(e));return Object(s.useEffect)((function(){t.current=et(e)}),[e]),t}({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:c}),L=Ae();Object(s.useEffect)((function(){if(L&&"visible"===D&&null===k.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[k,D,L]);var I=j&&!A,z=!L||I||F.current===S?"idle":S?"enter":"leave",_=Object(s.useRef)(!1),V=Ye((function(){_.current||(E("hidden"),T(P))}));$e({container:k,classes:R,events:B,direction:z,onStart:Fe((function(){_.current=!0})),onStop:Fe((function(e){_.current=!1,"leave"===e&&!Ge(V)&&(E("hidden"),T(P))}))}),Object(s.useEffect)((function(){!I||(C===pe.Hidden?F.current=null:F.current=S)}),[S,I,D]);var $=b,H={ref:w};return u.a.createElement(Qe.Provider,{value:V},u.a.createElement(De,{value:ae(D,(n={},r(n,"visible",we.Open),r(n,"hidden",we.Closed),n))},he({ourProps:H,theirProps:$,defaultTag:"div",features:ot,visible:"visible"===D,name:"Transition.Child"})))})),at=ge((function(e,t){var n,o=e.show,l=e.appear,c=void 0!==l&&l,f=e.unmount,d=a(e,Ue),h=Object(s.useRef)(null),m=Be(h,t);Ae();var v=xe();if(void 0===o&&null!==v&&(o=ae(v,(r(n={},we.Open,!0),r(n,we.Closed,!1),n))),![!0,!1].includes(o))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var g=p(Object(s.useState)(o?"visible":"hidden"),2),y=g[0],b=g[1],k=Ye((function(){b("hidden")})),w=p(Object(s.useState)(!0),2),x=w[0],D=w[1],E=Object(s.useRef)([o]);Oe((function(){!1!==x&&E.current[E.current.length-1]!==o&&(E.current.push(o),D(!1))}),[E,o]);var C=Object(s.useMemo)((function(){return{show:o,appear:c,initial:x}}),[o,c,x]);Object(s.useEffect)((function(){if(o)b("visible");else if(Ge(k)){var e=h.current;if(!e)return;var t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&b("hidden")}else b("hidden")}),[o,k]);var O={unmount:f};return u.a.createElement(Qe.Provider,{value:k},u.a.createElement(qe.Provider,{value:C},he({ourProps:i(i({},O),{},{as:s.Fragment,children:u.a.createElement(it,i(i({ref:m},O),d))}),theirProps:{},defaultTag:s.Fragment,features:ot,visible:"visible"===y,name:"Transition"})))})),st=ge((function(e,t){var n=null!==Object(s.useContext)(qe),r=null!==xe();return u.a.createElement(u.a.Fragment,null,!n&&r?u.a.createElement(at,i({ref:t},e)):u.a.createElement(it,i({ref:t},e)))})),ut=Object.assign(at,{Child:st,Root:at}),lt=["title","titleId"];function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ct.apply(this,arguments)}function ft(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function dt(e,t){var n=e.title,r=e.titleId,o=ft(e,lt);return s.createElement("svg",ct({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,tt||(tt=s.createElement("path",{d:"M7 9.5C7 10.1566 7.12933 10.8068 7.3806 11.4134C7.63188 12.02 8.00017 12.5712 8.46447 13.0355C8.92876 13.4998 9.47995 13.8681 10.0866 14.1194C10.6932 14.3707 11.3434 14.5 12 14.5C12.6566 14.5 13.3068 14.3707 13.9134 14.1194C14.52 13.8681 15.0712 13.4998 15.5355 13.0355C15.9998 12.5712 16.3681 12.02 16.6194 11.4134C16.8707 10.8068 17 10.1566 17 9.5C17 8.84339 16.8707 8.19321 16.6194 7.58658C16.3681 6.97995 15.9998 6.42876 15.5355 5.96447C15.0712 5.50017 14.52 5.13188 13.9134 4.8806C13.3068 4.62933 12.6566 4.5 12 4.5C11.3434 4.5 10.6932 4.62933 10.0866 4.8806C9.47995 5.13188 8.92876 5.50017 8.46447 5.96447C8.00017 6.42876 7.63188 6.97995 7.3806 7.58658C7.12933 8.19321 7 8.84339 7 9.5V9.5Z",stroke:"white",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})),nt||(nt=s.createElement("circle",{cx:12,cy:12,r:11.375,stroke:"white",strokeWidth:1.25})),rt||(rt=s.createElement("path",{d:"M19.5 20C19.092 19.6069 18.4941 19.2498 17.7403 18.9489C16.9864 18.6481 16.0915 18.4094 15.1066 18.2466C14.1217 18.0838 13.0661 18 12 18C10.9339 18 9.87831 18.0838 8.8934 18.2466C7.90848 18.4094 7.01357 18.6481 6.25975 18.9489C5.50593 19.2498 4.90796 19.6069 4.5 20",stroke:"white",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})))}var pt=s.forwardRef(dt),ht=(n.p,function(e){var t,n,r,o,i=Object(s.useContext)(A).member,a=null!==(t=null===i||void 0===i?void 0:i.name)&&void 0!==t?t:null===(n=e.comment)||void 0===n||null===(r=n.member)||void 0===r?void 0:r.name,u=function(e,t,n){return Math.floor(e%(n-t)+t)},l="small"===e.size?"w-6 h-6 sm:w-8 sm:h-8":"w-9 h-9 sm:w-[40px] sm:h-[40px]",c="small"===e.size?"text-sm":"text-lg",f=e.comment?e.comment.member:i,d=(o=function(){var t=e.comment?e.comment.member:i;if(!t||!t.name)return[0,0,10];var n=isNaN(e.saturation)?50:e.saturation,r=[0,360],o=Math.round(n/(100/30))+30,a=[o-20,o],s=function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}(t.name);return[u(s,r[0],r[1]),n,u(s,a[0],a[1])]}(),"hsl(".concat(o[0],", ").concat(o[1],"%, ").concat(o[2],"%)")),p={background:d},h=Object(j.jsxs)(j.Fragment,{children:[a?Object(j.jsx)("div",{className:"flex justify-center items-center rounded-full ".concat(l),style:p,children:Object(j.jsx)("p",{className:"text-white font-sans font-semibold ".concat(c),children:function(){if(e.comment&&!e.comment.member)return Z("Deleted member");var t=e.comment?e.comment.member:i;return t&&t.name?Z(t.name):Z("Anonymous")}()})}):Object(j.jsx)("div",{className:"flex justify-center items-center rounded-full bg-neutral-900 dark:bg-[rgba(255,255,255,0.7)] ".concat(l),children:Object(j.jsx)(pt,{className:"stroke-white dark:stroke-[rgba(0,0,0,0.6)]"})}),f&&Object(j.jsx)("img",{className:"absolute top-0 left-0 rounded-full ".concat(l),src:f.avatar_image,alt:"Avatar"})]});return e.isBlank&&(h=Object(j.jsx)("div",{className:"flex justify-center items-center rounded-full bg-neutral-200 bg-[rgba(200,200,200,0.3)] ".concat(l),children:Object(j.jsx)(pt,{className:"stroke-white dark:opacity-70"})})),Object(j.jsx)("figure",{className:"relative ".concat(l),children:h})});function mt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=D(e)););return e}function vt(){return vt="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=mt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},vt.apply(this,arguments)}function gt(e,t,n){return gt=E()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&w(o,n.prototype),o},gt.apply(null,arguments)}function yt(e){var t="function"===typeof Map?new Map:void 0;return yt=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return gt(e,arguments,D(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),w(r,e)},yt(e)}function bt(e){this.content=e}bt.prototype={constructor:bt,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new bt(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new bt(n)},addToStart:function(e,t){return new bt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new bt(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new bt(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=bt.from(e)).size?new bt(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=bt.from(e)).size?new bt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=bt.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},bt.from=function(e){if(e instanceof bt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new bt(t)};var kt=bt;function wt(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){var s=wt(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function xt(e,t,n,r){for(var o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=e.child(--o),s=t.child(--i),u=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var l=0,c=Math.min(a.text.length,s.text.length);l<c&&a.text[a.text.length-l-1]==s.text[s.text.length-l-1];)l++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){var f=xt(a.content,s.content,n-1,r-1);if(f)return f}n-=u,r-=u}else n-=u,r-=u}}var Dt=function(){function e(t,n){if(y(this,e),this.content=t,this.size=n||0,null==n)for(var r=0;r<t.length;r++)this.size+=t[r].nodeSize}return k(e,[{key:"nodesBetween",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=0,a=0;a<t;i++){var s=this.content[i],u=a+s.nodeSize;if(u>e&&!1!==n(s,r+a,o||null,i)&&s.content.size){var l=a+1;s.nodesBetween(Math.max(0,e-l),Math.min(s.content.size,t-l),n,r+l)}a=u}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf?(r?o+="function"===typeof r?r(a):r:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),i=!n):!i&&a.isBlock&&(o+=n,i=!0)}),0),o}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new e(o,this.size+t.size)}},{key:"cut",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],o=0;if(n>t)for(var i=0,a=0;a<n;i++){var s=this.content[i],u=a+s.nodeSize;u>t&&((a<t||u>n)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),o+=s.nodeSize),a=u}return new e(r,o)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,i)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}},{key:"maybeChild",value:function(e){return this.content[e]||null}},{key:"forEach",value:function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}}},{key:"findDiffStart",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return wt(this,e,t)}},{key:"findDiffEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size;return xt(this,e,t,n)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return Ct(0,e);if(e==this.size)return Ct(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e||t>0?Ct(n+1,i):Ct(n,r);r=i}}},{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(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,o=0;o<t.length;o++){var i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}},{key:"from",value:function(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),e}();Dt.empty=new Dt([],0);var Et={index:0,offset:0};function Ct(e,t){return Et.index=e,Et.offset=t,Et}function Ot(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!Ot(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t)||!Ot(e[o],t[o]))return!1;for(var i in t)if(!(i in e))return!1}return!0}var St=function(){function e(t,n){y(this,e),this.type=t,this.attrs=n}return k(e,[{key:"addToSet",value:function(e){for(var t,n=!1,r=0;r<e.length;r++){var o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}},{key:"eq",value:function(e){return this==e||this.type==e.type&&Ot(this.attrs,e.attrs)}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type ".concat(t.type," in this schema"));return n.create(t.attrs)}},{key:"sameSet",value:function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}},{key:"setFrom",value:function(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];var n=t.slice();return n.sort((function(e,t){return e.type.rank-t.type.rank})),n}}]),e}();St.none=[];var At=function(e){x(n,e);var t=S(n);function n(){return y(this,n),t.apply(this,arguments)}return k(n)}(yt(Error)),jt=function(){function e(t,n,r){y(this,e),this.content=t,this.openStart=n,this.openEnd=r}return k(e,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(t,n){var r=Mt(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(Nt(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(Dt.fromJSON(t,n.content),r,o)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(var a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)o++;return new e(t,r,o)}}]),e}();function Nt(e,t,n){var r=e.findIndex(t),o=r.index,i=r.offset,a=e.maybeChild(o),s=e.findIndex(n),u=s.index,l=s.offset;if(i==t||a.isText){if(l!=n&&!e.child(u).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(o!=u)throw new RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(Nt(a.content,t-i-1,n-i-1)))}function Mt(e,t,n,r){var o=e.findIndex(t),i=o.index,a=o.offset,s=e.maybeChild(i);if(a==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));var u=Mt(s.content,t-a-1,n);return u&&e.replaceChild(i,s.copy(u))}function Tt(e,t,n){if(n.openStart>e.depth)throw new At("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new At("Inconsistent open depths");return Ft(e,t,n,0)}function Ft(e,t,n,r){var o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){var a=Ft(e,t,n,r+1);return i.copy(i.content.replaceChild(o,a))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){var s=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(Dt.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return It(i,zt(e,s.start,s.end,t,r))}var u=e.parent,l=u.content;return It(u,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}return It(i,_t(e,t,r))}function Pt(e,t){if(!t.type.compatibleContent(e.type))throw new At("Cannot join "+t.type.name+" onto "+e.type.name)}function Rt(e,t,n){var r=e.node(n);return Pt(r,t.node(n)),r}function Bt(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Lt(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Bt(e.nodeAfter,r),i++));for(var s=i;s<a;s++)Bt(o.child(s),r);t&&t.depth==n&&t.textOffset&&Bt(t.nodeBefore,r)}function It(e,t){if(!e.type.validContent(t))throw new At("Invalid content for node "+e.type.name);return e.copy(t)}function zt(e,t,n,r,o){var i=e.depth>o&&Rt(e,t,o+1),a=r.depth>o&&Rt(n,r,o+1),s=[];return Lt(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(Pt(i,a),Bt(It(i,zt(e,t,n,r,o+1)),s)):(i&&Bt(It(i,_t(e,t,o+1)),s),Lt(t,n,o,s),a&&Bt(It(a,_t(n,r,o+1)),s)),Lt(r,null,o,s),new Dt(s)}function _t(e,t,n){var r=[];(Lt(null,e,n,r),e.depth>n)&&Bt(It(Rt(e,t,n+1),_t(e,t,n+1)),r);return Lt(t,null,n,r),new Dt(r)}jt.empty=new jt(Dt.empty,0,0);var Vt=function(){function e(t,n,r){y(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return k(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o<e;o++)r+=n.child(o).nodeSize;return r}},{key:"marks",value:function(){var e=this.parent,t=this.index();if(0==e.content.size)return St.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var o=n;n=r,r=o}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}},{key:"marksAcross",value:function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Wt(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos<this.pos?e:this}},{key:"toString",value:function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}}],[{key:"resolve",value:function(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],o=0,i=n,a=t;;){var s=a.content.findIndex(i),u=s.index,l=s.offset,c=i-l;if(r.push(a,u,o+l),!c)break;if((a=a.child(u)).isText)break;i=c-1,o+=l+1}return new e(n,r,i)}},{key:"resolveCached",value:function(t,n){for(var r=0;r<$t.length;r++){var o=$t[r];if(o.pos==n&&o.doc==t)return o}var i=$t[Ht]=e.resolve(t,n);return Ht=(Ht+1)%Ut,i}}]),e}(),$t=[],Ht=0,Ut=12,Wt=function(){function e(t,n,r){y(this,e),this.$from=t,this.$to=n,this.depth=r}return k(e,[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}]),e}(),qt=Object.create(null),Kt=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:St.none;y(this,e),this.type=t,this.attrs=n,this.marks=o,this.content=r||Dt.empty}return k(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{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(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&Ot(this.attrs,t||e.defaultAttrs||qt)&&St.sameSet(this.marks,n||St.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return jt.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i),u=s.content.cut(r.pos-a,o.pos-a);return new jt(u,r.depth-i,o.depth-i)}},{key:"replace",value:function(e,t,n){return Tt(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}},{key:"resolve",value:function(e){return Vt.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return Vt.resolve(this,e)}},{key:"rangeHasMark",value:function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Qt(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Dt.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,i=this.contentMatchAt(e).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=r;s<o;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}},{key:"canReplaceWith",value:function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}},{key:"canAppend",value:function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}},{key:"check",value:function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node ".concat(this.type.name,": ").concat(this.content.toString().slice(0,50)));for(var e=St.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!St.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(e){return e.type.name}))));this.content.forEach((function(e){return e.check()}))}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=Dt.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}]),e}();Kt.prototype.text=void 0;var Jt=function(e){x(n,e);var t=S(n);function n(e,r,o,i){var a;if(y(this,n),a=t.call(this,e,r,null,i),!o)throw new RangeError("Empty text nodes are not allowed");return a.text=o,a}return k(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Qt(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(e,t){return this.text.slice(e,t)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}},{key:"withText",value:function(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}},{key:"cut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=vt(D(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(Kt);function Qt(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var Gt=function(){function e(t){y(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return k(e,[{key:"matchType",value:function(e){for(var t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}},{key:"matchFragment",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}},{key:"inlineContent",get:function(){return this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var e=0;e<this.next.length;e++){var t=this.next[e].type;if(!t.isText&&!t.hasRequiredAttrs())return t}return null}},{key:"compatible",value:function(e){for(var t=0;t<this.next.length;t++)for(var n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];function o(i,a){var s=i.matchFragment(e,n);if(s&&(!t||s.validEnd))return Dt.from(a.map((function(e){return e.createAndFill()})));for(var u=0;u<i.next.length;u++){var l=i.next[u],c=l.type,f=l.next;if(!c.isText&&!c.hasRequiredAttrs()&&-1==r.indexOf(f)){r.push(f);var d=o(f,a.concat(c));if(d)return d}}return null}return o(this,[])}},{key:"findWrapping",value:function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}},{key:"computeWrapping",value:function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(e)){for(var i=[],a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<o.next.length;s++){var u=o.next[s],l=u.type,c=u.next;l.isLeaf||l.hasRequiredAttrs()||l.name in t||r.type&&!c.validEnd||(n.push({match:l.contentMatch,type:l,via:r}),t[l.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o++)r+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return r})).join("\n")}}],[{key:"parse",value:function(t,n){var r=new Yt(t,n);if(null==r.next)return e.empty;var o=Xt(r);r.next&&r.err("Unexpected trailing text");var i=function(e){var t=Object.create(null);return n(on(e,0));function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){for(var i,a=0;a<o.length;a++)o[a][0]==n&&(i=o[a][1]);on(e,r).forEach((function(e){i||o.push([n,i=[]]),-1==i.indexOf(e)&&i.push(e)}))}}))}));for(var i=t[r.join(",")]=new Gt(r.indexOf(e.length-1)>-1),a=0;a<o.length;a++){var s=o[a][1].sort(rn);i.next.push({type:o[a][0],next:t[s.join(",")]||n(s)})}return i}}(function(e){var t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((function(e){return e.to=t}))}function i(e,t){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(i(n,t))}),[]);if("seq"!=e.type){if("star"==e.type){var a=n();return r(t,a),o(i(e.expr,a),a),[r(a)]}if("plus"==e.type){var s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){for(var u=t,l=0;l<e.min;l++){var c=n();o(i(e.expr,u),c),u=c}if(-1==e.max)o(i(e.expr,u),u);else for(var f=e.min;f<e.max;f++){var d=n();r(u,d),o(i(e.expr,u),d),u=d}return[r(u)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(var p=0;;p++){var h=i(e.exprs[p],t);if(p==e.exprs.length-1)return h;o(h,t=n())}}}(o));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var o=r[n],i=!o.validEnd,a=[],s=0;s<o.next.length;s++){var u=o.next[s],l=u.type,c=u.next;a.push(l.name),!i||l.isText||l.hasRequiredAttrs()||(i=!1),-1==r.indexOf(c)&&r.push(c)}i&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,r),i}}]),e}();Gt.empty=new Gt(!0);var Yt=function(){function e(t,n){y(this,e),this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return k(e,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(e){return this.next==e&&(this.pos++||!0)}},{key:"err",value:function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}]),e}();function Xt(e){var t=[];do{t.push(Zt(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Zt(e){var t=[];do{t.push(en(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function en(e){for(var t=function(e){if(e.eat("(")){var t=Xt(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.groups.indexOf(t)>-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=nn(e,t)}return t}function tn(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function nn(e,t){var n=tn(e),r=n;return e.eat(",")&&(r="}"!=e.next?tn(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function rn(e,t){return t-e}function on(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var a=o[i],s=a.term,u=a.to;s||-1!=n.indexOf(u)||t(u)}}(t),n.sort(rn)}function an(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function sn(e,t){var n=Object.create(null);for(var r in e){var o=t&&t[r];if(void 0===o){var i=e[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function un(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new cn(e[n]);return t}var ln=function(){function e(t,n,r){y(this,e),this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=un(r.attrs),this.defaultAttrs=an(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}return k(e,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==Gt.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(e){return this==e||this.contentMatch.compatible(e.contentMatch)}},{key:"computeAttrs",value:function(e){return!e&&this.defaultAttrs?this.defaultAttrs:sn(this.attrs,e)}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=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 Kt(this,this.computeAttrs(e),Dt.from(t),St.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=Dt.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Kt(this,this.computeAttrs(e),t,St.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=Dt.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(Dt.empty,!0);return i?new Kt(this,e,t.append(i),St.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}},{key:"allowsMarkType",value:function(e){return null==this.markSet||this.markSet.indexOf(e)>-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}},{key:"allowedMarks",value:function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:St.none:e}}],[{key:"compile",value:function(t,n){var r=Object.create(null);t.forEach((function(t,o){return r[t]=new e(t,n,o)}));var o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}]),e}(),cn=function(){function e(t){y(this,e),this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}return k(e,[{key:"isRequired",get:function(){return!this.hasDefault}}]),e}(),fn=function(){function e(t,n,r,o){y(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=un(o.attrs),this.excluded=null;var i=an(this.attrs);this.instance=i?new St(this,i):null}return k(e,[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new St(this,sn(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]}},{key:"excludes",value:function(e){return this.excluded.indexOf(e)>-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),o=0;return t.forEach((function(t,i){return r[t]=new e(t,o++,n,i)})),r}}]),e}(),dn=function(){function e(t){y(this,e),this.cached=Object.create(null),this.spec={nodes:kt.from(t.nodes),marks:kt.from(t.marks||{}),topNode:t.topNode},this.nodes=ln.compile(this.spec.nodes,this),this.marks=fn.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var o=this.nodes[r],i=o.spec.content||"",a=o.spec.marks;o.contentMatch=n[i]||(n[i]=Gt.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==a?null:a?pn(this,a.split(" ")):""!=a&&o.inlineContent?null:[]}for(var s in this.marks){var u=this.marks[s],l=u.spec.excludes;u.excluded=null==l?[u]:""==l?[]:pn(this,l.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 k(e,[{key:"node",value:function(e){var t=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 e)e=this.nodeType(e);else{if(!(e instanceof ln))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new Jt(n,n.defaultAttrs,e,St.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return Kt.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return St.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}]),e}();function pn(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(var s in e.marks){var u=e.marks[s];("_"==o||u.spec.group&&u.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var hn=function(){function e(t,n){var r=this;y(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach((function(e){e.tag?r.tags.push(e):e.style&&r.styles.push(e)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}return k(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new kn(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new kn(this,t,!0);return n.addAll(e,t.from,t.to),jt.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(wn(e,o.tag)&&(void 0===o.namespace||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(e);if(!1===i)continue;o.attrs=i||void 0}return o}}}},{key:"matchStyle",value:function(e,t,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o],a=i.style;if(!(0!=a.indexOf(e)||i.context&&!n.matchesContext(i.context)||a.length>e.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(i.getAttrs){var s=i.getAttrs(t);if(!1===s)continue;i.attrs=s||void 0}return i}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var o=t[r];if((null==o.priority?50:o.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach((function(e){n(e=xn(e)),e.mark=t}))};for(var o in e.marks)r(o);var i=function(t){var r=e.nodes[t].spec.parseDOM;r&&r.forEach((function(e){n(e=xn(e)),e.node=t}))};for(var a in e.nodes)i(a);return t}},{key:"fromSchema",value:function(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}}]),e}(),mn={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},vn={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},gn={ol:!0,ul:!0};function yn(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var bn=function(){function e(t,n,r,o,i,a,s){y(this,e),this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=s,this.content=[],this.activeMarks=St.none,this.stashMarks=[],this.match=a||(4&s?null:t.contentMatch)}return k(e,[{key:"findWrapping",value:function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(Dt.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}},{key:"finish",value:function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];if(n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-t[0].length))}}var o=Dt.from(this.content);return!e&&this.match&&(o=o.append(this.match.fillBefore(Dt.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o}},{key:"popFromStashMark",value:function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}},{key:"applyPending",value:function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var r=n[t];(this.type?this.type.allowsMarkType(r.type):Dn(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!mn.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}]),e}(),kn=function(){function e(t,n,r){y(this,e),this.parser=t,this.options=n,this.isOpen=r,this.open=0;var o,i=n.topNode,a=yn(null,n.preserveWhitespace,0)|(r?4:0);o=i?new bn(i.type,i.attrs,St.none,St.none,!0,n.topMatch||i.type.contentMatch,a):new bn(r?null:t.schema.topNodeType,null,St.none,St.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}return k(e,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(e),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],r)}}},{key:"addTextNode",value:function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}},{key:"addElement",value:function(e,t){var n,r=e.nodeName.toLowerCase();gn.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&gn.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:vn.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);var i,a=this.top,s=this.needsBlock;if(mn.hasOwnProperty(r))i=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),i&&this.sync(a),this.needsBlock=s}else this.addElementByRule(e,o,!1===o.consuming?n:void 0)}},{key:"leafFallback",value:function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(e){var t=St.none;e:for(var n=0;n<e.length;n+=2)for(var r=void 0;;){var o=this.parser.matchStyle(e[n],e[n+1],this,r);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;r=o}return t}},{key:"addElementByRule",value:function(e,t,n){var r,o,i,a=this;t.node?(o=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace):(i=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(i));var s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return a.insertNode(e)}));else{var u=e;"string"==typeof t.contentElement?u=e.querySelector(t.contentElement):"function"==typeof t.contentElement?u=t.contentElement(e):t.contentElement&&(u=t.contentElement),this.findAround(e,u,!0),this.addAll(u)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}},{key:"addAll",value:function(e,t,n){for(var r=t||0,o=t?e.childNodes[t]:e.firstChild,i=null==n?null:e.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}},{key:"findPlace",value:function(e){for(var t,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a<t.length;a++)this.enterInner(t[a],null,!1);return!0}},{key:"insertNode",value:function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,o=0;o<e.marks.length;o++)n.type&&!n.type.allowsMarkType(e.marks[o].type)||(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}},{key:"enter",value:function(e,t,n){var r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}},{key:"enterInner",value:function(e){var t=arguments.length>1&&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 o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);var i=yn(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new bn(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}},{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(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}},{key:"findAround",value:function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}},{key:"findInText",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}},{key:"matchesContext",value:function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1);return function e(a,s){for(;a>=0;a--){var u=n[a];if(""==u){if(a==n.length-1||0==a)continue;for(;s>=i;s--)if(e(a-1,s))return!0;return!1}var l=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!l||l.name!=u&&-1==l.groups.indexOf(u))return!1;s--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}}},{key:"addPendingMark",value:function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var o=r.popFromStashMark(e);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==t)break}}}]),e}();function wn(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function xn(e){var t={};for(var n in e)t[n]=e[n];return t}function Dn(e,t){var n=t.schema.nodes,r=function(r){var o=n[r];if(!o.allowsMarkType(e))return"continue";var i=[];return function e(n){i.push(n);for(var r=0;r<n.edgeCount;r++){var o=n.edge(r),a=o.type,s=o.next;if(a==t)return!0;if(i.indexOf(s)<0&&e(s))return!0}}(o.contentMatch)?{v:!0}:void 0};for(var o in n){var i=r(o);if("continue"!==i&&"object"===typeof i)return i.v}}var En=function(){function e(t,n){y(this,e),this.nodes=t,this.marks=n}return k(e,[{key:"serializeFragment",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=On(n).createDocumentFragment());var o=r,i=[];return e.forEach((function(e){if(i.length||e.marks.length){for(var r=0,a=0;r<i.length&&a<e.marks.length;){var s=e.marks[a];if(t.marks[s.type.name]){if(!s.eq(i[r][0])||!1===s.type.spec.spanning)break;r++,a++}else a++}for(;r<i.length;)o=i.pop()[1];for(;a<e.marks.length;){var u=e.marks[a++],l=t.serializeMark(u,e.isInline,n);l&&(i.push([u,o]),o.appendChild(l.dom),o=l.contentDOM||l.dom)}}o.appendChild(t.serializeNodeInner(e,n))})),r}},{key:"serializeNodeInner",value:function(t,n){var r=e.renderSpec(On(n),this.nodes[t.type.name](t)),o=r.dom,i=r.contentDOM;if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return o}},{key:"serializeNode",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}},{key:"serializeMark",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.marks[t.type.name];return o&&e.renderSpec(On(r),o(t,n))}}],[{key:"renderSpec",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var o,i=n[0],a=i.indexOf(" ");a>0&&(r=i.slice(0,a),i=i.slice(a+1));var s=r?t.createElementNS(r,i):t.createElement(i),u=n[1],l=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u))for(var c in l=2,u)if(null!=u[c]){var f=c.indexOf(" ");f>0?s.setAttributeNS(c.slice(0,f),c.slice(f+1),u[c]):s.setAttribute(c,u[c])}for(var d=l;d<n.length;d++){var p=n[d];if(0===p){if(d<n.length-1||d>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=e.renderSpec(t,p,r),m=h.dom,v=h.contentDOM;if(s.appendChild(m),v){if(o)throw new RangeError("Multiple content holes");o=v}}return{dom:s,contentDOM:o}}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=Cn(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return Cn(e.marks)}}]),e}();function Cn(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function On(e){return e.document||window.document}var Sn=Math.pow(2,16);function An(e){return 65535&e}var jn=function(){function e(t,n,r){y(this,e),this.pos=t,this.delInfo=n,this.recover=r}return k(e,[{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}}]),e}(),Nn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(y(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return k(e,[{key:"recover",value:function(e){var t=0,n=An(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Sn}(e)}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?r:0);if(s>e)break;var u=this.ranges[a+o],l=this.ranges[a+i],c=s+u;if(e<=c){var f=s+r+((u?e==s?-1:e==c?1:t:t)<0?0:l);if(n)return f;var d=e==(t<0?s:c)?null:a/3+(e-s)*Sn,p=e==s?2:e==c?1:4;return(t<0?e!=s:e!=c)&&(p|=8),new jn(f,p,d)}r+=l-u}return n?e+r:new jn(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=An(t),o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>e)break;var u=this.ranges[a+o];if(e<=s+u&&a==3*r)return!0;n+=this.ranges[a+i]-u}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],a=i-(this.inverted?o:0),s=i+(this.inverted?0:o),u=this.ranges[r+t],l=this.ranges[r+n];e(a,a+u,s,s+l),o+=l-u}}},{key:"invert",value:function(){return new e(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}}]),e}();Nn.empty=new Nn([]);var Mn=function(){function e(){var t=arguments.length>0&&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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;y(this,e),this.maps=t,this.mirror=n,this.from=r,this.to=o}return k(e,[{key:"slice",value:function(){var t=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 e(this.maps,this.mirror,t,n)}},{key:"copy",value:function(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}},{key:"appendMapping",value:function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}},{key:"getMirror",value:function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}},{key:"setMirror",value:function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}},{key:"appendMappingInverted",value:function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}},{key:"invert",value:function(){var t=new e;return t.appendMappingInverted(this),t}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}},{key:"mapResult",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.from;o<this.to;o++){var i=this.maps[o].mapResult(e,t);if(null!=i.recover){var a=this.getMirror(o);if(null!=a&&a>o&&a<this.to){o=a,e=this.maps[a].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new jn(e,r,null)}}]),e}(),Tn=Object.create(null),Fn=function(){function e(){y(this,e)}return k(e,[{key:"getMap",value:function(){return Nn.empty}},{key:"merge",value:function(e){return null}}],[{key:"fromJSON",value:function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Tn[t.stepType];if(!n)throw new RangeError("No step type ".concat(t.stepType," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in Tn)throw new RangeError("Duplicate use of step JSON ID "+e);return Tn[e]=t,t.prototype.jsonID=e,t}}]),e}(),Pn=function(){function e(t,n){y(this,e),this.doc=t,this.failed=n}return k(e,null,[{key:"ok",value:function(t){return new e(t,null)}},{key:"fail",value:function(t){return new e(null,t)}},{key:"fromReplace",value:function(t,n,r,o){try{return e.ok(t.replace(n,r,o))}catch(se){if(se instanceof At)return e.fail(se.message);throw se}}}]),e}();function Rn(e,t,n){for(var r=[],o=0;o<e.childCount;o++){var i=e.child(o);i.content.size&&(i=i.copy(Rn(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return Dt.fromArray(r)}var Bn=function(e){x(n,e);var t=S(n);function n(e,r,o){var i;return y(this,n),(i=t.call(this)).from=e,i.to=r,i.mark=o,i}return k(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new jt(Rn(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),o),n.openStart,n.openEnd);return Pn.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new Ln(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(Fn);Fn.jsonID("addMark",Bn);var Ln=function(e){x(n,e);var t=S(n);function n(e,r,o){var i;return y(this,n),(i=t.call(this)).from=e,i.to=r,i.mark=o,i}return k(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=new jt(Rn(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return Pn.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new Bn(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(Fn);Fn.jsonID("removeMark",Ln);var In=function(e){x(n,e);var t=S(n);function n(e,r,o){var i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return y(this,n),(i=t.call(this)).from=e,i.to=r,i.slice=o,i.structure=a,i}return k(n,[{key:"apply",value:function(e){return this.structure&&_n(e,this.from,this.to)?Pn.fail("Structure replace would overwrite content"):Pn.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new Nn([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new n(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new n(t.pos,Math.max(t.pos,r.pos),this.slice)}},{key:"merge",value:function(e){if(!(e instanceof n)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var t=this.slice.size+e.slice.size==0?jt.empty:new jt(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new n(e.from,this.to,t,this.structure)}var r=this.slice.size+e.slice.size==0?jt.empty:new jt(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new n(this.from,this.to+(e.to-e.from),r,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new n(t.from,t.to,jt.fromJSON(e,t.slice),!!t.structure)}}]),n}(Fn);Fn.jsonID("replace",In);var zn=function(e){x(n,e);var t=S(n);function n(e,r,o,i,a,s){var u,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return y(this,n),(u=t.call(this)).from=e,u.to=r,u.gapFrom=o,u.gapTo=i,u.slice=a,u.insert=s,u.structure=l,u}return k(n,[{key:"apply",value:function(e){if(this.structure&&(_n(e,this.from,this.gapFrom)||_n(e,this.gapTo,this.to)))return Pn.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Pn.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?Pn.fromReplace(e,this.from,this.to,n):Pn.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new Nn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var t=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||o<t.pos||i>r.pos?null:new n(t.pos,r.pos,o,i,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(t.from,t.to,t.gapFrom,t.gapTo,jt.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(Fn);function _n(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function Vn(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function $n(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!Vn(r,o,i))break}return null}function Hn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=Wn(e,t),i=o&&qn(r,t);return i?o.map(Un).concat({type:t,attrs:n}).concat(i.map(Un)):null}function Un(e){return{type:e,attrs:null}}function Wn(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}function qn(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,u=r;s&&u<o;u++)s=s.matchType(n.child(u).type);return s&&s.validEnd?a:null}function Kn(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=e.steps.length;e.doc.nodesBetween(t,n,(function(t,n){if(t.isTextblock&&!t.hasMarkup(r,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){e.clearIncompatible(e.mapping.slice(i).map(n,1),r);var a=e.mapping.slice(i),s=a.map(n,1),u=a.map(n+t.nodeSize,1);return e.step(new zn(s,u,s+1,u-1,new jt(Dt.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}function Jn(e,t,n,r,o){var i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);var a=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,a);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new zn(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new jt(Dt.from(a),0,0),1,!0))}function Qn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,u=n-2;s>i;s--,u--){var l=o.node(s),c=o.index(s);if(l.type.spec.isolating)return!1;var f=l.content.cutByIndex(c,l.childCount),d=r&&r[u]||l;if(d!=l&&(f=f.replaceChild(0,d.type.create(d.attrs))),!l.canReplace(c+1,l.childCount)||!d.type.validContent(f))return!1}var p=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(p,p,h?h.type:o.node(i+1).type)}function Gn(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.doc.resolve(t),i=Dt.empty,a=Dt.empty,s=o.depth,u=o.depth-n,l=n-1;s>u;s--,l--){i=Dt.from(o.node(s).copy(i));var c=r&&r[l];a=Dt.from(c?c.type.create(c.attrs,a):o.node(s).copy(a))}e.step(new In(t,t,new jt(i.append(a),n,n),!0))}function Yn(e,t){var n=e.resolve(t),r=n.index();return Xn(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Xn(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function Zn(e,t,n){var r=new In(t-n,t+n,jt.empty,!0);e.step(r)}function er(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:jt.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return tr(o,i,r)?new In(t,n,r):new nr(o,i,r).fit()}function tr(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Fn.jsonID("replaceAround",zn);var nr=function(){function e(t,n,r){y(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Dt.empty;for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(var a=t.depth;a>0;a--)this.placed=Dt.from(t.node(a).copy(this.placed))}return k(e,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;for(var i=this.placed,a=r.depth,s=o.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var u=new jt(i,a,s);return t>-1?new zn(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new In(r.pos,o.pos,u):null}},{key:"findFittable",value:function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=null,r=(t?(n=ir(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var i=this.frontier[o],a=i.type,s=i.match,u=void 0,l=null;if(1==e&&(r?s.matchType(r.type)||(l=s.fillBefore(Dt.from(r),!1)):n&&a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:o,parent:n,inject:l};if(2==e&&r&&(u=s.findWrapping(r.type)))return{sliceDepth:t,frontierDepth:o,parent:n,wrap:u};if(n&&s.matchType(n.type))break}}},{key:"openMore",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=ir(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new jt(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=ir(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new jt(rr(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new jt(rr(t,n,1),n,r)}},{key:"placeNodes",value:function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,o=e.inject,i=e.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var a=0;a<i.length;a++)this.openFrontierNode(i[a]);var s=this.unplaced,u=r?r.content:s.content,l=s.openStart-t,c=0,f=[],d=this.frontier[n],p=d.match,h=d.type;if(o){for(a=0;a<o.childCount;a++)f.push(o.child(a));p=p.matchFragment(o)}for(var m=u.size+t-(s.content.size-s.openEnd);c<u.childCount;){var v=u.child(c),g=p.matchType(v.type);if(!g)break;(++c>1||0==l||v.content.size)&&(p=g,f.push(ar(v.mark(h.allowedMarks(v.marks)),1==c?l:0,c==u.childCount?m:-1)))}var y=c==u.childCount;y||(m=-1),this.placed=or(this.placed,n,Dt.from(f)),this.frontier[n].match=p,y&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var b=0,k=u;b<m;b++){var w=k.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),k=w.content}this.unplaced=y?0==t?jt.empty:new jt(rr(s.content,t-1,1),t-1,m<0?s.openEnd:t-1):new jt(rr(s.content,t,c),s.openStart,s.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!sr(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=sr(e,t,o,r,i);if(a){for(var s=t-1;s>=0;s--){var u=this.frontier[s],l=u.match,c=sr(e,s,u.type,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}},{key:"close",value:function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=or(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e}},{key:"openFrontierNode",value:function(e){var t=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(e),this.placed=or(this.placed,this.depth,Dt.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(Dt.empty,!0);e.childCount&&(this.placed=or(this.placed,this.frontier.length,e))}}]),e}();function rr(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(rr(e.firstChild.content,t-1,n)))}function or(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(or(e.lastChild.content,t-1,n)))}function ir(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function ar(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,ar(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Dt.empty,!0)))),e.copy(r)}function sr(e,t,n,r,o){var i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=r.fillBefore(i.content,!0,a);return s&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,a)?s:null}function ur(e){return e.spec.defining||e.spec.definingForContent}function lr(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(lr(i.content,t+1,n,r,i)))}if(t>r){var a=o.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(Dt.empty,!0))}return e}function cr(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}var fr=Error;((fr=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=fr,fr.prototype.name="TransformError";var dr=function(){function e(t){y(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new Mn}return k(e,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(e){var t=this.maybeStep(e);if(t.failed)throw new fr(t.failed);return this}},{key:"maybeStep",value:function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jt.empty,r=er(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new jt(Dt.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,jt.empty)}},{key:"insert",value:function(e,t){return this.replaceWith(e,e,t)}},{key:"replaceRange",value:function(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);var o=e.doc.resolve(t),i=e.doc.resolve(n);if(tr(o,i,r))return e.step(new In(t,n,r));var a=cr(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var u=o.depth,l=o.pos-1;u>0;u--,l--){var c=o.node(u).type.spec;if(c.defining||c.definingAsContext||c.isolating)break;a.indexOf(u)>-1?s=u:o.before(u)==l&&a.splice(1,0,-u)}for(var f=a.indexOf(s),d=[],p=r.openStart,h=r.content,m=0;;m++){var v=h.firstChild;if(d.push(v),m==r.openStart)break;h=v.content}for(var g=p-1;g>=0;g--){var y=d[g].type,b=ur(y);if(b&&o.node(f).type!=y)p=g;else if(b||!y.isTextblock)break}for(var k=r.openStart;k>=0;k--){var w=(k+p+1)%(r.openStart+1),x=d[w];if(x)for(var D=0;D<a.length;D++){var E=a[(D+f)%a.length],C=!0;E<0&&(C=!1,E=-E);var O=o.node(E-1),S=o.index(E-1);if(O.canReplaceWith(S,S,x.type,x.marks))return e.replace(o.before(E),C?i.after(E):n,new jt(lr(r.content,0,r.openStart,w),w,r.openEnd))}}for(var A=e.steps.length,j=a.length-1;j>=0&&(e.replace(t,n,r),!(e.steps.length>A));j--){var N=a[j];N<0||(t=o.before(N),n=i.after(N))}}(this,e,t,n),this}},{key:"replaceRangeWith",value:function(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>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<r.node(a).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new jt(Dt.from(r),0,0))}(this,e,t,n),this}},{key:"deleteRange",value:function(e,t){return function(e,t,n){for(var r=e.doc.resolve(t),o=e.doc.resolve(n),i=cr(r,o),a=0;a<i.length;a++){var s=i[a],u=a==i.length-1;if(u&&0==s||r.node(s).type.contentMatch.validEnd)return e.delete(r.start(s),o.end(s));if(s>0&&(u||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return e.delete(r.before(s),o.after(s))}for(var l=1;l<=r.depth&&l<=o.depth;l++)if(t-r.start(l)==r.depth-l&&n>r.end(l)&&o.end(l)-n!=o.depth-l)return e.delete(r.before(l),n);e.delete(t,n)}(this,e,t),this}},{key:"lift",value:function(e,t){return function(e,t,n){for(var r=t.$from,o=t.$to,i=t.depth,a=r.before(i+1),s=o.after(i+1),u=a,l=s,c=Dt.empty,f=0,d=i,p=!1;d>n;d--)p||r.index(d)>0?(p=!0,c=Dt.from(r.node(d).copy(c)),f++):u--;for(var h=Dt.empty,m=0,v=i,g=!1;v>n;v--)g||o.after(v+1)<o.end(v)?(g=!0,h=Dt.from(o.node(v).copy(h)),m++):l++;e.step(new zn(u,l,a,s,new jt(c.append(h),f,m),c.size-f,!0))}(this,e,t),this}},{key:"join",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Zn(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=Dt.empty,o=n.length-1;o>=0;o--){if(r.size){var i=n[o].type.contentMatch.matchFragment(r);if(!i||!i.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Dt.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new zn(a,s,a,s,new jt(r,0,0),n.length,!0))}(this,e,t),this}},{key:"setBlockType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Kn(this,e,t,n,r),this}},{key:"setNodeMarkup",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Jn(this,e,t,n,r),this}},{key:"split",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return Gn(this,e,t,n),this}},{key:"addMark",value:function(e,t,n){return function(e,t,n,r){var o,i,a=[],s=[];e.doc.nodesBetween(t,n,(function(e,u,l){if(e.isInline){var c=e.marks;if(!r.isInSet(c)&&l.type.allowsMarkType(r.type)){for(var f=Math.max(u,t),d=Math.min(u+e.nodeSize,n),p=r.addToSet(c),h=0;h<c.length;h++)c[h].isInSet(p)||(o&&o.to==f&&o.mark.eq(c[h])?o.to=d:a.push(o=new Ln(f,d,c[h])));i&&i.to==f?i.to=d:s.push(i=new Bn(f,d,r))}}})),a.forEach((function(t){return e.step(t)})),s.forEach((function(t){return e.step(t)}))}(this,e,t,n),this}},{key:"removeMark",value:function(e,t,n){return function(e,t,n,r){var o=[],i=0;e.doc.nodesBetween(t,n,(function(e,a){if(e.isInline){i++;var s=null;if(r instanceof fn)for(var u,l=e.marks;u=r.isInSet(l);)(s||(s=[])).push(u),l=u.removeFromSet(l);else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length)for(var c=Math.min(a+e.nodeSize,n),f=0;f<s.length;f++){for(var d=s[f],p=void 0,h=0;h<o.length;h++){var m=o[h];m.step==i-1&&d.eq(o[h].style)&&(p=m)}p?(p.to=c,p.step=i):o.push({style:d,from:Math.max(a,t),to:c,step:i})}}})),o.forEach((function(t){return e.step(new Ln(t.from,t.to,t.style))}))}(this,e,t,n),this}},{key:"clearIncompatible",value:function(e,t,n){return function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,o=e.doc.nodeAt(t),i=[],a=t+1,s=0;s<o.childCount;s++){var u=o.child(s),l=a+u.nodeSize,c=r.matchType(u.type);if(c){r=c;for(var f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||e.step(new Ln(a,l,u.marks[f]))}else i.push(new In(a,l,jt.empty));a=l}if(!r.validEnd){var d=r.fillBefore(Dt.empty,!0);e.replace(a,a,new jt(d,0,0))}for(var p=i.length-1;p>=0;p--)e.step(i[p])}(this,e,t,n),this}}]),e}(),pr=Object.create(null),hr=function(){function e(t,n,r){y(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new mr(t.min(n),t.max(n))]}return k(e,[{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 e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jt.empty,n=t.content.lastChild,r=null,o=0;o<t.openEnd;o++)r=n,n=n.lastChild;for(var i=e.steps.length,a=this.ranges,s=0;s<a.length;s++){var u=a[s],l=u.$from,c=u.$to,f=e.mapping.slice(i);e.replaceRange(f.map(l.pos),f.map(c.pos),s?jt.empty:t),0==s&&Cr(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,s=i.$to,u=e.mapping.slice(n),l=u.map(a.pos),c=u.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),Cr(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return yr.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new yr(e):Er(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?Er(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):Er(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new xr(e.node(0))}},{key:"atStart",value:function(e){return Er(e,e,0,0,1)||new xr(e)}},{key:"atEnd",value:function(e){return Er(e,e,e.content.size,e.childCount,-1)||new xr(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=pr[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in pr)throw new RangeError("Duplicate use of selection JSON ID "+e);return pr[e]=t,t.prototype.jsonID=e,t}}]),e}();hr.prototype.visible=!0;var mr=k((function e(t,n){y(this,e),this.$from=t,this.$to=n})),vr=!1;function gr(e){vr||e.parent.inlineContent||(vr=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var yr=function(e){x(n,e);var t=S(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return y(this,n),gr(e),gr(r),t.call(this,e,r)}return k(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,t){var r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return hr.near(r);var o=e.resolve(t.map(this.anchor));return new n(o.parent.inlineContent?o:r,r)}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jt.empty;if(vt(D(n.prototype),"replace",this).call(this,e,t),t==jt.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new br(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(e.resolve(t.anchor),e.resolve(t.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,t,r){var o=e.pos-t.pos;if(r&&!o||(r=o>=0?1:-1),!t.parent.inlineContent){var i=hr.findFrom(t,r,!0)||hr.findFrom(t,-r,!0);if(!i)return hr.near(t,r);t=i.$head}return e.parent.inlineContent||(0==o||(e=(hr.findFrom(e,-r,!0)||hr.findFrom(e,r,!0)).$anchor).pos<t.pos!=o<0)&&(e=t),new n(e,t)}}]),n}(hr);hr.jsonID("text",yr);var br=function(){function e(t,n){y(this,e),this.anchor=t,this.head=n}return k(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){return yr.between(e.resolve(this.anchor),e.resolve(this.head))}}]),e}(),kr=function(e){x(n,e);var t=S(n);function n(e){var r;y(this,n);var o=e.nodeAfter,i=e.node(0).resolve(e.pos+o.nodeSize);return(r=t.call(this,e,i)).node=o,r}return k(n,[{key:"map",value:function(e,t){var r=t.mapResult(this.anchor),o=r.deleted,i=r.pos,a=e.resolve(i);return o?hr.near(a):new n(a)}},{key:"content",value:function(){return new jt(Dt.from(this.node),0,0)}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new wr(this.anchor)}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new n(e.resolve(t.anchor))}},{key:"create",value:function(e,t){return new n(e.resolve(t))}},{key:"isSelectable",value:function(e){return!e.isText&&!1!==e.type.spec.selectable}}]),n}(hr);kr.prototype.visible=!1,hr.jsonID("node",kr);var wr=function(){function e(t){y(this,e),this.anchor=t}return k(e,[{key:"map",value:function(t){var n=t.mapResult(this.anchor),r=n.deleted,o=n.pos;return r?new br(o,o):new e(o)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&kr.isSelectable(n)?new kr(t):hr.near(t)}}]),e}(),xr=function(e){x(n,e);var t=S(n);function n(e){return y(this,n),t.call(this,e.resolve(0),e.resolve(e.content.size))}return k(n,[{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jt.empty;if(t==jt.empty){e.delete(0,e.doc.content.size);var r=hr.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else vt(D(n.prototype),"replace",this).call(this,e,t)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new n(e)}},{key:"eq",value:function(e){return e instanceof n}},{key:"getBookmark",value:function(){return Dr}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(hr);hr.jsonID("all",xr);var Dr={map:function(){return this},resolve:function(e){return new xr(e)}};function Er(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return yr.create(e,n);for(var a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&kr.isSelectable(s))return kr.create(e,n-(o<0?s.nodeSize:0))}else{var u=Er(e,s,n+o,o<0?s.childCount:0,o,i);if(u)return u}n+=s.nodeSize*o}return null}function Cr(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o,i=e.steps[r];if(i instanceof In||i instanceof zn)e.mapping.maps[r].forEach((function(e,t,n,r){null==o&&(o=r)})),e.setSelection(hr.near(e.doc.resolve(o),n))}}var Or=function(e){x(n,e);var t=S(n);function n(e){var r;return y(this,n),(r=t.call(this,e.doc)).curSelectionFor=0,r.updated=0,r.meta=Object.create(null),r.time=Date.now(),r.curSelection=e.selection,r.storedMarks=e.storedMarks,r}return k(n,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=2,this}},{key:"ensureMarks",value:function(e){return St.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(e,t){vt(D(n.prototype),"addStep",this).call(this,e,t),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||St.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(hr.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e 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}(dr);function Sr(e,t){return t&&e?e.bind(t):e}var Ar=k((function e(t,n,r){y(this,e),this.name=t,this.init=Sr(n.init,r),this.apply=Sr(n.apply,r)})),jr=[new Ar("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Ar("selection",{init:function(e,t){return e.selection||hr.atStart(t.doc)},apply:function(e){return e.selection}}),new Ar("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Ar("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],Nr=k((function e(t,n){var r=this;y(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=jr.slice(),n&&n.forEach((function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new Ar(e.key,e.spec.state,e))}))})),Mr=function(){function e(t){y(this,e),this.config=t}return k(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}},{key:"applyTransaction",value:function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=r?r[i].n:0,u=r?r[i].state:this,l=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,u,n);if(l&&n.filterTransaction(l,i)){if(l.setMeta("appendedTransaction",e),!r){r=[];for(var c=0;c<this.config.plugins.length;c++)r.push(c<i?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}},{key:"applyInner",value:function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new e(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}},{key:"tr",get:function(){return new Or(this)}},{key:"reconfigure",value:function(t){for(var n=new Nr(this.schema,t.plugins),r=n.fields,o=new e(n),i=0;i<r.length;i++){var a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(t,o)}return o}},{key:"toJSON",value:function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}}],[{key:"create",value:function(t){for(var n=new Nr(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n),o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}},{key:"fromJSON",value:function(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new Nr(t.schema,t.plugins),i=new e(o);return o.fields.forEach((function(e){if("doc"==e.name)i.doc=Kt.fromJSON(t.schema,n.doc);else if("selection"==e.name)i.selection=hr.fromJSON(i.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(var o in r){var a=r[o],s=a.spec.state;if(a.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,o))return void(i[e.name]=s.fromJSON.call(a,t,n[o],i))}i[e.name]=e.init(t,i)}})),i}}]),e}();function Tr(e,t,n){for(var r in e){var o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Tr(o,t,{})),n[r]=o}return n}var Fr=function(){function e(t){y(this,e),this.spec=t,this.props={},t.props&&Tr(t.props,this,this.props),this.key=t.key?t.key.key:Rr("plugin")}return k(e,[{key:"getState",value:function(e){return e[this.key]}}]),e}(),Pr=Object.create(null);function Rr(e){return e in Pr?e+"$"+ ++Pr[e]:(Pr[e]=0,e+"$")}var Br=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";y(this,e),this.key=Rr(t)}return k(e,[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}]),e}(),Lr="undefined"!=typeof navigator?navigator:null,Ir="undefined"!=typeof document?document:null,zr=Lr&&Lr.userAgent||"",_r=/Edge\/(\d+)/.exec(zr),Vr=/MSIE \d/.exec(zr),$r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zr),Hr=!!(Vr||$r||_r),Ur=Vr?document.documentMode:$r?+$r[1]:_r?+_r[1]:0,Wr=!Hr&&/gecko\/(\d+)/i.test(zr);Wr&&(/Firefox\/(\d+)/.exec(zr)||[0,0])[1];var qr=!Hr&&/Chrome\/(\d+)/.exec(zr),Kr=!!qr,Jr=qr?+qr[1]:0,Qr=!Hr&&!!Lr&&/Apple Computer/.test(Lr.vendor),Gr=Qr&&(/Mobile\/\w+/.test(zr)||!!Lr&&Lr.maxTouchPoints>2),Yr=Gr||!!Lr&&/Mac/.test(Lr.platform),Xr=/Android \d/.test(zr),Zr=!!Ir&&"webkitFontSmoothing"in Ir.documentElement.style,eo=Zr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,to=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},no=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},ro=null,oo=function(e,t,n){var r=ro||(ro=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},io=function(e,t,n,r){return n&&(so(e,t,n,r,-1)||so(e,t,n,r,1))},ao=/^(img|br|input|textarea|hr)$/i;function so(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:uo(e))){var i=e.parentNode;if(!i||1!=i.nodeType||co(e)||ao.test(e.nodeName)||"false"==e.contentEditable)return!1;t=to(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?uo(e):0}}}function uo(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function lo(e,t,n){for(var r=0==t,o=t==uo(e);r||o;){if(e==n)return!0;var i=to(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==uo(e)}}function co(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var fo=function(e){var t=e.isCollapsed;return t&&Kr&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function po(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ho(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function mo(e,t){return"number"==typeof e?e:e[t]}function vo(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function go(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=no(a))if(1==a.nodeType){var s=a,u=s==i.body,l=u?ho(i):vo(s),c=0,f=0;if(t.top<l.top+mo(r,"top")?f=-(l.top-t.top+mo(o,"top")):t.bottom>l.bottom-mo(r,"bottom")&&(f=t.bottom-l.bottom+mo(o,"bottom")),t.left<l.left+mo(r,"left")?c=-(l.left-t.left+mo(o,"left")):t.right>l.right-mo(r,"right")&&(c=t.right-l.right+mo(o,"right")),c||f)if(u)i.defaultView.scrollBy(c,f);else{var d=s.scrollLeft,p=s.scrollTop;f&&(s.scrollTop+=f),c&&(s.scrollLeft+=c);var h=s.scrollLeft-d,m=s.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(u)break}}function yo(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=no(r));return t}function bo(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=r.dom,i=r.top,a=r.left;o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=a&&(o.scrollLeft=a)}}var ko=null;function wo(e,t){for(var n,r,o=2e8,i=0,a=t.top,s=t.top,u=e.firstChild,l=0;u;u=u.nextSibling,l++){var c=void 0;if(1==u.nodeType)c=u.getClientRects();else{if(3!=u.nodeType)continue;c=oo(u).getClientRects()}for(var f=0;f<c.length;f++){var d=c[f];if(d.top<=a&&d.bottom>=s){a=Math.max(d.bottom,a),s=Math.min(d.top,s);var p=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(p<o){n=u,o=p,r=p&&3==n.nodeType?{left:d.right<t.left?d.right:d.left,top:t.top}:t,1==u.nodeType&&p&&(i=l+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);var i=Co(r,1);if(i.top!=i.bottom&&xo(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:wo(n,r)}function xo(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Do(e,t,n){var r=e.childNodes.length;if(r&&n.top<n.bottom)for(var o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){var a=e.childNodes[i];if(1==a.nodeType)for(var s=a.getClientRects(),u=0;u<s.length;u++){var l=s[u];if(xo(t,l))return Do(a,t,l)}if((i=(i+1)%r)==o)break}return e}function Eo(e,t){var n,r=e.dom.ownerDocument,o=0;if(r.caretPositionFromPoint)try{var i=r.caretPositionFromPoint(t.left,t.top);i&&(n=i.offsetNode,o=i.offset)}catch(h){}if(!n&&r.caretRangeFromPoint){var a=r.caretRangeFromPoint(t.left,t.top);a&&(n=a.startContainer,o=a.startOffset)}var s,u=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top+1);if(!u||!e.dom.contains(1!=u.nodeType?u.parentNode:u)){var l=e.dom.getBoundingClientRect();if(!xo(t,l))return null;if(!(u=Do(e.dom,t,l)))return null}if(Qr)for(var c=u;n&&c;c=no(c))c.draggable&&(n=void 0);if(u=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(u,t),n){if(Wr&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length))<n.childNodes.length){var f,d=n.childNodes[o];"IMG"==d.nodeName&&(f=d.getBoundingClientRect()).right<=t.left&&f.bottom>t.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!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)o=a.posBefore;else{if(!(s.right<r.left||s.bottom<r.top))break;o=a.posAfter}}i=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==s&&(s=function(e,t,n){var r=wo(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,u,t));var p=e.docView.nearestDesc(u,!0);return{pos:s,inside:p?p.posAtStart-p.border:-1}}function Co(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var Oo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function So(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=Zr||Wr;if(3==o.nodeType){if(!a||!Oo.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var s=i,u=i,l=n<0?1:-1;return n<0&&!i?(u++,l=-1):n>=0&&i==o.nodeValue.length?(s--,l=1):n<0?s--:u++,Ao(Co(oo(o,s,u),l),l<0)}var c=Co(oo(o,i,i),n);if(Wr&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var f=Co(oo(o,i-1,i-1),-1);if(f.top==c.top){var d=Co(oo(o,i,i+1),-1);if(d.top!=c.top)return Ao(d,d.left<f.left)}}return c}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==uo(o))){var p=o.childNodes[i-1];if(1==p.nodeType)return jo(p.getBoundingClientRect(),!1)}if(i<uo(o)){var h=o.childNodes[i];if(1==h.nodeType)return jo(h.getBoundingClientRect(),!0)}return jo(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==uo(o))){var m=o.childNodes[i-1],v=3==m.nodeType?oo(m,uo(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return Ao(Co(v,1),!1)}if(i<uo(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?oo(g,0,a?0:1):1==g.nodeType?g:null:null;if(y)return Ao(Co(y,-1),!0)}return Ao(Co(3==o.nodeType?oo(o):o,-n),n>=0)}function Ao(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function jo(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function No(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var Mo=/[\u0590-\u08ac]/;var To=null,Fo=null,Po=!1;function Ro(e,t,n){return To==t&&Fo==n?Po:(To=t,Fo=n,Po="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return No(e,t,(function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=So(e,o.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=oo(a,0,a.nodeValue.length).getClientRects()}for(var u=0;u<s.length;u++){var l=s[u];if(l.bottom>l.top+1&&("up"==n?i.top-l.top>2*(l.bottom-i.top):l.bottom-i.bottom>2*(i.bottom-l.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return Mo.test(r.parent.textContent)&&s.modify?No(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var u=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),u})):"left"==n||"backward"==n?i:a}(e,t,n))}var Bo=function(){function e(t,n,r,o){y(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=0,r.pmViewDesc=this}return k(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var e=0;e<this.children.length;e++)this.children[e].destroy()}},{key:"posBeforeChild",value:function(e){for(var t=0,n=this.posAtStart;;t++){var r=this.children[t];if(r==e)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,o;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,a;if(e==this.contentDOM)i=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}var s;if(e==this.dom&&this.contentDOM)s=t>to(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var u=e;;u=u.parentNode){if(u==this.dom){s=!1;break}if(u.previousSibling)break}if(null==s&&t==e.childNodes.length)for(var l=e;;l=l.parentNode){if(l==this.dom){s=!0;break}if(l.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}}},{key:"domFromPos",value:function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n,r=0,o=0,i=0;r<this.children.length;r++){var a=this.children[r],s=i+a.size;if(s>e||a instanceof Ho){o=e-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Lo&&n.side>=0;r--);if(t<=0){for(var u,l=!0;(u=r?this.children[r-1]:null)&&u.dom.parentNode!=this.contentDOM;r--,l=!1);return u&&t&&l&&!u.border&&!u.domAtom?u.domFromPos(u.size,t):{node:this.contentDOM,offset:u?to(u.dom)+1:0}}for(var c,f=!0;(c=r<this.children.length?this.children[r]:null)&&c.dom.parentNode!=this.contentDOM;r++,f=!1);return c&&f&&!c.border&&!c.domAtom?c.domFromPos(0,t):{node:this.contentDOM,offset:c?to(c.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],u=i+s.size;if(-1==r&&e<=u){var l=i+s.border;if(e>=l&&t<=u-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,l);e=i;for(var c=a;c>0;c--){var f=this.children[c-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=to(f.dom)+1;break}e-=f.size}-1==r&&(r=0)}if(r>-1&&(u>t||a==this.children.length-1)){t=u;for(var d=a+1;d<this.children.length;d++){var p=this.children[d];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){o=to(p.dom);break}t+=p.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}},{key:"emptyChildAt",value:function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}},{key:"domAfterPos",value:function(e){var t=this.domFromPos(e,0),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}},{key:"setSelection",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;a<this.children.length;a++){var u=this.children[a],l=s+u.size;if(o>s&&i<l)return u.setSelection(e-s-u.border,t-s-u.border,n,r);s=l}var c=this.domFromPos(e,e?-1:1),f=t==e?c:this.domFromPos(t,t?-1:1),d=n.getSelection(),p=!1;if((Wr||Qr)&&e==t){var h=c,m=h.node,v=h.offset;if(3==m.nodeType){if((p=!(!v||"\n"!=m.nodeValue[v-1]))&&v==m.nodeValue.length)for(var g,y=m;y;y=y.parentNode){if(g=y.nextSibling){"BR"==g.nodeName&&(c=f={node:g.parentNode,offset:to(g)+1});break}var b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{var k=m.childNodes[v-1];p=k&&("BR"==k.nodeName||"false"==k.contentEditable)}}if(Wr&&d.focusNode&&d.focusNode!=f.node&&1==d.focusNode.nodeType){var w=d.focusNode.childNodes[d.focusOffset];w&&"false"==w.contentEditable&&(r=!0)}if(r||p&&Qr||!io(c.node,c.offset,d.anchorNode,d.anchorOffset)||!io(f.node,f.offset,d.focusNode,d.focusOffset)){var x=!1;if((d.extend||e==t)&&!p){d.collapse(c.node,c.offset);try{e!=t&&d.extend(f.node,f.offset),x=!0}catch(C){if(!(C instanceof DOMException))throw C}}if(!x){if(e>t){var D=c;c=f,f=D}var E=document.createRange();E.setEnd(f.node,f.offset),E.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(E)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}}]),e}(),Lo=function(e){x(n,e);var t=S(n);function n(e,r,o,i){var a;y(this,n);var s,u=r.type.toDOM;if("function"==typeof u&&(u=u(o,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:i}))),!r.type.spec.raw){if(1!=u.nodeType){var l=document.createElement("span");l.appendChild(u),u=l}u.contentEditable="false",u.classList.add("ProseMirror-widget")}return(a=t.call(this,e,[],u,null)).widget=r,a.widget=r,s=C(a),a}return k(n,[{key:"matchesWidget",value:function(e){return 0==this.dirty&&e.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)}},{key:"ignoreMutation",value:function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),vt(D(n.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}]),n}(Bo),Io=function(e){x(n,e);var t=S(n);function n(e,r,o,i){var a;return y(this,n),(a=t.call(this,e,[],r,null)).textDOM=o,a.text=i,a}return k(n,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}},{key:"domFromPos",value:function(e){return{node:this.textDOM,offset:e}}},{key:"ignoreMutation",value:function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}]),n}(Bo),zo=function(e){x(n,e);var t=S(n);function n(e,r,o,i){var a;return y(this,n),(a=t.call(this,e,[],o,i)).mark=r,a}return k(n,[{key:"parseRule",value:function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}},{key:"matchesMark",value:function(e){return 3!=this.dirty&&this.mark.eq(e)}},{key:"markDirty",value:function(e,t){if(vt(D(n.prototype),"markDirty",this).call(this,e,t),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function(e,t,r){var o=n.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;t<a&&(i=ni(i,t,a,r)),e>0&&(i=ni(i,0,e,r));for(var s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o}}],[{key:"create",value:function(e,t,r,o){var i=o.nodeViews[t.type.name],a=i&&i(t,o,r);return a&&a.dom||(a=En.renderSpec(document,t.type.spec.toDOM(t,r))),new n(e,t,a.dom,a.contentDOM||a.dom)}}]),n}(Bo),_o=function(e){x(n,e);var t=S(n);function n(e,r,o,i,a,s,u,l,c){var f;return y(this,n),(f=t.call(this,e,[],a,s)).node=r,f.outerDeco=o,f.innerDeco=i,f.nodeDOM=u,s&&f.updateChildren(l,c),f}return k(n,[{key:"parseRule",value:function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return Dt.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Xo(t,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(e,t){var n=this,r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,u=new ei(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;a<e.childCount;a++){var s=e.child(a);r(s,o,t.forChild(i,s),a),i+=s.nodeSize}return}for(var u=0,l=[],c=null,f=0;;){if(u<o.length&&o[u].to==i){for(var d=o[u++],p=void 0;u<o.length&&o[u].to==i;)(p||(p=[d])).push(o[u++]);if(p){p.sort(ti);for(var h=0;h<p.length;h++)n(p[h],f,!!c)}else n(d,f,!!c)}var m=void 0,v=void 0;if(c)v=-1,m=c,c=null;else{if(!(f<e.childCount))break;v=f,m=e.child(f++)}for(var g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;u<o.length&&o[u].from<=i&&o[u].to>i;)l.push(o[u++]);var y=i+m.nodeSize;if(m.isText){var b=y;u<o.length&&o[u].from<b&&(b=o[u].from);for(var k=0;k<l.length;k++)l[k].to<b&&(b=l[k].to);b<y&&(c=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}r(m,m.isInline&&!m.isLeaf?l.filter((function(e){return!e.inline})):l.slice(),t.forChild(i,m),v),i=y}}(this.node,this.innerDeco,(function(t,i,a){t.spec.marks?u.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&u.syncToMarks(i==n.node.childCount?St.none:n.node.child(i).marks,r,e),u.placeWidget(t,e,o)}),(function(t,n,a,l){var c;u.syncToMarks(t.marks,r,e),u.findNodeMatch(t,n,a,l)||s&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(c=u.findIndexWithChild(i.node))>-1&&u.updateNodeAt(t,n,a,c,e)||u.updateNextNode(t,n,a,e,l)||u.addNode(t,n,a,e,o),o+=t.nodeSize})),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),Wo(this.contentDOM,this.children,e),Gr&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(e.state.selection instanceof yr)||r<t||o>t+this.node.content.size)return null;var i=e.domSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=uo(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){var s=a.nodeValue,u=function(e,t,n,r){for(var o=0,i=0;o<e.childCount&&i<=r;){var a=e.child(o++),s=i;if(i+=a.nodeSize,a.isText){for(var u=a.text;o<e.childCount;){var l=e.child(o++);if(i+=l.nodeSize,!l.isText)break;u+=l.text}if(i>=n){var c=s<r?u.lastIndexOf(t,r-s-1):-1;if(c>=0&&c+t.length+s>=n)return s+c;if(n==r&&u.length>=r+t.length-s&&u.slice(r-s,r-s+t.length)==t)return r}}}return-1}(this.node.content,s,r-t,o-t);return u<0?null:{node:a,pos:u,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new Io(this,i,n,o);e.input.compositionNodes.push(a),this.children=ni(this.children,r,r+o.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!Xo(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Qo(this.dom,this.nodeDOM,Jo(this.outerDeco,this.node,t),Jo(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{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(e,t,r,o,i,a){var s,u=i.nodeViews[t.type.name],l=u&&u(t,i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:a}),r,o),c=l&&l.dom,f=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){var d=En.renderSpec(document,t.type.spec.toDOM(t));c=d.dom,f=d.contentDOM}f||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));var p=c;return c=Yo(c,r,t),l?s=new Uo(e,t,r,o,c,f||null,p,l,i,a+1):t.isText?new $o(e,t,r,o,c,p,i):new n(e,t,r,o,c,f||null,p,i,a+1)}}]),n}(Bo);function Vo(e,t,n,r,o){return Yo(r,t,e),new _o(void 0,e,t,n,r,r,r,o,0)}var $o=function(e){x(n,e);var t=S(n);function n(e,r,o,i,a,s,u){return y(this,n),t.call(this,e,r,o,i,a,null,s,u,0)}return k(n,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):vt(D(n.prototype),"localPosFromDOM",this).call(this,e,t,r)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,t,r){var o=this.node.cut(e,t),i=document.createTextNode(o.text);return new n(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(e,t){vt(D(n.prototype),"markDirty",this).call(this,e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(_o),Ho=function(e){x(n,e);var t=S(n);function n(){return y(this,n),t.apply(this,arguments)}return k(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(Bo),Uo=function(e){x(n,e);var t=S(n);function n(e,r,o,i,a,s,u,l,c,f){var d;return y(this,n),(d=t.call(this,e,r,o,i,a,s,u,c,f)).spec=l,d}return k(n,[{key:"update",value:function(e,t,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&vt(D(n.prototype),"update",this).call(this,e,t,r,o)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():vt(D(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():vt(D(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):vt(D(n.prototype),"setSelection",this).call(this,e,t,r,o)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),vt(D(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):vt(D(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(_o);function Wo(e,t,n){for(var r=e.firstChild,o=!1,i=0;i<t.length;i++){var a=t[i],s=a.dom;if(s.parentNode==e){for(;s!=r;)r=Zo(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(s,r);if(a instanceof zo){var u=r?r.previousSibling:e.lastChild;Wo(a.contentDOM,a.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=Zo(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var qo=function(e){e&&(this.nodeName=e)};qo.prototype=Object.create(null);var Ko=[new qo];function Jo(e,t,n){if(0==e.length)return Ko;for(var r=n?Ko[0]:new qo,o=[r],i=0;i<e.length;i++){var a=e[i].type.attrs;if(a)for(var s in a.nodeName&&o.push(r=new qo(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==o.length&&o.push(r=new qo(t.isInline?"span":"div")),"class"==s?r.class=(r.class?r.class+" ":"")+u:"style"==s?r.style=(r.style?r.style+";":"")+u:"nodeName"!=s&&(r[s]=u))}}return o}function Qo(e,t,n,r){if(n==Ko&&r==Ko)return t;for(var o=t,i=0;i<r.length;i++){var a=r[i],s=n[i];if(i){var u=void 0;s&&s.nodeName==a.nodeName&&o!=e&&(u=o.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||((u=document.createElement(a.nodeName)).pmIsDeco=!0,u.appendChild(o),s=Ko[0]),o=u}Go(o,s||Ko[0],a)}return o}function Go(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" ").filter(Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[],s=0;s<i.length;s++)-1==a.indexOf(i[s])&&e.classList.remove(i[s]);for(var u=0;u<a.length;u++)-1==i.indexOf(a[u])&&e.classList.add(a[u]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style)for(var l,c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;l=c.exec(t.style);)e.style.removeProperty(l[1]);n.style&&(e.style.cssText+=n.style)}}function Yo(e,t,n){return Qo(e,e,Ko,Jo(t,n,1!=e.nodeType))}function Xo(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Zo(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var ei=function(){function e(t,n){y(this,e),this.lock=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(e,t){var n=t,r=n.children.length,o=e.childCount,i=new Map,a=[];e:for(;o>0;){for(var s=void 0;;)if(r){var u=n.children[r-1];if(!(u instanceof zo)){s=u,r--;break}n=u,r=u.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var l=s.node;if(l){if(l!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}(t.node.content,t)}return k(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(e,t,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,e.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(e[o])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var u=zo.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}},{key:"findNodeMatch",value:function(e,t,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var u=this.top.children[a];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}},{key:"updateNodeAt",value:function(e,t,n,r,o){var i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index=r+1,!0)}},{key:"findIndexWithChild",value:function(e){for(;;){var t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){var n=e.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}e=t}}},{key:"updateNextNode",value:function(e,t,n,r,o){for(var i=this.index;i<this.top.children.length;i++){var a=this.top.children[i];if(a instanceof _o){var s=this.preMatch.matched.get(a);if(null!=s&&s!=o)return!1;var u=a.dom;if(!(this.lock&&(u==this.lock||1==u.nodeType&&u.contains(this.lock.parentNode))&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&Xo(t,a.outerDeco)))&&a.update(e,t,n,r))return this.destroyBetween(this.index,i),a.dom!=u&&(this.changed=!0),this.index++,!0;break}}return!1}},{key:"addNode",value:function(e,t,n,r,o){this.top.children.splice(this.index++,0,_o.create(this.top,e,t,n,r,o)),this.changed=!0}},{key:"placeWidget",value:function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Lo(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){for(var e=this.top.children[this.index-1],t=this.top;e instanceof zo;)e=(t=e).children[t.children.length-1];e&&e instanceof $o&&!/\n$/.test(e.node.text)||((Qr||Kr)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{var n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");var r=new Ho(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}]),e}();function ti(e,t){return e.type.side-t.type.side}function ni(e,t,n,r,o){for(var i=[],a=0,s=0;a<e.length;a++){var u=e[a],l=s,c=s+=u.size;l>=n||c<=t?i.push(u):(l<t&&i.push(u.slice(0,t-l,r)),o&&(i.push(o),o=void 0),c>n&&i.push(u.slice(n-l,u.size,r)))}return i}function ri(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,u,l=r.resolve(a);if(fo(n)){for(s=l;o&&!o.node;)o=o.parent;var c=o.node;if(o&&c.isAtom&&kr.isSelectable(c)&&o.parent&&(!c.isInline||!lo(n.focusNode,n.focusOffset,o.dom))){var f=o.posBefore;u=new kr(a==f?l:r.resolve(f))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;s=r.resolve(d)}if(!u){var p="pointer"==t||e.state.selection.head<l.pos&&!i?1:-1;u=hi(e,s,l,p)}return u}function oi(e){return e.editable?e.hasFocus():vi(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ii(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(di(e,n),oi(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Kr){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&io(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)fi(e);else{var i,a,s=n.anchor,u=n.head;!ai||n instanceof yr||(n.$from.parent.inlineContent||(i=si(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=si(e,n.to))),e.docView.setSelection(s,u,e.root,t),ai&&(i&&li(i),a&&li(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ci(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var ai=Qr||Kr&&Jr<63;function si(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(Qr&&i&&"false"==i.contentEditable)return ui(i);if((!i||"false"==i.contentEditable)&&(!a||"false"==a.contentEditable)){if(i)return ui(i);if(a)return ui(a)}}function ui(e){return e.contentEditable="true",Qr&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function li(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ci(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);var n=e.domSelection(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((function(){oi(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}function fi(e){var t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,to(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Hr&&Ur<=11&&(r.disabled=!0,r.disabled=!1)}function di(e,t){if(t instanceof kr){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(pi(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else pi(e)}function pi(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function hi(e,t,n,r){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||yr.between(t,n,r)}function mi(e){return(!e.editable||e.root.activeElement==e.dom)&&vi(e)}function vi(e){var t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function gi(e,t){var n=e.selection,r=n.$anchor,o=n.$head,i=t>0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&hr.findFrom(a,t)}function yi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function bi(e,t,n){var r=e.state.selection;if(!(r instanceof yr)){if(r instanceof kr&&r.node.isInline)return yi(e,new yr(t>0?r.$to:r.$from));var o=gi(e.state,t);return!!o&&yi(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=gi(e.state,t);return!!(i&&i instanceof kr)&&yi(e,i)}if(!(Yr&&n.indexOf("m")>-1)){var a,s=r.$head,u=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!u||u.isText)return!1;var l=t<0?s.pos-u.nodeSize:s.pos;return!!(u.isAtom||(a=e.docView.descAt(l))&&!a.contentDOM)&&(kr.isSelectable(u)?yi(e,new kr(t<0?e.state.doc.resolve(s.pos-u.nodeSize):s)):!!Zr&&yi(e,new yr(e.state.doc.resolve(t<0?l:l+u.nodeSize))))}}function ki(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function wi(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function xi(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(Wr&&1==n.nodeType&&r<ki(n)&&wi(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(wi(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(Ei(n))break;for(var u=n.previousSibling;u&&wi(u);)o=n.parentNode,i=to(u),u=u.previousSibling;if(u)r=ki(n=u);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Ci(e,t,n,r):o&&Ci(e,t,o,i)}}function Di(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=ki(n);;)if(r<a){if(1!=n.nodeType)break;if(!wi(n.childNodes[r]))break;o=n,i=++r}else{if(Ei(n))break;for(var s=n.nextSibling;s&&wi(s);)o=s.parentNode,i=to(s)+1,s=s.nextSibling;if(s)r=0,a=ki(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}o&&Ci(e,t,o,i)}}function Ei(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ci(e,t,n,r){if(fo(t)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();var i=e.state;setTimeout((function(){e.state==i&&ii(e)}),50)}function Oi(e,t,n){var r=e.state.selection;if(r instanceof yr&&!r.empty||n.indexOf("s")>-1)return!1;if(Yr&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=gi(e.state,t);if(a&&a instanceof kr)return yi(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,u=r instanceof xr?hr.near(s,t):hr.findFrom(s,t);return!!u&&yi(e,u)}return!1}function Si(e,t){if(!(e.state.selection instanceof yr))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function Ai(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ji(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||Yr&&72==n&&"c"==r?Si(e,-1)||xi(e):46==n||Yr&&68==n&&"c"==r?Si(e,1)||Di(e):13==n||27==n||(37==n||Yr&&66==n&&"c"==r?bi(e,-1,r)||xi(e):39==n||Yr&&70==n&&"c"==r?bi(e,1,r)||Di(e):38==n||Yr&&80==n&&"c"==r?Oi(e,-1,r)||xi(e):40==n||Yr&&78==n&&"c"==r?function(e){if(!Qr||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Ai(e,o,"true"),setTimeout((function(){return Ai(e,o,"false")}),20)}return!1}(e)||Oi(e,1,r)||Di(e):r==(Yr?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ni(e,t){for(var n=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||En.fromSchema(e.state.schema),u=_i(),l=u.createElement("div");l.appendChild(s.serializeFragment(r,{document:u}));for(var c,f=l.firstChild,d=0;f&&1==f.nodeType&&(c=Ii[f.nodeName.toLowerCase()]);){for(var p=c.length-1;p>=0;p--){for(var h=u.createElement(c[p]);l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice","".concat(o," ").concat(i).concat(d?" -".concat(d):""," ").concat(JSON.stringify(n))),{dom:l,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function Mi(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var u=t&&(r||s||!n);if(u){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return t?new jt(Dt.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):jt.empty;var l=e.someProp("clipboardTextParser",(function(e){return e(t,o,r)}));if(l)a=l;else{var c=o.marks(),f=e.state.schema,d=En.fromSchema(f);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(d.serializeNode(f.text(e,c)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),i=function(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=_i().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Ii[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return"</"+e+">"})).reverse().join(""));if(r.innerHTML=e,n)for(var i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),Zr&&function(e){for(var t=e.querySelectorAll(Kr?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<t.length;n++){var r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);var p=i&&i.querySelector("[data-pm-slice]"),h=p&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(p.getAttribute("data-pm-slice")||"");if(h&&h[3])for(var m=+h[3];m>0&&i.firstChild;m--)i=i.firstChild;if(!a){var v=e.someProp("clipboardParser")||e.someProp("domParser")||hn.fromSchema(e.state.schema);a=v.parseSlice(i,{preserveWhitespace:!(!u&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Ti.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(h)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(se){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var u=r.nodes[n[s]];if(!u||u.hasRequiredAttrs())break;o=Dt.from(u.create(n[s+1],o)),i++,a++}return new jt(o,i,a)}(Li(a,+h[1],+h[2]),h[4]);else if(a=jt.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n).contentMatchAt(t.index(n)),o=void 0,i=[];if(e.forEach((function(e){if(i){var t,n=r.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&o.length&&Pi(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Ri(i[i.length-1],o.length));var a=Fi(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:Dt.from(i)}},r=t.depth;r>=0;r--){var o=n(r);if("object"===typeof o)return o.v}return e}(a.content,o),!0),a.openStart||a.openEnd){for(var g=0,y=0,b=a.content.firstChild;g<a.openStart&&!b.type.spec.isolating;g++,b=b.firstChild);for(var k=a.content.lastChild;y<a.openEnd&&!k.type.spec.isolating;y++,k=k.lastChild);a=Li(a,g,y)}return e.someProp("transformPasted",(function(e){a=e(a)})),a}var Ti=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Fi(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,Dt.from(e));return e}function Pi(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var i=Pi(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(Dt.from(Fi(n,e,o+1))))}}function Ri(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,Ri(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Dt.empty,!0);return e.copy(n.append(r))}function Bi(e,t,n,r,o,i){var a=t<0?e.firstChild:e.lastChild,s=a.content;return o<r-1&&(s=Bi(s,t,n,r,o+1,i)),o>=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(Dt.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function Li(e,t,n){return t<e.openStart&&(e=new jt(Bi(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new jt(Bi(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Ii={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},zi=null;function _i(){return zi||(zi=document.implementation.createHTMLDocument("title"))}var Vi={},$i={},Hi=k((function e(){y(this,e),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}));function Ui(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Wi(e){e.someProp("handleDOMEvents",(function(t){for(var n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=function(t){return qi(e,t)})}))}function qi(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Ki(e){return{left:e.clientX,top:e.clientY}}function Ji(e,t,n,r,o){if(-1==r)return!1;for(var i=e.state.doc.resolve(r),a=function(r){if(e.someProp(t,(function(t){return r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var u=a(s);if("object"===typeof u)return u.v}return!1}function Qi(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Gi(e,t,n,r,o){return Ji(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof kr&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(kr.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(Qi(e,kr.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&kr.isSelectable(r))&&(Qi(e,new kr(n),"pointer"),!0)}(e,n))}function Yi(e,t,n,r){return Ji(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function Xi(e,t,n,r){return Ji(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Qi(e,yr.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)Qi(e,yr.create(r,s+1,s+1+a.content.size),"pointer");else{if(!kr.isSelectable(a))continue;Qi(e,kr.create(r,s),"pointer")}return!0}}(e,n,r)}function Zi(e){return aa(e)}$i.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!na(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Xr||!Kr||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Gr||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||ji(e,n)?n.preventDefault():Ui(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,po(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},$i.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},$i.keypress=function(e,t){var n=t;if(!(na(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Yr&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof yr)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var ea=Yr?"metaKey":"ctrlKey";Vi.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=Zi(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[ea]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};var a=e.posAtCoords(Ki(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ta(e,a,n,!!r)):("doubleClick"==i?Yi:Xi)(e,a.pos,a.inside,n)?n.preventDefault():Ui(e,"pointer"))};var ta=function(){function e(t,n,r,o){var i,a,s=this;if(y(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[ea],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var u=t.state.doc.resolve(n.pos);i=u.parent,a=u.depth?u.before():0}var l=o?null:r.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c?c.dom:null;var f=t.state.selection;(0==r.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||f instanceof kr&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Wr||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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ui(t,"pointer")}return k(e,[{key:"done",value:function(){var e=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 ii(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ki(e))),this.allowDefault||!t?Ui(this.view,"pointer"):Gi(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Qr&&this.mightDrag&&!this.mightDrag.node.isAtom||Kr&&!(this.view.state.selection instanceof yr)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Qi(this.view,hr.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Ui(this.view,"pointer")}}},{key:"move",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Ui(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function na(e,t){return!!e.composing||!!(Qr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Vi.touchdown=function(e){Zi(e),Ui(e,"pointer")},Vi.contextmenu=function(e){return Zi(e)};var ra=Xr?5e3:-1;function oa(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return aa(e)}),t))}function ia(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function aa(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(Xr&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ia(e),t||e.docView&&e.docView.dirty){var n=ri(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}$i.compositionstart=$i.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),aa(e,!0),e.markCursor=null;else if(aa(e),Wr&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}oa(e,ra)},$i.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,oa(e,20))};var sa=Hr&&Ur<15||Gr&&eo<604;function ua(e,t,n,r){var o=Mi(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||jt.empty)})))return!0;if(!o)return!1;var i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Vi.copy=$i.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=sa?null:n.clipboardData,a=Ni(e,r.content()),s=a.dom,u=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",u)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},$i.paste=function(e,t){var n=t;if(!e.composing||Xr){var r=sa?null:n.clipboardData;r&&ua(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ua(e,r.value,null,t):ua(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var la=k((function e(t,n){y(this,e),this.slice=t,this.move=n})),ca=Yr?"altKey":"ctrlKey";for(var fa in Vi.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(Ki(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof kr?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(kr.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=e.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=e.docView&&e.dispatch(e.state.tr.setSelection(kr.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),u=Ni(e,s),l=u.dom,c=u.text;n.dataTransfer.clearData(),n.dataTransfer.setData(sa?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",sa||n.dataTransfer.setData("text/plain",c),e.dragging=new la(s,!n[ca])}},Vi.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},$i.dragover=$i.dragenter=function(e,t){return t.preventDefault()},$i.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(Ki(n));if(o){var i=e.state.doc.resolve(o.pos);if(i){var a=r&&r.slice;a?e.someProp("transformPasted",(function(e){a=e(a)})):a=Mi(e,n.dataTransfer.getData(sa?"Text":"text/plain"),sa?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[ca]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||jt.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var u=a?function(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(u>0?1:0),c=r.node(s),f=!1;if(1==a)f=c.canReplace(l,l,o);else{var d=c.contentMatchAt(l).findWrapping(o.firstChild.type);f=d&&c.canReplaceWith(l,l,d[0])}if(f)return 0==u?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}(e.state.doc,i.pos,a):i.pos;null==u&&(u=i.pos);var l=e.state.tr;s&&l.deleteSelection();var c=l.mapping.map(u),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=l.doc;if(f?l.replaceRangeWith(c,c,a.content.firstChild):l.replaceRange(c,c,a),!l.doc.eq(d)){var p=l.doc.resolve(c);if(f&&kr.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new kr(p));else{var h=l.mapping.map(u);l.mapping.maps[l.mapping.maps.length-1].forEach((function(e,t,n,r){return h=r})),l.setSelection(hi(e,p,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}}}}}},Vi.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&ii(e)}),20))},Vi.blur=function(e,t){var n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Vi.beforeinput=function(e,t){if(Kr&&Xr&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,po(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},$i)Vi[fa]=$i[fa];function da(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var pa=function(){function e(t,n){y(this,e),this.toDOM=t,this.spec=n||ya,this.side=this.spec.side||0}return k(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new va(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&da(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),ha=function(){function e(t,n){y(this,e),this.attrs=t,this.spec=n||ya}return k(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new va(o,i,this)}},{key:"valid",value:function(e,t){return t.from<t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&da(this.attrs,t.attrs)&&da(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}]),e}(),ma=function(){function e(t,n){y(this,e),this.attrs=t,this.spec=n||ya}return k(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new va(o.pos-n,i.pos-n,this)}},{key:"valid",value:function(e,t){var n,r=e.content.findIndex(t.from),o=r.index,i=r.offset;return i==t.from&&!(n=e.child(o)).isText&&i+n.nodeSize==t.to}},{key:"eq",value:function(t){return this==t||t instanceof e&&da(this.attrs,t.attrs)&&da(this.spec,t.spec)}},{key:"destroy",value:function(){}}]),e}(),va=function(){function e(t,n,r){y(this,e),this.from=t,this.to=n,this.type=r}return k(e,[{key:"copy",value:function(t,n){return new e(t,n,this.type)}},{key:"eq",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof ha}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new pa(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new ha(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new ma(r,o))}}]),e}(),ga=[],ya={},ba=function(){function e(t,n){y(this,e),this.local=t.length?t:ga,this.children=n.length?n:ga}return k(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){var u=this.children[s]+1;this.children[s+2].findInner(e-u,t-u,n,r+u,o)}}},{key:"map",value:function(e,t,n){return this==ka||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ya)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,s=0;s<this.local.length;s++){var u=this.local[s].map(t,r,o);u&&u.type.valid(n,u)?(a||(a=[])).push(u):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,a){for(var s=e.slice(),u=function(e,t,n,r){for(var a=0;a<s.length;a+=3){var u=s[a+1],l=void 0;if(!(u<0||e>u+i)){var c=s[a]+i;t>=c?s[a+1]=e<=c?-2:-1:n>=o&&(l=r-n-(t-e))&&(s[a]+=l,s[a+1]+=l)}}},l=0;l<n.maps.length;l++)n.maps[l].forEach(u);for(var c=!1,f=0;f<s.length;f+=3)if(s[f+1]<0){if(-2==s[f+1]){c=!0,s[f+1]=-1;continue}var d=n.map(e[f]+i),p=d-o;if(p<0||p>=r.content.size){c=!0;continue}var h=n.map(e[f+1]+i,-1)-o,m=r.content.findIndex(p),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==p&&g+y.nodeSize==h){var b=s[f+2].mapInner(n,y,d+1,e[f]+i+1,a);b!=ka?(s[f]=p,s[f+1]=h,s[f+2]=b):(s[f+1]=-2,c=!0)}else c=!0}if(c){var k=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;i<e.local.length;i++){var u=e.local[i].map(r,o,t);u?n.push(u):a.onRemove&&a.onRemove(e.local[i].spec)}for(var l=0;l<e.children.length;l+=3)s(e.children[l+2],e.children[l]+t+1)}for(var u=0;u<e.length;u+=3)-1==e[u+1]&&s(e[u+2],t[u]+i+1);return n}(s,e,t,n,o,i,a),w=Ca(k,r,0,a);t=w.local;for(var x=0;x<s.length;x+=3)s[x+1]<0&&(s.splice(x,3),x-=3);for(var D=0,E=0;D<w.children.length;D+=3){for(var C=w.children[D];E<s.length&&s[E]<C;)E+=3;s.splice(E,0,w.children[D],w.children[D+1],w.children[D+2])}}return new ba(t.sort(Oa),s)}(this.children,a||[],t,n,r,o,i):a?new e(a.sort(Oa),ga):ka}},{key:"add",value:function(t,n){return n.length?this==ka?e.create(t,n):this.addInner(t,n,0):this}},{key:"addInner",value:function(t,n,r){var o,i=this,a=0;t.forEach((function(e,t){var s,u=t+r;if(s=Da(n,e,u)){for(o||(o=i.children.slice());a<o.length&&o[a]<t;)a+=3;o[a]==t?o[a+2]=o[a+2].addInner(e,s,u+1):o.splice(a,0,t,t+e.nodeSize,Ca(s,e,u+1,ya)),a+=3}}));for(var s=xa(a?Ea(n):n,-r),u=0;u<s.length;u++)s[u].type.valid(t,s[u])||s.splice(u--,1);return new e(s.length?this.local.concat(s).sort(Oa):this.local,o||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==ka?this:this.removeInner(e,0)}},{key:"removeInner",value:function(t,n){for(var r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var a,s=void 0,u=r[i]+n,l=r[i+1]+n,c=0;c<t.length;c++)(a=t[c])&&a.from>u&&a.to<l&&(t[c]=null,(s||(s=[])).push(a));if(s){r==this.children&&(r=this.children.slice());var f=r[i+2].removeInner(s,u+1);f!=ka?r[i+2]=f:(r.splice(i,3),i-=3)}}if(o.length)for(var d,p=0;p<t.length;p++)if(d=t[p])for(var h=0;h<o.length;h++)o[h].eq(d,n)&&(o==this.local&&(o=this.local.slice()),o.splice(h--,1));return r==this.children&&o==this.local?this:o.length||r.length?new e(o,r):ka}},{key:"forChild",value:function(t,n){if(this==ka)return this;if(n.isLeaf)return e.empty;for(var r,o,i=0;i<this.children.length;i+=3)if(this.children[i]>=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,s=a+n.content.size,u=0;u<this.local.length;u++){var l=this.local[u];if(l.from<s&&l.to>a&&l.type instanceof ha){var c=Math.max(a,l.from)-a,f=Math.min(s,l.to)-a;c<f&&(o||(o=[])).push(l.copy(c,f))}}if(o){var d=new e(o.sort(Oa),ga);return r?new wa([d,r]):d}return r||ka}},{key:"eq",value:function(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}},{key:"locals",value:function(e){return Sa(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==ka)return ga;if(e.inlineContent||!this.local.some(ha.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof ha||t.push(this.local[n]);return t}}],[{key:"create",value:function(e,t){return t.length?Ca(t,e,0,ya):ka}}]),e}();ba.empty=new ba([],[]),ba.removeOverlap=Sa;var ka=ba.empty,wa=function(){function e(t){y(this,e),this.members=t}return k(e,[{key:"map",value:function(t,n){var r=this.members.map((function(e){return e.map(t,n,ya)}));return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return ba.empty;for(var r=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(t,n);i!=ka&&(i instanceof e?r=r.concat(i.members):r.push(i))}return e.from(r)}},{key:"eq",value:function(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}},{key:"locals",value:function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?Sa(n?t:t.sort(Oa)):ga}}],[{key:"from",value:function(t){switch(t.length){case 0:return ka;case 1:return t[0];default:return new e(t)}}}]),e}();function xa(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new va(o.from+t,o.to+t,o.type))}return n}function Da(e,t,n){if(t.isLeaf)return null;for(var r,o=n+t.nodeSize,i=null,a=0;a<e.length;a++)(r=e[a])&&r.from>n&&r.to<o&&((i||(i=[])).push(r),e[a]=null);return i}function Ea(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Ca(e,t,n,r){var o=[],i=!1;t.forEach((function(t,a){var s=Da(e,t,a+n);if(s){i=!0;var u=Ca(s,t,n+a+1,r);u!=ka&&o.push(a,a+t.nodeSize,u)}}));for(var a=xa(i?Ea(e):e,-n).sort(Oa),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new ba(a,o):ka}function Oa(e,t){return e.from-t.from||e.to-t.to}function Sa(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Aa(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Aa(t,o+1,i.copy(r.to,i.to)))}}return t}function Aa(e,t,n){for(;t<e.length&&Oa(n,e[t])>0;)t++;e.splice(t,0,n)}function ja(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=ka&&t.push(r)})),e.cursorWrapper&&t.push(ba.create(e.state.doc,[e.cursorWrapper.deco])),wa.from(t)}var Na={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ma=Hr&&Ur<=11,Ta=function(){function e(){y(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return k(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}]),e}(),Fa=function(){function e(t,n){var r=this;y(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ta,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;t<e.length;t++)r.queue.push(e[t]);Hr&&Ur<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?r.flushSoon():r.flush()})),Ma&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return k(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.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.observe(this.view.dom,Na),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout((function(){return e.flush()}),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return e.suppressingSelectionUpdates=!1}),50)}},{key:"onSelectionChange",value:function(){if(mi(this.view)){if(this.suppressingSelectionUpdates)return ii(this.view);if(Hr&&Ur<=11&&!this.view.state.selection.empty){var e=this.view.domSelection();if(e.focusNode&&io(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelection())}},{key:"ignoreSelectionChange",value:function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}},{key:"flush",value:function(){if(this.view.docView&&!(this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&mi(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s<e.length;s++){var u=this.registerMutation(e[s],a);u&&(r=r<0?u.from:Math.min(u.from,r),o=o<0?u.to:Math.max(u.to,o),u.typeOver&&(i=!0))}if(Wr&&a.length>1){var l=a.filter((function(e){return"BR"==e.nodeName}));if(2==l.length){var c=l[0],f=l[1];c.parentNode&&c.parentNode.parentNode==f.parentNode?f.remove():c.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(Pa)return;Pa=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ii(this.view),this.currentSelection.set(t))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var r=0;r<e.addedNodes.length;r++)t.push(e.addedNodes[r]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var o=e.previousSibling,i=e.nextSibling;if(Hr&&Ur<=11&&e.addedNodes.length)for(var a=0;a<e.addedNodes.length;a++){var s=e.addedNodes[a],u=s.previousSibling,l=s.nextSibling;(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(o=u),(!l||Array.prototype.indexOf.call(e.addedNodes,l)<0)&&(i=l)}var c=o&&o.parentNode==e.target?to(o)+1:0,f=n.localPosFromDOM(e.target,c,-1),d=i&&i.parentNode==e.target?to(i):e.target.childNodes.length;return{from:f,to:n.localPosFromDOM(e.target,d,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}]),e}(),Pa=!1;function Ra(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Qr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||Qr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Ba(e,t,n,r,o){if(t<0){var i=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,a=ri(e,i);if(a&&!e.state.selection.eq(a)){var s=e.state.tr.setSelection(a);"pointer"==i?s.setMeta("pointer",!0):"key"==i&&s.scrollIntoView(),e.dispatch(s)}}else{var u=e.state.doc.resolve(t),l=u.sharedDepth(n);t=u.before(l+1),n=e.state.doc.resolve(n).after(l+1);var c=e.state.selection,f=function(e,t,n){var r,o=e.docView.parseRange(t,n),i=o.node,a=o.fromOffset,s=o.toOffset,u=o.from,l=o.to,c=e.domSelection(),f=c.anchorNode;if(f&&e.dom.contains(1==f.nodeType?f:f.parentNode)&&(r=[{node:f,offset:c.anchorOffset}],fo(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Kr&&8===e.input.lastKeyCode)for(var d=s;d>a;d--){var p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){s=d;break}if(!h||h.size)break}var m=e.state.doc,v=e.someProp("domParser")||hn.fromSchema(e.state.schema),g=m.resolve(u),y=null,b=v.parse(i,{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:Ra,context:g});if(r&&null!=r[0].pos){var k=r[0].pos,w=r[1]&&r[1].pos;null==w&&(w=k),y={anchor:k+u,head:w+u}}return{doc:b,sel:y,from:u,to:l}}(e,t,n);if(Kr&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from){var d=e.cursorWrapper.deco.type.toDOM.nextSibling,p=d&&d.nodeValue?d.nodeValue.length:1;f.sel={anchor:f.sel.anchor+p,head:f.sel.anchor+p}}var h,m,v=e.state.doc,g=v.slice(f.from,f.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(h=e.state.selection.to,m="end"):(h=e.state.selection.from,m="start"),e.input.lastKeyCode=null;var y=function(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),s=a.a,u=a.b;if("end"==o){r-=s+Math.max(0,i-Math.min(s,u))-i}if(s<i&&e.size<t.size){u=(i-=r<=i&&r>=s?i-r:0)+(u-s),s=i}else if(u<i){s=(i-=r<=i&&r>=u?i-r:0)+(s-u),u=i}return{start:i,endA:s,endB:u}}(g.content,f.doc.content,f.from,h,m);if((Gr&&e.input.lastIOSEnter>Date.now()-225||Xr)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,po(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!y){if(!(r&&c instanceof yr&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||f.sel&&f.sel.anchor!=f.sel.head){if(f.sel){var b=La(e,e.state.doc,f.sel);b&&!b.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(b))}return}y={start:c.from,endA:c.to,endB:c.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof yr&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=f.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),Hr&&Ur<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&" \xa0"==f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)&&(y.start--,y.endA--,y.endB--);var k,w=f.doc.resolveNoCache(y.start-f.from),x=f.doc.resolveNoCache(y.endB-f.from),D=v.resolve(y.start),E=w.sameParent(x)&&w.parent.inlineContent&&D.end()>=y.endA;if((Gr&&e.input.lastIOSEnter>Date.now()-225&&(!E||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!E&&w.pos<f.doc.content.size&&(k=hr.findFrom(f.doc.resolve(w.pos+1),1,!0))&&k.head==x.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,po(13,"Enter"))})))e.input.lastIOSEnter=0;else if(e.state.selection.anchor>y.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Ia(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var a=e.resolve(Ia(i,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Ia(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(v,y.start,y.endA,w,x)&&e.someProp("handleKeyDown",(function(t){return t(e,po(8,"Backspace"))})))Xr&&Kr&&e.domObserver.suppressSelectionUpdates();else{Kr&&Xr&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),Xr&&!E&&w.start()!=x.start()&&0==x.parentOffset&&w.depth==x.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,x=f.doc.resolveNoCache(y.endB-f.from),setTimeout((function(){e.someProp("handleKeyDown",(function(t){return t(e,po(13,"Enter"))}))}),20));var C,O,S,A=y.start,j=y.endA;if(E)if(w.pos==x.pos)Hr&&Ur<=11&&0==w.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return ii(e)}),20)),C=e.state.tr.delete(A,j),O=v.resolve(y.start).marksAcross(v.resolve(y.endA));else if(y.endA==y.endB&&(S=function(e,t){for(var n,r,o,i=e.firstChild.marks,a=t.firstChild.marks,s=i,u=a,l=0;l<a.length;l++)s=a[l].removeFromSet(s);for(var c=0;c<i.length;c++)u=i[c].removeFromSet(u);if(1==s.length&&0==u.length)r=s[0],n="add",o=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=s.length||1!=u.length)return null;r=u[0],n="remove",o=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var f=[],d=0;d<t.childCount;d++)f.push(o(t.child(d)));if(Dt.from(f).eq(e))return{mark:r,type:n}}(w.parent.content.cut(w.parentOffset,x.parentOffset),D.parent.content.cut(D.parentOffset,y.endA-D.start()))))C=e.state.tr,"add"==S.type?C.addMark(A,j,S.mark):C.removeMark(A,j,S.mark);else if(w.parent.child(w.index()).isText&&w.index()==x.index()-(x.textOffset?0:1)){var N=w.parent.textBetween(w.parentOffset,x.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,A,j,N)})))return;C=e.state.tr.insertText(N,A,j)}if(C||(C=e.state.tr.replace(A,j,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){var M=La(e,C.doc,f.sel);M&&!(Kr&&Xr&&e.composing&&M.empty&&(y.start!=y.endB||e.input.lastAndroidDelete<Date.now()-100)&&(M.head==A||M.head==C.mapping.map(j)-1)||Hr&&M.empty&&M.head==A)&&C.setSelection(M)}O&&C.ensureMarks(O),e.dispatch(C.scrollIntoView())}}}}function La(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:hi(e,t.resolve(n.anchor),t.resolve(n.head))}function Ia(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}var za=function(){function e(t,n){var r=this;y(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Hi,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Ua),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=$a(this),Va(this),this.nodeViews=Ha(this),this.docView=Vo(this.state.doc,_a(this),ja(this),this.dom,this),this.domObserver=new Fa(this,(function(e,t,n,o){return Ba(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(t){var n=Vi[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||qi(e,t)||!e.editable&&t.type in $i||n(e,t)})};for(var n in Vi)t(n);Qr&&e.dom.addEventListener("input",(function(){return null})),Wi(e)}(this),this.updatePluginViews()}return k(e,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Wi(this),this._props=e,e.plugins&&(e.plugins.forEach(Ua),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}},{key:"updateStateInner",value:function(e,t){var n=this,r=this.state,o=!1,i=!1;if(e.storedMarks&&this.composing&&(ia(this),i=!0),this.state=e,t){var a=Ha(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,o=!0),Wi(this)}this.editable=$a(this),Va(this);var s=ja(this),u=_a(this),l=t?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",c=o||!this.docView.matchesNode(e.doc,u,s);!c&&e.selection.eq(r.selection)||(i=!0);var f="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a<Math.min(innerHeight,r.bottom);a+=5){var s=e.root.elementFromPoint(i,a);if(s&&s!=e.dom&&e.dom.contains(s)){var u=s.getBoundingClientRect();if(u.top>=o-20){t=s,n=u.top;break}}}return{refDOM:t,refTop:n,stack:yo(e.dom)}}(this);if(i){this.domObserver.stop();var d=c&&(Hr||Kr)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(c){var p=Kr?this.trackWrites=this.domSelection().focusNode:null;!o&&this.docView.update(e.doc,u,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Vo(e.doc,u,s,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return io(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ii(this,d):(di(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==l)this.dom.scrollTop=0;else if("to selection"==l){var h=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(function(e){return e(n)})));else if(e.selection instanceof kr){var m=this.docView.domAfterPos(e.selection.from);1==m.nodeType&&go(this,m.getBoundingClientRect(),h)}else go(this,this.coordsAtPos(e.selection.head,1),h)}else f&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;bo(r,0==o?0:o-n)}(f)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var o=this.directPlugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var a=this.state.plugins[i];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}}},{key:"someProp",value:function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(var o=0;o<this.directPlugins.length;o++){var i=this.directPlugins[o].props[e];if(null!=i&&(n=t?t(i):i))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var u=a[s].props[e];if(null!=u&&(n=t?t(u):u))return n}}},{key:"hasFocus",value:function(){return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ko)return e.focus(ko);var t=yo(e);e.focus(null==ko?{get preventScroll(){return ko={preventScroll:!0},!0}}:void 0),ko||(ko=!1,bo(t,0))}(this.dom),ii(this),this.domObserver.start()}},{key:"root",get:function(){var e=this,t=this._root;if(null==t)for(var n=function(t){if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return t.ownerDocument.getSelection()}),{v:e._root=t}},r=this.dom.parentNode;r;r=r.parentNode){var o=n(r);if("object"===typeof o)return o.v}return t||document}},{key:"posAtCoords",value:function(e){return Eo(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return So(this,e,t)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return Ro(this,t||this.state,e)}},{key:"destroy",value:function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ja(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(e){return function(e,t){qi(e,t)||!Vi[t.type]||!e.editable&&t.type in $i||Vi[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),e}();function _a(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r&&(t.class+=" "+n[r]),"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),[va.node(0,e.state.doc.content.size,t)]}function Va(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:va.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function $a(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Ha(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Ua(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Wa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},qa={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Ka="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ja="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Qa="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ga="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ya="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Xa=Ka&&(Ga||+Ka[1]<57)||Qa&&Ga,Za=0;Za<10;Za++)Wa[48+Za]=Wa[96+Za]=String(Za);for(Za=1;Za<=24;Za++)Wa[Za+111]="F"+Za;for(Za=65;Za<=90;Za++)Wa[Za]=String.fromCharCode(Za+32),qa[Za]=String.fromCharCode(Za);for(var es in Wa)qa.hasOwnProperty(es)||(qa[es]=Wa[es]);var ts="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ns(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s<i.length-1;s++){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);ts?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function rs(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function is(e){var t=function(e){var t=Object.create(null);for(var n in e)t[ns(n)]=e[n];return t}(e);return function(e,n){var r,o=function(e){var t=!(Xa&&(e.ctrlKey||e.altKey||e.metaKey)||(Ja||Ya)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?qa:Wa)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=1==o.length&&" "!=o,a=t[rs(o,n,!i)];if(a&&a(e.state,e.dispatch,e))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Wa[n.keyCode])&&r!=o){var s=t[rs(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){var u=t[rs(o,n,!0)];if(u&&u(e.state,e.dispatch,e))return!0}return!1}}var as=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)},ss=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=cs(r);if(!o){var i=r.blockRange(),a=i&&$n(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&ws(e,o,t))return!0;if(0==r.parent.content.size&&(us(s,"end")||kr.isSelectable(s))){var u=er(e.doc,r.before(),r.after(),jt.empty);if(u&&u.slice.size<u.to-u.from){if(t){var l=e.tr.step(u);l.setSelection(us(s,"end")?hr.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):kr.create(l.doc,o.pos-s.nodeSize)),t(l.scrollIntoView())}return!0}}return!(!s.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function us(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var ls=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;i=cs(o)}var a=i&&i.nodeBefore;return!(!a||!kr.isSelectable(a))&&(t&&t(e.tr.setSelection(kr.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function cs(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}var fs=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=ps(r);if(!o)return!1;var i=o.nodeAfter;if(ws(e,o,t))return!0;if(0==r.parent.content.size&&(us(i,"start")||kr.isSelectable(i))){var a=er(e.doc,r.before(),r.after(),jt.empty);if(a&&a.slice.size<a.to-a.from){if(t){var s=e.tr.step(a);s.setSelection(us(i,"start")?hr.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):kr.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},ds=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;i=ps(o)}var a=i&&i.nodeAfter;return!(!a||!kr.isSelectable(a))&&(t&&t(e.tr.setSelection(kr.create(e.doc,i.pos)).scrollIntoView()),!0)};function ps(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var hs=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=r.blockRange(o),a=i&&$n(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},ms=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function vs(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var gs=function(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var i=r.node(-1),a=r.indexAfter(-1),s=vs(i.contentMatchAt(a));if(!s||!i.canReplaceWith(a,a,s))return!1;if(t){var u=r.after(),l=e.tr.replaceWith(u,u,s.createAndFill());l.setSelection(hr.near(l.doc.resolve(u),1)),t(l.scrollIntoView())}return!0},ys=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof xr||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=vs(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){var a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(a,i.createAndFill());s.setSelection(yr.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},bs=function(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(Qn(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&$n(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},ks=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof kr&&e.selection.node.isBlock)return!(!r.parentOffset||!Qn(e.doc,r.pos))&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof yr||e.selection instanceof xr)&&a.deleteSelection();var s=0==r.depth?null:vs(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=i&&s?[{type:s}]:void 0,l=Qn(a.doc,a.mapping.map(r.pos),1,u);if(u||l||!Qn(a.doc,a.mapping.map(r.pos),1,s?[{type:s}]:void 0)||(s&&(u=[{type:s}]),l=!0),l&&(a.split(a.mapping.map(r.pos),1,u),!i&&!r.parentOffset&&r.parent.type!=s)){var c=a.mapping.map(r.before()),f=a.doc.resolve(c);s&&r.node(-1).canReplaceWith(f.index(),f.index()+1,s)&&a.setNodeMarkup(a.mapping.map(r.before()),s)}t(a.scrollIntoView())}return!0};function ws(e,t,n){var r,o,i=t.nodeBefore,a=t.nodeAfter;if(i.type.spec.isolating||a.type.spec.isolating)return!1;if(function(e,t,n){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Yn(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var u=t.pos+a.nodeSize,l=Dt.empty,c=r.length-1;c>=0;c--)l=Dt.from(r[c].create(null,l));l=Dt.from(i.copy(l));var f=e.tr.step(new zn(t.pos-1,u,t.pos,u,new jt(l,1,0),r.length,!0)),d=u+2*r.length;Yn(f.doc,d)&&f.join(d),n(f.scrollIntoView())}return!0}var p=hr.findFrom(t,1),h=p&&p.$from.blockRange(p.$to),m=h&&$n(h);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(h,m).scrollIntoView()),!0;if(s&&us(a,"start",!0)&&us(i,"end")){for(var v=i,g=[];g.push(v),!v.isTextblock;)v=v.lastChild;for(var y=a,b=1;!y.isTextblock;y=y.firstChild)b++;if(v.canReplace(v.childCount,v.childCount,y.content)){if(n){for(var k=Dt.empty,w=g.length-1;w>=0;w--)k=Dt.from(g[w].copy(k));n(e.tr.step(new zn(t.pos-g.length,t.pos+a.nodeSize,t.pos+b,t.pos+a.nodeSize-b,new jt(k,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function xs(e){return function(t,n){for(var r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(yr.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var Ds=xs(-1),Es=xs(1);function Cs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),u=s&&Hn(s,e,t);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}function Os(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(r,o){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var i=n.doc.resolve(o),a=i.index();s=i.parent.canReplaceWith(a,a+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}}function Ss(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,r){for(var o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var As=Ss(as,ss,ls),js=Ss(as,fs,ds),Ns={Enter:Ss(ms,ys,bs,ks),"Mod-Enter":gs,Backspace:As,"Mod-Backspace":As,"Shift-Backspace":As,Delete:js,"Mod-Delete":js,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new xr(e.doc))),!0}},Ms={"Ctrl-h":Ns.Backspace,"Alt-Backspace":Ns["Mod-Backspace"],"Ctrl-d":Ns.Delete,"Ctrl-Alt-Backspace":Ns["Mod-Delete"],"Alt-Delete":Ns["Mod-Delete"],"Alt-d":Ns["Mod-Delete"],"Ctrl-a":Ds,"Ctrl-e":Es};for(var Ts in Ns)Ms[Ts]=Ns[Ts];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function Fs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),u=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;var c=n.doc.resolve(s.start-2);l=new Wt(c,c,s.depth),s.endIndex<s.parent.childCount&&(s=new Wt(i,n.doc.resolve(a.end(s.depth)),s.depth)),u=!0}var f=Hn(l,e,t,s);return!!f&&(r&&r(Ps(n.tr,s,f,u,e).scrollIntoView()),!0)}}function Ps(e,t,n,r,o){for(var i=Dt.empty,a=n.length-1;a>=0;a--)i=Dt.from(n[a].type.create(n[a].attrs,i));e.step(new zn(t.start-(r?2:0),t.end,t.start,t.end,new jt(i,0,0),n.length,!0));for(var s=0,u=0;u<n.length;u++)n[u].type==o&&(s=u+1);for(var l=n.length-s,c=t.start+n.length-(r?2:0),f=t.parent,d=t.startIndex,p=t.endIndex,h=!0;d<p;d++,h=!1)!h&&Qn(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=f.child(d).nodeSize;return e}function Rs(e){return function(t,n){var r=t.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(t){return t.childCount>0&&t.firstChild.type==e}));return!!a&&(!n||(o.node(a.depth-1).type==e?function(e,t,n,r){var o=e.tr,i=r.end,a=r.$to.end(r.depth);i<a&&(o.step(new zn(i-1,a,i,a,new jt(Dt.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Wt(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));return t(o.lift(r,$n(r)).scrollIntoView()),!0}(t,n,e,a):function(e,t,n){for(var r=e.tr,o=n.parent,i=n.end,a=n.endIndex-1,s=n.startIndex;a>s;a--)i-=o.child(a).nodeSize,r.delete(i-1,i+1);var u=r.doc.resolve(n.start),l=u.nodeAfter;if(r.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var c=0==n.startIndex,f=n.endIndex==o.childCount,d=u.node(-1),p=u.index(-1);if(!d.canReplace(p+(c?0:1),p+1,l.content.append(f?Dt.empty:Dt.from(o))))return!1;var h=u.pos,m=h+l.nodeSize;return r.step(new zn(h-(c?1:0),m+(f?1:0),h+1,m-1,new jt((c?Dt.empty:Dt.from(o.copy(Dt.empty))).append(f?Dt.empty:Dt.from(o.copy(Dt.empty))),c?0:1,f?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,a)))}}function Bs(e){var t=e.state,n=e.transaction,r=n.selection,o=n.doc,a=n.storedMarks;return i(i({},t),{},{apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,a=n.storedMarks,n}})}var Ls=function(){function e(t){y(this,e),this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}return k(e,[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var e=this,t=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,a=this.buildProps(i);return Object.fromEntries(Object.entries(t).map((function(t){var n=p(t,2),r=n[0],s=n[1];return[r,function(){var t=s.apply(void 0,arguments)(a);return i.getMeta("preventDispatch")||e.hasCustomState||o.dispatch(i),t}]})))}},{key:"chain",get:function(){var e=this;return function(){return e.createChain()}}},{key:"can",get:function(){var e=this;return function(){return e.createCan()}}},{key:"createChain",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,a=this.state,s=o.view,u=[],l=!!e,c=e||a.tr,f=function(){return l||!n||c.getMeta("preventDispatch")||t.hasCustomState||s.dispatch(c),u.every((function(e){return!0===e}))},d=i(i({},Object.fromEntries(Object.entries(r).map((function(e){var r=p(e,2),o=r[0],i=r[1];return[o,function(){var e=t.buildProps(c,n),r=i.apply(void 0,arguments)(e);return u.push(r),d}]})))),{},{run:f});return d}},{key:"createCan",value:function(e){var t=this,n=this.rawCommands,r=this.state,o=void 0,a=e||r.tr,s=this.buildProps(a,o),u=Object.fromEntries(Object.entries(n).map((function(e){var t=p(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(i(i({},s),{},{dispatch:o}))}]})));return i(i({},u),{},{chain:function(){return t.createChain(a,o)}})}},{key:"buildProps",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view;i.storedMarks&&e.setStoredMarks(i.storedMarks);var s={tr:e,editor:o,view:a,state:Bs({state:i,transaction:e}),dispatch:n?function(){}:void 0,chain:function(){return t.createChain(e)},can:function(){return t.createCan(e)},get commands(){return Object.fromEntries(Object.entries(r).map((function(e){var t=p(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(s)}]})))}};return s}}]),e}(),Is=function(){function e(){y(this,e),this.callbacks={}}return k(e,[{key:"on",value:function(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=this.callbacks[e];return i&&i.forEach((function(e){return e.apply(t,r)})),this}},{key:"off",value:function(e,t){var n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((function(e){return e!==t})):delete this.callbacks[e]),this}},{key:"removeAllListeners",value:function(){this.callbacks={}}}]),e}();function zs(e,t,n){return void 0===e.config[t]&&e.parent?zs(e.parent,t,n):"function"===typeof e.config[t]?e.config[t].bind(i(i({},n),{},{parent:e.parent?zs(e.parent,t,n):null})):e.config[t]}function _s(e){return{baseExtensions:e.filter((function(e){return"extension"===e.type})),nodeExtensions:e.filter((function(e){return"node"===e.type})),markExtensions:e.filter((function(e){return"mark"===e.type}))}}function Vs(e){var t=[],n=_s(e),r=n.nodeExtensions,o=n.markExtensions,a=[].concat(P(r),P(o)),s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((function(e){var n=zs(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});n&&n().forEach((function(e){e.types.forEach((function(n){Object.entries(e.attributes).forEach((function(e){var r=p(e,2),o=r[0],a=r[1];t.push({type:n,name:o,attribute:i(i({},s),a)})}))}))}))})),a.forEach((function(e){var n={name:e.name,options:e.options,storage:e.storage},r=zs(e,"addAttributes",n);if(r){var o=r();Object.entries(o).forEach((function(n){var r=p(n,2),o=r[0],a=r[1],u=i(i({},s),a);a.isRequired&&void 0===a.default&&delete u.default,t.push({type:e.name,name:o,attribute:u})}))}})),t}function $s(e,t){if("string"===typeof e){if(!t.nodes[e])throw Error("There is no node type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.nodes[e]}return e}function Hs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return!!e})).reduce((function(e,t){var n=i({},e);return Object.entries(t).forEach((function(e){var t=p(e,2),r=t[0],o=t[1];n[r]?n[r]="class"===r?[n[r],o].join(" "):"style"===r?[n[r],o].join("; "):o:n[r]=o})),n}),{})}function Us(e,t){return t.filter((function(e){return e.attribute.rendered})).map((function(t){return t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:r({},t.name,e.attrs[t.name])})).reduce((function(e,t){return Hs(e,t)}),{})}function Ws(e){return"function"===typeof e}function qs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Ws(e)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t?e.bind(t).apply(void 0,r):e.apply(void 0,r)}return e}function Ks(e,t){return e.style?e:i(i({},e),{},{getAttrs:function(n){var o=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===o)return!1;var a=t.reduce((function(e,t){var o=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!==typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null===o||void 0===o?e:i(i({},e),{},r({},t.name,o))}),{});return i(i({},o),a)}})}function Js(e){return Object.fromEntries(Object.entries(e).filter((function(e){var t=p(e,2),n=t[0],r=t[1];return("attrs"!==n||!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}(r))&&(null!==r&&void 0!==r)})))}function Qs(e){var t,n=Vs(e),r=_s(e),o=r.nodeExtensions,a=r.markExtensions,s=null===(t=o.find((function(e){return zs(e,"topNode")})))||void 0===t?void 0:t.name,u=Object.fromEntries(o.map((function(t){var r=n.filter((function(e){return e.type===t.name})),o={name:t.name,options:t.options,storage:t.storage},a=e.reduce((function(e,n){var r=zs(n,"extendNodeSchema",o);return i(i({},e),r?r(t):{})}),{}),s=Js(i(i({},a),{},{content:qs(zs(t,"content",o)),marks:qs(zs(t,"marks",o)),group:qs(zs(t,"group",o)),inline:qs(zs(t,"inline",o)),atom:qs(zs(t,"atom",o)),selectable:qs(zs(t,"selectable",o)),draggable:qs(zs(t,"draggable",o)),code:qs(zs(t,"code",o)),defining:qs(zs(t,"defining",o)),isolating:qs(zs(t,"isolating",o)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),u=qs(zs(t,"parseHTML",o));u&&(s.parseDOM=u.map((function(e){return Ks(e,r)})));var l=zs(t,"renderHTML",o);l&&(s.toDOM=function(e){return l({node:e,HTMLAttributes:Us(e,r)})});var c=zs(t,"renderText",o);return c&&(s.toText=c),[t.name,s]}))),l=Object.fromEntries(a.map((function(t){var r=n.filter((function(e){return e.type===t.name})),o={name:t.name,options:t.options,storage:t.storage},a=e.reduce((function(e,n){var r=zs(n,"extendMarkSchema",o);return i(i({},e),r?r(t):{})}),{}),s=Js(i(i({},a),{},{inclusive:qs(zs(t,"inclusive",o)),excludes:qs(zs(t,"excludes",o)),group:qs(zs(t,"group",o)),spanning:qs(zs(t,"spanning",o)),code:qs(zs(t,"code",o)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),u=qs(zs(t,"parseHTML",o));u&&(s.parseDOM=u.map((function(e){return Ks(e,r)})));var l=zs(t,"renderHTML",o);return l&&(s.toDOM=function(e){return l({mark:e,HTMLAttributes:Us(e,r)})}),[t.name,s]})));return new dn({topNode:s,nodes:u,marks:l})}function Gs(e,t){return t.nodes[e]||t.marks[e]||null}function Ys(e,t){return Array.isArray(t)?t.some((function(t){return("string"===typeof t?t:t.name)===e.name})):t}function Xs(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Zs=k((function e(t){y(this,e),this.find=t.find,this.handler=t.handler}));function eu(e){var t,n=e.editor,r=e.from,o=e.to,i=e.text,a=e.rules,s=e.plugin,u=n.view;if(u.composing)return!1;var l=u.state.doc.resolve(r);if(l.parent.type.spec.code||(null===(t=l.nodeBefore||l.nodeAfter)||void 0===t?void 0:t.marks.find((function(e){return e.type.spec.code}))))return!1;var c=!1,f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,(function(t,r,o,i){var a,s,u;n+=(null===(s=(a=t.type.spec).toText)||void 0===s?void 0:s.call(a,{node:t,pos:r,parent:o,index:i}))||(null===(u=e.nodeBefore)||void 0===u?void 0:u.text)||"%leaf%"})),n}(l)+i;return a.forEach((function(e){if(!c){var t=function(e,t){if(Xs(t))return t.exec(e);var n=t(e);if(!n)return null;var r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r}(f,e.find);if(t){var a=u.state.tr,l=Bs({state:u.state,transaction:a}),d={from:r-(t[0].length-i.length),to:o},p=new Ls({editor:n,state:l}),h=p.commands,m=p.chain,v=p.can;null!==e.handler({state:l,range:d,match:t,commands:h,chain:m,can:v})&&a.steps.length&&(a.setMeta(s,{transform:a,from:r,to:o,text:i}),u.dispatch(a),c=!0)}}})),c}function tu(e){var t=e.editor,n=e.rules,r=new Fr({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,o,i,a){return eu({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:function(e){return setTimeout((function(){var o=e.state.selection.$cursor;o&&eu({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1}},handleKeyDown:function(e,o){if("Enter"!==o.key)return!1;var i=e.state.selection.$cursor;return!!i&&eu({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var nu=k((function e(t){y(this,e),this.find=t.find,this.handler=t.handler}));function ru(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=new Ls({editor:t,state:n}),s=a.commands,u=a.chain,l=a.can,c=[];return n.doc.nodesBetween(r,o,(function(e,t){if(e.isTextblock&&!e.type.spec.code){var a=Math.max(r,t),f=Math.min(o,t+e.content.size);(function(e,t){if(Xs(t))return P(e.matchAll(t));var n=t(e);return n?n.map((function(t){var n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(a-t,f-t,void 0,"\ufffc"),i.find).forEach((function(e){if(void 0!==e.index){var t=a+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=i.handler({state:n,range:o,match:e,commands:s,chain:u,can:l});c.push(f)}}))}})),c.every((function(e){return null!==e}))}var ou=function(){function e(t,n){var r=this;y(this,e),this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=Qs(this.extensions),this.extensions.forEach((function(e){var t;r.editor.extensionStorage[e.name]=e.storage;var n={name:e.name,options:e.options,storage:e.storage,editor:r.editor,type:Gs(e.name,r.schema)};"mark"===e.type&&((null===(t=qs(zs(e,"keepOnSplit",n)))||void 0===t||t)&&r.splittableMarks.push(e.name));var o=zs(e,"onBeforeCreate",n);o&&r.editor.on("beforeCreate",o);var i=zs(e,"onCreate",n);i&&r.editor.on("create",i);var a=zs(e,"onUpdate",n);a&&r.editor.on("update",a);var s=zs(e,"onSelectionUpdate",n);s&&r.editor.on("selectionUpdate",s);var u=zs(e,"onTransaction",n);u&&r.editor.on("transaction",u);var l=zs(e,"onFocus",n);l&&r.editor.on("focus",l);var c=zs(e,"onBlur",n);c&&r.editor.on("blur",c);var f=zs(e,"onDestroy",n);f&&r.editor.on("destroy",f)}))}return k(e,[{key:"commands",get:function(){var e=this;return this.extensions.reduce((function(t,n){var r=zs(n,"addCommands",{name:n.name,options:n.options,storage:n.storage,editor:e.editor,type:Gs(n.name,e.schema)});return r?i(i({},t),r()):t}),{})}},{key:"plugins",get:function(){var t=this,n=this.editor,r=e.sort(P(this.extensions).reverse()),o=[],i=[],a=r.map((function(e){var r={name:e.name,options:e.options,storage:e.storage,editor:n,type:Gs(e.name,t.schema)},a=[],s=zs(e,"addKeyboardShortcuts",r);if(s){var u=function(e){return new Fr({props:{handleKeyDown:is(e)}})}(Object.fromEntries(Object.entries(s()).map((function(e){var t=p(e,2),r=t[0],o=t[1];return[r,function(){return o({editor:n})}]}))));a.push(u)}var l=zs(e,"addInputRules",r);Ys(e,n.options.enableInputRules)&&l&&o.push.apply(o,P(l()));var c=zs(e,"addPasteRules",r);Ys(e,n.options.enablePasteRules)&&c&&i.push.apply(i,P(c()));var f=zs(e,"addProseMirrorPlugins",r);if(f){var d=f();a.push.apply(a,P(d))}return a})).flat();return[tu({editor:n,rules:o})].concat(P(function(e){var t=e.editor,n=e.rules,r=null,o=!1,i=!1;return n.map((function(e){return new Fr({view:function(e){var t=function(t){var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy:function(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:function(e){return i=r===e.dom.parentElement,!1},paste:function(e,t){var n,r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null===r||void 0===r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(n,r,a){var s=n[0],u="paste"===s.getMeta("uiEvent")&&!o,l="drop"===s.getMeta("uiEvent")&&!i;if(u||l){var c=r.doc.content.findDiffStart(a.doc.content),f=r.doc.content.findDiffEnd(a.doc.content);if("number"===typeof c&&f&&c!==f.b){var d=a.tr,p=Bs({state:a,transaction:d});if(ru({editor:t,state:p,from:Math.max(c-1,0),to:f.b,rule:e})&&d.steps.length)return d}}}})}))}({editor:n,rules:i})),P(a))}},{key:"attributes",get:function(){return Vs(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=_s(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(e){return!!zs(e,"addNodeView")})).map((function(n){var r=e.attributes.filter((function(e){return e.type===n.name})),o={name:n.name,options:n.options,storage:n.storage,editor:t,type:$s(n.name,e.schema)},i=zs(n,"addNodeView",o);if(!i)return[];return[n.name,function(e,o,a,s){var u=Us(e,r);return i()({editor:t,node:e,getPos:a,decorations:s,HTMLAttributes:u,extension:n})}]})))}}],[{key:"resolve",value:function(t){var n=e.sort(e.flatten(t)),r=function(e){var t=e.filter((function(t,n){return e.indexOf(t)!==n}));return P(new Set(t))}(n.map((function(e){return e.name})));return r.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"]. This can lead to issues.")),n}},{key:"flatten",value:function(e){var t=this;return e.map((function(e){var n=zs(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e].concat(P(t.flatten(n()))):e})).flat(10)}},{key:"sort",value:function(e){return e.sort((function(e,t){var n=zs(e,"priority")||100,r=zs(t,"priority")||100;return n>r?-1:n<r?1:0}))}}]),e}();function iu(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function au(e,t){var n=i({},e);return iu(e)&&iu(t)&&Object.keys(t).forEach((function(o){iu(t[o])&&o in e?n[o]=au(e[o],t[o]):Object.assign(n,r({},o,t[o]))})),n}var su=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,e),this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=i(i({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=qs(zs(this,"addOptions",{name:this.name}))),this.storage=qs(zs(this,"addStorage",{name:this.name,options:this.options}))||{}}return k(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=au(this.options,e),t.storage=qs(zs(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=qs(zs(n,"addOptions",{name:n.name})),n.storage=qs(zs(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function uu(e,t,n){var r=t.from,o=t.to,i=n||{},a=i.blockSeparator,s=void 0===a?"\n\n":a,u=i.textSerializers,l=void 0===u?{}:u,c="",f=!0;return e.nodesBetween(r,o,(function(e,n,i,a){var u,d=null===l||void 0===l?void 0:l[e.type.name];d?(e.isBlock&&!f&&(c+=s,f=!0),i&&(c+=d({node:e,pos:n,parent:i,index:a,range:t}))):e.isText?(c+=null===(u=null===e||void 0===e?void 0:e.text)||void 0===u?void 0:u.slice(Math.max(r,n)-n,o-n),f=!1):e.isBlock&&!f&&(c+=s,f=!0)})),c}function lu(e){return Object.fromEntries(Object.entries(e.nodes).filter((function(e){return p(e,2)[1].spec.toText})).map((function(e){var t=p(e,2);return[t[0],t[1].spec.toText]})))}var cu=su.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var e=this;return[new Fr({key:new Br("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var t=e.editor,n=t.state,r=t.schema,o=n.doc,i=n.selection.ranges,a=Math.min.apply(Math,P(i.map((function(e){return e.$from.pos})))),s=Math.max.apply(Math,P(i.map((function(e){return e.$to.pos}))));return uu(o,{from:a,to:s},{textSerializers:lu(r)})}}})]}});function fu(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every((function(r){return n.strict?t[r]===e[r]:Xs(t[r])?t[r].test(e[r]):t[r]===e[r]}))}function du(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find((function(e){return e.type===t&&fu(e.attrs,n)}))}function pu(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!du(e,t,n)}function hu(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t){var r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),r.node){var o=du(P(r.node.marks),t,n);if(o){var i=r.index,a=e.start()+r.offset,s=i+1,u=a+r.node.nodeSize;for(du(P(r.node.marks),t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,a-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&pu(P(e.parent.child(s).marks),t,n);)u+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}}}}function mu(e,t){if("string"===typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}function vu(e){return e&&"object"===typeof e&&!Array.isArray(e)&&!function(e){var t;return"class"===(null===(t=e.constructor)||void 0===t?void 0:t.toString().substring(0,5))}(e)}function gu(e){return vu(e)&&e instanceof yr}function yu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function bu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=hr.atStart(e),r=hr.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?yr.create(e,yu(0,o,i),yu(e.content.size,o,i)):yr.create(e,yu(t,o,i),yu(t,o,i))}function ku(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function wu(e){var t="<body>".concat(e,"</body>");return(new window.DOMParser).parseFromString(t,"text/html").body}function xu(e,t,n){if(n=i({slice:!0,parseOptions:{}},n),"object"===typeof e&&null!==e)try{return Array.isArray(e)?Dt.fromArray(e.map((function(e){return t.nodeFromJSON(e)}))):t.nodeFromJSON(e)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),xu("",t,n)}if("string"===typeof e){var r=hn.fromSchema(t);return n.slice?r.parseSlice(wu(e),n.parseOptions).content:r.parse(wu(e),n.parseOptions)}return xu("",t,n)}function Du(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function Eu(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.from,i=r.to,a=r.empty,s=t?$s(t,e.schema):null,u=[];e.doc.nodesBetween(o,i,(function(e,t){if(!e.isText){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);u.push({node:e,from:n,to:r})}}));var l=i-o,c=u.filter((function(e){return!s||s.name===e.node.type.name})).filter((function(e){return fu(e.node.attrs,n,{strict:!1})}));if(a)return!!c.length;var f=c.reduce((function(e,t){return e+t.to-t.from}),0);return f>=l}function Cu(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Ou(e,t){var n="string"===typeof t?[t]:t;return Object.keys(e).reduce((function(t,r){return n.includes(r)||(t[r]=e[r]),t}),{})}function Su(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return xu(e,t,{slice:!1,parseOptions:n})}function Au(e,t){var n=mu(t,e.schema),r=e.selection,o=r.from,a=r.to,s=r.empty,u=[];s?(e.storedMarks&&u.push.apply(u,P(e.storedMarks)),u.push.apply(u,P(e.selection.$head.marks()))):e.doc.nodesBetween(o,a,(function(e){u.push.apply(u,P(e.marks))}));var l=u.find((function(e){return e.type.name===n.name}));return l?i({},l.attrs):{}}function ju(e,t,n){return Object.fromEntries(Object.entries(n).filter((function(n){var r=p(n,1)[0],o=e.find((function(e){return e.type===t&&e.name===r}));return!!o&&o.attribute.keepOnSplit})))}function Nu(e){for(var t=0;t<e.edgeCount;t+=1){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Mu(e,t){var n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){var r=n.filter((function(e){return null===t||void 0===t?void 0:t.includes(e.type.name)}));e.tr.ensureMarks(r)}}function Tu(e){return function(t){return function(e,t){for(var n=e.depth;n>0;n-=1){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}}function Fu(e,t){var n=_s(t).nodeExtensions.find((function(t){return t.name===e}));if(!n)return!1;var r=qs(zs(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"===typeof r&&r.split(" ").includes("list")}var Pu=function(e,t){var n=Tu((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Yn(e.doc,n.pos)||(e.join(n.pos),!0)},Ru=function(e,t){var n=Tu((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Yn(e.doc,r)||(e.join(r),!0)};function Bu(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?mu(t,e.schema):null;if(o)return!!(e.storedMarks||e.selection.$from.marks()).filter((function(e){return!a||a.name===e.type.name})).find((function(e){return fu(e.attrs,n,{strict:!1})}));var s=0,u=[];if(i.forEach((function(t){var n=t.$from,r=t.$to,o=n.pos,i=r.pos;e.doc.nodesBetween(o,i,(function(e,t){if(e.isText||e.marks.length){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);s+=r-n,u.push.apply(u,P(e.marks.map((function(e){return{mark:e,from:n,to:r}}))))}}))})),0===s)return!1;var l=u.filter((function(e){return!a||a.name===e.mark.type.name})).filter((function(e){return fu(e.mark.attrs,n,{strict:!1})})).reduce((function(e,t){return e+t.to-t.from}),0),c=u.filter((function(e){return!a||e.mark.type!==a&&e.mark.type.excludes(a)})).reduce((function(e,t){return e+t.to-t.from}),0),f=l>0?l+c:l;return f>=s}var Lu=Object.freeze({__proto__:null,blur:function(){return function(e){var t=e.editor,n=e.view;return requestAnimationFrame((function(){var e;t.isDestroyed||(n.dom.blur(),null===(e=null===window||void 0===window?void 0:window.getSelection())||void 0===e||e.removeAllRanges())})),!0}},clearContent:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){return t.commands.setContent("",e)}},clearNodes:function(){return function(e){var t=e.state,n=e.tr,r=e.dispatch,o=n.selection.ranges;return!r||(o.forEach((function(e){var r=e.$from,o=e.$to;t.doc.nodesBetween(r.pos,o.pos,(function(e,t){if(!e.type.isText){var r=n.doc,o=n.mapping,i=r.resolve(o.map(t)),a=r.resolve(o.map(t+e.nodeSize)),s=i.blockRange(a);if(s){var u=$n(s);if(e.type.isTextblock){var l=i.parent.contentMatchAt(i.index()).defaultType;n.setNodeMarkup(s.start,l)}(u||0===u)&&n.lift(s,u)}}}))})),!0)}},command:function(e){return function(t){return e(t)}},createParagraphNear:function(){return function(e){var t=e.state,n=e.dispatch;return ys(t,n)}},deleteNode:function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=$s(e,r.schema),a=n.selection.$anchor,s=a.depth;s>0;s-=1){if(a.node(s).type===i){if(o){var u=a.before(s),l=a.after(s);n.delete(u,l).scrollIntoView()}return!0}}return!1}},deleteRange:function(e){return function(t){var n=t.tr,r=t.dispatch,o=e.from,i=e.to;return r&&n.delete(o,i),!0}},deleteSelection:function(){return function(e){var t=e.state,n=e.dispatch;return as(t,n)}},enter:function(){return function(e){return e.commands.keyboardShortcut("Enter")}},exitCode:function(){return function(e){var t=e.state,n=e.dispatch;return gs(t,n)}},extendMarkRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=mu(e,o.schema),s=r.doc,u=r.selection,l=u.$from,c=u.from,f=u.to;if(i){var d=hu(l,a,t);if(d&&d.from<=c&&d.to>=f){var p=yr.create(s,d.from,d.to);r.setSelection(p)}}return!0}},first:function(e){return function(t){for(var n="function"===typeof e?e(t):e,r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1}},focus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.editor,o=n.view,a=n.tr,s=n.dispatch;t=i({scrollIntoView:!0},t);var u=function(){ku()&&o.dom.focus(),requestAnimationFrame((function(){r.isDestroyed||(o.focus(),(null===t||void 0===t?void 0:t.scrollIntoView)&&r.commands.scrollIntoView())}))};if(o.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!gu(r.state.selection))return u(),!0;var l=bu(a.doc,e)||r.state.selection,c=r.state.selection.eq(l);return s&&(c||a.setSelection(l),c&&a.storedMarks&&a.setStoredMarks(a.storedMarks),u()),!0}},forEach:function(e,t){return function(n){return e.every((function(e,r){return t(e,i(i({},n),{},{index:r}))}))}},insertContent:function(e,t){return function(n){var r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)}},insertContentAt:function(e,t,n){return function(r){var o=r.tr,a=r.dispatch,s=r.editor;if(a){n=i({parseOptions:{},updateSelection:!0},n);var u=xu(t,s.schema,{parseOptions:i({preserveWhitespace:"full"},n.parseOptions)});if("<>"===u.toString())return!0;var l="number"===typeof e?{from:e,to:e}:e,c=l.from,f=l.to,d=!0,p=!0;if((u.toString().startsWith("<")?u:[u]).forEach((function(e){e.check(),d=!!d&&(e.isText&&0===e.marks.length),p=!!p&&e.isBlock})),c===f&&p){var h=o.doc.resolve(c).parent;h.isTextblock&&!h.type.spec.code&&!h.childCount&&(c-=1,f+=1)}d?o.insertText(t,c,f):o.replaceWith(c,f,u),n.updateSelection&&function(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o=e.steps[r];if(o instanceof In||o instanceof zn){var i=e.mapping.maps[r],a=0;i.forEach((function(e,t,n,r){0===a&&(a=r)})),e.setSelection(hr.near(e.doc.resolve(a),n))}}}(o,o.steps.length-1,-1)}return!0}},joinBackward:function(){return function(e){var t=e.state,n=e.dispatch;return ss(t,n)}},joinForward:function(){return function(e){var t=e.state,n=e.dispatch;return fs(t,n)}},keyboardShortcut:function(e){return function(t){var n=t.editor,r=t.view,o=t.tr,i=t.dispatch,a=function(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"===a&&(a=" ");for(var s=0;s<i.length-1;s+=1){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))t=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: ".concat(u));ku()||Du()?o=!0:n=!0}}return t&&(a="Alt-".concat(a)),n&&(a="Ctrl-".concat(a)),o&&(a="Meta-".concat(a)),r&&(a="Shift-".concat(a)),a}(e).split(/-(?!$)/),s=a.find((function(e){return!["Alt","Ctrl","Meta","Shift"].includes(e)})),u=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),l=n.captureTransaction((function(){r.someProp("handleKeyDown",(function(e){return e(r,u)}))}));return null===l||void 0===l||l.steps.forEach((function(e){var t=e.map(o.mapping);t&&i&&o.maybeStep(t)})),!0}},lift:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return!!Eu(r,$s(e,r.schema),t)&&hs(r,o)}},liftEmptyBlock:function(){return function(e){var t=e.state,n=e.dispatch;return bs(t,n)}},liftListItem:function(e){return function(t){var n=t.state,r=t.dispatch;return Rs($s(e,n.schema))(n,r)}},newlineInCode:function(){return function(e){var t=e.state,n=e.dispatch;return ms(t,n)}},resetAttributes:function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=Cu("string"===typeof e?e:e.name,o.schema);return!!u&&("node"===u&&(a=$s(e,o.schema)),"mark"===u&&(s=mu(e,o.schema)),i&&r.selection.ranges.forEach((function(e){o.doc.nodesBetween(e.$from.pos,e.$to.pos,(function(e,n){a&&a===e.type&&r.setNodeMarkup(n,void 0,Ou(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((function(o){s===o.type&&r.addMark(n,n+e.nodeSize,s.create(Ou(o.attrs,t)))}))}))})),!0)}},scrollIntoView:function(){return function(e){var t=e.tr;return e.dispatch&&t.scrollIntoView(),!0}},selectAll:function(){return function(e){var t=e.tr;return e.commands.setTextSelection({from:0,to:t.doc.content.size})}},selectNodeBackward:function(){return function(e){var t=e.state,n=e.dispatch;return ls(t,n)}},selectNodeForward:function(){return function(e){var t=e.state,n=e.dispatch;return ds(t,n)}},selectParentNode:function(){return function(e){return function(e,t){var n,r=e.selection,o=r.$from,i=r.to,a=o.sharedDepth(i);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(kr.create(e.doc,n))),!0)}(e.state,e.dispatch)}},selectTextblockEnd:function(){return function(e){var t=e.state,n=e.dispatch;return Es(t,n)}},selectTextblockStart:function(){return function(e){var t=e.state,n=e.dispatch;return Ds(t,n)}},setContent:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.tr,i=r.editor,a=r.dispatch,s=o.doc,u=Su(e,i.schema,n);return a&&o.replaceWith(0,s.content.size,u).setMeta("preventUpdate",!t),!0}},setMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,a=n.dispatch,s=r.selection,u=s.empty,l=s.ranges,c=mu(e,o.schema);if(a)if(u){var f=Au(o,c);r.addStoredMark(c.create(i(i({},f),t)))}else l.forEach((function(e){var n=e.$from.pos,a=e.$to.pos;o.doc.nodesBetween(n,a,(function(e,o){var s=Math.max(o,n),u=Math.min(o+e.nodeSize,a);e.marks.find((function(e){return e.type===c}))?e.marks.forEach((function(e){c===e.type&&r.addMark(s,u,c.create(i(i({},e.attrs),t)))})):r.addMark(s,u,c.create(t))}))}));return!0}},setMeta:function(e,t){return function(n){return n.tr.setMeta(e,t),!0}},setNode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=n.chain,a=$s(e,r.schema);return a.isTextblock?i().command((function(e){var n=e.commands;return!!Os(a,t)(r)||n.clearNodes()})).command((function(e){var n=e.state;return Os(a,t)(n,o)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},setNodeSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o=hr.atStart(r).from,i=hr.atEnd(r).to,a=yu(e,o,i),s=kr.create(r,a);n.setSelection(s)}return!0}},setTextSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o="number"===typeof e?{from:e,to:e}:e,i=o.from,a=o.to,s=yr.atStart(r).from,u=yr.atEnd(r).to,l=yu(i,s,u),c=yu(a,s,u),f=yr.create(r,l,c);n.setSelection(f)}return!0}},sinkListItem:function(e){return function(t){var n,r=t.state,o=t.dispatch,i=$s(e,r.schema);return(n=i,function(e,t){var r=e.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(e){return e.childCount>0&&e.firstChild.type==n}));if(!a)return!1;var s=a.startIndex;if(0==s)return!1;var u=a.parent,l=u.child(s-1);if(l.type!=n)return!1;if(t){var c=l.lastChild&&l.lastChild.type==u.type,f=Dt.from(c?n.create():null),d=new jt(Dt.from(n.create(null,Dt.from(u.type.create(null,f)))),c?3:1,0),p=a.start,h=a.end;t(e.tr.step(new zn(p-(c?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0})(r,o)}},splitBlock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.keepMarks,n=void 0===t||t;return function(e){var t=e.tr,r=e.state,o=e.dispatch,i=e.editor,a=t.selection,s=t.doc,u=a.$from,l=a.$to,c=ju(i.extensionManager.attributes,u.node().type.name,u.node().attrs);if(a instanceof kr&&a.node.isBlock)return!(!u.parentOffset||!Qn(s,u.pos))&&(o&&(n&&Mu(r,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(o){var f=l.parentOffset===l.parent.content.size;a instanceof yr&&t.deleteSelection();var d=0===u.depth?void 0:Nu(u.node(-1).contentMatchAt(u.indexAfter(-1))),p=f&&d?[{type:d,attrs:c}]:void 0,h=Qn(t.doc,t.mapping.map(u.pos),1,p);if(p||h||!Qn(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)||(h=!0,p=d?[{type:d,attrs:c}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){var m=t.mapping.map(u.before()),v=t.doc.resolve(m);u.node(-1).canReplaceWith(v.index(),v.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}n&&Mu(r,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0}},splitListItem:function(e){return function(t){var n,r=t.tr,o=t.state,i=t.dispatch,a=t.editor,s=$s(e,o.schema),u=o.selection,l=u.$from,c=u.$to,f=o.selection.node;if(f&&f.isBlock||l.depth<2||!l.sameParent(c))return!1;var d=l.node(-1);if(d.type!==s)return!1;var p=a.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){for(var h=Dt.empty,m=l.index(-1)?1:l.index(-2)?2:3,v=l.depth-m;v>=l.depth-3;v-=1)h=Dt.from(l.node(v).copy(h));var g=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,y=ju(p,l.node().type.name,l.node().attrs),b=(null===(n=s.contentMatch.defaultType)||void 0===n?void 0:n.createAndFill(y))||void 0;h=h.append(Dt.from(s.createAndFill(null,b)||void 0));var k=l.before(l.depth-(m-1));r.replace(k,l.after(-g),new jt(h,4-m,0));var w=-1;r.doc.nodesBetween(k,r.doc.content.size,(function(e,t){if(w>-1)return!1;e.isTextblock&&0===e.content.size&&(w=t+1)})),w>-1&&r.setSelection(yr.near(r.doc.resolve(w))),r.scrollIntoView()}return!0}var x=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,D=ju(p,d.type.name,d.attrs),E=ju(p,l.node().type.name,l.node().attrs);r.delete(l.pos,c.pos);var C=x?[{type:s,attrs:D},{type:x,attrs:E}]:[{type:s,attrs:D}];return!!Qn(r.doc,l.pos,2)&&(i&&r.split(l.pos,2,C).scrollIntoView(),!0)}},toggleList:function(e,t){return function(n){var r=n.editor,o=n.tr,i=n.state,a=n.dispatch,s=n.chain,u=n.commands,l=n.can,c=r.extensionManager.extensions,f=$s(e,i.schema),d=$s(t,i.schema),p=i.selection,h=p.$from,m=p.$to,v=h.blockRange(m);if(!v)return!1;var g=Tu((function(e){return Fu(e.type.name,c)}))(p);if(v.depth>=1&&g&&v.depth-g.depth<=1){if(g.node.type===f)return u.liftListItem(d);if(Fu(g.node.type.name,c)&&f.validContent(g.node.content)&&a)return s().command((function(){return o.setNodeMarkup(g.pos,f),!0})).command((function(){return Pu(o,f)})).command((function(){return Ru(o,f)})).run()}return s().command((function(){return!!l().wrapInList(f)||u.clearNodes()})).wrapInList(f).command((function(){return Pu(o,f)})).command((function(){return Ru(o,f)})).run()}},toggleMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=n.extendEmptyMarkRange,s=void 0!==a&&a,u=mu(e,o.schema);return Bu(o,u,t)?i.unsetMark(u,{extendEmptyMarkRange:s}):i.setMark(u,t)}},toggleNode:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=$s(e,o.schema),s=$s(t,o.schema);return Eu(o,a,n)?i.setNode(s):i.setNode(a,n)}},toggleWrap:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=$s(e,r.schema);return Eu(r,i,t)?o.lift(i):o.wrapIn(i,t)}},undoInputRule:function(){return function(e){for(var t=e.state,n=e.dispatch,r=t.plugins,o=0;o<r.length;o+=1){var i=r[o],a=void 0;if(i.spec.isInputRules&&(a=i.getState(t))){if(n){for(var s=t.tr,u=a.transform,l=u.steps.length-1;l>=0;l-=1)s.step(u.steps[l].invert(u.docs[l]));if(a.text){var c=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,c))}else s.delete(a.from,a.to)}return!0}}return!1}},unsetAllMarks:function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach((function(e){t.removeMark(e.$from.pos,e.$to.pos)})),!0}},unsetMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,s=t.extendEmptyMarkRange,u=void 0!==s&&s,l=o.selection,c=mu(e,i.schema),f=l.$from,d=l.empty,p=l.ranges;if(!a)return!0;if(d&&u){var h=l.from,m=l.to,v=null===(r=f.marks().find((function(e){return e.type===c})))||void 0===r?void 0:r.attrs,g=hu(f,c,v);g&&(h=g.from,m=g.to),o.removeMark(h,m,c)}else p.forEach((function(e){o.removeMark(e.$from.pos,e.$to.pos,c)}));return o.removeStoredMark(c),!0}},updateAttributes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,a=n.dispatch,s=null,u=null,l=Cu("string"===typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(s=$s(e,o.schema)),"mark"===l&&(u=mu(e,o.schema)),a&&r.selection.ranges.forEach((function(e){var n=e.$from.pos,a=e.$to.pos;o.doc.nodesBetween(n,a,(function(e,o){s&&s===e.type&&r.setNodeMarkup(o,void 0,i(i({},e.attrs),t)),u&&e.marks.length&&e.marks.forEach((function(s){if(u===s.type){var l=Math.max(o,n),c=Math.min(o+e.nodeSize,a);r.addMark(l,c,u.create(i(i({},s.attrs),t)))}}))}))})),!0)}},wrapIn:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return Cs($s(e,r.schema),t)(r,o)}},wrapInList:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return Fs($s(e,r.schema),t)(r,o)}}}),Iu=su.create({name:"commands",addCommands:function(){return i({},Lu)}}),zu=su.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new Fr({key:new Br("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),_u=su.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new Fr({key:new Br("focusEvents"),props:{handleDOMEvents:{focus:function(t,n){e.isFocused=!0;var r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:function(t,n){e.isFocused=!1;var r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Vu=su.create({name:"keymap",addKeyboardShortcuts:function(){var e=this,t=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.undoInputRule()},function(){return t.command((function(e){var n=e.tr,r=n.selection,o=n.doc,i=r.empty,a=r.$anchor,s=a.pos,u=a.parent,l=hr.atStart(o).from===s;return!(!(i&&l&&u.type.isTextblock)||u.textContent.length)&&t.clearNodes()}))},function(){return t.deleteSelection()},function(){return t.joinBackward()},function(){return t.selectNodeBackward()}]}))},n=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.deleteSelection()},function(){return t.joinForward()},function(){return t.selectNodeForward()}]}))},r={Enter:function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.newlineInCode()},function(){return t.createParagraphNear()},function(){return t.liftEmptyBlock()},function(){return t.splitBlock()}]}))},"Mod-Enter":function(){return e.editor.commands.exitCode()},Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":function(){return e.editor.commands.selectAll()}},o=i({},r),a=i(i({},r),{},{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":function(){return e.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return e.editor.commands.selectTextblockEnd()}});return ku()||Du()?a:o},addProseMirrorPlugins:function(){var e=this;return[new Fr({key:new Br("clearDocument"),appendTransaction:function(t,n,r){if(t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc)){var o=n.selection,i=o.empty,a=o.from,s=o.to,u=hr.atStart(n.doc).from,l=hr.atEnd(n.doc).to,c=a===u&&s===l,f=0===r.doc.textBetween(0,r.doc.content.size," "," ").length;if(!i&&c&&f){var d=r.tr,p=Bs({state:r,transaction:d});if(new Ls({editor:e.editor,state:p}).commands.clearNodes(),d.steps.length)return d}}}})]}}),$u=su.create({name:"tabindex",addProseMirrorPlugins:function(){return[new Fr({key:new Br("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Hu=Object.freeze({__proto__:null,ClipboardTextSerializer:cu,Commands:Iu,Editable:zu,FocusEvents:_u,Keymap:Vu,Tabindex:$u});function Uu(e,t){var n=Cu("string"===typeof t?t:t.name,e.schema);return"node"===n?function(e,t){var n=$s(t,e.schema),r=e.selection,o=r.from,a=r.to,s=[];e.doc.nodesBetween(o,a,(function(e){s.push(e)}));var u=s.reverse().find((function(e){return e.type.name===n.name}));return u?i({},u.attrs):{}}(e,t):"mark"===n?Au(e,t):{}}function Wu(e,t){var n=En.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function qu(e,t){return uu(e,{from:0,to:e.content.size},t)}var Ku=function(e){x(n,e);var t=S(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return y(this,n),(e=t.call(this)).isFocused=!1,e.extensionStorage={},e.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:function(){return null},onCreate:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null}},e.isCapturingTransaction=!1,e.capturedTransaction=null,e.setOptions(r),e.createExtensionManager(),e.createCommandManager(),e.createSchema(),e.on("beforeCreate",e.options.onBeforeCreate),e.emit("beforeCreate",{editor:C(e)}),e.createView(),e.injectCSS(),e.on("create",e.options.onCreate),e.on("update",e.options.onUpdate),e.on("selectionUpdate",e.options.onSelectionUpdate),e.on("transaction",e.options.onTransaction),e.on("focus",e.options.onFocus),e.on("blur",e.options.onBlur),e.on("destroy",e.options.onDestroy),window.setTimeout((function(){e.isDestroyed||(e.commands.focus(e.options.autofocus),e.emit("create",{editor:C(e)}))}),0),e}return k(n,[{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&document&&(this.css=function(e,t){var n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=i(i({},this.options),e),this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(e){this.setOptions({editable:e})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"state",get:function(){return this.view.state}},{key:"registerPlugin",value:function(e,t){var n=Ws(t)?t(e,P(this.state.plugins)):[].concat(P(this.state.plugins),[e]),r=this.state.reconfigure({plugins:n});this.view.updateState(r)}},{key:"unregisterPlugin",value:function(e){if(!this.isDestroyed){var t="string"===typeof e?"".concat(e,"$"):e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((function(e){return!e.key.startsWith(t)}))});this.view.updateState(n)}}},{key:"createExtensionManager",value:function(){var e=this.options.enableCoreExtensions?Object.values(Hu):[],t=[].concat(P(e),P(this.options.extensions)).filter((function(e){return["extension","node","mark"].includes(null===e||void 0===e?void 0:e.type)}));this.extensionManager=new ou(t,this)}},{key:"createCommandManager",value:function(){this.commandManager=new Ls({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var e=Su(this.options.content,this.schema,this.options.parseOptions),t=bu(e,this.options.autofocus);this.view=new za(this.options.element,i(i({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:Mr.create({doc:e,selection:t||void 0})}));var n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.view.dom.editor=this}},{key:"createNodeViews",value:function(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}},{key:"captureTransaction",value:function(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;var t=this.capturedTransaction;return this.capturedTransaction=null,t}},{key:"dispatchTransaction",value:function(e){var t=this;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((function(e){var n;return null===(n=t.capturedTransaction)||void 0===n?void 0:n.step(e)})):void(this.capturedTransaction=e);var n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});var o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}},{key:"getAttributes",value:function(e){return Uu(this.state,e)}},{key:"isActive",value:function(e,t){var n="string"===typeof e?e:null,r="string"===typeof e?t:e;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return Eu(e,null,n)||Bu(e,null,n);var r=Cu(t,e.schema);return"node"===r?Eu(e,t,n):"mark"===r&&Bu(e,t,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Wu(this.state.doc.content,this.schema)}},{key:"getText",value:function(e){var t=e||{},n=t.blockSeparator,r=void 0===n?"\n\n":n,o=t.textSerializers,a=void 0===o?{}:o;return qu(this.state.doc,{blockSeparator:r,textSerializers:i(i({},a),lu(this.schema))})}},{key:"isEmpty",get:function(){return function(e){var t,n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}},{key:"getCharacterCount",value:function(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}},{key:"destroy",value:function(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}},{key:"isDestroyed",get:function(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}]),n}(Is);function Ju(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter((function(e){var r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter((function(e,n){return!t.filter((function(e,t){return t!==n})).some((function(t){return e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to}))}))}function Qu(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach((function(t){var o=hu(n.resolve(e-1),t.type);o&&r.push(i({mark:t},o))})):n.nodesBetween(e,t,(function(e,t){r.push.apply(r,P(e.marks.map((function(n){return{from:t,to:t+e.nodeSize,mark:n}}))))})),r}function Gu(e,t,n){var r=e.state.doc.content.size,o=yu(t,0,r),a=yu(n,0,r),s=e.coordsAtPos(o),u=e.coordsAtPos(a,-1),l=Math.min(s.top,u.top),c=Math.max(s.bottom,u.bottom),f=Math.min(s.left,u.left),d=Math.max(s.right,u.right),p={top:l,bottom:c,left:f,right:d,width:d-f,height:c-l,x:f,y:l};return i(i({},p),{},{toJSON:function(){return p}})}var Yu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,e),this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=i(i({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=qs(zs(this,"addOptions",{name:this.name}))),this.storage=qs(zs(this,"addStorage",{name:this.name,options:this.options}))||{}}return k(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=au(this.options,e),t.storage=qs(zs(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=qs(zs(n,"addOptions",{name:n.name})),n.storage=qs(zs(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}(),Xu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,e),this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=i(i({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=qs(zs(this,"addOptions",{name:this.name}))),this.storage=qs(zs(this,"addStorage",{name:this.name,options:this.options}))||{}}return k(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=au(this.options,e),t.storage=qs(zs(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=qs(zs(n,"addOptions",{name:n.name})),n.storage=qs(zs(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function Zu(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function el(e){return e instanceof Zu(e).Element||e instanceof Element}function tl(e){return e instanceof Zu(e).HTMLElement||e instanceof HTMLElement}function nl(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Zu(e).ShadowRoot||e instanceof ShadowRoot)}var rl=Math.max,ol=Math.min,il=Math.round;function al(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(tl(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(r=il(n.width)/a||1),i>0&&(o=il(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function sl(e){var t=Zu(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ul(e){return e?(e.nodeName||"").toLowerCase():null}function ll(e){return((el(e)?e.ownerDocument:e.document)||window.document).documentElement}function cl(e){return al(ll(e)).left+sl(e).scrollLeft}function fl(e){return Zu(e).getComputedStyle(e)}function dl(e){var t=fl(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function pl(e,t,n){void 0===n&&(n=!1);var r=tl(t),o=tl(t)&&function(e){var t=e.getBoundingClientRect(),n=il(t.width)/e.offsetWidth||1,r=il(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=ll(t),a=al(e,o),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==ul(t)||dl(i))&&(s=function(e){return e!==Zu(e)&&tl(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:sl(e);var t}(t)),tl(t)?((u=al(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=cl(i))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function hl(e){var t=al(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function ml(e){return"html"===ul(e)?e:e.assignedSlot||e.parentNode||(nl(e)?e.host:null)||ll(e)}function vl(e){return["html","body","#document"].indexOf(ul(e))>=0?e.ownerDocument.body:tl(e)&&dl(e)?e:vl(ml(e))}function gl(e,t){var n;void 0===t&&(t=[]);var r=vl(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Zu(r),a=o?[i].concat(i.visualViewport||[],dl(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(gl(ml(a)))}function yl(e){return["table","td","th"].indexOf(ul(e))>=0}function bl(e){return tl(e)&&"fixed"!==fl(e).position?e.offsetParent:null}function kl(e){for(var t=Zu(e),n=bl(e);n&&yl(n)&&"static"===fl(n).position;)n=bl(n);return n&&("html"===ul(n)||"body"===ul(n)&&"static"===fl(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&tl(e)&&"fixed"===fl(e).position)return null;var n=ml(e);for(nl(n)&&(n=n.host);tl(n)&&["html","body"].indexOf(ul(n))<0;){var r=fl(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var wl="top",xl="bottom",Dl="right",El="left",Cl="auto",Ol=[wl,xl,Dl,El],Sl="start",Al="end",jl="viewport",Nl="popper",Ml=Ol.reduce((function(e,t){return e.concat([t+"-"+Sl,t+"-"+Al])}),[]),Tl=[].concat(Ol,[Cl]).reduce((function(e,t){return e.concat([t,t+"-"+Sl,t+"-"+Al])}),[]),Fl=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Pl(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function Rl(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var Bl={placement:"bottom",modifiers:[],strategy:"absolute"};function Ll(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"===typeof e.getBoundingClientRect)}))}function Il(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Bl:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Bl,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,u={state:o,setOptions:function(n){var s="function"===typeof n?n(o.options):n;l(),o.options=Object.assign({},i,o.options,s),o.scrollParents={reference:el(e)?gl(e):e.contextElement?gl(e.contextElement):[],popper:gl(t)};var c=function(e){var t=Pl(e);return Fl.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(r,o.options.modifiers)));return o.orderedModifiers=c.filter((function(e){return e.enabled})),o.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"===typeof i){var s=i({state:o,name:t,instance:u,options:r}),l=function(){};a.push(s||l)}})),u.update()},forceUpdate:function(){if(!s){var e=o.elements,t=e.reference,n=e.popper;if(Ll(t,n)){o.rects={reference:pl(t,kl(n),"fixed"===o.options.strategy),popper:hl(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach((function(e){return o.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var i=o.orderedModifiers[r],a=i.fn,l=i.options,c=void 0===l?{}:l,f=i.name;"function"===typeof a&&(o=a({state:o,options:c,name:f,instance:u})||o)}else o.reset=!1,r=-1}}},update:Rl((function(){return new Promise((function(e){u.forceUpdate(),e(o)}))})),destroy:function(){l(),s=!0}};if(!Ll(e,t))return u;function l(){a.forEach((function(e){return e()})),a=[]}return u.setOptions(n).then((function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var zl={passive:!0};function _l(e){return e.split("-")[0]}function Vl(e){return e.split("-")[1]}function $l(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Hl(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?_l(o):null,a=o?Vl(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case wl:t={x:s,y:n.y-r.height};break;case xl:t={x:s,y:n.y+n.height};break;case Dl:t={x:n.x+n.width,y:u};break;case El:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var l=i?$l(i):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case Sl:t[l]=t[l]-(n[c]/2-r[c]/2);break;case Al:t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}var Ul={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wl(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,l=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,p=void 0===d?0:d,h=a.y,m=void 0===h?0:h,v="function"===typeof c?c({x:p,y:m}):{x:p,y:m};p=v.x,m=v.y;var g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=El,k=wl,w=window;if(l){var x=kl(n),D="clientHeight",E="clientWidth";if(x===Zu(n)&&"static"!==fl(x=ll(n)).position&&"absolute"===s&&(D="scrollHeight",E="scrollWidth"),o===wl||(o===El||o===Dl)&&i===Al)k=xl,m-=(f&&x===w&&w.visualViewport?w.visualViewport.height:x[D])-r.height,m*=u?1:-1;if(o===El||(o===wl||o===xl)&&i===Al)b=Dl,p-=(f&&x===w&&w.visualViewport?w.visualViewport.width:x[E])-r.width,p*=u?1:-1}var C,O=Object.assign({position:s},l&&Ul),S=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:il(t*r)/r||0,y:il(n*r)/r||0}}({x:p,y:m}):{x:p,y:m};return p=S.x,m=S.y,u?Object.assign({},O,((C={})[k]=y?"0":"",C[b]=g?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",C)):Object.assign({},O,((t={})[k]=y?m+"px":"",t[b]=g?p+"px":"",t.transform="",t))}var ql={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];tl(o)&&ul(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});tl(r)&&ul(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Kl={left:"right",right:"left",bottom:"top",top:"bottom"};function Jl(e){return e.replace(/left|right|bottom|top/g,(function(e){return Kl[e]}))}var Ql={start:"end",end:"start"};function Gl(e){return e.replace(/start|end/g,(function(e){return Ql[e]}))}function Yl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&nl(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xl(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Zl(e,t){return t===jl?Xl(function(e){var t=Zu(e),n=ll(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+cl(e),y:s}}(e)):el(t)?function(e){var t=al(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):Xl(function(e){var t,n=ll(e),r=sl(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=rl(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=rl(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+cl(e),u=-r.scrollTop;return"rtl"===fl(o||n).direction&&(s+=rl(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(ll(e)))}function ec(e,t,n){var r="clippingParents"===t?function(e){var t=gl(ml(e)),n=["absolute","fixed"].indexOf(fl(e).position)>=0&&tl(e)?kl(e):e;return el(n)?t.filter((function(e){return el(e)&&Yl(e,n)&&"body"!==ul(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=Zl(e,n);return t.top=rl(r.top,t.top),t.right=ol(r.right,t.right),t.bottom=ol(r.bottom,t.bottom),t.left=rl(r.left,t.left),t}),Zl(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function tc(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function nc(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function rc(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,a=void 0===i?"clippingParents":i,s=n.rootBoundary,u=void 0===s?jl:s,l=n.elementContext,c=void 0===l?Nl:l,f=n.altBoundary,d=void 0!==f&&f,p=n.padding,h=void 0===p?0:p,m=tc("number"!==typeof h?h:nc(h,Ol)),v=c===Nl?"reference":Nl,g=e.rects.popper,y=e.elements[d?v:c],b=ec(el(y)?y:y.contextElement||ll(e.elements.popper),a,u),k=al(e.elements.reference),w=Hl({reference:k,element:g,strategy:"absolute",placement:o}),x=Xl(Object.assign({},g,w)),D=c===Nl?x:k,E={top:b.top-D.top+m.top,bottom:D.bottom-b.bottom+m.bottom,left:b.left-D.left+m.left,right:D.right-b.right+m.right},C=e.modifiersData.offset;if(c===Nl&&C){var O=C[o];Object.keys(E).forEach((function(e){var t=[Dl,xl].indexOf(e)>=0?1:-1,n=[wl,xl].indexOf(e)>=0?"y":"x";E[e]+=O[n]*t}))}return E}function oc(e,t,n){return rl(e,ol(t,n))}function ic(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ac(e){return[wl,Dl,xl,El].some((function(t){return e[t]>=0}))}var sc=Il({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,u=Zu(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach((function(e){e.addEventListener("scroll",n.update,zl)})),s&&u.addEventListener("resize",n.update,zl),function(){i&&l.forEach((function(e){e.removeEventListener("scroll",n.update,zl)})),s&&u.removeEventListener("resize",n.update,zl)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Hl({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,u=void 0===s||s,l={placement:_l(t.placement),variation:Vl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Wl(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Wl(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ql,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=Tl.reduce((function(e,n){return e[n]=function(e,t,n){var r=_l(e),o=[El,wl].indexOf(r)>=0?-1:1,i="function"===typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[El,Dl].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],u=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,l=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,m=n.allowedAutoPlacements,v=t.options.placement,g=_l(v),y=u||(g===v||!h?[Jl(v)]:function(e){if(_l(e)===Cl)return[];var t=Jl(e);return[Gl(e),t,Gl(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(_l(n)===Cl?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,l=void 0===u?Tl:u,c=Vl(r),f=c?s?Ml:Ml.filter((function(e){return Vl(e)===c})):Ol,d=f.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=f);var p=d.reduce((function(t,n){return t[n]=rc(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[_l(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:c,rootBoundary:f,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),k=t.rects.reference,w=t.rects.popper,x=new Map,D=!0,E=b[0],C=0;C<b.length;C++){var O=b[C],S=_l(O),A=Vl(O)===Sl,j=[wl,xl].indexOf(S)>=0,N=j?"width":"height",M=rc(t,{placement:O,boundary:c,rootBoundary:f,altBoundary:d,padding:l}),T=j?A?Dl:El:A?xl:wl;k[N]>w[N]&&(T=Jl(T));var F=Jl(T),P=[];if(i&&P.push(M[S]<=0),s&&P.push(M[T]<=0,M[F]<=0),P.every((function(e){return e}))){E=O,D=!1;break}x.set(O,P)}if(D)for(var R=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},B=h?3:1;B>0;B--){if("break"===R(B))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,l=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,p=void 0===d||d,h=n.tetherOffset,m=void 0===h?0:h,v=rc(t,{boundary:u,rootBoundary:l,padding:f,altBoundary:c}),g=_l(t.placement),y=Vl(t.placement),b=!y,k=$l(g),w="x"===k?"y":"x",x=t.modifiersData.popperOffsets,D=t.rects.reference,E=t.rects.popper,C="function"===typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,O="number"===typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(x){if(i){var j,N="y"===k?wl:El,M="y"===k?xl:Dl,T="y"===k?"height":"width",F=x[k],P=F+v[N],R=F-v[M],B=p?-E[T]/2:0,L=y===Sl?D[T]:E[T],I=y===Sl?-E[T]:-D[T],z=t.elements.arrow,_=p&&z?hl(z):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=V[N],H=V[M],U=oc(0,D[T],_[T]),W=b?D[T]/2-B-U-$-O.mainAxis:L-U-$-O.mainAxis,q=b?-D[T]/2+B+U+H+O.mainAxis:I+U+H+O.mainAxis,K=t.elements.arrow&&kl(t.elements.arrow),J=K?"y"===k?K.clientTop||0:K.clientLeft||0:0,Q=null!=(j=null==S?void 0:S[k])?j:0,G=F+q-Q,Y=oc(p?ol(P,F+W-Q-J):P,F,p?rl(R,G):R);x[k]=Y,A[k]=Y-F}if(s){var X,Z="x"===k?wl:El,ee="x"===k?xl:Dl,te=x[w],ne="y"===w?"height":"width",re=te+v[Z],oe=te-v[ee],ie=-1!==[wl,El].indexOf(g),ae=null!=(X=null==S?void 0:S[w])?X:0,se=ie?re:te-D[ne]-E[ne]-ae+O.altAxis,ue=ie?te+D[ne]+E[ne]-ae-O.altAxis:oe,le=p&&ie?function(e,t,n){var r=oc(e,t,n);return r>n?n:r}(se,te,ue):oc(p?se:re,te,p?ue:oe);x[w]=le,A[w]=le-te}t.modifiersData[r]=A}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=_l(n.placement),u=$l(s),l=[El,Dl].indexOf(s)>=0?"height":"width";if(i&&a){var c=function(e,t){return tc("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:nc(e,Ol))}(o.padding,n),f=hl(i),d="y"===u?wl:El,p="y"===u?xl:Dl,h=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],m=a[u]-n.rects.reference[u],v=kl(i),g=v?"y"===u?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=c[d],k=g-f[l]-c[p],w=g/2-f[l]/2+y,x=oc(b,w,k),D=u;n.modifiersData[r]=((t={})[D]=x,t.centerOffset=x-w,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!==typeof r||(r=t.elements.popper.querySelector(r)))&&Yl(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=rc(t,{elementContext:"reference"}),s=rc(t,{altBoundary:!0}),u=ic(a,r),l=ic(s,o,i),c=ac(u),f=ac(l);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}}]}),uc="tippy-content",lc="tippy-backdrop",cc="tippy-arrow",fc="tippy-svg-arrow",dc={passive:!0,capture:!0},pc=function(){return document.body};function hc(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function mc(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function vc(e,t){return"function"===typeof e?e.apply(void 0,t):e}function gc(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function yc(e){return[].concat(e)}function bc(e,t){-1===e.indexOf(t)&&e.push(t)}function kc(e){return e.split("-")[0]}function wc(e){return[].slice.call(e)}function xc(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Dc(){return document.createElement("div")}function Ec(e){return["Element","Fragment"].some((function(t){return mc(e,t)}))}function Cc(e){return mc(e,"MouseEvent")}function Oc(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Sc(e){return Ec(e)?[e]:function(e){return mc(e,"NodeList")}(e)?wc(e):Array.isArray(e)?e:wc(document.querySelectorAll(e))}function Ac(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function jc(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Nc(e){var t,n=yc(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function Mc(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Tc(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var Fc={isTouch:!1},Pc=0;function Rc(){Fc.isTouch||(Fc.isTouch=!0,window.performance&&document.addEventListener("mousemove",Bc))}function Bc(){var e=performance.now();e-Pc<20&&(Fc.isTouch=!1,document.removeEventListener("mousemove",Bc)),Pc=e}function Lc(){var e=document.activeElement;if(Oc(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ic=!!("undefined"!==typeof window&&"undefined"!==typeof document)&&!!window.msCrypto;var zc={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},_c=Object.assign({appendTo:pc,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},zc,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Vc=Object.keys(_c);function $c(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,i=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=_c[o])?r:i);return t}),{});return Object.assign({},e,t)}function Hc(e,t){var n=Object.assign({},t,{content:vc(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys($c(Object.assign({},_c,{plugins:t}))):Vc).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(se){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},_c.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Uc(e,t){e.innerHTML=t}function Wc(e){var t=Dc();return!0===e?t.className=cc:(t.className=fc,Ec(e)?t.appendChild(e):Uc(t,e)),t}function qc(e,t){Ec(t.content)?(Uc(e,""),e.appendChild(t.content)):"function"!==typeof t.content&&(t.allowHTML?Uc(e,t.content):e.textContent=t.content)}function Kc(e){var t=e.firstElementChild,n=wc(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(uc)})),arrow:n.find((function(e){return e.classList.contains(cc)||e.classList.contains(fc)})),backdrop:n.find((function(e){return e.classList.contains(lc)}))}}function Jc(e){var t=Dc(),n=Dc();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Dc();function o(n,r){var o=Kc(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"===typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"===typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||qc(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(Wc(r.arrow))):i.appendChild(Wc(r.arrow)):s&&i.removeChild(s)}return r.className=uc,r.setAttribute("data-state","hidden"),qc(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Jc.$$tippy=!0;var Qc=1,Gc=[],Yc=[];function Xc(e,t){var n,r,o,i,a,s,u,l,c=Hc(e,Object.assign({},_c,$c(xc(t)))),f=!1,d=!1,p=!1,h=!1,m=[],v=gc(K,c.interactiveDebounce),g=Qc++,y=(l=c.plugins).filter((function(e,t){return l.indexOf(e)===t})),b={id:g,reference:e,popper:Dc(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;F("onBeforeUpdate",[b,t]),W();var n=b.props,r=Hc(e,Object.assign({},n,xc(t),{ignoreAttributes:!0}));b.props=r,U(),n.interactiveDebounce!==r.interactiveDebounce&&(B(),v=gc(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?yc(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");R(),T(),x&&x(n,r);b.popperInstance&&(Y(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));F("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=Fc.isTouch&&!b.props.touch,o=hc(b.props.duration,0,_c.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(F("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,S()&&(w.style.visibility="visible");T(),_(),b.state.isMounted||(w.style.transition="none");if(S()){var i=N(),a=i.box,u=i.content;Ac([a,u],0)}s=function(){var e;if(b.state.isVisible&&!h){if(h=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,S()&&b.props.animation){var t=N(),n=t.box,r=t.content;Ac([n,r],o),jc([n,r],"visible")}P(),R(),bc(Yc,b),null==(e=b.popperInstance)||e.forceUpdate(),F("onMount",[b]),b.props.animation&&S()&&function(e,t){$(e,t)}(o,(function(){b.state.isShown=!0,F("onShown",[b])}))}},function(){var e,t=b.props.appendTo,n=A();e=b.props.interactive&&t===pc||"parent"===t?n.parentNode:vc(t,[n]);e.contains(w)||e.appendChild(w);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=hc(b.props.duration,1,_c.duration);if(e||t||n)return;if(F("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,h=!1,f=!1,S()&&(w.style.visibility="hidden");if(B(),V(),T(!0),S()){var o=N(),i=o.box,a=o.content;b.props.animation&&(Ac([i,a],r),jc([i,a],"hidden"))}P(),R(),b.props.animation?S()&&function(e,t){$(e,(function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&t()}))}(r,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;j().addEventListener("mousemove",v),bc(Gc,v),v(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;X(),Z().forEach((function(e){e._tippy.unmount()})),w.parentNode&&w.parentNode.removeChild(w);Yc=Yc.filter((function(e){return e!==b})),b.state.isMounted=!1,F("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),W(),delete e._tippy,b.state.isDestroyed=!0,F("onDestroy",[b])}};if(!c.render)return b;var k=c.render(b),w=k.popper,x=k.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,e._tippy=b,w._tippy=b;var D=y.map((function(e){return e.fn(b)})),E=e.hasAttribute("aria-expanded");return U(),R(),T(),F("onCreate",[b]),c.showOnCreate&&ee(),w.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),w.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&j().addEventListener("mousemove",v)})),b;function C(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function O(){return"hold"===C()[0]}function S(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function A(){return u||e}function j(){var e=A().parentNode;return e?Nc(e):document}function N(){return Kc(w)}function M(e){return b.state.isMounted&&!b.state.isVisible||Fc.isTouch||i&&"focus"===i.type?0:hc(b.props.delay,e?0:1,_c.delay)}function T(e){void 0===e&&(e=!1),w.style.pointerEvents=b.props.interactive&&!e?"":"none",w.style.zIndex=""+b.props.zIndex}function F(e,t,n){var r;(void 0===n&&(n=!0),D.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=b.props)[e].apply(r,t)}function P(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;yc(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function R(){!E&&b.props.aria.expanded&&yc(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function B(){j().removeEventListener("mousemove",v),Gc=Gc.filter((function(e){return e!==v}))}function L(t){if(!Fc.isTouch||!p&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Tc(w,n)){if(yc(b.props.triggerTarget||e).some((function(e){return Tc(e,n)}))){if(Fc.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else F("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout((function(){d=!1})),b.state.isMounted||V())}}}function I(){p=!0}function z(){p=!1}function _(){var e=j();e.addEventListener("mousedown",L,!0),e.addEventListener("touchend",L,dc),e.addEventListener("touchstart",z,dc),e.addEventListener("touchmove",I,dc)}function V(){var e=j();e.removeEventListener("mousedown",L,!0),e.removeEventListener("touchend",L,dc),e.removeEventListener("touchstart",z,dc),e.removeEventListener("touchmove",I,dc)}function $(e,t){var n=N().box;function r(e){e.target===n&&(Mc(n,"remove",r),t())}if(0===e)return t();Mc(n,"remove",a),Mc(n,"add",r),a=r}function H(t,n,r){void 0===r&&(r=!1),yc(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),m.push({node:e,eventType:t,handler:n,options:r})}))}function U(){var e;O()&&(H("touchstart",q,{passive:!0}),H("touchend",J,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",J);break;case"focus":H(Ic?"focusout":"blur",Q);break;case"focusin":H("focusout",Q)}}))}function W(){m.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),m=[]}function q(e){var t,n=!1;if(b.state.isEnabled&&!G(e)&&!d){var r="focus"===(null==(t=i)?void 0:t.type);i=e,u=e.currentTarget,R(),!b.state.isVisible&&Cc(e)&&Gc.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||f)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(f=!n),n&&!r&&te(e)}}function K(e){var t=e.target,n=A().contains(t)||w.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(w).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:c}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=kc(o.placement),s=o.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,c="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=t.top-r+u>i,p=r-t.bottom-l>i,h=t.left-n+c>i,m=n-t.right-f>i;return d||p||h||m}))})(r,e)&&(B(),te(e))}}function J(e){G(e)||b.props.trigger.indexOf("click")>=0&&f||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function Q(e){b.props.trigger.indexOf("focusin")<0&&e.target!==A()||b.props.interactive&&e.relatedTarget&&w.contains(e.relatedTarget)||te(e)}function G(e){return!!Fc.isTouch&&O()!==e.type.indexOf("touch")>=0}function Y(){X();var t=b.props,n=t.popperOptions,r=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,u=S()?Kc(w).arrow:null,l=i?{getBoundingClientRect:i,contextElement:i.contextElement||A()}:e,c={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var n=N().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},f=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},c];S()&&u&&f.push({name:"arrow",options:{element:u,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),b.popperInstance=sc(l,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function X(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return wc(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&F("onTrigger",[b,e]),_();var t=M(!0),r=C(),o=r[0],i=r[1];Fc.isTouch&&"hold"===o&&i&&(t=i),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),F("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&f)){var t=M(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):o=requestAnimationFrame((function(){b.hide()}))}}else V()}}function Zc(e,t){void 0===t&&(t={});var n=_c.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Rc,dc),window.addEventListener("blur",Lc);var r=Object.assign({},t,{plugins:n}),o=Sc(e).reduce((function(e,t){var n=t&&Xc(t,r);return n&&e.push(n),e}),[]);return Ec(e)?o[0]:o}Zc.defaultProps=_c,Zc.setDefaultProps=function(e){Object.keys(e).forEach((function(t){_c[t]=e[t]}))},Zc.currentInput=Fc;Object.assign({},ql,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Zc.setDefaultProps({render:Jc});var ef=Zc,tf=function(){function e(t){var n=this,r=t.editor,o=t.element,i=t.view,a=t.tippyOptions,s=void 0===a?{}:a,u=t.shouldShow;y(this,e),this.preventHide=!1,this.shouldShow=function(e){var t=e.view,n=e.state,r=e.from,o=e.to,i=n.doc,a=n.selection.empty,s=!i.textBetween(r,o).length&&gu(n.selection);return!(!t.hasFocus()||a||s)},this.mousedownHandler=function(){n.preventHide=!0},this.dragstartHandler=function(){n.hide()},this.focusHandler=function(){setTimeout((function(){return n.update(n.editor.view)}))},this.blurHandler=function(e){var t,r=e.event;n.preventHide?n.preventHide=!1:(null===r||void 0===r?void 0:r.relatedTarget)&&(null===(t=n.element.parentNode)||void 0===t?void 0:t.contains(r.relatedTarget))||n.hide()},this.editor=r,this.element=o,this.view=i,u&&(this.shouldShow=u),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=s,this.element.remove(),this.element.style.visibility="visible"}return k(e,[{key:"createTooltip",value:function(){var e=this,t=this.editor.options.element,n=!!t.parentElement;!this.tippy&&n&&(this.tippy=ef(t,i({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},this.tippyOptions)),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(function(t){e.blurHandler({event:t})})))}},{key:"update",value:function(e,t){var n,r,o,i=e.state,a=e.composing,s=i.doc,u=i.selection,l=t&&t.doc.eq(s)&&t.selection.eq(u);if(!a&&!l){this.createTooltip();var c=u.ranges,f=Math.min.apply(Math,P(c.map((function(e){return e.$from.pos})))),d=Math.max.apply(Math,P(c.map((function(e){return e.$to.pos}))));(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:t,from:f,to:d}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||function(){if(vu(n=i.selection)&&n instanceof kr){var t=e.nodeDOM(f);if(t)return t.getBoundingClientRect()}var n;return Gu(e,f,d)}}),this.show()):this.hide()}}},{key:"show",value:function(){var e;null===(e=this.tippy)||void 0===e||e.show()}},{key:"hide",value:function(){var e;null===(e=this.tippy)||void 0===e||e.hide()}},{key:"destroy",value:function(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}]),e}(),nf=function(e){return new Fr({key:"string"===typeof e.pluginKey?new Br(e.pluginKey):e.pluginKey,view:function(t){return new tf(i({view:t},e))}})},rf=(su.create({name:"bubbleMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[nf({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),function(){function e(t){var n=this,r=t.editor,o=t.element,i=t.view,a=t.tippyOptions,s=void 0===a?{}:a,u=t.shouldShow;y(this,e),this.preventHide=!1,this.shouldShow=function(e){var t=e.view,n=e.state.selection,r=n.$anchor,o=n.empty,i=1===r.depth,a=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent;return!!(t.hasFocus()&&o&&i&&a)},this.mousedownHandler=function(){n.preventHide=!0},this.focusHandler=function(){setTimeout((function(){return n.update(n.editor.view)}))},this.blurHandler=function(e){var t,r=e.event;n.preventHide?n.preventHide=!1:(null===r||void 0===r?void 0:r.relatedTarget)&&(null===(t=n.element.parentNode)||void 0===t?void 0:t.contains(r.relatedTarget))||n.hide()},this.editor=r,this.element=o,this.view=i,u&&(this.shouldShow=u),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=s,this.element.remove(),this.element.style.visibility="visible"}return k(e,[{key:"createTooltip",value:function(){var e=this,t=this.editor.options.element,n=!!t.parentElement;!this.tippy&&n&&(this.tippy=ef(t,i({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},this.tippyOptions)),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",(function(t){e.blurHandler({event:t})})))}},{key:"update",value:function(e,t){var n,r,o,i=e.state,a=i.doc,s=i.selection,u=s.from,l=s.to;t&&t.doc.eq(a)&&t.selection.eq(s)||(this.createTooltip(),(null===(n=this.shouldShow)||void 0===n?void 0:n.call(this,{editor:this.editor,view:e,state:i,oldState:t}))?(null===(r=this.tippy)||void 0===r||r.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||function(){return Gu(e,u,l)}}),this.show()):this.hide())}},{key:"show",value:function(){var e;null===(e=this.tippy)||void 0===e||e.show()}},{key:"hide",value:function(){var e;null===(e=this.tippy)||void 0===e||e.hide()}},{key:"destroy",value:function(){var e;null===(e=this.tippy)||void 0===e||e.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}]),e}()),of=function(e){return new Fr({key:"string"===typeof e.pluginKey?new Br(e.pluginKey):e.pluginKey,view:function(t){return new rf(i({view:t},e))}})},af=(su.create({name:"floatingMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[of({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),["editor"]),sf=function(e){x(n,e);var t=S(n);function n(){var e;return y(this,n),(e=t.apply(this,arguments)).contentComponent=null,e}return k(n)}(Ku),uf=function(e){var t=e.renderers;return u.a.createElement(u.a.Fragment,null,Array.from(t).map((function(e){var t=p(e,2),n=t[0],r=t[1];return c.a.createPortal(r.reactElement,r.element,n)})))},lf=function(e){x(n,e);var t=S(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).editorContentRef=u.a.createRef(),r.state={renderers:new Map},r}return k(n,[{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(){this.init()}},{key:"init",value:function(){var e=this.props.editor;if(e&&e.options.element){if(e.contentComponent)return;var t=this.editorContentRef.current;t.append.apply(t,P(e.options.element.childNodes)),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews()}}},{key:"componentWillUnmount",value:function(){var e=this.props.editor;if(e&&(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,e.options.element.firstChild)){var t=document.createElement("div");t.append.apply(t,P(e.options.element.childNodes)),e.setOptions({element:t})}}},{key:"render",value:function(){var e=this.props,t=(e.editor,a(e,af));return u.a.createElement(u.a.Fragment,null,u.a.createElement("div",i({ref:this.editorContentRef},t)),u.a.createElement(uf,{renderers:this.state.renderers}))}}]),n}(u.a.Component),cf=u.a.memo(lf),ff=Object(s.createContext)({onDragStart:void 0}),df=function(){return Object(s.useContext)(ff)};u.a.forwardRef((function(e,t){var n=df().onDragStart,r=e.as||"div";return u.a.createElement(r,i(i({},e),{},{ref:t,"data-node-view-wrapper":"",onDragStart:n,style:i({whiteSpace:"normal"},e.style)}))}));function pf(){var e=p(Object(s.useState)(0),2)[1];return function(){return e((function(e){return e+1}))}}var hf=su.create({name:"placeholder",addOptions:function(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new Fr({props:{decorations:function(t){var n=t.doc,r=t.selection,o=e.editor.isEditable||!e.options.showOnlyWhenEditable,i=r.anchor,a=[];return o?(n.descendants((function(t,n){var r=i>=n&&i<=n+t.nodeSize,o=!t.isLeaf&&!t.childCount;if((r||!e.options.showOnlyCurrent)&&o){var s=[e.options.emptyNodeClass];e.editor.isEmpty&&s.push(e.options.emptyEditorClass);var u=va.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"===typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n,hasAnchor:r}):e.options.placeholder});a.push(u)}return e.options.includeChildren})),ba.create(n,a)):null}}})]}}),mf=Xu.create({name:"text",group:"inline"});function vf(e){this.j={},this.jr=[],this.jd=null,this.t=e}vf.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=gf();var o=wf(this,e);return o?(Object.assign(r.j,o.j),r.jr.append(o.jr),r.jr=o.jd,r.t=n||o.t):r.t=n,this.j[e]=r,r}};var gf=function(){return new vf},yf=function(e){return new vf(e)},bf=function(e,t,n){e.j[t]||(e.j[t]=n)},kf=function(e,t,n){e.jr.push([t,n])},wf=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var o=e.jr[r][0],i=e.jr[r][1];if(o.test(t))return i}return e.jd},xf=function(e,t,n){for(var r=0;r<t.length;r++)bf(e,t[r],n)},Df=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],o=t[n][1];bf(e,r,o)}},Ef=function(e,t,n,r){for(var o,i=0,a=t.length;i<a&&(o=e.j[t[i]]);)e=o,i++;if(i>=a)return[];for(;i<a-1;)o=r(),bf(e,t[i],o),e=o,i++;bf(e,t[a-1],n)},Cf="DOMAIN",Of="LOCALHOST",Sf="TLD",Af="NUM",jf="PROTOCOL",Nf="MAILTO",Mf="WS",Tf="NL",Ff="OPENBRACE",Pf="OPENBRACKET",Rf="OPENANGLEBRACKET",Bf="OPENPAREN",Lf="CLOSEBRACE",If="CLOSEBRACKET",zf="CLOSEANGLEBRACKET",_f="CLOSEPAREN",Vf="AMPERSAND",$f="APOSTROPHE",Hf="ASTERISK",Uf="AT",Wf="BACKSLASH",qf="BACKTICK",Kf="CARET",Jf="COLON",Qf="COMMA",Gf="DOLLAR",Yf="DOT",Xf="EQUALS",Zf="EXCLAMATION",ed="HYPHEN",td="PERCENT",nd="PIPE",rd="PLUS",od="POUND",id="QUERY",ad="QUOTE",sd="SEMI",ud="SLASH",ld="TILDE",cd="UNDERSCORE",fd="SYM",dd=Object.freeze({__proto__:null,DOMAIN:Cf,LOCALHOST:Of,TLD:Sf,NUM:Af,PROTOCOL:jf,MAILTO:Nf,WS:Mf,NL:Tf,OPENBRACE:Ff,OPENBRACKET:Pf,OPENANGLEBRACKET:Rf,OPENPAREN:Bf,CLOSEBRACE:Lf,CLOSEBRACKET:If,CLOSEANGLEBRACKET:zf,CLOSEPAREN:_f,AMPERSAND:Vf,APOSTROPHE:$f,ASTERISK:Hf,AT:Uf,BACKSLASH:Wf,BACKTICK:qf,CARET:Kf,COLON:Jf,COMMA:Qf,DOLLAR:Gf,DOT:Yf,EQUALS:Xf,EXCLAMATION:Zf,HYPHEN:ed,PERCENT:td,PIPE:nd,PLUS:rd,POUND:od,QUERY:id,QUOTE:ad,SEMI:sd,SLASH:ud,TILDE:ld,UNDERSCORE:cd,SYM:fd}),pd="aaa aarp abarth abb abbott abbvie abc able abogado abudhabi ac academy accenture accountant accountants aco actor ad adac ads adult ae aeg aero aetna af afamilycompany afl africa ag agakhan agency ai aig airbus airforce airtel akdn al alfaromeo alibaba alipay allfinanz allstate ally alsace alstom am amazon americanexpress americanfamily amex amfam amica amsterdam analytics android anquan anz ao aol apartments app apple aq aquarelle ar arab aramco archi army arpa art arte as asda asia associates at athleta attorney au auction audi audible audio auspost author auto autos avianca aw aws ax axa az azure ba baby baidu banamex bananarepublic band bank bar barcelona barclaycard barclays barefoot bargains baseball basketball bauhaus bayern bb bbc bbt bbva bcg bcn bd be beats beauty beer bentley berlin best bestbuy bet bf bg bh bharti bi bible bid bike bing bingo bio biz bj black blackfriday blockbuster blog bloomberg blue bm bms bmw bn bnpparibas bo boats boehringer bofa bom bond boo book booking bosch bostik boston bot boutique box br bradesco bridgestone broadway broker brother brussels bs bt budapest bugatti build builders business buy buzz bv bw by bz bzh ca cab cafe cal call calvinklein cam camera camp cancerresearch canon capetown capital capitalone car caravan cards care career careers cars casa case cash casino cat catering catholic cba cbn cbre cbs cc cd center ceo cern cf cfa cfd cg ch chanel channel charity chase chat cheap chintai christmas chrome church ci cipriani circle cisco citadel citi citic city cityeats ck cl claims cleaning click clinic clinique clothing cloud club clubmed cm cn co coach codes coffee college cologne com comcast commbank community company compare computer comsec condos construction consulting contact contractors cooking cookingchannel cool coop corsica country coupon coupons courses cpa cr credit creditcard creditunion cricket crown crs cruise cruises csc cu cuisinella cv cw cx cy cymru cyou cz dabur dad dance data date dating datsun day dclk dds de deal dealer deals degree delivery dell deloitte delta democrat dental dentist desi design dev dhl diamonds diet digital direct directory discount discover dish diy dj dk dm dnp do docs doctor dog domains dot download drive dtv dubai duck dunlop dupont durban dvag dvr dz earth eat ec eco edeka edu education ee eg email emerck energy engineer engineering enterprises epson equipment er ericsson erni es esq estate et etisalat eu eurovision eus events exchange expert exposed express extraspace fage fail fairwinds faith family fan fans farm farmers fashion fast fedex feedback ferrari ferrero fi fiat fidelity fido film final finance financial fire firestone firmdale fish fishing fit fitness fj fk flickr flights flir florist flowers fly fm fo foo food foodnetwork football ford forex forsale forum foundation fox fr free fresenius frl frogans frontdoor frontier ftr fujitsu fujixerox fun fund furniture futbol fyi ga gal gallery gallo gallup game games gap garden gay gb gbiz gd gdn ge gea gent genting george gf gg ggee gh gi gift gifts gives giving gl glade glass gle global globo gm gmail gmbh gmo gmx gn godaddy gold goldpoint golf goo goodyear goog google gop got gov gp gq gr grainger graphics gratis green gripe grocery group gs gt gu guardian gucci guge guide guitars guru gw gy hair hamburg hangout haus hbo hdfc hdfcbank health healthcare help helsinki here hermes hgtv hiphop hisamitsu hitachi hiv hk hkt hm hn hockey holdings holiday homedepot homegoods homes homesense honda horse hospital host hosting hot hoteles hotels hotmail house how hr hsbc ht hu hughes hyatt hyundai ibm icbc ice icu id ie ieee ifm ikano il im imamat imdb immo immobilien in inc industries infiniti info ing ink institute insurance insure int international intuit investments io ipiranga iq ir irish is ismaili ist istanbul it itau itv iveco jaguar java jcb je jeep jetzt jewelry jio jll jm jmp jnj jo jobs joburg jot joy jp jpmorgan jprs juegos juniper kaufen kddi ke kerryhotels kerrylogistics kerryproperties kfh kg kh ki kia kim kinder kindle kitchen kiwi km kn koeln komatsu kosher kp kpmg kpn kr krd kred kuokgroup kw ky kyoto kz la lacaixa lamborghini lamer lancaster lancia land landrover lanxess lasalle lat latino latrobe law lawyer lb lc lds lease leclerc lefrak legal lego lexus lgbt li lidl life lifeinsurance lifestyle lighting like lilly limited limo lincoln linde link lipsy live living lixil lk llc llp loan loans locker locus loft lol london lotte lotto love lpl lplfinancial lr ls lt ltd ltda lu lundbeck luxe luxury lv ly ma macys madrid maif maison makeup man management mango map market marketing markets marriott marshalls maserati mattel mba mc mckinsey md me med media meet melbourne meme memorial men menu merckmsd mg mh miami microsoft mil mini mint mit mitsubishi mk ml mlb mls mm mma mn mo mobi mobile moda moe moi mom monash money monster mormon mortgage moscow moto motorcycles mov movie mp mq mr ms msd mt mtn mtr mu museum mutual mv mw mx my mz na nab nagoya name nationwide natura navy nba nc ne nec net netbank netflix network neustar new news next nextdirect nexus nf nfl ng ngo nhk ni nico nike nikon ninja nissan nissay nl no nokia northwesternmutual norton now nowruz nowtv np nr nra nrw ntt nu nyc nz obi observer off office okinawa olayan olayangroup oldnavy ollo om omega one ong onl online onyourside ooo open oracle orange org organic origins osaka otsuka ott ovh pa page panasonic paris pars partners parts party passagens pay pccw pe pet pf pfizer pg ph pharmacy phd philips phone photo photography photos physio pics pictet pictures pid pin ping pink pioneer pizza pk pl place play playstation plumbing plus pm pn pnc pohl poker politie porn post pr pramerica praxi press prime pro prod productions prof progressive promo properties property protection pru prudential ps pt pub pw pwc py qa qpon quebec quest qvc racing radio raid re read realestate realtor realty recipes red redstone redumbrella rehab reise reisen reit reliance ren rent rentals repair report republican rest restaurant review reviews rexroth rich richardli ricoh ril rio rip rmit ro rocher rocks rodeo rogers room rs rsvp ru rugby ruhr run rw rwe ryukyu sa saarland safe safety sakura sale salon samsclub samsung sandvik sandvikcoromant sanofi sap sarl sas save saxo sb sbi sbs sc sca scb schaeffler schmidt scholarships school schule schwarz science scjohnson scot sd se search seat secure security seek select sener services ses seven sew sex sexy sfr sg sh shangrila sharp shaw shell shia shiksha shoes shop shopping shouji show showtime si silk sina singles site sj sk ski skin sky skype sl sling sm smart smile sn sncf so soccer social softbank software sohu solar solutions song sony soy spa space sport spot spreadbetting sr srl ss st stada staples star statebank statefarm stc stcgroup stockholm storage store stream studio study style su sucks supplies supply support surf surgery suzuki sv swatch swiftcover swiss sx sy sydney systems sz tab taipei talk taobao target tatamotors tatar tattoo tax taxi tc tci td tdk team tech technology tel temasek tennis teva tf tg th thd theater theatre tiaa tickets tienda tiffany tips tires tirol tj tjmaxx tjx tk tkmaxx tl tm tmall tn to today tokyo tools top toray toshiba total tours town toyota toys tr trade trading training travel travelchannel travelers travelersinsurance trust trv tt tube tui tunes tushu tv tvs tw tz ua ubank ubs ug uk unicom university uno uol ups us uy uz va vacations vana vanguard vc ve vegas ventures verisign versicherung vet vg vi viajes video vig viking villas vin vip virgin visa vision viva vivo vlaanderen vn vodka volkswagen volvo vote voting voto voyage vu vuelos wales walmart walter wang wanggou watch watches weather weatherchannel webcam weber website wed wedding weibo weir wf whoswho wien wiki williamhill win windows wine winners wme wolterskluwer woodside work works world wow ws wtc wtf xbox xerox xfinity xihuan xin xxx xyz yachts yahoo yamaxun yandex ye yodobashi yoga yokohama you youtube yt yun za zappos zara zero zip zm zone zuerich zw verm\xf6gensberater-ctb verm\xf6gensberatung-pwb \u03b5\u03bb \u03b5\u03c5 \u0431\u0433 \u0431\u0435\u043b \u0434\u0435\u0442\u0438 \u0435\u044e \u043a\u0430\u0442\u043e\u043b\u0438\u043a \u043a\u043e\u043c \u049b\u0430\u0437 \u043c\u043a\u0434 \u043c\u043e\u043d \u043c\u043e\u0441\u043a\u0432\u0430 \u043e\u043d\u043b\u0430\u0439\u043d \u043e\u0440\u0433 \u0440\u0443\u0441 \u0440\u0444 \u0441\u0430\u0439\u0442 \u0441\u0440\u0431 \u0443\u043a\u0440 \u10d2\u10d4 \u0570\u0561\u0575 \u05d9\u05e9\u05e8\u05d0\u05dc \u05e7\u05d5\u05dd \u0627\u0628\u0648\u0638\u0628\u064a \u0627\u062a\u0635\u0627\u0644\u0627\u062a \u0627\u0631\u0627\u0645\u0643\u0648 \u0627\u0644\u0627\u0631\u062f\u0646 \u0627\u0644\u0628\u062d\u0631\u064a\u0646 \u0627\u0644\u062c\u0632\u0627\u0626\u0631 \u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629 \u0627\u0644\u0639\u0644\u064a\u0627\u0646 \u0627\u0644\u0645\u063a\u0631\u0628 \u0627\u0645\u0627\u0631\u0627\u062a \u0627\u06cc\u0631\u0627\u0646 \u0628\u0627\u0631\u062a \u0628\u0627\u0632\u0627\u0631 \u0628\u06be\u0627\u0631\u062a \u0628\u064a\u062a\u0643 \u067e\u0627\u06a9\u0633\u062a\u0627\u0646 \u0680\u0627\u0631\u062a \u062a\u0648\u0646\u0633 \u0633\u0648\u062f\u0627\u0646 \u0633\u0648\u0631\u064a\u0629 \u0634\u0628\u0643\u0629 \u0639\u0631\u0627\u0642 \u0639\u0631\u0628 \u0639\u0645\u0627\u0646 \u0641\u0644\u0633\u0637\u064a\u0646 \u0642\u0637\u0631 \u0643\u0627\u062b\u0648\u0644\u064a\u0643 \u0643\u0648\u0645 \u0645\u0635\u0631 \u0645\u0644\u064a\u0633\u064a\u0627 \u0645\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u0627 \u0645\u0648\u0642\u0639 \u0647\u0645\u0631\u0627\u0647 \u0915\u0949\u092e \u0928\u0947\u091f \u092d\u093e\u0930\u0924 \u092d\u093e\u0930\u0924\u092e\u094d \u092d\u093e\u0930\u094b\u0924 \u0938\u0902\u0917\u0920\u0928 \u09ac\u09be\u0982\u09b2\u09be \u09ad\u09be\u09b0\u09a4 \u09ad\u09be\u09f0\u09a4 \u0a2d\u0a3e\u0a30\u0a24 \u0aad\u0abe\u0ab0\u0aa4 \u0b2d\u0b3e\u0b30\u0b24 \u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe \u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8 \u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd \u0c2d\u0c3e\u0c30\u0c24\u0c4d \u0cad\u0cbe\u0cb0\u0ca4 \u0d2d\u0d3e\u0d30\u0d24\u0d02 \u0dbd\u0d82\u0d9a\u0dcf \u0e04\u0e2d\u0e21 \u0e44\u0e17\u0e22 \u0ea5\u0eb2\u0ea7 \ub2f7\ub137 \ub2f7\ucef4 \uc0bc\uc131 \ud55c\uad6d \u30a2\u30de\u30be\u30f3 \u30b0\u30fc\u30b0\u30eb \u30af\u30e9\u30a6\u30c9 \u30b3\u30e0 \u30b9\u30c8\u30a2 \u30bb\u30fc\u30eb \u30d5\u30a1\u30c3\u30b7\u30e7\u30f3 \u30dd\u30a4\u30f3\u30c8 \u307f\u3093\u306a \u4e16\u754c \u4e2d\u4fe1 \u4e2d\u56fd \u4e2d\u570b \u4e2d\u6587\u7f51 \u4e9a\u9a6c\u900a \u4f01\u4e1a \u4f5b\u5c71 \u4fe1\u606f \u5065\u5eb7 \u516b\u5366 \u516c\u53f8 \u516c\u76ca \u53f0\u6e7e \u53f0\u7063 \u5546\u57ce \u5546\u5e97 \u5546\u6807 \u5609\u91cc \u5609\u91cc\u5927\u9152\u5e97 \u5728\u7ebf \u5927\u4f17\u6c7d\u8f66 \u5927\u62ff \u5929\u4e3b\u6559 \u5a31\u4e50 \u5bb6\u96fb \u5e7f\u4e1c \u5fae\u535a \u6148\u5584 \u6211\u7231\u4f60 \u624b\u673a \u62db\u8058 \u653f\u52a1 \u653f\u5e9c \u65b0\u52a0\u5761 \u65b0\u95fb \u65f6\u5c1a \u66f8\u7c4d \u673a\u6784 \u6de1\u9a6c\u9521 \u6e38\u620f \u6fb3\u9580 \u70b9\u770b \u79fb\u52a8 \u7ec4\u7ec7\u673a\u6784 \u7f51\u5740 \u7f51\u5e97 \u7f51\u7ad9 \u7f51\u7edc \u8054\u901a \u8bfa\u57fa\u4e9a \u8c37\u6b4c \u8d2d\u7269 \u901a\u8ca9 \u96c6\u56e2 \u96fb\u8a0a\u76c8\u79d1 \u98de\u5229\u6d66 \u98df\u54c1 \u9910\u5385 \u9999\u683c\u91cc\u62c9 \u9999\u6e2f".split(" "),hd=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/,md=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDD-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC5\uDED0-\uDED9\uDEE0-\uDEE7\uDEF0-\uDEF6])/,vd=/\uFE0F/,gd=/\d/,yd=/\s/;function bd(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=gf(),n=yf(Af),r=yf(Cf),o=gf(),i=yf(Mf),a=[[gd,r],[hd,r],[md,r],[vd,r]],s=function(){var e=yf(Cf);return e.j={"-":o},e.jr=[].concat(a),e},u=function(e){var t=s();return t.t=e,t};Df(t,[["'",yf($f)],["{",yf(Ff)],["[",yf(Pf)],["<",yf(Rf)],["(",yf(Bf)],["}",yf(Lf)],["]",yf(If)],[">",yf(zf)],[")",yf(_f)],["&",yf(Vf)],["*",yf(Hf)],["@",yf(Uf)],["`",yf(qf)],["^",yf(Kf)],[":",yf(Jf)],[",",yf(Qf)],["$",yf(Gf)],[".",yf(Yf)],["=",yf(Xf)],["!",yf(Zf)],["-",yf(ed)],["%",yf(td)],["|",yf(nd)],["+",yf(rd)],["#",yf(od)],["?",yf(id)],['"',yf(ad)],["/",yf(ud)],[";",yf(sd)],["~",yf(ld)],["_",yf(cd)],["\\",yf(Wf)]]),bf(t,"\n",yf(Tf)),kf(t,yd,i),bf(i,"\n",gf()),kf(i,yd,i);for(var l=0;l<pd.length;l++)Ef(t,pd[l],u(Sf),s);var c=s(),f=s(),d=s(),p=s();Ef(t,"file",c,s),Ef(t,"ftp",f,s),Ef(t,"http",d,s),Ef(t,"mailto",p,s);var h=s(),m=yf(jf),v=yf(Nf);bf(f,"s",h),bf(f,":",m),bf(d,"s",h),bf(d,":",m),bf(c,":",m),bf(h,":",m),bf(p,":",v);for(var g=s(),y=0;y<e.length;y++)Ef(t,e[y],g,s);return bf(g,":",m),Ef(t,"localhost",u(Of),s),kf(t,gd,n),kf(t,hd,r),kf(t,md,r),kf(t,vd,r),kf(n,gd,n),kf(n,hd,r),kf(n,md,r),kf(n,vd,r),bf(n,"-",o),bf(r,"-",o),bf(o,"-",o),kf(r,gd,r),kf(r,hd,r),kf(r,md,r),kf(r,vd,r),kf(o,gd,r),kf(o,hd,r),kf(o,md,r),kf(o,vd,r),t.jd=yf(fd),t}function kd(e){return kd="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kd(e)}var wd={defaultProtocol:"http",events:null,format:Dd,formatHref:Dd,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function xd(e){e=e||{},this.defaultProtocol="defaultProtocol"in e?e.defaultProtocol:wd.defaultProtocol,this.events="events"in e?e.events:wd.events,this.format="format"in e?e.format:wd.format,this.formatHref="formatHref"in e?e.formatHref:wd.formatHref,this.nl2br="nl2br"in e?e.nl2br:wd.nl2br,this.tagName="tagName"in e?e.tagName:wd.tagName,this.target="target"in e?e.target:wd.target,this.rel="rel"in e?e.rel:wd.rel,this.validate="validate"in e?e.validate:wd.validate,this.truncate="truncate"in e?e.truncate:wd.truncate,this.className="className"in e?e.className:wd.className,this.attributes=e.attributes||wd.attributes,this.ignoreTags=[];for(var t=("ignoreTags"in e?e.ignoreTags:wd.ignoreTags),n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function Dd(e){return e}xd.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),rel:this.get("rel",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e),truncate:this.get("truncate",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var r,o=this[e];if(!o)return o;switch(kd(o)){case"function":return o(t,n.t);case"object":return"function"===typeof(r=n.t in o?o[n.t]:wd[e])?r(t,n.t):r}return o},getObject:function(e,t,n){var r=this[e];return"function"===typeof r?r(t,n.t):r}};function Ed(){}function Cd(e,t){function n(t,n){this.t=e,this.v=t,this.tk=n}return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var o in n)r[o]=n[o];r.constructor=t,t.prototype=r}(Ed,n,t),n}Ed.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wd.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var Od=Cd("email",{isLink:!0}),Sd=Cd("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Ad=Cd("text"),jd=Cd("nl"),Nd=Cd("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wd.defaultProtocol,t=this.tk,n=!1,r=!1,o=[],i=0;t[i].t===jf;)n=!0,o.push(t[i].v),i++;for(;t[i].t===ud;)r=!0,o.push(t[i].v),i++;for(;i<t.length;i++)o.push(t[i].v);return o=o.join(""),n||r||(o="".concat(e,"://").concat(o)),o},hasProtocol:function(){return this.tk[0].t===jf}}),Md=Object.freeze({__proto__:null,MultiToken:Ed,Base:Ed,createTokenClass:Cd,MailtoEmail:Od,Email:Sd,Text:Ad,Nl:jd,Url:Nd});function Td(){var e=gf(),t=gf(),n=gf(),r=gf(),o=gf(),i=gf(),a=gf(),s=yf(Nd),u=gf(),l=yf(Nd),c=yf(Nd),f=gf(),d=gf(),p=gf(),h=gf(),m=gf(),v=yf(Nd),g=yf(Nd),y=yf(Nd),b=yf(Nd),k=gf(),w=gf(),x=gf(),D=gf(),E=gf(),C=gf(),O=yf(Sd),S=gf(),A=yf(Sd),j=yf(Od),N=gf(),M=gf(),T=gf(),F=gf(),P=yf(jd);bf(e,Tf,P),bf(e,jf,t),bf(e,Nf,n),bf(t,ud,r),bf(r,ud,o),bf(e,Sf,i),bf(e,Cf,i),bf(e,Of,s),bf(e,Af,i),bf(o,Sf,c),bf(o,Cf,c),bf(o,Af,c),bf(o,Of,c),bf(i,Yf,a),bf(E,Yf,C),bf(a,Sf,s),bf(a,Cf,i),bf(a,Af,i),bf(a,Of,i),bf(C,Sf,O),bf(C,Cf,E),bf(C,Af,E),bf(C,Of,E),bf(s,Yf,a),bf(O,Yf,C),bf(s,Jf,u),bf(s,ud,c),bf(u,Af,l),bf(l,ud,c),bf(O,Jf,S),bf(S,Af,A);var R=[Vf,Hf,Uf,Wf,qf,Kf,Gf,Cf,Xf,ed,Of,Af,td,nd,rd,od,jf,ud,fd,ld,Sf,cd],B=[$f,zf,Lf,If,_f,Jf,Qf,Yf,Zf,Rf,Ff,Pf,Bf,id,ad,sd];bf(c,Ff,d),bf(c,Pf,p),bf(c,Rf,h),bf(c,Bf,m),bf(f,Ff,d),bf(f,Pf,p),bf(f,Rf,h),bf(f,Bf,m),bf(d,Lf,c),bf(p,If,c),bf(h,zf,c),bf(m,_f,c),bf(v,Lf,c),bf(g,If,c),bf(y,zf,c),bf(b,_f,c),bf(k,Lf,c),bf(w,If,c),bf(x,zf,c),bf(D,_f,c),xf(d,R,v),xf(p,R,g),xf(h,R,y),xf(m,R,b),xf(d,B,k),xf(p,B,w),xf(h,B,x),xf(m,B,D),xf(v,R,v),xf(g,R,g),xf(y,R,y),xf(b,R,b),xf(v,B,v),xf(g,B,g),xf(y,B,y),xf(b,B,b),xf(k,R,v),xf(w,R,g),xf(x,R,y),xf(D,R,b),xf(k,B,k),xf(w,B,w),xf(x,B,x),xf(D,B,D),xf(c,R,c),xf(f,R,c),xf(c,B,f),xf(f,B,f),bf(n,Sf,j),bf(n,Cf,j),bf(n,Af,j),bf(n,Of,j),xf(j,R,j),xf(j,B,N),xf(N,R,j),xf(N,B,N);var L=[Vf,$f,Hf,Wf,qf,Kf,Lf,Gf,Cf,Xf,ed,Af,Ff,td,nd,rd,od,id,ud,fd,ld,Sf,cd];return xf(i,L,M),bf(i,Uf,T),xf(s,L,M),bf(s,Uf,T),xf(a,L,M),xf(M,L,M),bf(M,Uf,T),bf(M,Yf,F),xf(F,L,M),bf(T,Sf,E),bf(T,Cf,E),bf(T,Af,E),bf(T,Of,O),e}function Fd(e,t,n){var r=n[0].s,o=n[n.length-1].e;return new e(t.substr(r,o-r),n)}var Pd="undefined"!==typeof console&&console&&console.warn||function(){},Rd={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function Bd(e){if(Rd.initialized&&Pd('linkifyjs: already initialized - will not register custom protocol "'.concat(e,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(e))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");Rd.customProtocols.push(e)}function Ld(e){return Rd.initialized||function(){Rd.scanner={start:bd(Rd.customProtocols),tokens:dd},Rd.parser={start:Td(),tokens:Md};for(var e={createTokenClass:Cd},t=0;t<Rd.pluginQueue.length;t++)Rd.pluginQueue[t][1]({scanner:Rd.scanner,parser:Rd.parser,utils:e});Rd.initialized=!0}(),function(e,t,n){for(var r=n.length,o=0,i=[],a=[];o<r;){for(var s=e,u=null,l=null,c=0,f=null,d=-1;o<r&&!(u=wf(s,n[o].t));)a.push(n[o++]);for(;o<r&&(l=u||wf(s,n[o].t));)u=null,(s=l).accepts()?(d=0,f=s):d>=0&&d++,o++,c++;if(d<0)for(var p=o-c;p<o;p++)a.push(n[p]);else{a.length>0&&(i.push(Fd(Ad,t,a)),a=[]),o-=d,c-=d;var h=f.t,m=n.slice(o-c,o);i.push(Fd(h,t,m))}}return a.length>0&&i.push(Fd(Ad,t,a)),i}(Rd.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r<n;){var o=e.charCodeAt(r),i=void 0,a=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,o=[],i=0,a=0;a<r;){for(var s=e,u=null,l=0,c=null,f=-1,d=-1;a<r&&(u=wf(s,n[a]));)(s=u).accepts()?(f=0,d=0,c=s):f>=0&&(f+=n[a].length,d++),l+=n[a].length,i+=n[a].length,a++;i-=f,a-=d,l-=f,o.push({t:c.t,v:t.substr(i-l,l),s:i-l,e:i})}return o}(Rd.scanner.start,e))}function Id(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Ld(e),r=[],o=0;o<n.length;o++){var i=n[o];!i.isLink||t&&i.t!==t||r.push(i.toObject())}return r}function zd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Ld(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function _d(e){return new Fr({key:new Br("autolink"),appendTransaction:function(t,n,r){var o=t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc),a=t.some((function(e){return e.getMeta("preventAutolink")}));if(o&&!a){var s=r.tr,u=function(e,t){var n=new dr(e);return t.forEach((function(e){e.steps.forEach((function(e){n.step(e)}))})),n}(n.doc,P(t)),l=u.mapping,c=function(e){var t=e.mapping,n=e.steps,r=[];return t.maps.forEach((function(e,o){var i=[];if(e.ranges.length)e.forEach((function(e,t){i.push({from:e,to:t})}));else{var a=n[o],s=a.from,u=a.to;if(void 0===s||void 0===u)return;i.push({from:s,to:u})}i.forEach((function(e){var n=e.from,i=e.to,a=t.slice(o).map(n,-1),s=t.slice(o).map(i),u=t.invert().map(a,-1),l=t.invert().map(s);r.push({oldRange:{from:u,to:l},newRange:{from:a,to:s}})}))})),Ju(r)}(u);if(c.forEach((function(t){var o=t.oldRange,a=t.newRange;Qu(o.from,o.to,n.doc).filter((function(t){return t.mark.type===e.type})).forEach((function(t){var o=Qu(l.map(t.from),l.map(t.to),r.doc).filter((function(t){return t.mark.type===e.type}));if(o.length){var i=o[0],a=n.doc.textBetween(t.from,t.to,void 0," "),u=r.doc.textBetween(i.from,i.to,void 0," "),c=zd(a),f=zd(u);c&&!f&&s.removeMark(i.from,i.to,e.type)}})),function(e,t,n){var r=[];return e.nodesBetween(t.from,t.to,(function(e,t){n(e)&&r.push({node:e,pos:t})})),r}(r.doc,a,(function(e){return e.isTextblock})).forEach((function(t){Id(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((function(e){return e.isLink})).filter((function(t){return!e.validate||e.validate(t.value)})).map((function(e){return i(i({},e),{},{from:t.pos+e.start+1,to:t.pos+e.end+1})})).filter((function(e){var t=a.from>=e.from&&a.from<=e.to,n=a.to>=e.from&&a.to<=e.to;return t||n})).forEach((function(t){s.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),s.steps.length)return s}}})}var Vd,$d=Yu.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate:function(){this.options.protocols.forEach(Bd)},inclusive:function(){return this.options.autolink},addOptions:function(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes:function(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:function(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["a",Hs(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setLink:function(t){return function(n){return(0,n.chain)().setMark(e.name,t).setMeta("preventAutolink",!0).run()}},toggleLink:function(t){return function(n){return(0,n.chain)().toggleMark(e.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},unsetLink:function(){return function(t){return(0,t.chain)().unsetMark(e.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}},addPasteRules:function(){var e,t=this;return[(e={find:function(e){return Id(e).filter((function(e){return!t.options.validate||t.options.validate(e.value)})).filter((function(e){return e.isLink})).map((function(e){return{text:e.value,index:e.start,data:e}}))},type:this.type,getAttributes:function(e){var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}},new nu({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=qs(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],u=o[0],l=r.to;if(s){var c=u.search(/\S/),f=r.from+u.indexOf(s),d=f+s.length;if(Qu(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>f})).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+c,f),l=r.from+c+s.length,a.addMark(r.from+c,l,e.type.create(i||{})),a.removeStoredMark(e.type)}}}))]},addProseMirrorPlugins:function(){var e,t=[];return this.options.autolink&&t.push(_d({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new Fr({key:new Br("handleClickLink"),props:{handleClick:function(t,n,r){var o,i=Uu(t.state,e.type.name);return!(!(null===(o=r.target)||void 0===o?void 0:o.closest("a"))||!i.href)&&(window.open(i.href,i.target),!0)}}}))),this.options.linkOnPaste&&t.push(function(e){return new Fr({key:new Br("handlePasteLink"),props:{handlePaste:function(t,n,r){if(t.state.selection.empty)return!1;var o="";r.content.forEach((function(e){o+=e.textContent}));var i=Id(o).find((function(e){return e.isLink&&e.value===o}));return!(!o||!i)&&(e.editor.commands.setMark(e.type,{href:i.href}),!0)}}})}({editor:this.editor,type:this.type})),t}}),Hd=Xu.create({name:"paragraph",priority:1e3,addOptions:function(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML:function(){return[{tag:"p"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["p",Hs(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setParagraph:function(){return function(t){return t.commands.setNode(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-0":function(){return e.editor.commands.setParagraph()}}}}),Ud=Xu.create({name:"doc",topNode:!0,content:"block+"}),Wd=/^\s*>\s$/,qd=Xu.create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["blockquote",Hs(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBlockquote:function(){return function(t){return t.commands.wrapIn(e.name)}},toggleBlockquote:function(){return function(t){return t.commands.toggleWrap(e.name)}},unsetBlockquote:function(){return function(t){return t.commands.lift(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-b":function(){return e.editor.commands.toggleBlockquote()}}},addInputRules:function(){return[(e={find:Wd,type:this.type},new Zs({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=qs(e.getAttributes,void 0,o)||{},a=n.tr.delete(r.from,r.to),s=a.doc.resolve(r.from).blockRange(),u=s&&Hn(s,e.type,i);if(!u)return null;a.wrap(s,u);var l=a.doc.resolve(r.from-1).nodeBefore;l&&l.type===e.type&&Yn(a.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,l))&&a.join(r.from-1)}}))];var e}});var Kd=["title","titleId"];function Jd(){return Jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jd.apply(this,arguments)}function Qd(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Gd(e,t){var n=e.title,r=e.titleId,o=Qd(e,Kd);return s.createElement("svg",Jd({id:"loader-1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"40px",height:"40px",viewBox:"0 0 50 50",style:{enableBackground:"new 0 0 50 50"},xmlSpace:"preserve",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,Vd||(Vd=s.createElement("path",{d:"M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"},s.createElement("animateTransform",{attributeType:"xml",attributeName:"transform",type:"rotate",from:"0 25 25",to:"360 25 25",dur:"0.6s",repeatCount:"indefinite"}))))}var Yd,Xd=s.forwardRef(Gd),Zd=(n.p,["title","titleId"]);function ep(){return ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ep.apply(this,arguments)}function tp(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function np(e,t){var n=e.title,r=e.titleId,o=tp(e,Zd);return s.createElement("svg",ep({xmlns:"http://www.w3.org/2000/svg",height:24,width:24,viewBox:"0 0 24 24",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,Yd||(Yd=s.createElement("g",{strokeLinecap:"round",strokeWidth:2,fill:"none",strokeLinejoin:"round",className:"nc-icon-wrapper"},s.createElement("polygon",{points:"7 21 2 22 3 17 18 2 22 6 7 21"}))))}var rp,op=s.forwardRef(np),ip=(n.p,function(){function e(){y(this,e),this.listeners=new Map}return k(e,[{key:"addListener",value:function(e,t,n){var r=this.listeners.get(e);r?r.push({type:t,listener:n}):this.listeners.set(e,[{type:t,listener:n}])}},{key:"removeListener",value:function(e,t){if(t){var n=this.listeners.get(e);n&&this.listeners.set(e,n.filter((function(e){return e.type!==t})))}else this.listeners.delete(e)}},{key:"sendEvent",value:function(e,t,n){var r,o=[],i=ie(this.listeners.values());try{for(i.s();!(r=i.n()).done;){var a=r.value;if(void 0!==n&&a===n)return;var s,u=ie(a);try{for(u.s();!(s=u.n()).done;){var l=s.value;l.type===e&&o.push(l.listener(t,e))}}catch(c){u.e(c)}finally{u.f()}}}catch(c){i.e(c)}finally{i.f()}return o}}]),e}()),ap=new ip,sp=0,up=function(e){var t,n,r,o,a=Object(s.useContext)(A),u=a.member,l=a.postId,c=a.dispatchAction,f=a.avatarSaturation,d=p(Object(s.useState)(!(!e.isReply&&!e.isEdit)),2),h=d[0],v=d[1],y=Object(s.useRef)(null),b=p(Object(s.useState)("default"),2),k=b[0],w=b[1],x=p(Object(s.useState)(!1),2),D=x[0],E=x[1],C=e.comment,O=e.commentsCount,S=null!==(t=null===u||void 0===u?void 0:u.name)&&void 0!==t?t:null===C||void 0===C||null===(n=C.member)||void 0===n?void 0:n.name,N=null!==(r=null===u||void 0===u?void 0:u.bio)&&void 0!==r?r:null===C||void 0===C||null===(o=C.member)||void 0===o?void 0:o.bio,M=null;"sending"===k?M=Object(j.jsx)(Xd,{className:"w-[24px] h-[24px] fill-white dark:fill-black"}):"sent"===k&&(M=null);var T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=p(Object(s.useState)(null),2),r=n[0],o=n[1],i=pf();return Object(s.useEffect)((function(){var t=!0,n=new sf(e);return o(n),n.on("transaction",(function(){requestAnimationFrame((function(){requestAnimationFrame((function(){t&&i()}))}))})),function(){n.destroy(),t=!1}}),t),r}(i({},function(e){var t=e.placeholder,n=e.autofocus,r=void 0!==n&&n,o=e.content,i=void 0===o?"":o;return{extensions:[Ud,mf,Hd,$d.configure({openOnClick:!1}),hf.configure({placeholder:t}),qd.configure({})],content:i,autofocus:r,editorProps:{attributes:{class:"gh-comment-content focus:outline-0"}},parseOptions:{preserveWhitespace:"full"}}}(e.isReply?{placeholder:"Reply to comment",autofocus:!0}:e.isEdit?{placeholder:"Edit this comment",autofocus:!1,content:e.comment.html}:{placeholder:0===O?"Start the conversation":"Join the discussion",autofocus:!1}))),F=function(){for(var e=0,t=y.current,n=t.ownerDocument.defaultView;n!==window;)for(var r=n.parent,o=0;o<r.frames.length;o++)if(r.frames[o]===n){var i,a=ie(r.document.getElementsByTagName("iframe"));try{for(a.s();!(i=a.n()).done;){var s=i.value;if(s.contentWindow===n)e+=s.getBoundingClientRect().top+n.pageYOffset}}catch(u){a.e(u)}finally{a.f()}n=r;break}return t.getBoundingClientRect().top+window.pageYOffset+e},P=p(Object(s.useState)((function(){return"form-"+(sp+=1)})),1)[0],R=Object(s.useCallback)((function(){(e.isReply&&null!==T&&void 0!==T&&T.isEmpty||e.isEdit&&(null===T||void 0===T?void 0:T.getHTML())===e.comment.html)&&e.close&&e.close()}),[T,e]);Object(s.useEffect)((function(){return ap.addListener(P,"form-focus",R),function(){ap.removeListener(P)}}),[R,P]),Object(s.useEffect)((function(){(e.isReply||e.isEdit)&&ap.sendEvent("form-focus",{},P)}),[e.isReply,e.isEdit,P]);var B=Object(s.useCallback)((function(){e.isReply||e.isEdit||ap.sendEvent("form-focus",{},P),S||e.isEdit?v(!0):(E(!0),T.commands.blur(),c("openPopup",{type:"addDetailsDialog",callback:function(t){t?T.commands.focus():e.close&&e.close(),E(!1)}}))}),[T,c,S,e,P]);Object(s.useEffect)((function(){var t;if(T)return e.isReply&&(t=setTimeout((function(){var e=y.current.offsetHeight,t=F(),n=t+e,r=window.innerHeight,o=window.scrollY;if(t-64<o||n+64>o+r){var i=(t+n)/2;window.scrollTo({top:i-r/2,left:0,behavior:"smooth"})}}),50)),e.isEdit?(T.chain().focus().command((function(e){var t=e.tr;return e.commands.setTextSelection({from:t.doc.content.size,to:t.doc.content.size})})).run(),function(){t&&clearTimeout(t)}):function(){t&&clearTimeout(t)}}),[T,e.isReply,e.isEdit]);var L=Object(s.useCallback)(g(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!T.isEmpty){t.next=2;break}return t.abrupt("return");case 2:if(w("sending"),!e.isReply){t.next=17;break}return t.prev=4,t.next=7,c("addReply",{parent:e.parent,reply:{post_id:l,status:"published",html:T.getHTML()}});case 7:T.chain().clearContent().blur().run(),w("sent"),e.close(),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(4),console.error(t.t0);case 15:t.next=35;break;case 17:if(!e.isEdit){t.next=24;break}return t.next=20,c("editComment",{comment:{id:e.comment.id,html:T.getHTML()},parent:e.parent});case 20:w("sent"),e.close(),t.next=35;break;case 24:return t.prev=24,t.next=27,c("addComment",{post_id:l,status:"published",html:T.getHTML()});case 27:T.chain().clearContent().blur().run(),v(!1),w("sent"),t.next=35;break;case 32:t.prev=32,t.t1=t.catch(24),console.error(t.t1);case 35:return t.abrupt("return",!1);case 36:case"end":return t.stop()}}),t,null,[[4,12],[24,32]])}))),[T,e,c,l]);Object(s.useEffect)((function(){if(T){T.on("focus",(function(){B()})),T.on("blur",(function(){null!==T&&void 0!==T&&T.isEmpty&&v(!1)}));var t=function(t){if(t.metaKey||t.ctrlKey)"Enter"===t.key&&null!==T&&void 0!==T&&T.isFocused&&L();else{if("Escape"!==t.key){for(var n=document.activeElement;n&&"IFRAME"===n.tagName&&n.contentDocument;)n=n.contentDocument.activeElement;var r=n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"IFRAME"===n.tagName||"true"===n.contentEditable);return"c"!==t.key||e.isEdit||e.isReply||null!==T&&void 0!==T&&T.isFocused||r?void 0:(null===T||void 0===T||T.commands.focus(),void window.scrollTo({top:F(),left:0,behavior:"smooth"}))}null!==T&&void 0!==T&&T.isFocused&&!D&&(e.close?e.close():null===T||void 0===T||T.commands.blur())}};return window.addEventListener("keydown",t,{passive:!0}),function(){window.removeEventListener("keydown",t,{passive:!0}),null===T||void 0===T||T.off("focus"),null===T||void 0===T||T.off("blur")}}}),[T,e,B,D,L]);var I,z=function(e){T.isFocused&&e.preventDefault()},_=function(e){T.isFocused&&e.stopPropagation()},V=function(e,t){var n;e.preventDefault(),E(!0),null===T||void 0===T||T.commands.blur(),c("openPopup",{type:"addDetailsDialog",bioAutofocus:null!==(n=t.bioAutofocus)&&void 0!==n&&n,callback:function(){null===T||void 0===T||T.commands.focus(),E(!1)}})};I=e.isReply?Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)("span",{className:"hidden sm:inline",children:"Add "}),Object(j.jsx)("span",{className:"capitalize sm:normal-case",children:"reply"})]}):e.isEdit?"Save":Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)("span",{className:"hidden sm:inline",children:"Add "}),Object(j.jsx)("span",{className:"capitalize sm:normal-case",children:"comment"})]}),"sending"===k&&(I=null);var $=ee()&&e.isReply||ee()&&e.isEdit,H=e.isReply||e.isEdit||h||D;return Object(j.jsx)(j.Fragment,{children:Object(j.jsx)("form",{ref:y,"data-testid":"form",onClick:function(e){T.isFocused||T.commands.focus()},onMouseDown:z,onTouchStart:z,className:"\n transition duration-200\n pt-3 pb-2 px-3\n -mt-[14px] -mx-3 mb-10\n rounded-md\n ".concat(H?"cursor-default":"cursor-pointer","\n ").concat(!e.isReply&&!e.isEdit&&"-mt-[4px]","\n ").concat((e.isReply||e.isEdit)&&"-mt-[20px]","\n ").concat($&&"pl-1","\n "),children:Object(j.jsxs)("div",{className:"w-full relative",children:[Object(j.jsx)("div",{className:"pr-[1px] font-sans leading-normal dark:text-neutral-300",children:Object(j.jsxs)("div",{className:"transition-[padding] duration-150 delay-100 relative w-full pl-[52px] ".concat($&&"pl-0"," ").concat(H&&"pt-[64px] pl-[1px] sm:pl-[52px]"),children:[Object(j.jsx)("div",{className:"\n transition-all duration-150 delay-100\n w-full px-3 py-4\n bg-transparent dark:bg-[rgba(255,255,255,0.08)]\n rounded-md border-none border border-slate-50 dark:border-none\n font-sans text-[16.5px] leading-normal dark:text-neutral-300 \n focus:outline-0\n shadow-form hover:shadow-formxl dark:shadow-transparent\n ".concat(0===O&&"placeholder:text-neutral-700","\n ").concat(H?"cursor-text min-h-[144px] pb-[68px] pt-2":"cursor-pointer overflow-hidden min-h-[48px] hover:border-slate-300","\n ").concat(e.isEdit&&"cursor-text","\n ").concat(!S&&"pointer-events-none","\n "),children:Object(j.jsx)(cf,{onMouseDown:_,onTouchStart:_,editor:T})}),Object(j.jsxs)("div",{className:" absolute right-[9px] bottom-[9px] flex space-x-4 transition-[opacity] duration-150 ",children:[(e.isEdit||e.isReply)&&Object(j.jsx)("button",{type:"button",onClick:e.close,className:"outline-0 font-sans text-sm font-medium ml-2.5 text-neutral-500 dark:text-neutral-400",children:"Cancel"}),Object(j.jsxs)("button",{className:"\n flex items-center justify-center w-auto sm:w-[128px] ".concat(e.isReply&&"sm:w-[100px]"," ").concat(e.isEdit&&"sm:w-[64px]"," h-[39px]\n transition-[opacity] duration-150\n bg-neutral-900 dark:bg-[rgba(255,255,255,0.9)]\n rounded-[6px] border outline-0\n py-2 px-3\n text-sm text-center font-sans font-semibold\n text-white dark:text-neutral-800\n "),type:"button","data-testid":"submit-form-button",onClick:L,children:[Object(j.jsx)("span",{children:M}),I&&Object(j.jsx)("span",{children:I})]})]})]})}),Object(j.jsxs)("div",{className:"absolute top-1 left-0 flex justify-start items-center h-12 w-full",children:[Object(j.jsx)("div",{className:"grow-0 mr-3",children:Object(j.jsx)(ht,{comment:C,saturation:f,className:"pointer-events-none"})}),Object(j.jsx)("div",{className:"grow-1 w-full",children:Object(j.jsxs)(ut,{show:H,enter:"transition duration-500 delay-100 ease-in-out",enterFrom:"opacity-0 -translate-x-2",enterTo:"opacity-100 translate-x-0",leave:"transition-none duration-0",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:[Object(j.jsx)("div",{className:"text-[17px] font-sans font-bold tracking-tight text-[rgb(23,23,23)] dark:text-[rgba(255,255,255,0.85)]",onClick:function(e){V(e,{bioAutofocus:!1})},children:S||"Anonymous"}),Object(j.jsx)("div",{className:"flex items-baseline justify-start",children:Object(j.jsxs)("button",{className:"group transition duration-150 whitespace-nowrap max-w-[80%] sm:max-w-[90%] flex items-center justify-start font-sans text-[14px] text-left tracking-tight text-neutral-400 hover:text-neutral-500 dark:text-[rgba(255,255,255,0.5)] ".concat(!N&&"text-neutral-300 hover:text-neutral-400"),onClick:function(e){V(e,{bioAutofocus:!0})},children:[Object(j.jsx)("span",{className:"text-ellipsis overflow-hidden ...",children:N||"Add your expertise"}),N&&Object(j.jsx)(op,{className:"transition-all duration-100 ease-out opacity-0 -translate-x-[6px] group-hover:opacity-100 group-hover:translate-x-0 w-[12px] h-[12px] stroke-neutral-500 ml-1"})]})})]})})]})]})})})},lp=["title","titleId"];function cp(){return cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cp.apply(this,arguments)}function fp(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function dp(e,t){var n=e.title,r=e.titleId,o=fp(e,lp);return s.createElement("svg",cp({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"black",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,rp||(rp=s.createElement("path",{d:"M8.00025 13.8739L2.46073 8.09636C1.97388 7.60989 1.65255 6.98248 1.54231 6.30312C1.43208 5.62376 1.53853 4.92694 1.84658 4.31148V4.31148C2.07887 3.84703 2.41819 3.44443 2.83659 3.13684C3.25499 2.82925 3.74049 2.62547 4.25308 2.54231C4.76567 2.45914 5.29069 2.49896 5.78488 2.65849C6.27906 2.81802 6.72827 3.09269 7.09549 3.45987L8.00025 4.36406L8.90502 3.45987C9.27224 3.09269 9.72145 2.81802 10.2156 2.65849C10.7098 2.49896 11.2348 2.45914 11.7474 2.54231C12.26 2.62547 12.7455 2.82925 13.1639 3.13684C13.5823 3.44443 13.9216 3.84703 14.1539 4.31148C14.4616 4.9267 14.5678 5.62311 14.4577 6.30208C14.3476 6.98105 14.0267 7.60817 13.5404 8.09462L8.00025 13.8739Z",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})))}var pp=s.forwardRef(dp);n.p;var hp,mp=function(e){var t=Object(s.useContext)(A),n=t.dispatchAction,r=t.member,o=t.commentsEnabled,i=p(Object(s.useState)(""),2),a=i[0],u=i[1],l="paid"===o,c=r&&!!r.paid,f=r&&(c||!l),d=f?"button":"span",h="cursor-pointer";return f||(h="cursor-text"),Object(j.jsxs)(d,{className:"group transition-all duration-50 ease-linear flex font-sans items-center text-sm outline-0 ".concat(e.comment.liked?"text-neutral-900 dark:text-[rgba(255,255,255,0.9)]":"text-neutral-400 dark:text-[rgba(255,255,255,0.5)]"," ").concat(!e.comment.liked&&f&&"hover:text-neutral-600 hover:dark:text-[rgba(255,255,255,0.3)]"," ").concat(h),onClick:function(){f&&(e.comment.liked?n("unlikeComment",e.comment):(n("likeComment",e.comment),u("animate-heartbeat"),setTimeout((function(){u("")}),400)))},"data-testid":"like-button",children:[Object(j.jsx)(pp,{className:a+" mr-[6px] ".concat(e.comment.liked?"fill-neutral-900 stroke-neutral-900 dark:fill-white dark:stroke-white":"stroke-neutral-400 dark:stroke-[rgba(255,255,255,0.5)"," ").concat(!e.comment.liked&&f&&"group-hover:stroke-neutral-600"," transition duration-50 ease-linear")}),e.comment.count.likes]})},vp=["title","titleId"];function gp(){return gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gp.apply(this,arguments)}function yp(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function bp(e,t){var n=e.title,r=e.titleId,o=yp(e,vp);return s.createElement("svg",gp({width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"black",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,hp||(hp=s.createElement("path",{d:"M7.17463 2.98741C7.17439 2.7888 7.11434 2.59487 7.00229 2.43088C6.89025 2.26689 6.73141 2.14046 6.54647 2.06805C6.36153 1.99564 6.15907 1.98061 5.96546 2.02492C5.77186 2.06923 5.5961 2.17083 5.46107 2.31648L1.86192 6.21418C1.69351 6.39677 1.60001 6.63606 1.60001 6.88445C1.60001 7.13284 1.69351 7.37213 1.86192 7.55472L5.45909 11.4524C5.59412 11.5981 5.76988 11.6997 5.96349 11.744C6.15709 11.7883 6.35955 11.7733 6.54449 11.7009C6.72943 11.6284 6.88827 11.502 7.00032 11.338C7.11236 11.174 7.17242 10.9801 7.17265 10.7815V8.86164H9.12703C10.438 8.86164 11.6953 9.38241 12.6222 10.3094C13.5492 11.2364 14.07 12.4937 14.07 13.8046V9.85023C14.07 8.53927 13.5492 7.28201 12.6222 6.35502C11.6953 5.42803 10.438 4.90726 9.12703 4.90726H7.17265L7.17463 2.98741Z",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})))}var kp=s.forwardRef(bp);n.p;var wp,xp,Dp,Ep=function(e){return Object(s.useContext)(A).member?Object(j.jsxs)("button",{disabled:!!e.disabled,className:"group transition-all duration-50 ease-linear flex font-sans items-center text-sm outline-0 ".concat(e.isReplying?"text-neutral-900 dark:text-[rgba(255,255,255,0.9)]":"text-neutral-500 hover:text-neutral-600 dark:text-[rgba(255,255,255,0.5)] dark:hover:text-[rgba(255,255,255,0.3)]"),onClick:e.toggleReply,"data-testid":"reply-button",children:[Object(j.jsx)(kp,{className:"mr-[6px] ".concat(e.isReplying?"fill-neutral-900 stroke-neutral-900 dark:fill-white dark:stroke-white":"stroke-neutral-400 dark:stroke-[rgba(255,255,255,0.5)] group-hover:stroke-neutral-600"," transition duration-50 ease-linear")}),"Reply"]}):null},Cp=function(e){var t=Object(s.useContext)(A).dispatchAction,n="published"!==e.comment.status;return Object(j.jsx)("div",{className:"flex flex-col",children:n?Object(j.jsxs)("button",{className:"w-full text-left text-[14px]",onClick:function(n){t("showComment",e.comment),e.close()},children:[Object(j.jsx)("span",{children:"Show "}),Object(j.jsx)("span",{className:"hidden sm:inline",children:"comment"})]}):Object(j.jsxs)("button",{className:"w-full text-left text-[14px]",onClick:function(n){t("hideComment",e.comment),e.close()},children:[Object(j.jsx)("span",{children:"Hide "}),Object(j.jsx)("span",{className:"hidden sm:inline",children:"comment"})]})})},Op=function(e){var t=Object(s.useContext)(A).dispatchAction;return Object(j.jsxs)("div",{className:"flex flex-col",children:[Object(j.jsx)("button",{className:"w-full mb-3 text-left text-[14px]",onClick:e.toggleEdit,children:"Edit"}),Object(j.jsx)("button",{className:"w-full text-left text-[14px] text-red-600",onClick:function(n){t("deleteComment",e.comment),e.close()},children:"Delete"})]})},Sp=function(e){var t=Object(s.useContext)(A).dispatchAction;return Object(j.jsx)("div",{className:"flex flex-col",children:Object(j.jsxs)("button",{className:"w-full text-left text-[14px]",onClick:function(){t("openPopup",{type:"reportDialog",comment:e.comment}),e.close()},children:[Object(j.jsx)("span",{children:"Report "}),Object(j.jsx)("span",{className:"hidden sm:inline",children:"comment"})]})})},Ap=function(e){var t,n=Object(s.useContext)(A),r=n.member,o=n.admin,i=e.comment,a=r&&(null===(t=i.member)||void 0===t?void 0:t.uuid)===(null===r||void 0===r?void 0:r.uuid),u=!!o,l=Object(s.useRef)();Object(s.useEffect)((function(){var t,n,r=function(){e.close()};window.addEventListener("click",r,{passive:!0});var o=null===(t=l.current)||void 0===t||null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;return o&&o!==window&&o.addEventListener("click",r,{passive:!0}),function(){window.removeEventListener("click",r,{passive:!0}),o&&o!==window&&o.removeEventListener("click",r,{passive:!0})}}),[e]),Object(s.useEffect)((function(){var t=function(t){"Escape"===t.key&&e.close()};return window.addEventListener("keydown",t,{passive:!0}),function(){window.removeEventListener("keydown",t,{passive:!0})}}));var c=null;if("published"===i.status)c=a?Object(j.jsx)(Op,{comment:i,close:e.close,toggleEdit:e.toggleEdit}):u?Object(j.jsx)(Cp,{comment:i,close:e.close}):Object(j.jsx)(Sp,{comment:i,close:e.close});else{if(!u)return null;c=Object(j.jsx)(Cp,{comment:i,close:e.close})}return Object(j.jsx)("div",{ref:l,onClick:function(e){e.stopPropagation()},children:Object(j.jsx)("div",{className:"min-w-min sm:min-w-[150px] bg-white absolute font-sans rounded py-3 pl-4 pr-8 shadow-lg text-sm whitespace-nowrap z-10 dark:bg-zinc-900 dark:text-white outline-0",children:c})})},jp=["title","titleId"];function Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Np.apply(this,arguments)}function Mp(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Tp(e,t){var n=e.title,r=e.titleId,o=Mp(e,jp);return s.createElement("svg",Np({width:16,height:16,viewBox:"0 0 16 16",fill:"black",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,wp||(wp=s.createElement("path",{d:"M3 12C3.82843 12 4.5 11.3284 4.5 10.5C4.5 9.67157 3.82843 9 3 9C2.17157 9 1.5 9.67157 1.5 10.5C1.5 11.3284 2.17157 12 3 12Z"})),xp||(xp=s.createElement("path",{d:"M8 12C8.82843 12 9.5 11.3284 9.5 10.5C9.5 9.67157 8.82843 9 8 9C7.17157 9 6.5 9.67157 6.5 10.5C6.5 11.3284 7.17157 12 8 12Z"})),Dp||(Dp=s.createElement("path",{d:"M13 12C13.8284 12 14.5 11.3284 14.5 10.5C14.5 9.67157 13.8284 9 13 9C12.1716 9 11.5 9.67157 11.5 10.5C11.5 11.3284 12.1716 12 13 12Z"})))}var Fp=s.forwardRef(Tp),Pp=(n.p,function(e){var t=p(Object(s.useState)(!1),2),n=t[0],r=t[1],o=Object(s.useContext)(A),i=o.member,a=o.admin,u=e.comment,l=!!i&&"published"===u.status||!!a;return i?Object(j.jsxs)("div",{className:"relative",children:[l?Object(j.jsx)("button",{onClick:function(){r((function(e){return!e}))},className:"outline-0",children:Object(j.jsx)(Fp,{className:"transition duration-50 ease-linear gh-comments-icon gh-comments-icon-more outline-0 fill-neutral-400 dark:fill-rgba(255,255,255,0.5) hover:fill-neutral-600"})}):null,n?Object(j.jsx)(Ap,{comment:u,close:function(){r(!1)},toggleEdit:e.toggleEdit}):null]}):null}),Rp=function(e){var t=e.loadMore,n=e.count;return Object(j.jsx)("button",{className:"group w-full text-neutral-700 font-semibold mt-10 sm:mt-0 mb-10 font-sans text-md text-left dark:text-white flex items-center ",onClick:t,"data-testid":"reply-pagination-button",children:Object(j.jsxs)("span",{className:"whitespace-nowrap mr-4",children:["\u2193 Show ",n," more ",1===n?"reply":"replies"]})})},Bp=function(e){var t=e.comment,n=Object(s.useContext)(A).dispatchAction,r=t.count.replies-t.replies.length;return Object(j.jsxs)("div",{children:[t.replies.map((function(e){return Object(j.jsx)(zp,{comment:e,parent:t,isReply:!0},e.id)})),r>0&&Object(j.jsx)(Rp,{count:r,loadMore:function(){n("loadMoreReplies",{comment:t})}})]})},Lp=["updateIsEditing","isEditing"];function Ip(e){return e.comment.edited_at?Object(j.jsxs)("span",{children:[Object(j.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"}),"Edited"]}):null}var zp=function(e){var t,n=e.updateIsEditing,r=void 0===n?null:n,o=(e.isEditing,a(e,Lp)),i=p(Object(s.useState)(!1),2),u=i[0],l=i[1],c=p(Object(s.useState)(!1),2),f=c[0],d=c[1],h=Object(s.useContext)(A),v=h.admin,y=h.avatarSaturation,b=h.member,k=h.commentsEnabled,w=h.dispatchAction,x=o.comment;Object(s.useEffect)((function(){null===r||void 0===r||r(f||u)}),[r,f,u]);var D,E=function(){l((function(e){return!e}))},C=function(){var e=g(m().mark((function e(){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f){e.next=3;break}return e.next=3,w("loadMoreReplies",{comment:x,limit:"all"});case 3:d((function(e){return!e}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=x.replies&&x.replies.length>0,S="published"!==x.status,N={__html:x.html};S&&(D=v&&"hidden"===x.status?"This comment has been hidden.":"This comment has been removed.");var M="paid"===k,T=b&&!!b.paid,F=b&&(T||!M),P=b&&x.member&&x.member.uuid===b.uuid?b.bio:null===x||void 0===x||null===(t=x.member)||void 0===t?void 0:t.bio;return u?Object(j.jsx)(up,{comment:x,close:function(){l(!1)},parent:o.parent,isEdit:!0}):Object(j.jsx)(ut,{appear:!0,show:!0,enter:"transition-opacity duration-300 ease-out",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:Object(j.jsxs)("div",{className:"flex flex-row w-full ".concat(O?"mb-0":"mb-10"),"data-testid":"comment-component",children:[Object(j.jsxs)("div",{className:"mr-3 flex flex-col justify-start items-center",children:[Object(j.jsx)("div",{className:"flex-0 mb-4",children:Object(j.jsx)(ht,{comment:x,saturation:y,isBlank:S})}),(!o.isReply&&O||f)&&Object(j.jsx)("div",{className:"w-[3px] h-full mb-2 bg-gradient-to-b from-neutral-100 via-neutral-100 to-transparent dark:from-[rgba(255,255,255,0.05)] dark:via-[rgba(255,255,255,0.05)] grow rounded"})]}),Object(j.jsxs)("div",{className:"grow",children:[Object(j.jsx)("div",{className:"flex items-start -mt-[3px] mb-2",children:S?Object(j.jsxs)("div",{className:"flex flex-row items-center gap-4 pb-[8px] pr-4 h-12",children:[Object(j.jsx)("p",{className:"font-sans text-[16px] leading-normal text-neutral-300 dark:text-[rgba(255,255,255,0.5)] italic mt-[4px]",children:D}),Object(j.jsx)("div",{className:"mt-[4px]",children:Object(j.jsx)(Pp,{comment:x,toggleEdit:E})})]}):Object(j.jsxs)("div",{children:[Object(j.jsx)("h4",{className:"text-[17px] font-sans font-bold tracking-tight text-[rgb(23,23,23] dark:text-[rgba(255,255,255,0.85)]",children:x.member?x.member.name?x.member.name:"Anonymous":"Deleted member"}),Object(j.jsx)("div",{className:"flex items-baseline font-sans text-[14px] tracking-tight pr-4 text-neutral-400 dark:text-[rgba(255,255,255,0.5)]",children:Object(j.jsxs)("span",{children:[P&&Object(j.jsxs)("span",{children:[P,Object(j.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"})]}),Object(j.jsx)("span",{title:X(x.created_at),children:Y(x.created_at)}),Object(j.jsx)(Ip,{comment:x})]})})]})}),!S&&Object(j.jsx)("div",{className:"flex flex-row items-center gap-4 mt mb-2 pr-4",children:Object(j.jsx)("p",{dangerouslySetInnerHTML:N,className:"gh-comment-content font-sans leading-normal text-[16px] text-neutral-900 dark:text-[rgba(255,255,255,0.85)]","data-testid":"comment-content"})}),!S&&Object(j.jsxs)("div",{className:"flex gap-5 items-center",children:[Object(j.jsx)(mp,{comment:x}),F&&(S||!o.parent)&&Object(j.jsx)(Ep,{comment:x,toggleReply:C,isReplying:f}),Object(j.jsx)(Pp,{comment:x,toggleEdit:E})]}),O&&Object(j.jsx)("div",{className:"mt-10 mb-4 sm:mb-0",children:Object(j.jsx)(Bp,{comment:x})}),f&&Object(j.jsx)("div",{className:"my-10",children:Object(j.jsx)(up,{parent:x,close:function(){d(!1)},isReply:!0})})]})]})})},_p=function(e){var t=Object(s.useContext)(A),n=t.pagination,r=t.dispatchAction;if(!n)return null;var o=n.total-n.page*n.limit;return o<=0?null:Object(j.jsxs)("button",{className:"group w-full text-neutral-700 font-semibold px-0 pt-0 pb-2 mb-10 font-sans text-md text-left dark:text-white flex items-center ",onClick:function(){r("loadMoreComments")},children:[Object(j.jsxs)("span",{className:"whitespace-nowrap mr-4",children:["\u2191 Show ",o," previous ",1===o?"comment":"comments"]}),Object(j.jsx)("span",{className:"transition-[background-color] duration-200 ease-out inline-block w-full bg-neutral-100 group-hover:bg-neutral-200 dark:bg-[rgba(255,255,255,0.05)] rounded h-[3px] mt-[3px]"})]})};var Vp,$p,Hp=function(){return Object(j.jsx)("div",{className:"flex items-center justify-center w-full h-32",children:Object(j.jsx)(Xd,{className:"w-12 h-12 mb-6 fill-[rgb(225,225,225,0.9)] dark:fill-[rgba(255,255,255,0.6)]"})})},Up="ghost-comments-root",Wp=function(e){var t=e.title,n=e.showCount,r=e.count;if(!t&&!n&&null!==t)return null;var o=function(){return null===t?Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)("span",{className:"hidden sm:inline",children:"Member "}),Object(j.jsx)("span",{className:"capitalize sm:normal-case",children:"discussion"})]}):t},i=function(){return n?1===r?Object(j.jsx)("div",{className:"text-neutral-400 text-[1.6rem]",children:"1 comment"}):Object(j.jsxs)("div",{className:"text-neutral-400 text-[1.6rem]",children:[r," comments"]}):null};return Object(j.jsxs)("div",{className:"w-full flex justify-between items-baseline font-sans mb-10",children:[Object(j.jsx)("h2",{className:"font-bold text-[2.8rem] tracking-tight dark:text-[rgba(255,255,255,0.85)]",children:Object(j.jsx)(o,{})}),Object(j.jsx)(i,{})]})},qp=function(e){var t=p(Object(s.useState)(!1),2),n=t[0],r=t[1],o=Object(s.useContext)(A),i=o.pagination,a=o.member,u=o.comments,l=o.commentCount,c=o.commentsEnabled,f=o.title,d=o.showCount,h=u.slice().reverse().map((function(e){return Object(j.jsx)(zp,{isEditing:n,comment:e,updateIsEditing:r},e.id)})),m="paid"===c,v=a&&!!a.paid;return Object(s.useEffect)((function(){var e=document.getElementById(Up);e&&"#ghost-comments"===window.location.hash&&0===window.scrollY&&requestAnimationFrame((function(){requestAnimationFrame((function(){e.scrollIntoView()}))}))}),[]),Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)(Wp,{title:f,showCount:d,count:l}),Object(j.jsx)(_p,{}),Object(j.jsx)("div",{className:i?"":"mt-4","data-test":"comment-elements",children:h}),Object(j.jsx)("div",{children:n?null:a&&(v||!m)?Object(j.jsx)(up,{commentsCount:l}):Object(j.jsx)(oe,{isFirst:0===(null===i||void 0===i?void 0:i.total),isPaid:m})})]})},Kp=function(e){var t=function(e,t,n){var r=[e,t,n].map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}));return.2126*r[0]+.7152*r[1]+.0722*r[2]},n=Object(s.useContext)(A),r=n.accentColor,o=n.colorScheme,i=function(){if("light"===o)return!1;if("dark"===o)return!0;var e=getComputedStyle(document.getElementById(Up).parentNode).getPropertyValue("color"),n=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(/,\s*/);return function(e,n){var r=t(e[0],e[1],e[2]),o=t(n[0],n[1],n[2]);return(Math.max(r,o)+.05)/(Math.min(r,o)+.05)}([255,255,255],[n[0],n[1],n[2]])<5}()?"dark":"",a={"--gh-accent-color":null!==r&&void 0!==r?r:"blue",paddingTop:0,paddingBottom:24};return Object(j.jsx)("section",{className:"ghost-display "+i,style:a,"data-testid":"comments-box",children:e.done?Object(j.jsx)(j.Fragment,{children:Object(j.jsx)(qp,{})}):Object(j.jsx)(Hp,{})})},Jp=["title","titleId"];function Qp(){return Qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qp.apply(this,arguments)}function Gp(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Yp(e,t){var n=e.title,r=e.titleId,o=Gp(e,Jp);return s.createElement("svg",Qp({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"gh-portal-closeicon",alt:"Close",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,Vp||(Vp=s.createElement("defs",null,s.createElement("style",null,".a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.2px !important;}"))),$p||($p=s.createElement("path",{className:"a",d:"M.75 23.249l22.5-22.5M23.25 23.249L.75.749"})))}var Xp,Zp=s.forwardRef(Yp),eh=(n.p,function(e){return Object(j.jsx)("button",{className:"transition-opacity duration-100 ease-out absolute top-6 sm:top-10 right-6 sm:right-8 opacity-20 hover:opacity-40",onClick:e.close,children:Object(j.jsx)(Zp,{className:"w-[20px] h-[20px]"})})}),th=function(e){var t,n,r=Object(s.useRef)(null),o=Object(s.useRef)(null),i=Object(s.useContext)(A),a=i.dispatchAction,u=i.member,l=i.accentColor,c=p(Object(s.useState)(null!==(t=u.name)&&void 0!==t?t:""),2),f=c[0],d=c[1],h=p(Object(s.useState)(null!==(n=u.bio)&&void 0!==n?n:""),2),v=h[0],y=h[1],b=50;u.bio&&(b-=u.bio.length);var k=p(Object(s.useState)(b),2),w=k[0],x=k[1],D=p(Object(s.useState)({name:"",bio:""}),2),E=D[0],C=D[1],O=function(t){a("closePopup"),e.callback(t)},S=function(){var e=g(m().mark((function e(){var t;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""===f.trim()){e.next=6;break}return e.next=3,a("updateMember",{name:f,bio:v});case 3:O(!0),e.next=9;break;case 6:C({name:"Enter your name"}),d(""),null===(t=r.current)||void 0===t||t.focus();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(s.useEffect)((function(){if(!ee()){var t=setTimeout((function(){var t,n;e.bioAutofocus?null===(t=o.current)||void 0===t||t.focus():null===(n=r.current)||void 0===n||n.focus()}),200);return function(){clearTimeout(t)}}}),[r,o,e.bioAutofocus]);return Object(j.jsx)("div",{className:"overflow-hidden relative bg-white w-screen sm:w-[720px] h-screen sm:h-auto p-[28px] sm:p-0 rounded-none sm:rounded-xl text-center shadow-modal",onMouseDown:function(e){e.stopPropagation()},children:Object(j.jsxs)("div",{className:"flex",children:[!ee()&&Object(j.jsx)("div",{className:"flex flex-col justify-center items-center w-[40%] bg-[#1C1C1C]",children:Object(j.jsx)("div",{className:"flex flex-col gap-9 -mt-[1px]",children:function(e){for(var t,n=[],r=[{avatar:"https://randomuser.me/api/portraits/men/32.jpg",name:"James Fletcher",expertise:"Full-time parent"},{avatar:"https://randomuser.me/api/portraits/women/30.jpg",name:"Naomi Schiff",expertise:"Founder @ Acme Inc"},{avatar:"https://randomuser.me/api/portraits/men/4.jpg",name:"Franz Tost",expertise:"Neurosurgeon"},{avatar:"https://randomuser.me/api/portraits/women/51.jpg",name:"Katrina Klosp",expertise:"Local resident"}],o=0;o<r.length;o++)n.push((t=r[o],Object(j.jsx)(ut,{appear:!0,enter:"transition duration-200 delay-[400ms] ease-out",enterFrom:"opacity-0 translate-y-2",enterTo:"opacity-100 translate-y-0",leave:"transition duration-200 ease-in",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-2",children:Object(j.jsxs)("div",{className:"flex flex-row justify-start items-center gap-3 pr-4",children:[Object(j.jsx)("div",{className:"w-10 h-10 rounded-full border-2 border-white bg-no-repeat bg-cover",style:{backgroundImage:"url(".concat(t.avatar,")")}}),Object(j.jsxs)("div",{className:"flex flex-col justify-center items-start",children:[Object(j.jsx)("div",{className:"text-base font-sans font-semibold tracking-tight text-white",children:t.name}),Object(j.jsx)("div",{className:"font-sans text-[14px] tracking-tight text-neutral-400",children:t.expertise})]})]})},t.name)));return n}()})}),Object(j.jsxs)("div",{className:"".concat(ee()?"w-full":"w-[60%]"," p-0 sm:p-8"),children:[Object(j.jsxs)("h1",{className:"font-sans font-bold tracking-tight text-[24px] mb-1 text-black text-center sm:text-left",children:["Complete your profile",Object(j.jsx)("span",{className:"hidden sm:inline",children:"."})]}),Object(j.jsx)("p",{className:"font-sans text-base text-neutral-500 pr-0 sm:pr-10 leading-9 text-center sm:text-left",children:"Add context to your comment, share your name and expertise to foster a healthy discussion."}),Object(j.jsxs)("section",{className:"mt-8 text-left",children:[Object(j.jsxs)("div",{className:"flex flex-row mb-2 justify-between",children:[Object(j.jsx)("label",{htmlFor:"comments-name",className:"font-sans font-semibold text-[1.3rem]",children:"Name"}),Object(j.jsx)(ut,{show:!!E.name,enter:"transition duration-300 ease-out",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-100 ease-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:Object(j.jsx)("div",{className:"font-sans text-sm text-red-500",children:E.name})})]}),Object(j.jsx)("input",{id:"comments-name",className:"transition-[border-color] duration-200 font-sans text-[16px] px-3 rounded border border-neutral-200 focus:border-neutral-300 w-full outline-0 h-[42px] flex items-center ".concat(E.name&&"border-red-500 focus:border-red-500"),type:"text",name:"name",ref:r,value:f,placeholder:"Jamie Larson",onChange:function(e){d(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(d(e.target.value),S())},maxLength:"64"}),Object(j.jsxs)("div",{className:"flex flex-row mt-6 mb-2 justify-between",children:[Object(j.jsx)("label",{htmlFor:"comments-name",className:"font-sans font-semibold text-[1.3rem]",children:"Expertise"}),Object(j.jsxs)("div",{className:"font-sans text-[1.3rem] text-neutral-400 ".concat(0===w&&"text-red-500"),children:[Object(j.jsx)("b",{children:w})," characters left"]})]}),Object(j.jsx)("input",{id:"comments-bio",className:"transition-[border-color] duration-200 font-sans text-[16px] px-3 rounded border border-neutral-200 focus:border-neutral-300 w-full outline-0 h-[42px] flex items-center ".concat(0===w&&"border-red-500 focus:border-red-500"),type:"text",name:"bio",ref:o,value:v,placeholder:"Head of Marketing at Acme, Inc",onChange:function(e){var t=e.target.value;x(50-t.length),y(t)},onKeyDown:function(e){"Enter"===e.key&&(y(e.target.value),S())},maxLength:50}),Object(j.jsx)("button",{className:"transition-opacity duration-200 ease-linear w-full h-[42px] mt-10 px-8 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] opacity-100 hover:opacity-90",style:{backgroundColor:null!==l&&void 0!==l?l:"#000000"},onClick:S,children:"Save"})]})]}),Object(j.jsx)(eh,{close:function(){return O(!1)}})]})})},nh=["title","titleId"];function rh(){return rh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rh.apply(this,arguments)}function oh(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ih(e,t){var n=e.title,r=e.titleId,o=oh(e,nh);return s.createElement("svg",rh({width:"26px",height:"26px",viewBox:"-1 -1 26 26",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},o),n?s.createElement("title",{id:r},n):null,Xp||(Xp=s.createElement("g",{id:"check-circle",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},s.createElement("path",{className:"animated-check-circle",d:"M19.6004116,2.71490714 C17.5353801,1.0196018 14.8927356,0 12,0 C5.38938053,0 0,5.38938053 0,12 C0,18.6106195 5.38938053,24 12,24 C18.6106195,24 24,18.6106195 24,12 C24,9.71681416 23.3628319,7.59292035 22.2743363,5.78761062 L11.0442478,17.0442478 L5.49557522,11.4955752",id:"Shape",stroke:"#FFFFFF",strokeWidth:2}))))}var ah=s.forwardRef(ih),sh=(n.p,{addDetailsDialog:th,reportDialog:function(e){var t,n=Object(s.useContext)(A).dispatchAction,r=p(Object(s.useState)("default"),2),o=r[0],i=r[1],a="bg-red-600";"sent"===o&&(a="bg-green-600");var u="Report this comment";"sending"===o?u="Sending":"sent"===o&&(u="Sent");var l=null;"sending"===o?l=Object(j.jsx)(Xd,{className:"w-[24px] h-[24px] mr-2 fill-white"}):"sent"===o&&(l=Object(j.jsx)(ah,{className:"w-[16px] h-[16px] mr-2"}));var c=function(e){n("closePopup")};return Object(j.jsxs)("div",{className:"relative bg-white w-screen sm:w-[500px] h-screen sm:h-auto p-[28px] sm:p-8 rounded-none sm:rounded-xl text-center sm:text-left shadow-modal",onMouseDown:function(e){e.stopPropagation()},children:[Object(j.jsxs)("h1",{className:"font-sans font-bold tracking-tight text-[24px] mb-1 text-black",children:["You want to report",Object(j.jsx)("span",{className:"hidden sm:inline",children:" this comment"}),"?"]}),Object(j.jsx)("p",{className:"font-sans text-base text-neutral-500 px-4 sm:pr-4 sm:pl-0 leading-9",children:"Your request will be sent to the owner of this site."}),Object(j.jsxs)("div",{className:"flex flex-col sm:flex-row justify-start items-center gap-4 mt-10",children:[Object(j.jsxs)("button",{className:"transition duration-200 ease-linear w-full sm:w-[200px] h-[44px] px-4 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] ".concat(a," opacity-100 hover:opacity-90"),onClick:function(t){t.stopPropagation(),i("sending"),setTimeout((function(){i("sent"),n("reportComment",e.comment),setTimeout((function(){c()}),750)}),1e3)},style:{backgroundColor:null!==(t=a)&&void 0!==t?t:"#000000"},children:[l,u]}),Object(j.jsx)("button",{type:"button",onClick:c,className:"font-sans text-sm font-medium text-neutral-500 dark:text-neutral-400",children:"Cancel"})]}),Object(j.jsx)(eh,{close:function(){return c()}})]})}}),uh=function(e){var t=Object(s.useContext)(A).dispatchAction,n=function(n){t("closePopup"),e.callback&&e.callback(!1)};return Object(s.useEffect)((function(){var e=function(e){"Escape"===e.key&&n()};return window.addEventListener("keydown",e,{passive:!0}),function(){window.removeEventListener("keydown",e,{passive:!0})}})),Object(j.jsx)(ut,{show:e.show,appear:!0,children:Object(j.jsx)(F,{type:"fixed",children:Object(j.jsx)("div",{children:Object(j.jsx)(ut.Child,{enter:"transition duration-200 linear",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition duration-200 linear",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:Object(j.jsx)("div",{className:"fixed top-0 left-0 overflow-hidden w-screen h-screen flex pt-0 sm:pt-12 justify-center bg-gradient-to-b from-[rgba(0,0,0,0.2)] to-rgba(0,0,0,0.1) backdrop-blur-[2px]",onMouseDown:n,children:Object(j.jsx)(ut.Child,{enter:"transition duration-200 delay-150 linear",enterFrom:"translate-y-4 opacity-0",enterTo:"translate-y-0 opacity-100",leave:"transition duration-200 linear",leaveFrom:"translate-y-0 opacity-100",leaveTo:"translate-y-4 opacity-0",children:e.children})})})})})})},lh=["type"];function ch(e){var t=Object(s.useContext)(A).popup,n=p(Object(s.useState)(t),2),r=n[0],o=n[1];if(Object(s.useEffect)((function(){if(null!==t&&o(t),null===t){var e=setTimeout((function(){o(null)}),250);return function(){clearTimeout(e)}}}),[t,o]),!r||!r.type)return null;var u=null!==t&&void 0!==t?t:r,l=u.type,c=a(u,lh),f=sh[l];if(!f)return console.warn("Unknown popup of type ",l),null;var d=t===r;return Object(j.jsx)(j.Fragment,{children:Object(j.jsx)(uh,{show:d,callback:c.callback,children:Object(j.jsx)(f,i({},c))})})}function fh(e){var t=e.adminUrl,n=e.onLoad;return Object(j.jsx)("iframe",{"data-frame":"admin-auth",src:t+"auth-frame/",style:{display:"none"},title:"auth-frame",onLoad:n})}function dh(e){var t=e.done;e.appVersion;return Object(j.jsx)(F,{title:"comments-box",children:Object(j.jsx)(Kp,{done:t})})}function ph(e){e.dsn;var t=e.children;return Object(j.jsx)(j.Fragment,{children:t})}var hh=function(e){x(n,e);var t=S(n);function n(e){var r;return y(this,n),(r=t.call(this,e)).state={action:"init:running",initStatus:"running",member:null,admin:null,comments:null,pagination:null,popupNotification:null,customSiteUrl:e.customSiteUrl,postId:e.postId,popup:null,accentColor:e.accentColor},r.adminApi=null,r.GhostApi=null,r}return k(n,[{key:"initSetup",value:function(){var e=g(m().mark((function e(){var t,n,r,o,i,a,s;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.fetchApiData();case 3:return t=e.sent,n=t.member,e.next=7,this.fetchComments();case 7:r=e.sent,o=r.comments,i=r.pagination,a=r.count,s={member:n,action:"init:success",initStatus:"success",comments:o,pagination:i,commentCount:a},this.setState(s),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(0),console.error("[Comments] Failed to initialize:",e.t0),this.setState({action:"init:failed",initStatus:"failed"});case 19:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(){return e.apply(this,arguments)}}()},{key:"initAdminAuth",value:function(){var e=g(m().mark((function e(){var t,n;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.adminApi=this.setupAdminAPI(),t=null,e.prev=3,e.next=6,this.adminApi.getUser();case 6:t=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),console.warn("[Comments] Failed to fetch current admin user:",e.t0);case 12:n={admin:t},this.setState(n),e.next=19;break;case 16:e.prev=16,e.t1=e.catch(0),console.error("[Comments] Failed to initialize admin authentication:",e.t1);case 19:case"end":return e.stop()}}),e,this,[[0,16],[3,9]])})));return function(){return e.apply(this,arguments)}}()},{key:"dispatchAction",value:function(){var e=g(m().mark((function e(t,n){var r,o,i=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this.timeoutId),this.setState({action:"".concat(t,":running")}),e.prev=2,e.next=5,J({action:t,data:n,state:this.state,api:this.GhostApi,adminApi:this.adminApi});case 5:r=e.sent,this.setState(r),r&&r.action&&!r.action.includes(":failed")&&(this.timeoutId=setTimeout((function(){i.setState({action:""})}),2e3)),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(2),console.error(e.t0),o=G({type:"".concat(t,":failed"),autoHide:!0,closeable:!0,status:"error",state:this.state,meta:{error:e.t0}}),this.setState({action:"".concat(t,":failed"),popupNotification:o});case 15:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fetchApiData",value:function(){var e=g(m().mark((function e(){var t,n,r,o,i,a,s;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props,n=t.siteUrl,r=t.customSiteUrl,o=t.apiUrl,i=t.apiKey,e.prev=1,this.GhostApi=this.props.api||re({siteUrl:n,apiUrl:o,apiKey:i}),e.next=5,this.GhostApi.init();case 5:return a=e.sent,s=a.member,this.setupSentry(),e.abrupt("return",{member:s});case 11:if(e.prev=11,e.t0=e.catch(1),!ne(["dev","test"],{customSiteUrl:r})){e.next=15;break}return e.abrupt("return",{});case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,this,[[1,11]])})));return function(){return e.apply(this,arguments)}}()},{key:"fetchComments",value:function(){var e=g(m().mark((function e(){var t,n,r,o,i,a;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.GhostApi.comments.browse({page:1,postId:this.state.postId}),n=this.GhostApi.comments.count({postId:this.state.postId}),e.next=4,Promise.all([t,n]);case 4:return r=e.sent,o=p(r,2),i=o[0],a=o[1],e.abrupt("return",{comments:i.comments,pagination:i.meta.pagination,count:a});case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setupAdminAPI",value:function(){var e=document.querySelector('iframe[data-frame="admin-auth"]'),t=1,n={},r=new URL(this.props.adminUrl).origin;function o(o,a){return new Promise((function(s,u){n[t+=1]=function(e,t){return e?u(e):s(t)},e.contentWindow.postMessage(JSON.stringify(i({uid:t,action:o},a)),r)}))}return window.addEventListener("message",(function(e){if(e.origin===r){var t=null;try{t=JSON.parse(e.data)}catch(i){return void console.error("Error parsing event data",i)}var o=n[t.uid];o&&(delete n[t.uid],o(t.error,t.result))}})),{getUser:function(){return g(m().mark((function e(){var t;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o("getUser");case 2:return t=e.sent,e.abrupt("return",t.users[0]);case 4:case"end":return e.stop()}}),e)})))()},hideComment:function(e){return g(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o("hideComment",{id:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},showComment:function(e){return g(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o("showComment",{id:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()}}}},{key:"setupSentry",value:function(){}},{key:"getContextFromState",value:function(){var e=this,t=this.state,n=t.action,r=t.popupNotification,o=t.customSiteUrl,i=t.member,a=t.comments,s=t.pagination,u=t.commentCount,l=t.postId,c=t.admin,f=t.popup;return{action:n,popupNotification:r,customSiteUrl:o,member:i,admin:c,comments:a,pagination:s,commentCount:u,postId:l,title:this.props.title,showCount:this.props.showCount,colorScheme:this.props.colorScheme,avatarSaturation:this.props.avatarSaturation,accentColor:this.props.accentColor,commentsEnabled:this.props.commentsEnabled,appVersion:this.props.appVersion,stylesUrl:this.props.stylesUrl,publication:this.props.publication,popup:f,dispatchAction:function(t,n){return e.dispatchAction(t,n)},onAction:function(t,n){return e.dispatchAction(t,n)}}}},{key:"componentDidMount",value:function(){this.initSetup()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeoutId)}},{key:"render",value:function(){var e="success"===this.state.initStatus;return Object(j.jsx)(ph,{dsn:this.props.sentryDsn,children:Object(j.jsxs)(A.Provider,{value:this.getContextFromState(),children:[Object(j.jsx)(dh,{done:e}),Object(j.jsx)(fh,{adminUrl:this.props.adminUrl,onLoad:this.initAdminAuth.bind(this)}),Object(j.jsx)(ch,{})]})})}}]),n}(u.a.Component),mh=["siteUrl"];function vh(e){e.siteUrl;!function(){var e=document.querySelector("script[data-ghost-comments]");if(e){var t=document.createElement("div");t.id=Up,e.parentElement.insertBefore(t,e)}else console.warn("[Comments] Comment box location was not found: could not load comments box.")}(),function(){var e=new URL(window.location.href);e.searchParams.get("token")&&(e.searchParams.delete("token"),window.history.replaceState({},document.title,e.href))}()}!function(){var e=function(){var e=document.querySelector("script[data-ghost-comments]");if(e){var t,n=e.dataset.ghostComments,r=e.dataset.key,o=e.dataset.api,i=e.dataset.admin,a=e.dataset.sentryDsn,s=e.dataset.postId,u=e.dataset.colorScheme,l=e.dataset.avatarSaturation,c=e.dataset.accentColor,f=e.dataset.appVersion,d=e.dataset.commentsEnabled;return{siteUrl:n,stylesUrl:e.dataset.styles,apiKey:r,apiUrl:o,sentryDsn:a,postId:s,adminUrl:i,colorScheme:u,avatarSaturation:l,accentColor:c,appVersion:f,commentsEnabled:d,title:"null"===e.dataset.title?null:e.dataset.title,showCount:"true"===e.dataset.count,publication:null!==(t=e.dataset.publication)&&void 0!==t?t:""}}return{}}(),t=e.siteUrl,n=a(e,mh),r=t||window.location.origin;vh({siteUrl:r}),c.a.render(Object(j.jsx)(u.a.StrictMode,{children:Object(j.jsx)(hh,i({siteUrl:r,customSiteUrl:t},n))}),document.getElementById(Up))}()}]);
|
|
3
3
|
//# sourceMappingURL=comments-ui.min.js.map
|