@tryghost/comments-ui 0.10.1 → 0.10.3
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/package.json +9 -16
- package/umd/comments-ui.min.js +1 -1
- package/umd/comments-ui.min.js.map +1 -1
- package/umd/main.css +1 -1
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=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 y(){}function g(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")},y.prototype=v.prototype;var b=g.prototype=new y;b.constructor=g,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 C(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var E=/\/+/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(E,"$&/")+"/"),S(a,t,n,"",(function(e){return e}))):null!=a&&(C(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(E,"$&/")+"/")+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 M={current:null};function N(){var e=M.current;if(null===e)throw Error(p(321));return e}var T={ReactCurrentDispatcher:M,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(!C(e))throw Error(p(143));return e}},t.Component=v,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 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=C,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 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(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 y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[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];y[t]=new v(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[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){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new v(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new v(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new v(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new v(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(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(g,b);y[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(g,b);y[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(g,b);y[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[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,C=60107,E=60108,O=60114,S=60109,A=60110,j=60112,M=60113,N=60120,T=60115,F=60116,R=60121,P=60128,B=60129,I=60130,L=60131;if("function"===typeof Symbol&&Symbol.for){var z=Symbol.for;x=z("react.element"),D=z("react.portal"),C=z("react.fragment"),E=z("react.strict_mode"),O=z("react.profiler"),S=z("react.provider"),A=z("react.context"),j=z("react.forward_ref"),M=z("react.suspense"),N=z("react.suspense_list"),T=z("react.memo"),F=z("react.lazy"),R=z("react.block"),z("react.scope"),P=z("react.opaque.id"),B=z("react.debug_trace_mode"),I=z("react.offscreen"),L=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 J(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 C:return"Fragment";case D:return"Portal";case O:return"Profiler";case E:return"StrictMode";case M:return"Suspense";case N: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 J(e.type);case R:return J(e._render);case F:t=e._payload,e=e._init;try{return J(e(t))}catch(n){}}return null}function K(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=K(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=K(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,K(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=""+K(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:K(n)}}function le(e,t){var n=K(t.value),r=K(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,ye=(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 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 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 Ce(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 Ee(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 Me(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 Ne(e){Ae?je?je.push(e):je=[e]:Ae=e}function Te(){if(Ae){var e=Ae,t=je;if(je=Ae=null,Me(e),t)for(e=0;e<t.length;e++)Me(t[e])}}function Fe(e,t){return e(t)}function Re(e,t,n,r,o){return e(t,n,r,o)}function Pe(){}var Be=Fe,Ie=!1,Le=!1;function ze(){null===Ae&&null===je||(Pe(),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,Je=null,Ke={onError:function(e){Ue=!0,We=e}};function Qe(e,t,n,r,o,i,a,s,u){Ue=!1,We=null,He.apply(Ke,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 yt(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 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!==lt&>(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;)yt(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 Ct={animationend:Dt("Animation","AnimationEnd"),animationiteration:Dt("Animation","AnimationIteration"),animationstart:Dt("Animation","AnimationStart"),transitionend:Dt("Transition","TransitionEnd")},Et={},Ot={};function St(e){if(Et[e])return Et[e];if(!Ct[e])return e;var t,n=Ct[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ot)return Et[e]=n[t];return e}f&&(Ot=document.createElement("div").style,"AnimationEvent"in window||(delete Ct.animationend.animation,delete Ct.animationiteration.animation,delete Ct.animationstart.animation),"TransitionEvent"in window||delete Ct.transitionend.transition);var At=St("animationend"),jt=St("animationiteration"),Mt=St("animationstart"),Nt=St("transitionend"),Tt=new Map,Ft=new Map,Rt=["abort","abort",At,"animationEnd",jt,"animationIteration",Mt,"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 Pt(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 It(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 Lt(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=It(u),o=Bt):0!==(s&=i)&&(r=It(s),o=Bt)}else 0!==(i=n&~a)?(r=It(i),o=Bt):0!==s&&(r=It(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(It(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 Jt=i.unstable_UserBlockingPriority,Kt=i.unstable_runWithPriority,Qt=!0;function Gt(e,t,n,r){Ie||Pe();var o=Xt,i=Ie;Ie=!0;try{Re(o,e,t,n,r)}finally{(Ie=i)||ze()}}function Yt(e,t,n,r){Kt(Jt,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)}Pr(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 Pr(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}}),yn=un(vn),gn=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})),Cn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},En={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=Cn[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?En[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}}),Mn=un(jn),Nn=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})),Rn=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}),Pn=un(Rn),Bn=[9,13,27,32],In=f&&"CompositionEvent"in window,Ln=null;f&&"documentMode"in document&&(Ln=document.documentMode);var zn=f&&"TextEvent"in window&&!Ln,_n=f&&(!In||Ln&&8<Ln&&11>=Ln),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 Jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function Kn(e,t,n,r){Ne(r),0<(t=Ir(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(Kn(t,Gn,e,Oe(e)),e=Yn,Ie)e(t);else{Ie=!0;try{Fe(e,t)}finally{Ie=!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 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 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)&&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=Ir(kr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}Pt("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),Pt("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),Pt(Rt,2);for(var Cr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Er=0;Er<Cr.length;Er++)Ft.set(Cr[Er],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,Je=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=Je,qe=!1,Je=null,e}function Mr(e,t){var n=ao(t),r=e+"__bubble";n.has(r)||(Rr(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){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),Rr(i,e,o,t),a.add(s))}function Rr(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 Pr(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{Be(e,t,n)}finally{Le=!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=Mn;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=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 At:case jt:case Mt:u=kn;break;case Nt:u=Fn;break;case"scroll":u=mn;break;case"wheel":u=Pn;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 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=yn,m="onMouseLeave",d="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=Nn,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=Lr(p))h++;for(p=0,m=d;m;m=Lr(m))p++;for(;0<h-p;)c=Lr(c),h--;for(;0<p-h;)d=Lr(d),p--;for(;h--;){if(c===d||null!==d&&c===d.alternate)break e;c=Lr(c),d=Lr(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(Jn(s))if(er)v=lr;else{v=sr;var y=ar}else(u=s.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(v=ur);switch(v&&(v=v(e,r))?Kn(a,v,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":(Jn(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,Dr(a,n,o);break;case"selectionchange":if(gr)break;case"keydown":case"keyup":Dr(a,n,o)}var g;if(In)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&&(g=rn()):(tn="value"in(en=o)?en.value:en.textContent,Wn=!0)),0<(y=Ir(r,b)).length&&(b=new Dn(b,e,null,n,o),a.push({event:b,listeners:y}),g?b.data=g:null!==(g=Un(n))&&(b.data=g))),(g=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||!In&&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=Ir(r,"onBeforeInput")).length&&(o=new Dn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=g))}jr(a,t)}))}function Br(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ir(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 Lr(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 Jr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Kr(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 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(){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,J(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 Co=null,Eo=null,Oo=i.unstable_runWithPriority,So=i.unstable_scheduleCallback,Ao=i.unstable_cancelCallback,jo=i.unstable_shouldYield,Mo=i.unstable_requestPaint,No=i.unstable_now,To=i.unstable_getCurrentPriorityLevel,Fo=i.unstable_ImmediatePriority,Ro=i.unstable_UserBlockingPriority,Po=i.unstable_NormalPriority,Bo=i.unstable_LowPriority,Io=i.unstable_IdlePriority,Lo={},zo=void 0!==Mo?Mo:function(){},_o=null,Vo=null,$o=!1,Ho=No(),Uo=1e4>Ho?No:function(){return No()-Ho};function Wo(){switch(To()){case Fo:return 99;case Ro:return 98;case Po:return 97;case Bo:return 96;case Io:return 95;default:throw Error(a(332))}}function qo(e){switch(e){case 99:return Fo;case 98:return Ro;case 97:return Po;case 96:return Bo;case 95:return Io;default:throw Error(a(332))}}function Jo(e,t){return e=qo(e),Oo(e,t)}function Ko(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;Jo(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)&&(Ia=!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 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)&&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=go(t)?vo: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=vi,li(e);var i=t.contextType;"object"===typeof i&&null!==i?o.context=si(i):(i=go(t)?vo: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 Di=Array.isArray;function Ci(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 Ei(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=Ci(e,t,n),r.return=e,r):((r=Ju(n.type,n.key,n.props,null,e.mode,r)).ref=Ci(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=Ku(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=Ju(t.type,t.key,t.props,null,e.mode,n)).ref=Ci(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=Ku(t,e.mode,n,null)).return=e,t;Ei(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===C?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);Ei(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===C?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);Ei(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 y=p(o,f,s[m],u);if(null===y){null===f&&(f=v);break}e&&f&&null===y.alternate&&t(o,f),a=i(y,a,m),null===c?l=y:c.sibling=y,c=y,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,y=null,g=u.next();null!==m&&!g.done;v++,g=u.next()){m.index>v?(y=m,m=null):y=m.sibling;var b=p(o,m,g.value,l);if(null===b){null===m&&(m=y);break}e&&m&&null===b.alternate&&t(o,m),s=i(b,s,v),null===f?c=b:f.sibling=b,f=b,m=y}if(g.done)return n(o,m),c;if(null===m){for(;!g.done;v++,g=u.next())null!==(g=d(o,g.value,l))&&(s=i(g,s,v),null===f?c=g:f.sibling=g,f=g);return c}for(m=r(o,m);!g.done;v++,g=u.next())null!==(g=h(m,o,v,g.value,l))&&(e&&null!==g.alternate&&m.delete(null===g.key?v:g.key),s=i(g,s,v),null===f?c=g:f.sibling=g,f=g);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===C&&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===C){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=Ci(e,l,i),r.return=e,e=r;break e}n(e,l);break}t(e,l),l=l.sibling}i.type===C?((r=Ku(i.props.children,e.mode,u,i.key)).return=e,e=r):((u=Ju(i.type,i.key,i.props,null,e.mode,u)).ref=Ci(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&&Ei(e,i),"undefined"===typeof i&&!l)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,J(e.type)||"Component"))}return n(e,r)}}var Si=Oi(!0),Ai=Oi(!1),ji={},Mi=lo(ji),Ni=lo(ji),Ti=lo(ji);function Fi(e){if(e===ji)throw Error(a(174));return e}function Ri(e,t){switch(fo(Ti,t),fo(Ni,e),fo(Mi,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(Mi),fo(Mi,t)}function Pi(){co(Mi),co(Ni),co(Ti)}function Bi(e){Fi(Ti.current);var t=Fi(Mi.current),n=he(t,e.type);t!==n&&(fo(Ni,e),fo(Mi,n))}function Ii(e){Ni.current===e&&(co(Mi),co(Ni))}var Li=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=Kr(n.nextSibling))||!Ui(e,t))return e.flags=-1025&e.flags|2,$i=!1,void(_i=e);Hi(_i,n)}_i=e,Vi=Kr(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 Ji(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=Kr(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=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Vi=null}}else Vi=_i?Kr(e.stateNode.nextSibling):null;return!0}function Ki(){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:Ra,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=Pa,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)||(Ia=!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)||(Ia=!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=Na.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=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 la().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=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 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 Da(e,t){return wa(516,4,e,t)}function Ca(e,t){return wa(4,2,e,t)}function Ea(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,Ea.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 Ma(e,t){var n=Wo();Jo(98>n?98:n,(function(){e(!0)})),Jo(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,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,Ea.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: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 ga(e=Ma.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:P,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,ya(5,(function(){n("r:"+(Gr++).toString(36))}),void 0,null)),t}return va(t="r:"+(Gr++).toString(36)),t},unstable_isNewReconciler:!1},Ra={readContext:si,useCallback:Aa,useContext:si,useEffect:Da,useImperativeHandle:Oa,useLayoutEffect:Ca,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},Pa={readContext:si,useCallback:Aa,useContext:si,useEffect:Da,useImperativeHandle:Oa,useLayoutEffect:Ca,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,Ia=!1;function La(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||Ia?(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 _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=Ju(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(Ia=!1,0===(i&o))return t.lanes=e.lanes,is(e,t,i);0!==(16384&e.flags)&&(Ia=!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 La(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=go(n)?vo:ho.current;return i=yo(t,i),ai(t,o),n=sa(e,t,n,r,i,o),null===e||Ia?(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 Wa(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,l=n.contextType;"object"===typeof l&&null!==l?l=si(l):l=yo(t,l=go(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&&(yi(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=yo(t,u=go(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&&(yi(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)):La(e,t,s,i),t.memoizedState=r.state,o&&Do(t,n,!0),t.child}function Ja(e){var t=e.stateNode;t.pendingContext?ko(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ko(0,t.context,!1),Ri(e,t.containerInfo)}var Ka,Qa,Ga,Ya={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&&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=Ku(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=Ku(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===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 go(t.type)&&bo(),null;case 3:return Pi(),co(mo),co(ho),Gi(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ji(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Ii(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(Mi.current),Ji(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xr]=t,r[Zr]=s,n){case"dialog":Mr("cancel",r),Mr("close",r);break;case"iframe":case"object":case"embed":Mr("load",r);break;case"video":case"audio":for(e=0;e<Or.length;e++)Mr(Or[e],r);break;case"source":Mr("error",r);break;case"img":case"image":case"link":Mr("error",r),Mr("load",r);break;case"details":Mr("toggle",r);break;case"input":ee(r,s),Mr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Mr("invalid",r);break;case"textarea":ue(r,s),Mr("invalid",r)}for(var l in Ce(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&&Mr("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,Ka(e,t),t.stateNode=e,l=Ee(n,r),n){case"dialog":Mr("cancel",e),Mr("close",e),i=r;break;case"iframe":case"object":case"embed":Mr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Or.length;i++)Mr(Or[i],e);i=r;break;case"source":Mr("error",e),i=r;break;case"img":case"image":case"link":Mr("error",e),Mr("load",e),i=r;break;case"details":Mr("toggle",e),i=r;break;case"input":ee(e,r),i=Z(e,r),Mr("invalid",e);break;case"option":i=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=o({},r,{value:void 0}),Mr("invalid",e);break;case"textarea":ue(e,r),i=se(e,r),Mr("invalid",e);break;default:i=r}Ce(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)&&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&&Mr("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",""+K(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(Mi.current),Ji(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(Li),r=t.memoizedState,0!==(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Ji(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===Fs||0===(134217727&Vs)&&0===(134217727&$s)||gu(Fs,Ps))),(r||n)&&(t.flags|=4),null);case 4:return Pi(),null===e&&Tr(t.stateNode.containerInfo),null;case 10:return oi(t),null;case 19:if(co(Li),null===(r=t.memoizedState))return null;if(s=0!==(64&t.flags),null===(l=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!==(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(Li,1&Li.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=Li.current,fo(Li,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:go(e.type)&&bo();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Pi(),co(mo),co(ho),Gi(),0!==(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Ii(e),null;case 13:return co(Li),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return co(Li),null;case 4:return Pi(),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}))}}Ka=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(Mi.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 Ce(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&&Mr("scroll",e),s||l===c||(s=[])):"object"===typeof c&&null!==c&&c.$$typeof===P?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&&Jr(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)&&(Iu(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 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(Eo&&"function"===typeof Eo.onCommitFiberUnmount)try{Eo.onCommitFiberUnmount(Co,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))Iu(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:Es(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?Ds(e,n,t):Cs(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 Cs(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(Cs(e,t,n),e=e.sibling;null!==e;)Cs(e,t,n),e=e.sibling}function Es(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),Ee(e,o),t=Ee(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":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(),gs(t.child,!0)),void Ss(t);case 19:return void Ss(t);case 23:case 24:return void gs(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,Ms=w.ReactCurrentDispatcher,Ns=w.ReactCurrentOwner,Ts=0,Fs=null,Rs=null,Ps=0,Bs=0,Is=lo(0),Ls=0,zs=null,_s=0,Vs=0,$s=0,Hs=0,Us=null,Ws=0,qs=1/0;function Js(){qs=Uo()+500}var Ks,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===Ls&&gu(e,Ps));var r=Wo();1===t?0!==(8&Ts)&&0===(48&Ts)?bu(e):(vu(e,n),0===Ts&&(Js(),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,It(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=Lt(e,e===Fs?Ps:0),t=Bt,0===r)null!==n&&(n!==Lo&&Ao(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Lo&&Ao(n)}15===t?(n=bu.bind(null,e),null===_o?(_o=[n],Vo=So(Fo,Go)):_o.push(n),n=Lo):14===t?n=Ko(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=Ko(n,yu.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function yu(e){if(su=-1,lu=uu=0,0!==(48&Ts))throw Error(a(327));var t=e.callbackNode;if(Pu()&&e.callbackNode!==t)return null;var n=Lt(e,e===Fs?Ps:0);if(0===n)return null;var r=n,o=Ts;Ts|=16;var i=Ou();for(Fs===e&&Ps===r||(Js(),Cu(e,r));;)try{ju();break}catch(u){Eu(e,u)}if(ri(),Ms.current=i,Ts=o,null!==Rs?r=0:(Fs=null,Ps=0,r=Ls),0!==(_s&$s))Cu(e,0);else if(0!==r){if(2===r&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Jr(e.containerInfo)),0!==(n=zt(e))&&(r=Su(e,n))),1===r)throw t=zs,Cu(e,0),gu(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(gu(e,n),(62914560&n)===n&&10<(r=Ws+500-Uo())){if(0!==Lt(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(gu(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?yu.bind(null,e):null}function gu(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(Pu(),e===Fs&&0!==(e.expiredLanes&Ps)){var t=Ps,n=Su(e,t);0!==(_s&$s)&&(n=Su(e,t=Lt(e,t)))}else n=Su(e,t=Lt(e,0));if(0!==e.tag&&2===n&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Jr(e.containerInfo)),0!==(t=zt(e))&&(n=Su(e,t))),1===n)throw n=zs,Cu(e,0),gu(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)&&(Js(),Qo())}}function wu(e,t){var n=Ts;Ts&=-2,Ts|=8;try{return e(t)}finally{0===(Ts=n)&&(Js(),Qo())}}function xu(e,t){fo(Is,Bs),Bs|=t,_s|=t}function Du(){Bs=Is.current,co(Is)}function Cu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,qr(n)),null!==Rs)for(n=Rs.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&bo();break;case 3:Pi(),co(mo),co(ho),Gi();break;case 5:Ii(r);break;case 4:Pi();break;case 13:case 19:co(Li);break;case 10:oi(r);break;case 23:case 24:Du()}n=n.return}Fs=e,Rs=qu(e.current,null),Ps=Bs=_s=t,Ls=0,zs=null,Hs=$s=Vs=0}function Eu(e,t){for(;;){var n=Rs;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,Ns.current=null,null===n||null===n.return){Ls=1,zs=t,Rs=null;break}e:{var i=e,a=n.return,s=n,u=t;if(t=Ps,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&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 m=d.memoizedProps;p=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!f)}}if(p){var v=d.updateQueue;if(null===v){var y=new Set;y.add(l),d.updateQueue=y}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 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(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((J(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=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)}Nu(n)}catch(D){t=D,Rs===n&&null!==n&&(Rs=n=n.return);continue}break}}function Ou(){var e=Ms.current;return Ms.current=Ta,null===e?Ta:e}function Su(e,t){var n=Ts;Ts|=16;var r=Ou();for(Fs===e&&Ps===t||Cu(e,t);;)try{Au();break}catch(o){Eu(e,o)}if(ri(),Ts=n,Ms.current=r,null!==Rs)throw Error(a(261));return Fs=null,Ps=0,Ls}function Au(){for(;null!==Rs;)Mu(Rs)}function ju(){for(;null!==Rs&&!jo();)Mu(Rs)}function Mu(e){var t=Ks(e.alternate,e,Bs);e.memoizedProps=e.pendingProps,null===t?Nu(e):Rs=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,Bs)))return void(Rs=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(Rs=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Rs=t);Rs=t=e}while(null!==t);0===Ls&&(Ls=5)}function Tu(e){var t=Wo();return Jo(99,Fu.bind(null,e,t)),null}function Fu(e,t){do{Pu()}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&&(Rs=Fs=null,Ps=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,Vr=Qt,yr(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,y=null;t:for(;;){for(var g;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!==(g=v.firstChild);)y=v,v=g;for(;;){if(v===s)break t;if(y===u&&++h===i&&(d=f),y===l&&++m===c&&(p=f),null!==(g=v.nextSibling))break;y=(v=y).parentNode}v=g}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{Ru()}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&&ge(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:Es(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&&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}Qt=!!Vr,$r=Vr=null,e.current=n,Qs=r;do{try{for(b=e;null!==Qs;){var D=Qs.flags;if(36&D&&ys(b,Qs.alternate,Qs),128&D){k=void 0;var C=Qs.ref;if(null!==C){var E=Qs.stateNode;Qs.tag,k=E,"function"===typeof C?C(k):C.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,Eo&&"function"===typeof Eo.onCommitFiberRoot)try{Eo.onCommitFiberRoot(Co,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 Ru(){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,Ko(97,(function(){return Pu(),null}))),Qs=Qs.nextEffect}}function Pu(){if(90!==tu){var e=97<tu?97:tu;return tu=90,Jo(e,Lu)}return!1}function Bu(e,t){nu.push(t,e),Zs||(Zs=!0,Ko(97,(function(){return Pu(),null})))}function Iu(e,t){ru.push(t,e),Zs||(Zs=!0,Ko(97,(function(){return Pu(),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(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&&(Ps&n)===n&&(4===Ls||3===Ls&&(62914560&Ps)===Ps&&500>Uo()-Ws?Cu(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 Ju(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 C:return Ku(n.children,o,i,t);case B:s=8,o|=16;break;case E: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 M:return(e=Uu(13,n,t,o)).type=M,e.elementType=M,e.lanes=i,e;case N:return(e=Uu(19,n,t,o)).elementType=N,e.lanes=i,e;case I:return Qu(n,o,i,t);case L:return(e=Uu(24,n,t,o)).elementType=L,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 R: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 Ku(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=I,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(go(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(go(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)}Ks=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||mo.current)Ia=!0;else{if(0===(n&r)){switch(Ia=!1,t.tag){case 3:Ja(t),Ki();break;case 5:Bi(t);break;case 1:go(t.type)&&xo(t);break;case 4:Ri(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,$a(e,t,n)}return is(e,t,n)}Ia=0!==(16384&e.flags)}else Ia=!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,li(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=qa(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 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(Ja(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)Ki(),t=is(e,t,n);else{if((i=(o=t.stateNode).hydrate)&&(Vi=Kr(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 La(e,t,r,n),Ki();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),La(e,t,s,n),t.child;case 6:return null===e&&Wi(t),null;case 13:return Xa(e,t,n);case 4:return Ri(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Si(t,null,r,n):La(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 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=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}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),_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,go(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,Re=function(e,t,n,r,o){var i=Ts;Ts|=4;try{return Jo(98,e.bind(null,t,n,r,o))}finally{0===(Ts=i)&&(Js(),Qo())}},Pe=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()}(),Pu())},Be=function(e,t){var n=Ts;Ts|=2;try{return e(t)}finally{0===(Ts=n)&&(Js(),Qo())}};var ul={Events:[ro,oo,io,Ne,Te,Pu,{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{Co=fl.inject(cl),Eo=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 Jo(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,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):(v=!1,y=null)}catch(n){throw x.postMessage(null),n}}else v=!1},r=function(e){y=e,v||(v=!0,x.postMessage(null))},o=function(e,n){g=p((function(){e(t.unstable_now())}),n)},i=function(){h(g),g=-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 C(e){return void 0===(e=e[0])?null:e}function E(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,M=null,N=3,T=!1,F=!1,R=!1;function P(e){for(var t=C(A);null!==t;){if(null===t.callback)E(A);else{if(!(t.startTime<=e))break;E(A),t.sortIndex=t.expirationTime,D(S,t)}t=C(A)}}function B(e){if(R=!1,P(e),!F)if(null!==C(S))F=!0,r(I);else{var t=C(A);null!==t&&o(B,t.startTime-e)}}function I(e,n){F=!1,R&&(R=!1,i()),T=!0;var r=N;try{for(P(n),M=C(S);null!==M&&(!(M.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=M.callback;if("function"===typeof a){M.callback=null,N=M.priorityLevel;var s=a(M.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?M.callback=s:M===C(S)&&E(S),P(n)}else E(S);M=C(S)}if(null!==M)var u=!0;else{var l=C(A);null!==l&&o(B,l.startTime-n),u=!1}return u}finally{M=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(){F||T||(F=!0,r(I))},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_getFirstCallbackNode=function(){return C(S)},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:j++,callback:n,priorityLevel:e,startTime:a,expirationTime:u=a+u,sortIndex:-1},a>s?(e.sortIndex=a,D(A,e),null===C(S)&&e===C(A)&&(R?i():R=!0,o(B,a-s))):(e.sortIndex=u,D(S,e),F||T||(F=!0,r(I))),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(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 E(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 y=Object.getPrototypeOf,g=y&&y(y(O([])));g&&g!==t&&n.call(g,o)&&(v=g);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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(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,E.prototype={constructor:E,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(C),!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),C(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;C(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 y(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 g(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){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function D(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&&x(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(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(de){return!1}}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 w(e)}function S(e){var t=E();return function(){var n,r=C(e);if(t){var o=C(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}var A=n(1).createContext({}),j=n(0),M=["children","head","title","style","onResize"],N=function(e){D(n,e);var t=S(n);function n(){var e;g(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,M));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=function(e){var t=e.children,n=e.onResize,r=e.style,o=e.title,i=Object(s.useContext)(A).stylesUrl,a=p(Object(s.useState)(!i),2),u=a[0],l=a[1],c=Object(j.jsxs)(j.Fragment,{children:[i?Object(j.jsx)("link",{rel:"stylesheet",href:i,onLoad:function(){l(!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"})]});return Object(j.jsx)(N,{head:c,style:r,onResize:n,title:o,children:u&&t})},F=function(e){var t=e.children,n=e.style,r=e.title,o=p(Object(s.useState)(n),2),a=o[0],u=o[1];return Object(j.jsx)(T,{style:a,onResize:function(e){u((function(t){return i(i({},t),{},{height:"".concat(e.scrollHeight,"px")})}))},title:r,children:t})},R=function(e){var t=e.children;return Object(j.jsx)(F,{style:{width:"100%",height:"400px"},title:"comments-frame",children:t})},P=function(e){var t=e.children;return Object(j.jsx)(T,{style:{zIndex:"3999999",position:"fixed",left:"0",top:"0",width:"100%",height:"100%",overflow:"hidden"},title:"popup-frame",children:t})};function B(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 I(){return(I=y(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(B(n.comments),B(i.comments)),pagination:i.meta.pagination});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return(L=y(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(B(s.replies),B(l.comments))}):e}))});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return(z=y(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(B(n.comments)),commentCount:n.commentCount+1});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){return(_=y(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(B(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 V(){return(V=y(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($=y(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 H(){return(H=y(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 U(){return(U=y(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 W(){return(W=y(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 q(){return(q=y(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 J(){return(J=y(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 K(){return(K=y(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.expertise,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.expertise,void 0!==u&&f!==u&&(l.expertise=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 Q={openPopup:function(e){return{popup:e.data}},closePopup:function(){return{popup:null}},increaseSecundaryFormCount:function(e){return{secundaryFormCount:e.state.secundaryFormCount+1}},decreaseSecundaryFormCount:function(e){return{secundaryFormCount:e.state.secundaryFormCount-1}}},G={addComment:function(e){return z.apply(this,arguments)},editComment:function(e){return J.apply(this,arguments)},hideComment:function(e){return V.apply(this,arguments)},deleteComment:function(e){return q.apply(this,arguments)},showComment:function(e){return $.apply(this,arguments)},likeComment:function(e){return H.apply(this,arguments)},unlikeComment:function(e){return W.apply(this,arguments)},reportComment:function(e){return U.apply(this,arguments)},addReply:function(e){return _.apply(this,arguments)},loadMoreComments:function(e){return I.apply(this,arguments)},loadMoreReplies:function(e){return L.apply(this,arguments)},updateMember:function(e){return K.apply(this,arguments)}};function Y(e){return!!Q[e]}function X(e){return Z.apply(this,arguments)}function Z(){return(Z=y(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=G[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)}function ee(e){var t=e.action,n=e.data,r=e.state,o=e.api,i=e.adminApi,a=Q[t];return a&&a({data:n,state:r,api:o,adminApi:i})||{}}var te=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 ne(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 re(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 oe(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 ie(){return Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)<480}var ae={dev:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.customSiteUrl;return!1},test:function(){return!1}},se=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=ae[e];return!(!n||!n(t))}))};var ue=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,expertise:e.expertise};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 y(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 y(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=y(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},le=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"," border-y-2 border-gray-100 px-2 dark:border-gray-100/10 sm:px-8"),children:[Object(j.jsx)("h1",{className:"mb-[8px] text-center font-sans text-[24px] tracking-tight text-black dark:text-[rgba(255,255,255,0.85)] ".concat(e.isFirst?"font-semibold":"font-bold"),children:u}),Object(j.jsxs)("p",{className:"sm:max-w-screen-sm mb-[28px] w-full px-0 text-center font-sans text-[16px] leading-normal text-neutral-600 dark:text-[rgba(255,255,255,0.85)] sm:px-8",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:"font-san mb-[12px] inline-block rounded py-[14px] px-5 font-medium leading-none text-white transition-all hover:opacity-90",style:i,children:e.isPaid&&o?"Upgrade now":"Sign up now"}),!o&&Object(j.jsxs)("p",{className:"text-center font-sans text-sm text-neutral-400 dark:text-[rgba(255,255,255,0.5)]",children:[Object(j.jsx)("span",{className:"mr-1 inline-block text-[15px]",children:"Already a member?"}),Object(j.jsx)("button",{onClick:function(e){window.location.href="#/portal/signin"},className:"rounded-md text-sm font-semibold transition-all hover:opacity-90",style:a,children:"Sign in"})]})]})};function ce(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 fe(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,fe),a}var de,pe,he=["static"],me=["unmount"],ve=["as","children","refName"],ye=((pe=ye||{})[pe.None=0]="None",pe[pe.RenderStrategy=1]="RenderStrategy",pe[pe.Static=2]="Static",pe),ge=((de=ge||{})[de.Unmount=0]="Unmount",de[de.Hidden=1]="Hidden",de);function be(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=we(n,t);if(c)return ke(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,he);if(m)return ke(v,o,s,f)}if(1&p){var y,g=d.unmount,b=void 0===g||g,k=a(d,me);return fe(b?0:1,(r(y={},0,(function(){return null})),r(y,1,(function(){return ke(i(i({},k),{},{hidden:!0,style:{display:"none"}}),o,s,f)})),y))}return ke(d,o,s,f)}function ke(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=Ce(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,ve),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(De(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({},we(m.props,De(Ce(p,["ref"]))),v,h))}return Object(s.createElement)(l,Object.assign({},Ce(p,["ref"]),l!==s.Fragment&&h,l!==s.Fragment&&v),m)}function we(){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=ce(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 xe(e){var t;return Object.assign(Object(s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function De(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}function Ce(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=ce(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 Ee=Object(s.createContext)(null);Ee.displayName="OpenClosedContext";var Oe=function(e){return e[e.Open=0]="Open",e[e.Closed=1]="Closed",e}(Oe||{});function Se(){return Object(s.useContext)(Ee)}function Ae(e){var t=e.value,n=e.children;return u.a.createElement(Ee.Provider,{value:t},n)}function je(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((function(e){return setTimeout((function(){throw e}))}))}var Me,Ne="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,Te={serverHandoffComplete:!1};function Fe(){var e=p(Object(s.useState)(Te.serverHandoffComplete),2),t=e[0],n=e[1];return Object(s.useEffect)((function(){!0!==t&&n(!0)}),[t]),Object(s.useEffect)((function(){!1===Te.serverHandoffComplete&&(Te.serverHandoffComplete=!0)}),[]),t}var Re=0;function Pe(){return++Re}var Be=null!=(Me=u.a.useId)?Me:function(){var e=Fe(),t=p(u.a.useState(e?Pe:null),2),n=t[0],r=t[1];return Ne((function(){null===n&&r(Pe())}),[n]),null!=n?""+n:void 0};function Ie(){var e=Object(s.useRef)(!1);return Ne((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function Le(e){var t=Object(s.useRef)(e);return Ne((function(){t.current=e}),[e]),t}var ze=function(e){var t=Le(e);return u.a.useCallback((function(){return t.current.apply(t,arguments)}),[t])},_e=Symbol();function Ve(){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=ze((function(e){var t,n=ce(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[_e])}))?void 0:o}function $e(){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=ce(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 y(m().mark((function e(){var n,r,o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=ce(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 He(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 Ue(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 We=function(e){return e.Ended="ended",e.Cancelled="cancelled",e}(We||{});function qe(e,t,n,r){var o=n?"enter":"leave",i=$e(),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=fe(o,{enter:function(){return t.enter},leave:function(){return t.leave}}),u=fe(o,{enter:function(){return t.enterTo},leave:function(){return t.leaveTo}}),l=fe(o,{enter:function(){return t.enterFrom},leave:function(){return t.leaveFrom}});return Ue.apply(void 0,[e].concat(B(t.enter),B(t.enterTo),B(t.enterFrom),B(t.leave),B(t.leaveFrom),B(t.leaveTo),B(t.entered))),He.apply(void 0,[e].concat(B(s),B(l))),i.nextFrame((function(){Ue.apply(void 0,[e].concat(B(l))),He.apply(void 0,[e].concat(B(u))),function(e,t){var n=$e();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&&(Ue.apply(void 0,[e].concat(B(s))),He.apply(void 0,[e].concat(B(t.entered)))),a(n)}))})),i.dispose}function Je(e){var t=e.container,n=e.direction,o=e.classes,i=e.events,a=e.onStart,u=e.onStop,l=Ie(),c=function(){var e=p(Object(s.useState)($e),1)[0];return Object(s.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}(),f=Le(n),d=ze((function(){return fe(f.current,{enter:function(){return i.current.beforeEnter()},leave:function(){return i.current.beforeLeave()},idle:function(){}})})),h=ze((function(){return fe(f.current,{enter:function(){return i.current.afterEnter()},leave:function(){return i.current.afterLeave()},idle:function(){}})}));Ne((function(){var e=$e();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(qe(n,o.current,"enter"===f.current,(function(t){var n;e.dispose(),fe(t,(r(n={},We.Ended,(function(){h(),u.current(f.current)})),r(n,We.Cancelled,(function(){})),n))}))),e.dispose}),[n])}var Ke=["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"],Qe=["show","appear","unmount"];function Ge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(" ").filter((function(e){return e.trim().length>1}))}var Ye=Object(s.createContext)(null);Ye.displayName="TransitionContext";var Xe,Ze=((Xe=Ze||{}).Visible="visible",Xe.Hidden="hidden",Xe);var et=Object(s.createContext)(null);function tt(e){return"children"in e?tt(e.children):e.current.filter((function(e){return"visible"===e.state})).length>0}function nt(e){var t=Le(e),n=Object(s.useRef)([]),o=Ie(),i=ze((function(e){var i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ge.Hidden,s=n.current.findIndex((function(t){return t.id===e}));-1!==s&&(fe(a,(r(i={},ge.Unmount,(function(){n.current.splice(s,1)})),r(i,ge.Hidden,(function(){n.current[s].state="hidden"})),i)),je((function(){var e;!tt(n)&&o.current&&(null==(e=t.current)||e.call(t))})))})),a=ze((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,ge.Unmount)}}));return Object(s.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function rt(){}et.displayName="NestingContext";var ot=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function it(e){var t,n,r={},o=ce(ot);try{for(o.s();!(n=o.n()).done;){var i=n.value;r[i]=null!=(t=e[i])?t:rt}}catch(a){o.e(a)}finally{o.f()}return r}var at,st,ut,lt=ye.RenderStrategy,ct=xe((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,y=e.leaveFrom,g=e.leaveTo,b=a(e,Ke),k=Object(s.useRef)(null),w=Ve(k,t),x=p(Object(s.useState)("visible"),2),D=x[0],C=x[1],E=b.unmount?ge.Unmount:ge.Hidden,O=function(){var e=Object(s.useContext)(Ye);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,M=function(){var e=Object(s.useContext)(et);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),N=M.register,T=M.unregister,F=Object(s.useRef)(null),R=Be();Object(s.useEffect)((function(){if(R)return N(R)}),[N,R]),Object(s.useEffect)((function(){if(E===ge.Hidden&&R){var e;if(S&&"visible"!==D)return void C("visible");fe(D,(r(e={},"hidden",(function(){return T(R)})),r(e,"visible",(function(){return N(R)})),e))}}),[D,R,N,T,S,E]);var P=Le({enter:Ge(f),enterFrom:Ge(d),enterTo:Ge(h),entered:Ge(m),leave:Ge(v),leaveFrom:Ge(y),leaveTo:Ge(g)}),B=function(e){var t=Object(s.useRef)(it(e));return Object(s.useEffect)((function(){t.current=it(e)}),[e]),t}({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:c}),I=Fe();Object(s.useEffect)((function(){if(I&&"visible"===D&&null===k.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[k,D,I]);var L=j&&!A,z=!I||L||F.current===S?"idle":S?"enter":"leave",_=Object(s.useRef)(!1),V=nt((function(){_.current||(C("hidden"),T(R))}));Je({container:k,classes:P,events:B,direction:z,onStart:Le((function(){_.current=!0})),onStop:Le((function(e){_.current=!1,"leave"===e&&!tt(V)&&(C("hidden"),T(R))}))}),Object(s.useEffect)((function(){!L||(E===ge.Hidden?F.current=null:F.current=S)}),[S,L,D]);var $=b,H={ref:w};return u.a.createElement(et.Provider,{value:V},u.a.createElement(Ae,{value:fe(D,(n={},r(n,"visible",Oe.Open),r(n,"hidden",Oe.Closed),n))},be({ourProps:H,theirProps:$,defaultTag:"div",features:lt,visible:"visible"===D,name:"Transition.Child"})))})),ft=xe((function(e,t){var n,o=e.show,l=e.appear,c=void 0!==l&&l,f=e.unmount,d=a(e,Qe),h=Object(s.useRef)(null),m=Ve(h,t);Fe();var v=Se();if(void 0===o&&null!==v&&(o=fe(v,(r(n={},Oe.Open,!0),r(n,Oe.Closed,!1),n))),![!0,!1].includes(o))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var y=p(Object(s.useState)(o?"visible":"hidden"),2),g=y[0],b=y[1],k=nt((function(){b("hidden")})),w=p(Object(s.useState)(!0),2),x=w[0],D=w[1],C=Object(s.useRef)([o]);Ne((function(){!1!==x&&C.current[C.current.length-1]!==o&&(C.current.push(o),D(!1))}),[C,o]);var E=Object(s.useMemo)((function(){return{show:o,appear:c,initial:x}}),[o,c,x]);Object(s.useEffect)((function(){if(o)b("visible");else if(tt(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(et.Provider,{value:k},u.a.createElement(Ye.Provider,{value:E},be({ourProps:i(i({},O),{},{as:s.Fragment,children:u.a.createElement(ct,i(i({ref:m},O),d))}),theirProps:{},defaultTag:s.Fragment,features:lt,visible:"visible"===g,name:"Transition"})))})),dt=xe((function(e,t){var n=null!==Object(s.useContext)(Ye),r=null!==Se();return u.a.createElement(u.a.Fragment,null,!n&&r?u.a.createElement(ft,i({ref:t},e)):u.a.createElement(ct,i({ref:t},e)))})),pt=Object.assign(ft,{Child:dt,Root:ft}),ht=["title","titleId"];function mt(){return mt=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},mt.apply(this,arguments)}function vt(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 yt(e,t){var n=e.title,r=e.titleId,o=vt(e,ht);return s.createElement("svg",mt({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,at||(at=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"})),st||(st=s.createElement("circle",{cx:12,cy:12,r:11.375,stroke:"white",strokeWidth:1.25})),ut||(ut=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 gt=s.forwardRef(yt);n.p;var bt=function(){var e="w-9 h-9 sm:w-[40px] sm:h-[40px]";return Object(j.jsx)("figure",{className:"relative ".concat(e),children:Object(j.jsx)("div",{className:"flex items-center justify-center rounded-full bg-[rgba(200,200,200,0.3)] ".concat(e),children:Object(j.jsx)(gt,{className:"stroke-white dark:opacity-70"})})})},kt=function(e){var t,n,r,o=e.comment,i=Object(s.useContext)(A),a=i.member,u=i.avatarSaturation,l="w-9 h-9 sm:w-[40px] sm:h-[40px]",c=null!==(t=null===a||void 0===a?void 0:a.name)&&void 0!==t?t:null===o||void 0===o||null===(n=o.member)||void 0===n?void 0:n.name,f=function(e,t,n){return Math.floor(e%(n-t)+t)},d=o?o.member:a,p=(r=function(){var e=o?o.member:a;if(!e||!e.name)return[0,0,10];var t=isNaN(u)?50:u,n=[0,360],r=Math.round(t/(100/30))+30,i=[r-20,r],s=function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}(e.name);return[f(s,n[0],n[1]),t,f(s,i[0],i[1])]}(),"hsl(".concat(r[0],", ").concat(r[1],"%, ").concat(r[2],"%)")),h={background:p},m=Object(j.jsxs)(j.Fragment,{children:[c?Object(j.jsx)("div",{className:"flex items-center justify-center rounded-full ".concat(l),style:h,children:Object(j.jsx)("p",{className:"font-sans text-lg font-semibold text-white",children:function(){if(o&&!o.member)return oe("Deleted member");var e=o?o.member:a;return e&&e.name?oe(e.name):oe("Anonymous")}()})}):Object(j.jsx)("div",{className:"flex items-center justify-center rounded-full bg-neutral-900 dark:bg-[rgba(255,255,255,0.7)] ".concat(l),children:Object(j.jsx)(gt,{className:"stroke-white dark:stroke-[rgba(0,0,0,0.6)]"})}),d&&Object(j.jsx)("img",{className:"absolute top-0 left-0 rounded-full ".concat(l),src:d.avatar_image,alt:"Avatar"})]});return Object(j.jsx)("figure",{className:"relative ".concat(l),children:m})};function wt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=C(e)););return e}function xt(){return xt="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=wt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},xt.apply(this,arguments)}function Dt(e,t,n){return Dt=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&&x(o,n.prototype),o},Dt.apply(null,arguments)}function Ct(e){var t="function"===typeof Map?new Map:void 0;return Ct=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 Dt(e,arguments,C(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),x(r,e)},Ct(e)}function Et(e){this.content=e}Et.prototype={constructor:Et,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 Et(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 Et(n)},addToStart:function(e,t){return new Et([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Et(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 Et(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=Et.from(e)).size?new Et(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Et.from(e)).size?new Et(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Et.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}},Et.from=function(e){if(e instanceof Et)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Et(t)};var Ot=Et;function St(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=St(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function At(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=At(a.content,s.content,n-1,r-1);if(f)return f}n-=u,r-=u}else n-=u,r-=u}}var jt=function(){function e(t,n){if(g(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 St(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 At(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 Nt(0,e);if(e==this.size)return Nt(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?Nt(n+1,i):Nt(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}();jt.empty=new jt([],0);var Mt={index:0,offset:0};function Nt(e,t){return Mt.index=e,Mt.offset=t,Mt}function Tt(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(!Tt(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t)||!Tt(e[o],t[o]))return!1;for(var i in t)if(!(i in e))return!1}return!0}var Ft=function(){function e(t,n){g(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&&Tt(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}();Ft.none=[];var Rt=function(e){D(n,e);var t=S(n);function n(){return g(this,n),t.apply(this,arguments)}return k(n)}(Ct(Error)),Pt=function(){function e(t,n,r){g(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=It(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(Bt(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(jt.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 Bt(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(Bt(a.content,t-i-1,n-i-1)))}function It(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=It(s.content,t-a-1,n);return u&&e.replaceChild(i,s.copy(u))}function Lt(e,t,n){if(n.openStart>e.depth)throw new Rt("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Rt("Inconsistent open depths");return zt(e,t,n,0)}function zt(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=zt(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(jt.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Ut(i,Wt(e,s.start,s.end,t,r))}var u=e.parent,l=u.content;return Ut(u,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}return Ut(i,qt(e,t,r))}function _t(e,t){if(!t.type.compatibleContent(e.type))throw new Rt("Cannot join "+t.type.name+" onto "+e.type.name)}function Vt(e,t,n){var r=e.node(n);return _t(r,t.node(n)),r}function $t(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 Ht(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&&($t(e.nodeAfter,r),i++));for(var s=i;s<a;s++)$t(o.child(s),r);t&&t.depth==n&&t.textOffset&&$t(t.nodeBefore,r)}function Ut(e,t){if(!e.type.validContent(t))throw new Rt("Invalid content for node "+e.type.name);return e.copy(t)}function Wt(e,t,n,r,o){var i=e.depth>o&&Vt(e,t,o+1),a=r.depth>o&&Vt(n,r,o+1),s=[];return Ht(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(_t(i,a),$t(Ut(i,Wt(e,t,n,r,o+1)),s)):(i&&$t(Ut(i,qt(e,t,o+1)),s),Ht(t,n,o,s),a&&$t(Ut(a,qt(n,r,o+1)),s)),Ht(r,null,o,s),new jt(s)}function qt(e,t,n){var r=[];(Ht(null,e,n,r),e.depth>n)&&$t(Ut(Vt(e,t,n+1),qt(e,t,n+1)),r);return Ht(t,null,n,r),new jt(r)}Pt.empty=new Pt(jt.empty,0,0);var Jt=function(){function e(t,n,r){g(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 Ft.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 Yt(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<Kt.length;r++){var o=Kt[r];if(o.pos==n&&o.doc==t)return o}var i=Kt[Qt]=e.resolve(t,n);return Qt=(Qt+1)%Gt,i}}]),e}(),Kt=[],Qt=0,Gt=12,Yt=function(){function e(t,n,r){g(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}(),Xt=Object.create(null),Zt=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ft.none;g(this,e),this.type=t,this.attrs=n,this.marks=o,this.content=r||jt.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&&Tt(this.attrs,t||e.defaultAttrs||Xt)&&Ft.sameSet(this.marks,n||Ft.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 Pt.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 Pt(u,r.depth-i,o.depth-i)}},{key:"replace",value:function(e,t,n){return Lt(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 Jt.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return Jt.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()+")"),tn(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]:jt.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=Ft.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Ft.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=jt.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}]),e}();Zt.prototype.text=void 0;var en=function(e){D(n,e);var t=S(n);function n(e,r,o,i){var a;if(g(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):tn(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=xt(C(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(Zt);function tn(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var nn=function(){function e(t){g(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 jt.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 rn(t,n);if(null==r.next)return e.empty;var o=on(r);r.next&&r.err("Unexpected trailing text");var i=function(e){var t=Object.create(null);return n(fn(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]);fn(e,r).forEach((function(e){i||o.push([n,i=[]]),-1==i.indexOf(e)&&i.push(e)}))}}))}));for(var i=t[r.join(",")]=new nn(r.indexOf(e.length-1)>-1),a=0;a<o.length;a++){var s=o[a][1].sort(cn);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}();nn.empty=new nn(!0);var rn=function(){function e(t,n){g(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 on(e){var t=[];do{t.push(an(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function an(e){var t=[];do{t.push(sn(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function sn(e){for(var t=function(e){if(e.eat("(")){var t=on(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=ln(e,t)}return t}function un(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function ln(e,t){var n=un(e),r=n;return e.eat(",")&&(r="}"!=e.next?un(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function cn(e,t){return t-e}function fn(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(cn)}function dn(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 pn(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 hn(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new vn(e[n]);return t}var mn=function(){function e(t,n,r){g(this,e),this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=hn(r.attrs),this.defaultAttrs=dn(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==nn.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:pn(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 Zt(this,this.computeAttrs(e),jt.from(t),Ft.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=jt.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Zt(this,this.computeAttrs(e),t,Ft.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=jt.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(jt.empty,!0);return i?new Zt(this,e,t.append(i),Ft.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:Ft.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}(),vn=function(){function e(t){g(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}(),yn=function(){function e(t,n,r,o){g(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=hn(o.attrs),this.excluded=null;var i=dn(this.attrs);this.instance=i?new Ft(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 Ft(this,pn(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}(),gn=function(){function e(t){g(this,e),this.cached=Object.create(null),this.spec={nodes:Ot.from(t.nodes),marks:Ot.from(t.marks||{}),topNode:t.topNode},this.nodes=mn.compile(this.spec.nodes,this),this.marks=yn.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]=nn.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==a?null:a?bn(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?[]:bn(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 mn))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 en(n,n.defaultAttrs,e,Ft.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 Zt.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return Ft.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 bn(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 kn=function(){function e(t,n){var r=this;g(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 On(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 On(this,t,!0);return n.addAll(e,t.from,t.to),Pt.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(Sn(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=An(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=An(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}(),wn={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},xn={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Dn={ol:!0,ul:!0};function Cn(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var En=function(){function e(t,n,r,o,i,a,s){g(this,e),this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ft.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(jt.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=jt.from(this.content);return!e&&this.match&&(o=o.append(this.match.fillBefore(jt.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):jn(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&&!wn.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}]),e}(),On=function(){function e(t,n,r){g(this,e),this.parser=t,this.options=n,this.isOpen=r,this.open=0;var o,i=n.topNode,a=Cn(null,n.preserveWhitespace,0)|(r?4:0);o=i?new En(i.type,i.attrs,Ft.none,Ft.none,!0,n.topMatch||i.type.contentMatch,a):new En(r?null:t.schema.topNodeType,null,Ft.none,Ft.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();Dn.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&&Dn.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:xn.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(wn.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=Ft.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=Cn(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new En(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 Sn(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function An(e){var t={};for(var n in e)t[n]=e[n];return t}function jn(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 Mn=function(){function e(t,n){g(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=Tn(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(Tn(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(Tn(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=Nn(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return Nn(e.marks)}}]),e}();function Nn(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Tn(e){return e.document||window.document}var Fn=Math.pow(2,16);function Rn(e){return 65535&e}var Pn=function(){function e(t,n,r){g(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}(),Bn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(g(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=Rn(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))/Fn}(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)*Fn,p=e==s?2:e==c?1:4;return(t<0?e!=s:e!=c)&&(p|=8),new Pn(f,p,d)}r+=l-u}return n?e+r:new Pn(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=Rn(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}();Bn.empty=new Bn([]);var In=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;g(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 Pn(e,r,null)}}]),e}(),Ln=Object.create(null),zn=function(){function e(){g(this,e)}return k(e,[{key:"getMap",value:function(){return Bn.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=Ln[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 Ln)throw new RangeError("Duplicate use of step JSON ID "+e);return Ln[e]=t,t.prototype.jsonID=e,t}}]),e}(),_n=function(){function e(t,n){g(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(de){if(de instanceof Rt)return e.fail(de.message);throw de}}}]),e}();function Vn(e,t,n){for(var r=[],o=0;o<e.childCount;o++){var i=e.child(o);i.content.size&&(i=i.copy(Vn(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return jt.fromArray(r)}var $n=function(e){D(n,e);var t=S(n);function n(e,r,o){var i;return g(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 Pt(Vn(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 _n.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new Hn(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}(zn);zn.jsonID("addMark",$n);var Hn=function(e){D(n,e);var t=S(n);function n(e,r,o){var i;return g(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 Pt(Vn(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return _n.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new $n(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}(zn);zn.jsonID("removeMark",Hn);var Un=function(e){D(n,e);var t=S(n);function n(e,r){var o;return g(this,n),(o=t.call(this)).pos=e,o.mark=r,o}return k(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return _n.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return _n.fromReplace(e,this.pos,this.pos+1,new Pt(jt.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);if(t){var r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(var o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new n(this.pos,t.marks[o]);return new n(this.pos,this.mark)}}return new Wn(this.pos,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new n(t.pos,e.markFromJSON(t.mark))}}]),n}(zn);zn.jsonID("addNodeMark",Un);var Wn=function(e){D(n,e);var t=S(n);function n(e,r){var o;return g(this,n),(o=t.call(this)).pos=e,o.mark=r,o}return k(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return _n.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return _n.fromReplace(e,this.pos,this.pos+1,new Pt(jt.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Un(this.pos,this.mark):this}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new n(t.pos,e.markFromJSON(t.mark))}}]),n}(zn);zn.jsonID("removeNodeMark",Wn);var qn=function(e){D(n,e);var t=S(n);function n(e,r,o){var i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return g(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&&Kn(e,this.from,this.to)?_n.fail("Structure replace would overwrite content"):_n.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new Bn([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?Pt.empty:new Pt(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?Pt.empty:new Pt(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,Pt.fromJSON(e,t.slice),!!t.structure)}}]),n}(zn);zn.jsonID("replace",qn);var Jn=function(e){D(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 g(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&&(Kn(e,this.from,this.gapFrom)||Kn(e,this.gapTo,this.to)))return _n.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return _n.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?_n.fromReplace(e,this.from,this.to,n):_n.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new Bn([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,Pt.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(zn);function Kn(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 Qn(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Gn(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||!Qn(r,o,i))break}return null}function Yn(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=Zn(e,t),i=o&&er(r,t);return i?o.map(Xn).concat({type:t,attrs:n}).concat(i.map(Xn)):null}function Xn(e){return{type:e,attrs:null}}function Zn(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 er(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 tr(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 Jn(s,u,s+1,u-1,new Pt(jt.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}function nr(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 Jn(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Pt(jt.from(a),0,0),1,!0))}function rr(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 or(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=jt.empty,a=jt.empty,s=o.depth,u=o.depth-n,l=n-1;s>u;s--,l--){i=jt.from(o.node(s).copy(i));var c=r&&r[l];a=jt.from(c?c.type.create(c.attrs,a):o.node(s).copy(a))}e.step(new qn(t,t,new Pt(i.append(a),n,n),!0))}function ir(e,t){var n=e.resolve(t),r=n.index();return ar(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ar(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function sr(e,t,n){var r=new qn(t-n,t+n,Pt.empty,!0);e.step(r)}function ur(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pt.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return lr(o,i,r)?new qn(t,n,r):new cr(o,i,r).fit()}function lr(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}zn.jsonID("replaceAround",Jn);var cr=function(){function e(t,n,r){g(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=jt.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=jt.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 Pt(i,a,s);return t>-1?new Jn(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new qn(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=pr(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(jt.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=pr(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new Pt(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=pr(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new Pt(fr(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Pt(fr(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),y=p.matchType(v.type);if(!y)break;(++c>1||0==l||v.content.size)&&(p=y,f.push(hr(v.mark(h.allowedMarks(v.marks)),1==c?l:0,c==u.childCount?m:-1)))}var g=c==u.childCount;g||(m=-1),this.placed=dr(this.placed,n,jt.from(f)),this.frontier[n].match=p,g&&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=g?0==t?Pt.empty:new Pt(fr(s.content,t-1,1),t-1,m<0?s.openEnd:t-1):new Pt(fr(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||!mr(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=mr(e,t,o,r,i);if(a){for(var s=t-1;s>=0;s--){var u=this.frontier[s],l=u.match,c=mr(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=dr(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=dr(this.placed,this.depth,jt.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(jt.empty,!0);e.childCount&&(this.placed=dr(this.placed,this.frontier.length,e))}}]),e}();function fr(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(fr(e.firstChild.content,t-1,n)))}function dr(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(dr(e.lastChild.content,t-1,n)))}function pr(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function hr(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,hr(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(jt.empty,!0)))),e.copy(r)}function mr(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 vr(e){return e.spec.defining||e.spec.definingForContent}function yr(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(yr(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(jt.empty,!0))}return e}function gr(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 br=function(e){D(n,e);var t=S(n);function n(e,r,o){var i;return g(this,n),(i=t.call(this)).pos=e,i.attr=r,i.value=o,i}return k(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return _n.fail("No node at attribute step's position");var n=Object.create(null);for(var r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;var o=t.type.create(n,null,t.marks);return _n.fromReplace(e,this.pos,this.pos+1,new Pt(jt.from(o),0,t.isLeaf?0:1))}},{key:"getMap",value:function(){return Bn.empty}},{key:"invert",value:function(e){return new n(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new n(t.pos,t.attr,t.value)}}]),n}(zn);zn.jsonID("attr",br);var kr=Error;((kr=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=kr,kr.prototype.name="TransformError";var wr=function(){function e(t){g(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new In}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 kr(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]:Pt.empty,r=ur(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new Pt(jt.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,Pt.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(lr(o,i,r))return e.step(new qn(t,n,r));var a=gr(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 y=p-1;y>=0;y--){var g=d[y].type,b=vr(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 D=0;D<a.length;D++){var C=a[(D+f)%a.length],E=!0;C<0&&(E=!1,C=-C);var O=o.node(C-1),S=o.index(C-1);if(O.canReplaceWith(S,S,x.type,x.marks))return e.replace(o.before(C),E?i.after(C):n,new Pt(yr(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 M=a[j];M<0||(t=o.before(M),n=i.after(M))}}(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 Pt(jt.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=gr(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=jt.empty,f=0,d=i,p=!1;d>n;d--)p||r.index(d)>0?(p=!0,c=jt.from(r.node(d).copy(c)),f++):u--;for(var h=jt.empty,m=0,v=i,y=!1;v>n;v--)y||o.after(v+1)<o.end(v)?(y=!0,h=jt.from(o.node(v).copy(h)),m++):l++;e.step(new Jn(u,l,a,s,new Pt(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 sr(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=jt.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=jt.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new Jn(a,s,a,s,new Pt(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 tr(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 nr(this,e,t,n,r),this}},{key:"setNodeAttribute",value:function(e,t,n){return this.step(new br(e,t,n)),this}},{key:"addNodeMark",value:function(e,t){return this.step(new Un(e,t)),this}},{key:"removeNodeMark",value:function(e,t){if(!(t instanceof Ft)){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Wn(e,t)),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 or(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 Hn(f,d,c[h])));i&&i.to==f?i.to=d:s.push(i=new $n(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 yn)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 Hn(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 Hn(a,l,u.marks[f]))}else i.push(new qn(a,l,Pt.empty));a=l}if(!r.validEnd){var d=r.fillBefore(jt.empty,!0);e.replace(a,a,new Pt(d,0,0))}for(var p=i.length-1;p>=0;p--)e.step(i[p])}(this,e,t,n),this}}]),e}(),xr=Object.create(null),Dr=function(){function e(t,n,r){g(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new Cr(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]:Pt.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?Pt.empty:t),0==s&&Rr(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),Rr(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return Sr.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 Sr(e):Fr(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?Fr(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):Fr(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 Nr(e.node(0))}},{key:"atStart",value:function(e){return Fr(e,e,0,0,1)||new Nr(e)}},{key:"atEnd",value:function(e){return Fr(e,e,e.content.size,e.childCount,-1)||new Nr(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=xr[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 xr)throw new RangeError("Duplicate use of selection JSON ID "+e);return xr[e]=t,t.prototype.jsonID=e,t}}]),e}();Dr.prototype.visible=!0;var Cr=k((function e(t,n){g(this,e),this.$from=t,this.$to=n})),Er=!1;function Or(e){Er||e.parent.inlineContent||(Er=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var Sr=function(e){D(n,e);var t=S(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return g(this,n),Or(e),Or(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 Dr.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]:Pt.empty;if(xt(C(n.prototype),"replace",this).call(this,e,t),t==Pt.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 Ar(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=Dr.findFrom(t,r,!0)||Dr.findFrom(t,-r,!0);if(!i)return Dr.near(t,r);t=i.$head}return e.parent.inlineContent||(0==o||(e=(Dr.findFrom(e,-r,!0)||Dr.findFrom(e,r,!0)).$anchor).pos<t.pos!=o<0)&&(e=t),new n(e,t)}}]),n}(Dr);Dr.jsonID("text",Sr);var Ar=function(){function e(t,n){g(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 Sr.between(e.resolve(this.anchor),e.resolve(this.head))}}]),e}(),jr=function(e){D(n,e);var t=S(n);function n(e){var r;g(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?Dr.near(a):new n(a)}},{key:"content",value:function(){return new Pt(jt.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 Mr(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}(Dr);jr.prototype.visible=!1,Dr.jsonID("node",jr);var Mr=function(){function e(t){g(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 Ar(o,o):new e(o)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&jr.isSelectable(n)?new jr(t):Dr.near(t)}}]),e}(),Nr=function(e){D(n,e);var t=S(n);function n(e){return g(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]:Pt.empty;if(t==Pt.empty){e.delete(0,e.doc.content.size);var r=Dr.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else xt(C(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 Tr}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(Dr);Dr.jsonID("all",Nr);var Tr={map:function(){return this},resolve:function(e){return new Nr(e)}};function Fr(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return Sr.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&&jr.isSelectable(s))return jr.create(e,n-(o<0?s.nodeSize:0))}else{var u=Fr(e,s,n+o,o<0?s.childCount:0,o,i);if(u)return u}n+=s.nodeSize*o}return null}function Rr(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o,i=e.steps[r];if(i instanceof qn||i instanceof Jn)e.mapping.maps[r].forEach((function(e,t,n,r){null==o&&(o=r)})),e.setSelection(Dr.near(e.doc.resolve(o),n))}}var Pr=function(e){D(n,e);var t=S(n);function n(e){var r;return g(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 Ft.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){xt(C(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)||Ft.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(Dr.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}(wr);function Br(e,t){return t&&e?e.bind(t):e}var Ir=k((function e(t,n,r){g(this,e),this.name=t,this.init=Br(n.init,r),this.apply=Br(n.apply,r)})),Lr=[new Ir("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new Ir("selection",{init:function(e,t){return e.selection||Dr.atStart(t.doc)},apply:function(e){return e.selection}}),new Ir("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Ir("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],zr=k((function e(t,n){var r=this;g(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Lr.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 Ir(e.key,e.spec.state,e))}))})),_r=function(){function e(t){g(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 Pr(this)}},{key:"reconfigure",value:function(t){for(var n=new zr(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 zr(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 zr(t.schema,t.plugins),i=new e(o);return o.fields.forEach((function(e){if("doc"==e.name)i.doc=Zt.fromJSON(t.schema,n.doc);else if("selection"==e.name)i.selection=Dr.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 Vr(e,t,n){for(var r in e){var o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Vr(o,t,{})),n[r]=o}return n}var $r=function(){function e(t){g(this,e),this.spec=t,this.props={},t.props&&Vr(t.props,this,this.props),this.key=t.key?t.key.key:Ur("plugin")}return k(e,[{key:"getState",value:function(e){return e[this.key]}}]),e}(),Hr=Object.create(null);function Ur(e){return e in Hr?e+"$"+ ++Hr[e]:(Hr[e]=0,e+"$")}var Wr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";g(this,e),this.key=Ur(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}(),qr="undefined"!=typeof navigator?navigator:null,Jr="undefined"!=typeof document?document:null,Kr=qr&&qr.userAgent||"",Qr=/Edge\/(\d+)/.exec(Kr),Gr=/MSIE \d/.exec(Kr),Yr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kr),Xr=!!(Gr||Yr||Qr),Zr=Gr?document.documentMode:Yr?+Yr[1]:Qr?+Qr[1]:0,eo=!Xr&&/gecko\/(\d+)/i.test(Kr);eo&&(/Firefox\/(\d+)/.exec(Kr)||[0,0])[1];var to=!Xr&&/Chrome\/(\d+)/.exec(Kr),no=!!to,ro=to?+to[1]:0,oo=!Xr&&!!qr&&/Apple Computer/.test(qr.vendor),io=oo&&(/Mobile\/\w+/.test(Kr)||!!qr&&qr.maxTouchPoints>2),ao=io||!!qr&&/Mac/.test(qr.platform),so=/Android \d/.test(Kr),uo=!!Jr&&"webkitFontSmoothing"in Jr.documentElement.style,lo=uo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,co=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},fo=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},po=null,ho=function(e,t,n){var r=po||(po=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},mo=function(e,t,n,r){return n&&(yo(e,t,n,r,-1)||yo(e,t,n,r,1))},vo=/^(img|br|input|textarea|hr)$/i;function yo(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:go(e))){var i=e.parentNode;if(!i||1!=i.nodeType||ko(e)||vo.test(e.nodeName)||"false"==e.contentEditable)return!1;t=co(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?go(e):0}}}function go(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function bo(e,t,n){for(var r=0==t,o=t==go(e);r||o;){if(e==n)return!0;var i=co(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==go(e)}}function ko(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 wo=function(e){var t=e.isCollapsed;return t&&no&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function xo(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Do(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Co(e,t){return"number"==typeof e?e:e[t]}function Eo(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 Oo(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=fo(a))if(1==a.nodeType){var s=a,u=s==i.body,l=u?Do(i):Eo(s),c=0,f=0;if(t.top<l.top+Co(r,"top")?f=-(l.top-t.top+Co(o,"top")):t.bottom>l.bottom-Co(r,"bottom")&&(f=t.bottom-l.bottom+Co(o,"bottom")),t.left<l.left+Co(r,"left")?c=-(l.left-t.left+Co(o,"left")):t.right>l.right-Co(r,"right")&&(c=t.right-l.right+Co(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 So(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=fo(r));return t}function Ao(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 jo=null;function Mo(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=ho(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=Ro(r,1);if(i.top!=i.bottom&&No(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}:Mo(n,r)}function No(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function To(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(No(t,l))return To(a,t,l)}if((i=(i+1)%r)==o)break}return e}function Fo(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(!No(t,l))return null;if(!(u=To(e.dom,t,l)))return null}if(oo)for(var c=u;n&&c;c=fo(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(eo&&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=Mo(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 Ro(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var Po=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Bo(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=uo||eo;if(3==o.nodeType){if(!a||!Po.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++,Io(Ro(ho(o,s,u),l),l<0)}var c=Ro(ho(o,i,i),n);if(eo&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var f=Ro(ho(o,i-1,i-1),-1);if(f.top==c.top){var d=Ro(ho(o,i,i+1),-1);if(d.top!=c.top)return Io(d,d.left<f.left)}}return c}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==go(o))){var p=o.childNodes[i-1];if(1==p.nodeType)return Lo(p.getBoundingClientRect(),!1)}if(i<go(o)){var h=o.childNodes[i];if(1==h.nodeType)return Lo(h.getBoundingClientRect(),!0)}return Lo(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==go(o))){var m=o.childNodes[i-1],v=3==m.nodeType?ho(m,go(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return Io(Ro(v,1),!1)}if(i<go(o)){for(var y=o.childNodes[i];y.pmViewDesc&&y.pmViewDesc.ignoreForCoords;)y=y.nextSibling;var g=y?3==y.nodeType?ho(y,0,a?0:1):1==y.nodeType?y:null:null;if(g)return Io(Ro(g,-1),!0)}return Io(Ro(3==o.nodeType?ho(o):o,-n),n>=0)}function Io(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 Lo(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 zo(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 _o=/[\u0590-\u08ac]/;var Vo=null,$o=null,Ho=!1;function Uo(e,t,n){return Vo==t&&$o==n?Ho:(Vo=t,$o=n,Ho="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return zo(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=Bo(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=ho(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 _o.test(r.parent.textContent)&&s.modify?zo(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 Wo=function(){function e(t,n,r,o){g(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>co(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 Xo){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 qo&&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?co(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?co(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=co(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=co(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((eo||oo)&&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 y,g=m;g;g=g.parentNode){if(y=g.nextSibling){"BR"==y.nodeName&&(c=f={node:y.parentNode,offset:co(y)+1});break}var b=g.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(eo&&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&&oo||!mo(c.node,c.offset,d.anchorNode,d.anchorOffset)||!mo(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(E){if(!(E instanceof DOMException))throw E}}if(!x){if(e>t){var D=c;c=f,f=D}var C=document.createRange();C.setEnd(f.node,f.offset),C.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(C)}}}},{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}(),qo=function(e){D(n,e);var t=S(n);function n(e,r,o,i){var a;g(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=w(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),xt(C(n.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}]),n}(Wo),Jo=function(e){D(n,e);var t=S(n);function n(e,r,o,i){var a;return g(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}(Wo),Ko=function(e){D(n,e);var t=S(n);function n(e,r,o,i){var a;return g(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(xt(C(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=fi(i,t,a,r)),e>0&&(i=fi(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=Mn.renderSpec(document,t.type.spec.toDOM(t,r))),new n(e,t,a.dom,a.contentDOM||a.dom)}}]),n}(Wo),Qo=function(e){D(n,e);var t=S(n);function n(e,r,o,i,a,s,u,l,c){var f;return g(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 jt.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)&&si(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 li(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(ci);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 y=0;y<l.length;y++)l[y].to<=i&&l.splice(y--,1);for(;u<o.length&&o[u].from<=i&&o[u].to>i;)l.push(o[u++]);var g=i+m.nodeSize;if(m.isText){var b=g;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<g&&(c=m.cut(b-i),m=m.cut(0,b-i),g=b,v=-1)}r(m,m.isInline&&!m.isLeaf?l.filter((function(e){return!e.inline})):l.slice(),t.forChild(i,m),v),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?Ft.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),ei(this.contentDOM,this.children,e),io&&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 Sr)||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=go(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 Jo(this,i,n,o);e.input.compositionNodes.push(a),this.children=fi(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(!si(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=oi(this.dom,this.nodeDOM,ri(this.outerDeco,this.node,t),ri(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=Mn.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=ai(c,r,t),l?s=new Zo(e,t,r,o,c,f||null,p,l,i,a+1):t.isText?new Yo(e,t,r,o,c,p,i):new n(e,t,r,o,c,f||null,p,i,a+1)}}]),n}(Wo);function Go(e,t,n,r,o){return ai(r,t,e),new Qo(void 0,e,t,n,r,r,r,o,0)}var Yo=function(e){D(n,e);var t=S(n);function n(e,r,o,i,a,s,u){return g(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):xt(C(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){xt(C(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}(Qo),Xo=function(e){D(n,e);var t=S(n);function n(){return g(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}(Wo),Zo=function(e){D(n,e);var t=S(n);function n(e,r,o,i,a,s,u,l,c,f){var d;return g(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)&&xt(C(n.prototype),"update",this).call(this,e,t,r,o)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():xt(C(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():xt(C(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):xt(C(n.prototype),"setSelection",this).call(this,e,t,r,o)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),xt(C(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):xt(C(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(Qo);function ei(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=ui(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(s,r);if(a instanceof Ko){var u=r?r.previousSibling:e.lastChild;ei(a.contentDOM,a.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=ui(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var ti=function(e){e&&(this.nodeName=e)};ti.prototype=Object.create(null);var ni=[new ti];function ri(e,t,n){if(0==e.length)return ni;for(var r=n?ni[0]:new ti,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 ti(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==o.length&&o.push(r=new ti(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 oi(e,t,n,r){if(n==ni&&r==ni)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=ni[0]),o=u}ii(o,s||ni[0],a)}return o}function ii(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 ai(e,t,n){return oi(e,e,ni,ri(t,n,1!=e.nodeType))}function si(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 ui(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var li=function(){function e(t,n){g(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 Ko)){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=Ko.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 Qo){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&&si(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,Qo.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 qo(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 Ko;)e=(t=e).children[t.children.length-1];e&&e instanceof Yo&&!/\n$/.test(e.node.text)||((oo||no)&&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 Xo(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}]),e}();function ci(e,t){return e.type.side-t.type.side}function fi(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 di(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(wo(n)){for(s=l;o&&!o.node;)o=o.parent;var c=o.node;if(o&&c.isAtom&&jr.isSelectable(c)&&o.parent&&(!c.isInline||!bo(n.focusNode,n.focusOffset,o.dom))){var f=o.posBefore;u=new jr(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=Di(e,s,l,p)}return u}function pi(e){return e.editable?e.hasFocus():Ei(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function hi(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(wi(e,n),pi(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&no){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&mo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)ki(e);else{var i,a,s=n.anchor,u=n.head;!mi||n instanceof Sr||(n.$from.parent.inlineContent||(i=vi(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=vi(e,n.to))),e.docView.setSelection(s,u,e.root,t),mi&&(i&&gi(i),a&&gi(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&bi(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var mi=oo||no&&ro<63;function vi(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(oo&&i&&"false"==i.contentEditable)return yi(i);if((!i||"false"==i.contentEditable)&&(!a||"false"==a.contentEditable)){if(i)return yi(i);if(a)return yi(a)}}function yi(e){return e.contentEditable="true",oo&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function gi(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function bi(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(){pi(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}function ki(e){var t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,co(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Xr&&Zr<=11&&(r.disabled=!0,r.disabled=!1)}function wi(e,t){if(t instanceof jr){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(xi(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else xi(e)}function xi(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Di(e,t,n,r){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||Sr.between(t,n,r)}function Ci(e){return(!e.editable||e.root.activeElement==e.dom)&&Ei(e)}function Ei(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 Oi(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&&Dr.findFrom(a,t)}function Si(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ai(e,t,n){var r=e.state.selection;if(!(r instanceof Sr)){if(r instanceof jr&&r.node.isInline)return Si(e,new Sr(t>0?r.$to:r.$from));var o=Oi(e.state,t);return!!o&&Si(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=Oi(e.state,t);return!!(i&&i instanceof jr)&&Si(e,i)}if(!(ao&&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)&&(jr.isSelectable(u)?Si(e,new jr(t<0?e.state.doc.resolve(s.pos-u.nodeSize):s)):!!uo&&Si(e,new Sr(e.state.doc.resolve(t<0?l:l+u.nodeSize))))}}function ji(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Mi(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Ni(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(eo&&1==n.nodeType&&r<ji(n)&&Mi(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(Mi(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(Fi(n))break;for(var u=n.previousSibling;u&&Mi(u);)o=n.parentNode,i=co(u),u=u.previousSibling;if(u)r=ji(n=u);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Ri(e,t,n,r):o&&Ri(e,t,o,i)}}function Ti(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=ji(n);;)if(r<a){if(1!=n.nodeType)break;if(!Mi(n.childNodes[r]))break;o=n,i=++r}else{if(Fi(n))break;for(var s=n.nextSibling;s&&Mi(s);)o=s.parentNode,i=co(s)+1,s=s.nextSibling;if(s)r=0,a=ji(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}o&&Ri(e,t,o,i)}}function Fi(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ri(e,t,n,r){if(wo(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&&hi(e)}),50)}function Pi(e,t,n){var r=e.state.selection;if(r instanceof Sr&&!r.empty||n.indexOf("s")>-1)return!1;if(ao&&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=Oi(e.state,t);if(a&&a instanceof jr)return Si(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,u=r instanceof Nr?Dr.near(s,t):Dr.findFrom(s,t);return!!u&&Si(e,u)}return!1}function Bi(e,t){if(!(e.state.selection instanceof Sr))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 Ii(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Li(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||ao&&72==n&&"c"==r?Bi(e,-1)||Ni(e):46==n||ao&&68==n&&"c"==r?Bi(e,1)||Ti(e):13==n||27==n||(37==n||ao&&66==n&&"c"==r?Ai(e,-1,r)||Ni(e):39==n||ao&&70==n&&"c"==r?Ai(e,1,r)||Ti(e):38==n||ao&&80==n&&"c"==r?Pi(e,-1,r)||Ni(e):40==n||ao&&78==n&&"c"==r?function(e){if(!oo||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;Ii(e,o,"true"),setTimeout((function(){return Ii(e,o,"false")}),20)}return!1}(e)||Pi(e,1,r)||Ti(e):r==(ao?"m":"c")&&(66==n||73==n||89==n||90==n))}function zi(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")||Mn.fromSchema(e.state.schema),u=Qi(),l=u.createElement("div");l.appendChild(s.serializeFragment(r,{document:u}));for(var c,f=l.firstChild,d=0;f&&1==f.nodeType&&(c=Ji[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 _i(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 Pt(jt.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):Pt.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=Mn.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=Qi().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Ji[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),uo&&function(e){for(var t=e.querySelectorAll(no?"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")||kn.fromSchema(e.state.schema);a=v.parseSlice(i,{preserveWhitespace:!(!u&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Vi.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(de){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=jt.from(u.create(n[s+1],o)),i++,a++}return new Pt(o,i,a)}(qi(a,+h[1],+h[2]),h[4]);else if(a=Pt.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&&Hi(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Ui(i[i.length-1],o.length));var a=$i(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:jt.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=qi(a,y,g)}return e.someProp("transformPasted",(function(e){a=e(a)})),a}var Vi=/^(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 $i(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,jt.from(e));return e}function Hi(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var i=Hi(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(jt.from($i(n,e,o+1))))}}function Ui(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,Ui(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(jt.empty,!0);return e.copy(n.append(r))}function Wi(e,t,n,r,o,i){var a=t<0?e.firstChild:e.lastChild,s=a.content;return o<r-1&&(s=Wi(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(jt.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function qi(e,t,n){return t<e.openStart&&(e=new Pt(Wi(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Pt(Wi(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Ji={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Ki=null;function Qi(){return Ki||(Ki=document.implementation.createHTMLDocument("title"))}var Gi={},Yi={},Xi=k((function e(){g(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 Zi(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ea(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 ta(e,t)})}))}function ta(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function na(e){return{left:e.clientX,top:e.clientY}}function ra(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 oa(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function ia(e,t,n,r,o){return ra(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 jr&&(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(jr.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&&(oa(e,jr.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&&jr.isSelectable(r))&&(oa(e,new jr(n),"pointer"),!0)}(e,n))}function aa(e,t,n,r){return ra(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function sa(e,t,n,r){return ra(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&&(oa(e,Sr.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)oa(e,Sr.create(r,s+1,s+1+a.content.size),"pointer");else{if(!jr.isSelectable(a))continue;oa(e,jr.create(r,s),"pointer")}return!0}}(e,n,r)}function ua(e){return ma(e)}Yi.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!fa(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!so||!no||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!io||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||Li(e,n)?n.preventDefault():Zi(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,xo(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},Yi.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},Yi.keypress=function(e,t){var n=t;if(!(fa(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ao&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof Sr)||!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 la=ao?"metaKey":"ctrlKey";Gi.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=ua(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[la]&&("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(na(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ca(e,a,n,!!r)):("doubleClick"==i?aa:sa)(e,a.pos,a.inside,n)?n.preventDefault():Zi(e,"pointer"))};var ca=function(){function e(t,n,r,o){var i,a,s=this;if(g(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[la],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 jr&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!eo||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)),Zi(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 hi(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(na(e))),this.allowDefault||!t?Zi(this.view,"pointer"):ia(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||oo&&this.mightDrag&&!this.mightDrag.node.isAtom||no&&!(this.view.state.selection instanceof Sr)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(oa(this.view,Dr.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Zi(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),Zi(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function fa(e,t){return!!e.composing||!!(oo&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Gi.touchdown=function(e){ua(e),Zi(e,"pointer")},Gi.contextmenu=function(e){return ua(e)};var da=so?5e3:-1;function pa(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return ma(e)}),t))}function ha(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 ma(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(so&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ha(e),t||e.docView&&e.docView.dirty){var n=di(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}Yi.compositionstart=Yi.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(),ma(e,!0),e.markCursor=null;else if(ma(e),eo&&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}pa(e,da)},Yi.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,pa(e,20))};var va=Xr&&Zr<15||io&&lo<604;function ya(e,t,n,r){var o=_i(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||Pt.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}Gi.copy=Yi.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=va?null:n.clipboardData,a=zi(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"))}},Yi.paste=function(e,t){var n=t;if(!e.composing||so){var r=va?null:n.clipboardData;r&&ya(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?ya(e,r.value,null,t):ya(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var ga=k((function e(t,n){g(this,e),this.slice=t,this.move=n})),ba=ao?"altKey":"ctrlKey";for(var ka in Gi.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(na(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof jr?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(jr.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(jr.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),u=zi(e,s),l=u.dom,c=u.text;n.dataTransfer.clearData(),n.dataTransfer.setData(va?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",va||n.dataTransfer.setData("text/plain",c),e.dragging=new ga(s,!n[ba])}},Gi.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},Yi.dragover=Yi.dragenter=function(e,t){return t.preventDefault()},Yi.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(na(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=_i(e,n.dataTransfer.getData(va?"Text":"text/plain"),va?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[ba]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||Pt.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&&jr.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new jr(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(Di(e,p,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}}}}}},Gi.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())&&hi(e)}),20))},Gi.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)},Gi.beforeinput=function(e,t){if(no&&so&&"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,xo(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)}},Yi)Gi[ka]=Yi[ka];function wa(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 xa=function(){function e(t,n){g(this,e),this.toDOM=t,this.spec=n||Sa,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 Ea(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&&wa(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),Da=function(){function e(t,n){g(this,e),this.attrs=t,this.spec=n||Sa}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 Ea(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&&wa(this.attrs,t.attrs)&&wa(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}]),e}(),Ca=function(){function e(t,n){g(this,e),this.attrs=t,this.spec=n||Sa}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 Ea(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&&wa(this.attrs,t.attrs)&&wa(this.spec,t.spec)}},{key:"destroy",value:function(){}}]),e}(),Ea=function(){function e(t,n,r){g(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 Da}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new xa(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new Da(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new Ca(r,o))}}]),e}(),Oa=[],Sa={},Aa=function(){function e(t,n){g(this,e),this.local=t.length?t:Oa,this.children=n.length?n:Oa}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==ja||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Sa)}},{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,y=m.offset,g=r.maybeChild(v);if(g&&y==p&&y+g.nodeSize==h){var b=s[f+2].mapInner(n,g,d+1,e[f]+i+1,a);b!=ja?(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=Ra(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,C=0;D<w.children.length;D+=3){for(var E=w.children[D];C<s.length&&s[C]<E;)C+=3;s.splice(C,0,w.children[D],w.children[D+1],w.children[D+2])}}return new Aa(t.sort(Pa),s)}(this.children,a||[],t,n,r,o,i):a?new e(a.sort(Pa),Oa):ja}},{key:"add",value:function(t,n){return n.length?this==ja?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=Ta(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,Ra(s,e,u+1,Sa)),a+=3}}));for(var s=Na(a?Fa(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(Pa):this.local,o||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==ja?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!=ja?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):ja}},{key:"forChild",value:function(t,n){if(this==ja)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 Da){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(Pa),Oa);return r?new Ma([d,r]):d}return r||ja}},{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 Ba(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==ja)return Oa;if(e.inlineContent||!this.local.some(Da.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof Da||t.push(this.local[n]);return t}}],[{key:"create",value:function(e,t){return t.length?Ra(t,e,0,Sa):ja}}]),e}();Aa.empty=new Aa([],[]),Aa.removeOverlap=Ba;var ja=Aa.empty,Ma=function(){function e(t){g(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,Sa)}));return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return Aa.empty;for(var r=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(t,n);i!=ja&&(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?Ba(n?t:t.sort(Pa)):Oa}}],[{key:"from",value:function(t){switch(t.length){case 0:return ja;case 1:return t[0];default:return new e(t)}}}]),e}();function Na(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new Ea(o.from+t,o.to+t,o.type))}return n}function Ta(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 Fa(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Ra(e,t,n,r){var o=[],i=!1;t.forEach((function(t,a){var s=Ta(e,t,a+n);if(s){i=!0;var u=Ra(s,t,n+a+1,r);u!=ja&&o.push(a,a+t.nodeSize,u)}}));for(var a=Na(i?Fa(e):e,-n).sort(Pa),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 Aa(a,o):ja}function Pa(e,t){return e.from-t.from||e.to-t.to}function Ba(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),Ia(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),Ia(t,o+1,i.copy(r.to,i.to)))}}return t}function Ia(e,t,n){for(;t<e.length&&Pa(n,e[t])>0;)t++;e.splice(t,0,n)}function La(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=ja&&t.push(r)})),e.cursorWrapper&&t.push(Aa.create(e.state.doc,[e.cursorWrapper.deco])),Ma.from(t)}var za={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_a=Xr&&Zr<=11,Va=function(){function e(){g(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}(),$a=function(){function e(t,n){var r=this;g(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Va,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]);Xr&&Zr<=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()})),_a&&(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,za),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(Ci(this.view)){if(this.suppressingSelectionUpdates)return hi(this.view);if(Xr&&Zr<=11&&!this.view.state.selection.empty){var e=this.view.domSelection();if(e.focusNode&&mo(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)&&Ci(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(eo&&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(Ha)return;Ha=!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)||hi(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(Xr&&Zr<=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?co(o)+1:0,f=n.localPosFromDOM(e.target,c,-1),d=i&&i.parentNode==e.target?co(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}(),Ha=!1;function Ua(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(oo&&/^(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||oo&&/^(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 Wa(e,t,n,r,o){if(t<0){var i=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,a=di(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}],wo(c)||r.push({node:c.focusNode,offset:c.focusOffset})),no&&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")||kn.fromSchema(e.state.schema),y=m.resolve(u),g=null,b=v.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:Ua,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:l}}(e,t,n);if(no&&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,y=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 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,m);if((io&&e.input.lastIOSEnter>Date.now()-225||so)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!g||g.endA>=g.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,xo(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!g){if(!(r&&c instanceof Sr&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||f.sel&&f.sel.anchor!=f.sel.head){if(f.sel){var b=qa(e,e.state.doc,f.sel);b&&!b.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(b))}return}g={start:c.from,endA:c.to,endB:c.to}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof Sr&&(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)),Xr&&Zr<=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),D=v.resolve(g.start),C=w.sameParent(x)&&w.parent.inlineContent&&D.end()>=g.endA;if((io&&e.input.lastIOSEnter>Date.now()-225&&(!C||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!C&&w.pos<f.doc.content.size&&(k=Dr.findFrom(f.doc.resolve(w.pos+1),1,!0))&&k.head==x.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,xo(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||Ja(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(Ja(i,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Ja(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(v,g.start,g.endA,w,x)&&e.someProp("handleKeyDown",(function(t){return t(e,xo(8,"Backspace"))})))so&&no&&e.domObserver.suppressSelectionUpdates();else{no&&so&&g.endB==g.start&&(e.input.lastAndroidDelete=Date.now()),so&&!C&&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,xo(13,"Enter"))}))}),20));var E,O,S,A=g.start,j=g.endA;if(C)if(w.pos==x.pos)Xr&&Zr<=11&&0==w.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return hi(e)}),20)),E=e.state.tr.delete(A,j),O=v.resolve(g.start).marksAcross(v.resolve(g.endA));else if(g.endA==g.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(jt.from(f).eq(e))return{mark:r,type:n}}(w.parent.content.cut(w.parentOffset,x.parentOffset),D.parent.content.cut(D.parentOffset,g.endA-D.start()))))E=e.state.tr,"add"==S.type?E.addMark(A,j,S.mark):E.removeMark(A,j,S.mark);else if(w.parent.child(w.index()).isText&&w.index()==x.index()-(x.textOffset?0:1)){var M=w.parent.textBetween(w.parentOffset,x.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,A,j,M)})))return;E=e.state.tr.insertText(M,A,j)}if(E||(E=e.state.tr.replace(A,j,f.doc.slice(g.start-f.from,g.endB-f.from))),f.sel){var N=qa(e,E.doc,f.sel);N&&!(no&&so&&e.composing&&N.empty&&(g.start!=g.endB||e.input.lastAndroidDelete<Date.now()-100)&&(N.head==A||N.head==E.mapping.map(j)-1)||Xr&&N.empty&&N.head==A)&&E.setSelection(N)}O&&E.ensureMarks(O),e.dispatch(E.scrollIntoView())}}}}function qa(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Di(e,t.resolve(n.anchor),t.resolve(n.head))}function Ja(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 Ka=function(){function e(t,n){var r=this;g(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 Xi,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Za),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=Ya(this),Ga(this),this.nodeViews=Xa(this),this.docView=Go(this.state.doc,Qa(this),La(this),this.dom,this),this.domObserver=new $a(this,(function(e,t,n,o){return Wa(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(t){var n=Gi[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)||ta(e,t)||!e.editable&&t.type in Yi||n(e,t)})};for(var n in Gi)t(n);oo&&e.dom.addEventListener("input",(function(){return null})),ea(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&&ea(this),this._props=e,e.plugins&&(e.plugins.forEach(Za),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&&(ha(this),i=!0),this.state=e,t){var a=Xa(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),ea(this)}this.editable=Ya(this),Ga(this);var s=La(this),u=Qa(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:So(e.dom)}}(this);if(i){this.domObserver.stop();var d=c&&(Xr||no)&&!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=no?this.trackWrites=this.domSelection().focusNode:null;!o&&this.docView.update(e.doc,u,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Go(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 mo(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?hi(this,d):(wi(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 jr){var m=this.docView.domAfterPos(e.selection.from);1==m.nodeType&&Oo(this,m.getBoundingClientRect(),h)}else Oo(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;Ao(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(jo)return e.focus(jo);var t=So(e);e.focus(null==jo?{get preventScroll(){return jo={preventScroll:!0},!0}}:void 0),jo||(jo=!1,Ao(t,0))}(this.dom),hi(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 Fo(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Bo(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 Uo(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,[],La(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){ta(e,t)||!Gi[t.type]||!e.editable&&t.type in Yi||Gi[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 Qa(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]))})),[Ea.node(0,e.state.doc.content.size,t)]}function Ga(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:Ea.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ya(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Xa(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 Za(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 es={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:"'"},ts={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ns="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),rs=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),is="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),as=rs||ns&&+ns[1]<57,ss=0;ss<10;ss++)es[48+ss]=es[96+ss]=String(ss);for(ss=1;ss<=24;ss++)es[ss+111]="F"+ss;for(ss=65;ss<=90;ss++)es[ss]=String.fromCharCode(ss+32),ts[ss]=String.fromCharCode(ss);for(var us in es)ts.hasOwnProperty(us)||(ts[us]=es[us]);var ls="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function cs(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);ls?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function fs(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 ds(e){var t=function(e){var t=Object.create(null);for(var n in e)t[cs(n)]=e[n];return t}(e);return function(e,n){var r,o=function(e){var t=!(as&&(e.ctrlKey||e.altKey||e.metaKey)||is&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?ts:es)[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[fs(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=es[n.keyCode])&&r!=o){var s=t[fs(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){var u=t[fs(o,n,!0)];if(u&&u(e.state,e.dispatch,e))return!0}return!1}}var ps=Math.pow(2,16);function hs(e){return 65535&e}var ms=function(){function e(t,n,r){g(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}(),vs=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(g(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=hs(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))/ps}(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)*ps,p=e==s?2:e==c?1:4;return(t<0?e!=s:e!=c)&&(p|=8),new ms(f,p,d)}r+=l-u}return n?e+r:new ms(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=hs(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}();vs.empty=new vs([]);var ys=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;g(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 ms(e,r,null)}}]),e}(),gs=Object.create(null),bs=function(){function e(){g(this,e)}return k(e,[{key:"getMap",value:function(){return vs.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=gs[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 gs)throw new RangeError("Duplicate use of step JSON ID "+e);return gs[e]=t,t.prototype.jsonID=e,t}}]),e}(),ks=function(){function e(t,n){g(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(de){if(de instanceof Rt)return e.fail(de.message);throw de}}}]),e}();function ws(e,t,n){for(var r=[],o=0;o<e.childCount;o++){var i=e.child(o);i.content.size&&(i=i.copy(ws(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return jt.fromArray(r)}var xs=function(e){D(n,e);var t=S(n);function n(e,r,o){var i;return g(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 Pt(ws(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 ks.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new Ds(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}(bs);bs.jsonID("addMark",xs);var Ds=function(e){D(n,e);var t=S(n);function n(e,r,o){var i;return g(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 Pt(ws(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return ks.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new xs(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}(bs);bs.jsonID("removeMark",Ds);var Cs=function(e){D(n,e);var t=S(n);function n(e,r,o){var i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return g(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&&Os(e,this.from,this.to)?ks.fail("Structure replace would overwrite content"):ks.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new vs([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?Pt.empty:new Pt(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?Pt.empty:new Pt(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,Pt.fromJSON(e,t.slice),!!t.structure)}}]),n}(bs);bs.jsonID("replace",Cs);var Es=function(e){D(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 g(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&&(Os(e,this.from,this.gapFrom)||Os(e,this.gapTo,this.to)))return ks.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ks.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?ks.fromReplace(e,this.from,this.to,n):ks.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new vs([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,Pt.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(bs);function Os(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 Ss(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function As(e){return{type:e,attrs:null}}function js(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 Ms(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 Ns(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 Es(s,u,s+1,u-1,new Pt(jt.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}function Ts(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 Es(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Pt(jt.from(a),0,0),1,!0))}function Fs(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 Rs(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=jt.empty,a=jt.empty,s=o.depth,u=o.depth-n,l=n-1;s>u;s--,l--){i=jt.from(o.node(s).copy(i));var c=r&&r[l];a=jt.from(c?c.type.create(c.attrs,a):o.node(s).copy(a))}e.step(new Cs(t,t,new Pt(i.append(a),n,n),!0))}function Ps(e,t){var n=e.resolve(t),r=n.index();return Bs(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Bs(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function Is(e,t,n){var r=new Cs(t-n,t+n,Pt.empty,!0);e.step(r)}function Ls(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pt.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return zs(o,i,r)?new Cs(t,n,r):new _s(o,i,r).fit()}function zs(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}bs.jsonID("replaceAround",Es);var _s=function(){function e(t,n,r){g(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=jt.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=jt.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 Pt(i,a,s);return t>-1?new Es(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Cs(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=Hs(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(jt.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=Hs(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new Pt(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=Hs(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new Pt(Vs(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Pt(Vs(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),y=p.matchType(v.type);if(!y)break;(++c>1||0==l||v.content.size)&&(p=y,f.push(Us(v.mark(h.allowedMarks(v.marks)),1==c?l:0,c==u.childCount?m:-1)))}var g=c==u.childCount;g||(m=-1),this.placed=$s(this.placed,n,jt.from(f)),this.frontier[n].match=p,g&&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=g?0==t?Pt.empty:new Pt(Vs(s.content,t-1,1),t-1,m<0?s.openEnd:t-1):new Pt(Vs(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||!Ws(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=Ws(e,t,o,r,i);if(a){for(var s=t-1;s>=0;s--){var u=this.frontier[s],l=u.match,c=Ws(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=$s(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=$s(this.placed,this.depth,jt.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(jt.empty,!0);e.childCount&&(this.placed=$s(this.placed,this.frontier.length,e))}}]),e}();function Vs(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vs(e.firstChild.content,t-1,n)))}function $s(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy($s(e.lastChild.content,t-1,n)))}function Hs(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function Us(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,Us(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(jt.empty,!0)))),e.copy(r)}function Ws(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 qs(e){return e.spec.defining||e.spec.definingForContent}function Js(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(Js(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(jt.empty,!0))}return e}function Ks(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 Qs=Error;((Qs=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=Qs,Qs.prototype.name="TransformError";var Gs=function(){function e(t){g(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new ys}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 Qs(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]:Pt.empty,r=Ls(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new Pt(jt.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,Pt.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(zs(o,i,r))return e.step(new Cs(t,n,r));var a=Ks(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 y=p-1;y>=0;y--){var g=d[y].type,b=qs(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 D=0;D<a.length;D++){var C=a[(D+f)%a.length],E=!0;C<0&&(E=!1,C=-C);var O=o.node(C-1),S=o.index(C-1);if(O.canReplaceWith(S,S,x.type,x.marks))return e.replace(o.before(C),E?i.after(C):n,new Pt(Js(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 M=a[j];M<0||(t=o.before(M),n=i.after(M))}}(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 Pt(jt.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=Ks(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=jt.empty,f=0,d=i,p=!1;d>n;d--)p||r.index(d)>0?(p=!0,c=jt.from(r.node(d).copy(c)),f++):u--;for(var h=jt.empty,m=0,v=i,y=!1;v>n;v--)y||o.after(v+1)<o.end(v)?(y=!0,h=jt.from(o.node(v).copy(h)),m++):l++;e.step(new Es(u,l,a,s,new Pt(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 Is(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=jt.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=jt.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new Es(a,s,a,s,new Pt(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 Ns(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 Ts(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 Rs(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 Ds(f,d,c[h])));i&&i.to==f?i.to=d:s.push(i=new xs(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 yn)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 Ds(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 Ds(a,l,u.marks[f]))}else i.push(new Cs(a,l,Pt.empty));a=l}if(!r.validEnd){var d=r.fillBefore(jt.empty,!0);e.replace(a,a,new Pt(d,0,0))}for(var p=i.length-1;p>=0;p--)e.step(i[p])}(this,e,t,n),this}}]),e}(),Ys=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)},Xs=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=tu(r);if(!o){var i=r.blockRange(),a=i&&Gn(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&du(e,o,t))return!0;if(0==r.parent.content.size&&(Zs(s,"end")||jr.isSelectable(s))){var u=ur(e.doc,r.before(),r.after(),Pt.empty);if(u&&u.slice.size<u.to-u.from){if(t){var l=e.tr.step(u);l.setSelection(Zs(s,"end")?Dr.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):jr.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 Zs(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 eu=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=tu(o)}var a=i&&i.nodeBefore;return!(!a||!jr.isSelectable(a))&&(t&&t(e.tr.setSelection(jr.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function tu(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 nu=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=ou(r);if(!o)return!1;var i=o.nodeAfter;if(du(e,o,t))return!0;if(0==r.parent.content.size&&(Zs(i,"start")||jr.isSelectable(i))){var a=ur(e.doc,r.before(),r.after(),Pt.empty);if(a&&a.slice.size<a.to-a.from){if(t){var s=e.tr.step(a);s.setSelection(Zs(i,"start")?Dr.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):jr.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)},ru=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=ou(o)}var a=i&&i.nodeAfter;return!(!a||!jr.isSelectable(a))&&(t&&t(e.tr.setSelection(jr.create(e.doc,i.pos)).scrollIntoView()),!0)};function ou(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 iu=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=r.blockRange(o),a=i&&Gn(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},au=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 su(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 uu=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=su(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(Dr.near(l.doc.resolve(u),1)),t(l.scrollIntoView())}return!0},lu=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof Nr||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=su(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(Sr.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},cu=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(rr(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Gn(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},fu=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof jr&&e.selection.node.isBlock)return!(!r.parentOffset||!rr(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 Sr||e.selection instanceof Nr)&&a.deleteSelection();var s=0==r.depth?null:su(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=i&&s?[{type:s}]:void 0,l=rr(a.doc,a.mapping.map(r.pos),1,u);if(u||l||!rr(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 du(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&&!ir(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=jt.empty,c=r.length-1;c>=0;c--)l=jt.from(r[c].create(null,l));l=jt.from(i.copy(l));var f=e.tr.step(new Jn(t.pos-1,u,t.pos,u,new Pt(l,1,0),r.length,!0)),d=u+2*r.length;ir(f.doc,d)&&f.join(d),n(f.scrollIntoView())}return!0}var p=Dr.findFrom(t,1),h=p&&p.$from.blockRange(p.$to),m=h&&Gn(h);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(h,m).scrollIntoView()),!0;if(s&&Zs(a,"start",!0)&&Zs(i,"end")){for(var v=i,y=[];y.push(v),!v.isTextblock;)v=v.lastChild;for(var g=a,b=1;!g.isTextblock;g=g.firstChild)b++;if(v.canReplace(v.childCount,v.childCount,g.content)){if(n){for(var k=jt.empty,w=y.length-1;w>=0;w--)k=jt.from(y[w].copy(k));n(e.tr.step(new Jn(t.pos-y.length,t.pos+a.nodeSize,t.pos+b,t.pos+a.nodeSize-b,new Pt(k,y.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pu(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(Sr.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var hu=pu(-1),mu=pu(1);function vu(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&&Yn(s,e,t);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}function yu(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 gu(){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 bu=gu(Ys,Xs,eu),ku=gu(Ys,nu,ru),wu={Enter:gu(au,lu,cu,fu),"Mod-Enter":uu,Backspace:bu,"Mod-Backspace":bu,"Shift-Backspace":bu,Delete:ku,"Mod-Delete":ku,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new Nr(e.doc))),!0}},xu={"Ctrl-h":wu.Backspace,"Alt-Backspace":wu["Mod-Backspace"],"Ctrl-d":wu.Delete,"Ctrl-Alt-Backspace":wu["Mod-Delete"],"Alt-Delete":wu["Mod-Delete"],"Alt-d":wu["Mod-Delete"],"Ctrl-a":hu,"Ctrl-e":mu};for(var Du in wu)xu[Du]=wu[Du];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function Cu(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 Yt(c,c,s.depth),s.endIndex<s.parent.childCount&&(s=new Yt(i,n.doc.resolve(a.end(s.depth)),s.depth)),u=!0}var f=Yn(l,e,t,s);return!!f&&(r&&r(Eu(n.tr,s,f,u,e).scrollIntoView()),!0)}}function Eu(e,t,n,r,o){for(var i=jt.empty,a=n.length-1;a>=0;a--)i=jt.from(n[a].type.create(n[a].attrs,i));e.step(new Jn(t.start-(r?2:0),t.end,t.start,t.end,new Pt(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&&rr(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=f.child(d).nodeSize;return e}function Ou(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 Jn(i-1,a,i,a,new Pt(jt.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Yt(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));return t(o.lift(r,Gn(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?jt.empty:jt.from(o))))return!1;var h=u.pos,m=h+l.nodeSize;return r.step(new Jn(h-(c?1:0),m+(f?1:0),h+1,m-1,new Pt((c?jt.empty:jt.from(o.copy(jt.empty))).append(f?jt.empty:jt.from(o.copy(jt.empty))),c?0:1,f?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,a)))}}function Su(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 Au=function(){function e(t){g(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:Su({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}(),ju=function(){function e(){g(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 Mu(e,t,n){return void 0===e.config[t]&&e.parent?Mu(e.parent,t,n):"function"===typeof e.config[t]?e.config[t].bind(i(i({},n),{},{parent:e.parent?Mu(e.parent,t,n):null})):e.config[t]}function Nu(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 Tu(e){var t=[],n=Nu(e),r=n.nodeExtensions,o=n.markExtensions,a=[].concat(B(r),B(o)),s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((function(e){var n=Mu(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=Mu(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 Fu(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 Ru(){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 Pu(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 Ru(e,t)}),{})}function Bu(e){return"function"===typeof e}function Iu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Bu(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 Lu(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 zu(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 _u(e){var t,n=Tu(e),r=Nu(e),o=r.nodeExtensions,a=r.markExtensions,s=null===(t=o.find((function(e){return Mu(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=Mu(n,"extendNodeSchema",o);return i(i({},e),r?r(t):{})}),{}),s=zu(i(i({},a),{},{content:Iu(Mu(t,"content",o)),marks:Iu(Mu(t,"marks",o)),group:Iu(Mu(t,"group",o)),inline:Iu(Mu(t,"inline",o)),atom:Iu(Mu(t,"atom",o)),selectable:Iu(Mu(t,"selectable",o)),draggable:Iu(Mu(t,"draggable",o)),code:Iu(Mu(t,"code",o)),defining:Iu(Mu(t,"defining",o)),isolating:Iu(Mu(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=Iu(Mu(t,"parseHTML",o));u&&(s.parseDOM=u.map((function(e){return Lu(e,r)})));var l=Mu(t,"renderHTML",o);l&&(s.toDOM=function(e){return l({node:e,HTMLAttributes:Pu(e,r)})});var c=Mu(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=Mu(n,"extendMarkSchema",o);return i(i({},e),r?r(t):{})}),{}),s=zu(i(i({},a),{},{inclusive:Iu(Mu(t,"inclusive",o)),excludes:Iu(Mu(t,"excludes",o)),group:Iu(Mu(t,"group",o)),spanning:Iu(Mu(t,"spanning",o)),code:Iu(Mu(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=Iu(Mu(t,"parseHTML",o));u&&(s.parseDOM=u.map((function(e){return Lu(e,r)})));var l=Mu(t,"renderHTML",o);return l&&(s.toDOM=function(e){return l({mark:e,HTMLAttributes:Pu(e,r)})}),[t.name,s]})));return new gn({topNode:s,nodes:u,marks:l})}function Vu(e,t){return t.nodes[e]||t.marks[e]||null}function $u(e,t){return Array.isArray(t)?t.some((function(t){return("string"===typeof t?t:t.name)===e.name})):t}function Hu(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Uu=k((function e(t){g(this,e),this.find=t.find,this.handler=t.handler}));function Wu(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(Hu(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=Su({state:u.state,transaction:a}),d={from:r-(t[0].length-i.length),to:o},p=new Au({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 qu(e){var t=e.editor,n=e.rules,r=new $r({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 Wu({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&&Wu({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&&Wu({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var Ju=k((function e(t){g(this,e),this.find=t.find,this.handler=t.handler}));function Ku(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=new Au({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(Hu(t))return B(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 Qu=function(){function e(t,n){var r=this;g(this,e),this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=_u(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:Vu(e.name,r.schema)};"mark"===e.type&&((null===(t=Iu(Mu(e,"keepOnSplit",n)))||void 0===t||t)&&r.splittableMarks.push(e.name));var o=Mu(e,"onBeforeCreate",n);o&&r.editor.on("beforeCreate",o);var i=Mu(e,"onCreate",n);i&&r.editor.on("create",i);var a=Mu(e,"onUpdate",n);a&&r.editor.on("update",a);var s=Mu(e,"onSelectionUpdate",n);s&&r.editor.on("selectionUpdate",s);var u=Mu(e,"onTransaction",n);u&&r.editor.on("transaction",u);var l=Mu(e,"onFocus",n);l&&r.editor.on("focus",l);var c=Mu(e,"onBlur",n);c&&r.editor.on("blur",c);var f=Mu(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=Mu(n,"addCommands",{name:n.name,options:n.options,storage:n.storage,editor:e.editor,type:Vu(n.name,e.schema)});return r?i(i({},t),r()):t}),{})}},{key:"plugins",get:function(){var t=this,n=this.editor,r=e.sort(B(this.extensions).reverse()),o=[],i=[],a=r.map((function(e){var r={name:e.name,options:e.options,storage:e.storage,editor:n,type:Vu(e.name,t.schema)},a=[],s=Mu(e,"addKeyboardShortcuts",r);if(s){var u=function(e){return new $r({props:{handleKeyDown:ds(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=Mu(e,"addInputRules",r);$u(e,n.options.enableInputRules)&&l&&o.push.apply(o,B(l()));var c=Mu(e,"addPasteRules",r);$u(e,n.options.enablePasteRules)&&c&&i.push.apply(i,B(c()));var f=Mu(e,"addProseMirrorPlugins",r);if(f){var d=f();a.push.apply(a,B(d))}return a})).flat();return[qu({editor:n,rules:o})].concat(B(function(e){var t=e.editor,n=e.rules,r=null,o=!1,i=!1;return n.map((function(e){return new $r({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=Su({state:a,transaction:d});if(Ku({editor:t,state:p,from:Math.max(c-1,0),to:f.b,rule:e})&&d.steps.length)return d}}}})}))}({editor:n,rules:i})),B(a))}},{key:"attributes",get:function(){return Tu(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=Nu(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(e){return!!Mu(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:Fu(n.name,e.schema)},i=Mu(n,"addNodeView",o);if(!i)return[];return[n.name,function(e,o,a,s){var u=Pu(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 B(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=Mu(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e].concat(B(t.flatten(n()))):e})).flat(10)}},{key:"sort",value:function(e){return e.sort((function(e,t){var n=Mu(e,"priority")||100,r=Mu(t,"priority")||100;return n>r?-1:n<r?1:0}))}}]),e}();function Gu(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Yu(e,t){var n=i({},e);return Gu(e)&&Gu(t)&&Object.keys(t).forEach((function(o){Gu(t[o])&&o in e?n[o]=Yu(e[o],t[o]):Object.assign(n,r({},o,t[o]))})),n}var Xu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};g(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=Iu(Mu(this,"addOptions",{name:this.name}))),this.storage=Iu(Mu(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=Yu(this.options,e),t.storage=Iu(Mu(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=Iu(Mu(n,"addOptions",{name:n.name})),n.storage=Iu(Mu(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,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 el(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 tl=Xu.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var e=this;return[new $r({key:new Wr("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,B(i.map((function(e){return e.$from.pos})))),s=Math.max.apply(Math,B(i.map((function(e){return e.$to.pos}))));return Zu(o,{from:a,to:s},{textSerializers:el(r)})}}})]}});function nl(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]:Hu(t[r])?t[r].test(e[r]):t[r]===e[r]}))}function rl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find((function(e){return e.type===t&&nl(e.attrs,n)}))}function ol(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!rl(e,t,n)}function il(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=rl(B(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(rl(B(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&&ol(B(e.parent.child(s).marks),t,n);)u+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}}}}function al(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 sl(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 ul(e){return sl(e)&&e instanceof Sr}function ll(){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 cl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=Dr.atStart(e),r=Dr.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?Sr.create(e,ll(0,o,i),ll(e.content.size,o,i)):Sr.create(e,ll(t,o,i),ll(t,o,i))}function fl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function dl(e){var t="<body>".concat(e,"</body>");return(new window.DOMParser).parseFromString(t,"text/html").body}function pl(e,t,n){if(n=i({slice:!0,parseOptions:{}},n),"object"===typeof e&&null!==e)try{return Array.isArray(e)?jt.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),pl("",t,n)}if("string"===typeof e){var r=kn.fromSchema(t);return n.slice?r.parseSlice(dl(e),n.parseOptions).content:r.parse(dl(e),n.parseOptions)}return pl("",t,n)}function hl(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function ml(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?Fu(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 nl(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 vl(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function yl(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 gl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return pl(e,t,{slice:!1,parseOptions:n})}function bl(e,t){var n=al(t,e.schema),r=e.selection,o=r.from,a=r.to,s=r.empty,u=[];s?(e.storedMarks&&u.push.apply(u,B(e.storedMarks)),u.push.apply(u,B(e.selection.$head.marks()))):e.doc.nodesBetween(o,a,(function(e){u.push.apply(u,B(e.marks))}));var l=u.find((function(e){return e.type.name===n.name}));return l?i({},l.attrs):{}}function kl(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 wl(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 xl(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 Dl(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 Cl(e,t){var n=Nu(t).nodeExtensions.find((function(t){return t.name===e}));if(!n)return!1;var r=Iu(Mu(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"===typeof r&&r.split(" ").includes("list")}var El=function(e,t){var n=Dl((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)||!Ps(e.doc,n.pos)||(e.join(n.pos),!0)},Ol=function(e,t){var n=Dl((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)||!Ps(e.doc,r)||(e.join(r),!0)};function Sl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?al(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 nl(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,B(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 nl(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 Al=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=function(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||!Ss(r,o,i))break}return null}(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 lu(t,n)}},deleteNode:function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=Fu(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 Ys(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 uu(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=al(e,o.schema),s=r.doc,u=r.selection,l=u.$from,c=u.from,f=u.to;if(i){var d=il(l,a,t);if(d&&d.from<=c&&d.to>=f){var p=Sr.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(){fl()&&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&&!ul(r.state.selection))return u(),!0;var l=cl(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=pl(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 Cs||o instanceof Es){var i=e.mapping.maps[r],a=0;i.forEach((function(e,t,n,r){0===a&&(a=r)})),e.setSelection(Dr.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 Xs(t,n)}},joinForward:function(){return function(e){var t=e.state,n=e.dispatch;return nu(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));fl()||hl()?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!!ml(r,Fu(e,r.schema),t)&&iu(r,o)}},liftEmptyBlock:function(){return function(e){var t=e.state,n=e.dispatch;return cu(t,n)}},liftListItem:function(e){return function(t){var n=t.state,r=t.dispatch;return Ou(Fu(e,n.schema))(n,r)}},newlineInCode:function(){return function(e){var t=e.state,n=e.dispatch;return au(t,n)}},resetAttributes:function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=vl("string"===typeof e?e:e.name,o.schema);return!!u&&("node"===u&&(a=Fu(e,o.schema)),"mark"===u&&(s=al(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,yl(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((function(o){s===o.type&&r.addMark(n,n+e.nodeSize,s.create(yl(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 eu(t,n)}},selectNodeForward:function(){return function(e){var t=e.state,n=e.dispatch;return ru(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(jr.create(e.doc,n))),!0)}(e.state,e.dispatch)}},selectTextblockEnd:function(){return function(e){var t=e.state,n=e.dispatch;return mu(t,n)}},selectTextblockStart:function(){return function(e){var t=e.state,n=e.dispatch;return hu(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=gl(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=al(e,o.schema);if(a)if(u){var f=bl(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=Fu(e,r.schema);return a.isTextblock?i().command((function(e){var n=e.commands;return!!yu(a,t)(r)||n.clearNodes()})).command((function(e){var n=e.state;return yu(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=Dr.atStart(r).from,i=Dr.atEnd(r).to,a=ll(e,o,i),s=jr.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=Sr.atStart(r).from,u=Sr.atEnd(r).to,l=ll(i,s,u),c=ll(a,s,u),f=Sr.create(r,l,c);n.setSelection(f)}return!0}},sinkListItem:function(e){return function(t){var n,r=t.state,o=t.dispatch,i=Fu(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=jt.from(c?n.create():null),d=new Pt(jt.from(n.create(null,jt.from(u.type.create(null,f)))),c?3:1,0),p=a.start,h=a.end;t(e.tr.step(new Jn(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=kl(i.extensionManager.attributes,u.node().type.name,u.node().attrs);if(a instanceof jr&&a.node.isBlock)return!(!u.parentOffset||!Fs(s,u.pos))&&(o&&(n&&xl(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 Sr&&t.deleteSelection();var d=0===u.depth?void 0:wl(u.node(-1).contentMatchAt(u.indexAfter(-1))),p=f&&d?[{type:d,attrs:c}]:void 0,h=Fs(t.doc,t.mapping.map(u.pos),1,p);if(p||h||!Fs(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&&xl(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=Fu(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=jt.empty,m=l.index(-1)?1:l.index(-2)?2:3,v=l.depth-m;v>=l.depth-3;v-=1)h=jt.from(l.node(v).copy(h));var y=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,g=kl(p,l.node().type.name,l.node().attrs),b=(null===(n=s.contentMatch.defaultType)||void 0===n?void 0:n.createAndFill(g))||void 0;h=h.append(jt.from(s.createAndFill(null,b)||void 0));var k=l.before(l.depth-(m-1));r.replace(k,l.after(-y),new Pt(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(Sr.near(r.doc.resolve(w))),r.scrollIntoView()}return!0}var x=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,D=kl(p,d.type.name,d.attrs),C=kl(p,l.node().type.name,l.node().attrs);r.delete(l.pos,c.pos);var E=x?[{type:s,attrs:D},{type:x,attrs:C}]:[{type:s,attrs:D}];return!!Fs(r.doc,l.pos,2)&&(i&&r.split(l.pos,2,E).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=Fu(e,i.schema),d=Fu(t,i.schema),p=i.selection,h=p.$from,m=p.$to,v=h.blockRange(m);if(!v)return!1;var y=Dl((function(e){return Cl(e.type.name,c)}))(p);if(v.depth>=1&&y&&v.depth-y.depth<=1){if(y.node.type===f)return u.liftListItem(d);if(Cl(y.node.type.name,c)&&f.validContent(y.node.content)&&a)return s().command((function(){return o.setNodeMarkup(y.pos,f),!0})).command((function(){return El(o,f)})).command((function(){return Ol(o,f)})).run()}return s().command((function(){return!!l().wrapInList(f)||u.clearNodes()})).wrapInList(f).command((function(){return El(o,f)})).command((function(){return Ol(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=al(e,o.schema);return Sl(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=Fu(e,o.schema),s=Fu(t,o.schema);return ml(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=Fu(e,r.schema);return ml(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=al(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,y=il(f,c,v);y&&(h=y.from,m=y.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=vl("string"===typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(s=Fu(e,o.schema)),"mark"===l&&(u=al(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 vu(Fu(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 Cu(Fu(e,r.schema),t)(r,o)}}}),jl=Xu.create({name:"commands",addCommands:function(){return i({},Al)}}),Ml=Xu.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new $r({key:new Wr("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),Nl=Xu.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new $r({key:new Wr("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}}}})]}}),Tl=Xu.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=Dr.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 fl()||hl()?a:o},addProseMirrorPlugins:function(){var e=this;return[new $r({key:new Wr("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=Dr.atStart(n.doc).from,l=Dr.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=Su({state:r,transaction:d});if(new Au({editor:e.editor,state:p}).commands.clearNodes(),d.steps.length)return d}}}})]}}),Fl=Xu.create({name:"tabindex",addProseMirrorPlugins:function(){return[new $r({key:new Wr("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Rl=Object.freeze({__proto__:null,ClipboardTextSerializer:tl,Commands:jl,Editable:Ml,FocusEvents:Nl,Keymap:Tl,Tabindex:Fl});function Pl(e,t){var n=vl("string"===typeof t?t:t.name,e.schema);return"node"===n?function(e,t){var n=Fu(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?bl(e,t):{}}function Bl(e,t){var n=Mn.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Il(e,t){return Zu(e,{from:0,to:e.content.size},t)}var Ll=function(e){D(n,e);var t=S(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g(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:w(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:w(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=Bu(t)?t(e,B(this.state.plugins)):[].concat(B(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(Rl):[],t=[].concat(B(e),B(this.options.extensions)).filter((function(e){return["extension","node","mark"].includes(null===e||void 0===e?void 0:e.type)}));this.extensionManager=new Qu(t,this)}},{key:"createCommandManager",value:function(){this.commandManager=new Au({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var e=gl(this.options.content,this.schema,this.options.parseOptions),t=cl(e,this.options.autofocus);this.view=new Ka(this.options.element,i(i({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:_r.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 Pl(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 ml(e,null,n)||Sl(e,null,n);var r=vl(t,e.schema);return"node"===r?ml(e,t,n):"mark"===r&&Sl(e,t,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Bl(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 Il(this.state.doc,{blockSeparator:r,textSerializers:i(i({},a),el(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}(ju);function zl(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 _l(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach((function(t){var o=il(n.resolve(e-1),t.type);o&&r.push(i({mark:t},o))})):n.nodesBetween(e,t,(function(e,t){r.push.apply(r,B(e.marks.map((function(n){return{from:t,to:t+e.nodeSize,mark:n}}))))})),r}function Vl(e,t,n){var r=e.state.doc.content.size,o=ll(t,0,r),a=ll(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}})}function $l(e){return new Uu({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Iu(e.getAttributes,void 0,o)||{},a=n.tr.delete(r.from,r.to),s=a.doc.resolve(r.from).blockRange(),u=s&&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]:e,o=js(e,t),i=o&&Ms(r,t);return i?o.map(As).concat({type:t,attrs:n}).concat(i.map(As)):null}(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&&Ps(a.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,l))&&a.join(r.from-1)}})}var Hl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};g(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=Iu(Mu(this,"addOptions",{name:this.name}))),this.storage=Iu(Mu(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=Yu(this.options,e),t.storage=Iu(Mu(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=Iu(Mu(n,"addOptions",{name:n.name})),n.storage=Iu(Mu(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}(),Ul=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};g(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=Iu(Mu(this,"addOptions",{name:this.name}))),this.storage=Iu(Mu(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=Yu(this.options,e),t.storage=Iu(Mu(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=Iu(Mu(n,"addOptions",{name:n.name})),n.storage=Iu(Mu(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 Wl(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ql(e){return e instanceof Wl(e).Element||e instanceof Element}function Jl(e){return e instanceof Wl(e).HTMLElement||e instanceof HTMLElement}function Kl(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Wl(e).ShadowRoot||e instanceof ShadowRoot)}var Ql=Math.max,Gl=Math.min,Yl=Math.round;function Xl(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Zl(){return!/^((?!chrome|android).)*safari/i.test(Xl())}function ec(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Jl(e)&&(o=e.offsetWidth>0&&Yl(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yl(r.height)/e.offsetHeight||1);var a=(ql(e)?Wl(e):window).visualViewport,s=!Zl()&&n,u=(r.left+(s&&a?a.offsetLeft:0))/o,l=(r.top+(s&&a?a.offsetTop:0))/i,c=r.width/o,f=r.height/i;return{width:c,height:f,top:l,right:u+c,bottom:l+f,left:u,x:u,y:l}}function tc(e){var t=Wl(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function nc(e){return e?(e.nodeName||"").toLowerCase():null}function rc(e){return((ql(e)?e.ownerDocument:e.document)||window.document).documentElement}function oc(e){return ec(rc(e)).left+tc(e).scrollLeft}function ic(e){return Wl(e).getComputedStyle(e)}function ac(e){var t=ic(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function sc(e,t,n){void 0===n&&(n=!1);var r=Jl(t),o=Jl(t)&&function(e){var t=e.getBoundingClientRect(),n=Yl(t.width)/e.offsetWidth||1,r=Yl(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=rc(t),a=ec(e,o,n),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==nc(t)||ac(i))&&(s=function(e){return e!==Wl(e)&&Jl(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:tc(e);var t}(t)),Jl(t)?((u=ec(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=oc(i))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function uc(e){var t=ec(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 lc(e){return"html"===nc(e)?e:e.assignedSlot||e.parentNode||(Kl(e)?e.host:null)||rc(e)}function cc(e){return["html","body","#document"].indexOf(nc(e))>=0?e.ownerDocument.body:Jl(e)&&ac(e)?e:cc(lc(e))}function fc(e,t){var n;void 0===t&&(t=[]);var r=cc(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Wl(r),a=o?[i].concat(i.visualViewport||[],ac(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(fc(lc(a)))}function dc(e){return["table","td","th"].indexOf(nc(e))>=0}function pc(e){return Jl(e)&&"fixed"!==ic(e).position?e.offsetParent:null}function hc(e){for(var t=Wl(e),n=pc(e);n&&dc(n)&&"static"===ic(n).position;)n=pc(n);return n&&("html"===nc(n)||"body"===nc(n)&&"static"===ic(n).position)?t:n||function(e){var t=/firefox/i.test(Xl());if(/Trident/i.test(Xl())&&Jl(e)&&"fixed"===ic(e).position)return null;var n=lc(e);for(Kl(n)&&(n=n.host);Jl(n)&&["html","body"].indexOf(nc(n))<0;){var r=ic(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 mc="top",vc="bottom",yc="right",gc="left",bc="auto",kc=[mc,vc,yc,gc],wc="start",xc="end",Dc="viewport",Cc="popper",Ec=kc.reduce((function(e,t){return e.concat([t+"-"+wc,t+"-"+xc])}),[]),Oc=[].concat(kc,[bc]).reduce((function(e,t){return e.concat([t,t+"-"+wc,t+"-"+xc])}),[]),Sc=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Ac(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 jc(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var Mc={placement:"bottom",modifiers:[],strategy:"absolute"};function Nc(){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 Tc(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Mc:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mc,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:ql(e)?fc(e):e.contextElement?fc(e.contextElement):[],popper:fc(t)};var c=function(e){var t=Ac(e);return Sc.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(Nc(t,n)){o.rects={reference:sc(t,hc(n),"fixed"===o.options.strategy),popper:uc(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:jc((function(){return new Promise((function(e){u.forceUpdate(),e(o)}))})),destroy:function(){l(),s=!0}};if(!Nc(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 Fc={passive:!0};function Rc(e){return e.split("-")[0]}function Pc(e){return e.split("-")[1]}function Bc(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ic(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Rc(o):null,a=o?Pc(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case mc:t={x:s,y:n.y-r.height};break;case vc:t={x:s,y:n.y+n.height};break;case yc:t={x:n.x+n.width,y:u};break;case gc:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var l=i?Bc(i):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case wc:t[l]=t[l]-(n[c]/2-r[c]/2);break;case xc:t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}var Lc={top:"auto",right:"auto",bottom:"auto",left:"auto"};function zc(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 y=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),b=gc,k=mc,w=window;if(l){var x=hc(n),D="clientHeight",C="clientWidth";if(x===Wl(n)&&"static"!==ic(x=rc(n)).position&&"absolute"===s&&(D="scrollHeight",C="scrollWidth"),o===mc||(o===gc||o===yc)&&i===xc)k=vc,m-=(f&&x===w&&w.visualViewport?w.visualViewport.height:x[D])-r.height,m*=u?1:-1;if(o===gc||(o===mc||o===vc)&&i===xc)b=yc,p-=(f&&x===w&&w.visualViewport?w.visualViewport.width:x[C])-r.width,p*=u?1:-1}var E,O=Object.assign({position:s},l&&Lc),S=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Yl(t*r)/r||0,y:Yl(n*r)/r||0}}({x:p,y:m}):{x:p,y:m};return p=S.x,m=S.y,u?Object.assign({},O,((E={})[k]=g?"0":"",E[b]=y?"0":"",E.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",E)):Object.assign({},O,((t={})[k]=g?m+"px":"",t[b]=y?p+"px":"",t.transform="",t))}var _c={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];Jl(o)&&nc(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}),{});Jl(r)&&nc(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Vc={left:"right",right:"left",bottom:"top",top:"bottom"};function $c(e){return e.replace(/left|right|bottom|top/g,(function(e){return Vc[e]}))}var Hc={start:"end",end:"start"};function Uc(e){return e.replace(/start|end/g,(function(e){return Hc[e]}))}function Wc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Kl(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function qc(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Jc(e,t,n){return t===Dc?qc(function(e,t){var n=Wl(e),r=rc(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;var l=Zl();(l||!l&&"fixed"===t)&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s+oc(e),y:u}}(e,n)):ql(t)?function(e,t){var n=ec(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):qc(function(e){var t,n=rc(e),r=tc(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=Ql(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ql(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+oc(e),u=-r.scrollTop;return"rtl"===ic(o||n).direction&&(s+=Ql(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(rc(e)))}function Kc(e,t,n,r){var o="clippingParents"===t?function(e){var t=fc(lc(e)),n=["absolute","fixed"].indexOf(ic(e).position)>=0&&Jl(e)?hc(e):e;return ql(n)?t.filter((function(e){return ql(e)&&Wc(e,n)&&"body"!==nc(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=Jc(e,n,r);return t.top=Ql(o.top,t.top),t.right=Gl(o.right,t.right),t.bottom=Gl(o.bottom,t.bottom),t.left=Ql(o.left,t.left),t}),Jc(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Qc(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Gc(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Yc(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,u=void 0===s?"clippingParents":s,l=n.rootBoundary,c=void 0===l?Dc:l,f=n.elementContext,d=void 0===f?Cc:f,p=n.altBoundary,h=void 0!==p&&p,m=n.padding,v=void 0===m?0:m,y=Qc("number"!==typeof v?v:Gc(v,kc)),g=d===Cc?"reference":Cc,b=e.rects.popper,k=e.elements[h?g:d],w=Kc(ql(k)?k:k.contextElement||rc(e.elements.popper),u,c,a),x=ec(e.elements.reference),D=Ic({reference:x,element:b,strategy:"absolute",placement:o}),C=qc(Object.assign({},b,D)),E=d===Cc?C:x,O={top:w.top-E.top+y.top,bottom:E.bottom-w.bottom+y.bottom,left:w.left-E.left+y.left,right:E.right-w.right+y.right},S=e.modifiersData.offset;if(d===Cc&&S){var A=S[o];Object.keys(O).forEach((function(e){var t=[yc,vc].indexOf(e)>=0?1:-1,n=[mc,vc].indexOf(e)>=0?"y":"x";O[e]+=A[n]*t}))}return O}function Xc(e,t,n){return Ql(e,Gl(t,n))}function Zc(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 ef(e){return[mc,yc,vc,gc].some((function(t){return e[t]>=0}))}var tf=Tc({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=Wl(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach((function(e){e.addEventListener("scroll",n.update,Fc)})),s&&u.addEventListener("resize",n.update,Fc),function(){i&&l.forEach((function(e){e.removeEventListener("scroll",n.update,Fc)})),s&&u.removeEventListener("resize",n.update,Fc)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ic({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:Rc(t.placement),variation:Pc(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,zc(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,zc(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:{}},_c,{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=Oc.reduce((function(e,n){return e[n]=function(e,t,n){var r=Rc(e),o=[gc,mc].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,[gc,yc].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,y=Rc(v),g=u||(y===v||!h?[$c(v)]:function(e){if(Rc(e)===bc)return[];var t=$c(e);return[Uc(e),t,Uc(t)]}(v)),b=[v].concat(g).reduce((function(e,n){return e.concat(Rc(n)===bc?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?Oc:u,c=Pc(r),f=c?s?Ec:Ec.filter((function(e){return Pc(e)===c})):kc,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]=Yc(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[Rc(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,C=b[0],E=0;E<b.length;E++){var O=b[E],S=Rc(O),A=Pc(O)===wc,j=[mc,vc].indexOf(S)>=0,M=j?"width":"height",N=Yc(t,{placement:O,boundary:c,rootBoundary:f,altBoundary:d,padding:l}),T=j?A?yc:gc:A?vc:mc;k[M]>w[M]&&(T=$c(T));var F=$c(T),R=[];if(i&&R.push(N[S]<=0),s&&R.push(N[T]<=0,N[F]<=0),R.every((function(e){return e}))){C=O,D=!1;break}x.set(O,R)}if(D)for(var P=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 C=t,"break"},B=h?3:1;B>0;B--){if("break"===P(B))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,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=Yc(t,{boundary:u,rootBoundary:l,padding:f,altBoundary:c}),y=Rc(t.placement),g=Pc(t.placement),b=!g,k=Bc(y),w="x"===k?"y":"x",x=t.modifiersData.popperOffsets,D=t.rects.reference,C=t.rects.popper,E="function"===typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,O="number"===typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(x){if(i){var j,M="y"===k?mc:gc,N="y"===k?vc:yc,T="y"===k?"height":"width",F=x[k],R=F+v[M],P=F-v[N],B=p?-C[T]/2:0,I=g===wc?D[T]:C[T],L=g===wc?-C[T]:-D[T],z=t.elements.arrow,_=p&&z?uc(z):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=V[M],H=V[N],U=Xc(0,D[T],_[T]),W=b?D[T]/2-B-U-$-O.mainAxis:I-U-$-O.mainAxis,q=b?-D[T]/2+B+U+H+O.mainAxis:L+U+H+O.mainAxis,J=t.elements.arrow&&hc(t.elements.arrow),K=J?"y"===k?J.clientTop||0:J.clientLeft||0:0,Q=null!=(j=null==S?void 0:S[k])?j:0,G=F+q-Q,Y=Xc(p?Gl(R,F+W-Q-K):R,F,p?Ql(P,G):P);x[k]=Y,A[k]=Y-F}if(s){var X,Z="x"===k?mc:gc,ee="x"===k?vc:yc,te=x[w],ne="y"===w?"height":"width",re=te+v[Z],oe=te-v[ee],ie=-1!==[mc,gc].indexOf(y),ae=null!=(X=null==S?void 0:S[w])?X:0,se=ie?re:te-D[ne]-C[ne]-ae+O.altAxis,ue=ie?te+D[ne]+C[ne]-ae-O.altAxis:oe,le=p&&ie?function(e,t,n){var r=Xc(e,t,n);return r>n?n:r}(se,te,ue):Xc(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=Rc(n.placement),u=Bc(s),l=[gc,yc].indexOf(s)>=0?"height":"width";if(i&&a){var c=function(e,t){return Qc("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Gc(e,kc))}(o.padding,n),f=uc(i),d="y"===u?mc:gc,p="y"===u?vc:yc,h=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],m=a[u]-n.rects.reference[u],v=hc(i),y=v?"y"===u?v.clientHeight||0:v.clientWidth||0:0,g=h/2-m/2,b=c[d],k=y-f[l]-c[p],w=y/2-f[l]/2+g,x=Xc(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)))&&Wc(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=Yc(t,{elementContext:"reference"}),s=Yc(t,{altBoundary:!0}),u=Zc(a,r),l=Zc(s,o,i),c=ef(u),f=ef(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})}}]}),nf="tippy-content",rf="tippy-backdrop",of="tippy-arrow",af="tippy-svg-arrow",sf={passive:!0,capture:!0},uf=function(){return document.body};function lf(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function cf(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function ff(e,t){return"function"===typeof e?e.apply(void 0,t):e}function df(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function pf(e){return[].concat(e)}function hf(e,t){-1===e.indexOf(t)&&e.push(t)}function mf(e){return e.split("-")[0]}function vf(e){return[].slice.call(e)}function yf(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function gf(){return document.createElement("div")}function bf(e){return["Element","Fragment"].some((function(t){return cf(e,t)}))}function kf(e){return cf(e,"MouseEvent")}function wf(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function xf(e){return bf(e)?[e]:function(e){return cf(e,"NodeList")}(e)?vf(e):Array.isArray(e)?e:vf(document.querySelectorAll(e))}function Df(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Cf(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Ef(e){var t,n=pf(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function Of(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function Sf(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 Af={isTouch:!1},jf=0;function Mf(){Af.isTouch||(Af.isTouch=!0,window.performance&&document.addEventListener("mousemove",Nf))}function Nf(){var e=performance.now();e-jf<20&&(Af.isTouch=!1,document.removeEventListener("mousemove",Nf)),jf=e}function Tf(){var e=document.activeElement;if(wf(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ff=!!("undefined"!==typeof window&&"undefined"!==typeof document)&&!!window.msCrypto;var Rf={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Pf=Object.assign({appendTo:uf,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},Rf,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Bf=Object.keys(Pf);function If(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=Pf[o])?r:i);return t}),{});return Object.assign({},e,t)}function Lf(e,t){var n=Object.assign({},t,{content:ff(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(If(Object.assign({},Pf,{plugins:t}))):Bf).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(de){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Pf.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 zf(e,t){e.innerHTML=t}function _f(e){var t=gf();return!0===e?t.className=of:(t.className=af,bf(e)?t.appendChild(e):zf(t,e)),t}function Vf(e,t){bf(t.content)?(zf(e,""),e.appendChild(t.content)):"function"!==typeof t.content&&(t.allowHTML?zf(e,t.content):e.textContent=t.content)}function $f(e){var t=e.firstElementChild,n=vf(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(nf)})),arrow:n.find((function(e){return e.classList.contains(of)||e.classList.contains(af)})),backdrop:n.find((function(e){return e.classList.contains(rf)}))}}function Hf(e){var t=gf(),n=gf();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=gf();function o(n,r){var o=$f(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||Vf(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(_f(r.arrow))):i.appendChild(_f(r.arrow)):s&&i.removeChild(s)}return r.className=nf,r.setAttribute("data-state","hidden"),Vf(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Hf.$$tippy=!0;var Uf=1,Wf=[],qf=[];function Jf(e,t){var n,r,o,i,a,s,u,l,c=Lf(e,Object.assign({},Pf,If(yf(t)))),f=!1,d=!1,p=!1,h=!1,m=[],v=df(J,c.interactiveDebounce),y=Uf++,g=(l=c.plugins).filter((function(e,t){return l.indexOf(e)===t})),b={id:y,reference:e,popper:gf(),popperInstance:null,props:c,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;F("onBeforeUpdate",[b,t]),W();var n=b.props,r=Lf(e,Object.assign({},n,yf(t),{ignoreAttributes:!0}));b.props=r,U(),n.interactiveDebounce!==r.interactiveDebounce&&(B(),v=df(J,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?pf(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");P(),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=Af.isTouch&&!b.props.touch,o=lf(b.props.duration,0,Pf.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=M(),a=i.box,u=i.content;Df([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=M(),n=t.box,r=t.content;Df([n,r],o),Cf([n,r],"visible")}R(),P(),hf(qf,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===uf||"parent"===t?n.parentNode:ff(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=lf(b.props.duration,1,Pf.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=M(),i=o.box,a=o.content;b.props.animation&&(Df([i,a],r),Cf([i,a],"hidden"))}R(),P(),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),hf(Wf,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);qf=qf.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=g.map((function(e){return e.fn(b)})),C=e.hasAttribute("aria-expanded");return U(),P(),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 E(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function O(){return"hold"===E()[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?Ef(e):document}function M(){return $f(w)}function N(e){return b.state.isMounted&&!b.state.isVisible||Af.isTouch||i&&"focus"===i.type?0:lf(b.props.delay,e?0:1,Pf.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 R(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=w.id;pf(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 P(){!C&&b.props.aria.expanded&&pf(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),Wf=Wf.filter((function(e){return e!==v}))}function I(t){if(!Af.isTouch||!p&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Sf(w,n)){if(pf(b.props.triggerTarget||e).some((function(e){return Sf(e,n)}))){if(Af.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 L(){p=!0}function z(){p=!1}function _(){var e=j();e.addEventListener("mousedown",I,!0),e.addEventListener("touchend",I,sf),e.addEventListener("touchstart",z,sf),e.addEventListener("touchmove",L,sf)}function V(){var e=j();e.removeEventListener("mousedown",I,!0),e.removeEventListener("touchend",I,sf),e.removeEventListener("touchstart",z,sf),e.removeEventListener("touchmove",L,sf)}function $(e,t){var n=M().box;function r(e){e.target===n&&(Of(n,"remove",r),t())}if(0===e)return t();Of(n,"remove",a),Of(n,"add",r),a=r}function H(t,n,r){void 0===r&&(r=!1),pf(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",K,{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",K);break;case"focus":H(Ff?"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,P(),!b.state.isVisible&&kf(e)&&Wf.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 J(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=mf(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 K(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!!Af.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()?$f(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=M().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=tf(l,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function X(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return vf(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&F("onTrigger",[b,e]),_();var t=N(!0),r=E(),o=r[0],i=r[1];Af.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=N(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):o=requestAnimationFrame((function(){b.hide()}))}}else V()}}function Kf(e,t){void 0===t&&(t={});var n=Pf.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Mf,sf),window.addEventListener("blur",Tf);var r=Object.assign({},t,{plugins:n}),o=xf(e).reduce((function(e,t){var n=t&&Jf(t,r);return n&&e.push(n),e}),[]);return bf(e)?o[0]:o}Kf.defaultProps=Pf,Kf.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Pf[t]=e[t]}))},Kf.currentInput=Af;Object.assign({},_c,{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)}});Kf.setDefaultProps({render:Hf});var Qf=Kf,Gf=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;g(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&&ul(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=Qf(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,B(c.map((function(e){return e.$from.pos})))),d=Math.max.apply(Math,B(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(sl(n=i.selection)&&n instanceof jr){var t=e.nodeDOM(f);if(t)return t.getBoundingClientRect()}var n;return Vl(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}(),Yf=function(e){return new $r({key:"string"===typeof e.pluginKey?new Wr(e.pluginKey):e.pluginKey,view:function(t){return new Gf(i({view:t},e))}})},Xf=(Xu.create({name:"bubbleMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[Yf({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;g(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=Qf(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 Vl(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}()),Zf=function(e){return new $r({key:"string"===typeof e.pluginKey?new Wr(e.pluginKey):e.pluginKey,view:function(t){return new Xf(i({view:t},e))}})},ed=(Xu.create({name:"floatingMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[Zf({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),["editor"]),td=function(e){D(n,e);var t=S(n);function n(){var e;return g(this,n),(e=t.apply(this,arguments)).contentComponent=null,e}return k(n)}(Ll),nd=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)})))},rd=function(e){D(n,e);var t=S(n);function n(e){var r;return g(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,B(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,B(e.options.element.childNodes)),e.setOptions({element:t})}}},{key:"render",value:function(){var e=this.props,t=(e.editor,a(e,ed));return u.a.createElement(u.a.Fragment,null,u.a.createElement("div",i({ref:this.editorContentRef},t)),u.a.createElement(nd,{renderers:this.state.renderers}))}}]),n}(u.a.Component),od=u.a.memo(rd),id=Object(s.createContext)({onDragStart:void 0}),ad=function(){return Object(s.useContext)(id)};u.a.forwardRef((function(e,t){var n=ad().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 sd(){var e=p(Object(s.useState)(0),2)[1];return function(){return e((function(e){return e+1}))}}var ud=Xu.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 $r({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=Ea.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})),Aa.create(n,a)):null}}})]}}),ld=Ul.create({name:"text",group:"inline"});function cd(e){this.j={},this.jr=[],this.jd=null,this.t=e}cd.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=fd();var o=md(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 fd=function(){return new cd},dd=function(e){return new cd(e)},pd=function(e,t,n){e.j[t]||(e.j[t]=n)},hd=function(e,t,n){e.jr.push([t,n])},md=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},vd=function(e,t,n){for(var r=0;r<t.length;r++)pd(e,t[r],n)},yd=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],o=t[n][1];pd(e,r,o)}},gd=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(),pd(e,t[i],o),e=o,i++;pd(e,t[a-1],n)},bd="DOMAIN",kd="LOCALHOST",wd="TLD",xd="NUM",Dd="PROTOCOL",Cd="MAILTO",Ed="WS",Od="NL",Sd="OPENBRACE",Ad="OPENBRACKET",jd="OPENANGLEBRACKET",Md="OPENPAREN",Nd="CLOSEBRACE",Td="CLOSEBRACKET",Fd="CLOSEANGLEBRACKET",Rd="CLOSEPAREN",Pd="AMPERSAND",Bd="APOSTROPHE",Id="ASTERISK",Ld="AT",zd="BACKSLASH",_d="BACKTICK",Vd="CARET",$d="COLON",Hd="COMMA",Ud="DOLLAR",Wd="DOT",qd="EQUALS",Jd="EXCLAMATION",Kd="HYPHEN",Qd="PERCENT",Gd="PIPE",Yd="PLUS",Xd="POUND",Zd="QUERY",ep="QUOTE",tp="SEMI",np="SLASH",rp="TILDE",op="UNDERSCORE",ip="SYM",ap=Object.freeze({__proto__:null,DOMAIN:bd,LOCALHOST:kd,TLD:wd,NUM:xd,PROTOCOL:Dd,MAILTO:Cd,WS:Ed,NL:Od,OPENBRACE:Sd,OPENBRACKET:Ad,OPENANGLEBRACKET:jd,OPENPAREN:Md,CLOSEBRACE:Nd,CLOSEBRACKET:Td,CLOSEANGLEBRACKET:Fd,CLOSEPAREN:Rd,AMPERSAND:Pd,APOSTROPHE:Bd,ASTERISK:Id,AT:Ld,BACKSLASH:zd,BACKTICK:_d,CARET:Vd,COLON:$d,COMMA:Hd,DOLLAR:Ud,DOT:Wd,EQUALS:qd,EXCLAMATION:Jd,HYPHEN:Kd,PERCENT:Qd,PIPE:Gd,PLUS:Yd,POUND:Xd,QUERY:Zd,QUOTE:ep,SEMI:tp,SLASH:np,TILDE:rp,UNDERSCORE:op,SYM:ip}),sp="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(" "),up=/(?:[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])/,lp=/(?:[#\*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])/,cp=/\uFE0F/,fp=/\d/,dp=/\s/;function pp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=fd(),n=dd(xd),r=dd(bd),o=fd(),i=dd(Ed),a=[[fp,r],[up,r],[lp,r],[cp,r]],s=function(){var e=dd(bd);return e.j={"-":o},e.jr=[].concat(a),e},u=function(e){var t=s();return t.t=e,t};yd(t,[["'",dd(Bd)],["{",dd(Sd)],["[",dd(Ad)],["<",dd(jd)],["(",dd(Md)],["}",dd(Nd)],["]",dd(Td)],[">",dd(Fd)],[")",dd(Rd)],["&",dd(Pd)],["*",dd(Id)],["@",dd(Ld)],["`",dd(_d)],["^",dd(Vd)],[":",dd($d)],[",",dd(Hd)],["$",dd(Ud)],[".",dd(Wd)],["=",dd(qd)],["!",dd(Jd)],["-",dd(Kd)],["%",dd(Qd)],["|",dd(Gd)],["+",dd(Yd)],["#",dd(Xd)],["?",dd(Zd)],['"',dd(ep)],["/",dd(np)],[";",dd(tp)],["~",dd(rp)],["_",dd(op)],["\\",dd(zd)]]),pd(t,"\n",dd(Od)),hd(t,dp,i),pd(i,"\n",fd()),hd(i,dp,i);for(var l=0;l<sp.length;l++)gd(t,sp[l],u(wd),s);var c=s(),f=s(),d=s(),p=s();gd(t,"file",c,s),gd(t,"ftp",f,s),gd(t,"http",d,s),gd(t,"mailto",p,s);var h=s(),m=dd(Dd),v=dd(Cd);pd(f,"s",h),pd(f,":",m),pd(d,"s",h),pd(d,":",m),pd(c,":",m),pd(h,":",m),pd(p,":",v);for(var y=s(),g=0;g<e.length;g++)gd(t,e[g],y,s);return pd(y,":",m),gd(t,"localhost",u(kd),s),hd(t,fp,n),hd(t,up,r),hd(t,lp,r),hd(t,cp,r),hd(n,fp,n),hd(n,up,r),hd(n,lp,r),hd(n,cp,r),pd(n,"-",o),pd(r,"-",o),pd(o,"-",o),hd(r,fp,r),hd(r,up,r),hd(r,lp,r),hd(r,cp,r),hd(o,fp,r),hd(o,up,r),hd(o,lp,r),hd(o,cp,r),t.jd=dd(ip),t}function hp(e){return hp="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},hp(e)}var mp={defaultProtocol:"http",events:null,format:yp,formatHref:yp,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function vp(e){e=e||{},this.defaultProtocol="defaultProtocol"in e?e.defaultProtocol:mp.defaultProtocol,this.events="events"in e?e.events:mp.events,this.format="format"in e?e.format:mp.format,this.formatHref="formatHref"in e?e.formatHref:mp.formatHref,this.nl2br="nl2br"in e?e.nl2br:mp.nl2br,this.tagName="tagName"in e?e.tagName:mp.tagName,this.target="target"in e?e.target:mp.target,this.rel="rel"in e?e.rel:mp.rel,this.validate="validate"in e?e.validate:mp.validate,this.truncate="truncate"in e?e.truncate:mp.truncate,this.className="className"in e?e.className:mp.className,this.attributes=e.attributes||mp.attributes,this.ignoreTags=[];for(var t=("ignoreTags"in e?e.ignoreTags:mp.ignoreTags),n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function yp(e){return e}vp.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(hp(o)){case"function":return o(t,n.t);case"object":return"function"===typeof(r=n.t in o?o[n.t]:mp[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 gp(){}function bp(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}(gp,n,t),n}gp.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]:mp.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var kp=bp("email",{isLink:!0}),wp=bp("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),xp=bp("text"),Dp=bp("nl"),Cp=bp("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mp.defaultProtocol,t=this.tk,n=!1,r=!1,o=[],i=0;t[i].t===Dd;)n=!0,o.push(t[i].v),i++;for(;t[i].t===np;)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===Dd}}),Ep=Object.freeze({__proto__:null,MultiToken:gp,Base:gp,createTokenClass:bp,MailtoEmail:kp,Email:wp,Text:xp,Nl:Dp,Url:Cp});function Op(){var e=fd(),t=fd(),n=fd(),r=fd(),o=fd(),i=fd(),a=fd(),s=dd(Cp),u=fd(),l=dd(Cp),c=dd(Cp),f=fd(),d=fd(),p=fd(),h=fd(),m=fd(),v=dd(Cp),y=dd(Cp),g=dd(Cp),b=dd(Cp),k=fd(),w=fd(),x=fd(),D=fd(),C=fd(),E=fd(),O=dd(wp),S=fd(),A=dd(wp),j=dd(kp),M=fd(),N=fd(),T=fd(),F=fd(),R=dd(Dp);pd(e,Od,R),pd(e,Dd,t),pd(e,Cd,n),pd(t,np,r),pd(r,np,o),pd(e,wd,i),pd(e,bd,i),pd(e,kd,s),pd(e,xd,i),pd(o,wd,c),pd(o,bd,c),pd(o,xd,c),pd(o,kd,c),pd(i,Wd,a),pd(C,Wd,E),pd(a,wd,s),pd(a,bd,i),pd(a,xd,i),pd(a,kd,i),pd(E,wd,O),pd(E,bd,C),pd(E,xd,C),pd(E,kd,C),pd(s,Wd,a),pd(O,Wd,E),pd(s,$d,u),pd(s,np,c),pd(u,xd,l),pd(l,np,c),pd(O,$d,S),pd(S,xd,A);var P=[Pd,Id,Ld,zd,_d,Vd,Ud,bd,qd,Kd,kd,xd,Qd,Gd,Yd,Xd,Dd,np,ip,rp,wd,op],B=[Bd,Fd,Nd,Td,Rd,$d,Hd,Wd,Jd,jd,Sd,Ad,Md,Zd,ep,tp];pd(c,Sd,d),pd(c,Ad,p),pd(c,jd,h),pd(c,Md,m),pd(f,Sd,d),pd(f,Ad,p),pd(f,jd,h),pd(f,Md,m),pd(d,Nd,c),pd(p,Td,c),pd(h,Fd,c),pd(m,Rd,c),pd(v,Nd,c),pd(y,Td,c),pd(g,Fd,c),pd(b,Rd,c),pd(k,Nd,c),pd(w,Td,c),pd(x,Fd,c),pd(D,Rd,c),vd(d,P,v),vd(p,P,y),vd(h,P,g),vd(m,P,b),vd(d,B,k),vd(p,B,w),vd(h,B,x),vd(m,B,D),vd(v,P,v),vd(y,P,y),vd(g,P,g),vd(b,P,b),vd(v,B,v),vd(y,B,y),vd(g,B,g),vd(b,B,b),vd(k,P,v),vd(w,P,y),vd(x,P,g),vd(D,P,b),vd(k,B,k),vd(w,B,w),vd(x,B,x),vd(D,B,D),vd(c,P,c),vd(f,P,c),vd(c,B,f),vd(f,B,f),pd(n,wd,j),pd(n,bd,j),pd(n,xd,j),pd(n,kd,j),vd(j,P,j),vd(j,B,M),vd(M,P,j),vd(M,B,M);var I=[Pd,Bd,Id,zd,_d,Vd,Nd,Ud,bd,qd,Kd,xd,Sd,Qd,Gd,Yd,Xd,Zd,np,ip,rp,wd,op];return vd(i,I,N),pd(i,Ld,T),vd(s,I,N),pd(s,Ld,T),vd(a,I,N),vd(N,I,N),pd(N,Ld,T),pd(N,Wd,F),vd(F,I,N),pd(T,wd,C),pd(T,bd,C),pd(T,xd,C),pd(T,kd,O),e}function Sp(e,t,n){var r=n[0].s,o=n[n.length-1].e;return new e(t.substr(r,o-r),n)}var Ap="undefined"!==typeof console&&console&&console.warn||function(){},jp={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function Mp(e){if(jp.initialized&&Ap('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");jp.customProtocols.push(e)}function Np(e){return jp.initialized||function(){jp.scanner={start:pp(jp.customProtocols),tokens:ap},jp.parser={start:Op(),tokens:Ep};for(var e={createTokenClass:bp},t=0;t<jp.pluginQueue.length;t++)jp.pluginQueue[t][1]({scanner:jp.scanner,parser:jp.parser,utils:e});jp.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=md(s,n[o].t));)a.push(n[o++]);for(;o<r&&(l=u||md(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(Sp(xp,t,a)),a=[]),o-=d,c-=d;var h=f.t,m=n.slice(o-c,o);i.push(Sp(h,t,m))}}return a.length>0&&i.push(Sp(xp,t,a)),i}(jp.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=md(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}(jp.scanner.start,e))}function Tp(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Np(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 Fp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Np(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function Rp(e){return new $r({key:new Wr("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 Gs(e);return t.forEach((function(e){e.steps.forEach((function(e){n.step(e)}))})),n}(n.doc,B(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}})}))})),zl(r)}(u);if(c.forEach((function(t){var o=t.oldRange,a=t.newRange;_l(o.from,o.to,n.doc).filter((function(t){return t.mark.type===e.type})).forEach((function(t){var o=_l(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=Fp(a),f=Fp(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){Tp(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 Pp,Bp=Hl.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate:function(){this.options.protocols.forEach(Mp)},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",Ru(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 Tp(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 Ju({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Iu(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(_l(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(Rp({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new $r({key:new Wr("handleClickLink"),props:{handleClick:function(t,n,r){var o,i=Pl(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 $r({key:new Wr("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=Tp(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}}),Ip=Ul.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",Ru(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()}}}}),Lp=Ul.create({name:"doc",topNode:!0,content:"block+"}),zp=/^\s*>\s$/,_p=Ul.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",Ru(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[$l({find:zp,type:this.type})]}}),Vp=Ul.create({name:"hardBreak",addOptions:function(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML:function(){return[{tag:"br"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["br",Ru(this.options.HTMLAttributes,t)]},renderText:function(){return"\n"},addCommands:function(){var e=this;return{setHardBreak:function(){return function(t){var n=t.commands,r=t.chain,o=t.state,i=t.editor;return n.first([function(){return n.exitCode()},function(){return n.command((function(){var t=o.selection,n=o.storedMarks;if(t.$from.parent.type.spec.isolating)return!1;var a=e.options.keepMarks,s=i.extensionManager.splittableMarks,u=n||t.$to.parentOffset&&t.$from.marks();return r().insertContent({type:e.name}).command((function(e){var t=e.tr;if(e.dispatch&&u&&a){var n=u.filter((function(e){return s.includes(e.type.name)}));t.ensureMarks(n)}return!0})).run()}))}])}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return e.editor.commands.setHardBreak()},"Shift-Enter":function(){return e.editor.commands.setHardBreak()}}}});var $p=["title","titleId"];function Hp(){return Hp=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},Hp.apply(this,arguments)}function Up(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 Wp(e,t){var n=e.title,r=e.titleId,o=Up(e,$p);return s.createElement("svg",Hp({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,Pp||(Pp=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 qp,Jp=s.forwardRef(Wp),Kp=(n.p,["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,Kp);return s.createElement("svg",Qp({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,qp||(qp=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 Xp,Zp=s.forwardRef(Yp),eh=(n.p,function(){function e(){g(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=ce(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=ce(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}()),th=new eh,nh=0,rh=function(e){var t,n,r,o,a=Object(s.useContext)(A),u=a.member,l=a.postId,c=a.dispatchAction,f=p(Object(s.useState)(!(!e.isReply&&!e.isEdit)),2),d=f[0],h=f[1],v=Object(s.useRef)(null),g=p(Object(s.useState)("default"),2),b=g[0],k=g[1],w=p(Object(s.useState)(!1),2),x=w[0],D=w[1],C=e.comment,E=e.commentsCount,O=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,S=null!==(r=null===u||void 0===u?void 0:u.expertise)&&void 0!==r?r:null===C||void 0===C||null===(o=C.member)||void 0===o?void 0:o.expertise;Object(s.useEffect)((function(){if(e.isEdit||e.isReply)return c("increaseSecundaryFormCount"),function(){c("decreaseSecundaryFormCount")}}),[c,e.isEdit,e.isReply]);var M=null;"sending"===b?M=Object(j.jsx)(Jp,{className:"h-[24px] w-[24px] fill-white dark:fill-black"}):"sent"===b&&(M=null);var N=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=sd();return Object(s.useEffect)((function(){var t=!0,n=new td(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:[Lp,ld,Ip,Bp.configure({openOnClick:!1}),ud.configure({placeholder:t}),_p.configure({}),Vp.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===E?"Start the conversation":"Join the discussion",autofocus:!1}))),T=function(){for(var e=0,t=v.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=ce(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},F=p(Object(s.useState)((function(){return"form-"+(nh+=1)})),1)[0],R=Object(s.useCallback)((function(){(e.isReply&&null!==N&&void 0!==N&&N.isEmpty||e.isEdit&&(null===N||void 0===N?void 0:N.getHTML())===e.comment.html)&&e.close&&e.close()}),[N,e]);Object(s.useEffect)((function(){return th.addListener(F,"form-focus",R),function(){th.removeListener(F)}}),[R,F]),Object(s.useEffect)((function(){(e.isReply||e.isEdit)&&th.sendEvent("form-focus",{},F)}),[e.isReply,e.isEdit,F]);var P=Object(s.useCallback)((function(){e.isReply||e.isEdit||th.sendEvent("form-focus",{},F),O||e.isEdit?h(!0):(D(!0),N.commands.blur(),c("openPopup",{type:"addDetailsPopup",callback:function(t){t?N.commands.focus():e.close&&e.close(),D(!1)}}))}),[N,c,O,e,F]);Object(s.useEffect)((function(){var t;if(N)return e.isReply&&(t=setTimeout((function(){var e=v.current.offsetHeight,t=T(),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?(N.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)}}),[N,e.isReply,e.isEdit]);var B=Object(s.useCallback)(y(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!N.isEmpty){t.next=2;break}return t.abrupt("return");case 2:if(k("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:N.getHTML()}});case 7:N.chain().clearContent().blur().run(),k("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:N.getHTML()},parent:e.parent});case 20:k("sent"),e.close(),t.next=35;break;case 24:return t.prev=24,t.next=27,c("addComment",{post_id:l,status:"published",html:N.getHTML()});case 27:N.chain().clearContent().blur().run(),h(!1),k("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]])}))),[N,e,c,l]);Object(s.useEffect)((function(){if(N){N.on("focus",(function(){P()})),N.on("blur",(function(){null!==N&&void 0!==N&&N.isEmpty&&h(!1)}));var t=function(t){if(t.metaKey||t.ctrlKey)"Enter"===t.key&&null!==N&&void 0!==N&&N.isFocused&&B();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!==N&&void 0!==N&&N.isFocused||r?void 0:(null===N||void 0===N||N.commands.focus(),void window.scrollTo({top:T(),left:0,behavior:"smooth"}))}null!==N&&void 0!==N&&N.isFocused&&!x&&(e.close?e.close():null===N||void 0===N||N.commands.blur())}};return window.addEventListener("keydown",t,{passive:!0}),function(){window.removeEventListener("keydown",t,{passive:!0}),null===N||void 0===N||N.off("focus"),null===N||void 0===N||N.off("blur")}}}),[N,e,P,x,B]);var I,L=function(e){N.isFocused&&e.preventDefault()},z=function(e){N.isFocused&&e.stopPropagation()},_=function(e,t){var n;e.preventDefault(),D(!0),null===N||void 0===N||N.commands.blur(),c("openPopup",{type:"addDetailsPopup",expertiseAutofocus:null!==(n=t.expertiseAutofocus)&&void 0!==n&&n,callback:function(){null===N||void 0===N||N.commands.focus(),D(!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"===b&&(I=null);var V=ie()&&e.isReply||ie()&&e.isEdit,$=e.isReply||e.isEdit||d||x;return Object(j.jsx)(j.Fragment,{children:Object(j.jsx)("form",{ref:v,"data-testid":"form",onClick:function(e){N.isFocused||N.commands.focus()},onMouseDown:L,onTouchStart:L,className:"-mx-3 -mt-[14px] mb-10 rounded-md px-3 pt-3 pb-2 transition duration-200 ".concat($?"cursor-default":"cursor-pointer"," ").concat(!e.isReply&&!e.isEdit&&"-mt-[4px]"," ").concat((e.isReply||e.isEdit)&&"-mt-[20px]"," ").concat(V&&"pl-1","\n "),children:Object(j.jsxs)("div",{className:"relative w-full",children:[Object(j.jsx)("div",{className:"pr-[1px] font-sans leading-normal dark:text-neutral-300",children:Object(j.jsxs)("div",{className:"relative w-full pl-[52px] transition-[padding] delay-100 duration-150 ".concat(V&&"pl-0"," ").concat($&&"pt-[64px] pl-[1px] sm:pl-[52px]"),children:[Object(j.jsx)("div",{className:"w-full rounded-md border border-none border-slate-50 bg-[rgba(255,255,255,0.9)] px-3 py-4 font-sans text-[16.5px] leading-normal shadow-form transition-all delay-100 duration-150 hover:shadow-formxl focus:outline-0 dark:border-none dark:bg-[rgba(255,255,255,0.08)] dark:text-neutral-300 dark:shadow-transparent ".concat(0===E&&"placeholder:text-neutral-700"," ").concat($?"min-h-[144px] cursor-text pb-[68px] pt-2":"min-h-[48px] cursor-pointer overflow-hidden hover:border-slate-300"," ").concat(e.isEdit&&"cursor-text"," ").concat(!O&&"pointer-events-none","\n "),children:Object(j.jsx)(od,{onMouseDown:z,onTouchStart:z,editor:N})}),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:"ml-2.5 font-sans text-sm font-medium text-neutral-500 outline-0 dark:text-neutral-400",children:"Cancel"}),Object(j.jsxs)("button",{className:"flex w-auto items-center justify-center sm:w-[128px] ".concat(e.isReply&&"sm:w-[100px]"," ").concat(e.isEdit&&"sm:w-[64px]"," h-[39px] rounded-[6px] border bg-neutral-900 py-2 px-3 text-center font-sans text-sm font-semibold text-white outline-0 transition-[opacity] duration-150 dark:bg-[rgba(255,255,255,0.9)] dark:text-neutral-800"),type:"button","data-testid":"submit-form-button",onClick:B,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 h-12 w-full items-center justify-start",children:[Object(j.jsx)("div",{className:"mr-3 grow-0",children:Object(j.jsx)(kt,{comment:C,className:"pointer-events-none"})}),Object(j.jsx)("div",{className:"grow-1 w-full",children:Object(j.jsxs)(pt,{show:$,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:"font-sans text-[17px] font-bold tracking-tight text-[rgb(23,23,23)] dark:text-[rgba(255,255,255,0.85)]",onClick:function(e){_(e,{expertiseAutofocus:!1})},children:O||"Anonymous"}),Object(j.jsx)("div",{className:"flex items-baseline justify-start",children:Object(j.jsxs)("button",{className:"group flex max-w-[80%] items-center justify-start whitespace-nowrap text-left font-sans text-[14px] tracking-tight text-[rgba(0,0,0,0.5)] transition duration-150 hover:text-[rgba(0,0,0,0.75)] dark:text-[rgba(255,255,255,0.5)] dark:hover:text-[rgba(255,255,255,0.4)] sm:max-w-[90%] ".concat(!S&&"text-[rgba(0,0,0,0.3)] hover:text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.3)]"),onClick:function(e){_(e,{expertiseAutofocus:!0})},children:[Object(j.jsx)("span",{className:"... overflow-hidden text-ellipsis",children:S||"Add your expertise"}),S&&Object(j.jsx)(Zp,{className:"ml-1 h-[12px] w-[12px] -translate-x-[6px] stroke-[rgba(0,0,0,0.5)] opacity-0 transition-all duration-100 ease-out group-hover:translate-x-0 group-hover:stroke-[rgba(0,0,0,0.75)] group-hover:opacity-100 dark:stroke-[rgba(255,255,255,0.5)] dark:group-hover:stroke-[rgba(255,255,255,0.3)]"})]})})]})})]})]})})})},oh=["title","titleId"];function ih(){return ih=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},ih.apply(this,arguments)}function ah(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 sh(e,t){var n=e.title,r=e.titleId,o=ah(e,oh);return s.createElement("svg",ih({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,Xp||(Xp=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 uh=s.forwardRef(sh);n.p;var lh,ch=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 duration-50 flex items-center font-sans text-sm outline-0 transition-all ease-linear ".concat(e.comment.liked?"text-[rgba(0,0,0,0.9)] dark:text-[rgba(255,255,255,0.9)]":"text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]"," ").concat(!e.comment.liked&&f&&"hover:text-[rgba(0,0,0,0.75)] hover:dark:text-[rgba(255,255,255,0.25)]"," ").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)(uh,{className:a+" mr-[6px] ".concat(e.comment.liked?"fill-[rgba(0,0,0,0.9)] stroke-[rgba(0,0,0,0.9)] dark:fill-[rgba(255,255,255,0.9)] dark:stroke-[rgba(255,255,255,0.9)]":"stroke-[rgba(0,0,0,0.5)] dark:stroke-[rgba(255,255,255,0.5)]"," ").concat(!e.comment.liked&&f&&"group-hover:stroke-[rgba(0,0,0,0.75)] dark:group-hover:stroke-[rgba(255,255,255,0.25)]"," transition duration-50 ease-linear")}),e.comment.count.likes]})},fh=["title","titleId"];function dh(){return dh=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},dh.apply(this,arguments)}function ph(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 hh(e,t){var n=e.title,r=e.titleId,o=ph(e,fh);return s.createElement("svg",dh({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,lh||(lh=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 mh=s.forwardRef(hh);n.p;var vh,yh,gh,bh=function(e){return Object(s.useContext)(A).member?Object(j.jsxs)("button",{disabled:!!e.disabled,className:"group duration-50 flex items-center font-sans text-sm outline-0 transition-all ease-linear ".concat(e.isReplying?"text-[rgba(0,0,0,0.9)] dark:text-[rgba(255,255,255,0.9)]":"text-[rgba(0,0,0,0.5)] hover:text-[rgba(0,0,0,0.75)] dark:text-[rgba(255,255,255,0.5)] dark:hover:text-[rgba(255,255,255,0.25)]"),onClick:e.toggleReply,"data-testid":"reply-button",children:[Object(j.jsx)(mh,{className:"mr-[6px] ".concat(e.isReplying?"fill-[rgba(0,0,0,0.9)] stroke-[rgba(0,0,0,0.9)] dark:fill-[rgba(255,255,255,0.9)] dark:stroke-[rgba(255,255,255,0.9)]":"stroke-[rgba(0,0,0,0.5)] group-hover:stroke-[rgba(0,0,0,0.75)] dark:stroke-[rgba(255,255,255,0.5)] dark:group-hover:stroke-[rgba(255,255,255,0.25)]"," duration-50 transition ease-linear")}),"Reply"]}):null},kh=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"})]})})},wh=function(e){var t=Object(s.useContext)(A).dispatchAction;return Object(j.jsxs)("div",{className:"flex flex-col",children:[Object(j.jsx)("button",{className:"mb-3 w-full 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"})]})},xh=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:"reportPopup",comment:e.comment}),e.close()},children:[Object(j.jsx)("span",{children:"Report "}),Object(j.jsx)("span",{className:"hidden sm:inline",children:"comment"})]})})},Dh=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)(wh,{comment:i,close:e.close,toggleEdit:e.toggleEdit}):u?Object(j.jsx)(kh,{comment:i,close:e.close}):Object(j.jsx)(xh,{comment:i,close:e.close});else{if(!u)return null;c=Object(j.jsx)(kh,{comment:i,close:e.close})}return Object(j.jsx)("div",{ref:l,onClick:function(e){e.stopPropagation()},children:Object(j.jsx)("div",{className:"absolute z-10 min-w-min whitespace-nowrap rounded bg-white py-3 pl-4 pr-8 font-sans text-sm shadow-lg outline-0 dark:bg-zinc-900 dark:text-white sm:min-w-[150px]",children:c})})},Ch=["title","titleId"];function Eh(){return Eh=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},Eh.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 Sh(e,t){var n=e.title,r=e.titleId,o=Oh(e,Ch);return s.createElement("svg",Eh({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,vh||(vh=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"})),yh||(yh=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"})),gh||(gh=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 Ah=s.forwardRef(Sh),jh=(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)(Ah,{className:"duration-50 gh-comments-icon gh-comments-icon-more fill-[rgba(0,0,0,0.5)] outline-0 transition ease-linear hover:fill-[rgba(0,0,0,0.75)] dark:fill-[rgba(255,255,255,0.5)] dark:hover:fill-[rgba(255,255,255,0.25)]"})}):null,n?Object(j.jsx)(Dh,{comment:u,close:function(){r(!1)},toggleEdit:e.toggleEdit}):null]}):null}),Mh=function(e){var t=e.loadMore,n=e.count;return Object(j.jsx)("div",{className:"flex w-full items-center justify-start",children:Object(j.jsx)("button",{className:"group ml-[48px] mb-10 flex w-auto items-center px-0 pt-0 pb-2 text-left font-sans text-md font-semibold text-neutral-700 dark:text-white sm:mb-12 ",onClick:t,"data-testid":"reply-pagination-button",children:Object(j.jsxs)("span",{className:"flex h-[39px] w-auto items-center justify-center whitespace-nowrap rounded-[6px] bg-[rgb(229,229,229,0.4)] py-2 px-4 text-center font-sans text-sm font-semibold text-neutral-700 outline-0 transition-[opacity,background] duration-150 hover:bg-[rgb(229,229,229,0.7)] dark:bg-[rgba(255,255,255,0.08)] dark:text-neutral-100 dark:hover:bg-[rgba(255,255,255,0.1)]",children:["\u2193 Show ",n," more ",1===n?"reply":"replies"]})})})},Nh=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)(Jh,{comment:e,parent:t,isReply:!0},e.id)})),r>0&&Object(j.jsx)(Mh,{count:r,loadMore:function(){n("loadMoreReplies",{comment:t})}})]})};function Th(e){var t=e.comment,n=e.parent,r=p(Object(s.useState)(!1),2),o=r[0],i=r[1];return o?Object(j.jsx)(_h,{comment:t,close:function(){i(!1)},parent:n}):Object(j.jsx)(Fh,{comment:t,openEditMode:function(){i(!0)},parent:n})}function Fh(e){var t=e.comment,n=e.parent,r=e.openEditMode,o=function(e){return"published"===e.status}(t);return o?Object(j.jsx)(Rh,{comment:t,parent:n,openEditMode:r}):Object(j.jsx)(Ph,{comment:t,openEditMode:r})}function Rh(e){var t=e.comment,n=e.parent,r=e.openEditMode,o=p(Object(s.useState)(!1),2),i=o[0],a=o[1],u=Object(s.useContext)(A).dispatchAction,l=function(){var e=y(m().mark((function e(){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i){e.next=3;break}return e.next=3,u("loadMoreReplies",{comment:t,limit:"all"});case 3:a((function(e){return!e}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=i||t.replies&&t.replies.length>0,f=Object(j.jsx)(kt,{comment:t});return Object(j.jsxs)(qh,{hasReplies:c,avatar:f,children:[Object(j.jsx)($h,{comment:t}),Object(j.jsx)(Hh,{html:t.html}),Object(j.jsx)(Uh,{comment:t,parent:n,isInReplyMode:i,toggleReplyMode:l,openEditMode:r}),Object(j.jsx)(Lh,{comment:t}),Object(j.jsx)(zh,{comment:t,isInReplyMode:i,closeReplyMode:function(){a(!1)}})]})}function Ph(e){var t,n=e.comment,r=e.openEditMode;t=Object(s.useContext)(A).admin&&"hidden"===n.status?"This comment has been hidden.":"This comment has been removed.";var o=Object(j.jsx)(bt,{}),i=n.replies&&n.replies.length>0;return Object(j.jsxs)(qh,{hasReplies:i,avatar:o,children:[Object(j.jsx)("div",{className:"-mt-[3px] mb-2 flex items-start",children:Object(j.jsxs)("div",{className:"flex h-12 flex-row items-center gap-4 pb-[8px] pr-4",children:[Object(j.jsx)("p",{className:"mt-[4px] font-sans text-[16px] italic leading-normal text-neutral-300 dark:text-[rgba(255,255,255,0.5)]",children:t}),Object(j.jsx)("div",{className:"mt-[4px]",children:Object(j.jsx)(jh,{comment:n,toggleEdit:r})})]})}),Object(j.jsx)(Lh,{comment:n})]})}function Bh(e){var t,n=e.comment,r=Object(s.useContext)(A).member,o=r&&n.member&&n.member.uuid===r.uuid?r.expertise:null===n||void 0===n||null===(t=n.member)||void 0===t?void 0:t.expertise;return o?Object(j.jsxs)("span",{children:[o,Object(j.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"})]}):null}function Ih(e){return e.comment.edited_at?Object(j.jsxs)("span",{children:[Object(j.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"}),"Edited"]}):null}function Lh(e){var t=e.comment;return t.replies&&t.replies.length>0?Object(j.jsx)("div",{className:"mt-10 mb-4 sm:mb-0",children:Object(j.jsx)(Nh,{comment:t})}):null}function zh(e){var t=e.comment,n=e.isInReplyMode,r=e.closeReplyMode;return n?Object(j.jsx)("div",{className:"my-10",children:Object(j.jsx)(rh,{parent:t,close:r,isReply:!0})}):null}function _h(e){var t=e.comment,n=e.parent,r=e.close;return Object(j.jsx)(rh,{comment:t,close:r,parent:n,isEdit:!0})}function Vh(e){var t=e.comment,n=t.member?t.member.name?t.member.name:"Anonymous":"Deleted member";return Object(j.jsx)("h4",{className:"text-[rgb(23,23,23] font-sans text-[17px] font-bold tracking-tight dark:text-[rgba(255,255,255,0.85)]",children:n})}function $h(e){var t=e.comment;return Object(j.jsx)("div",{className:"-mt-[3px] mb-2 flex items-start",children:Object(j.jsxs)("div",{children:[Object(j.jsx)(Vh,{comment:t}),Object(j.jsx)("div",{className:"flex items-baseline pr-4 font-sans text-[14px] tracking-tight text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]",children:Object(j.jsxs)("span",{children:[Object(j.jsx)(Bh,{comment:t}),Object(j.jsx)("span",{title:re(t.created_at),children:ne(t.created_at)}),Object(j.jsx)(Ih,{comment:t})]})})]})})}function Hh(e){var t={__html:e.html};return Object(j.jsx)("div",{className:"mt mb-2 flex flex-row items-center gap-4 pr-4",children:Object(j.jsx)("p",{dangerouslySetInnerHTML:t,className:"gh-comment-content font-sans text-[16px] leading-normal text-neutral-900 dark:text-[rgba(255,255,255,0.85)]","data-testid":"comment-content"})})}function Uh(e){var t=e.comment,n=e.toggleReplyMode,r=e.isInReplyMode,o=e.openEditMode,i=e.parent,a=Object(s.useContext)(A),u=a.member,l="paid"===a.commentsEnabled,c=u&&!!u.paid,f=u&&(c||!l)&&!i;return Object(j.jsxs)("div",{className:"flex items-center gap-5",children:[Object(j.jsx)(ch,{comment:t}),f&&Object(j.jsx)(bh,{comment:t,toggleReply:n,isReplying:r}),Object(j.jsx)(jh,{comment:t,toggleEdit:o})]})}function Wh(e){return e.hasReplies?Object(j.jsx)("div",{className:"mb-2 h-full w-[3px] grow rounded bg-gradient-to-b from-[rgba(229,229,229,0.5)] via-[rgba(229,229,229,0.5)] to-transparent dark:from-[rgba(255,255,255,0.05)] dark:via-[rgba(255,255,255,0.05)]"}):null}function qh(e){var t=e.children,n=e.avatar,r=e.hasReplies;return Object(j.jsxs)("div",{className:"flex w-full flex-row ".concat(!0===r?"mb-0":"mb-10"),"data-testid":"comment-component",children:[Object(j.jsxs)("div",{className:"mr-3 flex flex-col items-center justify-start",children:[Object(j.jsx)("div",{className:"flex-0 mb-4",children:n}),Object(j.jsx)(Wh,{hasReplies:r})]}),Object(j.jsx)("div",{className:"grow",children:t})]})}var Jh=function(e){var t=e.comment,n=e.parent;return Object(j.jsx)(pt,{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.jsx)(Th,{comment:t,parent:n})})},Kh=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.jsx)("button",{className:"group mb-10 flex w-full items-center px-0 pt-0 pb-2 text-left font-sans text-md font-semibold text-neutral-700 dark:text-white ",onClick:function(){r("loadMoreComments")},children:Object(j.jsxs)("span",{className:"flex h-[39px] w-full items-center justify-center whitespace-nowrap rounded-[6px] bg-[rgb(229,229,229,0.4)] py-2 px-3 text-center font-sans text-sm font-semibold text-neutral-700 outline-0 transition-[opacity,background] duration-150 hover:bg-[rgb(229,229,229,0.7)] dark:bg-[rgba(255,255,255,0.08)] dark:text-neutral-100 dark:hover:bg-[rgba(255,255,255,0.1)]",children:["\u2191 Show ",o," previous ",1===o?"comment":"comments"]})})};var Qh,Gh,Yh=function(){return Object(j.jsx)("div",{className:"flex h-32 w-full items-center justify-center",children:Object(j.jsx)(Jp,{className:"mb-6 h-12 w-12 fill-[rgb(225,225,225,0.9)] dark:fill-[rgba(255,255,255,0.6)]"})})},Xh="ghost-comments-root",Zh=function(e){var t=e.showCount,n=e.count;return t?1===n?Object(j.jsx)("div",{className:"text-[1.6rem] text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]",children:"1 comment"}):Object(j.jsxs)("div",{className:"text-[1.6rem] text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]",children:[n," comments"]}):null},em=function(e){var t=e.title;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},tm=function(e){var t=e.title,n=e.showCount,r=e.count;return t||n||null===t?Object(j.jsxs)("div",{className:"mb-8 flex w-full items-baseline justify-between font-sans",children:[Object(j.jsx)("h2",{className:"text-[2.8rem] font-bold tracking-tight dark:text-[rgba(255,255,255,0.85)]",children:Object(j.jsx)(em,{title:t})}),Object(j.jsx)(Zh,{count:r,showCount:n})]}):null},nm=function(e){var t=Object(s.useContext)(A),n=t.pagination,r=t.member,o=t.comments,i=t.commentCount,a=t.commentsEnabled,u=t.title,l=t.showCount,c=t.secundaryFormCount,f=o.slice().reverse().map((function(e){return Object(j.jsx)(Jh,{comment:e},e.id)})),d="paid"===a,p=r&&!!r.paid;Object(s.useEffect)((function(){var e=document.getElementById(Xh);e&&"#ghost-comments"===window.location.hash&&0===window.scrollY&&requestAnimationFrame((function(){requestAnimationFrame((function(){e.scrollIntoView()}))}))}),[]);var h=c>0;return Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)(tm,{title:u,showCount:l,count:i}),Object(j.jsx)(Kh,{}),Object(j.jsx)("div",{className:n?"":"mt-4","data-test":"comment-elements",children:f}),Object(j.jsx)("div",{children:h?null:r&&(p||!d)?Object(j.jsx)(rh,{commentsCount:i}):Object(j.jsx)(le,{isFirst:0===(null===n||void 0===n?void 0:n.total),isPaid:d})})]})},rm=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(Xh).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":"content-box",children:e.done?Object(j.jsx)(j.Fragment,{children:Object(j.jsx)(nm,{})}):Object(j.jsx)(Yh,{})})},om=["title","titleId"];function im(){return im=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},im.apply(this,arguments)}function am(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=am(e,om);return s.createElement("svg",im({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,Qh||(Qh=s.createElement("defs",null,s.createElement("style",null,".a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.2px !important;}"))),Gh||(Gh=s.createElement("path",{className:"a",d:"M.75 23.249l22.5-22.5M23.25 23.249L.75.749"})))}var um,lm=s.forwardRef(sm),cm=(n.p,function(e){return Object(j.jsx)("button",{className:"absolute top-6 right-6 opacity-20 transition-opacity duration-100 ease-out hover:opacity-40 sm:top-10 sm:right-8",onClick:e.close,children:Object(j.jsx)(lm,{className:"h-[20px] w-[20px]"})})}),fm=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.expertise)&&void 0!==n?n:""),2),v=h[0],g=h[1],b=50;u.expertise&&(b-=u.expertise.length);var k=p(Object(s.useState)(b),2),w=k[0],x=k[1],D=p(Object(s.useState)({name:"",expertise:""}),2),C=D[0],E=D[1],O=function(t){a("closePopup"),e.callback(t)},S=function(){var e=y(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,expertise:v});case 3:O(!0),e.next=9;break;case 6:E({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(!ie()){var t=setTimeout((function(){var t,n;e.expertiseAutofocus?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.expertiseAutofocus]);return Object(j.jsx)("div",{className:"rounded-none relative h-screen w-screen overflow-hidden bg-white p-[28px] text-center shadow-modal sm:h-auto sm:w-[720px] sm:rounded-xl sm:p-0",onMouseDown:function(e){e.stopPropagation()},children:Object(j.jsxs)("div",{className:"flex",children:[!ie()&&Object(j.jsx)("div",{className:"flex w-[40%] flex-col items-center justify-center bg-[#1C1C1C]",children:Object(j.jsx)("div",{className:"-mt-[1px] flex flex-col gap-9",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)(pt,{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 items-center justify-start gap-3 pr-4",children:[Object(j.jsx)("div",{className:"h-10 w-10 rounded-full border-2 border-white bg-cover bg-no-repeat",style:{backgroundImage:"url(".concat(t.avatar,")")}}),Object(j.jsxs)("div",{className:"flex flex-col items-start justify-center",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(ie()?"w-full":"w-[60%]"," p-0 sm:p-8"),children:[Object(j.jsxs)("h1",{className:"mb-1 text-center font-sans text-[24px] font-bold tracking-tight text-black sm:text-left",children:["Complete your profile",Object(j.jsx)("span",{className:"hidden sm:inline",children:"."})]}),Object(j.jsx)("p",{className:"text-base pr-0 text-center font-sans leading-9 text-neutral-500 sm:pr-10 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:"mb-2 flex flex-row justify-between",children:[Object(j.jsx)("label",{htmlFor:"comments-name",className:"font-sans text-[1.3rem] font-semibold",children:"Name"}),Object(j.jsx)(pt,{show:!!C.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:C.name})})]}),Object(j.jsx)("input",{id:"comments-name",className:"flex h-[42px] w-full items-center rounded border border-neutral-200 px-3 font-sans text-[16px] outline-0 transition-[border-color] duration-200 focus:border-neutral-300 ".concat(C.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:"mt-6 mb-2 flex flex-row justify-between",children:[Object(j.jsx)("label",{htmlFor:"comments-name",className:"font-sans text-[1.3rem] font-semibold",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:"flex h-[42px] w-full items-center rounded border border-neutral-200 px-3 font-sans text-[16px] outline-0 transition-[border-color] duration-200 focus:border-neutral-300 ".concat(0===w&&"border-red-500 focus:border-red-500"),type:"text",name:"expertise",ref:o,value:v,placeholder:"Head of Marketing at Acme, Inc",onChange:function(e){var t=e.target.value;x(50-t.length),g(t)},onKeyDown:function(e){"Enter"===e.key&&(g(e.target.value),S())},maxLength:50}),Object(j.jsx)("button",{className:"mt-10 flex h-[42px] w-full items-center justify-center rounded-md px-8 font-sans text-[15px] font-semibold text-white opacity-100 transition-opacity duration-200 ease-linear hover:opacity-90",style:{backgroundColor:null!==l&&void 0!==l?l:"#000000"},onClick:S,children:"Save"})]})]}),Object(j.jsx)(cm,{close:function(){return O(!1)}})]})})},dm=["title","titleId"];function pm(){return pm=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},pm.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 mm(e,t){var n=e.title,r=e.titleId,o=hm(e,dm);return s.createElement("svg",pm({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,um||(um=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 vm=s.forwardRef(mm),ym=(n.p,{addDetailsPopup:fm,reportPopup: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)(Jp,{className:"mr-2 h-[24px] w-[24px] fill-white"}):"sent"===o&&(l=Object(j.jsx)(vm,{className:"mr-2 h-[16px] w-[16px]"}));var c=function(e){n("closePopup")};return Object(j.jsxs)("div",{className:"rounded-none relative h-screen w-screen bg-white p-[28px] text-center shadow-modal sm:h-auto sm:w-[500px] sm:rounded-xl sm:p-8 sm:text-left",onMouseDown:function(e){e.stopPropagation()},children:[Object(j.jsxs)("h1",{className:"mb-1 font-sans text-[24px] font-bold tracking-tight text-black",children:["You want to report",Object(j.jsx)("span",{className:"hidden sm:inline",children:" this comment"}),"?"]}),Object(j.jsx)("p",{className:"text-base px-4 font-sans leading-9 text-neutral-500 sm:pr-4 sm:pl-0",children:"Your request will be sent to the owner of this site."}),Object(j.jsxs)("div",{className:"mt-10 flex flex-col items-center justify-start gap-4 sm:flex-row",children:[Object(j.jsxs)("button",{className:"flex h-[44px] w-full items-center justify-center rounded-md px-4 font-sans text-[15px] font-semibold text-white transition duration-200 ease-linear sm:w-[200px] ".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)(cm,{close:function(){return c()}})]})}}),gm=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)(pt,{show:e.show,appear:!0,children:Object(j.jsx)(P,{children:Object(j.jsx)("div",{children:Object(j.jsx)(pt.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:"to-rgba(0,0,0,0.1) fixed top-0 left-0 flex h-screen w-screen justify-center overflow-hidden bg-gradient-to-b from-[rgba(0,0,0,0.2)] pt-0 backdrop-blur-[2px] sm:pt-12",onMouseDown:n,children:Object(j.jsx)(pt.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})})})})})})},bm=["type"];function km(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,bm),f=ym[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)(gm,{show:d,callback:c.callback,children:Object(j.jsx)(f,i({},c))})})}function wm(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 xm(e){e.dsn;var t=e.children;return Object(j.jsx)(j.Fragment,{children:t})}var Dm=function(e){D(n,e);var t=S(n);function n(e){var r;return g(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,secundaryFormCount:0},r.adminApi=null,r.GhostApi=null,r.dispatchAction=r.dispatchAction.bind(w(r)),r}return k(n,[{key:"initSetup",value:function(){var e=y(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=y(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=y(m().mark((function e(t,n){var r,o,i=this;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Y(t)){e.next=3;break}return this.setState((function(e){return ee({action:t,data:n,state:e,api:i.GhostApi,adminApi:i.adminApi})})),e.abrupt("return");case 3:return clearTimeout(this.timeoutId),this.setState({action:"".concat(t,":running")}),e.prev=5,e.next=8,X({action:t,data:n,state:this.state,api:this.GhostApi,adminApi:this.adminApi});case 8:r=e.sent,this.setState(r),r&&r.action&&!r.action.includes(":failed")&&(this.timeoutId=setTimeout((function(){i.setState({action:""})}),2e3)),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(5),console.error(e.t0),o=te({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 18:case"end":return e.stop()}}),e,this,[[5,13]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fetchApiData",value:function(){var e=y(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||ue({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),!se(["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=y(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 y(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 y(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 y(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.state,t=e.action,n=e.popupNotification,r=e.customSiteUrl,o=e.member,i=e.comments,a=e.pagination,s=e.commentCount,u=e.postId,l=e.admin,c=e.popup,f=e.secundaryFormCount;return{action:t,popupNotification:n,customSiteUrl:r,member:o,admin:l,comments:i,pagination:a,commentCount:s,postId:u,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,secundaryFormCount:f,popup:c,dispatchAction:this.dispatchAction}}},{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)(xm,{dsn:this.props.sentryDsn,children:Object(j.jsxs)(A.Provider,{value:this.getContextFromState(),children:[Object(j.jsx)(R,{children:Object(j.jsx)(rm,{done:e})}),Object(j.jsx)(wm,{adminUrl:this.props.adminUrl,onLoad:this.initAdminAuth.bind(this)}),Object(j.jsx)(km,{})]})})}}]),n}(u.a.Component),Cm=["siteUrl"];function Em(e){e.siteUrl;!function(){var e=document.querySelector("script[data-ghost-comments]");if(e){var t=document.createElement("div");t.id=Xh,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,Cm),r=t||window.location.origin;Em({siteUrl:r}),c.a.render(Object(j.jsx)(u.a.StrictMode,{children:Object(j.jsx)(Dm,i({siteUrl:r,customSiteUrl:t},n))}),document.getElementById(Xh))}()}]);
|
|
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 C(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var E=/\/+/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(E,"$&/")+"/"),S(a,t,n,"",(function(e){return e}))):null!=a&&(C(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(E,"$&/")+"/")+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 M={current:null};function N(){var e=M.current;if(null===e)throw Error(p(321));return e}var T={ReactCurrentDispatcher:M,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(!C(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=C,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 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(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,C=60107,E=60108,O=60114,S=60109,A=60110,j=60112,M=60113,N=60120,T=60115,F=60116,P=60121,R=60128,B=60129,I=60130,L=60131;if("function"===typeof Symbol&&Symbol.for){var z=Symbol.for;x=z("react.element"),D=z("react.portal"),C=z("react.fragment"),E=z("react.strict_mode"),O=z("react.profiler"),S=z("react.provider"),A=z("react.context"),j=z("react.forward_ref"),M=z("react.suspense"),N=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"),I=z("react.offscreen"),L=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 J(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 C:return"Fragment";case D:return"Portal";case O:return"Profiler";case E:return"StrictMode";case M:return"Suspense";case N: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 J(e.type);case P:return J(e._render);case F:t=e._payload,e=e._init;try{return J(e(t))}catch(n){}}return null}function K(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=K(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=K(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,K(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=""+K(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:K(n)}}function le(e,t){var n=K(t.value),r=K(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 Ce(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 Ee(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 Me(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 Ne(e){Ae?je?je.push(e):je=[e]:Ae=e}function Te(){if(Ae){var e=Ae,t=je;if(je=Ae=null,Me(e),t)for(e=0;e<t.length;e++)Me(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,Ie=!1,Le=!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,Je=null,Ke={onError:function(e){Ue=!0,We=e}};function Qe(e,t,n,r,o,i,a,s,u){Ue=!1,We=null,He.apply(Ke,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 Ct={animationend:Dt("Animation","AnimationEnd"),animationiteration:Dt("Animation","AnimationIteration"),animationstart:Dt("Animation","AnimationStart"),transitionend:Dt("Transition","TransitionEnd")},Et={},Ot={};function St(e){if(Et[e])return Et[e];if(!Ct[e])return e;var t,n=Ct[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ot)return Et[e]=n[t];return e}f&&(Ot=document.createElement("div").style,"AnimationEvent"in window||(delete Ct.animationend.animation,delete Ct.animationiteration.animation,delete Ct.animationstart.animation),"TransitionEvent"in window||delete Ct.transitionend.transition);var At=St("animationend"),jt=St("animationiteration"),Mt=St("animationstart"),Nt=St("transitionend"),Tt=new Map,Ft=new Map,Pt=["abort","abort",At,"animationEnd",jt,"animationIteration",Mt,"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)),Ft.set(r,t),Tt.set(r,o),l(o,[r])}}(0,i.unstable_now)();var Bt=8;function It(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 Lt(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=It(u),o=Bt):0!==(s&=i)&&(r=It(s),o=Bt)}else 0!==(i=n&~a)?(r=It(i),o=Bt):0!==s&&(r=It(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(It(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 Jt=i.unstable_UserBlockingPriority,Kt=i.unstable_runWithPriority,Qt=!0;function Gt(e,t,n,r){Ie||Re();var o=Xt,i=Ie;Ie=!0;try{Pe(o,e,t,n,r)}finally{(Ie=i)||ze()}}function Yt(e,t,n,r){Kt(Jt,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})),Cn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},En={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=Cn[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?En[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}}),Mn=un(jn),Nn=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],In=f&&"CompositionEvent"in window,Ln=null;f&&"documentMode"in document&&(Ln=document.documentMode);var zn=f&&"TextEvent"in window&&!Ln,_n=f&&(!In||Ln&&8<Ln&&11>=Ln),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 Jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!qn[e.type]:"textarea"===t}function Kn(e,t,n,r){Ne(r),0<(t=Ir(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(Kn(t,Gn,e,Oe(e)),e=Yn,Ie)e(t);else{Ie=!0;try{Fe(e,t)}finally{Ie=!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=Ir(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 Cr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Er=0;Er<Cr.length;Er++)Ft.set(Cr[Er],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,Je=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=Je,qe=!1,Je=null,e}function Mr(e,t){var n=ao(t),r=e+"__bubble";n.has(r)||(Pr(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){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(Le)return e(t,n);Le=!0;try{Be(e,t,n)}finally{Le=!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=Mn;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 Mt:u=kn;break;case Nt: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=Nn}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=Nn,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=Lr(p))h++;for(p=0,m=d;m;m=Lr(m))p++;for(;0<h-p;)c=Lr(c),h--;for(;0<p-h;)d=Lr(d),p--;for(;h--;){if(c===d||null!==d&&c===d.alternate)break e;c=Lr(c),d=Lr(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(Jn(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))?Kn(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":(Jn(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(In)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=Ir(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||!In&&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=Ir(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 Ir(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 Lr(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 Jr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Kr(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,J(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 Co=null,Eo=null,Oo=i.unstable_runWithPriority,So=i.unstable_scheduleCallback,Ao=i.unstable_cancelCallback,jo=i.unstable_shouldYield,Mo=i.unstable_requestPaint,No=i.unstable_now,To=i.unstable_getCurrentPriorityLevel,Fo=i.unstable_ImmediatePriority,Po=i.unstable_UserBlockingPriority,Ro=i.unstable_NormalPriority,Bo=i.unstable_LowPriority,Io=i.unstable_IdlePriority,Lo={},zo=void 0!==Mo?Mo:function(){},_o=null,Vo=null,$o=!1,Ho=No(),Uo=1e4>Ho?No:function(){return No()-Ho};function Wo(){switch(To()){case Fo:return 99;case Po:return 98;case Ro:return 97;case Bo:return 96;case Io: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 Io;default:throw Error(a(332))}}function Jo(e,t){return e=qo(e),Oo(e,t)}function Ko(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;Jo(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)&&(Ia=!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 Ci(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 Ei(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=Ci(e,t,n),r.return=e,r):((r=Ju(n.type,n.key,n.props,null,e.mode,r)).ref=Ci(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=Ku(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=Ju(t.type,t.key,t.props,null,e.mode,n)).ref=Ci(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=Ku(t,e.mode,n,null)).return=e,t;Ei(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===C?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);Ei(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===C?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);Ei(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===C&&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===C){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=Ci(e,l,i),r.return=e,e=r;break e}n(e,l);break}t(e,l),l=l.sibling}i.type===C?((r=Ku(i.props.children,e.mode,u,i.key)).return=e,e=r):((u=Ju(i.type,i.key,i.props,null,e.mode,u)).ref=Ci(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&&Ei(e,i),"undefined"===typeof i&&!l)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,J(e.type)||"Component"))}return n(e,r)}}var Si=Oi(!0),Ai=Oi(!1),ji={},Mi=lo(ji),Ni=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(Ni,e),fo(Mi,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(Mi),fo(Mi,t)}function Ri(){co(Mi),co(Ni),co(Ti)}function Bi(e){Fi(Ti.current);var t=Fi(Mi.current),n=he(t,e.type);t!==n&&(fo(Ni,e),fo(Mi,n))}function Ii(e){Ni.current===e&&(co(Mi),co(Ni))}var Li=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=Kr(n.nextSibling))||!Ui(e,t))return e.flags=-1025&e.flags|2,$i=!1,void(_i=e);Hi(_i,n)}_i=e,Vi=Kr(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 Ji(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=Kr(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=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Vi=null}}else Vi=_i?Kr(e.stateNode.nextSibling):null;return!0}function Ki(){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)||(Ia=!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)||(Ia=!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=Na.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=Na.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 Ca(e,t){return wa(4,2,e,t)}function Ea(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,Ea.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 Ma(e,t){var n=Wo();Jo(98>n?98:n,(function(){e(!0)})),Jo(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,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,Ea.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: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=Ma.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:Ca,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:Ca,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,Ia=!1;function La(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||Ia?(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 _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=Ju(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(Ia=!1,0===(i&o))return t.lanes=e.lanes,is(e,t,i);0!==(16384&e.flags)&&(Ia=!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 La(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||Ia?(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 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)):La(e,t,s,i),t.memoizedState=r.state,o&&Do(t,n,!0),t.child}function Ja(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 Ka,Qa,Ga,Ya={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&&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=Ku(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=Ku(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===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||(Ji(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Ii(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(Mi.current),Ji(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xr]=t,r[Zr]=s,n){case"dialog":Mr("cancel",r),Mr("close",r);break;case"iframe":case"object":case"embed":Mr("load",r);break;case"video":case"audio":for(e=0;e<Or.length;e++)Mr(Or[e],r);break;case"source":Mr("error",r);break;case"img":case"image":case"link":Mr("error",r),Mr("load",r);break;case"details":Mr("toggle",r);break;case"input":ee(r,s),Mr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Mr("invalid",r);break;case"textarea":ue(r,s),Mr("invalid",r)}for(var l in Ce(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&&Mr("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,Ka(e,t),t.stateNode=e,l=Ee(n,r),n){case"dialog":Mr("cancel",e),Mr("close",e),i=r;break;case"iframe":case"object":case"embed":Mr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Or.length;i++)Mr(Or[i],e);i=r;break;case"source":Mr("error",e),i=r;break;case"img":case"image":case"link":Mr("error",e),Mr("load",e),i=r;break;case"details":Mr("toggle",e),i=r;break;case"input":ee(e,r),i=Z(e,r),Mr("invalid",e);break;case"option":i=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=o({},r,{value:void 0}),Mr("invalid",e);break;case"textarea":ue(e,r),i=se(e,r),Mr("invalid",e);break;default:i=r}Ce(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&&Mr("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",""+K(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(Mi.current),Ji(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(Li),r=t.memoizedState,0!==(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Ji(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===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(Li),null===(r=t.memoizedState))return null;if(s=0!==(64&t.flags),null===(l=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!==(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(Li,1&Li.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=Li.current,fo(Li,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 Ii(e),null;case 13:return co(Li),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return co(Li),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}))}}Ka=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(Mi.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 Ce(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&&Mr("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&&Jr(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)&&(Iu(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(Eo&&"function"===typeof Eo.onCommitFiberUnmount)try{Eo.onCommitFiberUnmount(Co,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))Iu(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:Es(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):Cs(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 Cs(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(Cs(e,t,n),e=e.sibling;null!==e;)Cs(e,t,n),e=e.sibling}function Es(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),Ee(e,o),t=Ee(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,Ms=w.ReactCurrentDispatcher,Ns=w.ReactCurrentOwner,Ts=0,Fs=null,Ps=null,Rs=0,Bs=0,Is=lo(0),Ls=0,zs=null,_s=0,Vs=0,$s=0,Hs=0,Us=null,Ws=0,qs=1/0;function Js(){qs=Uo()+500}var Ks,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===Ls&&yu(e,Rs));var r=Wo();1===t?0!==(8&Ts)&&0===(48&Ts)?bu(e):(vu(e,n),0===Ts&&(Js(),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,It(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=Lt(e,e===Fs?Rs:0),t=Bt,0===r)null!==n&&(n!==Lo&&Ao(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Lo&&Ao(n)}15===t?(n=bu.bind(null,e),null===_o?(_o=[n],Vo=So(Fo,Go)):_o.push(n),n=Lo):14===t?n=Ko(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=Ko(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=Lt(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||(Js(),Cu(e,r));;)try{ju();break}catch(u){Eu(e,u)}if(ri(),Ms.current=i,Ts=o,null!==Ps?r=0:(Fs=null,Rs=0,r=Ls),0!==(_s&$s))Cu(e,0);else if(0!==r){if(2===r&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Jr(e.containerInfo)),0!==(n=zt(e))&&(r=Su(e,n))),1===r)throw t=zs,Cu(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!==Lt(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=Lt(e,t)))}else n=Su(e,t=Lt(e,0));if(0!==e.tag&&2===n&&(Ts|=64,e.hydrate&&(e.hydrate=!1,Jr(e.containerInfo)),0!==(t=zt(e))&&(n=Su(e,t))),1===n)throw n=zs,Cu(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)&&(Js(),Qo())}}function wu(e,t){var n=Ts;Ts&=-2,Ts|=8;try{return e(t)}finally{0===(Ts=n)&&(Js(),Qo())}}function xu(e,t){fo(Is,Bs),Bs|=t,_s|=t}function Du(){Bs=Is.current,co(Is)}function Cu(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:Ii(r);break;case 4:Ri();break;case 13:case 19:co(Li);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,Ls=0,zs=null,Hs=$s=Vs=0}function Eu(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,Ns.current=null,null===n||null===n.return){Ls=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&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 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((J(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=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)}Nu(n)}catch(D){t=D,Ps===n&&null!==n&&(Ps=n=n.return);continue}break}}function Ou(){var e=Ms.current;return Ms.current=Ta,null===e?Ta:e}function Su(e,t){var n=Ts;Ts|=16;var r=Ou();for(Fs===e&&Rs===t||Cu(e,t);;)try{Au();break}catch(o){Eu(e,o)}if(ri(),Ts=n,Ms.current=r,null!==Ps)throw Error(a(261));return Fs=null,Rs=0,Ls}function Au(){for(;null!==Ps;)Mu(Ps)}function ju(){for(;null!==Ps&&!jo();)Mu(Ps)}function Mu(e){var t=Ks(e.alternate,e,Bs);e.memoizedProps=e.pendingProps,null===t?Nu(e):Ps=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,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===Ls&&(Ls=5)}function Tu(e){var t=Wo();return Jo(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,Ns.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:Es(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 C=Qs.ref;if(null!==C){var E=Qs.stateNode;Qs.tag,k=E,"function"===typeof C?C(k):C.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,Eo&&"function"===typeof Eo.onCommitFiberRoot)try{Eo.onCommitFiberRoot(Co,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,Ko(97,(function(){return Ru(),null}))),Qs=Qs.nextEffect}}function Ru(){if(90!==tu){var e=97<tu?97:tu;return tu=90,Jo(e,Lu)}return!1}function Bu(e,t){nu.push(t,e),Zs||(Zs=!0,Ko(97,(function(){return Ru(),null})))}function Iu(e,t){ru.push(t,e),Zs||(Zs=!0,Ko(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(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===Ls||3===Ls&&(62914560&Rs)===Rs&&500>Uo()-Ws?Cu(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 Ju(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 C:return Ku(n.children,o,i,t);case B:s=8,o|=16;break;case E: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 M:return(e=Uu(13,n,t,o)).type=M,e.elementType=M,e.lanes=i,e;case N:return(e=Uu(19,n,t,o)).elementType=N,e.lanes=i,e;case I:return Qu(n,o,i,t);case L:return(e=Uu(24,n,t,o)).elementType=L,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 Ku(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=I,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)}Ks=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||mo.current)Ia=!0;else{if(0===(n&r)){switch(Ia=!1,t.tag){case 3:Ja(t),Ki();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(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,$a(e,t,n)}return is(e,t,n)}Ia=0!==(16384&e.flags)}else Ia=!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,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 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(Ja(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)Ki(),t=is(e,t,n);else{if((i=(o=t.stateNode).hydrate)&&(Vi=Kr(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 La(e,t,r,n),Ki();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),La(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):La(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 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=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}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),_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 Jo(98,e.bind(null,t,n,r,o))}finally{0===(Ts=i)&&(Js(),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)&&(Js(),Qo())}};var ul={Events:[ro,oo,io,Ne,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{Co=fl.inject(cl),Eo=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 Jo(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 C(e){return void 0===(e=e[0])?null:e}function E(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,M=null,N=3,T=!1,F=!1,P=!1;function R(e){for(var t=C(A);null!==t;){if(null===t.callback)E(A);else{if(!(t.startTime<=e))break;E(A),t.sortIndex=t.expirationTime,D(S,t)}t=C(A)}}function B(e){if(P=!1,R(e),!F)if(null!==C(S))F=!0,r(I);else{var t=C(A);null!==t&&o(B,t.startTime-e)}}function I(e,n){F=!1,P&&(P=!1,i()),T=!0;var r=N;try{for(R(n),M=C(S);null!==M&&(!(M.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=M.callback;if("function"===typeof a){M.callback=null,N=M.priorityLevel;var s=a(M.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?M.callback=s:M===C(S)&&E(S),R(n)}else E(S);M=C(S)}if(null!==M)var u=!0;else{var l=C(A);null!==l&&o(B,l.startTime-n),u=!1}return u}finally{M=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(){F||T||(F=!0,r(I))},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_getFirstCallbackNode=function(){return C(S)},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:j++,callback:n,priorityLevel:e,startTime:a,expirationTime:u=a+u,sortIndex:-1},a>s?(e.sortIndex=a,D(A,e),null===C(S)&&e===C(A)&&(P?i():P=!0,o(B,a-s))):(e.sortIndex=u,D(S,e),F||T||(F=!0,r(I))),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(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 E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(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,E.prototype={constructor:E,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(C),!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),C(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;C(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){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function D(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&&x(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(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(Rd){return!1}}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 w(e)}function S(e){var t=E();return function(){var n,r=C(e);if(t){var o=C(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return O(this,n)}}var A=n(1).createContext({}),j=n(0),M=["children","head","title","style","onResize"],N=function(e){D(n,e);var t=S(n);function n(){var e;return y(this,n),(e=t.call(this)).handleLoad=function(){e.setupFrameBaseStyle()},e.setNode=e.setNode.bind(w(e)),e.node=null,e}return k(n,[{key:"componentDidMount",value:function(){this.node.addEventListener("load",this.handleLoad)}},{key:"componentWillUnmount",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:"setNode",value:function(e){this.node=e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.head,r=e.title,o=void 0===r?"":r,s=e.style,u=void 0===s?{}:s,c=(e.onResize,a(e,M));return Object(j.jsxs)("iframe",i(i({srcDoc:"<!DOCTYPE html>"},c),{},{ref:this.setNode,title:o,style:u,frameBorder:"0",children:[this.iframeHead&&Object(l.createPortal)(n,this.iframeHead),this.iframeRoot&&Object(l.createPortal)(t,this.iframeRoot)]}))}}]),n}(s.Component),T=function(e){var t=e.children,n=e.onResize,r=e.style,o=e.title,i=Object(s.useContext)(A).stylesUrl,a=p(Object(s.useState)(!i),2),u=a[0],l=a[1],c=Object(j.jsxs)(j.Fragment,{children:[i?Object(j.jsx)("link",{rel:"stylesheet",href:i,onLoad:function(){l(!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"})]});return Object(j.jsx)(N,{head:c,style:r,onResize:n,title:o,children:u&&t})},F=function(e){var t=e.children,n=e.style,r=e.title,o=p(Object(s.useState)(n),2),a=o[0],u=o[1],l=Object(s.useCallback)((function(e){u((function(t){return i(i({},t),{},{height:"".concat(e.scrollHeight,"px")})}))}),[]);return Object(j.jsx)(T,{style:a,onResize:l,title:r,children:t})},P=function(e){var t=e.children;return Object(j.jsx)(F,{style:{width:"100%",height:"400px"},title:"comments-frame",children:t})},R=function(e){var t=e.children,n=e.title;return Object(j.jsx)(T,{style:{zIndex:"3999999",position:"fixed",left:"0",top:"0",width:"100%",height:"100%",overflow:"hidden"},title:n,children:t})};function B(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 I(){return(I=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(B(n.comments),B(i.comments)),pagination:i.meta.pagination});case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function L(){return(L=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(B(s.replies),B(l.comments))}):e}))});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return(z=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(B(n.comments)),commentCount:n.commentCount+1});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(){return(_=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(B(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 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.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 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.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 U(){return(U=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 W(){return(W=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 q(){return(q=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 J(){return(J=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 K(){return(K=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.expertise,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.expertise,void 0!==u&&f!==u&&(l.expertise=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 Q={openPopup:function(e){return{popup:e.data}},closePopup:function(){return{popup:null}},increaseSecundaryFormCount:function(e){return{secundaryFormCount:e.state.secundaryFormCount+1}},decreaseSecundaryFormCount:function(e){return{secundaryFormCount:e.state.secundaryFormCount-1}}},G={addComment:function(e){return z.apply(this,arguments)},editComment:function(e){return J.apply(this,arguments)},hideComment:function(e){return V.apply(this,arguments)},deleteComment:function(e){return q.apply(this,arguments)},showComment:function(e){return $.apply(this,arguments)},likeComment:function(e){return H.apply(this,arguments)},unlikeComment:function(e){return W.apply(this,arguments)},reportComment:function(e){return U.apply(this,arguments)},addReply:function(e){return _.apply(this,arguments)},loadMoreComments:function(e){return I.apply(this,arguments)},loadMoreReplies:function(e){return L.apply(this,arguments)},updateMember:function(e){return K.apply(this,arguments)}};function Y(e){return!!Q[e]}function X(e){return Z.apply(this,arguments)}function Z(){return(Z=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=G[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)}function ee(e){var t=e.action,n=e.data,r=e.state,o=e.api,i=e.adminApi,a=Q[t];return a&&a({data:n,state:r,api:o,adminApi:i})||{}}function te(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}}}}var ne=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 re(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 oe(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 ie(){return Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)<480}var ae=function(e){var t=e.offsetHeight,n=function(e){for(var t=0,n=e.ownerDocument.defaultView;n!==window;)for(var r=n.parent,o=0;o<r.frames.length;o++)if(r.frames[o]===n){var i,a=te(r.document.getElementsByTagName("iframe"));try{for(a.s();!(i=a.n()).done;){var s=i.value;s.contentWindow===n&&(t+=s.getBoundingClientRect().top+n.pageYOffset)}}catch(u){a.e(u)}finally{a.f()}n=r;break}return e.getBoundingClientRect().top+window.pageYOffset+t}(e),r=n+t,o=window.innerHeight,i=window.scrollY;if(n-64<i||r+64>i+o){var a=(n+r)/2;window.scrollTo({top:a-o/2,left:0,behavior:"smooth"})}},se={dev:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.customSiteUrl;return!1},test:function(){return!1}},ue=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=se[e];return!(!n||!n(t))}))};var le=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,expertise:e.expertise};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},ce="ghost-comments-root",fe=function(e){var t=e.isFirst,n=e.isPaid,r=Object(s.useContext)(A),o=r.accentColor,i=r.publication,a=r.member,u={backgroundColor:o},l={color:o},c=t?"Start the conversation":"Join the discussion";return Object(j.jsxs)("section",{className:"flex flex-col items-center pt-[40px] ".concat(a?"pb-[32px]":"pb-[48px]"," ").concat(!t&&"mt-4"," border-y-2 border-[rgba(0,0,0,0.075)] dark:border-[rgba(255,255,255,0.1)] sm:px-8"),children:[Object(j.jsx)("h1",{className:"mb-[8px] text-center font-sans text-[24px] tracking-tight text-black dark:text-[rgba(255,255,255,0.85)] ".concat(t?"font-semibold":"font-bold"),children:c}),Object(j.jsxs)("p",{className:"sm:max-w-screen-sm mb-[28px] w-full px-0 text-center font-sans text-[16px] leading-normal text-neutral-600 dark:text-[rgba(255,255,255,0.85)] sm:px-8",children:["Become a ",n&&"paid"," member of ",Object(j.jsx)("span",{className:"font-semibold",children:i})," to start commenting."]}),Object(j.jsx)("button",{onClick:function(){window.location.href=n&&a?"#/portal/account/plans":"#/portal/signup"},className:"font-san mb-[12px] inline-block rounded py-[14px] px-5 font-medium leading-none text-white transition-all hover:opacity-90",style:u,children:n&&a?"Upgrade now":"Sign up now"}),!a&&Object(j.jsxs)("p",{className:"text-center font-sans text-sm text-[rgba(0,0,0,0.4)] dark:text-[rgba(255,255,255,0.5)]",children:[Object(j.jsx)("span",{className:"mr-1 inline-block text-[15px]",children:"Already a member?"}),Object(j.jsx)("button",{onClick:function(){window.location.href="#/portal/signin"},className:"rounded-md text-sm font-semibold transition-all hover:opacity-90",style:l,children:"Sign in"})]})]})};function de(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=C(e)););return e}function pe(){return pe="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=de(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},pe.apply(this,arguments)}function he(e,t,n){return he=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&&x(o,n.prototype),o},he.apply(null,arguments)}function me(e){var t="function"===typeof Map?new Map:void 0;return me=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 he(e,arguments,C(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),x(r,e)},me(e)}function ve(e){this.content=e}ve.prototype={constructor:ve,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 ve(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 ve(n)},addToStart:function(e,t){return new ve([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new ve(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 ve(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=ve.from(e)).size?new ve(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=ve.from(e)).size?new ve(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=ve.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}},ve.from=function(e){if(e instanceof ve)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ve(t)};var ge=ve;function ye(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=ye(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function be(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=be(a.content,s.content,n-1,r-1);if(f)return f}n-=u,r-=u}else n-=u,r-=u}}var ke=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 ye(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 be(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 xe(0,e);if(e==this.size)return xe(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?xe(n+1,i):xe(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}();ke.empty=new ke([],0);var we={index:0,offset:0};function xe(e,t){return we.index=e,we.offset=t,we}function De(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(!De(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t)||!De(e[o],t[o]))return!1;for(var i in t)if(!(i in e))return!1}return!0}var Ce=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&&De(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}();Ce.none=[];var Ee=function(e){D(n,e);var t=S(n);function n(){return y(this,n),t.apply(this,arguments)}return k(n)}(me(Error)),Oe=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=Ae(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(Se(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(ke.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 Se(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(Se(a.content,t-i-1,n-i-1)))}function Ae(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=Ae(s.content,t-a-1,n);return u&&e.replaceChild(i,s.copy(u))}function je(e,t,n){if(n.openStart>e.depth)throw new Ee("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ee("Inconsistent open depths");return Me(e,t,n,0)}function Me(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=Me(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(ke.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Re(i,Be(e,s.start,s.end,t,r))}var u=e.parent,l=u.content;return Re(u,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}return Re(i,Ie(e,t,r))}function Ne(e,t){if(!t.type.compatibleContent(e.type))throw new Ee("Cannot join "+t.type.name+" onto "+e.type.name)}function Te(e,t,n){var r=e.node(n);return Ne(r,t.node(n)),r}function Fe(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 Pe(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&&(Fe(e.nodeAfter,r),i++));for(var s=i;s<a;s++)Fe(o.child(s),r);t&&t.depth==n&&t.textOffset&&Fe(t.nodeBefore,r)}function Re(e,t){if(!e.type.validContent(t))throw new Ee("Invalid content for node "+e.type.name);return e.copy(t)}function Be(e,t,n,r,o){var i=e.depth>o&&Te(e,t,o+1),a=r.depth>o&&Te(n,r,o+1),s=[];return Pe(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(Ne(i,a),Fe(Re(i,Be(e,t,n,r,o+1)),s)):(i&&Fe(Re(i,Ie(e,t,o+1)),s),Pe(t,n,o,s),a&&Fe(Re(a,Ie(n,r,o+1)),s)),Pe(r,null,o,s),new ke(s)}function Ie(e,t,n){var r=[];(Pe(null,e,n,r),e.depth>n)&&Fe(Re(Te(e,t,n+1),Ie(e,t,n+1)),r);return Pe(t,null,n,r),new ke(r)}Oe.empty=new Oe(ke.empty,0,0);var Le=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 Ce.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 $e(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<ze.length;r++){var o=ze[r];if(o.pos==n&&o.doc==t)return o}var i=ze[_e]=e.resolve(t,n);return _e=(_e+1)%Ve,i}}]),e}(),ze=[],_e=0,Ve=12,$e=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}(),He=Object.create(null),Ue=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ce.none;y(this,e),this.type=t,this.attrs=n,this.marks=o,this.content=r||ke.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&&De(this.attrs,t||e.defaultAttrs||He)&&Ce.sameSet(this.marks,n||Ce.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 Oe.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 Oe(u,r.depth-i,o.depth-i)}},{key:"replace",value:function(e,t,n){return je(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 Le.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return Le.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()+")"),qe(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]:ke.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=Ce.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Ce.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=ke.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}]),e}();Ue.prototype.text=void 0;var We=function(e){D(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):qe(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=pe(C(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(Ue);function qe(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var Je=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 ke.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 Ke(t,n);if(null==r.next)return e.empty;var o=Qe(r);r.next&&r.err("Unexpected trailing text");var i=function(e){var t=Object.create(null);return n(tt(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]);tt(e,r).forEach((function(e){i||o.push([n,i=[]]),-1==i.indexOf(e)&&i.push(e)}))}}))}));for(var i=t[r.join(",")]=new Je(r.indexOf(e.length-1)>-1),a=0;a<o.length;a++){var s=o[a][1].sort(et);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}();Je.empty=new Je(!0);var Ke=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 Qe(e){var t=[];do{t.push(Ge(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function Ge(e){var t=[];do{t.push(Ye(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Ye(e){for(var t=function(e){if(e.eat("(")){var t=Qe(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=Ze(e,t)}return t}function Xe(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Ze(e,t){var n=Xe(e),r=n;return e.eat(",")&&(r="}"!=e.next?Xe(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function et(e,t){return t-e}function tt(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(et)}function nt(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 rt(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 ot(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new at(e[n]);return t}var it=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=ot(r.attrs),this.defaultAttrs=nt(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==Je.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:rt(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 Ue(this,this.computeAttrs(e),ke.from(t),Ce.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=ke.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new Ue(this,this.computeAttrs(e),t,Ce.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=ke.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(ke.empty,!0);return i?new Ue(this,e,t.append(i),Ce.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:Ce.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}(),at=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}(),st=function(){function e(t,n,r,o){y(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=ot(o.attrs),this.excluded=null;var i=nt(this.attrs);this.instance=i?new Ce(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 Ce(this,rt(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}(),ut=function(){function e(t){y(this,e),this.cached=Object.create(null),this.spec={nodes:ge.from(t.nodes),marks:ge.from(t.marks||{}),topNode:t.topNode},this.nodes=it.compile(this.spec.nodes,this),this.marks=st.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]=Je.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==a?null:a?lt(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?[]:lt(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 it))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 We(n,n.defaultAttrs,e,Ce.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 Ue.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return Ce.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 lt(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 ct=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 vt(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 vt(this,t,!0);return n.addAll(e,t.from,t.to),Oe.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(gt(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=yt(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=yt(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}(),ft={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},dt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},pt={ol:!0,ul:!0};function ht(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var mt=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=Ce.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(ke.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=ke.from(this.content);return!e&&this.match&&(o=o.append(this.match.fillBefore(ke.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):bt(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&&!ft.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}]),e}(),vt=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=ht(null,n.preserveWhitespace,0)|(r?4:0);o=i?new mt(i.type,i.attrs,Ce.none,Ce.none,!0,n.topMatch||i.type.contentMatch,a):new mt(r?null:t.schema.topNodeType,null,Ce.none,Ce.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();pt.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&&pt.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:dt.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(ft.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=Ce.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=ht(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new mt(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 gt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function yt(e){var t={};for(var n in e)t[n]=e[n];return t}function bt(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 kt=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=xt(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(xt(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(xt(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=wt(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return wt(e.marks)}}]),e}();function wt(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function xt(e){return e.document||window.document}var Dt=Math.pow(2,16);function Ct(e){return 65535&e}var Et=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}(),Ot=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=Ct(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))/Dt}(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)*Dt,p=e==s?2:e==c?1:4;return(t<0?e!=s:e!=c)&&(p|=8),new Et(f,p,d)}r+=l-u}return n?e+r:new Et(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=Ct(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}();Ot.empty=new Ot([]);var St=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 Et(e,r,null)}}]),e}(),At=Object.create(null),jt=function(){function e(){y(this,e)}return k(e,[{key:"getMap",value:function(){return Ot.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=At[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 At)throw new RangeError("Duplicate use of step JSON ID "+e);return At[e]=t,t.prototype.jsonID=e,t}}]),e}(),Mt=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(Rd){if(Rd instanceof Ee)return e.fail(Rd.message);throw Rd}}}]),e}();function Nt(e,t,n){for(var r=[],o=0;o<e.childCount;o++){var i=e.child(o);i.content.size&&(i=i.copy(Nt(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return ke.fromArray(r)}var Tt=function(e){D(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 Oe(Nt(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 Mt.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new Ft(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}(jt);jt.jsonID("addMark",Tt);var Ft=function(e){D(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 Oe(Nt(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return Mt.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new Tt(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}(jt);jt.jsonID("removeMark",Ft);var Pt=function(e){D(n,e);var t=S(n);function n(e,r){var o;return y(this,n),(o=t.call(this)).pos=e,o.mark=r,o}return k(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Mt.fromReplace(e,this.pos,this.pos+1,new Oe(ke.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);if(t){var r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(var o=0;o<t.marks.length;o++)if(!t.marks[o].isInSet(r))return new n(this.pos,t.marks[o]);return new n(this.pos,this.mark)}}return new Rt(this.pos,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new n(t.pos,e.markFromJSON(t.mark))}}]),n}(jt);jt.jsonID("addNodeMark",Pt);var Rt=function(e){D(n,e);var t=S(n);function n(e,r){var o;return y(this,n),(o=t.call(this)).pos=e,o.mark=r,o}return k(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at mark step's position");var n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Mt.fromReplace(e,this.pos,this.pos+1,new Oe(ke.from(n),0,t.isLeaf?0:1))}},{key:"invert",value:function(e){var t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Pt(this.pos,this.mark):this}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new n(t.pos,e.markFromJSON(t.mark))}}]),n}(jt);jt.jsonID("removeNodeMark",Rt);var Bt=function(e){D(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&&Lt(e,this.from,this.to)?Mt.fail("Structure replace would overwrite content"):Mt.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new Ot([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?Oe.empty:new Oe(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?Oe.empty:new Oe(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,Oe.fromJSON(e,t.slice),!!t.structure)}}]),n}(jt);jt.jsonID("replace",Bt);var It=function(e){D(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&&(Lt(e,this.from,this.gapFrom)||Lt(e,this.gapTo,this.to)))return Mt.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Mt.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?Mt.fromReplace(e,this.from,this.to,n):Mt.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new Ot([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,Oe.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(jt);function Lt(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 zt(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function _t(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||!zt(r,o,i))break}return null}function Vt(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=Ht(e,t),i=o&&Ut(r,t);return i?o.map($t).concat({type:t,attrs:n}).concat(i.map($t)):null}function $t(e){return{type:e,attrs:null}}function Ht(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 Ut(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 Wt(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 It(s,u,s+1,u-1,new Oe(ke.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}function qt(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 It(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Oe(ke.from(a),0,0),1,!0))}function Jt(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 Kt(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=ke.empty,a=ke.empty,s=o.depth,u=o.depth-n,l=n-1;s>u;s--,l--){i=ke.from(o.node(s).copy(i));var c=r&&r[l];a=ke.from(c?c.type.create(c.attrs,a):o.node(s).copy(a))}e.step(new Bt(t,t,new Oe(i.append(a),n,n),!0))}function Qt(e,t){var n=e.resolve(t),r=n.index();return Gt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Gt(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function Yt(e,t,n){var r=new Bt(t-n,t+n,Oe.empty,!0);e.step(r)}function Xt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Oe.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return Zt(o,i,r)?new Bt(t,n,r):new en(o,i,r).fit()}function Zt(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}jt.jsonID("replaceAround",It);var en=function(){function e(t,n,r){y(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ke.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=ke.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 Oe(i,a,s);return t>-1?new It(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Bt(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=rn(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(ke.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=rn(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new Oe(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=rn(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new Oe(tn(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Oe(tn(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(on(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=nn(this.placed,n,ke.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?Oe.empty:new Oe(tn(s.content,t-1,1),t-1,m<0?s.openEnd:t-1):new Oe(tn(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||!an(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=an(e,t,o,r,i);if(a){for(var s=t-1;s>=0;s--){var u=this.frontier[s],l=u.match,c=an(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=nn(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=nn(this.placed,this.depth,ke.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(ke.empty,!0);e.childCount&&(this.placed=nn(this.placed,this.frontier.length,e))}}]),e}();function tn(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(tn(e.firstChild.content,t-1,n)))}function nn(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(nn(e.lastChild.content,t-1,n)))}function rn(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function on(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,on(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(ke.empty,!0)))),e.copy(r)}function an(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 sn(e){return e.spec.defining||e.spec.definingForContent}function un(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(un(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(ke.empty,!0))}return e}function ln(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 cn=function(e){D(n,e);var t=S(n);function n(e,r,o){var i;return y(this,n),(i=t.call(this)).pos=e,i.attr=r,i.value=o,i}return k(n,[{key:"apply",value:function(e){var t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at attribute step's position");var n=Object.create(null);for(var r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;var o=t.type.create(n,null,t.marks);return Mt.fromReplace(e,this.pos,this.pos+1,new Oe(ke.from(o),0,t.isLeaf?0:1))}},{key:"getMap",value:function(){return Ot.empty}},{key:"invert",value:function(e){return new n(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(e){var t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new n(t.pos,t.attr,t.value)}}]),n}(jt);jt.jsonID("attr",cn);var fn=Error;((fn=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=fn,fn.prototype.name="TransformError";var dn=function(){function e(t){y(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new St}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 fn(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]:Oe.empty,r=Xt(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new Oe(ke.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,Oe.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(Zt(o,i,r))return e.step(new Bt(t,n,r));var a=ln(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=sn(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 C=a[(D+f)%a.length],E=!0;C<0&&(E=!1,C=-C);var O=o.node(C-1),S=o.index(C-1);if(O.canReplaceWith(S,S,x.type,x.marks))return e.replace(o.before(C),E?i.after(C):n,new Oe(un(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 M=a[j];M<0||(t=o.before(M),n=i.after(M))}}(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 Oe(ke.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=ln(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=ke.empty,f=0,d=i,p=!1;d>n;d--)p||r.index(d)>0?(p=!0,c=ke.from(r.node(d).copy(c)),f++):u--;for(var h=ke.empty,m=0,v=i,g=!1;v>n;v--)g||o.after(v+1)<o.end(v)?(g=!0,h=ke.from(o.node(v).copy(h)),m++):l++;e.step(new It(u,l,a,s,new Oe(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 Yt(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=ke.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=ke.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new It(a,s,a,s,new Oe(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 Wt(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 qt(this,e,t,n,r),this}},{key:"setNodeAttribute",value:function(e,t,n){return this.step(new cn(e,t,n)),this}},{key:"addNodeMark",value:function(e,t){return this.step(new Pt(e,t)),this}},{key:"removeNodeMark",value:function(e,t){if(!(t instanceof Ce)){var n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Rt(e,t)),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 Kt(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 Ft(f,d,c[h])));i&&i.to==f?i.to=d:s.push(i=new Tt(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 st)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 Ft(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 Ft(a,l,u.marks[f]))}else i.push(new Bt(a,l,Oe.empty));a=l}if(!r.validEnd){var d=r.fillBefore(ke.empty,!0);e.replace(a,a,new Oe(d,0,0))}for(var p=i.length-1;p>=0;p--)e.step(i[p])}(this,e,t,n),this}}]),e}(),pn=Object.create(null),hn=function(){function e(t,n,r){y(this,e),this.$anchor=t,this.$head=n,this.ranges=r||[new mn(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]:Oe.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?Oe.empty:t),0==s&&En(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),En(e,n,t.isInline?-1:1))}}},{key:"getBookmark",value:function(){return yn.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 yn(e):Cn(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?Cn(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):Cn(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 xn(e.node(0))}},{key:"atStart",value:function(e){return Cn(e,e,0,0,1)||new xn(e)}},{key:"atEnd",value:function(e){return Cn(e,e,e.content.size,e.childCount,-1)||new xn(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=pn[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 pn)throw new RangeError("Duplicate use of selection JSON ID "+e);return pn[e]=t,t.prototype.jsonID=e,t}}]),e}();hn.prototype.visible=!0;var mn=k((function e(t,n){y(this,e),this.$from=t,this.$to=n})),vn=!1;function gn(e){vn||e.parent.inlineContent||(vn=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var yn=function(e){D(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),gn(e),gn(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 hn.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]:Oe.empty;if(pe(C(n.prototype),"replace",this).call(this,e,t),t==Oe.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 bn(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=hn.findFrom(t,r,!0)||hn.findFrom(t,-r,!0);if(!i)return hn.near(t,r);t=i.$head}return e.parent.inlineContent||(0==o||(e=(hn.findFrom(e,-r,!0)||hn.findFrom(e,r,!0)).$anchor).pos<t.pos!=o<0)&&(e=t),new n(e,t)}}]),n}(hn);hn.jsonID("text",yn);var bn=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 yn.between(e.resolve(this.anchor),e.resolve(this.head))}}]),e}(),kn=function(e){D(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?hn.near(a):new n(a)}},{key:"content",value:function(){return new Oe(ke.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 wn(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}(hn);kn.prototype.visible=!1,hn.jsonID("node",kn);var wn=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 bn(o,o):new e(o)}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&kn.isSelectable(n)?new kn(t):hn.near(t)}}]),e}(),xn=function(e){D(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]:Oe.empty;if(t==Oe.empty){e.delete(0,e.doc.content.size);var r=hn.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else pe(C(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 Dn}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(hn);hn.jsonID("all",xn);var Dn={map:function(){return this},resolve:function(e){return new xn(e)}};function Cn(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return yn.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&&kn.isSelectable(s))return kn.create(e,n-(o<0?s.nodeSize:0))}else{var u=Cn(e,s,n+o,o<0?s.childCount:0,o,i);if(u)return u}n+=s.nodeSize*o}return null}function En(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o,i=e.steps[r];if(i instanceof Bt||i instanceof It)e.mapping.maps[r].forEach((function(e,t,n,r){null==o&&(o=r)})),e.setSelection(hn.near(e.doc.resolve(o),n))}}var On=function(e){D(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 Ce.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){pe(C(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)||Ce.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(hn.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}(dn);function Sn(e,t){return t&&e?e.bind(t):e}var An=k((function e(t,n,r){y(this,e),this.name=t,this.init=Sn(n.init,r),this.apply=Sn(n.apply,r)})),jn=[new An("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new An("selection",{init:function(e,t){return e.selection||hn.atStart(t.doc)},apply:function(e){return e.selection}}),new An("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new An("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],Mn=k((function e(t,n){var r=this;y(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=jn.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 An(e.key,e.spec.state,e))}))})),Nn=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 On(this)}},{key:"reconfigure",value:function(t){for(var n=new Mn(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 Mn(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 Mn(t.schema,t.plugins),i=new e(o);return o.fields.forEach((function(e){if("doc"==e.name)i.doc=Ue.fromJSON(t.schema,n.doc);else if("selection"==e.name)i.selection=hn.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 Tn(e,t,n){for(var r in e){var o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Tn(o,t,{})),n[r]=o}return n}var Fn=function(){function e(t){y(this,e),this.spec=t,this.props={},t.props&&Tn(t.props,this,this.props),this.key=t.key?t.key.key:Rn("plugin")}return k(e,[{key:"getState",value:function(e){return e[this.key]}}]),e}(),Pn=Object.create(null);function Rn(e){return e in Pn?e+"$"+ ++Pn[e]:(Pn[e]=0,e+"$")}var Bn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";y(this,e),this.key=Rn(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}(),In="undefined"!=typeof navigator?navigator:null,Ln="undefined"!=typeof document?document:null,zn=In&&In.userAgent||"",_n=/Edge\/(\d+)/.exec(zn),Vn=/MSIE \d/.exec(zn),$n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zn),Hn=!!(Vn||$n||_n),Un=Vn?document.documentMode:$n?+$n[1]:_n?+_n[1]:0,Wn=!Hn&&/gecko\/(\d+)/i.test(zn);Wn&&(/Firefox\/(\d+)/.exec(zn)||[0,0])[1];var qn=!Hn&&/Chrome\/(\d+)/.exec(zn),Jn=!!qn,Kn=qn?+qn[1]:0,Qn=!Hn&&!!In&&/Apple Computer/.test(In.vendor),Gn=Qn&&(/Mobile\/\w+/.test(zn)||!!In&&In.maxTouchPoints>2),Yn=Gn||!!In&&/Mac/.test(In.platform),Xn=/Android \d/.test(zn),Zn=!!Ln&&"webkitFontSmoothing"in Ln.documentElement.style,er=Zn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tr=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},nr=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},rr=null,or=function(e,t,n){var r=rr||(rr=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},ir=function(e,t,n,r){return n&&(sr(e,t,n,r,-1)||sr(e,t,n,r,1))},ar=/^(img|br|input|textarea|hr)$/i;function sr(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:ur(e))){var i=e.parentNode;if(!i||1!=i.nodeType||cr(e)||ar.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tr(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?ur(e):0}}}function ur(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function lr(e,t,n){for(var r=0==t,o=t==ur(e);r||o;){if(e==n)return!0;var i=tr(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==ur(e)}}function cr(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 fr=function(e){var t=e.isCollapsed;return t&&Jn&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function dr(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function pr(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function hr(e,t){return"number"==typeof e?e:e[t]}function mr(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 vr(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=nr(a))if(1==a.nodeType){var s=a,u=s==i.body,l=u?pr(i):mr(s),c=0,f=0;if(t.top<l.top+hr(r,"top")?f=-(l.top-t.top+hr(o,"top")):t.bottom>l.bottom-hr(r,"bottom")&&(f=t.bottom-l.bottom+hr(o,"bottom")),t.left<l.left+hr(r,"left")?c=-(l.left-t.left+hr(o,"left")):t.right>l.right-hr(r,"right")&&(c=t.right-l.right+hr(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 gr(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=nr(r));return t}function yr(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 br=null;function kr(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=or(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=Cr(r,1);if(i.top!=i.bottom&&wr(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}:kr(n,r)}function wr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function xr(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(wr(t,l))return xr(a,t,l)}if((i=(i+1)%r)==o)break}return e}function Dr(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(!wr(t,l))return null;if(!(u=xr(e.dom,t,l)))return null}if(Qn)for(var c=u;n&&c;c=nr(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(Wn&&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=kr(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 Cr(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var Er=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Or(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=Zn||Wn;if(3==o.nodeType){if(!a||!Er.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++,Sr(Cr(or(o,s,u),l),l<0)}var c=Cr(or(o,i,i),n);if(Wn&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var f=Cr(or(o,i-1,i-1),-1);if(f.top==c.top){var d=Cr(or(o,i,i+1),-1);if(d.top!=c.top)return Sr(d,d.left<f.left)}}return c}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==ur(o))){var p=o.childNodes[i-1];if(1==p.nodeType)return Ar(p.getBoundingClientRect(),!1)}if(i<ur(o)){var h=o.childNodes[i];if(1==h.nodeType)return Ar(h.getBoundingClientRect(),!0)}return Ar(o.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==ur(o))){var m=o.childNodes[i-1],v=3==m.nodeType?or(m,ur(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return Sr(Cr(v,1),!1)}if(i<ur(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?or(g,0,a?0:1):1==g.nodeType?g:null:null;if(y)return Sr(Cr(y,-1),!0)}return Sr(Cr(3==o.nodeType?or(o):o,-n),n>=0)}function Sr(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 Ar(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 jr(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 Mr=/[\u0590-\u08ac]/;var Nr=null,Tr=null,Fr=!1;function Pr(e,t,n){return Nr==t&&Tr==n?Fr:(Nr=t,Tr=n,Fr="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return jr(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=Or(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=or(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 Mr.test(r.parent.textContent)&&s.modify?jr(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 Rr=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>tr(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 $r){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 Br&&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?tr(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?tr(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=tr(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=tr(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((Wn||Qn)&&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:tr(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(Wn&&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&&Qn||!ir(c.node,c.offset,d.anchorNode,d.anchorOffset)||!ir(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(E){if(!(E instanceof DOMException))throw E}}if(!x){if(e>t){var D=c;c=f,f=D}var C=document.createRange();C.setEnd(f.node,f.offset),C.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(C)}}}},{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}(),Br=function(e){D(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=w(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),pe(C(n.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}]),n}(Rr),Ir=function(e){D(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}(Rr),Lr=function(e){D(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(pe(C(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=to(i,t,a,r)),e>0&&(i=to(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=kt.renderSpec(document,t.type.spec.toDOM(t,r))),new n(e,t,a.dom,a.contentDOM||a.dom)}}]),n}(Rr),zr=function(e){D(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 ke.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)&&Yr(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 Zr(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(eo);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?Ce.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),Ur(this.contentDOM,this.children,e),Gn&&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 yn)||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=ur(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 Ir(this,i,n,o);e.input.compositionNodes.push(a),this.children=to(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(!Yr(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Kr(this.dom,this.nodeDOM,Jr(this.outerDeco,this.node,t),Jr(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=kt.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=Gr(c,r,t),l?s=new Hr(e,t,r,o,c,f||null,p,l,i,a+1):t.isText?new Vr(e,t,r,o,c,p,i):new n(e,t,r,o,c,f||null,p,i,a+1)}}]),n}(Rr);function _r(e,t,n,r,o){return Gr(r,t,e),new zr(void 0,e,t,n,r,r,r,o,0)}var Vr=function(e){D(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):pe(C(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){pe(C(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}(zr),$r=function(e){D(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}(Rr),Hr=function(e){D(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)&&pe(C(n.prototype),"update",this).call(this,e,t,r,o)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():pe(C(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():pe(C(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):pe(C(n.prototype),"setSelection",this).call(this,e,t,r,o)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),pe(C(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):pe(C(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(zr);function Ur(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=Xr(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(s,r);if(a instanceof Lr){var u=r?r.previousSibling:e.lastChild;Ur(a.contentDOM,a.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=Xr(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var Wr=function(e){e&&(this.nodeName=e)};Wr.prototype=Object.create(null);var qr=[new Wr];function Jr(e,t,n){if(0==e.length)return qr;for(var r=n?qr[0]:new Wr,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 Wr(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==o.length&&o.push(r=new Wr(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 Kr(e,t,n,r){if(n==qr&&r==qr)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=qr[0]),o=u}Qr(o,s||qr[0],a)}return o}function Qr(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 Gr(e,t,n){return Kr(e,e,qr,Jr(t,n,1!=e.nodeType))}function Yr(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 Xr(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var Zr=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 Lr)){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=Lr.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 zr){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&&Yr(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,zr.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 Br(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 Lr;)e=(t=e).children[t.children.length-1];e&&e instanceof Vr&&!/\n$/.test(e.node.text)||((Qn||Jn)&&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 $r(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}}]),e}();function eo(e,t){return e.type.side-t.type.side}function to(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 no(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(fr(n)){for(s=l;o&&!o.node;)o=o.parent;var c=o.node;if(o&&c.isAtom&&kn.isSelectable(c)&&o.parent&&(!c.isInline||!lr(n.focusNode,n.focusOffset,o.dom))){var f=o.posBefore;u=new kn(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=ho(e,s,l,p)}return u}function ro(e){return e.editable?e.hasFocus():vo(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function oo(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(fo(e,n),ro(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Jn){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&ir(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)co(e);else{var i,a,s=n.anchor,u=n.head;!io||n instanceof yn||(n.$from.parent.inlineContent||(i=ao(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=ao(e,n.to))),e.docView.setSelection(s,u,e.root,t),io&&(i&&uo(i),a&&uo(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&lo(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var io=Qn||Jn&&Kn<63;function ao(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(Qn&&i&&"false"==i.contentEditable)return so(i);if((!i||"false"==i.contentEditable)&&(!a||"false"==a.contentEditable)){if(i)return so(i);if(a)return so(a)}}function so(e){return e.contentEditable="true",Qn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function uo(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function lo(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(){ro(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}function co(e){var t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,tr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Hn&&Un<=11&&(r.disabled=!0,r.disabled=!1)}function fo(e,t){if(t instanceof kn){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(po(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else po(e)}function po(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ho(e,t,n,r){return e.someProp("createSelectionBetween",(function(r){return r(e,t,n)}))||yn.between(t,n,r)}function mo(e){return(!e.editable||e.root.activeElement==e.dom)&&vo(e)}function vo(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 go(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&&hn.findFrom(a,t)}function yo(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function bo(e,t,n){var r=e.state.selection;if(!(r instanceof yn)){if(r instanceof kn&&r.node.isInline)return yo(e,new yn(t>0?r.$to:r.$from));var o=go(e.state,t);return!!o&&yo(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=go(e.state,t);return!!(i&&i instanceof kn)&&yo(e,i)}if(!(Yn&&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)&&(kn.isSelectable(u)?yo(e,new kn(t<0?e.state.doc.resolve(s.pos-u.nodeSize):s)):!!Zn&&yo(e,new yn(e.state.doc.resolve(t<0?l:l+u.nodeSize))))}}function ko(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function wo(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function xo(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(Wn&&1==n.nodeType&&r<ko(n)&&wo(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(wo(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(Co(n))break;for(var u=n.previousSibling;u&&wo(u);)o=n.parentNode,i=tr(u),u=u.previousSibling;if(u)r=ko(n=u);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Eo(e,t,n,r):o&&Eo(e,t,o,i)}}function Do(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=ko(n);;)if(r<a){if(1!=n.nodeType)break;if(!wo(n.childNodes[r]))break;o=n,i=++r}else{if(Co(n))break;for(var s=n.nextSibling;s&&wo(s);)o=s.parentNode,i=tr(s)+1,s=s.nextSibling;if(s)r=0,a=ko(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}o&&Eo(e,t,o,i)}}function Co(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Eo(e,t,n,r){if(fr(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&&oo(e)}),50)}function Oo(e,t,n){var r=e.state.selection;if(r instanceof yn&&!r.empty||n.indexOf("s")>-1)return!1;if(Yn&&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=go(e.state,t);if(a&&a instanceof kn)return yo(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,u=r instanceof xn?hn.near(s,t):hn.findFrom(s,t);return!!u&&yo(e,u)}return!1}function So(e,t){if(!(e.state.selection instanceof yn))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 Ao(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function jo(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||Yn&&72==n&&"c"==r?So(e,-1)||xo(e):46==n||Yn&&68==n&&"c"==r?So(e,1)||Do(e):13==n||27==n||(37==n||Yn&&66==n&&"c"==r?bo(e,-1,r)||xo(e):39==n||Yn&&70==n&&"c"==r?bo(e,1,r)||Do(e):38==n||Yn&&80==n&&"c"==r?Oo(e,-1,r)||xo(e):40==n||Yn&&78==n&&"c"==r?function(e){if(!Qn||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;Ao(e,o,"true"),setTimeout((function(){return Ao(e,o,"false")}),20)}return!1}(e)||Oo(e,1,r)||Do(e):r==(Yn?"m":"c")&&(66==n||73==n||89==n||90==n))}function Mo(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")||kt.fromSchema(e.state.schema),u=_o(),l=u.createElement("div");l.appendChild(s.serializeFragment(r,{document:u}));for(var c,f=l.firstChild,d=0;f&&1==f.nodeType&&(c=Lo[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 No(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 Oe(ke.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):Oe.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=kt.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=_o().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Lo[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),Zn&&function(e){for(var t=e.querySelectorAll(Jn?"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")||ct.fromSchema(e.state.schema);a=v.parseSlice(i,{preserveWhitespace:!(!u&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||To.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(Rd){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=ke.from(u.create(n[s+1],o)),i++,a++}return new Oe(o,i,a)}(Io(a,+h[1],+h[2]),h[4]);else if(a=Oe.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&&Po(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Ro(i[i.length-1],o.length));var a=Fo(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:ke.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=Io(a,g,y)}return e.someProp("transformPasted",(function(e){a=e(a)})),a}var To=/^(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 Fo(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,ke.from(e));return e}function Po(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var i=Po(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(ke.from(Fo(n,e,o+1))))}}function Ro(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,Ro(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(ke.empty,!0);return e.copy(n.append(r))}function Bo(e,t,n,r,o,i){var a=t<0?e.firstChild:e.lastChild,s=a.content;return o<r-1&&(s=Bo(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(ke.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function Io(e,t,n){return t<e.openStart&&(e=new Oe(Bo(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Oe(Bo(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Lo={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},zo=null;function _o(){return zo||(zo=document.implementation.createHTMLDocument("title"))}var Vo={},$o={},Ho=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 Uo(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Wo(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 qo(e,t)})}))}function qo(e,t){return e.someProp("handleDOMEvents",(function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Jo(e){return{left:e.clientX,top:e.clientY}}function Ko(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 Qo(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Go(e,t,n,r,o){return Ko(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 kn&&(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(kn.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&&(Qo(e,kn.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&&kn.isSelectable(r))&&(Qo(e,new kn(n),"pointer"),!0)}(e,n))}function Yo(e,t,n,r){return Ko(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function Xo(e,t,n,r){return Ko(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&&(Qo(e,yn.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)Qo(e,yn.create(r,s+1,s+1+a.content.size),"pointer");else{if(!kn.isSelectable(a))continue;Qo(e,kn.create(r,s),"pointer")}return!0}}(e,n,r)}function Zo(e){return ai(e)}$o.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!ni(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Xn||!Jn||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Gn||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||jo(e,n)?n.preventDefault():Uo(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,dr(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},$o.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},$o.keypress=function(e,t){var n=t;if(!(ni(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Yn&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof yn)||!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 ei=Yn?"metaKey":"ctrlKey";Vo.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=Zo(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[ei]&&("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(Jo(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ti(e,a,n,!!r)):("doubleClick"==i?Yo:Xo)(e,a.pos,a.inside,n)?n.preventDefault():Uo(e,"pointer"))};var ti=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[ei],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 kn&&f.from<=a&&f.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Wn||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)),Uo(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 oo(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(Jo(e))),this.allowDefault||!t?Uo(this.view,"pointer"):Go(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Qn&&this.mightDrag&&!this.mightDrag.node.isAtom||Jn&&!(this.view.state.selection instanceof yn)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Qo(this.view,hn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Uo(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),Uo(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function ni(e,t){return!!e.composing||!!(Qn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Vo.touchdown=function(e){Zo(e),Uo(e,"pointer")},Vo.contextmenu=function(e){return Zo(e)};var ri=Xn?5e3:-1;function oi(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return ai(e)}),t))}function ii(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 ai(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(Xn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ii(e),t||e.docView&&e.docView.dirty){var n=no(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}$o.compositionstart=$o.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(),ai(e,!0),e.markCursor=null;else if(ai(e),Wn&&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}oi(e,ri)},$o.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,oi(e,20))};var si=Hn&&Un<15||Gn&&er<604;function ui(e,t,n,r){var o=No(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||Oe.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}Vo.copy=$o.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=si?null:n.clipboardData,a=Mo(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"))}},$o.paste=function(e,t){var n=t;if(!e.composing||Xn){var r=si?null:n.clipboardData;r&&ui(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?ui(e,r.value,null,t):ui(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var li=k((function e(t,n){y(this,e),this.slice=t,this.move=n})),ci=Yn?"altKey":"ctrlKey";for(var fi in Vo.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(Jo(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof kn?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(kn.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(kn.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),u=Mo(e,s),l=u.dom,c=u.text;n.dataTransfer.clearData(),n.dataTransfer.setData(si?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",si||n.dataTransfer.setData("text/plain",c),e.dragging=new li(s,!n[ci])}},Vo.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},$o.dragover=$o.dragenter=function(e,t){return t.preventDefault()},$o.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(Jo(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=No(e,n.dataTransfer.getData(si?"Text":"text/plain"),si?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[ci]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||Oe.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&&kn.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new kn(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(ho(e,p,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}}}}}},Vo.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())&&oo(e)}),20))},Vo.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)},Vo.beforeinput=function(e,t){if(Jn&&Xn&&"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,dr(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)}},$o)Vo[fi]=$o[fi];function di(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 pi=function(){function e(t,n){y(this,e),this.toDOM=t,this.spec=n||yi,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 vi(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&&di(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),hi=function(){function e(t,n){y(this,e),this.attrs=t,this.spec=n||yi}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 vi(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&&di(this.attrs,t.attrs)&&di(this.spec,t.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(t){return t.type instanceof e}}]),e}(),mi=function(){function e(t,n){y(this,e),this.attrs=t,this.spec=n||yi}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 vi(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&&di(this.attrs,t.attrs)&&di(this.spec,t.spec)}},{key:"destroy",value:function(){}}]),e}(),vi=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 hi}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new pi(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new hi(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new mi(r,o))}}]),e}(),gi=[],yi={},bi=function(){function e(t,n){y(this,e),this.local=t.length?t:gi,this.children=n.length?n:gi}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==ki||0==e.maps.length?this:this.mapInner(e,t,0,0,n||yi)}},{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!=ki?(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=Ei(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,C=0;D<w.children.length;D+=3){for(var E=w.children[D];C<s.length&&s[C]<E;)C+=3;s.splice(C,0,w.children[D],w.children[D+1],w.children[D+2])}}return new bi(t.sort(Oi),s)}(this.children,a||[],t,n,r,o,i):a?new e(a.sort(Oi),gi):ki}},{key:"add",value:function(t,n){return n.length?this==ki?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=Di(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,Ei(s,e,u+1,yi)),a+=3}}));for(var s=xi(a?Ci(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(Oi):this.local,o||this.children)}},{key:"remove",value:function(e){return 0==e.length||this==ki?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!=ki?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):ki}},{key:"forChild",value:function(t,n){if(this==ki)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 hi){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(Oi),gi);return r?new wi([d,r]):d}return r||ki}},{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 Si(this.localsInner(e))}},{key:"localsInner",value:function(e){if(this==ki)return gi;if(e.inlineContent||!this.local.some(hi.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof hi||t.push(this.local[n]);return t}}],[{key:"create",value:function(e,t){return t.length?Ei(t,e,0,yi):ki}}]),e}();bi.empty=new bi([],[]),bi.removeOverlap=Si;var ki=bi.empty,wi=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,yi)}));return e.from(r)}},{key:"forChild",value:function(t,n){if(n.isLeaf)return bi.empty;for(var r=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(t,n);i!=ki&&(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?Si(n?t:t.sort(Oi)):gi}}],[{key:"from",value:function(t){switch(t.length){case 0:return ki;case 1:return t[0];default:return new e(t)}}}]),e}();function xi(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new vi(o.from+t,o.to+t,o.type))}return n}function Di(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 Ci(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Ei(e,t,n,r){var o=[],i=!1;t.forEach((function(t,a){var s=Di(e,t,a+n);if(s){i=!0;var u=Ei(s,t,n+a+1,r);u!=ki&&o.push(a,a+t.nodeSize,u)}}));for(var a=xi(i?Ci(e):e,-n).sort(Oi),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 bi(a,o):ki}function Oi(e,t){return e.from-t.from||e.to-t.to}function Si(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),Ai(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),Ai(t,o+1,i.copy(r.to,i.to)))}}return t}function Ai(e,t,n){for(;t<e.length&&Oi(n,e[t])>0;)t++;e.splice(t,0,n)}function ji(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=ki&&t.push(r)})),e.cursorWrapper&&t.push(bi.create(e.state.doc,[e.cursorWrapper.deco])),wi.from(t)}var Mi={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ni=Hn&&Un<=11,Ti=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}(),Fi=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 Ti,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]);Hn&&Un<=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()})),Ni&&(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,Mi),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(mo(this.view)){if(this.suppressingSelectionUpdates)return oo(this.view);if(Hn&&Un<=11&&!this.view.state.selection.empty){var e=this.view.domSelection();if(e.focusNode&&ir(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)&&mo(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(Wn&&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(Pi)return;Pi=!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)||oo(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(Hn&&Un<=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?tr(o)+1:0,f=n.localPosFromDOM(e.target,c,-1),d=i&&i.parentNode==e.target?tr(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}(),Pi=!1;function Ri(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Qn&&/^(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||Qn&&/^(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 Bi(e,t,n,r,o){if(t<0){var i=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,a=no(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}],fr(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Jn&&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")||ct.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:Ri,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(Jn&&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((Gn&&e.input.lastIOSEnter>Date.now()-225||Xn)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,dr(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!y){if(!(r&&c instanceof yn&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||f.sel&&f.sel.anchor!=f.sel.head){if(f.sel){var b=Ii(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 yn&&(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)),Hn&&Un<=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),C=w.sameParent(x)&&w.parent.inlineContent&&D.end()>=y.endA;if((Gn&&e.input.lastIOSEnter>Date.now()-225&&(!C||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!C&&w.pos<f.doc.content.size&&(k=hn.findFrom(f.doc.resolve(w.pos+1),1,!0))&&k.head==x.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,dr(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||Li(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(Li(i,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Li(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,dr(8,"Backspace"))})))Xn&&Jn&&e.domObserver.suppressSelectionUpdates();else{Jn&&Xn&&y.endB==y.start&&(e.input.lastAndroidDelete=Date.now()),Xn&&!C&&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,dr(13,"Enter"))}))}),20));var E,O,S,A=y.start,j=y.endA;if(C)if(w.pos==x.pos)Hn&&Un<=11&&0==w.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return oo(e)}),20)),E=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(ke.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()))))E=e.state.tr,"add"==S.type?E.addMark(A,j,S.mark):E.removeMark(A,j,S.mark);else if(w.parent.child(w.index()).isText&&w.index()==x.index()-(x.textOffset?0:1)){var M=w.parent.textBetween(w.parentOffset,x.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,A,j,M)})))return;E=e.state.tr.insertText(M,A,j)}if(E||(E=e.state.tr.replace(A,j,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){var N=Ii(e,E.doc,f.sel);N&&!(Jn&&Xn&&e.composing&&N.empty&&(y.start!=y.endB||e.input.lastAndroidDelete<Date.now()-100)&&(N.head==A||N.head==E.mapping.map(j)-1)||Hn&&N.empty&&N.head==A)&&E.setSelection(N)}O&&E.ensureMarks(O),e.dispatch(E.scrollIntoView())}}}}function Ii(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ho(e,t.resolve(n.anchor),t.resolve(n.head))}function Li(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 zi=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 Ho,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Ui),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=$i(this),Vi(this),this.nodeViews=Hi(this),this.docView=_r(this.state.doc,_i(this),ji(this),this.dom,this),this.domObserver=new Fi(this,(function(e,t,n,o){return Bi(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(t){var n=Vo[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)||qo(e,t)||!e.editable&&t.type in $o||n(e,t)})};for(var n in Vo)t(n);Qn&&e.dom.addEventListener("input",(function(){return null})),Wo(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&&Wo(this),this._props=e,e.plugins&&(e.plugins.forEach(Ui),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&&(ii(this),i=!0),this.state=e,t){var a=Hi(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),Wo(this)}this.editable=$i(this),Vi(this);var s=ji(this),u=_i(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:gr(e.dom)}}(this);if(i){this.domObserver.stop();var d=c&&(Hn||Jn)&&!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=Jn?this.trackWrites=this.domSelection().focusNode:null;!o&&this.docView.update(e.doc,u,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=_r(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 ir(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?oo(this,d):(fo(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 kn){var m=this.docView.domAfterPos(e.selection.from);1==m.nodeType&&vr(this,m.getBoundingClientRect(),h)}else vr(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;yr(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(br)return e.focus(br);var t=gr(e);e.focus(null==br?{get preventScroll(){return br={preventScroll:!0},!0}}:void 0),br||(br=!1,yr(t,0))}(this.dom),oo(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 Dr(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Or(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 Pr(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,[],ji(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){qo(e,t)||!Vo[t.type]||!e.editable&&t.type in $o||Vo[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 _i(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]))})),[vi.node(0,e.state.doc.content.size,t)]}function Vi(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:vi.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function $i(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Hi(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 Ui(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 Wi={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:"'"},qi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ji="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Ki=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),Qi="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Gi=Ki||Ji&&+Ji[1]<57,Yi=0;Yi<10;Yi++)Wi[48+Yi]=Wi[96+Yi]=String(Yi);for(Yi=1;Yi<=24;Yi++)Wi[Yi+111]="F"+Yi;for(Yi=65;Yi<=90;Yi++)Wi[Yi]=String.fromCharCode(Yi+32),qi[Yi]=String.fromCharCode(Yi);for(var Xi in Wi)qi.hasOwnProperty(Xi)||(qi[Xi]=Wi[Xi]);var Zi="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ea(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);Zi?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function ta(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 na(e){var t=function(e){var t=Object.create(null);for(var n in e)t[ea(n)]=e[n];return t}(e);return function(e,n){var r,o=function(e){var t=!(Gi&&(e.ctrlKey||e.altKey||e.metaKey)||Qi&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?qi:Wi)[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[ta(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=Wi[n.keyCode])&&r!=o){var s=t[ta(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){var u=t[ta(o,n,!0)];if(u&&u(e.state,e.dispatch,e))return!0}return!1}}var ra=Math.pow(2,16);function oa(e){return 65535&e}var ia=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}(),aa=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=oa(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))/ra}(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)*ra,p=e==s?2:e==c?1:4;return(t<0?e!=s:e!=c)&&(p|=8),new ia(f,p,d)}r+=l-u}return n?e+r:new ia(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=oa(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}();aa.empty=new aa([]);var sa=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 ia(e,r,null)}}]),e}(),ua=Object.create(null),la=function(){function e(){y(this,e)}return k(e,[{key:"getMap",value:function(){return aa.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=ua[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 ua)throw new RangeError("Duplicate use of step JSON ID "+e);return ua[e]=t,t.prototype.jsonID=e,t}}]),e}(),ca=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(Rd){if(Rd instanceof Ee)return e.fail(Rd.message);throw Rd}}}]),e}();function fa(e,t,n){for(var r=[],o=0;o<e.childCount;o++){var i=e.child(o);i.content.size&&(i=i.copy(fa(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return ke.fromArray(r)}var da=function(e){D(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 Oe(fa(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 ca.fromReplace(e,this.from,this.to,i)}},{key:"invert",value:function(){return new pa(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}(la);la.jsonID("addMark",da);var pa=function(e){D(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 Oe(fa(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return ca.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new da(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}(la);la.jsonID("removeMark",pa);var ha=function(e){D(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&&va(e,this.from,this.to)?ca.fail("Structure replace would overwrite content"):ca.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new aa([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?Oe.empty:new Oe(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?Oe.empty:new Oe(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,Oe.fromJSON(e,t.slice),!!t.structure)}}]),n}(la);la.jsonID("replace",ha);var ma=function(e){D(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&&(va(e,this.from,this.gapFrom)||va(e,this.gapTo,this.to)))return ca.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ca.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?ca.fromReplace(e,this.from,this.to,n):ca.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new aa([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,Oe.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(la);function va(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 ga(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ya(e){return{type:e,attrs:null}}function ba(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 ka(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 wa(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 ma(s,u,s+1,u-1,new Oe(ke.from(r.create(o,null,t.marks)),0,0),1,!0)),!1}}))}function xa(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 ma(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Oe(ke.from(a),0,0),1,!0))}function Da(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 Ca(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=ke.empty,a=ke.empty,s=o.depth,u=o.depth-n,l=n-1;s>u;s--,l--){i=ke.from(o.node(s).copy(i));var c=r&&r[l];a=ke.from(c?c.type.create(c.attrs,a):o.node(s).copy(a))}e.step(new ha(t,t,new Oe(i.append(a),n,n),!0))}function Ea(e,t){var n=e.resolve(t),r=n.index();return Oa(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Oa(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function Sa(e,t,n){var r=new ha(t-n,t+n,Oe.empty,!0);e.step(r)}function Aa(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Oe.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return ja(o,i,r)?new ha(t,n,r):new Ma(o,i,r).fit()}function ja(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}la.jsonID("replaceAround",ma);var Ma=function(){function e(t,n,r){y(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ke.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=ke.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 Oe(i,a,s);return t>-1?new ma(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new ha(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=Fa(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(ke.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=Fa(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new Oe(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=Fa(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new Oe(Na(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Oe(Na(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(Pa(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=Ta(this.placed,n,ke.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?Oe.empty:new Oe(Na(s.content,t-1,1),t-1,m<0?s.openEnd:t-1):new Oe(Na(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||!Ra(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=Ra(e,t,o,r,i);if(a){for(var s=t-1;s>=0;s--){var u=this.frontier[s],l=u.match,c=Ra(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=Ta(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=Ta(this.placed,this.depth,ke.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(ke.empty,!0);e.childCount&&(this.placed=Ta(this.placed,this.frontier.length,e))}}]),e}();function Na(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Na(e.firstChild.content,t-1,n)))}function Ta(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ta(e.lastChild.content,t-1,n)))}function Fa(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function Pa(e,t,n){if(t<=0)return e;var r=e.content;return t>1&&(r=r.replaceChild(0,Pa(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(ke.empty,!0)))),e.copy(r)}function Ra(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 Ba(e){return e.spec.defining||e.spec.definingForContent}function Ia(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(Ia(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(ke.empty,!0))}return e}function La(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 za=Error;((za=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=za,za.prototype.name="TransformError";var _a=function(){function e(t){y(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new sa}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 za(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]:Oe.empty,r=Aa(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new Oe(ke.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,Oe.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(ja(o,i,r))return e.step(new ha(t,n,r));var a=La(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=Ba(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 C=a[(D+f)%a.length],E=!0;C<0&&(E=!1,C=-C);var O=o.node(C-1),S=o.index(C-1);if(O.canReplaceWith(S,S,x.type,x.marks))return e.replace(o.before(C),E?i.after(C):n,new Oe(Ia(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 M=a[j];M<0||(t=o.before(M),n=i.after(M))}}(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 Oe(ke.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=La(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=ke.empty,f=0,d=i,p=!1;d>n;d--)p||r.index(d)>0?(p=!0,c=ke.from(r.node(d).copy(c)),f++):u--;for(var h=ke.empty,m=0,v=i,g=!1;v>n;v--)g||o.after(v+1)<o.end(v)?(g=!0,h=ke.from(o.node(v).copy(h)),m++):l++;e.step(new ma(u,l,a,s,new Oe(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 Sa(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=ke.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=ke.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new ma(a,s,a,s,new Oe(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 wa(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 xa(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 Ca(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 pa(f,d,c[h])));i&&i.to==f?i.to=d:s.push(i=new da(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 st)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 pa(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 pa(a,l,u.marks[f]))}else i.push(new ha(a,l,Oe.empty));a=l}if(!r.validEnd){var d=r.fillBefore(ke.empty,!0);e.replace(a,a,new Oe(d,0,0))}for(var p=i.length-1;p>=0;p--)e.step(i[p])}(this,e,t,n),this}}]),e}(),Va=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)},$a=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=Wa(r);if(!o){var i=r.blockRange(),a=i&&_t(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&ns(e,o,t))return!0;if(0==r.parent.content.size&&(Ha(s,"end")||kn.isSelectable(s))){var u=Xt(e.doc,r.before(),r.after(),Oe.empty);if(u&&u.slice.size<u.to-u.from){if(t){var l=e.tr.step(u);l.setSelection(Ha(s,"end")?hn.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):kn.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 Ha(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 Ua=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=Wa(o)}var a=i&&i.nodeBefore;return!(!a||!kn.isSelectable(a))&&(t&&t(e.tr.setSelection(kn.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function Wa(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 qa=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=Ka(r);if(!o)return!1;var i=o.nodeAfter;if(ns(e,o,t))return!0;if(0==r.parent.content.size&&(Ha(i,"start")||kn.isSelectable(i))){var a=Xt(e.doc,r.before(),r.after(),Oe.empty);if(a&&a.slice.size<a.to-a.from){if(t){var s=e.tr.step(a);s.setSelection(Ha(i,"start")?hn.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):kn.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)},Ja=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=Ka(o)}var a=i&&i.nodeAfter;return!(!a||!kn.isSelectable(a))&&(t&&t(e.tr.setSelection(kn.create(e.doc,i.pos)).scrollIntoView()),!0)};function Ka(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 Qa=function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=r.blockRange(o),a=i&&_t(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Ga=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 Ya(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 Xa=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=Ya(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(hn.near(l.doc.resolve(u),1)),t(l.scrollIntoView())}return!0},Za=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(n instanceof xn||r.parent.inlineContent||o.parent.inlineContent)return!1;var i=Ya(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(yn.create(s.doc,a+1)),t(s.scrollIntoView())}return!0},es=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(Jt(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&_t(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},ts=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof kn&&e.selection.node.isBlock)return!(!r.parentOffset||!Jt(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 yn||e.selection instanceof xn)&&a.deleteSelection();var s=0==r.depth?null:Ya(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=i&&s?[{type:s}]:void 0,l=Jt(a.doc,a.mapping.map(r.pos),1,u);if(u||l||!Jt(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 ns(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&&!Qt(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=ke.empty,c=r.length-1;c>=0;c--)l=ke.from(r[c].create(null,l));l=ke.from(i.copy(l));var f=e.tr.step(new It(t.pos-1,u,t.pos,u,new Oe(l,1,0),r.length,!0)),d=u+2*r.length;Qt(f.doc,d)&&f.join(d),n(f.scrollIntoView())}return!0}var p=hn.findFrom(t,1),h=p&&p.$from.blockRange(p.$to),m=h&&_t(h);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(h,m).scrollIntoView()),!0;if(s&&Ha(a,"start",!0)&&Ha(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=ke.empty,w=g.length-1;w>=0;w--)k=ke.from(g[w].copy(k));n(e.tr.step(new It(t.pos-g.length,t.pos+a.nodeSize,t.pos+b,t.pos+a.nodeSize-b,new Oe(k,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function rs(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(yn.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var is=rs(-1),as=rs(1);function ss(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&&Vt(s,e,t);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}function us(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 ls(){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 cs=ls(Va,$a,Ua),fs=ls(Va,qa,Ja),ds={Enter:ls(Ga,Za,es,ts),"Mod-Enter":Xa,Backspace:cs,"Mod-Backspace":cs,"Shift-Backspace":cs,Delete:fs,"Mod-Delete":fs,"Mod-a":function(e,t){return t&&t(e.tr.setSelection(new xn(e.doc))),!0}},ps={"Ctrl-h":ds.Backspace,"Alt-Backspace":ds["Mod-Backspace"],"Ctrl-d":ds.Delete,"Ctrl-Alt-Backspace":ds["Mod-Delete"],"Alt-Delete":ds["Mod-Delete"],"Alt-d":ds["Mod-Delete"],"Ctrl-a":is,"Ctrl-e":as};for(var hs in ds)ps[hs]=ds[hs];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function ms(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 $e(c,c,s.depth),s.endIndex<s.parent.childCount&&(s=new $e(i,n.doc.resolve(a.end(s.depth)),s.depth)),u=!0}var f=Vt(l,e,t,s);return!!f&&(r&&r(vs(n.tr,s,f,u,e).scrollIntoView()),!0)}}function vs(e,t,n,r,o){for(var i=ke.empty,a=n.length-1;a>=0;a--)i=ke.from(n[a].type.create(n[a].attrs,i));e.step(new It(t.start-(r?2:0),t.end,t.start,t.end,new Oe(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&&Jt(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=f.child(d).nodeSize;return e}function gs(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 It(i-1,a,i,a,new Oe(ke.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new $e(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));return t(o.lift(r,_t(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?ke.empty:ke.from(o))))return!1;var h=u.pos,m=h+l.nodeSize;return r.step(new It(h-(c?1:0),m+(f?1:0),h+1,m-1,new Oe((c?ke.empty:ke.from(o.copy(ke.empty))).append(f?ke.empty:ke.from(o.copy(ke.empty))),c?0:1,f?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,a)))}}function ys(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 bs=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:ys({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}(),ks=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 ws(e,t,n){return void 0===e.config[t]&&e.parent?ws(e.parent,t,n):"function"===typeof e.config[t]?e.config[t].bind(i(i({},n),{},{parent:e.parent?ws(e.parent,t,n):null})):e.config[t]}function xs(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 Ds(e){var t=[],n=xs(e),r=n.nodeExtensions,o=n.markExtensions,a=[].concat(B(r),B(o)),s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((function(e){var n=ws(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=ws(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 Cs(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 Es(){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 Os(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 Es(e,t)}),{})}function Ss(e){return"function"===typeof e}function As(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Ss(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 js(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 Ms(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 Ns(e){var t,n=Ds(e),r=xs(e),o=r.nodeExtensions,a=r.markExtensions,s=null===(t=o.find((function(e){return ws(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=ws(n,"extendNodeSchema",o);return i(i({},e),r?r(t):{})}),{}),s=Ms(i(i({},a),{},{content:As(ws(t,"content",o)),marks:As(ws(t,"marks",o)),group:As(ws(t,"group",o)),inline:As(ws(t,"inline",o)),atom:As(ws(t,"atom",o)),selectable:As(ws(t,"selectable",o)),draggable:As(ws(t,"draggable",o)),code:As(ws(t,"code",o)),defining:As(ws(t,"defining",o)),isolating:As(ws(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=As(ws(t,"parseHTML",o));u&&(s.parseDOM=u.map((function(e){return js(e,r)})));var l=ws(t,"renderHTML",o);l&&(s.toDOM=function(e){return l({node:e,HTMLAttributes:Os(e,r)})});var c=ws(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=ws(n,"extendMarkSchema",o);return i(i({},e),r?r(t):{})}),{}),s=Ms(i(i({},a),{},{inclusive:As(ws(t,"inclusive",o)),excludes:As(ws(t,"excludes",o)),group:As(ws(t,"group",o)),spanning:As(ws(t,"spanning",o)),code:As(ws(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=As(ws(t,"parseHTML",o));u&&(s.parseDOM=u.map((function(e){return js(e,r)})));var l=ws(t,"renderHTML",o);return l&&(s.toDOM=function(e){return l({mark:e,HTMLAttributes:Os(e,r)})}),[t.name,s]})));return new ut({topNode:s,nodes:u,marks:l})}function Ts(e,t){return t.nodes[e]||t.marks[e]||null}function Fs(e,t){return Array.isArray(t)?t.some((function(t){return("string"===typeof t?t:t.name)===e.name})):t}function Ps(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Rs=k((function e(t){y(this,e),this.find=t.find,this.handler=t.handler}));function Bs(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(Ps(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=ys({state:u.state,transaction:a}),d={from:r-(t[0].length-i.length),to:o},p=new bs({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 Is(e){var t=e.editor,n=e.rules,r=new Fn({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 Bs({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&&Bs({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&&Bs({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var Ls=k((function e(t){y(this,e),this.find=t.find,this.handler=t.handler}));function zs(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=new bs({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(Ps(t))return B(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 _s=function(){function e(t,n){var r=this;y(this,e),this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=Ns(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:Ts(e.name,r.schema)};"mark"===e.type&&((null===(t=As(ws(e,"keepOnSplit",n)))||void 0===t||t)&&r.splittableMarks.push(e.name));var o=ws(e,"onBeforeCreate",n);o&&r.editor.on("beforeCreate",o);var i=ws(e,"onCreate",n);i&&r.editor.on("create",i);var a=ws(e,"onUpdate",n);a&&r.editor.on("update",a);var s=ws(e,"onSelectionUpdate",n);s&&r.editor.on("selectionUpdate",s);var u=ws(e,"onTransaction",n);u&&r.editor.on("transaction",u);var l=ws(e,"onFocus",n);l&&r.editor.on("focus",l);var c=ws(e,"onBlur",n);c&&r.editor.on("blur",c);var f=ws(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=ws(n,"addCommands",{name:n.name,options:n.options,storage:n.storage,editor:e.editor,type:Ts(n.name,e.schema)});return r?i(i({},t),r()):t}),{})}},{key:"plugins",get:function(){var t=this,n=this.editor,r=e.sort(B(this.extensions).reverse()),o=[],i=[],a=r.map((function(e){var r={name:e.name,options:e.options,storage:e.storage,editor:n,type:Ts(e.name,t.schema)},a=[],s=ws(e,"addKeyboardShortcuts",r);if(s){var u=function(e){return new Fn({props:{handleKeyDown:na(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=ws(e,"addInputRules",r);Fs(e,n.options.enableInputRules)&&l&&o.push.apply(o,B(l()));var c=ws(e,"addPasteRules",r);Fs(e,n.options.enablePasteRules)&&c&&i.push.apply(i,B(c()));var f=ws(e,"addProseMirrorPlugins",r);if(f){var d=f();a.push.apply(a,B(d))}return a})).flat();return[Is({editor:n,rules:o})].concat(B(function(e){var t=e.editor,n=e.rules,r=null,o=!1,i=!1;return n.map((function(e){return new Fn({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=ys({state:a,transaction:d});if(zs({editor:t,state:p,from:Math.max(c-1,0),to:f.b,rule:e})&&d.steps.length)return d}}}})}))}({editor:n,rules:i})),B(a))}},{key:"attributes",get:function(){return Ds(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=xs(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(e){return!!ws(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:Cs(n.name,e.schema)},i=ws(n,"addNodeView",o);if(!i)return[];return[n.name,function(e,o,a,s){var u=Os(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 B(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=ws(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e].concat(B(t.flatten(n()))):e})).flat(10)}},{key:"sort",value:function(e){return e.sort((function(e,t){var n=ws(e,"priority")||100,r=ws(t,"priority")||100;return n>r?-1:n<r?1:0}))}}]),e}();function Vs(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function $s(e,t){var n=i({},e);return Vs(e)&&Vs(t)&&Object.keys(t).forEach((function(o){Vs(t[o])&&o in e?n[o]=$s(e[o],t[o]):Object.assign(n,r({},o,t[o]))})),n}var Hs=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=As(ws(this,"addOptions",{name:this.name}))),this.storage=As(ws(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=$s(this.options,e),t.storage=As(ws(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=As(ws(n,"addOptions",{name:n.name})),n.storage=As(ws(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 Us(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 Ws(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 qs=Hs.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var e=this;return[new Fn({key:new Bn("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,B(i.map((function(e){return e.$from.pos})))),s=Math.max.apply(Math,B(i.map((function(e){return e.$to.pos}))));return Us(o,{from:a,to:s},{textSerializers:Ws(r)})}}})]}});function Js(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]:Ps(t[r])?t[r].test(e[r]):t[r]===e[r]}))}function Ks(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find((function(e){return e.type===t&&Js(e.attrs,n)}))}function Qs(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!Ks(e,t,n)}function Gs(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=Ks(B(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(Ks(B(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&&Qs(B(e.parent.child(s).marks),t,n);)u+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}}}}function Ys(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 Xs(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 Zs(e){return Xs(e)&&e instanceof yn}function eu(){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 tu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=hn.atStart(e),r=hn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?yn.create(e,eu(0,o,i),eu(e.content.size,o,i)):yn.create(e,eu(t,o,i),eu(t,o,i))}function nu(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ru(e){var t="<body>".concat(e,"</body>");return(new window.DOMParser).parseFromString(t,"text/html").body}function ou(e,t,n){if(n=i({slice:!0,parseOptions:{}},n),"object"===typeof e&&null!==e)try{return Array.isArray(e)?ke.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),ou("",t,n)}if("string"===typeof e){var r=ct.fromSchema(t);return n.slice?r.parseSlice(ru(e),n.parseOptions).content:r.parse(ru(e),n.parseOptions)}return ou("",t,n)}function iu(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function au(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?Cs(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 Js(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 su(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function uu(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 lu(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ou(e,t,{slice:!1,parseOptions:n})}function cu(e,t){var n=Ys(t,e.schema),r=e.selection,o=r.from,a=r.to,s=r.empty,u=[];s?(e.storedMarks&&u.push.apply(u,B(e.storedMarks)),u.push.apply(u,B(e.selection.$head.marks()))):e.doc.nodesBetween(o,a,(function(e){u.push.apply(u,B(e.marks))}));var l=u.find((function(e){return e.type.name===n.name}));return l?i({},l.attrs):{}}function fu(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 du(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 pu(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 hu(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 mu(e,t){var n=xs(t).nodeExtensions.find((function(t){return t.name===e}));if(!n)return!1;var r=As(ws(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"===typeof r&&r.split(" ").includes("list")}var vu=function(e,t){var n=hu((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)||!Ea(e.doc,n.pos)||(e.join(n.pos),!0)},gu=function(e,t){var n=hu((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)||!Ea(e.doc,r)||(e.join(r),!0)};function yu(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?Ys(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 Js(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,B(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 Js(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 bu=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=function(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||!ga(r,o,i))break}return null}(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 Za(t,n)}},deleteNode:function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=Cs(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 Va(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 Xa(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=Ys(e,o.schema),s=r.doc,u=r.selection,l=u.$from,c=u.from,f=u.to;if(i){var d=Gs(l,a,t);if(d&&d.from<=c&&d.to>=f){var p=yn.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(){nu()&&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&&!Zs(r.state.selection))return u(),!0;var l=tu(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=ou(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 ha||o instanceof ma){var i=e.mapping.maps[r],a=0;i.forEach((function(e,t,n,r){0===a&&(a=r)})),e.setSelection(hn.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 $a(t,n)}},joinForward:function(){return function(e){var t=e.state,n=e.dispatch;return qa(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));nu()||iu()?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!!au(r,Cs(e,r.schema),t)&&Qa(r,o)}},liftEmptyBlock:function(){return function(e){var t=e.state,n=e.dispatch;return es(t,n)}},liftListItem:function(e){return function(t){var n=t.state,r=t.dispatch;return gs(Cs(e,n.schema))(n,r)}},newlineInCode:function(){return function(e){var t=e.state,n=e.dispatch;return Ga(t,n)}},resetAttributes:function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=su("string"===typeof e?e:e.name,o.schema);return!!u&&("node"===u&&(a=Cs(e,o.schema)),"mark"===u&&(s=Ys(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,uu(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((function(o){s===o.type&&r.addMark(n,n+e.nodeSize,s.create(uu(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 Ua(t,n)}},selectNodeForward:function(){return function(e){var t=e.state,n=e.dispatch;return Ja(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(kn.create(e.doc,n))),!0)}(e.state,e.dispatch)}},selectTextblockEnd:function(){return function(e){var t=e.state,n=e.dispatch;return as(t,n)}},selectTextblockStart:function(){return function(e){var t=e.state,n=e.dispatch;return is(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=lu(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=Ys(e,o.schema);if(a)if(u){var f=cu(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=Cs(e,r.schema);return a.isTextblock?i().command((function(e){var n=e.commands;return!!us(a,t)(r)||n.clearNodes()})).command((function(e){var n=e.state;return us(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=hn.atStart(r).from,i=hn.atEnd(r).to,a=eu(e,o,i),s=kn.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=yn.atStart(r).from,u=yn.atEnd(r).to,l=eu(i,s,u),c=eu(a,s,u),f=yn.create(r,l,c);n.setSelection(f)}return!0}},sinkListItem:function(e){return function(t){var n,r=t.state,o=t.dispatch,i=Cs(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=ke.from(c?n.create():null),d=new Oe(ke.from(n.create(null,ke.from(u.type.create(null,f)))),c?3:1,0),p=a.start,h=a.end;t(e.tr.step(new It(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=fu(i.extensionManager.attributes,u.node().type.name,u.node().attrs);if(a instanceof kn&&a.node.isBlock)return!(!u.parentOffset||!Da(s,u.pos))&&(o&&(n&&pu(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 yn&&t.deleteSelection();var d=0===u.depth?void 0:du(u.node(-1).contentMatchAt(u.indexAfter(-1))),p=f&&d?[{type:d,attrs:c}]:void 0,h=Da(t.doc,t.mapping.map(u.pos),1,p);if(p||h||!Da(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&&pu(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=Cs(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=ke.empty,m=l.index(-1)?1:l.index(-2)?2:3,v=l.depth-m;v>=l.depth-3;v-=1)h=ke.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=fu(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(ke.from(s.createAndFill(null,b)||void 0));var k=l.before(l.depth-(m-1));r.replace(k,l.after(-g),new Oe(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(yn.near(r.doc.resolve(w))),r.scrollIntoView()}return!0}var x=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,D=fu(p,d.type.name,d.attrs),C=fu(p,l.node().type.name,l.node().attrs);r.delete(l.pos,c.pos);var E=x?[{type:s,attrs:D},{type:x,attrs:C}]:[{type:s,attrs:D}];return!!Da(r.doc,l.pos,2)&&(i&&r.split(l.pos,2,E).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=Cs(e,i.schema),d=Cs(t,i.schema),p=i.selection,h=p.$from,m=p.$to,v=h.blockRange(m);if(!v)return!1;var g=hu((function(e){return mu(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(mu(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 vu(o,f)})).command((function(){return gu(o,f)})).run()}return s().command((function(){return!!l().wrapInList(f)||u.clearNodes()})).wrapInList(f).command((function(){return vu(o,f)})).command((function(){return gu(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=Ys(e,o.schema);return yu(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=Cs(e,o.schema),s=Cs(t,o.schema);return au(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=Cs(e,r.schema);return au(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=Ys(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=Gs(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=su("string"===typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(s=Cs(e,o.schema)),"mark"===l&&(u=Ys(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 ss(Cs(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 ms(Cs(e,r.schema),t)(r,o)}}}),ku=Hs.create({name:"commands",addCommands:function(){return i({},bu)}}),wu=Hs.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new Fn({key:new Bn("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),xu=Hs.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new Fn({key:new Bn("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}}}})]}}),Du=Hs.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=hn.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 nu()||iu()?a:o},addProseMirrorPlugins:function(){var e=this;return[new Fn({key:new Bn("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=hn.atStart(n.doc).from,l=hn.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=ys({state:r,transaction:d});if(new bs({editor:e.editor,state:p}).commands.clearNodes(),d.steps.length)return d}}}})]}}),Cu=Hs.create({name:"tabindex",addProseMirrorPlugins:function(){return[new Fn({key:new Bn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Eu=Object.freeze({__proto__:null,ClipboardTextSerializer:qs,Commands:ku,Editable:wu,FocusEvents:xu,Keymap:Du,Tabindex:Cu});function Ou(e,t){var n=su("string"===typeof t?t:t.name,e.schema);return"node"===n?function(e,t){var n=Cs(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?cu(e,t):{}}function Su(e,t){var n=kt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Au(e,t){return Us(e,{from:0,to:e.content.size},t)}var ju=function(e){D(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:w(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:w(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=Ss(t)?t(e,B(this.state.plugins)):[].concat(B(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(Eu):[],t=[].concat(B(e),B(this.options.extensions)).filter((function(e){return["extension","node","mark"].includes(null===e||void 0===e?void 0:e.type)}));this.extensionManager=new _s(t,this)}},{key:"createCommandManager",value:function(){this.commandManager=new bs({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var e=lu(this.options.content,this.schema,this.options.parseOptions),t=tu(e,this.options.autofocus);this.view=new zi(this.options.element,i(i({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:Nn.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 Ou(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 au(e,null,n)||yu(e,null,n);var r=su(t,e.schema);return"node"===r?au(e,t,n):"mark"===r&&yu(e,t,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Su(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 Au(this.state.doc,{blockSeparator:r,textSerializers:i(i({},a),Ws(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}(ks);function Mu(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 Nu(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach((function(t){var o=Gs(n.resolve(e-1),t.type);o&&r.push(i({mark:t},o))})):n.nodesBetween(e,t,(function(e,t){r.push.apply(r,B(e.marks.map((function(n){return{from:t,to:t+e.nodeSize,mark:n}}))))})),r}function Tu(e,t,n){var r=e.state.doc.content.size,o=eu(t,0,r),a=eu(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}})}function Fu(e){return new Rs({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=As(e.getAttributes,void 0,o)||{},a=n.tr.delete(r.from,r.to),s=a.doc.resolve(r.from).blockRange(),u=s&&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]:e,o=ba(e,t),i=o&&ka(r,t);return i?o.map(ya).concat({type:t,attrs:n}).concat(i.map(ya)):null}(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&&Ea(a.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,l))&&a.join(r.from-1)}})}var Pu=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=As(ws(this,"addOptions",{name:this.name}))),this.storage=As(ws(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=$s(this.options,e),t.storage=As(ws(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=As(ws(n,"addOptions",{name:n.name})),n.storage=As(ws(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}(),Ru=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=As(ws(this,"addOptions",{name:this.name}))),this.storage=As(ws(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=$s(this.options,e),t.storage=As(ws(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=As(ws(n,"addOptions",{name:n.name})),n.storage=As(ws(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 Bu(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Iu(e){return e instanceof Bu(e).Element||e instanceof Element}function Lu(e){return e instanceof Bu(e).HTMLElement||e instanceof HTMLElement}function zu(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Bu(e).ShadowRoot||e instanceof ShadowRoot)}var _u=Math.max,Vu=Math.min,$u=Math.round;function Hu(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Uu(){return!/^((?!chrome|android).)*safari/i.test(Hu())}function Wu(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Lu(e)&&(o=e.offsetWidth>0&&$u(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&$u(r.height)/e.offsetHeight||1);var a=(Iu(e)?Bu(e):window).visualViewport,s=!Uu()&&n,u=(r.left+(s&&a?a.offsetLeft:0))/o,l=(r.top+(s&&a?a.offsetTop:0))/i,c=r.width/o,f=r.height/i;return{width:c,height:f,top:l,right:u+c,bottom:l+f,left:u,x:u,y:l}}function qu(e){var t=Bu(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ju(e){return e?(e.nodeName||"").toLowerCase():null}function Ku(e){return((Iu(e)?e.ownerDocument:e.document)||window.document).documentElement}function Qu(e){return Wu(Ku(e)).left+qu(e).scrollLeft}function Gu(e){return Bu(e).getComputedStyle(e)}function Yu(e){var t=Gu(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Xu(e,t,n){void 0===n&&(n=!1);var r=Lu(t),o=Lu(t)&&function(e){var t=e.getBoundingClientRect(),n=$u(t.width)/e.offsetWidth||1,r=$u(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=Ku(t),a=Wu(e,o,n),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==Ju(t)||Yu(i))&&(s=function(e){return e!==Bu(e)&&Lu(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:qu(e);var t}(t)),Lu(t)?((u=Wu(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=Qu(i))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function Zu(e){var t=Wu(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 el(e){return"html"===Ju(e)?e:e.assignedSlot||e.parentNode||(zu(e)?e.host:null)||Ku(e)}function tl(e){return["html","body","#document"].indexOf(Ju(e))>=0?e.ownerDocument.body:Lu(e)&&Yu(e)?e:tl(el(e))}function nl(e,t){var n;void 0===t&&(t=[]);var r=tl(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Bu(r),a=o?[i].concat(i.visualViewport||[],Yu(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(nl(el(a)))}function rl(e){return["table","td","th"].indexOf(Ju(e))>=0}function ol(e){return Lu(e)&&"fixed"!==Gu(e).position?e.offsetParent:null}function il(e){for(var t=Bu(e),n=ol(e);n&&rl(n)&&"static"===Gu(n).position;)n=ol(n);return n&&("html"===Ju(n)||"body"===Ju(n)&&"static"===Gu(n).position)?t:n||function(e){var t=/firefox/i.test(Hu());if(/Trident/i.test(Hu())&&Lu(e)&&"fixed"===Gu(e).position)return null;var n=el(e);for(zu(n)&&(n=n.host);Lu(n)&&["html","body"].indexOf(Ju(n))<0;){var r=Gu(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 al="top",sl="bottom",ul="right",ll="left",cl="auto",fl=[al,sl,ul,ll],dl="start",pl="end",hl="viewport",ml="popper",vl=fl.reduce((function(e,t){return e.concat([t+"-"+dl,t+"-"+pl])}),[]),gl=[].concat(fl,[cl]).reduce((function(e,t){return e.concat([t,t+"-"+dl,t+"-"+pl])}),[]),yl=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function bl(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 kl(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var wl={placement:"bottom",modifiers:[],strategy:"absolute"};function xl(){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 Dl(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?wl:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},wl,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:Iu(e)?nl(e):e.contextElement?nl(e.contextElement):[],popper:nl(t)};var c=function(e){var t=bl(e);return yl.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(xl(t,n)){o.rects={reference:Xu(t,il(n),"fixed"===o.options.strategy),popper:Zu(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:kl((function(){return new Promise((function(e){u.forceUpdate(),e(o)}))})),destroy:function(){l(),s=!0}};if(!xl(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 Cl={passive:!0};function El(e){return e.split("-")[0]}function Ol(e){return e.split("-")[1]}function Sl(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Al(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?El(o):null,a=o?Ol(o):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(i){case al:t={x:s,y:n.y-r.height};break;case sl:t={x:s,y:n.y+n.height};break;case ul:t={x:n.x+n.width,y:u};break;case ll:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var l=i?Sl(i):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case dl:t[l]=t[l]-(n[c]/2-r[c]/2);break;case pl:t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}var jl={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ml(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=ll,k=al,w=window;if(l){var x=il(n),D="clientHeight",C="clientWidth";if(x===Bu(n)&&"static"!==Gu(x=Ku(n)).position&&"absolute"===s&&(D="scrollHeight",C="scrollWidth"),o===al||(o===ll||o===ul)&&i===pl)k=sl,m-=(f&&x===w&&w.visualViewport?w.visualViewport.height:x[D])-r.height,m*=u?1:-1;if(o===ll||(o===al||o===sl)&&i===pl)b=ul,p-=(f&&x===w&&w.visualViewport?w.visualViewport.width:x[C])-r.width,p*=u?1:-1}var E,O=Object.assign({position:s},l&&jl),S=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:$u(t*r)/r||0,y:$u(n*r)/r||0}}({x:p,y:m}):{x:p,y:m};return p=S.x,m=S.y,u?Object.assign({},O,((E={})[k]=y?"0":"",E[b]=g?"0":"",E.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",E)):Object.assign({},O,((t={})[k]=y?m+"px":"",t[b]=g?p+"px":"",t.transform="",t))}var Nl={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];Lu(o)&&Ju(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}),{});Lu(r)&&Ju(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var Tl={left:"right",right:"left",bottom:"top",top:"bottom"};function Fl(e){return e.replace(/left|right|bottom|top/g,(function(e){return Tl[e]}))}var Pl={start:"end",end:"start"};function Rl(e){return e.replace(/start|end/g,(function(e){return Pl[e]}))}function Bl(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&zu(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Il(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ll(e,t,n){return t===hl?Il(function(e,t){var n=Bu(e),r=Ku(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;var l=Uu();(l||!l&&"fixed"===t)&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s+Qu(e),y:u}}(e,n)):Iu(t)?function(e,t){var n=Wu(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):Il(function(e){var t,n=Ku(e),r=qu(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=_u(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=_u(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Qu(e),u=-r.scrollTop;return"rtl"===Gu(o||n).direction&&(s+=_u(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}(Ku(e)))}function zl(e,t,n,r){var o="clippingParents"===t?function(e){var t=nl(el(e)),n=["absolute","fixed"].indexOf(Gu(e).position)>=0&&Lu(e)?il(e):e;return Iu(n)?t.filter((function(e){return Iu(e)&&Bl(e,n)&&"body"!==Ju(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=Ll(e,n,r);return t.top=_u(o.top,t.top),t.right=Vu(o.right,t.right),t.bottom=Vu(o.bottom,t.bottom),t.left=_u(o.left,t.left),t}),Ll(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function _l(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Vl(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function $l(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,u=void 0===s?"clippingParents":s,l=n.rootBoundary,c=void 0===l?hl:l,f=n.elementContext,d=void 0===f?ml:f,p=n.altBoundary,h=void 0!==p&&p,m=n.padding,v=void 0===m?0:m,g=_l("number"!==typeof v?v:Vl(v,fl)),y=d===ml?"reference":ml,b=e.rects.popper,k=e.elements[h?y:d],w=zl(Iu(k)?k:k.contextElement||Ku(e.elements.popper),u,c,a),x=Wu(e.elements.reference),D=Al({reference:x,element:b,strategy:"absolute",placement:o}),C=Il(Object.assign({},b,D)),E=d===ml?C:x,O={top:w.top-E.top+g.top,bottom:E.bottom-w.bottom+g.bottom,left:w.left-E.left+g.left,right:E.right-w.right+g.right},S=e.modifiersData.offset;if(d===ml&&S){var A=S[o];Object.keys(O).forEach((function(e){var t=[ul,sl].indexOf(e)>=0?1:-1,n=[al,sl].indexOf(e)>=0?"y":"x";O[e]+=A[n]*t}))}return O}function Hl(e,t,n){return _u(e,Vu(t,n))}function Ul(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 Wl(e){return[al,ul,sl,ll].some((function(t){return e[t]>=0}))}var ql=Dl({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=Bu(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach((function(e){e.addEventListener("scroll",n.update,Cl)})),s&&u.addEventListener("resize",n.update,Cl),function(){i&&l.forEach((function(e){e.removeEventListener("scroll",n.update,Cl)})),s&&u.removeEventListener("resize",n.update,Cl)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Al({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:El(t.placement),variation:Ol(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,Ml(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,Ml(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:{}},Nl,{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=gl.reduce((function(e,n){return e[n]=function(e,t,n){var r=El(e),o=[ll,al].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,[ll,ul].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=El(v),y=u||(g===v||!h?[Fl(v)]:function(e){if(El(e)===cl)return[];var t=Fl(e);return[Rl(e),t,Rl(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(El(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?gl:u,c=Ol(r),f=c?s?vl:vl.filter((function(e){return Ol(e)===c})):fl,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]=$l(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[El(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,C=b[0],E=0;E<b.length;E++){var O=b[E],S=El(O),A=Ol(O)===dl,j=[al,sl].indexOf(S)>=0,M=j?"width":"height",N=$l(t,{placement:O,boundary:c,rootBoundary:f,altBoundary:d,padding:l}),T=j?A?ul:ll:A?sl:al;k[M]>w[M]&&(T=Fl(T));var F=Fl(T),P=[];if(i&&P.push(N[S]<=0),s&&P.push(N[T]<=0,N[F]<=0),P.every((function(e){return e}))){C=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 C=t,"break"},B=h?3:1;B>0;B--){if("break"===R(B))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,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=$l(t,{boundary:u,rootBoundary:l,padding:f,altBoundary:c}),g=El(t.placement),y=Ol(t.placement),b=!y,k=Sl(g),w="x"===k?"y":"x",x=t.modifiersData.popperOffsets,D=t.rects.reference,C=t.rects.popper,E="function"===typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,O="number"===typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(x){if(i){var j,M="y"===k?al:ll,N="y"===k?sl:ul,T="y"===k?"height":"width",F=x[k],P=F+v[M],R=F-v[N],B=p?-C[T]/2:0,I=y===dl?D[T]:C[T],L=y===dl?-C[T]:-D[T],z=t.elements.arrow,_=p&&z?Zu(z):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=V[M],H=V[N],U=Hl(0,D[T],_[T]),W=b?D[T]/2-B-U-$-O.mainAxis:I-U-$-O.mainAxis,q=b?-D[T]/2+B+U+H+O.mainAxis:L+U+H+O.mainAxis,J=t.elements.arrow&&il(t.elements.arrow),K=J?"y"===k?J.clientTop||0:J.clientLeft||0:0,Q=null!=(j=null==S?void 0:S[k])?j:0,G=F+q-Q,Y=Hl(p?Vu(P,F+W-Q-K):P,F,p?_u(R,G):R);x[k]=Y,A[k]=Y-F}if(s){var X,Z="x"===k?al:ll,ee="x"===k?sl:ul,te=x[w],ne="y"===w?"height":"width",re=te+v[Z],oe=te-v[ee],ie=-1!==[al,ll].indexOf(g),ae=null!=(X=null==S?void 0:S[w])?X:0,se=ie?re:te-D[ne]-C[ne]-ae+O.altAxis,ue=ie?te+D[ne]+C[ne]-ae-O.altAxis:oe,le=p&&ie?function(e,t,n){var r=Hl(e,t,n);return r>n?n:r}(se,te,ue):Hl(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=El(n.placement),u=Sl(s),l=[ll,ul].indexOf(s)>=0?"height":"width";if(i&&a){var c=function(e,t){return _l("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Vl(e,fl))}(o.padding,n),f=Zu(i),d="y"===u?al:ll,p="y"===u?sl:ul,h=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],m=a[u]-n.rects.reference[u],v=il(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=Hl(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)))&&Bl(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=$l(t,{elementContext:"reference"}),s=$l(t,{altBoundary:!0}),u=Ul(a,r),l=Ul(s,o,i),c=Wl(u),f=Wl(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})}}]}),Jl="tippy-content",Kl="tippy-backdrop",Ql="tippy-arrow",Gl="tippy-svg-arrow",Yl={passive:!0,capture:!0},Xl=function(){return document.body};function Zl(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function ec(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function tc(e,t){return"function"===typeof e?e.apply(void 0,t):e}function nc(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function rc(e){return[].concat(e)}function oc(e,t){-1===e.indexOf(t)&&e.push(t)}function ic(e){return e.split("-")[0]}function ac(e){return[].slice.call(e)}function sc(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function uc(){return document.createElement("div")}function lc(e){return["Element","Fragment"].some((function(t){return ec(e,t)}))}function cc(e){return ec(e,"MouseEvent")}function fc(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function dc(e){return lc(e)?[e]:function(e){return ec(e,"NodeList")}(e)?ac(e):Array.isArray(e)?e:ac(document.querySelectorAll(e))}function pc(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function hc(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function mc(e){var t,n=rc(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function vc(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function gc(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 yc={isTouch:!1},bc=0;function kc(){yc.isTouch||(yc.isTouch=!0,window.performance&&document.addEventListener("mousemove",wc))}function wc(){var e=performance.now();e-bc<20&&(yc.isTouch=!1,document.removeEventListener("mousemove",wc)),bc=e}function xc(){var e=document.activeElement;if(fc(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Dc=!!("undefined"!==typeof window&&"undefined"!==typeof document)&&!!window.msCrypto;var Cc={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Ec=Object.assign({appendTo:Xl,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},Cc,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Oc=Object.keys(Ec);function Sc(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=Ec[o])?r:i);return t}),{});return Object.assign({},e,t)}function Ac(e,t){var n=Object.assign({},t,{content:tc(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Sc(Object.assign({},Ec,{plugins:t}))):Oc).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(Rd){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ec.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 jc(e,t){e.innerHTML=t}function Mc(e){var t=uc();return!0===e?t.className=Ql:(t.className=Gl,lc(e)?t.appendChild(e):jc(t,e)),t}function Nc(e,t){lc(t.content)?(jc(e,""),e.appendChild(t.content)):"function"!==typeof t.content&&(t.allowHTML?jc(e,t.content):e.textContent=t.content)}function Tc(e){var t=e.firstElementChild,n=ac(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(Jl)})),arrow:n.find((function(e){return e.classList.contains(Ql)||e.classList.contains(Gl)})),backdrop:n.find((function(e){return e.classList.contains(Kl)}))}}function Fc(e){var t=uc(),n=uc();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=uc();function o(n,r){var o=Tc(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||Nc(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(i.removeChild(s),i.appendChild(Mc(r.arrow))):i.appendChild(Mc(r.arrow)):s&&i.removeChild(s)}return r.className=Jl,r.setAttribute("data-state","hidden"),Nc(r,e.props),t.appendChild(n),n.appendChild(r),o(e.props,e.props),{popper:t,onUpdate:o}}Fc.$$tippy=!0;var Pc=1,Rc=[],Bc=[];function Ic(e,t){var n,r,o,i,a,s,u,l,c=Ac(e,Object.assign({},Ec,Sc(sc(t)))),f=!1,d=!1,p=!1,h=!1,m=[],v=nc(J,c.interactiveDebounce),g=Pc++,y=(l=c.plugins).filter((function(e,t){return l.indexOf(e)===t})),b={id:g,reference:e,popper:uc(),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=Ac(e,Object.assign({},n,sc(t),{ignoreAttributes:!0}));b.props=r,U(),n.interactiveDebounce!==r.interactiveDebounce&&(B(),v=nc(J,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?rc(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=yc.isTouch&&!b.props.touch,o=Zl(b.props.duration,0,Ec.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=M(),a=i.box,u=i.content;pc([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=M(),n=t.box,r=t.content;pc([n,r],o),hc([n,r],"visible")}P(),R(),oc(Bc,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===Xl||"parent"===t?n.parentNode:tc(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=Zl(b.props.duration,1,Ec.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=M(),i=o.box,a=o.content;b.props.animation&&(pc([i,a],r),hc([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),oc(Rc,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);Bc=Bc.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)})),C=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 E(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function O(){return"hold"===E()[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?mc(e):document}function M(){return Tc(w)}function N(e){return b.state.isMounted&&!b.state.isVisible||yc.isTouch||i&&"focus"===i.type?0:Zl(b.props.delay,e?0:1,Ec.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;rc(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(){!C&&b.props.aria.expanded&&rc(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),Rc=Rc.filter((function(e){return e!==v}))}function I(t){if(!yc.isTouch||!p&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!gc(w,n)){if(rc(b.props.triggerTarget||e).some((function(e){return gc(e,n)}))){if(yc.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 L(){p=!0}function z(){p=!1}function _(){var e=j();e.addEventListener("mousedown",I,!0),e.addEventListener("touchend",I,Yl),e.addEventListener("touchstart",z,Yl),e.addEventListener("touchmove",L,Yl)}function V(){var e=j();e.removeEventListener("mousedown",I,!0),e.removeEventListener("touchend",I,Yl),e.removeEventListener("touchstart",z,Yl),e.removeEventListener("touchmove",L,Yl)}function $(e,t){var n=M().box;function r(e){e.target===n&&(vc(n,"remove",r),t())}if(0===e)return t();vc(n,"remove",a),vc(n,"add",r),a=r}function H(t,n,r){void 0===r&&(r=!1),rc(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",K,{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",K);break;case"focus":H(Dc?"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)&&Rc.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 J(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=ic(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 K(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!!yc.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()?Tc(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=M().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=ql(l,w,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function X(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return ac(w.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&F("onTrigger",[b,e]),_();var t=N(!0),r=E(),o=r[0],i=r[1];yc.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=N(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):o=requestAnimationFrame((function(){b.hide()}))}}else V()}}function Lc(e,t){void 0===t&&(t={});var n=Ec.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kc,Yl),window.addEventListener("blur",xc);var r=Object.assign({},t,{plugins:n}),o=dc(e).reduce((function(e,t){var n=t&&Ic(t,r);return n&&e.push(n),e}),[]);return lc(e)?o[0]:o}Lc.defaultProps=Ec,Lc.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ec[t]=e[t]}))},Lc.currentInput=yc;Object.assign({},Nl,{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)}});Lc.setDefaultProps({render:Fc});var zc=Lc,_c=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&&Zs(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=zc(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,B(c.map((function(e){return e.$from.pos})))),d=Math.max.apply(Math,B(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(Xs(n=i.selection)&&n instanceof kn){var t=e.nodeDOM(f);if(t)return t.getBoundingClientRect()}var n;return Tu(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}(),Vc=function(e){return new Fn({key:"string"===typeof e.pluginKey?new Bn(e.pluginKey):e.pluginKey,view:function(t){return new _c(i({view:t},e))}})},$c=(Hs.create({name:"bubbleMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[Vc({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=zc(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 Tu(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}()),Hc=function(e){return new Fn({key:"string"===typeof e.pluginKey?new Bn(e.pluginKey):e.pluginKey,view:function(t){return new $c(i({view:t},e))}})},Uc=(Hs.create({name:"floatingMenu",addOptions:function(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins:function(){return this.options.element?[Hc({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),["editor"]),Wc=function(e){D(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)}(ju),qc=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)})))},Jc=function(e){D(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,B(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,B(e.options.element.childNodes)),e.setOptions({element:t})}}},{key:"render",value:function(){var e=this.props,t=(e.editor,a(e,Uc));return u.a.createElement(u.a.Fragment,null,u.a.createElement("div",i({ref:this.editorContentRef},t)),u.a.createElement(qc,{renderers:this.state.renderers}))}}]),n}(u.a.Component),Kc=u.a.memo(Jc),Qc=Object(s.createContext)({onDragStart:void 0}),Gc=function(){return Object(s.useContext)(Qc)};u.a.forwardRef((function(e,t){var n=Gc().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 Yc(){var e=p(Object(s.useState)(0),2)[1];return function(){return e((function(e){return e+1}))}}var Xc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(s.useState)(null),r=p(n,2),o=r[0],i=r[1],a=Yc();return Object(s.useEffect)((function(){var t=!0,n=new Wc(e);return i(n),n.on("transaction",(function(){requestAnimationFrame((function(){requestAnimationFrame((function(){t&&a()}))}))})),function(){n.destroy(),t=!1}}),t),o},Zc=Hs.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 Fn({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=vi.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})),bi.create(n,a)):null}}})]}}),ef=Ru.create({name:"text",group:"inline"});function tf(e){this.j={},this.jr=[],this.jd=null,this.t=e}tf.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=nf();var o=sf(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 nf=function(){return new tf},rf=function(e){return new tf(e)},of=function(e,t,n){e.j[t]||(e.j[t]=n)},af=function(e,t,n){e.jr.push([t,n])},sf=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},uf=function(e,t,n){for(var r=0;r<t.length;r++)of(e,t[r],n)},lf=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0],o=t[n][1];of(e,r,o)}},cf=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(),of(e,t[i],o),e=o,i++;of(e,t[a-1],n)},ff="DOMAIN",df="LOCALHOST",pf="TLD",hf="NUM",mf="PROTOCOL",vf="MAILTO",gf="WS",yf="NL",bf="OPENBRACE",kf="OPENBRACKET",wf="OPENANGLEBRACKET",xf="OPENPAREN",Df="CLOSEBRACE",Cf="CLOSEBRACKET",Ef="CLOSEANGLEBRACKET",Of="CLOSEPAREN",Sf="AMPERSAND",Af="APOSTROPHE",jf="ASTERISK",Mf="AT",Nf="BACKSLASH",Tf="BACKTICK",Ff="CARET",Pf="COLON",Rf="COMMA",Bf="DOLLAR",If="DOT",Lf="EQUALS",zf="EXCLAMATION",_f="HYPHEN",Vf="PERCENT",$f="PIPE",Hf="PLUS",Uf="POUND",Wf="QUERY",qf="QUOTE",Jf="SEMI",Kf="SLASH",Qf="TILDE",Gf="UNDERSCORE",Yf="SYM",Xf=Object.freeze({__proto__:null,DOMAIN:ff,LOCALHOST:df,TLD:pf,NUM:hf,PROTOCOL:mf,MAILTO:vf,WS:gf,NL:yf,OPENBRACE:bf,OPENBRACKET:kf,OPENANGLEBRACKET:wf,OPENPAREN:xf,CLOSEBRACE:Df,CLOSEBRACKET:Cf,CLOSEANGLEBRACKET:Ef,CLOSEPAREN:Of,AMPERSAND:Sf,APOSTROPHE:Af,ASTERISK:jf,AT:Mf,BACKSLASH:Nf,BACKTICK:Tf,CARET:Ff,COLON:Pf,COMMA:Rf,DOLLAR:Bf,DOT:If,EQUALS:Lf,EXCLAMATION:zf,HYPHEN:_f,PERCENT:Vf,PIPE:$f,PLUS:Hf,POUND:Uf,QUERY:Wf,QUOTE:qf,SEMI:Jf,SLASH:Kf,TILDE:Qf,UNDERSCORE:Gf,SYM:Yf}),Zf="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(" "),ed=/(?:[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])/,td=/(?:[#\*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])/,nd=/\uFE0F/,rd=/\d/,od=/\s/;function id(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=nf(),n=rf(hf),r=rf(ff),o=nf(),i=rf(gf),a=[[rd,r],[ed,r],[td,r],[nd,r]],s=function(){var e=rf(ff);return e.j={"-":o},e.jr=[].concat(a),e},u=function(e){var t=s();return t.t=e,t};lf(t,[["'",rf(Af)],["{",rf(bf)],["[",rf(kf)],["<",rf(wf)],["(",rf(xf)],["}",rf(Df)],["]",rf(Cf)],[">",rf(Ef)],[")",rf(Of)],["&",rf(Sf)],["*",rf(jf)],["@",rf(Mf)],["`",rf(Tf)],["^",rf(Ff)],[":",rf(Pf)],[",",rf(Rf)],["$",rf(Bf)],[".",rf(If)],["=",rf(Lf)],["!",rf(zf)],["-",rf(_f)],["%",rf(Vf)],["|",rf($f)],["+",rf(Hf)],["#",rf(Uf)],["?",rf(Wf)],['"',rf(qf)],["/",rf(Kf)],[";",rf(Jf)],["~",rf(Qf)],["_",rf(Gf)],["\\",rf(Nf)]]),of(t,"\n",rf(yf)),af(t,od,i),of(i,"\n",nf()),af(i,od,i);for(var l=0;l<Zf.length;l++)cf(t,Zf[l],u(pf),s);var c=s(),f=s(),d=s(),p=s();cf(t,"file",c,s),cf(t,"ftp",f,s),cf(t,"http",d,s),cf(t,"mailto",p,s);var h=s(),m=rf(mf),v=rf(vf);of(f,"s",h),of(f,":",m),of(d,"s",h),of(d,":",m),of(c,":",m),of(h,":",m),of(p,":",v);for(var g=s(),y=0;y<e.length;y++)cf(t,e[y],g,s);return of(g,":",m),cf(t,"localhost",u(df),s),af(t,rd,n),af(t,ed,r),af(t,td,r),af(t,nd,r),af(n,rd,n),af(n,ed,r),af(n,td,r),af(n,nd,r),of(n,"-",o),of(r,"-",o),of(o,"-",o),af(r,rd,r),af(r,ed,r),af(r,td,r),af(r,nd,r),af(o,rd,r),af(o,ed,r),af(o,td,r),af(o,nd,r),t.jd=rf(Yf),t}function ad(e){return ad="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},ad(e)}var sd={defaultProtocol:"http",events:null,format:ld,formatHref:ld,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function ud(e){e=e||{},this.defaultProtocol="defaultProtocol"in e?e.defaultProtocol:sd.defaultProtocol,this.events="events"in e?e.events:sd.events,this.format="format"in e?e.format:sd.format,this.formatHref="formatHref"in e?e.formatHref:sd.formatHref,this.nl2br="nl2br"in e?e.nl2br:sd.nl2br,this.tagName="tagName"in e?e.tagName:sd.tagName,this.target="target"in e?e.target:sd.target,this.rel="rel"in e?e.rel:sd.rel,this.validate="validate"in e?e.validate:sd.validate,this.truncate="truncate"in e?e.truncate:sd.truncate,this.className="className"in e?e.className:sd.className,this.attributes=e.attributes||sd.attributes,this.ignoreTags=[];for(var t=("ignoreTags"in e?e.ignoreTags:sd.ignoreTags),n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function ld(e){return e}ud.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(ad(o)){case"function":return o(t,n.t);case"object":return"function"===typeof(r=n.t in o?o[n.t]:sd[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 cd(){}function fd(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}(cd,n,t),n}cd.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]:sd.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var dd=fd("email",{isLink:!0}),pd=fd("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),hd=fd("text"),md=fd("nl"),vd=fd("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sd.defaultProtocol,t=this.tk,n=!1,r=!1,o=[],i=0;t[i].t===mf;)n=!0,o.push(t[i].v),i++;for(;t[i].t===Kf;)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===mf}}),gd=Object.freeze({__proto__:null,MultiToken:cd,Base:cd,createTokenClass:fd,MailtoEmail:dd,Email:pd,Text:hd,Nl:md,Url:vd});function yd(){var e=nf(),t=nf(),n=nf(),r=nf(),o=nf(),i=nf(),a=nf(),s=rf(vd),u=nf(),l=rf(vd),c=rf(vd),f=nf(),d=nf(),p=nf(),h=nf(),m=nf(),v=rf(vd),g=rf(vd),y=rf(vd),b=rf(vd),k=nf(),w=nf(),x=nf(),D=nf(),C=nf(),E=nf(),O=rf(pd),S=nf(),A=rf(pd),j=rf(dd),M=nf(),N=nf(),T=nf(),F=nf(),P=rf(md);of(e,yf,P),of(e,mf,t),of(e,vf,n),of(t,Kf,r),of(r,Kf,o),of(e,pf,i),of(e,ff,i),of(e,df,s),of(e,hf,i),of(o,pf,c),of(o,ff,c),of(o,hf,c),of(o,df,c),of(i,If,a),of(C,If,E),of(a,pf,s),of(a,ff,i),of(a,hf,i),of(a,df,i),of(E,pf,O),of(E,ff,C),of(E,hf,C),of(E,df,C),of(s,If,a),of(O,If,E),of(s,Pf,u),of(s,Kf,c),of(u,hf,l),of(l,Kf,c),of(O,Pf,S),of(S,hf,A);var R=[Sf,jf,Mf,Nf,Tf,Ff,Bf,ff,Lf,_f,df,hf,Vf,$f,Hf,Uf,mf,Kf,Yf,Qf,pf,Gf],B=[Af,Ef,Df,Cf,Of,Pf,Rf,If,zf,wf,bf,kf,xf,Wf,qf,Jf];of(c,bf,d),of(c,kf,p),of(c,wf,h),of(c,xf,m),of(f,bf,d),of(f,kf,p),of(f,wf,h),of(f,xf,m),of(d,Df,c),of(p,Cf,c),of(h,Ef,c),of(m,Of,c),of(v,Df,c),of(g,Cf,c),of(y,Ef,c),of(b,Of,c),of(k,Df,c),of(w,Cf,c),of(x,Ef,c),of(D,Of,c),uf(d,R,v),uf(p,R,g),uf(h,R,y),uf(m,R,b),uf(d,B,k),uf(p,B,w),uf(h,B,x),uf(m,B,D),uf(v,R,v),uf(g,R,g),uf(y,R,y),uf(b,R,b),uf(v,B,v),uf(g,B,g),uf(y,B,y),uf(b,B,b),uf(k,R,v),uf(w,R,g),uf(x,R,y),uf(D,R,b),uf(k,B,k),uf(w,B,w),uf(x,B,x),uf(D,B,D),uf(c,R,c),uf(f,R,c),uf(c,B,f),uf(f,B,f),of(n,pf,j),of(n,ff,j),of(n,hf,j),of(n,df,j),uf(j,R,j),uf(j,B,M),uf(M,R,j),uf(M,B,M);var I=[Sf,Af,jf,Nf,Tf,Ff,Df,Bf,ff,Lf,_f,hf,bf,Vf,$f,Hf,Uf,Wf,Kf,Yf,Qf,pf,Gf];return uf(i,I,N),of(i,Mf,T),uf(s,I,N),of(s,Mf,T),uf(a,I,N),uf(N,I,N),of(N,Mf,T),of(N,If,F),uf(F,I,N),of(T,pf,C),of(T,ff,C),of(T,hf,C),of(T,df,O),e}function bd(e,t,n){var r=n[0].s,o=n[n.length-1].e;return new e(t.substr(r,o-r),n)}var kd="undefined"!==typeof console&&console&&console.warn||function(){},wd={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function xd(e){if(wd.initialized&&kd('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");wd.customProtocols.push(e)}function Dd(e){return wd.initialized||function(){wd.scanner={start:id(wd.customProtocols),tokens:Xf},wd.parser={start:yd(),tokens:gd};for(var e={createTokenClass:fd},t=0;t<wd.pluginQueue.length;t++)wd.pluginQueue[t][1]({scanner:wd.scanner,parser:wd.parser,utils:e});wd.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=sf(s,n[o].t));)a.push(n[o++]);for(;o<r&&(l=u||sf(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(bd(hd,t,a)),a=[]),o-=d,c-=d;var h=f.t,m=n.slice(o-c,o);i.push(bd(h,t,m))}}return a.length>0&&i.push(bd(hd,t,a)),i}(wd.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=sf(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}(wd.scanner.start,e))}function Cd(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Dd(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 Ed(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Dd(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function Od(e){return new Fn({key:new Bn("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 _a(e);return t.forEach((function(e){e.steps.forEach((function(e){n.step(e)}))})),n}(n.doc,B(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}})}))})),Mu(r)}(u);if(c.forEach((function(t){var o=t.oldRange,a=t.newRange;Nu(o.from,o.to,n.doc).filter((function(t){return t.mark.type===e.type})).forEach((function(t){var o=Nu(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=Ed(a),f=Ed(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){Cd(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 Sd=Pu.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate:function(){this.options.protocols.forEach(xd)},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",Es(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 Cd(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 Ls({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=As(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(Nu(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(Od({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new Fn({key:new Bn("handleClickLink"),props:{handleClick:function(t,n,r){var o,i=Ou(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 Fn({key:new Bn("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=Cd(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}}),Ad=Ru.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",Es(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()}}}}),jd=Ru.create({name:"doc",topNode:!0,content:"block+"}),Md=/^\s*>\s$/,Nd=Ru.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",Es(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[Fu({find:Md,type:this.type})]}}),Td=Ru.create({name:"hardBreak",addOptions:function(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML:function(){return[{tag:"br"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["br",Es(this.options.HTMLAttributes,t)]},renderText:function(){return"\n"},addCommands:function(){var e=this;return{setHardBreak:function(){return function(t){var n=t.commands,r=t.chain,o=t.state,i=t.editor;return n.first([function(){return n.exitCode()},function(){return n.command((function(){var t=o.selection,n=o.storedMarks;if(t.$from.parent.type.spec.isolating)return!1;var a=e.options.keepMarks,s=i.extensionManager.splittableMarks,u=n||t.$to.parentOffset&&t.$from.marks();return r().insertContent({type:e.name}).command((function(e){var t=e.tr;if(e.dispatch&&u&&a){var n=u.filter((function(e){return s.includes(e.type.name)}));t.ensureMarks(n)}return!0})).run()}))}])}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return e.editor.commands.setHardBreak()},"Shift-Enter":function(){return e.editor.commands.setHardBreak()}}}});function Fd(e){var t=e.placeholder,n=e.autofocus,r=void 0!==n&&n,o=e.content,i=void 0===o?"":o;return{extensions:[jd,ef,Ad,Sd.configure({openOnClick:!1}),Zc.configure({placeholder:t,showOnlyWhenEditable:!1}),Nd.configure({}),Td.configure({})],content:i,autofocus:r,editorProps:{attributes:{class:"gh-comment-content focus:outline-0"}},parseOptions:{preserveWhitespace:"full"}}}function Pd(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,Pd),a}var Rd,Bd,Id=["static"],Ld=["unmount"],zd=["as","children","refName"],_d=((Bd=_d||{})[Bd.None=0]="None",Bd[Bd.RenderStrategy=1]="RenderStrategy",Bd[Bd.Static=2]="Static",Bd),Vd=((Rd=Vd||{})[Rd.Unmount=0]="Unmount",Rd[Rd.Hidden=1]="Hidden",Rd);function $d(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=Ud(n,t);if(c)return Hd(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,Id);if(m)return Hd(v,o,s,f)}if(1&p){var g,y=d.unmount,b=void 0===y||y,k=a(d,Ld);return Pd(b?0:1,(r(g={},0,(function(){return null})),r(g,1,(function(){return Hd(i(i({},k),{},{hidden:!0,style:{display:"none"}}),o,s,f)})),g))}return Hd(d,o,s,f)}function Hd(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=Jd(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,zd),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(qd(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({},Ud(m.props,qd(Jd(p,["ref"]))),v,h))}return Object(s.createElement)(l,Object.assign({},Jd(p,["ref"]),l!==s.Fragment&&h,l!==s.Fragment&&v),m)}function Ud(){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=te(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 Wd(e){var t;return Object.assign(Object(s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function qd(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}function Jd(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=te(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 Kd=Object(s.createContext)(null);Kd.displayName="OpenClosedContext";var Qd=function(e){return e[e.Open=0]="Open",e[e.Closed=1]="Closed",e}(Qd||{});function Gd(){return Object(s.useContext)(Kd)}function Yd(e){var t=e.value,n=e.children;return u.a.createElement(Kd.Provider,{value:t},n)}function Xd(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((function(e){return setTimeout((function(){throw e}))}))}var Zd,ep="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,tp={serverHandoffComplete:!1};function np(){var e=p(Object(s.useState)(tp.serverHandoffComplete),2),t=e[0],n=e[1];return Object(s.useEffect)((function(){!0!==t&&n(!0)}),[t]),Object(s.useEffect)((function(){!1===tp.serverHandoffComplete&&(tp.serverHandoffComplete=!0)}),[]),t}var rp=0;function op(){return++rp}var ip=null!=(Zd=u.a.useId)?Zd:function(){var e=np(),t=p(u.a.useState(e?op:null),2),n=t[0],r=t[1];return ep((function(){null===n&&r(op())}),[n]),null!=n?""+n:void 0};function ap(){var e=Object(s.useRef)(!1);return ep((function(){return e.current=!0,function(){e.current=!1}}),[]),e}function sp(e){var t=Object(s.useRef)(e);return ep((function(){t.current=e}),[e]),t}var up=function(e){var t=sp(e);return u.a.useCallback((function(){return t.current.apply(t,arguments)}),[t])},lp=Symbol();function cp(){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=up((function(e){var t,n=te(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[lp])}))?void 0:o}function fp(){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=te(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=te(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 dp(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 pp(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 hp=function(e){return e.Ended="ended",e.Cancelled="cancelled",e}(hp||{});function mp(e,t,n,r){var o=n?"enter":"leave",i=fp(),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=Pd(o,{enter:function(){return t.enter},leave:function(){return t.leave}}),u=Pd(o,{enter:function(){return t.enterTo},leave:function(){return t.leaveTo}}),l=Pd(o,{enter:function(){return t.enterFrom},leave:function(){return t.leaveFrom}});return pp.apply(void 0,[e].concat(B(t.enter),B(t.enterTo),B(t.enterFrom),B(t.leave),B(t.leaveFrom),B(t.leaveTo),B(t.entered))),dp.apply(void 0,[e].concat(B(s),B(l))),i.nextFrame((function(){pp.apply(void 0,[e].concat(B(l))),dp.apply(void 0,[e].concat(B(u))),function(e,t){var n=fp();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&&(pp.apply(void 0,[e].concat(B(s))),dp.apply(void 0,[e].concat(B(t.entered)))),a(n)}))})),i.dispose}function vp(e){var t=e.container,n=e.direction,o=e.classes,i=e.events,a=e.onStart,u=e.onStop,l=ap(),c=function(){var e=p(Object(s.useState)(fp),1)[0];return Object(s.useEffect)((function(){return function(){return e.dispose()}}),[e]),e}(),f=sp(n),d=up((function(){return Pd(f.current,{enter:function(){return i.current.beforeEnter()},leave:function(){return i.current.beforeLeave()},idle:function(){}})})),h=up((function(){return Pd(f.current,{enter:function(){return i.current.afterEnter()},leave:function(){return i.current.afterLeave()},idle:function(){}})}));ep((function(){var e=fp();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(mp(n,o.current,"enter"===f.current,(function(t){var n;e.dispose(),Pd(t,(r(n={},hp.Ended,(function(){h(),u.current(f.current)})),r(n,hp.Cancelled,(function(){})),n))}))),e.dispose}),[n])}var gp=["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"],yp=["show","appear","unmount"];function bp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(" ").filter((function(e){return e.trim().length>1}))}var kp=Object(s.createContext)(null);kp.displayName="TransitionContext";var wp,xp=((wp=xp||{}).Visible="visible",wp.Hidden="hidden",wp);var Dp=Object(s.createContext)(null);function Cp(e){return"children"in e?Cp(e.children):e.current.filter((function(e){return"visible"===e.state})).length>0}function Ep(e){var t=sp(e),n=Object(s.useRef)([]),o=ap(),i=up((function(e){var i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vd.Hidden,s=n.current.findIndex((function(t){return t.id===e}));-1!==s&&(Pd(a,(r(i={},Vd.Unmount,(function(){n.current.splice(s,1)})),r(i,Vd.Hidden,(function(){n.current[s].state="hidden"})),i)),Xd((function(){var e;!Cp(n)&&o.current&&(null==(e=t.current)||e.call(t))})))})),a=up((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,Vd.Unmount)}}));return Object(s.useMemo)((function(){return{children:n,register:a,unregister:i}}),[a,i,n])}function Op(){}Dp.displayName="NestingContext";var Sp=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Ap(e){var t,n,r={},o=te(Sp);try{for(o.s();!(n=o.n()).done;){var i=n.value;r[i]=null!=(t=e[i])?t:Op}}catch(a){o.e(a)}finally{o.f()}return r}var jp,Mp=_d.RenderStrategy,Np=Wd((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,gp),k=Object(s.useRef)(null),w=cp(k,t),x=p(Object(s.useState)("visible"),2),D=x[0],C=x[1],E=b.unmount?Vd.Unmount:Vd.Hidden,O=function(){var e=Object(s.useContext)(kp);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,M=function(){var e=Object(s.useContext)(Dp);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),N=M.register,T=M.unregister,F=Object(s.useRef)(null),P=ip();Object(s.useEffect)((function(){if(P)return N(P)}),[N,P]),Object(s.useEffect)((function(){if(E===Vd.Hidden&&P){var e;if(S&&"visible"!==D)return void C("visible");Pd(D,(r(e={},"hidden",(function(){return T(P)})),r(e,"visible",(function(){return N(P)})),e))}}),[D,P,N,T,S,E]);var R=sp({enter:bp(f),enterFrom:bp(d),enterTo:bp(h),entered:bp(m),leave:bp(v),leaveFrom:bp(g),leaveTo:bp(y)}),B=function(e){var t=Object(s.useRef)(Ap(e));return Object(s.useEffect)((function(){t.current=Ap(e)}),[e]),t}({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:c}),I=np();Object(s.useEffect)((function(){if(I&&"visible"===D&&null===k.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[k,D,I]);var L=j&&!A,z=!I||L||F.current===S?"idle":S?"enter":"leave",_=Object(s.useRef)(!1),V=Ep((function(){_.current||(C("hidden"),T(P))}));vp({container:k,classes:R,events:B,direction:z,onStart:sp((function(){_.current=!0})),onStop:sp((function(e){_.current=!1,"leave"===e&&!Cp(V)&&(C("hidden"),T(P))}))}),Object(s.useEffect)((function(){!L||(E===Vd.Hidden?F.current=null:F.current=S)}),[S,L,D]);var $=b,H={ref:w};return u.a.createElement(Dp.Provider,{value:V},u.a.createElement(Yd,{value:Pd(D,(n={},r(n,"visible",Qd.Open),r(n,"hidden",Qd.Closed),n))},$d({ourProps:H,theirProps:$,defaultTag:"div",features:Mp,visible:"visible"===D,name:"Transition.Child"})))})),Tp=Wd((function(e,t){var n,o=e.show,l=e.appear,c=void 0!==l&&l,f=e.unmount,d=a(e,yp),h=Object(s.useRef)(null),m=cp(h,t);np();var v=Gd();if(void 0===o&&null!==v&&(o=Pd(v,(r(n={},Qd.Open,!0),r(n,Qd.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=Ep((function(){b("hidden")})),w=p(Object(s.useState)(!0),2),x=w[0],D=w[1],C=Object(s.useRef)([o]);ep((function(){!1!==x&&C.current[C.current.length-1]!==o&&(C.current.push(o),D(!1))}),[C,o]);var E=Object(s.useMemo)((function(){return{show:o,appear:c,initial:x}}),[o,c,x]);Object(s.useEffect)((function(){if(o)b("visible");else if(Cp(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(Dp.Provider,{value:k},u.a.createElement(kp.Provider,{value:E},$d({ourProps:i(i({},O),{},{as:s.Fragment,children:u.a.createElement(Np,i(i({ref:m},O),d))}),theirProps:{},defaultTag:s.Fragment,features:Mp,visible:"visible"===y,name:"Transition"})))})),Fp=Wd((function(e,t){var n=null!==Object(s.useContext)(kp),r=null!==Gd();return u.a.createElement(u.a.Fragment,null,!n&&r?u.a.createElement(Tp,i({ref:t},e)):u.a.createElement(Np,i({ref:t},e)))})),Pp=Object.assign(Tp,{Child:Fp,Root:Tp}),Rp=["title","titleId"];function Bp(){return Bp=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},Bp.apply(this,arguments)}function Ip(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 Lp(e,t){var n=e.title,r=e.titleId,o=Ip(e,Rp);return s.createElement("svg",Bp({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,jp||(jp=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 zp,_p=s.forwardRef(Lp),Vp=(n.p,["title","titleId"]);function $p(){return $p=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},$p.apply(this,arguments)}function Hp(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 Up(e,t){var n=e.title,r=e.titleId,o=Hp(e,Vp);return s.createElement("svg",$p({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,zp||(zp=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 Wp,qp,Jp,Kp=s.forwardRef(Up),Qp=(n.p,["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 Xp(e,t){var n=e.title,r=e.titleId,o=Yp(e,Qp);return s.createElement("svg",Gp({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,Wp||(Wp=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"})),qp||(qp=s.createElement("circle",{cx:12,cy:12,r:11.375,stroke:"white",strokeWidth:1.25})),Jp||(Jp=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 Zp=s.forwardRef(Xp);n.p;var eh=function(){var e="w-9 h-9 sm:w-[40px] sm:h-[40px]";return Object(j.jsx)("figure",{className:"relative ".concat(e),children:Object(j.jsx)("div",{className:"flex items-center justify-center rounded-full bg-[rgba(0,0,0,0.085)] dark:bg-[rgba(255,255,255,0.15)] ".concat(e),children:Object(j.jsx)(Zp,{className:"stroke-white opacity-80"})})})},th=function(e){var t,n,r,o=e.comment,i=Object(s.useContext)(A),a=i.member,u=i.avatarSaturation,l="w-9 h-9 sm:w-[40px] sm:h-[40px]",c=null!==(t=null===a||void 0===a?void 0:a.name)&&void 0!==t?t:null===o||void 0===o||null===(n=o.member)||void 0===n?void 0:n.name,f=function(e,t,n){return Math.floor(e%(n-t)+t)},d=o?o.member:a,p=(r=function(){var e=o?o.member:a;if(!e||!e.name)return[0,0,10];var t=isNaN(u)?50:u,n=[0,360],r=Math.round(t/(100/30))+30,i=[r-20,r],s=function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}(e.name);return[f(s,n[0],n[1]),t,f(s,i[0],i[1])]}(),"hsl(".concat(r[0],", ").concat(r[1],"%, ").concat(r[2],"%)")),h={background:p},m=Object(j.jsxs)(j.Fragment,{children:[c?Object(j.jsx)("div",{className:"flex items-center justify-center rounded-full ".concat(l),style:h,children:Object(j.jsx)("p",{className:"font-sans text-lg font-semibold text-white",children:function(){if(o&&!o.member)return oe("Deleted member");var e=o?o.member:a;return e&&e.name?oe(e.name):oe("Anonymous")}()})}):Object(j.jsx)("div",{className:"flex items-center justify-center rounded-full bg-neutral-900 dark:bg-[rgba(255,255,255,0.7)] ".concat(l),children:Object(j.jsx)(Zp,{className:"stroke-white dark:stroke-[rgba(0,0,0,0.6)]"})}),d&&Object(j.jsx)("img",{className:"absolute top-0 left-0 rounded-full ".concat(l),src:d.avatar_image,alt:"Avatar"})]});return Object(j.jsx)("figure",{className:"relative ".concat(l),children:m})};function nh(e){return Object(s.useMemo)((function(){return function(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"))}(e)}),[e])}var rh,oh=function(e){var t=e.submit,n=e.progress,r=e.setProgress,o=e.close,i=e.reduced,a=e.isOpen,u=e.editor,l=e.submitText,c=e.submitSize,f=null;"sending"===n&&(l=null,f=Object(j.jsx)(Kp,{className:"h-[24px] w-[24px] fill-white dark:fill-black"}));var d=Object(s.useCallback)((function(e){null!==u&&void 0!==u&&u.isFocused&&e.stopPropagation()}),[u]),p=Object(s.useCallback)(g(m().mark((function e(){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u.isEmpty){e.next=2;break}return e.abrupt("return");case 2:return r("sending"),e.prev=3,e.next=6,t({html:u.getHTML()});case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),r("error"),e.abrupt("return");case 12:return o?o():(r("sent"),u.chain().clearContent().blur().run()),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[3,8]])}))),[r,u,t,o]);return Object(s.useEffect)((function(){var e=function(e){e.metaKey||e.ctrlKey?"Enter"===e.key&&null!==u&&void 0!==u&&u.isFocused&&(p(),null===u||void 0===u||u.commands.blur()):"Escape"!==e.key||null!==u&&void 0!==u&&u.isFocused&&(o?o():null===u||void 0===u||u.commands.blur())};return window.addEventListener("keydown",e,{passive:!0}),function(){window.removeEventListener("keydown",e,{passive:!0})}}),[u,o,p]),Object(j.jsxs)("div",{className:"relative w-full pl-[52px] transition-[padding] delay-100 duration-150 ".concat(i&&"pl-0"," ").concat(a&&"pt-[64px] pl-[1px] sm:pl-[52px]"),children:[Object(j.jsx)("div",{className:"w-full rounded-md border border-none border-slate-50 bg-[rgba(255,255,255,0.9)] px-3 py-4 font-sans text-[16.5px] leading-normal shadow-form transition-all delay-100 duration-150 hover:shadow-formxl focus:outline-0 dark:border-none dark:bg-[rgba(255,255,255,0.08)] dark:text-neutral-300 dark:shadow-transparent ".concat(a?"min-h-[144px] cursor-text pb-[68px] pt-2":"min-h-[48px] cursor-pointer overflow-hidden hover:border-slate-300","\n "),children:Object(j.jsx)(Kc,{onMouseDown:d,onTouchStart:d,editor:u})}),Object(j.jsxs)("div",{className:"absolute right-[9px] bottom-[9px] flex space-x-4 transition-[opacity] duration-150",children:[o&&Object(j.jsx)("button",{type:"button",onClick:o,className:"ml-2.5 font-sans text-sm font-medium text-neutral-500 outline-0 dark:text-neutral-400",children:"Cancel"}),Object(j.jsxs)("button",{className:"flex w-auto items-center justify-center sm:w-[128px] ".concat("medium"===c&&"sm:w-[100px]"," ").concat("small"===c&&"sm:w-[64px]"," h-[39px] rounded-[6px] border bg-neutral-900 py-2 px-3 text-center font-sans text-sm font-semibold text-white outline-0 transition-[opacity] duration-150 dark:bg-[rgba(255,255,255,0.9)] dark:text-neutral-800"),type:"button","data-testid":"submit-form-button",onClick:p,children:[Object(j.jsx)("span",{children:f}),l&&Object(j.jsx)("span",{children:l})]})]})]})},ih=function(e){var t=e.show,n=e.name,r=e.expertise,o=e.editName,i=e.editExpertise;return Object(j.jsxs)(Pp,{show:t,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:"font-sans text-[17px] font-bold tracking-tight text-[rgb(23,23,23)] dark:text-[rgba(255,255,255,0.85)]",onClick:o,"data-testid":"member-name",children:n||"Anonymous"}),Object(j.jsx)("div",{className:"flex items-baseline justify-start",children:Object(j.jsxs)("button",{type:"button",className:"group flex max-w-[80%] items-center justify-start whitespace-nowrap text-left font-sans text-[14px] tracking-tight text-[rgba(0,0,0,0.5)] transition duration-150 hover:text-[rgba(0,0,0,0.75)] dark:text-[rgba(255,255,255,0.5)] dark:hover:text-[rgba(255,255,255,0.4)] sm:max-w-[90%] ".concat(!r&&"text-[rgba(0,0,0,0.3)] hover:text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.3)]"),onClick:i,children:[Object(j.jsx)("span",{className:"... overflow-hidden text-ellipsis",children:r||"Add your expertise"}),r&&Object(j.jsx)(_p,{className:"ml-1 h-[12px] w-[12px] -translate-x-[6px] stroke-[rgba(0,0,0,0.5)] opacity-0 transition-all duration-100 ease-out group-hover:translate-x-0 group-hover:stroke-[rgba(0,0,0,0.75)] group-hover:opacity-100 dark:stroke-[rgba(255,255,255,0.5)] dark:group-hover:stroke-[rgba(255,255,255,0.3)]"})]})})]})},ah=function(e){var t,n,r,o,i=e.comment,a=e.submit,u=e.submitText,l=e.submitSize,c=e.close,f=e.editor,d=e.reduced,h=e.isOpen,m=Object(s.useContext)(A),v=m.member,g=m.dispatchAction,y=function(e){var t=Object(s.useContext)(A).popup;return(null===t||void 0===t?void 0:t.type)===e}("addDetailsPopup"),b=p(Object(s.useState)("default"),2),k=b[0],w=b[1],x=Object(s.useRef)(null),D=null!==(t=null===v||void 0===v?void 0:v.name)&&void 0!==t?t:null===i||void 0===i||null===(n=i.member)||void 0===n?void 0:n.name,C=null!==(r=null===v||void 0===v?void 0:v.expertise)&&void 0!==r?r:null===i||void 0===i||null===(o=i.member)||void 0===o?void 0:o.expertise;("sending"===k||D&&y)&&(h=!0);var E=function(e){null!==f&&void 0!==f&&f.isFocused&&e.preventDefault()},O=Object(s.useCallback)((function(e){var t,n;null===f||void 0===f||null===(t=f.commands)||void 0===t||t.blur(),g("openPopup",{type:"addDetailsPopup",expertiseAutofocus:null!==(n=e.expertiseAutofocus)&&void 0!==n&&n,callback:function(e){f&&x.current&&e&&(f.setEditable(!0),f.commands.focus())}})}),[f,g,x]),S=Object(s.useCallback)((function(){O({expertiseAutofocus:!1})}),[O]),M=Object(s.useCallback)((function(){O({expertiseAutofocus:!0})}),[O]),N=Object(s.useCallback)((function(){f.isFocused||(D?f.commands.focus():S())}),[f,S,D]);return Object(s.useEffect)((function(){f&&f.setEditable(!!D&&"sending"!==k)}),[f,D,k]),Object(j.jsx)("form",{ref:x,"data-testid":"form",onClick:N,onMouseDown:E,onTouchStart:E,className:"-mx-3 -mt-[14px] mb-10 rounded-md px-3 pt-3 pb-2 transition duration-200 ".concat(h?"cursor-default":"cursor-pointer"," ").concat(d&&"pl-1","\n "),children:Object(j.jsxs)("div",{className:"relative w-full",children:[Object(j.jsx)("div",{className:"pr-[1px] font-sans leading-normal dark:text-neutral-300",children:Object(j.jsx)(oh,{close:c,reduced:d,isOpen:h,editor:f,submitText:u,submitSize:l,submit:a,setProgress:w,progress:k})}),Object(j.jsxs)("div",{className:"absolute top-1 left-0 flex h-12 w-full items-center justify-start",children:[Object(j.jsx)("div",{className:"mr-3 grow-0",children:Object(j.jsx)(th,{comment:i,className:"pointer-events-none"})}),Object(j.jsx)("div",{className:"grow-1 w-full",children:Object(j.jsx)(ih,{show:h,name:D,expertise:C,editExpertise:M,editName:S})})]})]})})},sh=function(e){var t,n=e.commentsCount,r=Object(s.useContext)(A),o=r.postId,a=r.dispatchAction,u=Xc(i({},Fd({placeholder:0===n?"Start the conversation":"Join the discussion",autofocus:!1}))),l=Object(s.useCallback)(function(){var e=g(m().mark((function e(t){var n;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.html,e.next=3,a("addComment",{post_id:o,status:"published",html:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,a]),c=Object(s.useRef)(null);Object(s.useEffect)((function(){if(u){var e=function(e){if(u&&!e.metaKey&&!e.ctrlKey){for(var t=document.activeElement;t&&"IFRAME"===t.tagName&&t.contentDocument;)t=t.contentDocument.activeElement;var n=t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"IFRAME"===t.tagName||"true"===t.contentEditable);return"c"!==e.key||null!==u&&void 0!==u&&u.isFocused||n?void 0:(null===u||void 0===u||u.commands.focus(),void(c.current&&ae(c.current)))}};return window.addEventListener("keydown",e,{passive:!0}),function(){window.removeEventListener("keydown",e,{passive:!0})}}}),[u]);var f={submitText: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"})]}),submitSize:"large",submit:l},d=null!==(t=null===u||void 0===u?void 0:u.isFocused)&&void 0!==t&&t;return Object(j.jsx)("div",{className:"-mt-[4px]",ref:c,"data-testid":"main-form",children:Object(j.jsx)(ah,i({editor:u,reduced:!1,isOpen:d},f))})},uh=["title","titleId"];function lh(){return lh=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},lh.apply(this,arguments)}function ch(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 fh(e,t){var n=e.title,r=e.titleId,o=ch(e,uh);return s.createElement("svg",lh({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,rh||(rh=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 dh=s.forwardRef(fh);n.p;var ph,hh=function(e){var t=e.comment,n=Object(s.useContext)(A),r=n.dispatchAction,o=n.member,i=n.commentsEnabled,a=p(Object(s.useState)(""),2),u=a[0],l=a[1],c="paid"===i,f=o&&!!o.paid,d=o&&(f||!c),h=d?"button":"span",m="cursor-pointer";return d||(m="cursor-text"),Object(j.jsxs)(h,{type:"button",className:"group duration-50 flex items-center font-sans text-sm outline-0 transition-all ease-linear ".concat(t.liked?"text-[rgba(0,0,0,0.9)] dark:text-[rgba(255,255,255,0.9)]":"text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]"," ").concat(!t.liked&&d&&"hover:text-[rgba(0,0,0,0.75)] hover:dark:text-[rgba(255,255,255,0.25)]"," ").concat(m),onClick:function(){d&&(t.liked?r("unlikeComment",t):(r("likeComment",t),l("animate-heartbeat"),setTimeout((function(){l("")}),400)))},"data-testid":"like-button",children:[Object(j.jsx)(dh,{className:u+" mr-[6px] ".concat(t.liked?"fill-[rgba(0,0,0,0.9)] stroke-[rgba(0,0,0,0.9)] dark:fill-[rgba(255,255,255,0.9)] dark:stroke-[rgba(255,255,255,0.9)]":"stroke-[rgba(0,0,0,0.5)] dark:stroke-[rgba(255,255,255,0.5)]"," ").concat(!t.liked&&d&&"group-hover:stroke-[rgba(0,0,0,0.75)] dark:group-hover:stroke-[rgba(255,255,255,0.25)]"," transition duration-50 ease-linear")}),t.count.likes]})},mh=["title","titleId"];function vh(){return vh=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},vh.apply(this,arguments)}function gh(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 yh(e,t){var n=e.title,r=e.titleId,o=gh(e,mh);return s.createElement("svg",vh({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,ph||(ph=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 bh=s.forwardRef(yh);n.p;var kh,wh,xh,Dh=function(e){var t=e.disabled,n=e.isReplying,r=e.toggleReply;return Object(s.useContext)(A).member?Object(j.jsxs)("button",{disabled:!!t,type:"button",className:"group duration-50 flex items-center font-sans text-sm outline-0 transition-all ease-linear ".concat(n?"text-[rgba(0,0,0,0.9)] dark:text-[rgba(255,255,255,0.9)]":"text-[rgba(0,0,0,0.5)] hover:text-[rgba(0,0,0,0.75)] dark:text-[rgba(255,255,255,0.5)] dark:hover:text-[rgba(255,255,255,0.25)]"),onClick:r,"data-testid":"reply-button",children:[Object(j.jsx)(bh,{className:"mr-[6px] ".concat(n?"fill-[rgba(0,0,0,0.9)] stroke-[rgba(0,0,0,0.9)] dark:fill-[rgba(255,255,255,0.9)] dark:stroke-[rgba(255,255,255,0.9)]":"stroke-[rgba(0,0,0,0.5)] group-hover:stroke-[rgba(0,0,0,0.75)] dark:stroke-[rgba(255,255,255,0.5)] dark:group-hover:stroke-[rgba(255,255,255,0.25)]"," duration-50 transition ease-linear")}),"Reply"]}):null},Ch=function(e){var t=e.comment,n=e.close,r=Object(s.useContext)(A).dispatchAction,o="published"!==t.status;return Object(j.jsx)("div",{className:"flex flex-col",children:o?Object(j.jsxs)("button",{type:"button",className:"w-full text-left text-[14px]",onClick:function(){r("showComment",t),n()},children:[Object(j.jsx)("span",{children:"Show "}),Object(j.jsx)("span",{className:"hidden sm:inline",children:"comment"})]}):Object(j.jsxs)("button",{type:"button",className:"w-full text-left text-[14px]",onClick:function(){r("hideComment",t),n()},children:[Object(j.jsx)("span",{children:"Hide "}),Object(j.jsx)("span",{className:"hidden sm:inline",children:"comment"})]})})},Eh=function(e){var t=e.comment,n=e.close,r=e.toggleEdit,o=Object(s.useContext)(A).dispatchAction;return Object(j.jsxs)("div",{className:"flex flex-col",children:[Object(j.jsx)("button",{type:"button",className:"mb-3 w-full text-left text-[14px]",onClick:r,"data-testid":"edit",children:"Edit"}),Object(j.jsx)("button",{type:"button",className:"w-full text-left text-[14px] text-red-600",onClick:function(e){o("deleteComment",t),n()},children:"Delete"})]})},Oh=function(e){var t=e.comment,n=e.close,r=Object(s.useContext)(A).dispatchAction;return Object(j.jsx)("div",{className:"flex flex-col",children:Object(j.jsxs)("button",{type:"button",className:"w-full text-left text-[14px]",onClick:function(){r("openPopup",{type:"reportPopup",comment:t}),n()},children:[Object(j.jsx)("span",{children:"Report "}),Object(j.jsx)("span",{className:"hidden sm:inline",children:"comment"})]})})},Sh=function(e){var t,n=e.comment,r=e.close,o=e.toggleEdit,i=Object(s.useContext)(A),a=i.member,u=i.admin,l=a&&(null===(t=n.member)||void 0===t?void 0:t.uuid)===(null===a||void 0===a?void 0:a.uuid),c=!!u,f=Object(s.useRef)();Object(s.useEffect)((function(){var e,t,n=function(){r()};window.addEventListener("click",n,{passive:!0});var o=null===(e=f.current)||void 0===e||null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView;return o&&o!==window&&o.addEventListener("click",n,{passive:!0}),function(){window.removeEventListener("click",n,{passive:!0}),o&&o!==window&&o.removeEventListener("click",n,{passive:!0})}}),[r]),Object(s.useEffect)((function(){var e=function(e){"Escape"===e.key&&r()};return window.addEventListener("keydown",e,{passive:!0}),function(){window.removeEventListener("keydown",e,{passive:!0})}}),[r]);var d=null;if("published"===n.status)d=l?Object(j.jsx)(Eh,{comment:n,close:r,toggleEdit:o}):c?Object(j.jsx)(Ch,{comment:n,close:r}):Object(j.jsx)(Oh,{comment:n,close:r});else{if(!c)return null;d=Object(j.jsx)(Ch,{comment:n,close:r})}return Object(j.jsx)("div",{ref:f,onClick:function(e){e.stopPropagation()},children:Object(j.jsx)("div",{className:"absolute z-10 min-w-min whitespace-nowrap rounded bg-white py-3 pl-4 pr-8 font-sans text-sm shadow-lg outline-0 dark:bg-zinc-900 dark:text-white sm:min-w-[150px]",children:d})})},Ah=["title","titleId"];function jh(){return jh=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},jh.apply(this,arguments)}function Mh(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 Nh(e,t){var n=e.title,r=e.titleId,o=Mh(e,Ah);return s.createElement("svg",jh({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,kh||(kh=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"})),wh||(wh=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"})),xh||(xh=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 Th=s.forwardRef(Nh),Fh=(n.p,function(e){var t=e.comment,n=e.toggleEdit,r=p(Object(s.useState)(!1),2),o=r[0],i=r[1],a=Object(s.useContext)(A),u=a.member,l=a.admin,c=!!u&&"published"===t.status||!!l;return u?Object(j.jsxs)("div",{className:"relative","data-testid":"more-button",children:[c?Object(j.jsx)("button",{type:"button",onClick:function(){i((function(e){return!e}))},className:"outline-0",children:Object(j.jsx)(Th,{className:"duration-50 gh-comments-icon gh-comments-icon-more fill-[rgba(0,0,0,0.5)] outline-0 transition ease-linear hover:fill-[rgba(0,0,0,0.75)] dark:fill-[rgba(255,255,255,0.5)] dark:hover:fill-[rgba(255,255,255,0.25)]"})}):null,o?Object(j.jsx)(Sh,{comment:t,close:function(){i(!1)},toggleEdit:n}):null]}):null}),Ph=function(e){var t=e.loadMore,n=e.count;return Object(j.jsx)("div",{className:"flex w-full items-center justify-start",children:Object(j.jsx)("button",{type:"button",className:"group ml-[48px] mb-10 flex w-auto items-center px-0 pt-0 pb-2 text-left font-sans text-md font-semibold text-neutral-700 dark:text-white sm:mb-12 ",onClick:t,"data-testid":"reply-pagination-button",children:Object(j.jsxs)("span",{className:"flex h-[39px] w-auto items-center justify-center whitespace-nowrap rounded-[6px] bg-[rgba(0,0,0,0.05)] py-2 px-4 text-center font-sans text-sm font-semibold text-neutral-700 outline-0 transition-[opacity,background] duration-150 hover:bg-[rgba(0,0,0,0.1)] dark:bg-[rgba(255,255,255,0.08)] dark:text-neutral-100 dark:hover:bg-[rgba(255,255,255,0.1)]",children:["\u2193 Show ",n," more ",1===n?"reply":"replies"]})})})},Rh=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)(Zh,{comment:e,parent:t,isReply:!0},e.id)})),r>0&&Object(j.jsx)(Ph,{count:r,loadMore:function(){n("loadMoreReplies",{comment:t})}})]})},Bh=function(e){var t=e.editor,n=e.submit,r=e.close,o=e.closeIfNotChanged,i=e.submitText,a=e.submitSize,u=Object(s.useContext)(A),l=u.dispatchAction,c=u.secundaryFormCount;Object(s.useEffect)((function(){return l("increaseSecundaryFormCount"),function(){l("decreaseSecundaryFormCount")}}),[l]),function(e,t){var n=Object(s.useRef)(0);Object(s.useEffect)((function(){if(n.current>=2)return e();n.current+=1}),t)}((function(){c>1&&o()}),[c]);var f=ie();return Object(j.jsx)("div",{className:"-mt-[20px]",children:Object(j.jsx)(ah,{editor:t,submit:n,close:r,submitText:i,submitSize:a,reduced:f,isOpen:!0})})},Ih=function(e){var t=e.parent,n=e.close,r=Object(s.useContext)(A),o=r.postId,a=r.dispatchAction,u=p(function(e,t){var n=Object(s.useRef)(null),r=Object(s.useCallback)((function(r){n.current&&t&&t(n.current),r&&e&&e(r),n.current=r}),[e,t]);return[n,r]}(ae),2)[1],l=Xc(i({},Fd({placeholder:"Reply to comment",autofocus:!0}))),c=Object(s.useCallback)(function(){var e=g(m().mark((function e(n){var r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.html,e.next=3,a("addReply",{parent:t,reply:{post_id:o,status:"published",html:r}});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[t,o,a]),f={submitText: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"})]}),submitSize:"medium",submit:c},d=Object(s.useCallback)((function(){null!==l&&void 0!==l&&l.isEmpty&&n()}),[l,n]);return Object(j.jsx)("div",{ref:u,children:Object(j.jsx)(Bh,i({close:n,closeIfNotChanged:d,editor:l},f))})},Lh=function(e){var t=e.comment,n=e.parent,r=e.close,o=Object(s.useContext)(A).dispatchAction,a={placeholder:"Edit this comment",autofocus:!1,content:t.html},u=Xc(i({},Fd(a)));Object(s.useEffect)((function(){u&&u.chain().focus().command((function(e){var t=e.tr;return e.commands.setTextSelection({from:t.doc.content.size,to:t.doc.content.size})})).run()}),[u]);var l=Object(s.useCallback)(function(){var e=g(m().mark((function e(r){var i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.html,e.next=3,o("editComment",{comment:{id:t.id,html:i},parent:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[n,t,o]),c={submitText:"Save",submitSize:"small",submit:l},f=Object(s.useCallback)((function(){(null===u||void 0===u?void 0:u.getHTML())===t.html&&r()}),[u,r,t.html]);return Object(j.jsx)(Bh,i({editor:u,close:r,closeIfNotChanged:f},c))};function zh(e){var t=e.comment,n=e.parent,r=p(Object(s.useState)(!1),2),o=r[0],i=r[1];return o?Object(j.jsx)(Lh,{comment:t,close:function(){i(!1)},parent:n}):Object(j.jsx)(_h,{comment:t,openEditMode:function(){i(!0)},parent:n})}function _h(e){var t=e.comment,n=e.parent,r=e.openEditMode,o=function(e){return"published"===e.status}(t);return o?Object(j.jsx)(Vh,{comment:t,parent:n,openEditMode:r}):Object(j.jsx)($h,{comment:t,openEditMode:r})}function Vh(e){var t=e.comment,n=e.parent,r=e.openEditMode,o=p(Object(s.useState)(!1),2),i=o[0],a=o[1],u=Object(s.useContext)(A).dispatchAction,l=function(){var e=g(m().mark((function e(){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i){e.next=3;break}return e.next=3,u("loadMoreReplies",{comment:t,limit:"all"});case 3:a((function(e){return!e}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=i||t.replies&&t.replies.length>0,f=Object(j.jsx)(th,{comment:t});return Object(j.jsxs)(Xh,{hasReplies:c,avatar:f,children:[Object(j.jsx)(Kh,{comment:t}),Object(j.jsx)(Qh,{html:t.html}),Object(j.jsx)(Gh,{comment:t,parent:n,isInReplyMode:i,toggleReplyMode:l,openEditMode:r}),Object(j.jsx)(Wh,{comment:t}),Object(j.jsx)(qh,{comment:t,isInReplyMode:i,closeReplyMode:function(){a(!1)}})]})}function $h(e){var t,n=e.comment,r=e.openEditMode;t=Object(s.useContext)(A).admin&&"hidden"===n.status?"This comment has been hidden.":"This comment has been removed.";var o=Object(j.jsx)(eh,{}),i=n.replies&&n.replies.length>0;return Object(j.jsxs)(Xh,{hasReplies:i,avatar:o,children:[Object(j.jsx)("div",{className:"-mt-[3px] mb-2 flex items-start",children:Object(j.jsxs)("div",{className:"flex h-12 flex-row items-center gap-4 pb-[8px] pr-4",children:[Object(j.jsx)("p",{className:"mt-[4px] font-sans text-[16px] italic leading-normal text-[rgba(0,0,0,0.2)] dark:text-[rgba(255,255,255,0.35)]",children:t}),Object(j.jsx)("div",{className:"mt-[4px]",children:Object(j.jsx)(Fh,{comment:n,toggleEdit:r})})]})}),Object(j.jsx)(Wh,{comment:n})]})}function Hh(e){var t,n=e.comment,r=Object(s.useContext)(A).member,o=r&&n.member&&n.member.uuid===r.uuid?r.expertise:null===n||void 0===n||null===(t=n.member)||void 0===t?void 0:t.expertise;return o?Object(j.jsxs)("span",{children:[o,Object(j.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"})]}):null}function Uh(e){return e.comment.edited_at?Object(j.jsxs)("span",{children:[Object(j.jsx)("span",{className:"mx-[0.3em]",children:"\xb7"}),"Edited"]}):null}function Wh(e){var t=e.comment;return t.replies&&t.replies.length>0?Object(j.jsx)("div",{className:"mt-10 mb-4 sm:mb-0",children:Object(j.jsx)(Rh,{comment:t})}):null}function qh(e){var t=e.comment,n=e.isInReplyMode,r=e.closeReplyMode;return n?Object(j.jsx)("div",{className:"my-10",children:Object(j.jsx)(Ih,{parent:t,close:r})}):null}function Jh(e){var t=e.comment,n=t.member?t.member.name?t.member.name:"Anonymous":"Deleted member";return Object(j.jsx)("h4",{className:"text-[rgb(23,23,23] font-sans text-[17px] font-bold tracking-tight dark:text-[rgba(255,255,255,0.85)]",children:n})}function Kh(e){var t=e.comment,n=nh(t.created_at);return Object(j.jsx)("div",{className:"-mt-[3px] mb-2 flex items-start",children:Object(j.jsxs)("div",{children:[Object(j.jsx)(Jh,{comment:t}),Object(j.jsx)("div",{className:"flex items-baseline pr-4 font-sans text-[14px] tracking-tight text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]",children:Object(j.jsxs)("span",{children:[Object(j.jsx)(Hh,{comment:t}),Object(j.jsx)("span",{title:re(t.created_at),children:n}),Object(j.jsx)(Uh,{comment:t})]})})]})})}function Qh(e){var t={__html:e.html};return Object(j.jsx)("div",{className:"mt mb-2 flex flex-row items-center gap-4 pr-4",children:Object(j.jsx)("p",{dangerouslySetInnerHTML:t,className:"gh-comment-content font-sans text-[16px] leading-normal text-neutral-900 dark:text-[rgba(255,255,255,0.85)]","data-testid":"comment-content"})})}function Gh(e){var t=e.comment,n=e.toggleReplyMode,r=e.isInReplyMode,o=e.openEditMode,i=e.parent,a=Object(s.useContext)(A),u=a.member,l="paid"===a.commentsEnabled,c=u&&!!u.paid,f=u&&(c||!l)&&!i;return Object(j.jsxs)("div",{className:"flex items-center gap-5",children:[Object(j.jsx)(hh,{comment:t}),f&&Object(j.jsx)(Dh,{comment:t,toggleReply:n,isReplying:r}),Object(j.jsx)(Fh,{comment:t,toggleEdit:o})]})}function Yh(e){return e.hasReplies?Object(j.jsx)("div",{className:"mb-2 h-full w-[3px] grow rounded bg-gradient-to-b from-[rgba(0,0,0,0.05)] via-[rgba(0,0,0,0.05)] to-transparent dark:from-[rgba(255,255,255,0.08)] dark:via-[rgba(255,255,255,0.08)]"}):null}function Xh(e){var t=e.children,n=e.avatar,r=e.hasReplies;return Object(j.jsxs)("div",{className:"flex w-full flex-row ".concat(!0===r?"mb-0":"mb-10"),"data-testid":"comment-component",children:[Object(j.jsxs)("div",{className:"mr-3 flex flex-col items-center justify-start",children:[Object(j.jsx)("div",{className:"flex-0 mb-4",children:n}),Object(j.jsx)(Yh,{hasReplies:r})]}),Object(j.jsx)("div",{className:"grow",children:t})]})}var Zh=function(e){var t=e.comment,n=e.parent;return Object(j.jsx)(Pp,{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.jsx)(zh,{comment:t,parent:n})})},em=function(){var e=Object(s.useContext)(A),t=e.pagination,n=e.dispatchAction;if(!t)return null;var r=t.total-t.page*t.limit;return r<=0?null:Object(j.jsx)("button",{"data-testid":"pagination-component",type:"button",className:"group mb-10 flex w-full items-center px-0 pt-0 pb-2 text-left font-sans text-md font-semibold text-neutral-700 dark:text-white",onClick:function(){n("loadMoreComments")},children:Object(j.jsxs)("span",{className:"flex h-[39px] w-full items-center justify-center whitespace-nowrap rounded-[6px] bg-[rgba(0,0,0,0.05)] py-2 px-3 text-center font-sans text-sm font-semibold text-neutral-700 outline-0 transition-[opacity,background] duration-150 hover:bg-[rgba(0,0,0,0.1)] dark:bg-[rgba(255,255,255,0.08)] dark:text-neutral-100 dark:hover:bg-[rgba(255,255,255,0.1)]",children:["\u2191 Show ",r," previous ",1===r?"comment":"comments"]})})},tm=function(e){var t=e.showCount,n=e.count;return t?1===n?Object(j.jsx)("div",{className:"text-[1.6rem] text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]",children:"1 comment"}):Object(j.jsxs)("div",{className:"text-[1.6rem] text-[rgba(0,0,0,0.5)] dark:text-[rgba(255,255,255,0.5)]",children:[n," comments"]}):null},nm=function(e){var t=e.title;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},rm=function(e){var t=e.title,n=e.showCount,r=e.count;return t||n||null===t?Object(j.jsxs)("div",{className:"mb-8 flex w-full items-baseline justify-between font-sans",children:[Object(j.jsx)("h2",{className:"text-[2.8rem] font-bold tracking-tight dark:text-[rgba(255,255,255,0.85)]",children:Object(j.jsx)(nm,{title:t})}),Object(j.jsx)(tm,{count:r,showCount:n})]}):null},om=function(){var e=Object(s.useContext)(A),t=e.pagination,n=e.member,r=e.comments,o=e.commentCount,i=e.commentsEnabled,a=e.title,u=e.showCount,l=e.secundaryFormCount,c=r.slice().reverse().map((function(e){return Object(j.jsx)(Zh,{comment:e},e.id)})),f="paid"===i,d=n&&!!n.paid;Object(s.useEffect)((function(){var e=document.getElementById(ce);e&&"#ghost-comments"===window.location.hash&&0===window.scrollY&&requestAnimationFrame((function(){requestAnimationFrame((function(){e.scrollIntoView()}))}))}),[]);var p=l>0;return Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)(rm,{title:a,showCount:u,count:o}),Object(j.jsx)(em,{}),Object(j.jsx)("div",{className:t?"":"mt-4","data-test":"comment-elements",children:c}),Object(j.jsx)("div",{children:p?null:n&&(d||!f)?Object(j.jsx)(sh,{commentsCount:o}):Object(j.jsx)(fe,{isFirst:0===(null===t||void 0===t?void 0:t.total),isPaid:f})})]})};var im,am,sm=function(){return Object(j.jsx)("div",{className:"flex h-32 w-full items-center justify-center",children:Object(j.jsx)(Kp,{className:"mb-6 h-12 w-12 fill-[rgb(225,225,225,0.9)] dark:fill-[rgba(255,255,255,0.6)]"})})},um=function(e){var t=e.done,n=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]},r=Object(s.useContext)(A),o=r.accentColor,i=r.colorScheme,a=function(){if("light"===i)return!1;if("dark"===i)return!0;var e=getComputedStyle(document.getElementById(ce).parentNode).getPropertyValue("color"),t=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(/,\s*/);return function(e,t){var r=n(e[0],e[1],e[2]),o=n(t[0],t[1],t[2]);return(Math.max(r,o)+.05)/(Math.min(r,o)+.05)}([255,255,255],[t[0],t[1],t[2]])<5}()?"dark":"",u={"--gh-accent-color":null!==o&&void 0!==o?o:"blue",paddingTop:0,paddingBottom:24};return Object(j.jsx)("section",{className:"ghost-display "+a,style:u,"data-testid":"content-box",children:t?Object(j.jsx)(om,{}):Object(j.jsx)(sm,{})})},lm=["title","titleId"];function cm(){return cm=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},cm.apply(this,arguments)}function fm(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 dm(e,t){var n=e.title,r=e.titleId,o=fm(e,lm);return s.createElement("svg",cm({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,im||(im=s.createElement("defs",null,s.createElement("style",null,".a{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.2px !important;}"))),am||(am=s.createElement("path",{className:"a",d:"M.75 23.249l22.5-22.5M23.25 23.249L.75.749"})))}var pm,hm=s.forwardRef(dm),mm=(n.p,function(e){return Object(j.jsx)("button",{type:"button",className:"absolute top-6 right-6 opacity-20 transition-opacity duration-100 ease-out hover:opacity-40 sm:top-10 sm:right-8",onClick:e.close,children:Object(j.jsx)(hm,{className:"h-[20px] w-[20px]"})})}),vm=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.expertise)&&void 0!==n?n:""),2),v=h[0],y=h[1],b=50;u.expertise&&(b-=u.expertise.length);var k=p(Object(s.useState)(b),2),w=k[0],x=k[1],D=p(Object(s.useState)({name:"",expertise:""}),2),C=D[0],E=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,expertise:v});case 3:O(!0),e.next=9;break;case 6:E({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(!ie()){var t=setTimeout((function(){var t,n;e.expertiseAutofocus?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.expertiseAutofocus]);return Object(j.jsx)("div",{className:"rounded-none relative h-screen w-screen overflow-hidden bg-white p-[28px] text-center shadow-modal sm:h-auto sm:w-[720px] sm:rounded-xl sm:p-0",onMouseDown:function(e){e.stopPropagation()},children:Object(j.jsxs)("div",{className:"flex",children:[!ie()&&Object(j.jsx)("div",{className:"flex w-[40%] flex-col items-center justify-center bg-[#1C1C1C]",children:Object(j.jsx)("div",{className:"-mt-[1px] flex flex-col gap-9",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)(Pp,{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 items-center justify-start gap-3 pr-4",children:[Object(j.jsx)("div",{className:"h-10 w-10 rounded-full border-2 border-white bg-cover bg-no-repeat",style:{backgroundImage:"url(".concat(t.avatar,")")}}),Object(j.jsxs)("div",{className:"flex flex-col items-start justify-center",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(ie()?"w-full":"w-[60%]"," p-0 sm:p-8"),children:[Object(j.jsxs)("h1",{className:"mb-1 text-center font-sans text-[24px] font-bold tracking-tight text-black sm:text-left",children:["Complete your profile",Object(j.jsx)("span",{className:"hidden sm:inline",children:"."})]}),Object(j.jsx)("p",{className:"text-base pr-0 text-center font-sans leading-9 text-neutral-500 sm:pr-10 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:"mb-2 flex flex-row justify-between",children:[Object(j.jsx)("label",{htmlFor:"comments-name",className:"font-sans text-[1.3rem] font-semibold",children:"Name"}),Object(j.jsx)(Pp,{show:!!C.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:C.name})})]}),Object(j.jsx)("input",{id:"comments-name",className:"flex h-[42px] w-full items-center rounded border border-neutral-200 px-3 font-sans text-[16px] outline-0 transition-[border-color] duration-200 focus:border-neutral-300 ".concat(C.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:"mt-6 mb-2 flex flex-row justify-between",children:[Object(j.jsx)("label",{htmlFor:"comments-name",className:"font-sans text-[1.3rem] font-semibold",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-expertise",className:"flex h-[42px] w-full items-center rounded border border-neutral-200 px-3 font-sans text-[16px] outline-0 transition-[border-color] duration-200 focus:border-neutral-300 ".concat(0===w&&"border-red-500 focus:border-red-500"),type:"text",name:"expertise",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",{type:"button",className:"mt-10 flex h-[42px] w-full items-center justify-center rounded-md px-8 font-sans text-[15px] font-semibold text-white opacity-100 transition-opacity duration-200 ease-linear hover:opacity-90",style:{backgroundColor:null!==l&&void 0!==l?l:"#000000"},onClick:S,children:"Save"})]})]}),Object(j.jsx)(mm,{close:function(){return O(!1)}})]})})},gm=["title","titleId"];function ym(){return ym=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},ym.apply(this,arguments)}function bm(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 km(e,t){var n=e.title,r=e.titleId,o=bm(e,gm);return s.createElement("svg",ym({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,pm||(pm=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 wm=s.forwardRef(km),xm=(n.p,{addDetailsPopup:vm,reportPopup: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)(Kp,{className:"mr-2 h-[24px] w-[24px] fill-white"}):"sent"===o&&(l=Object(j.jsx)(wm,{className:"mr-2 h-[16px] w-[16px]"}));var c=function(e){n("closePopup")};return Object(j.jsxs)("div",{className:"rounded-none relative h-screen w-screen bg-white p-[28px] text-center shadow-modal sm:h-auto sm:w-[500px] sm:rounded-xl sm:p-8 sm:text-left",onMouseDown:function(e){e.stopPropagation()},children:[Object(j.jsxs)("h1",{className:"mb-1 font-sans text-[24px] font-bold tracking-tight text-black",children:["You want to report",Object(j.jsx)("span",{className:"hidden sm:inline",children:" this comment"}),"?"]}),Object(j.jsx)("p",{className:"text-base px-4 font-sans leading-9 text-neutral-500 sm:pr-4 sm:pl-0",children:"Your request will be sent to the owner of this site."}),Object(j.jsxs)("div",{className:"mt-10 flex flex-col items-center justify-start gap-4 sm:flex-row",children:[Object(j.jsxs)("button",{type:"button",className:"flex h-[44px] w-full items-center justify-center rounded-md px-4 font-sans text-[15px] font-semibold text-white transition duration-200 ease-linear sm:w-[200px] ".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)(mm,{close:function(){return c()}})]})}}),Dm=function(e){var t=e.show,n=e.children,r=e.title,o=e.callback,i=Object(s.useContext)(A).dispatchAction,a=function(e){i("closePopup"),o&&o(!1)};return Object(s.useEffect)((function(){var e=function(e){"Escape"===e.key&&a()};return window.addEventListener("keydown",e,{passive:!0}),function(){window.removeEventListener("keydown",e,{passive:!0})}})),Object(j.jsx)(Pp,{show:t,appear:!0,children:Object(j.jsx)(R,{title:r,children:Object(j.jsx)("div",{children:Object(j.jsx)(Pp.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:"to-rgba(0,0,0,0.1) fixed top-0 left-0 flex h-screen w-screen justify-center overflow-hidden bg-gradient-to-b from-[rgba(0,0,0,0.2)] pt-0 backdrop-blur-[2px] sm:pt-12",onMouseDown:a,children:Object(j.jsx)(Pp.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:n})})})})})})},Cm=["type"];function Em(){var e=Object(s.useContext)(A).popup,t=p(Object(s.useState)(e),2),n=t[0],r=t[1];if(Object(s.useEffect)((function(){if(null!==e&&r(e),null===e){var t=setTimeout((function(){r(null)}),250);return function(){clearTimeout(t)}}}),[e,r]),!n||!n.type)return null;var o=null!==e&&void 0!==e?e:n,u=o.type,l=a(o,Cm),c=xm[u];if(!c)return console.warn("Unknown popup of type ",u),null;var f=e===n;return Object(j.jsx)(j.Fragment,{children:Object(j.jsx)(Dm,{show:f,callback:l.callback,title:u,children:Object(j.jsx)(c,i({},l))})})}function Om(e){var t=e.adminUrl,n=e.onLoad;if(!t)return null;return Object(j.jsx)("iframe",{"data-frame":"admin-auth",src:t+"auth-frame/",style:{display:"none"},title:"auth-frame",onLoad:n})}function Sm(e){e.dsn;var t=e.children;return Object(j.jsx)(j.Fragment,{children:t})}var Am=function(e){D(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,secundaryFormCount:0},r.adminApi=null,r.GhostApi=null,r.dispatchAction=r.dispatchAction.bind(w(r)),r.initAdminAuth=r.initAdminAuth.bind(w(r)),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:if(!this.adminApi){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,this.adminApi=this.setupAdminAPI(),t=null,e.prev=5,e.next=8,this.adminApi.getUser();case 8:t=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),console.warn("[Comments] Failed to fetch current admin user:",e.t0);case 14:n={admin:t},this.setState(n),e.next=21;break;case 18:e.prev=18,e.t1=e.catch(2),console.error("[Comments] Failed to initialize admin authentication:",e.t1);case 21:case"end":return e.stop()}}),e,this,[[2,18],[5,11]])})));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:if(!Y(t)){e.next=3;break}return this.setState((function(e){return ee({action:t,data:n,state:e,api:i.GhostApi,adminApi:i.adminApi})})),e.abrupt("return");case 3:return clearTimeout(this.timeoutId),this.setState({action:"".concat(t,":running")}),e.prev=5,e.next=8,X({action:t,data:n,state:this.state,api:this.GhostApi,adminApi:this.adminApi});case 8:r=e.sent,this.setState(r),r&&r.action&&!r.action.includes(":failed")&&(this.timeoutId=setTimeout((function(){i.setState({action:""})}),2e3)),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(5),console.error(e.t0),o=ne({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 18:case"end":return e.stop()}}),e,this,[[5,13]])})));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||le({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),!ue(["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:if((t=e.sent)&&t.users){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",t.users[0]);case 6: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.state,t=e.action,n=e.popupNotification,r=e.customSiteUrl,o=e.member,i=e.comments,a=e.pagination,s=e.commentCount,u=e.postId,l=e.admin,c=e.popup,f=e.secundaryFormCount;return{action:t,popupNotification:n,customSiteUrl:r,member:o,admin:l,comments:i,pagination:a,commentCount:s,postId:u,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,secundaryFormCount:f,popup:c,dispatchAction:this.dispatchAction}}},{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)(Sm,{dsn:this.props.sentryDsn,children:Object(j.jsxs)(A.Provider,{value:this.getContextFromState(),children:[Object(j.jsx)(P,{children:Object(j.jsx)(um,{done:e})}),Object(j.jsx)(Om,{adminUrl:this.props.adminUrl,onLoad:this.initAdminAuth}),Object(j.jsx)(Em,{})]})})}}]),n}(u.a.Component),jm=["siteUrl"];function Mm(e){e.siteUrl;!function(){var e=document.querySelector("script[data-ghost-comments]");if(e){var t=document.createElement("div");t.id=ce,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,t=document.querySelector("script[data-ghost-comments]"),n=null===t||void 0===t?void 0:t.dataset;if(!t)return{};var r=n.ghostComments,o=n.key,i=n.api,a=n.admin,s=n.sentryDsn,u=n.postId,l=n.colorScheme,c=n.avatarSaturation,f=n.accentColor,d=n.appVersion,p=n.commentsEnabled;return{siteUrl:r,stylesUrl:n.styles,apiKey:o,apiUrl:i,sentryDsn:s,postId:u,adminUrl:a,colorScheme:l,avatarSaturation:c,accentColor:f,appVersion:d,commentsEnabled:p,title:"null"===n.title?null:n.title,showCount:"true"===n.count,publication:null!==(e=n.publication)&&void 0!==e?e:""}}(),t=e.siteUrl,n=a(e,jm),r=t||window.location.origin;try{Mm({siteUrl:r}),c.a.render(Object(j.jsx)(u.a.StrictMode,{children:Object(j.jsx)(Am,i({siteUrl:r,customSiteUrl:t},n))}),document.getElementById(ce))}catch(Rd){console.error(Rd)}}()}]);
|
|
3
3
|
//# sourceMappingURL=comments-ui.min.js.map
|