@zipify/wysiwyg 3.5.4-ai-prototype → 3.6.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cli.js +2 -2
  2. package/dist/wysiwyg.css +112 -248
  3. package/dist/wysiwyg.mjs +8128 -10207
  4. package/example/ExampleApp.vue +4 -4
  5. package/example/ai-component/AiComponent.vue +57 -0
  6. package/lib/Wysiwyg.vue +4 -6
  7. package/lib/components/base/Button.vue +10 -0
  8. package/lib/components/base/dropdown/Dropdown.vue +7 -1
  9. package/lib/components/base/dropdown/DropdownActivator.vue +22 -0
  10. package/lib/components/base/dropdown/__tests__/DropdownActivator.test.js +21 -1
  11. package/lib/components/base/index.js +0 -1
  12. package/lib/components/toolbar/Toolbar.vue +7 -1
  13. package/lib/components/toolbar/controls/AlignmentControl.vue +12 -1
  14. package/lib/components/toolbar/controls/FontColorControl.vue +12 -0
  15. package/lib/components/toolbar/controls/FontFamilyControl.vue +19 -4
  16. package/lib/components/toolbar/controls/FontSizeControl.vue +27 -4
  17. package/lib/components/toolbar/controls/FontWeightControl.vue +26 -4
  18. package/lib/components/toolbar/controls/ItalicControl.vue +11 -1
  19. package/lib/components/toolbar/controls/LineHeightControl.vue +11 -0
  20. package/lib/components/toolbar/controls/UnderlineControl.vue +10 -0
  21. package/lib/components/toolbar/controls/__tests__/AlignmentControl.test.js +43 -1
  22. package/lib/components/toolbar/controls/__tests__/FontColorControl.test.js +22 -1
  23. package/lib/components/toolbar/controls/__tests__/FontFamilyControl.test.js +2 -0
  24. package/lib/components/toolbar/controls/__tests__/FontSizeControl.test.js +9 -1
  25. package/lib/components/toolbar/controls/__tests__/FontWeightControl.test.js +9 -1
  26. package/lib/components/toolbar/controls/__tests__/ItalicControl.test.js +23 -1
  27. package/lib/components/toolbar/controls/__tests__/LineHeightControl.test.js +23 -1
  28. package/lib/components/toolbar/controls/__tests__/StylePresetControl.test.js +31 -13
  29. package/lib/components/toolbar/controls/__tests__/UnderlineControl.test.js +26 -1
  30. package/lib/components/toolbar/controls/index.js +1 -2
  31. package/lib/components/toolbar/controls/{StylePresetControl.vue → stylePreset/StylePresetControl.vue} +23 -8
  32. package/lib/components/toolbar/controls/stylePreset/StylePresetOption.vue +87 -0
  33. package/lib/components/toolbar/controls/stylePreset/index.js +1 -0
  34. package/lib/components/toolbar/layouts/ToolbarDesktop.vue +14 -5
  35. package/lib/components/toolbar/layouts/ToolbarPopup.vue +12 -0
  36. package/lib/entryLib.js +2 -0
  37. package/lib/extensions/index.js +0 -5
  38. package/lib/extensions/proseMirror/PastePlugin.js +4 -6
  39. package/lib/styles/dropdown.css +7 -0
  40. package/lib/styles/main.css +1 -0
  41. package/lib/styles/variables.css +1 -0
  42. package/package.json +1 -2
  43. package/example/aiAdapter.js +0 -52
  44. package/lib/assets/icons/loading.svg +0 -11
  45. package/lib/assets/icons/send.svg +0 -3
  46. package/lib/assets/icons/sparkles.svg +0 -3
  47. package/lib/components/base/TextArea.vue +0 -108
  48. package/lib/components/floatingMenu/AiWidgetSuggestionItem.vue +0 -74
  49. package/lib/components/floatingMenu/FloatingMenuControl.vue +0 -222
  50. package/lib/components/floatingMenu/index.js +0 -1
  51. package/lib/components/toolbar/controls/aiComponent/AiControl.vue +0 -204
  52. package/lib/components/toolbar/controls/aiComponent/AiControlHeader.vue +0 -28
  53. package/lib/components/toolbar/controls/aiComponent/AiSettings.vue +0 -153
  54. package/lib/components/toolbar/controls/aiComponent/AiSuggestionItem.vue +0 -84
  55. package/lib/extensions/AiComponent.js +0 -22
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Vue.js v2.7.14
4
4
  * (c) 2014-2022 Evan You
5
5
  * Released under the MIT License.
6
- */var J=Object.freeze({}),G=Array.isArray;function Y(t){return null==t}function X(t){return null!=t}function Z(t){return!0===t}function Q(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function tt(t){return"function"==typeof t}function et(t){return null!==t&&"object"==typeof t}var nt=Object.prototype.toString;function rt(t){return nt.call(t).slice(8,-1)}function ot(t){return"[object Object]"===nt.call(t)}function it(t){return"[object RegExp]"===nt.call(t)}function st(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function at(t){return X(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function lt(t){return null==t?"":Array.isArray(t)||ot(t)&&t.toString===nt?JSON.stringify(t,null,2):String(t)}function ct(t){var e=parseFloat(t);return isNaN(e)?t:e}function ut(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}var pt=ut("slot,component",!0),dt=ut("key,ref,slot,slot-scope,is");function ft(t,e){var n=t.length;if(n){if(e===t[n-1])return void(t.length=n-1);var r=t.indexOf(e);if(r>-1)return t.splice(r,1)}}var ht=Object.prototype.hasOwnProperty;function mt(t,e){return ht.call(t,e)}function gt(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var vt=/-(\w)/g,yt=gt((function(t){return t.replace(vt,(function(t,e){return e?e.toUpperCase():""}))})),_t=gt((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),bt=/\B([A-Z])/g,wt=gt((function(t){return t.replace(bt,"-$1").toLowerCase()}));var kt=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function xt(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function St(t,e){for(var n in e)t[n]=e[n];return t}function Et(t){for(var e={},n=0;n<t.length;n++)t[n]&&St(e,t[n]);return e}function Ot(t,e,n){}var Ct=function(t,e,n){return!1},At=function(t){return t};function Nt(t,e){if(t===e)return!0;var n=et(t),r=et(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=Array.isArray(t),i=Array.isArray(e);if(o&&i)return t.length===e.length&&t.every((function(t,n){return Nt(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||i)return!1;var s=Object.keys(t),a=Object.keys(e);return s.length===a.length&&s.every((function(n){return Nt(t[n],e[n])}))}catch(t){return!1}}function Tt(t,e){for(var n=0;n<t.length;n++)if(Nt(t[n],e))return n;return-1}function Mt(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function It(t,e){return t===e?0===t&&1/t!=1/e:t==t||e==e}var $t="data-server-rendered",Dt=["component","directive","filter"],Lt=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],Rt={optionMergeStrategies:Object.create(null),silent:!1,productionTip:"production"!==process.env.NODE_ENV,devtools:"production"!==process.env.NODE_ENV,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Ct,isReservedAttr:Ct,isUnknownElement:Ct,getTagNamespace:Ot,parsePlatformTagName:At,mustUseProp:Ct,async:!0,_lifecycleHooks:Lt},Pt=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function jt(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function zt(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var Ft=new RegExp("[^".concat(Pt.source,".$_\\d]"));var Ht="__proto__"in{},Vt="undefined"!=typeof window,Bt=Vt&&window.navigator.userAgent.toLowerCase(),Wt=Bt&&/msie|trident/.test(Bt),Ut=Bt&&Bt.indexOf("msie 9.0")>0,qt=Bt&&Bt.indexOf("edge/")>0;Bt&&Bt.indexOf("android");var Kt,Jt=Bt&&/iphone|ipad|ipod|ios/.test(Bt),Gt=Bt&&Bt.match(/firefox\/(\d+)/),Yt={}.watch,Xt=!1;if(Vt)try{var Zt={};Object.defineProperty(Zt,"passive",{get:function(){Xt=!0}}),window.addEventListener("test-passive",null,Zt)}catch(t){}var Qt=function(){return void 0===Kt&&(Kt=!Vt&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Kt},te=Vt&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(t){return"function"==typeof t&&/native code/.test(t.toString())}var ne,re="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);ne="undefined"!=typeof Set&&ee(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var oe=null;function ie(t){void 0===t&&(t=null),t||oe&&oe._scope.off(),oe=t,t&&t._scope.on()}var se=function(){function t(t,e,n,r,o,i,s,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),ae=function(t){void 0===t&&(t="");var e=new se;return e.text=t,e.isComment=!0,e};function le(t){return new se(void 0,void 0,void 0,String(t))}function ce(t){var e=new se(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var ue=function(){return ue=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ue.apply(this,arguments)},pe=0,de=[],fe=function(){function t(){this._pending=!1,this.id=pe++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,de.push(this))},t.prototype.depend=function(e){t.target&&(t.target.addDep(this),"production"!==process.env.NODE_ENV&&e&&t.target.onTrack&&t.target.onTrack(ue({effect:t.target},e)))},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));"production"===process.env.NODE_ENV||Rt.async||e.sort((function(t,e){return t.id-e.id}));for(var n=0,r=e.length;n<r;n++){var o=e[n];"production"!==process.env.NODE_ENV&&t&&o.onTrigger&&o.onTrigger(ue({effect:e[n]},t)),o.update()}},t}();fe.target=null;var he=[];function me(t){he.push(t),fe.target=t}function ge(){he.pop(),fe.target=he[he.length-1]}var ve=Array.prototype,ye=Object.create(ve);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){var e=ve[t];zt(ye,t,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o,i=e.apply(this,n),s=this.__ob__;switch(t){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&s.observeArray(o),"production"!==process.env.NODE_ENV?s.dep.notify({type:"array mutation",target:this,key:t}):s.dep.notify(),i}))}));var _e=Object.getOwnPropertyNames(ye),be={},we=!0;function ke(t){we=t}var xe={notify:Ot,depend:Ot,addSub:Ot,removeSub:Ot},Se=function(){function t(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!1),this.value=t,this.shallow=e,this.mock=n,this.dep=n?xe:new fe,this.vmCount=0,zt(t,"__ob__",this),G(t)){if(!n)if(Ht)t.__proto__=ye;else for(var r=0,o=_e.length;r<o;r++){zt(t,s=_e[r],ye[s])}e||this.observeArray(t)}else{var i=Object.keys(t);for(r=0;r<i.length;r++){var s;Oe(t,s=i[r],be,void 0,e,n)}}}return t.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)Ee(t[e],!1,this.mock)},t}();function Ee(t,e,n){return t&&mt(t,"__ob__")&&t.__ob__ instanceof Se?t.__ob__:!we||!n&&Qt()||!G(t)&&!ot(t)||!Object.isExtensible(t)||t.__v_skip||Re(t)||t instanceof se?void 0:new Se(t,e,n)}function Oe(t,e,n,r,o,i){var s=new fe,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var l=a&&a.get,c=a&&a.set;l&&!c||n!==be&&2!==arguments.length||(n=t[e]);var u=!o&&Ee(n,!1,i);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var r=l?l.call(t):n;return fe.target&&("production"!==process.env.NODE_ENV?s.depend({target:t,type:"get",key:e}):s.depend(),u&&(u.dep.depend(),G(r)&&Ne(r))),Re(r)&&!o?r.value:r},set:function(a){var p=l?l.call(t):n;if(It(p,a)){if("production"!==process.env.NODE_ENV&&r&&r(),c)c.call(t,a);else{if(l)return;if(!o&&Re(p)&&!Re(a))return void(p.value=a);n=a}u=!o&&Ee(a,!1,i),"production"!==process.env.NODE_ENV?s.notify({type:"set",target:t,key:e,newValue:a,oldValue:p}):s.notify()}}}),s}}function Ce(t,e,n){if("production"!==process.env.NODE_ENV&&(Y(t)||Q(t))&&Fr("Cannot set reactive property on undefined, null, or primitive value: ".concat(t)),!De(t)){var r=t.__ob__;return G(t)&&st(e)?(t.length=Math.max(t.length,e),t.splice(e,1,n),r&&!r.shallow&&r.mock&&Ee(n,!1,!0),n):e in t&&!(e in Object.prototype)?(t[e]=n,n):t._isVue||r&&r.vmCount?("production"!==process.env.NODE_ENV&&Fr("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),n):r?(Oe(r.value,e,n,void 0,r.shallow,r.mock),"production"!==process.env.NODE_ENV?r.dep.notify({type:"add",target:t,key:e,newValue:n,oldValue:void 0}):r.dep.notify(),n):(t[e]=n,n)}"production"!==process.env.NODE_ENV&&Fr('Set operation on key "'.concat(e,'" failed: target is readonly.'))}function Ae(t,e){if("production"!==process.env.NODE_ENV&&(Y(t)||Q(t))&&Fr("Cannot delete reactive property on undefined, null, or primitive value: ".concat(t)),G(t)&&st(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount?"production"!==process.env.NODE_ENV&&Fr("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):De(t)?"production"!==process.env.NODE_ENV&&Fr('Delete operation on key "'.concat(e,'" failed: target is readonly.')):mt(t,e)&&(delete t[e],n&&("production"!==process.env.NODE_ENV?n.dep.notify({type:"delete",target:t,key:e}):n.dep.notify()))}}function Ne(t){for(var e=void 0,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),G(e)&&Ne(e)}function Te(t){return Me(t,!0),zt(t,"__v_isShallow",!0),t}function Me(t,e){if(!De(t)){if("production"!==process.env.NODE_ENV){G(t)&&Fr("Avoid using Array as root value for ".concat(e?"shallowReactive()":"reactive()"," as it cannot be tracked in watch() or watchEffect(). Use ").concat(e?"shallowRef()":"ref()"," instead. This is a Vue-2-only limitation."));var n=t&&t.__ob__;n&&n.shallow!==e&&Fr("Target is already a ".concat(n.shallow?"":"non-","shallow reactive object, and cannot be converted to ").concat(e?"":"non-","shallow."))}var r=Ee(t,e,Qt());"production"===process.env.NODE_ENV||r||((null==t||Q(t))&&Fr("value cannot be made reactive: ".concat(String(t))),("Map"===(o=rt(t))||"WeakMap"===o||"Set"===o||"WeakSet"===o)&&Fr("Vue 2 does not support reactive collection types such as Map or Set."))}var o}function Ie(t){return De(t)?Ie(t.__v_raw):!(!t||!t.__ob__)}function $e(t){return!(!t||!t.__v_isShallow)}function De(t){return!(!t||!t.__v_isReadonly)}var Le="__v_isRef";function Re(t){return!(!t||!0!==t.__v_isRef)}function Pe(t){return function(t,e){if(Re(t))return t;var n={};return zt(n,Le,!0),zt(n,"__v_isShallow",e),zt(n,"dep",Oe(n,"value",t,null,e,Qt())),n}(t,!1)}function je(t){return Re(t)?t.value:t}function ze(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var t=e[n];if(Re(t))return t.value;var r=t&&t.__ob__;return r&&r.dep.depend(),t},set:function(t){var r=e[n];Re(r)&&!Re(t)?r.value=t:e[n]=t}})}function Fe(t,e,n){var r=t[e];if(Re(r))return r;var o={get value(){var r=t[e];return void 0===r?n:r},set value(n){t[e]=n}};return zt(o,Le,!0),o}function He(t,e){var n,r,o=tt(t);o?(n=t,r="production"!==process.env.NODE_ENV?function(){Fr("Write operation failed: computed value is readonly")}:Ot):(n=t.get,r=t.set);var i=Qt()?null:new nr(oe,n,Ot,{lazy:!0});"production"!==process.env.NODE_ENV&&i&&e&&(i.onTrack=e.onTrack,i.onTrigger=e.onTrigger);var s={effect:i,get value(){return i?(i.dirty&&i.evaluate(),fe.target&&("production"!==process.env.NODE_ENV&&fe.target.onTrack&&fe.target.onTrack({effect:fe.target,target:s,type:"get",key:"value"}),i.depend()),i.value):n()},set value(t){r(t)}};return zt(s,Le,!0),zt(s,"__v_isReadonly",o),s}var Ve,Be="watcher",We="".concat(Be," callback"),Ue="".concat(Be," getter"),qe="".concat(Be," cleanup"),Ke={};function Je(t,e,n){return"production"!==process.env.NODE_ENV&&"function"!=typeof e&&Fr("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),function(t,e,n){var r=void 0===n?J:n,o=r.immediate,i=r.deep,s=r.flush,a=void 0===s?"pre":s,l=r.onTrack,c=r.onTrigger;"production"===process.env.NODE_ENV||e||(void 0!==o&&Fr('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==i&&Fr('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));var u,p,d=function(t){Fr("Invalid watch source: ".concat(t,". A watch source can only be a getter/effect ")+"function, a ref, a reactive object, or an array of these types.")},f=oe,h=function(t,e,n){return void 0===n&&(n=null),Rn(t,null,n,f,e)},m=!1,g=!1;Re(t)?(u=function(){return t.value},m=$e(t)):Ie(t)?(u=function(){return t.__ob__.dep.depend(),t},i=!0):G(t)?(g=!0,m=t.some((function(t){return Ie(t)||$e(t)})),u=function(){return t.map((function(t){return Re(t)?t.value:Ie(t)?Yn(t):tt(t)?h(t,Ue):void("production"!==process.env.NODE_ENV&&d(t))}))}):tt(t)?u=e?function(){return h(t,Ue)}:function(){if(!f||!f._isDestroyed)return p&&p(),h(t,Be,[y])}:(u=Ot,"production"!==process.env.NODE_ENV&&d(t));if(e&&i){var v=u;u=function(){return Yn(v())}}var y=function(t){p=_.onStop=function(){h(t,qe)}};if(Qt())return y=Ot,e?o&&h(e,We,[u(),g?[]:void 0,y]):u(),Ot;var _=new nr(oe,u,Ot,{lazy:!0});_.noRecurse=!e;var b=g?[]:Ke;_.run=function(){if(_.active)if(e){var t=_.get();(i||m||(g?t.some((function(t,e){return It(t,b[e])})):It(t,b)))&&(p&&p(),h(e,We,[t,b===Ke?void 0:b,y]),b=t)}else _.get()},"sync"===a?_.update=_.run:"post"===a?(_.post=!0,_.update=function(){return Cr(_)}):_.update=function(){if(f&&f===oe&&!f._isMounted){var t=f._preWatchers||(f._preWatchers=[]);t.indexOf(_)<0&&t.push(_)}else Cr(_)};"production"!==process.env.NODE_ENV&&(_.onTrack=l,_.onTrigger=c);e?o?_.run():b=_.get():"post"===a&&f?f.$once("hook:mounted",(function(){return _.get()})):_.get();return function(){_.teardown()}}(t,e,n)}var Ge=function(){function t(t){void 0===t&&(t=!1),this.detached=t,this.active=!0,this.effects=[],this.cleanups=[],this.parent=Ve,!t&&Ve&&(this.index=(Ve.scopes||(Ve.scopes=[])).push(this)-1)}return t.prototype.run=function(t){if(this.active){var e=Ve;try{return Ve=this,t()}finally{Ve=e}}else"production"!==process.env.NODE_ENV&&Fr("cannot run an inactive effect scope.")},t.prototype.on=function(){Ve=this},t.prototype.off=function(){Ve=this.parent},t.prototype.stop=function(t){if(this.active){var e=void 0,n=void 0;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].teardown();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){var r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this.active=!1}},t}();var Ye=gt((function(t){var e="&"===t.charAt(0),n="~"===(t=e?t.slice(1):t).charAt(0),r="!"===(t=n?t.slice(1):t).charAt(0);return{name:t=r?t.slice(1):t,once:n,capture:r,passive:e}}));function Xe(t,e){function n(){var t=n.fns;if(!G(t))return Rn(t,null,arguments,e,"v-on handler");for(var r=t.slice(),o=0;o<r.length;o++)Rn(r[o],null,arguments,e,"v-on handler")}return n.fns=t,n}function Ze(t,e,n,r,o,i){var s,a,l,c;for(s in t)a=t[s],l=e[s],c=Ye(s),Y(a)?"production"!==process.env.NODE_ENV&&Fr('Invalid handler for event "'.concat(c.name,'": got ')+String(a),i):Y(l)?(Y(a.fns)&&(a=t[s]=Xe(a,i)),Z(c.once)&&(a=t[s]=o(c.name,a,c.capture)),n(c.name,a,c.capture,c.passive,c.params)):a!==l&&(l.fns=a,t[s]=l);for(s in e)Y(t[s])&&r((c=Ye(s)).name,e[s],c.capture)}function Qe(t,e,n){var r;t instanceof se&&(t=t.data.hook||(t.data.hook={}));var o=t[e];function i(){n.apply(this,arguments),ft(r.fns,i)}Y(o)?r=Xe([i]):X(o.fns)&&Z(o.merged)?(r=o).fns.push(i):r=Xe([o,i]),r.merged=!0,t[e]=r}function tn(t,e,n,r,o){if(X(e)){if(mt(e,n))return t[n]=e[n],o||delete e[n],!0;if(mt(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function en(t){return Q(t)?[le(t)]:G(t)?rn(t):void 0}function nn(t){return X(t)&&X(t.text)&&!1===t.isComment}function rn(t,e){var n,r,o,i,s=[];for(n=0;n<t.length;n++)Y(r=t[n])||"boolean"==typeof r||(i=s[o=s.length-1],G(r)?r.length>0&&(nn((r=rn(r,"".concat(e||"","_").concat(n)))[0])&&nn(i)&&(s[o]=le(i.text+r[0].text),r.shift()),s.push.apply(s,r)):Q(r)?nn(i)?s[o]=le(i.text+r):""!==r&&s.push(le(r)):nn(r)&&nn(i)?s[o]=le(i.text+r.text):(Z(t._isVList)&&X(r.tag)&&Y(r.key)&&X(e)&&(r.key="__vlist".concat(e,"_").concat(n,"__")),s.push(r)));return s}function on(t,e){var n,r,o,i,s=null;if(G(t)||"string"==typeof t)for(s=new Array(t.length),n=0,r=t.length;n<r;n++)s[n]=e(t[n],n);else if("number"==typeof t)for(s=new Array(t),n=0;n<t;n++)s[n]=e(n+1,n);else if(et(t))if(re&&t[Symbol.iterator]){s=[];for(var a=t[Symbol.iterator](),l=a.next();!l.done;)s.push(e(l.value,s.length)),l=a.next()}else for(o=Object.keys(t),s=new Array(o.length),n=0,r=o.length;n<r;n++)i=o[n],s[n]=e(t[i],i,n);return X(s)||(s=[]),s._isVList=!0,s}function sn(t,e,n,r){var o,i=this.$scopedSlots[t];i?(n=n||{},r&&("production"===process.env.NODE_ENV||et(r)||Fr("slot v-bind without argument expects an Object",this),n=St(St({},r),n)),o=i(n)||(tt(e)?e():e)):o=this.$slots[t]||(tt(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function an(t){return Qr(this.$options,"filters",t,!0)||At}function ln(t,e){return G(t)?-1===t.indexOf(e):t!==e}function cn(t,e,n,r,o){var i=Rt.keyCodes[e]||n;return o&&r&&!Rt.keyCodes[e]?ln(o,r):i?ln(i,t):r?wt(r)!==e:void 0===t}function un(t,e,n,r,o){if(n)if(et(n)){G(n)&&(n=Et(n));var i=void 0,s=function(s){if("class"===s||"style"===s||dt(s))i=t;else{var a=t.attrs&&t.attrs.type;i=r||Rt.mustUseProp(e,a,s)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var l=yt(s),c=wt(s);l in i||c in i||(i[s]=n[s],o&&((t.on||(t.on={}))["update:".concat(s)]=function(t){n[s]=t}))};for(var a in n)s(a)}else"production"!==process.env.NODE_ENV&&Fr("v-bind without argument expects an Object or Array value",this);return t}function pn(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||fn(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),"__static__".concat(t),!1),r}function dn(t,e,n){return fn(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function fn(t,e,n){if(G(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&hn(t[r],"".concat(e,"_").concat(r),n);else hn(t,e,n)}function hn(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function mn(t,e){if(e)if(ot(e)){var n=t.on=t.on?St({},t.on):{};for(var r in e){var o=n[r],i=e[r];n[r]=o?[].concat(o,i):i}}else"production"!==process.env.NODE_ENV&&Fr("v-on without argument expects an Object value",this);return t}function gn(t,e,n,r){e=e||{$stable:!n};for(var o=0;o<t.length;o++){var i=t[o];G(i)?gn(i,e,n):i&&(i.proxy&&(i.fn.proxy=!0),e[i.key]=i.fn)}return r&&(e.$key=r),e}function vn(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];"string"==typeof r&&r?t[e[n]]=e[n+1]:"production"!==process.env.NODE_ENV&&""!==r&&null!==r&&Fr("Invalid value for dynamic directive argument (expected string or null): ".concat(r),this)}return t}function yn(t,e){return"string"==typeof t?e+t:t}function _n(t){t._o=dn,t._n=ct,t._s=lt,t._l=on,t._t=sn,t._q=Nt,t._i=Tt,t._m=pn,t._f=an,t._k=cn,t._b=un,t._v=le,t._e=ae,t._u=gn,t._g=mn,t._d=vn,t._p=yn}function bn(t,e){if(!t||!t.length)return{};for(var n={},r=0,o=t.length;r<o;r++){var i=t[r],s=i.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,i.context!==e&&i.fnContext!==e||!s||null==s.slot)(n.default||(n.default=[])).push(i);else{var a=s.slot,l=n[a]||(n[a]=[]);"template"===i.tag?l.push.apply(l,i.children||[]):l.push(i)}}for(var c in n)n[c].every(wn)&&delete n[c];return n}function wn(t){return t.isComment&&!t.asyncFactory||" "===t.text}function kn(t){return t.isComment&&t.asyncFactory}function xn(t,e,n,r){var o,i=Object.keys(n).length>0,s=e?!!e.$stable:!i,a=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&r&&r!==J&&a===r.$key&&!i&&!r.$hasNormal)return r;for(var l in o={},e)e[l]&&"$"!==l[0]&&(o[l]=Sn(t,n,l,e[l]))}else o={};for(var c in n)c in o||(o[c]=En(n,c));return e&&Object.isExtensible(e)&&(e._normalized=o),zt(o,"$stable",s),zt(o,"$key",a),zt(o,"$hasNormal",i),o}function Sn(t,e,n,r){var o=function(){var e=oe;ie(t);var n=arguments.length?r.apply(null,arguments):r({}),o=(n=n&&"object"==typeof n&&!G(n)?[n]:en(n))&&n[0];return ie(e),n&&(!o||1===n.length&&o.isComment&&!kn(o))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:o,enumerable:!0,configurable:!0}),o}function En(t,e){return function(){return t[e]}}function On(t){var e=t.$options,n=e.setup;if(n){var r=t._setupContext=function(t){var e=!1;return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};zt(e,"_v_attr_proxy",!0),Cn(e,t.$attrs,J,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||Cn(t._listenersProxy={},t.$listeners,J,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||Nn(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:kt(t.$emit,t),expose:function(n){"production"!==process.env.NODE_ENV&&(e&&Fr("expose() should be called only once per setup().",t),e=!0),n&&Object.keys(n).forEach((function(e){return ze(t,n,e)}))}}}(t);ie(t),me();var o=Rn(n,null,[t._props||Te({}),r],t,"setup");if(ge(),ie(),tt(o))e.render=o;else if(et(o))if("production"!==process.env.NODE_ENV&&o instanceof se&&Fr("setup() should not return VNodes directly - return a render function instead."),t._setupState=o,o.__sfc){var i=t._setupProxy={};for(var s in o)"__sfc"!==s&&ze(i,o,s)}else for(var s in o)jt(s)?"production"!==process.env.NODE_ENV&&Fr("Avoid using variables that start with _ or $ in setup()."):ze(t,o,s);else"production"!==process.env.NODE_ENV&&void 0!==o&&Fr("setup() should return an object. Received: ".concat(null===o?"null":typeof o))}}function Cn(t,e,n,r,o){var i=!1;for(var s in e)s in t?e[s]!==n[s]&&(i=!0):(i=!0,An(t,s,r,o));for(var s in t)s in e||(i=!0,delete t[s]);return i}function An(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function Nn(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var Tn=null;function Mn(t,e){return(t.__esModule||re&&"Module"===t[Symbol.toStringTag])&&(t=t.default),et(t)?e.extend(t):t}function In(t){if(G(t))for(var e=0;e<t.length;e++){var n=t[e];if(X(n)&&(X(n.componentOptions)||kn(n)))return n}}function $n(t,e,n,r,o,i){return(G(n)||Q(n))&&(o=r,r=n,n=void 0),Z(i)&&(o=2),function(t,e,n,r,o){if(X(n)&&X(n.__ob__))return"production"!==process.env.NODE_ENV&&Fr("Avoid using observed data object as vnode data: ".concat(JSON.stringify(n),"\n")+"Always create fresh vnode data objects in each render!",t),ae();X(n)&&X(n.is)&&(e=n.is);if(!e)return ae();"production"!==process.env.NODE_ENV&&X(n)&&X(n.key)&&!Q(n.key)&&Fr("Avoid using non-primitive value as key, use string/number value instead.",t);G(r)&&tt(r[0])&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);2===o?r=en(r):1===o&&(r=function(t){for(var e=0;e<t.length;e++)if(G(t[e]))return Array.prototype.concat.apply([],t);return t}(r));var i,s;if("string"==typeof e){var a=void 0;s=t.$vnode&&t.$vnode.ns||Rt.getTagNamespace(e),Rt.isReservedTag(e)?("production"!==process.env.NODE_ENV&&X(n)&&X(n.nativeOn)&&"component"!==n.tag&&Fr("The .native modifier for v-on is only valid on components but it was used on <".concat(e,">."),t),i=new se(Rt.parsePlatformTagName(e),n,r,void 0,void 0,t)):i=n&&n.pre||!X(a=Qr(t.$options,"components",e))?new se(e,n,r,void 0,void 0,t):Rr(a,n,t,r,e)}else i=Rr(e,n,t,r);return G(i)?i:X(i)?(X(s)&&Dn(i,s),X(n)&&function(t){et(t.style)&&Yn(t.style);et(t.class)&&Yn(t.class)}(n),i):ae()}(t,e,n,r,o)}function Dn(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),X(t.children))for(var r=0,o=t.children.length;r<o;r++){var i=t.children[r];X(i.tag)&&(Y(i.ns)||Z(n)&&"svg"!==i.tag)&&Dn(i,e,n)}}function Ln(t,e,n){me();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,t,e,n))return}catch(t){Pn(t,r,"errorCaptured hook")}}Pn(t,e,n)}finally{ge()}}function Rn(t,e,n,r,o){var i;try{(i=n?t.apply(e,n):t.call(e))&&!i._isVue&&at(i)&&!i._handled&&(i.catch((function(t){return Ln(t,r,o+" (Promise/async)")})),i._handled=!0)}catch(t){Ln(t,r,o)}return i}function Pn(t,e,n){if(Rt.errorHandler)try{return Rt.errorHandler.call(null,t,e,n)}catch(e){e!==t&&jn(e,null,"config.errorHandler")}jn(t,e,n)}function jn(t,e,n){if("production"!==process.env.NODE_ENV&&Fr("Error in ".concat(n,': "').concat(t.toString(),'"'),e),!Vt||"undefined"==typeof console)throw t;console.error(t)}var zn,Fn=!1,Hn=[],Vn=!1;function Bn(){Vn=!1;var t=Hn.slice(0);Hn.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&ee(Promise)){var Wn=Promise.resolve();zn=function(){Wn.then(Bn),Jt&&setTimeout(Ot)},Fn=!0}else if(Wt||"undefined"==typeof MutationObserver||!ee(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())zn="undefined"!=typeof setImmediate&&ee(setImmediate)?function(){setImmediate(Bn)}:function(){setTimeout(Bn,0)};else{var Un=1,qn=new MutationObserver(Bn),Kn=document.createTextNode(String(Un));qn.observe(Kn,{characterData:!0}),zn=function(){Un=(Un+1)%2,Kn.data=String(Un)},Fn=!0}function Jn(t,e){var n;if(Hn.push((function(){if(t)try{t.call(e)}catch(t){Ln(t,e,"nextTick")}else n&&n(e)})),Vn||(Vn=!0,zn()),!t&&"undefined"!=typeof Promise)return new Promise((function(t){n=t}))}var Gn=new ne;function Yn(t){return Xn(t,Gn),Gn.clear(),t}function Xn(t,e){var n,r,o=G(t);if(!(!o&&!et(t)||t.__v_skip||Object.isFrozen(t)||t instanceof se)){if(t.__ob__){var i=t.__ob__.dep.id;if(e.has(i))return;e.add(i)}if(o)for(n=t.length;n--;)Xn(t[n],e);else if(Re(t))Xn(t.value,e);else for(n=(r=Object.keys(t)).length;n--;)Xn(t[r[n]],e)}}var Zn,Qn,tr,er=0,nr=function(){function t(t,e,n,r,o){var i,s;i=this,void 0===(s=Ve&&!Ve._vm?Ve:t?t._scope:void 0)&&(s=Ve),s&&s.active&&s.effects.push(i),(this.vm=t)&&o&&(t._watcher=this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before,"production"!==process.env.NODE_ENV&&(this.onTrack=r.onTrack,this.onTrigger=r.onTrigger)):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++er,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ne,this.newDepIds=new ne,this.expression="production"!==process.env.NODE_ENV?e.toString():"",tt(e)?this.getter=e:(this.getter=function(t){if(!Ft.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}(e),this.getter||(this.getter=Ot,"production"!==process.env.NODE_ENV&&Fr('Failed watching path: "'.concat(e,'" ')+"Watcher only accepts simple dot-delimited paths. For full control, use a function instead.",t))),this.value=this.lazy?void 0:this.get()}return t.prototype.get=function(){var t;me(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;Ln(t,e,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&Yn(t),ge(),this.cleanupDeps()}return t},t.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},t.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},t.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Cr(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||et(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');Rn(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&ft(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();if("production"!==process.env.NODE_ENV){var rr=Vt&&window.performance;rr&&rr.mark&&rr.measure&&rr.clearMarks&&rr.clearMeasures&&(Zn=function(t){return rr.mark(t)},Qn=function(t,e,n){rr.measure(t,e,n),rr.clearMarks(e),rr.clearMarks(n)})}function or(t,e){tr.$on(t,e)}function ir(t,e){tr.$off(t,e)}function sr(t,e){var n=tr;return function r(){var o=e.apply(null,arguments);null!==o&&n.$off(t,r)}}function ar(t,e,n){tr=t,Ze(e,n||{},or,ir,sr,t),tr=void 0}var lr=null,cr=!1;function ur(t){var e=lr;return lr=t,function(){lr=e}}function pr(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function dr(t,e){if(e){if(t._directInactive=!1,pr(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)dr(t.$children[n]);hr(t,"activated")}}function fr(t,e){if(!(e&&(t._directInactive=!0,pr(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)fr(t.$children[n]);hr(t,"deactivated")}}function hr(t,e,n,r){void 0===r&&(r=!0),me();var o=oe;r&&ie(t);var i=t.$options[e],s="".concat(e," hook");if(i)for(var a=0,l=i.length;a<l;a++)Rn(i[a],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),r&&ie(o),ge()}var mr=[],gr=[],vr={},yr={},_r=!1,br=!1,wr=0;var kr=0,xr=Date.now;if(Vt&&!Wt){var Sr=window.performance;Sr&&"function"==typeof Sr.now&&xr()>document.createEvent("Event").timeStamp&&(xr=function(){return Sr.now()})}var Er=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Or(){var t,e;for(kr=xr(),br=!0,mr.sort(Er),wr=0;wr<mr.length;wr++)if((t=mr[wr]).before&&t.before(),e=t.id,vr[e]=null,t.run(),"production"!==process.env.NODE_ENV&&null!=vr[e]&&(yr[e]=(yr[e]||0)+1,yr[e]>100)){Fr("You may have an infinite update loop "+(t.user?'in watcher with expression "'.concat(t.expression,'"'):"in a component render function."),t.vm);break}var n=gr.slice(),r=mr.slice();wr=mr.length=gr.length=0,vr={},"production"!==process.env.NODE_ENV&&(yr={}),_r=br=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,dr(t[e],!0)}(n),function(t){var e=t.length;for(;e--;){var n=t[e],r=n.vm;r&&r._watcher===n&&r._isMounted&&!r._isDestroyed&&hr(r,"updated")}}(r),function(){for(var t=0;t<de.length;t++){var e=de[t];e.subs=e.subs.filter((function(t){return t})),e._pending=!1}de.length=0}(),te&&Rt.devtools&&te.emit("flush")}function Cr(t){var e=t.id;if(null==vr[e]&&(t!==fe.target||!t.noRecurse)){if(vr[e]=!0,br){for(var n=mr.length-1;n>wr&&mr[n].id>t.id;)n--;mr.splice(n+1,0,t)}else mr.push(t);if(!_r){if(_r=!0,"production"!==process.env.NODE_ENV&&!Rt.async)return void Or();Jn(Or)}}}function Ar(t){var e=t.$options.provide;if(e){var n=tt(e)?e.call(t):e;if(!et(n))return;for(var r=function(t){var e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}(t),o=re?Reflect.ownKeys(n):Object.keys(n),i=0;i<o.length;i++){var s=o[i];Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(n,s))}}}function Nr(t,e){if(t){for(var n=Object.create(null),r=re?Reflect.ownKeys(t):Object.keys(t),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){var s=t[i].from;if(s in e._provided)n[i]=e._provided[s];else if("default"in t[i]){var a=t[i].default;n[i]=tt(a)?a.call(e):a}else"production"!==process.env.NODE_ENV&&Fr('Injection "'.concat(i,'" not found'),e)}}return n}}function Tr(t,e,n,r,o){var i,s=this,a=o.options;mt(r,"_uid")?(i=Object.create(r))._original=r:(i=r,r=r._original);var l=Z(a._compiled),c=!l;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||J,this.injections=Nr(a.inject,r),this.slots=function(){return s.$slots||xn(r,t.scopedSlots,s.$slots=bn(n,r)),s.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return xn(r,t.scopedSlots,this.slots())}}),l&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=xn(r,t.scopedSlots,this.$slots)),a._scopeId?this._c=function(t,e,n,o){var s=$n(i,t,e,n,o,c);return s&&!G(s)&&(s.fnScopeId=a._scopeId,s.fnContext=r),s}:this._c=function(t,e,n,r){return $n(i,t,e,n,r,c)}}function Mr(t,e,n,r,o){var i=ce(t);return i.fnContext=n,i.fnOptions=r,"production"!==process.env.NODE_ENV&&((i.devtoolsMeta=i.devtoolsMeta||{}).renderContext=o),e.slot&&((i.data||(i.data={})).slot=e.slot),i}function Ir(t,e){for(var n in e)t[yt(n)]=e[n]}function $r(t){return t.name||t.__name||t._componentTag}_n(Tr.prototype);var Dr={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Dr.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;X(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,lr)).$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var n=e.componentOptions;!function(t,e,n,r,o){"production"!==process.env.NODE_ENV&&(cr=!0);var i=r.data.scopedSlots,s=t.$scopedSlots,a=!!(i&&!i.$stable||s!==J&&!s.$stable||i&&t.$scopedSlots.$key!==i.$key||!i&&t.$scopedSlots.$key),l=!!(o||t.$options._renderChildren||a),c=t.$vnode;t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=o;var u=r.data.attrs||J;t._attrsProxy&&Cn(t._attrsProxy,u,c.data&&c.data.attrs||J,t,"$attrs")&&(l=!0),t.$attrs=u,n=n||J;var p=t.$options._parentListeners;if(t._listenersProxy&&Cn(t._listenersProxy,n,p||J,t,"$listeners"),t.$listeners=t.$options._parentListeners=n,ar(t,n,p),e&&t.$options.props){ke(!1);for(var d=t._props,f=t.$options._propKeys||[],h=0;h<f.length;h++){var m=f[h],g=t.$options.props;d[m]=to(m,g,e,t)}ke(!0),t.$options.propsData=e}l&&(t.$slots=bn(o,r.context),t.$forceUpdate()),"production"!==process.env.NODE_ENV&&(cr=!1)}(e.componentInstance=t.componentInstance,n.propsData,n.listeners,e,n.children)},insert:function(t){var e,n=t.context,r=t.componentInstance;r._isMounted||(r._isMounted=!0,hr(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,gr.push(e)):dr(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?fr(e,!0):e.$destroy())}},Lr=Object.keys(Dr);function Rr(t,e,n,r,o){if(!Y(t)){var i=n.$options._base;if(et(t)&&(t=i.extend(t)),"function"==typeof t){var s;if(Y(t.cid)&&(t=function(t,e){if(Z(t.error)&&X(t.errorComp))return t.errorComp;if(X(t.resolved))return t.resolved;var n=Tn;if(n&&X(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),Z(t.loading)&&X(t.loadingComp))return t.loadingComp;if(n&&!X(t.owners)){var r=t.owners=[n],o=!0,i=null,s=null;n.$on("hook:destroyed",(function(){return ft(r,n)}));var a=function(t){for(var e=0,n=r.length;e<n;e++)r[e].$forceUpdate();t&&(r.length=0,null!==i&&(clearTimeout(i),i=null),null!==s&&(clearTimeout(s),s=null))},l=Mt((function(n){t.resolved=Mn(n,e),o?r.length=0:a(!0)})),c=Mt((function(e){"production"!==process.env.NODE_ENV&&Fr("Failed to resolve async component: ".concat(String(t))+(e?"\nReason: ".concat(e):"")),X(t.errorComp)&&(t.error=!0,a(!0))})),u=t(l,c);return et(u)&&(at(u)?Y(t.resolved)&&u.then(l,c):at(u.component)&&(u.component.then(l,c),X(u.error)&&(t.errorComp=Mn(u.error,e)),X(u.loading)&&(t.loadingComp=Mn(u.loading,e),0===u.delay?t.loading=!0:i=setTimeout((function(){i=null,Y(t.resolved)&&Y(t.error)&&(t.loading=!0,a(!1))}),u.delay||200)),X(u.timeout)&&(s=setTimeout((function(){s=null,Y(t.resolved)&&c("production"!==process.env.NODE_ENV?"timeout (".concat(u.timeout,"ms)"):null)}),u.timeout)))),o=!1,t.loading?t.loadingComp:t.resolved}}(s=t,i),void 0===t))return function(t,e,n,r,o){var i=ae();return i.asyncFactory=t,i.asyncMeta={data:e,context:n,children:r,tag:o},i}(s,e,n,r,o);e=e||{},Ao(t),X(e.model)&&function(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var o=e.on||(e.on={}),i=o[r],s=e.model.callback;X(i)?(G(i)?-1===i.indexOf(s):i!==s)&&(o[r]=[s].concat(i)):o[r]=s}(t.options,e);var a=function(t,e,n){var r=e.options.props;if(!Y(r)){var o={},i=t.attrs,s=t.props;if(X(i)||X(s))for(var a in r){var l=wt(a);if("production"!==process.env.NODE_ENV){var c=a.toLowerCase();a!==c&&i&&mt(i,c)&&Hr('Prop "'.concat(c,'" is passed to component ')+"".concat(zr(n||e),", but the declared prop name is")+' "'.concat(a,'". ')+"Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM "+'templates. You should probably use "'.concat(l,'" instead of "').concat(a,'".'))}tn(o,s,a,l,!0)||tn(o,i,a,l,!1)}return o}}(e,t,o);if(Z(t.options.functional))return function(t,e,n,r,o){var i=t.options,s={},a=i.props;if(X(a))for(var l in a)s[l]=to(l,a,e||J);else X(n.attrs)&&Ir(s,n.attrs),X(n.props)&&Ir(s,n.props);var c=new Tr(n,s,o,r,t),u=i.render.call(null,c._c,c);if(u instanceof se)return Mr(u,n,c.parent,i,c);if(G(u)){for(var p=en(u)||[],d=new Array(p.length),f=0;f<p.length;f++)d[f]=Mr(p[f],n,c.parent,i,c);return d}}(t,a,e,n,r);var l=e.on;if(e.on=e.nativeOn,Z(t.options.abstract)){var c=e.slot;e={},c&&(e.slot=c)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<Lr.length;n++){var r=Lr[n],o=e[r],i=Dr[r];o===i||o&&o._merged||(e[r]=o?Pr(i,o):i)}}(e);var u=$r(t.options)||o;return new se("vue-component-".concat(t.cid).concat(u?"-".concat(u):""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:a,listeners:l,tag:o,children:r},s)}"production"!==process.env.NODE_ENV&&Fr("Invalid Component definition: ".concat(String(t)),n)}}function Pr(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}var jr,zr,Fr=Ot,Hr=Ot;if("production"!==process.env.NODE_ENV){var Vr="undefined"!=typeof console,Br=/(?:^|[-_])(\w)/g;Fr=function(t,e){void 0===e&&(e=oe);var n=e?jr(e):"";Rt.warnHandler?Rt.warnHandler.call(null,t,e,n):Vr&&!Rt.silent&&console.error("[Vue warn]: ".concat(t).concat(n))},Hr=function(t,e){Vr&&!Rt.silent&&console.warn("[Vue tip]: ".concat(t)+(e?jr(e):""))},zr=function(t,e){if(t.$root===t)return"<Root>";var n=tt(t)&&null!=t.cid?t.options:t._isVue?t.$options||t.constructor.options:t,r=$r(n),o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<".concat(r.replace(Br,(function(t){return t.toUpperCase()})).replace(/[-_]/g,""),">"):"<Anonymous>")+(o&&!1!==e?" at ".concat(o):"")};jr=function(t){if(t._isVue&&t.$parent){for(var e=[],n=0;t;){if(e.length>0){var r=e[e.length-1];if(r.constructor===t.constructor){n++,t=t.$parent;continue}n>0&&(e[e.length-1]=[r,n],n=0)}e.push(t),t=t.$parent}return"\n\nfound in\n\n"+e.map((function(t,e){return"".concat(0===e?"---\x3e ":function(t,e){for(var n="";e;)e%2==1&&(n+=t),e>1&&(t+=t),e>>=1;return n}(" ",5+2*e)).concat(G(t)?"".concat(zr(t[0]),"... (").concat(t[1]," recursive calls)"):zr(t))})).join("\n")}return"\n\n(found in ".concat(zr(t),")")}}var Wr=Rt.optionMergeStrategies;function Ur(t,e,n){if(void 0===n&&(n=!0),!e)return t;for(var r,o,i,s=re?Reflect.ownKeys(e):Object.keys(e),a=0;a<s.length;a++)"__ob__"!==(r=s[a])&&(o=t[r],i=e[r],n&&mt(t,r)?o!==i&&ot(o)&&ot(i)&&Ur(o,i):Ce(t,r,i));return t}function qr(t,e,n){return n?function(){var r=tt(e)?e.call(n,n):e,o=tt(t)?t.call(n,n):t;return r?Ur(r,o):o}:e?t?function(){return Ur(tt(e)?e.call(this,this):e,tt(t)?t.call(this,this):t)}:e:t}function Kr(t,e){var n=e?t?t.concat(e):G(e)?e:[e]:t;return n?function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(n):n}function Jr(t,e,n,r){var o=Object.create(t||null);return e?("production"!==process.env.NODE_ENV&&Xr(r,e,n),St(o,e)):o}"production"!==process.env.NODE_ENV&&(Wr.el=Wr.propsData=function(t,e,n,r){return n||Fr('option "'.concat(r,'" can only be used during instance ')+"creation with the `new` keyword."),Gr(t,e)}),Wr.data=function(t,e,n){return n?qr(t,e,n):e&&"function"!=typeof e?("production"!==process.env.NODE_ENV&&Fr('The "data" option should be a function that returns a per-instance value in component definitions.',n),t):qr(t,e)},Lt.forEach((function(t){Wr[t]=Kr})),Dt.forEach((function(t){Wr[t+"s"]=Jr})),Wr.watch=function(t,e,n,r){if(t===Yt&&(t=void 0),e===Yt&&(e=void 0),!e)return Object.create(t||null);if("production"!==process.env.NODE_ENV&&Xr(r,e,n),!t)return e;var o={};for(var i in St(o,t),e){var s=o[i],a=e[i];s&&!G(s)&&(s=[s]),o[i]=s?s.concat(a):G(a)?a:[a]}return o},Wr.props=Wr.methods=Wr.inject=Wr.computed=function(t,e,n,r){if(e&&"production"!==process.env.NODE_ENV&&Xr(r,e,n),!t)return e;var o=Object.create(null);return St(o,t),e&&St(o,e),o},Wr.provide=function(t,e){return t?function(){var n=Object.create(null);return Ur(n,tt(t)?t.call(this):t),e&&Ur(n,tt(e)?e.call(this):e,!1),n}:e};var Gr=function(t,e){return void 0===e?t:e};function Yr(t){new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(Pt.source,"]*$")).test(t)||Fr('Invalid component name: "'+t+'". Component names should conform to valid custom element name in html5 specification.'),(pt(t)||Rt.isReservedTag(t))&&Fr("Do not use built-in or reserved HTML elements as component id: "+t)}function Xr(t,e,n){ot(e)||Fr('Invalid value for option "'.concat(t,'": expected an Object, ')+"but got ".concat(rt(e),"."),n)}function Zr(t,e,n){if("production"!==process.env.NODE_ENV&&function(t){for(var e in t.components)Yr(e)}(e),tt(e)&&(e=e.options),function(t,e){var n=t.props;if(n){var r,o,i={};if(G(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[yt(o)]={type:null}:"production"!==process.env.NODE_ENV&&Fr("props must be strings when using array syntax.");else if(ot(n))for(var s in n)o=n[s],i[yt(s)]=ot(o)?o:{type:o};else"production"!==process.env.NODE_ENV&&Fr('Invalid value for option "props": expected an Array or an Object, '+"but got ".concat(rt(n),"."),e);t.props=i}}(e,n),function(t,e){var n=t.inject;if(n){var r=t.inject={};if(G(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(ot(n))for(var i in n){var s=n[i];r[i]=ot(s)?St({from:i},s):{from:s}}else"production"!==process.env.NODE_ENV&&Fr('Invalid value for option "inject": expected an Array or an Object, '+"but got ".concat(rt(n),"."),e)}}(e,n),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];tt(r)&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=Zr(t,e.extends,n)),e.mixins))for(var r=0,o=e.mixins.length;r<o;r++)t=Zr(t,e.mixins[r],n);var i,s={};for(i in t)a(i);for(i in e)mt(t,i)||a(i);function a(r){var o=Wr[r]||Gr;s[r]=o(t[r],e[r],n,r)}return s}function Qr(t,e,n,r){if("string"==typeof n){var o=t[e];if(mt(o,n))return o[n];var i=yt(n);if(mt(o,i))return o[i];var s=_t(i);if(mt(o,s))return o[s];var a=o[n]||o[i]||o[s];return"production"!==process.env.NODE_ENV&&r&&!a&&Fr("Failed to resolve "+e.slice(0,-1)+": "+n),a}}function to(t,e,n,r){var o=e[t],i=!mt(n,t),s=n[t],a=so(Boolean,o.type);if(a>-1)if(i&&!mt(o,"default"))s=!1;else if(""===s||s===wt(t)){var l=so(String,o.type);(l<0||a<l)&&(s=!0)}if(void 0===s){s=function(t,e,n){if(!mt(e,"default"))return;var r=e.default;"production"!==process.env.NODE_ENV&&et(r)&&Fr('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',t);if(t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n])return t._props[n];return tt(r)&&"Function"!==oo(e.type)?r.call(t):r}(r,o,t);var c=we;ke(!0),Ee(s),ke(c)}return"production"!==process.env.NODE_ENV&&function(t,e,n,r,o){if(t.required&&o)return void Fr('Missing required prop: "'+e+'"',r);if(null==n&&!t.required)return;var i=t.type,s=!i||!0===i,a=[];if(i){G(i)||(i=[i]);for(var l=0;l<i.length&&!s;l++){var c=no(n,i[l],r);a.push(c.expectedType||""),s=c.valid}}var u=a.some((function(t){return t}));if(!s&&u)return void Fr(function(t,e,n){var r='Invalid prop: type check failed for prop "'.concat(t,'".')+" Expected ".concat(n.map(_t).join(", ")),o=n[0],i=rt(e);1===n.length&&uo(o)&&uo(typeof e)&&!function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.some((function(t){return"boolean"===t.toLowerCase()}))}(o,i)&&(r+=" with value ".concat(ao(e,o)));r+=", got ".concat(i," "),uo(i)&&(r+="with value ".concat(ao(e,i),"."));return r}(e,n,a),r);var p=t.validator;p&&(p(n)||Fr('Invalid prop: custom validator check failed for prop "'+e+'".',r))}(o,t,s,r,i),s}var eo=/^(String|Number|Boolean|Function|Symbol|BigInt)$/;function no(t,e,n){var r,o=oo(e);if(eo.test(o)){var i=typeof t;(r=i===o.toLowerCase())||"object"!==i||(r=t instanceof e)}else if("Object"===o)r=ot(t);else if("Array"===o)r=G(t);else try{r=t instanceof e}catch(t){Fr('Invalid prop type: "'+String(e)+'" is not a constructor',n),r=!1}return{valid:r,expectedType:o}}var ro=/^\s*function (\w+)/;function oo(t){var e=t&&t.toString().match(ro);return e?e[1]:""}function io(t,e){return oo(t)===oo(e)}function so(t,e){if(!G(e))return io(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(io(e[n],t))return n;return-1}function ao(t,e){return"String"===e?'"'.concat(t,'"'):"".concat("Number"===e?Number(t):t)}var lo,co=["string","number","boolean"];function uo(t){return co.some((function(e){return t.toLowerCase()===e}))}if("production"!==process.env.NODE_ENV){var po=ut("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,require"),fo=function(t,e){Fr('Property or method "'.concat(e,'" is not defined on the instance but ')+"referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.",t)},ho=function(t,e){Fr('Property "'.concat(e,'" must be accessed with "$data.').concat(e,'" because ')+'properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internals. See: https://v2.vuejs.org/v2/api/#data',t)},mo="undefined"!=typeof Proxy&&ee(Proxy);if(mo){var go=ut("stop,prevent,self,ctrl,shift,alt,meta,exact");Rt.keyCodes=new Proxy(Rt.keyCodes,{set:function(t,e,n){return go(e)?(Fr("Avoid overwriting built-in modifier in config.keyCodes: .".concat(e)),!1):(t[e]=n,!0)}})}var vo={has:function(t,e){var n=e in t,r=po(e)||"string"==typeof e&&"_"===e.charAt(0)&&!(e in t.$data);return n||r||(e in t.$data?ho(t,e):fo(t,e)),n||!r}},yo={get:function(t,e){return"string"!=typeof e||e in t||(e in t.$data?ho(t,e):fo(t,e)),t[e]}};lo=function(t){if(mo){var e=t.$options,n=e.render&&e.render._withStripped?yo:vo;t._renderProxy=new Proxy(t,n)}else t._renderProxy=t}}var _o={enumerable:!0,configurable:!0,get:Ot,set:Ot};function bo(t,e,n){_o.get=function(){return this[e][n]},_o.set=function(t){this[e][n]=t},Object.defineProperty(t,n,_o)}function wo(t){var e=t.$options;if(e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=Te({}),o=t.$options._propKeys=[],i=!t.$parent;i||ke(!1);var s=function(s){o.push(s);var a=to(s,e,n,t);if("production"!==process.env.NODE_ENV){var l=wt(s);(dt(l)||Rt.isReservedAttr(l))&&Fr('"'.concat(l,'" is a reserved attribute and cannot be used as component prop.'),t),Oe(r,s,a,(function(){i||cr||Fr("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's "+'value. Prop being mutated: "'.concat(s,'"'),t)}))}else Oe(r,s,a);s in t||bo(t,"_props",s)};for(var a in e)s(a);ke(!0)}(t,e.props),On(t),e.methods&&function(t,e){var n=t.$options.props;for(var r in e)"production"!==process.env.NODE_ENV&&("function"!=typeof e[r]&&Fr('Method "'.concat(r,'" has type "').concat(typeof e[r],'" in the component definition. ')+"Did you reference the function correctly?",t),n&&mt(n,r)&&Fr('Method "'.concat(r,'" has already been defined as a prop.'),t),r in t&&jt(r)&&Fr('Method "'.concat(r,'" conflicts with an existing Vue instance method. ')+"Avoid defining component methods that start with _ or $.")),t[r]="function"!=typeof e[r]?Ot:kt(e[r],t)}(t,e.methods),e.data)!function(t){var e=t.$options.data;e=t._data=tt(e)?function(t,e){me();try{return t.call(e,e)}catch(t){return Ln(t,e,"data()"),{}}finally{ge()}}(e,t):e||{},ot(e)||(e={},"production"!==process.env.NODE_ENV&&Fr("data functions should return an object:\nhttps://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",t));var n=Object.keys(e),r=t.$options.props,o=t.$options.methods,i=n.length;for(;i--;){var s=n[i];"production"!==process.env.NODE_ENV&&o&&mt(o,s)&&Fr('Method "'.concat(s,'" has already been defined as a data property.'),t),r&&mt(r,s)?"production"!==process.env.NODE_ENV&&Fr('The data property "'.concat(s,'" is already declared as a prop. ')+"Use prop default value instead.",t):jt(s)||bo(t,"_data",s)}var a=Ee(e);a&&a.vmCount++}(t);else{var n=Ee(t._data={});n&&n.vmCount++}e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=Qt();for(var o in e){var i=e[o],s=tt(i)?i:i.get;"production"!==process.env.NODE_ENV&&null==s&&Fr('Getter is missing for computed property "'.concat(o,'".'),t),r||(n[o]=new nr(t,s||Ot,Ot,ko)),o in t?"production"!==process.env.NODE_ENV&&(o in t.$data?Fr('The computed property "'.concat(o,'" is already defined in data.'),t):t.$options.props&&o in t.$options.props?Fr('The computed property "'.concat(o,'" is already defined as a prop.'),t):t.$options.methods&&o in t.$options.methods&&Fr('The computed property "'.concat(o,'" is already defined as a method.'),t)):xo(t,o,i)}}(t,e.computed),e.watch&&e.watch!==Yt&&function(t,e){for(var n in e){var r=e[n];if(G(r))for(var o=0;o<r.length;o++)Oo(t,n,r[o]);else Oo(t,n,r)}}(t,e.watch)}var ko={lazy:!0};function xo(t,e,n){var r=!Qt();tt(n)?(_o.get=r?So(e):Eo(n),_o.set=Ot):(_o.get=n.get?r&&!1!==n.cache?So(e):Eo(n.get):Ot,_o.set=n.set||Ot),"production"!==process.env.NODE_ENV&&_o.set===Ot&&(_o.set=function(){Fr('Computed property "'.concat(e,'" was assigned to but it has no setter.'),this)}),Object.defineProperty(t,e,_o)}function So(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),fe.target&&("production"!==process.env.NODE_ENV&&fe.target.onTrack&&fe.target.onTrack({effect:fe.target,target:this,type:"get",key:t}),e.depend()),e.value}}function Eo(t){return function(){return t.call(this,this)}}function Oo(t,e,n,r){return ot(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var Co=0;function Ao(t){var e=t.options;if(t.super){var n=Ao(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var o in n)n[o]!==r[o]&&(e||(e={}),e[o]=n[o]);return e}(t);r&&St(t.extendOptions,r),(e=t.options=Zr(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function No(t){"production"===process.env.NODE_ENV||this instanceof No||Fr("Vue is a constructor and should be called with the `new` keyword"),this._init(t)}function To(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=$r(t)||$r(n.options);"production"!==process.env.NODE_ENV&&i&&Yr(i);var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=Zr(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)bo(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)xo(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,Dt.forEach((function(t){s[t]=n[t]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=St({},s.options),o[r]=s,s}}function Mo(t){return t&&($r(t.Ctor.options)||t.tag)}function Io(t,e){return G(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!it(t)&&t.test(e)}function $o(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!e(a)&&Do(n,i,r,o)}}}function Do(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,ft(n,e)}!function(t){t.prototype._init=function(t){var e,n,r=this;r._uid=Co++,"production"!==process.env.NODE_ENV&&Rt.performance&&Zn&&(e="vue-perf-start:".concat(r._uid),n="vue-perf-end:".concat(r._uid),Zn(e)),r._isVue=!0,r.__v_skip=!0,r._scope=new Ge(!0),r._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(r,t):r.$options=Zr(Ao(r.constructor),t||{},r),"production"!==process.env.NODE_ENV?lo(r):r._renderProxy=r,r._self=r,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(r),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ar(t,e)}(r),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,r=n&&n.context;t.$slots=bn(e._renderChildren,r),t.$scopedSlots=n?xn(t.$parent,n.data.scopedSlots,t.$slots):J,t._c=function(e,n,r,o){return $n(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return $n(t,e,n,r,o,!0)};var o=n&&n.data;"production"!==process.env.NODE_ENV?(Oe(t,"$attrs",o&&o.attrs||J,(function(){!cr&&Fr("$attrs is readonly.",t)}),!0),Oe(t,"$listeners",e._parentListeners||J,(function(){!cr&&Fr("$listeners is readonly.",t)}),!0)):(Oe(t,"$attrs",o&&o.attrs||J,null,!0),Oe(t,"$listeners",e._parentListeners||J,null,!0))}(r),hr(r,"beforeCreate",void 0,!1),function(t){var e=Nr(t.$options.inject,t);e&&(ke(!1),Object.keys(e).forEach((function(n){"production"!==process.env.NODE_ENV?Oe(t,n,e[n],(function(){Fr("Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. "+'injection being mutated: "'.concat(n,'"'),t)})):Oe(t,n,e[n])})),ke(!0))}(r),wo(r),Ar(r),hr(r,"created"),"production"!==process.env.NODE_ENV&&Rt.performance&&Zn&&(r._name=zr(r,!1),Zn(n),Qn("vue ".concat(r._name," init"),e,n)),r.$options.el&&r.$mount(r.$options.el)}}(No),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};"production"!==process.env.NODE_ENV&&(e.set=function(){Fr("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){Fr("$props is readonly.",this)}),Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Ce,t.prototype.$delete=Ae,t.prototype.$watch=function(t,e,n){var r=this;if(ot(e))return Oo(r,t,e,n);(n=n||{}).user=!0;var o=new nr(r,t,e,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');me(),Rn(e,r,[o.value],r,i),ge()}return function(){o.teardown()}}}(No),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(G(t))for(var o=0,i=t.length;o<i;o++)r.$on(t[o],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){var n=this;function r(){n.$off(t,r),e.apply(n,arguments)}return r.fn=e,n.$on(t,r),n},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(G(t)){for(var r=0,o=t.length;r<o;r++)n.$off(t[r],e);return n}var i,s=n._events[t];if(!s)return n;if(!e)return n._events[t]=null,n;for(var a=s.length;a--;)if((i=s[a])===e||i.fn===e){s.splice(a,1);break}return n},t.prototype.$emit=function(t){var e=this;if("production"!==process.env.NODE_ENV){var n=t.toLowerCase();n!==t&&e._events[n]&&Hr('Event "'.concat(n,'" is emitted in component ')+"".concat(zr(e),' but the handler is registered for "').concat(t,'". ')+"Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. "+'You should probably use "'.concat(wt(t),'" instead of "').concat(t,'".'))}var r=e._events[t];if(r){r=r.length>1?xt(r):r;for(var o=xt(arguments,1),i='event handler for "'.concat(t,'"'),s=0,a=r.length;s<a;s++)Rn(r[s],e,o,e,i)}return e}}(No),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,o=n._vnode,i=ur(n);n._vnode=t,n.$el=o?n.__patch__(o,t):n.__patch__(n.$el,t,e,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n);for(var s=n;s&&s.$vnode&&s.$parent&&s.$vnode===s.$parent._vnode;)s.$parent.$el=s.$el,s=s.$parent},t.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){hr(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||ft(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),hr(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(No),function(t){_n(t.prototype),t.prototype.$nextTick=function(t){return Jn(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,o=n._parentVnode;o&&e._isMounted&&(e.$scopedSlots=xn(e.$parent,o.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Nn(e._slotsProxy,e.$scopedSlots)),e.$vnode=o;try{ie(e),Tn=e,t=r.call(e._renderProxy,e.$createElement)}catch(n){if(Ln(n,e,"render"),"production"!==process.env.NODE_ENV&&e.$options.renderError)try{t=e.$options.renderError.call(e._renderProxy,e.$createElement,n)}catch(n){Ln(n,e,"renderError"),t=e._vnode}else t=e._vnode}finally{Tn=null,ie()}return G(t)&&1===t.length&&(t=t[0]),t instanceof se||("production"!==process.env.NODE_ENV&&G(t)&&Fr("Multiple root nodes returned from render function. Render function should return a single root node.",e),t=ae()),t.parent=o,t}}(No);var Lo=[String,RegExp,Array],Ro={name:"keep-alive",abstract:!0,props:{include:Lo,exclude:Lo,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,r=t.vnodeToCache,o=t.keyToCache;if(r){var i=r.tag,s=r.componentInstance,a=r.componentOptions;e[o]={name:Mo(a),tag:i,componentInstance:s},n.push(o),this.max&&n.length>parseInt(this.max)&&Do(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Do(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){$o(t,(function(t){return Io(e,t)}))})),this.$watch("exclude",(function(e){$o(t,(function(t){return!Io(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=In(t),n=e&&e.componentOptions;if(n){var r=Mo(n),o=this.include,i=this.exclude;if(o&&(!r||!Io(o,r))||i&&r&&Io(i,r))return e;var s=this.cache,a=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,ft(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}},Po={KeepAlive:Ro};!function(t){var e={get:function(){return Rt}};"production"!==process.env.NODE_ENV&&(e.set=function(){Fr("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(t,"config",e),t.util={warn:Fr,extend:St,mergeOptions:Zr,defineReactive:Oe},t.set=Ce,t.delete=Ae,t.nextTick=Jn,t.observable=function(t){return Ee(t),t},t.options=Object.create(null),Dt.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,St(t.options.components,Po),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=xt(arguments,1);return n.unshift(this),tt(t.install)?t.install.apply(t,n):tt(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Zr(this.options,t),this}}(t),To(t),function(t){Dt.forEach((function(e){t[e]=function(t,n){return n?("production"!==process.env.NODE_ENV&&"component"===e&&Yr(t),"component"===e&&ot(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&tt(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(No),Object.defineProperty(No.prototype,"$isServer",{get:Qt}),Object.defineProperty(No.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(No,"FunctionalRenderContext",{value:Tr}),No.version="2.7.14";var jo=ut("style,class"),zo=ut("input,textarea,option,select,progress"),Fo=ut("contenteditable,draggable,spellcheck"),Ho=ut("events,caret,typing,plaintext-only"),Vo=ut("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Bo="http://www.w3.org/1999/xlink",Wo=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Uo=function(t){return Wo(t)?t.slice(6,t.length):""},qo=function(t){return null==t||!1===t};function Ko(t){for(var e=t.data,n=t,r=t;X(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Jo(r.data,e));for(;X(n=n.parent);)n&&n.data&&(e=Jo(e,n.data));return function(t,e){if(X(t)||X(e))return Go(t,Yo(e));return""}(e.staticClass,e.class)}function Jo(t,e){return{staticClass:Go(t.staticClass,e.staticClass),class:X(t.class)?[t.class,e.class]:e.class}}function Go(t,e){return t?e?t+" "+e:t:e||""}function Yo(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r<o;r++)X(e=Yo(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):et(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var Xo={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Zo=ut("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Qo=ut("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),ti=function(t){return Zo(t)||Qo(t)};var ei=Object.create(null);var ni=ut("text,number,password,search,email,tel,url");var ri=Object.freeze({__proto__:null,createElement:function(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(t,e){return document.createElementNS(Xo[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setStyleScope:function(t,e){t.setAttribute(e,"")}}),oi={create:function(t,e){ii(e)},update:function(t,e){t.data.ref!==e.data.ref&&(ii(t,!0),ii(e))},destroy:function(t){ii(t,!0)}};function ii(t,e){var n=t.data.ref;if(X(n)){var r=t.context,o=t.componentInstance||t.elm,i=e?null:o,s=e?void 0:o;if(tt(n))Rn(n,r,[i],r,"template ref function");else{var a=t.data.refInFor,l="string"==typeof n||"number"==typeof n,c=Re(n),u=r.$refs;if(l||c)if(a){var p=l?u[n]:n.value;e?G(p)&&ft(p,o):G(p)?p.includes(o)||p.push(o):l?(u[n]=[o],si(r,n,u[n])):n.value=[o]}else if(l){if(e&&u[n]!==o)return;u[n]=s,si(r,n,i)}else if(c){if(e&&n.value!==o)return;n.value=i}else"production"!==process.env.NODE_ENV&&Fr("Invalid template ref type: ".concat(typeof n))}}}function si(t,e,n){var r=t._setupState;r&&mt(r,e)&&(Re(r[e])?r[e].value=n:r[e]=n)}var ai=new se("",{},[]),li=["create","activate","update","remove","destroy"];function ci(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&X(t.data)===X(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=X(n=t.data)&&X(n=n.attrs)&&n.type,o=X(n=e.data)&&X(n=n.attrs)&&n.type;return r===o||ni(r)&&ni(o)}(t,e)||Z(t.isAsyncPlaceholder)&&Y(e.asyncFactory.error))}function ui(t,e,n){var r,o,i={};for(r=e;r<=n;++r)X(o=t[r].key)&&(i[o]=r);return i}var pi={create:di,update:di,destroy:function(t){di(t,ai)}};function di(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,o,i=t===ai,s=e===ai,a=hi(t.data.directives,t.context),l=hi(e.data.directives,e.context),c=[],u=[];for(n in l)r=a[n],o=l[n],r?(o.oldValue=r.value,o.oldArg=r.arg,gi(o,"update",e,t),o.def&&o.def.componentUpdated&&u.push(o)):(gi(o,"bind",e,t),o.def&&o.def.inserted&&c.push(o));if(c.length){var p=function(){for(var n=0;n<c.length;n++)gi(c[n],"inserted",e,t)};i?Qe(e,"insert",p):p()}u.length&&Qe(e,"postpatch",(function(){for(var n=0;n<u.length;n++)gi(u[n],"componentUpdated",e,t)}));if(!i)for(n in a)l[n]||gi(a[n],"unbind",t,t,s)}(t,e)}var fi=Object.create(null);function hi(t,e){var n,r,o=Object.create(null);if(!t)return o;for(n=0;n<t.length;n++){if((r=t[n]).modifiers||(r.modifiers=fi),o[mi(r)]=r,e._setupState&&e._setupState.__sfc){var i=r.def||Qr(e,"_setupState","v-"+r.name);r.def="function"==typeof i?{bind:i,update:i}:i}r.def=r.def||Qr(e.$options,"directives",r.name,!0)}return o}function mi(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function gi(t,e,n,r,o){var i=t.def&&t.def[e];if(i)try{i(n.elm,t,n,r,o)}catch(r){Ln(r,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var vi=[oi,pi];function yi(t,e){var n=e.componentOptions;if(!(X(n)&&!1===n.Ctor.options.inheritAttrs||Y(t.data.attrs)&&Y(e.data.attrs))){var r,o,i=e.elm,s=t.data.attrs||{},a=e.data.attrs||{};for(r in(X(a.__ob__)||Z(a._v_attr_proxy))&&(a=e.data.attrs=St({},a)),a)o=a[r],s[r]!==o&&_i(i,r,o,e.data.pre);for(r in(Wt||qt)&&a.value!==s.value&&_i(i,"value",a.value),s)Y(a[r])&&(Wo(r)?i.removeAttributeNS(Bo,Uo(r)):Fo(r)||i.removeAttribute(r))}}function _i(t,e,n,r){r||t.tagName.indexOf("-")>-1?bi(t,e,n):Vo(e)?qo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Fo(e)?t.setAttribute(e,function(t,e){return qo(e)||"false"===e?"false":"contenteditable"===t&&Ho(e)?e:"true"}(e,n)):Wo(e)?qo(n)?t.removeAttributeNS(Bo,Uo(e)):t.setAttributeNS(Bo,e,n):bi(t,e,n)}function bi(t,e,n){if(qo(n))t.removeAttribute(e);else{if(Wt&&!Ut&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var wi={create:yi,update:yi};function ki(t,e){var n=e.elm,r=e.data,o=t.data;if(!(Y(r.staticClass)&&Y(r.class)&&(Y(o)||Y(o.staticClass)&&Y(o.class)))){var i=Ko(e),s=n._transitionClasses;X(s)&&(i=Go(i,Yo(s))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var xi,Si={create:ki,update:ki},Ei="__r",Oi="__c";function Ci(t,e,n){var r=xi;return function o(){var i=e.apply(null,arguments);null!==i&&Ti(t,o,n,r)}}var Ai=Fn&&!(Gt&&Number(Gt[1])<=53);function Ni(t,e,n,r){if(Ai){var o=kr,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}xi.addEventListener(t,e,Xt?{capture:n,passive:r}:n)}function Ti(t,e,n,r){(r||xi).removeEventListener(t,e._wrapper||e,n)}function Mi(t,e){if(!Y(t.data.on)||!Y(e.data.on)){var n=e.data.on||{},r=t.data.on||{};xi=e.elm||t.elm,function(t){if(X(t[Ei])){var e=Wt?"change":"input";t[e]=[].concat(t[Ei],t[e]||[]),delete t[Ei]}X(t[Oi])&&(t.change=[].concat(t[Oi],t.change||[]),delete t[Oi])}(n),Ze(n,r,Ni,Ti,Ci,e.context),xi=void 0}}var Ii,$i={create:Mi,update:Mi,destroy:function(t){return Mi(t,ai)}};function Di(t,e){if(!Y(t.data.domProps)||!Y(e.data.domProps)){var n,r,o=e.elm,i=t.data.domProps||{},s=e.data.domProps||{};for(n in(X(s.__ob__)||Z(s._v_attr_proxy))&&(s=e.data.domProps=St({},s)),i)n in s||(o[n]="");for(n in s){if(r=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===i[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var a=Y(r)?"":String(r);Li(o,a)&&(o.value=a)}else if("innerHTML"===n&&Qo(o.tagName)&&Y(o.innerHTML)){(Ii=Ii||document.createElement("div")).innerHTML="<svg>".concat(r,"</svg>");for(var l=Ii.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}else if(r!==i[n])try{o[n]=r}catch(t){}}}}function Li(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(X(r)){if(r.number)return ct(n)!==ct(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Ri={create:Di,update:Di},Pi=gt((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function ji(t){var e=zi(t.style);return t.staticStyle?St(t.staticStyle,e):e}function zi(t){return Array.isArray(t)?Et(t):"string"==typeof t?Pi(t):t}var Fi,Hi=/^--/,Vi=/\s*!important$/,Bi=function(t,e,n){if(Hi.test(e))t.style.setProperty(e,n);else if(Vi.test(n))t.style.setProperty(wt(e),n.replace(Vi,""),"important");else{var r=Ui(e);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)t.style[r]=n[o];else t.style[r]=n}},Wi=["Webkit","Moz","ms"],Ui=gt((function(t){if(Fi=Fi||document.createElement("div").style,"filter"!==(t=yt(t))&&t in Fi)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Wi.length;n++){var r=Wi[n]+e;if(r in Fi)return r}}));function qi(t,e){var n=e.data,r=t.data;if(!(Y(n.staticStyle)&&Y(n.style)&&Y(r.staticStyle)&&Y(r.style))){var o,i,s=e.elm,a=r.staticStyle,l=r.normalizedStyle||r.style||{},c=a||l,u=zi(e.data.style)||{};e.data.normalizedStyle=X(u.__ob__)?St({},u):u;var p=function(t,e){var n,r={};if(e)for(var o=t;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=ji(o.data))&&St(r,n);(n=ji(t.data))&&St(r,n);for(var i=t;i=i.parent;)i.data&&(n=ji(i.data))&&St(r,n);return r}(e,!0);for(i in c)Y(p[i])&&Bi(s,i,"");for(i in p)(o=p[i])!==c[i]&&Bi(s,i,null==o?"":o)}}var Ki={create:qi,update:qi},Ji=/\s+/;function Gi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ji).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Yi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ji).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Xi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&St(e,Zi(t.name||"v")),St(e,t),e}return"string"==typeof t?Zi(t):void 0}}var Zi=gt((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),Qi=Vt&&!Ut,ts="transition",es="animation",ns="transition",rs="transitionend",is="animation",ss="animationend";Qi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ns="WebkitTransition",rs="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(is="WebkitAnimation",ss="webkitAnimationEnd"));var as=Vt?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function ls(t){as((function(){as(t)}))}function cs(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Gi(t,e))}function us(t,e){t._transitionClasses&&ft(t._transitionClasses,e),Yi(t,e)}function ps(t,e,n){var r=fs(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===ts?rs:ss,l=0,c=function(){t.removeEventListener(a,u),n()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout((function(){l<s&&c()}),i+1),t.addEventListener(a,u)}var ds=/\b(transform|all)(,|$)/;function fs(t,e){var n,r=window.getComputedStyle(t),o=(r[ns+"Delay"]||"").split(", "),i=(r[ns+"Duration"]||"").split(", "),s=hs(o,i),a=(r[is+"Delay"]||"").split(", "),l=(r[is+"Duration"]||"").split(", "),c=hs(a,l),u=0,p=0;return e===ts?s>0&&(n=ts,u=s,p=i.length):e===es?c>0&&(n=es,u=c,p=l.length):p=(n=(u=Math.max(s,c))>0?s>c?ts:es:null)?n===ts?i.length:l.length:0,{type:n,timeout:u,propCount:p,hasTransform:n===ts&&ds.test(r[ns+"Property"])}}function hs(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return ms(e)+ms(t[n])})))}function ms(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function gs(t,e){var n=t.elm;X(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=Xi(t.data.transition);if(!Y(r)&&!X(n._enterCb)&&1===n.nodeType){for(var o=r.css,i=r.type,s=r.enterClass,a=r.enterToClass,l=r.enterActiveClass,c=r.appearClass,u=r.appearToClass,p=r.appearActiveClass,d=r.beforeEnter,f=r.enter,h=r.afterEnter,m=r.enterCancelled,g=r.beforeAppear,v=r.appear,y=r.afterAppear,_=r.appearCancelled,b=r.duration,w=lr,k=lr.$vnode;k&&k.parent;)w=k.context,k=k.parent;var x=!w._isMounted||!t.isRootInsert;if(!x||v||""===v){var S=x&&c?c:s,E=x&&p?p:l,O=x&&u?u:a,C=x&&g||d,A=x&&tt(v)?v:f,N=x&&y||h,T=x&&_||m,M=ct(et(b)?b.enter:b);"production"!==process.env.NODE_ENV&&null!=M&&ys(M,"enter",t);var I=!1!==o&&!Ut,$=bs(A),D=n._enterCb=Mt((function(){I&&(us(n,O),us(n,E)),D.cancelled?(I&&us(n,S),T&&T(n)):N&&N(n),n._enterCb=null}));t.data.show||Qe(t,"insert",(function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),A&&A(n,D)})),C&&C(n),I&&(cs(n,S),cs(n,E),ls((function(){us(n,S),D.cancelled||(cs(n,O),$||(_s(M)?setTimeout(D,M):ps(n,i,D)))}))),t.data.show&&(e&&e(),A&&A(n,D)),I||$||D()}}}function vs(t,e){var n=t.elm;X(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=Xi(t.data.transition);if(Y(r)||1!==n.nodeType)return e();if(!X(n._leaveCb)){var o=r.css,i=r.type,s=r.leaveClass,a=r.leaveToClass,l=r.leaveActiveClass,c=r.beforeLeave,u=r.leave,p=r.afterLeave,d=r.leaveCancelled,f=r.delayLeave,h=r.duration,m=!1!==o&&!Ut,g=bs(u),v=ct(et(h)?h.leave:h);"production"!==process.env.NODE_ENV&&X(v)&&ys(v,"leave",t);var y=n._leaveCb=Mt((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),m&&(us(n,a),us(n,l)),y.cancelled?(m&&us(n,s),d&&d(n)):(e(),p&&p(n)),n._leaveCb=null}));f?f(_):_()}function _(){y.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),c&&c(n),m&&(cs(n,s),cs(n,l),ls((function(){us(n,s),y.cancelled||(cs(n,a),g||(_s(v)?setTimeout(y,v):ps(n,i,y)))}))),u&&u(n,y),m||g||y())}}function ys(t,e,n){"number"!=typeof t?Fr("<transition> explicit ".concat(e," duration is not a valid number - ")+"got ".concat(JSON.stringify(t),"."),n.context):isNaN(t)&&Fr("<transition> explicit ".concat(e," duration is NaN - ")+"the duration expression might be incorrect.",n.context)}function _s(t){return"number"==typeof t&&!isNaN(t)}function bs(t){if(Y(t))return!1;var e=t.fns;return X(e)?bs(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function ws(t,e){!0!==e.data.show&&gs(e)}var ks=function(t){var e,n,r={},o=t.modules,i=t.nodeOps;for(e=0;e<li.length;++e)for(r[li[e]]=[],n=0;n<o.length;++n)X(o[n][li[e]])&&r[li[e]].push(o[n][li[e]]);function s(t){var e=i.parentNode(t);X(e)&&i.removeChild(e,t)}function a(t,e){return!e&&!t.ns&&!(Rt.ignoredElements.length&&Rt.ignoredElements.some((function(e){return it(e)?e.test(t.tag):e===t.tag})))&&Rt.isUnknownElement(t.tag)}var l=0;function c(t,e,n,o,s,c,f){if(X(t.elm)&&X(c)&&(t=c[f]=ce(t)),t.isRootInsert=!s,!function(t,e,n,o){var i=t.data;if(X(i)){var s=X(t.componentInstance)&&i.keepAlive;if(X(i=i.hook)&&X(i=i.init)&&i(t,!1),X(t.componentInstance))return u(t,e),p(n,t.elm,o),Z(s)&&function(t,e,n,o){var i,s=t;for(;s.componentInstance;)if(X(i=(s=s.componentInstance._vnode).data)&&X(i=i.transition)){for(i=0;i<r.activate.length;++i)r.activate[i](ai,s);e.push(s);break}p(n,t.elm,o)}(t,e,n,o),!0}}(t,e,n,o)){var g=t.data,v=t.children,y=t.tag;X(y)?("production"!==process.env.NODE_ENV&&(g&&g.pre&&l++,a(t,l)&&Fr("Unknown custom element: <"+y+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',t.context)),t.elm=t.ns?i.createElementNS(t.ns,y):i.createElement(y,t),m(t),d(t,v,e),X(g)&&h(t,e),p(n,t.elm,o),"production"!==process.env.NODE_ENV&&g&&g.pre&&l--):Z(t.isComment)?(t.elm=i.createComment(t.text),p(n,t.elm,o)):(t.elm=i.createTextNode(t.text),p(n,t.elm,o))}}function u(t,e){X(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,f(t)?(h(t,e),m(t)):(ii(t),e.push(t))}function p(t,e,n){X(t)&&(X(n)?i.parentNode(n)===t&&i.insertBefore(t,e,n):i.appendChild(t,e))}function d(t,e,n){if(G(e)){"production"!==process.env.NODE_ENV&&b(e);for(var r=0;r<e.length;++r)c(e[r],n,t.elm,null,!0,e,r)}else Q(t.text)&&i.appendChild(t.elm,i.createTextNode(String(t.text)))}function f(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return X(t.tag)}function h(t,n){for(var o=0;o<r.create.length;++o)r.create[o](ai,t);X(e=t.data.hook)&&(X(e.create)&&e.create(ai,t),X(e.insert)&&n.push(t))}function m(t){var e;if(X(e=t.fnScopeId))i.setStyleScope(t.elm,e);else for(var n=t;n;)X(e=n.context)&&X(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e),n=n.parent;X(e=lr)&&e!==t.context&&e!==t.fnContext&&X(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e)}function g(t,e,n,r,o,i){for(;r<=o;++r)c(n[r],i,t,e,!1,n,r)}function v(t){var e,n,o=t.data;if(X(o))for(X(e=o.hook)&&X(e=e.destroy)&&e(t),e=0;e<r.destroy.length;++e)r.destroy[e](t);if(X(e=t.children))for(n=0;n<t.children.length;++n)v(t.children[n])}function y(t,e,n){for(;e<=n;++e){var r=t[e];X(r)&&(X(r.tag)?(_(r),v(r)):s(r.elm))}}function _(t,e){if(X(e)||X(t.data)){var n,o=r.remove.length+1;for(X(e)?e.listeners+=o:e=function(t,e){function n(){0==--n.listeners&&s(t)}return n.listeners=e,n}(t.elm,o),X(n=t.componentInstance)&&X(n=n._vnode)&&X(n.data)&&_(n,e),n=0;n<r.remove.length;++n)r.remove[n](t,e);X(n=t.data.hook)&&X(n=n.remove)?n(t,e):e()}else s(t.elm)}function b(t){for(var e={},n=0;n<t.length;n++){var r=t[n],o=r.key;X(o)&&(e[o]?Fr("Duplicate keys detected: '".concat(o,"'. This may cause an update error."),r.context):e[o]=!0)}}function w(t,e,n,r){for(var o=n;o<r;o++){var i=e[o];if(X(i)&&ci(t,i))return o}}function k(t,e,n,o,s,a){if(t!==e){X(e.elm)&&X(o)&&(e=o[s]=ce(e));var l=e.elm=t.elm;if(Z(t.isAsyncPlaceholder))X(e.asyncFactory.resolved)?O(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(Z(e.isStatic)&&Z(t.isStatic)&&e.key===t.key&&(Z(e.isCloned)||Z(e.isOnce)))e.componentInstance=t.componentInstance;else{var u,p=e.data;X(p)&&X(u=p.hook)&&X(u=u.prepatch)&&u(t,e);var d=t.children,h=e.children;if(X(p)&&f(e)){for(u=0;u<r.update.length;++u)r.update[u](t,e);X(u=p.hook)&&X(u=u.update)&&u(t,e)}Y(e.text)?X(d)&&X(h)?d!==h&&function(t,e,n,r,o){var s,a,l,u=0,p=0,d=e.length-1,f=e[0],h=e[d],m=n.length-1,v=n[0],_=n[m],x=!o;for("production"!==process.env.NODE_ENV&&b(n);u<=d&&p<=m;)Y(f)?f=e[++u]:Y(h)?h=e[--d]:ci(f,v)?(k(f,v,r,n,p),f=e[++u],v=n[++p]):ci(h,_)?(k(h,_,r,n,m),h=e[--d],_=n[--m]):ci(f,_)?(k(f,_,r,n,m),x&&i.insertBefore(t,f.elm,i.nextSibling(h.elm)),f=e[++u],_=n[--m]):ci(h,v)?(k(h,v,r,n,p),x&&i.insertBefore(t,h.elm,f.elm),h=e[--d],v=n[++p]):(Y(s)&&(s=ui(e,u,d)),Y(a=X(v.key)?s[v.key]:w(v,e,u,d))?c(v,r,t,f.elm,!1,n,p):ci(l=e[a],v)?(k(l,v,r,n,p),e[a]=void 0,x&&i.insertBefore(t,l.elm,f.elm)):c(v,r,t,f.elm,!1,n,p),v=n[++p]);u>d?g(t,Y(n[m+1])?null:n[m+1].elm,n,p,m,r):p>m&&y(e,u,d)}(l,d,h,n,a):X(h)?("production"!==process.env.NODE_ENV&&b(h),X(t.text)&&i.setTextContent(l,""),g(l,null,h,0,h.length-1,n)):X(d)?y(d,0,d.length-1):X(t.text)&&i.setTextContent(l,""):t.text!==e.text&&i.setTextContent(l,e.text),X(p)&&X(u=p.hook)&&X(u=u.postpatch)&&u(t,e)}}}function x(t,e,n){if(Z(n)&&X(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var S=!1,E=ut("attrs,class,staticClass,staticStyle,key");function O(t,e,n,r){var o,i=e.tag,s=e.data,l=e.children;if(r=r||s&&s.pre,e.elm=t,Z(e.isComment)&&X(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if("production"!==process.env.NODE_ENV&&!function(t,e,n){return X(e.tag)?0===e.tag.indexOf("vue-component")||!a(e,n)&&e.tag.toLowerCase()===(t.tagName&&t.tagName.toLowerCase()):t.nodeType===(e.isComment?8:3)}(t,e,r))return!1;if(X(s)&&(X(o=s.hook)&&X(o=o.init)&&o(e,!0),X(o=e.componentInstance)))return u(e,n),!0;if(X(i)){if(X(l))if(t.hasChildNodes())if(X(o=s)&&X(o=o.domProps)&&X(o=o.innerHTML)){if(o!==t.innerHTML)return"production"===process.env.NODE_ENV||"undefined"==typeof console||S||(S=!0,console.warn("Parent: ",t),console.warn("server innerHTML: ",o),console.warn("client innerHTML: ",t.innerHTML)),!1}else{for(var c=!0,p=t.firstChild,f=0;f<l.length;f++){if(!p||!O(p,l[f],n,r)){c=!1;break}p=p.nextSibling}if(!c||p)return"production"===process.env.NODE_ENV||"undefined"==typeof console||S||(S=!0,console.warn("Parent: ",t),console.warn("Mismatching childNodes vs. VNodes: ",t.childNodes,l)),!1}else d(e,l,n);if(X(s)){var m=!1;for(var g in s)if(!E(g)){m=!0,h(e,n);break}!m&&s.class&&Yn(s.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,o){if(!Y(e)){var s,a=!1,l=[];if(Y(t))a=!0,c(e,l);else{var u=X(t.nodeType);if(!u&&ci(t,e))k(t,e,l,null,null,o);else{if(u){if(1===t.nodeType&&t.hasAttribute($t)&&(t.removeAttribute($t),n=!0),Z(n)){if(O(t,e,l))return x(e,l,!0),t;"production"!==process.env.NODE_ENV&&Fr("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}s=t,t=new se(i.tagName(s).toLowerCase(),{},[],void 0,s)}var p=t.elm,d=i.parentNode(p);if(c(e,l,p._leaveCb?null:d,i.nextSibling(p)),X(e.parent))for(var h=e.parent,m=f(e);h;){for(var g=0;g<r.destroy.length;++g)r.destroy[g](h);if(h.elm=e.elm,m){for(var _=0;_<r.create.length;++_)r.create[_](ai,h);var b=h.data.hook.insert;if(b.merged)for(var w=1;w<b.fns.length;w++)b.fns[w]()}else ii(h);h=h.parent}X(d)?y([t],0,0):X(t.tag)&&v(t)}}return x(e,l,a),e.elm}X(t)&&v(t)}}({nodeOps:ri,modules:[wi,Si,$i,Ri,Ki,Vt?{create:ws,activate:ws,remove:function(t,e){!0!==t.data.show?vs(t,e):e()}}:{}].concat(vi)});Ut&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&Ts(t,"input")}));var xs={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Qe(n,"postpatch",(function(){xs.componentUpdated(t,e,n)})):Ss(t,e,n.context),t._vOptions=[].map.call(t.options,Cs)):("textarea"===n.tag||ni(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",As),t.addEventListener("compositionend",Ns),t.addEventListener("change",Ns),Ut&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Ss(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,Cs);if(o.some((function(t,e){return!Nt(t,r[e])})))(t.multiple?e.value.some((function(t){return Os(t,o)})):e.value!==e.oldValue&&Os(e.value,o))&&Ts(t,"change")}}};function Ss(t,e,n){Es(t,e,n),(Wt||qt)&&setTimeout((function(){Es(t,e,n)}),0)}function Es(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var i,s,a=0,l=t.options.length;a<l;a++)if(s=t.options[a],o)i=Tt(r,Cs(s))>-1,s.selected!==i&&(s.selected=i);else if(Nt(Cs(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}else"production"!==process.env.NODE_ENV&&Fr('<select multiple v-model="'.concat(e.expression,'"> ')+"expects an Array value for its binding, but got ".concat(Object.prototype.toString.call(r).slice(8,-1)),n)}function Os(t,e){return e.every((function(e){return!Nt(e,t)}))}function Cs(t){return"_value"in t?t._value:t.value}function As(t){t.target.composing=!0}function Ns(t){t.target.composing&&(t.target.composing=!1,Ts(t.target,"input"))}function Ts(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ms(t){return!t.componentInstance||t.data&&t.data.transition?t:Ms(t.componentInstance._vnode)}var Is={bind:function(t,e,n){var r=e.value,o=(n=Ms(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,gs(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Ms(n)).data&&n.data.transition?(n.data.show=!0,r?gs(n,(function(){t.style.display=t.__vOriginalDisplay})):vs(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}},$s={model:xs,show:Is},Ds={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ls(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ls(In(e.children)):t}function Rs(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[yt(r)]=o[r];return e}function Ps(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var js=function(t){return t.tag||kn(t)},zs=function(t){return"show"===t.name},Fs={name:"transition",props:Ds,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(js)).length){"production"!==process.env.NODE_ENV&&n.length>1&&Fr("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;"production"!==process.env.NODE_ENV&&r&&"in-out"!==r&&"out-in"!==r&&Fr("invalid <transition> mode: "+r,this.$parent);var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=Ls(o);if(!i)return o;if(this._leaving)return Ps(t,o);var s="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?s+"comment":s+i.tag:Q(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var a=(i.data||(i.data={})).transition=Rs(this),l=this._vnode,c=Ls(l);if(i.data.directives&&i.data.directives.some(zs)&&(i.data.show=!0),c&&c.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,c)&&!kn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var u=c.data.transition=St({},a);if("out-in"===r)return this._leaving=!0,Qe(u,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Ps(t,o);if("in-out"===r){if(kn(i))return l;var p,d=function(){p()};Qe(a,"afterEnter",d),Qe(a,"enterCancelled",d),Qe(u,"delayLeave",(function(t){p=t}))}}return o}}},Hs=St({tag:String,moveClass:String},Ds);delete Hs.mode;var Vs={props:Hs,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=ur(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Rs(this),a=0;a<o.length;a++){if((d=o[a]).tag)if(null!=d.key&&0!==String(d.key).indexOf("__vlist"))i.push(d),n[d.key]=d,(d.data||(d.data={})).transition=s;else if("production"!==process.env.NODE_ENV){var l=d.componentOptions,c=l?$r(l.Ctor.options)||l.tag||"":d.tag;Fr("<transition-group> children must be keyed: <".concat(c,">"))}}if(r){var u=[],p=[];for(a=0;a<r.length;a++){var d;(d=r[a]).data.transition=s,d.data.pos=d.elm.getBoundingClientRect(),n[d.key]?u.push(d):p.push(d)}this.kept=t(e,null,u),this.removed=p}return t(e,null,i)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Bs),t.forEach(Ws),t.forEach(Us),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;cs(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(rs,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(rs,t),n._moveCb=null,us(n,e))})}})))},methods:{hasMove:function(t,e){if(!Qi)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){Yi(n,t)})),Gi(n,e),n.style.display="none",this.$el.appendChild(n);var r=fs(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Bs(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Ws(t){t.data.newPos=t.elm.getBoundingClientRect()}function Us(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}var qs={Transition:Fs,TransitionGroup:Vs};function Ks(t){this.content=t}function Js(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=Js(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function Gs(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t<e&&s.text[s.text.length-t-1]==a.text[a.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let t=Gs(s.content,a.content,n-1,r-1);if(t)return t}n-=l,r-=l}else n-=l,r-=l}}No.config.mustUseProp=function(t,e,n){return"value"===n&&zo(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},No.config.isReservedTag=ti,No.config.isReservedAttr=jo,No.config.getTagNamespace=function(t){return Qo(t)?"svg":"math"===t?"math":void 0},No.config.isUnknownElement=function(t){if(!Vt)return!0;if(ti(t))return!1;if(t=t.toLowerCase(),null!=ei[t])return ei[t];var e=document.createElement(t);return t.indexOf("-")>-1?ei[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ei[t]=/HTMLUnknownElement/.test(e.toString())},St(No.options.directives,$s),St(No.options.components,qs),No.prototype.__patch__=Vt?ks:Ot,No.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=ae,"production"!==process.env.NODE_ENV&&(t.$options.template&&"#"!==t.$options.template.charAt(0)||t.$options.el||e?Fr("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",t):Fr("Failed to mount component: template or render function not defined.",t))),hr(t,"beforeMount"),r="production"!==process.env.NODE_ENV&&Rt.performance&&Zn?function(){var e=t._name,r=t._uid,o="vue-perf-start:".concat(r),i="vue-perf-end:".concat(r);Zn(o);var s=t._render();Zn(i),Qn("vue ".concat(e," render"),o,i),Zn(o),t._update(s,n),Zn(i),Qn("vue ".concat(e," patch"),o,i)}:function(){t._update(t._render(),n)};var o={before:function(){t._isMounted&&!t._isDestroyed&&hr(t,"beforeUpdate")}};"production"!==process.env.NODE_ENV&&(o.onTrack=function(e){return hr(t,"renderTracked",[e])},o.onTrigger=function(e){return hr(t,"renderTriggered",[e])}),new nr(t,r,Ot,o,!0),n=!1;var i=t._preWatchers;if(i)for(var s=0;s<i.length;s++)i[s].run();return null==t.$vnode&&(t._isMounted=!0,hr(t,"mounted")),t}(this,t=t&&Vt?function(t){if("string"==typeof t){return document.querySelector(t)||("production"!==process.env.NODE_ENV&&Fr("Cannot find element: "+t),document.createElement("div"))}return t}(t):void 0,e)},Vt&&setTimeout((function(){Rt.devtools&&(te?te.emit("init",No):"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&!1!==Rt.productionTip&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html")}),0),Ks.prototype={constructor:Ks,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Ks(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new Ks(n)},addToStart:function(t,e){return new Ks([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ks(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new Ks(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Ks.from(t)).size?new Ks(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Ks.from(t)).size?new Ks(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ks.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},Ks.from=function(t){if(t instanceof Ks)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ks(e)};class Ys{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new Ys(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new Ys(n,r)}cutByIndex(t,e){return t==e?Ys.empty:0==t&&e==this.content.length?this:new Ys(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new Ys(r,o)}addToStart(t){return new Ys([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Ys(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return Js(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return Gs(this,t,e,n)}findIndex(t,e=-1){if(0==t)return Zs(0,t);if(t==this.size)return Zs(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?Zs(n+1,o):Zs(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return Ys.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ys(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Ys.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new Ys(e||t,n)}static from(t){if(!t)return Ys.empty;if(t instanceof Ys)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Ys([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ys.empty=new Ys([],0);const Xs={index:0,offset:0};function Zs(t,e){return Xs.index=t,Xs.offset=e,Xs}function Qs(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Qs(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Qs(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ta=class t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Qs(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];let n=e.slice();return n.sort(((t,e)=>t.type.rank-e.type.rank)),n}};ta.none=[];class ea extends Error{}class na{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=oa(this.content,t+this.openStart,e);return n&&new na(n,this.openStart,this.openEnd)}removeBetween(t,e){return new na(ra(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return na.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new na(Ys.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new na(t,n,r)}}function ra(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(ra(i.content,e-o-1,n-o-1)))}function oa(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=oa(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function ia(t,e,n){if(n.openStart>t.depth)throw new ea("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ea("Inconsistent open depths");return sa(t,e,n,0)}function sa(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=sa(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(Ys.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return pa(i,da(t,o,s,e,r))}{let r=t.parent,o=r.content;return pa(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return pa(i,fa(t,e,r))}function aa(t,e){if(!e.type.compatibleContent(t.type))throw new ea("Cannot join "+e.type.name+" onto "+t.type.name)}function la(t,e,n){let r=t.node(n);return aa(r,e.node(n)),r}function ca(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ua(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ca(t.nodeAfter,r),i++));for(let t=i;t<s;t++)ca(o.child(t),r);e&&e.depth==n&&e.textOffset&&ca(e.nodeBefore,r)}function pa(t,e){return t.type.checkContent(e),t.copy(e)}function da(t,e,n,r,o){let i=t.depth>o&&la(t,e,o+1),s=r.depth>o&&la(n,r,o+1),a=[];return ua(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(aa(i,s),ca(pa(i,da(t,e,n,r,o+1)),a)):(i&&ca(pa(i,fa(t,e,o+1)),a),ua(e,n,o,a),s&&ca(pa(s,fa(n,r,o+1)),a)),ua(r,null,o,a),new Ys(a)}function fa(t,e,n){let r=[];if(ua(null,t,n,r),t.depth>n){ca(pa(la(t,e,n+1),fa(t,e,n+1)),r)}return ua(e,null,n,r),new Ys(r)}na.empty=new na(Ys.empty,0,0);class ha{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return ta.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var 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}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new ya(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new ha(e,n,o)}static resolveCached(t,e){for(let n=0;n<ma.length;n++){let r=ma[n];if(r.pos==e&&r.doc==t)return r}let n=ma[ga]=ha.resolve(t,e);return ga=(ga+1)%va,n}}let ma=[],ga=0,va=12;class ya{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const _a=Object.create(null);let ba=class t{constructor(t,e,n,r=ta.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||Ys.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&Qs(this.attrs,e||t.defaultAttrs||_a)&&ta.sameSet(this.marks,n||ta.none)}copy(e=null){return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return na.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new na(a,r.depth-i,o.depth-i)}replace(t,e,n){return ia(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return ha.resolveCached(this,t)}resolveNoCache(t){return ha.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ka(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=Ys.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=ta.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!ta.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t=>t.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=Ys.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}};ba.prototype.text=void 0;class wa extends ba{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ka(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new wa(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new wa(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function ka(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class xa{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Sa(t,e);if(null==n.next)return xa.empty;let r=Ea(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(Ma(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);Ma(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new xa(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(Ta);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}}(function(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;e<t.min;e++){let e=n();o(i(t.expr,s),e),s=e}if(-1==t.max)o(i(t.expr,s),s);else for(let e=t.min;e<t.max;e++){let e=n();r(s,e),o(i(t.expr,s),e),s=e}return[r(s)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(t.exprs[r],e);if(r==t.exprs.length-1)return s;o(s,e=n())}}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return Ys.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r})).join("\n")}}xa.empty=new xa(!0);class Sa{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Ea(t){let e=[];do{e.push(Oa(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Oa(t){let e=[];do{e.push(Ca(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Ca(t){let e=function(t){if(t.eat("(")){let e=Ea(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&o.push(r)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Na(t,e)}return e}function Aa(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Na(t,e){let n=Aa(t),r=n;return t.eat(",")&&(r="}"!=t.next?Aa(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Ta(t,e){return e-t}function Ma(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(Ta)}function Ia(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function $a(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function Da(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Ra(t[n]);return e}let La=class t{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Da(n.attrs),this.defaultAttrs=Ia(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xa.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:$a(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ba(this,this.computeAttrs(t),Ys.from(e),ta.setFrom(n))}createChecked(t=null,e,n){return e=Ys.from(e),this.checkContent(e),new ba(this,this.computeAttrs(t),e,ta.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=Ys.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(Ys.empty,!0);return o?new ba(this,t,e.append(o),ta.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:ta.none:t}static compile(e,n){let r=Object.create(null);e.forEach(((e,o)=>r[e]=new t(e,n,o)));let 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(let t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Ra{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Pa{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Da(r.attrs),this.excluded=null;let o=Ia(this.attrs);this.instance=o?new ta(this,o):null}create(t=null){return!t&&this.instance?this.instance:new ta(this,$a(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new Pa(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class ja{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=Ks.from(t.nodes),e.marks=Ks.from(t.marks||{}),this.nodes=La.compile(this.spec.nodes,this),this.marks=Pa.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",o=e.spec.marks;e.contentMatch=n[r]||(n[r]=xa.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==o?null:o?za(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:za(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof La))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new wa(n,n.defaultAttrs,t,ta.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return ba.fromJSON(this,t)}markFromJSON(t){return ta.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function za(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}let Fa=class t{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new qa(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new qa(this,e,!0);return n.addAll(t,e.from,e.to),na.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Ka(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach((t=>{n(t=Ja(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=Ja(t)),t.node||t.ignore||t.mark||(t.node=e)}))}return e}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}};const Ha={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},Va={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ba={ol:!0,ul:!0};function Wa(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Ua{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=ta.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(Ys.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=Ys.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(Ys.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):Ga(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Ha.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class qa{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=Wa(null,e.preserveWhitespace,0)|(n?4:0);r=o?new Ua(o.type,o.attrs,ta.none,ta.none,!0,e.topMatch||o.type.contentMatch,i):new Ua(n?null:t.schema.topNodeType,null,ta.none,ta.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let e=t.getAttribute("style");if(e){let n=this.readStyles(function(t){let e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e));if(!n)return;let[r,o]=n,i=this.top;for(let t=0;t<o.length;t++)this.removePendingMark(o[t],i);for(let t=0;t<r.length;t++)this.addPendingMark(r[t]);this.addElement(t);for(let t=0;t<r.length;t++)this.removePendingMark(r[t],i);for(let t=0;t<o.length;t++)this.addPendingMark(o[t])}else this.addElement(t)}}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n,r=t.nodeName.toLowerCase();Ba.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&Ba.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:Va.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let e,n=this.top,i=this.needsBlock;if(Ha.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),e=!0,n.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),e&&this.sync(n),this.needsBlock=i}else this.addElementByRule(t,o,!1===o.consuming?n:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=ta.none,n=ta.none;t:for(let r=0;r<t.length;r+=2)for(let o;;){let i=this.parser.matchStyle(t[r],t[r+1],this,o);if(!i)continue t;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.forEach((t=>{i.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(e),!1!==i.consuming)break;o=i}return[e,n]}addElementByRule(t,e,n){let r,o,i;if(e.node)o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs||null,e.preserveWhitespace);else{i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)e.type&&!e.type.allowsMarkType(t.marks[r].type)||(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let i=Wa(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new Ua(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function Ka(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ja(t){let e={};for(let n in t)e[n]=t[n];return e}function Ga(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Ya{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Za(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Ya.renderSpec(Za(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Ya.renderSpec(Za(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let o=l;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=Ya.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ya(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Xa(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Xa(t.marks)}}function Xa(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Za(t){return t.document||window.document}const Qa=Math.pow(2,16);function tl(t,e){return t+e*Qa}function el(t){return 65535&t}class nl{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class rl{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&rl.empty)return rl.empty}recover(t){let e=0,n=el(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/Qa}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(t<=u){let o=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:u)?null:tl(s/3,t-a),p=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(p|=8),new nl(o,p,i)}r+=c-l}return n?t+r:new nl(t+r,0,null)}touches(t,e){let n=0,r=el(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),o+=c-l}}invert(){return new rl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?rl.empty:new rl(t<0?[0,-t,0]:[0,0,t])}}rl.empty=new rl([]);class ol{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new ol(this.maps,this.mirror,t,e)}copy(){return new ol(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new ol;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new nl(t,r,null)}}const il=Object.create(null);class sl{getMap(){return rl.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=il[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in il)throw new RangeError("Duplicate use of step JSON ID "+t);return il[t]=e,e.prototype.jsonID=t,e}}class al{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new al(t,null)}static fail(t){return new al(null,t)}static fromReplace(t,e,n,r){try{return al.ok(t.replace(e,n,r))}catch(t){if(t instanceof ea)return al.fail(t.message);throw t}}}function ll(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(ll(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return Ys.fromArray(r)}class cl extends sl{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new na(ll(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return al.fromReplace(t,this.from,this.to,o)}invert(){return new ul(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new cl(e.pos,n.pos,this.mark)}merge(t){return t instanceof cl&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new cl(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new cl(e.from,e.to,t.markFromJSON(e.mark))}}sl.jsonID("addMark",cl);class ul extends sl{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new na(ll(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return al.fromReplace(t,this.from,this.to,n)}invert(){return new cl(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new ul(e.pos,n.pos,this.mark)}merge(t){return t instanceof ul&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ul(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ul(e.from,e.to,t.markFromJSON(e.mark))}}sl.jsonID("removeMark",ul);class pl extends sl{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return al.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return al.fromReplace(t,this.pos,this.pos+1,new na(Ys.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new pl(this.pos,e.marks[n]);return new pl(this.pos,this.mark)}}return new dl(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new pl(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new pl(e.pos,t.markFromJSON(e.mark))}}sl.jsonID("addNodeMark",pl);class dl extends sl{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return al.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return al.fromReplace(t,this.pos,this.pos+1,new na(Ys.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new pl(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new dl(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new dl(e.pos,t.markFromJSON(e.mark))}}sl.jsonID("removeNodeMark",dl);class fl extends sl{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&ml(t,this.from,this.to)?al.fail("Structure replace would overwrite content"):al.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new rl([this.from,this.to-this.from,this.slice.size])}invert(t){return new fl(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new fl(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof fl)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?na.empty:new na(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new fl(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?na.empty:new na(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new fl(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new fl(e.from,e.to,na.fromJSON(t,e.slice),!!e.structure)}}sl.jsonID("replace",fl);class hl extends sl{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(ml(t,this.from,this.gapFrom)||ml(t,this.gapTo,this.to)))return al.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return al.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?al.fromReplace(t,this.from,this.to,n):al.fail("Content does not fit in gap")}getMap(){return new rl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new hl(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new hl(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new hl(e.from,e.to,e.gapFrom,e.gapTo,na.fromJSON(t,e.slice),e.insert,!!e.structure)}}function ml(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function gl(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function vl(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!gl(r,o,i))break}return null}function yl(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(_l).concat({type:e,attrs:n}).concat(i.map(_l)):null}function _l(t){return{type:t,attrs:null}}function bl(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function wl(t,e){let n=t.resolve(e),r=n.index();return kl(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function kl(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function xl(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let o,i,s=r.index(t);if(t==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(t+1),s++,i=r.node(t).maybeChild(s)):(o=r.node(t).maybeChild(s-1),i=r.node(t+1)),o&&!o.isTextblock&&kl(o,i)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function Sl(t,e,n=e,r=na.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return El(o,i,r)?new fl(e,n,r):new Ol(o,i,r).fit()}function El(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}sl.jsonID("replaceAround",hl);class Ol{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=Ys.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=Ys.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new na(o,i,s);return t>-1?new hl(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new fl(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=Nl(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(Ys.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:n,parent:r,inject:l};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Nl(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new na(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Nl(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new na(Cl(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new na(Cl(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,l=0,c=[],{match:u,type:p}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)c.push(r.child(t));u=u.matchFragment(r)}let d=s.size+t-(i.content.size-i.openEnd);for(;l<s.childCount;){let t=s.child(l),e=u.matchType(t.type);if(!e)break;l++,(l>1||0==a||t.content.size)&&(u=e,c.push(Tl(t.mark(p.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?d:-1)))}let f=l==s.childCount;f||(d=-1),this.placed=Al(this.placed,e,Ys.from(c)),this.frontier[e].match=u,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<d;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=f?0==t?na.empty:new na(Cl(i.content,t-1,1),t-1,d<0?i.openEnd:t-1):new na(Cl(i.content,t,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Ml(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=Ml(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=Ml(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Al(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Al(this.placed,this.depth,Ys.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Ys.empty,!0);t.childCount&&(this.placed=Al(this.placed,this.frontier.length,t))}}function Cl(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Cl(t.firstChild.content,e-1,n)))}function Al(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Al(t.lastChild.content,e-1,n)))}function Nl(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Tl(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Tl(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Ys.empty,!0)))),t.copy(r)}function Ml(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function Il(t){return t.spec.defining||t.spec.definingForContent}function $l(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy($l(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(Ys.empty,!0))}return t}function Dl(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class Ll extends sl{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return al.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return al.fromReplace(t,this.pos,this.pos+1,new na(Ys.from(r),0,e.isLeaf?0:1))}getMap(){return rl.empty}invert(t){return new Ll(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Ll(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ll(e.pos,e.attr,e.value)}}sl.jsonID("attr",Ll);let Rl=class extends Error{};Rl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Rl.prototype=Object.create(Error.prototype)).constructor=Rl,Rl.prototype.name="TransformError";class Pl{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ol}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Rl(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=na.empty){let r=Sl(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new na(Ys.from(n),0,0))}delete(t,e){return this.replace(t,e,na.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(El(o,i,r))return t.step(new fl(e,n,r));let s=Dl(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let l=s.indexOf(a),c=[],u=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==r.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){let e=c[t].type,n=Il(e);if(n&&o.node(l).type!=e)u=t;else if(n||!e.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+u+1)%(r.openStart+1),p=c[a];if(p)for(let e=0;e<s.length;e++){let c=s[(e+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let d=o.node(c-1),f=o.index(c-1);if(d.canReplaceWith(f,f,p.type,p.marks))return t.replace(o.before(c),u?i.after(c):n,new na($l(r.content,0,r.openStart,a),a,r.openEnd))}}let p=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>p));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new na(Ys.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Dl(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=Ys.empty,p=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,u=Ys.from(r.node(t).copy(u)),p++):l--;let d=Ys.empty,f=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,d=Ys.from(o.node(t).copy(d)),f++):c++;t.step(new hl(l,c,s,a,new na(u.append(d),p,f),u.size-p,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new fl(e-n,e+n,na.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=Ys.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ys.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new hl(o,i,o,i,new na(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),l=s.map(n+e.nodeSize,1);return t.step(new hl(a,l,a+1,l-1,new na(Ys.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new hl(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new na(Ys.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new Ll(t,e,n)),this}addNodeMark(t,e){return this.step(new pl(t,e)),this}removeNodeMark(t,e){if(!(e instanceof ta)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new dl(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=Ys.empty,s=Ys.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=Ys.from(o.node(t).copy(i));let e=r&&r[a];s=Ys.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new fl(e,e,new na(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),p=Math.min(l+t.nodeSize,n),d=r.addToSet(u);for(let t=0;t<u.length;t++)u[t].isInSet(d)||(o&&o.to==c&&o.mark.eq(u[t])?o.to=p:s.push(o=new ul(c,p,u[t])));i&&i.to==c?i.to=p:a.push(i=new cl(c,p,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof Pa){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,l=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&l.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,e),to:r,step:i})}}})),o.forEach((e=>t.step(new ul(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let e=0;e<o.childCount;e++){let a=o.child(e),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let e=0;e<a.marks.length;e++)n.allowsMarkType(a.marks[e].type)||t.step(new ul(s,l,a.marks[e]))}else i.push(new fl(s,l,na.empty));s=l}if(!r.validEnd){let e=r.fillBefore(Ys.empty,!0);t.replace(s,s,new na(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}const jl=Object.create(null);class zl{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Fl(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=na.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=t.mapping.slice(o);t.replaceRange(c.map(a.pos),c.map(l.pos),s?na.empty:e),0==s&&Yl(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),Yl(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Bl(t):Gl(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?Gl(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Gl(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Kl(t.node(0))}static atStart(t){return Gl(t,t,0,0,1)||new Kl(t)}static atEnd(t){return Gl(t,t,t.content.size,t.childCount,-1)||new Kl(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=jl[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in jl)throw new RangeError("Duplicate use of selection JSON ID "+t);return jl[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Bl.between(this.$anchor,this.$head).getBookmark()}}zl.prototype.visible=!0;class Fl{constructor(t,e){this.$from=t,this.$to=e}}let Hl=!1;function Vl(t){Hl||t.parent.inlineContent||(Hl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Bl extends zl{constructor(t,e=t){Vl(t),Vl(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return zl.near(n);let r=t.resolve(e.map(this.anchor));return new Bl(r.parent.inlineContent?r:n,n)}replace(t,e=na.empty){if(super.replace(t,e),e==na.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Bl&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Wl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Bl(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=zl.findFrom(e,n,!0)||zl.findFrom(e,-n,!0);if(!t)return zl.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(zl.findFrom(t,-n,!0)||zl.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Bl(t,e)}}zl.jsonID("text",Bl);class Wl{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Wl(t.map(this.anchor),t.map(this.head))}resolve(t){return Bl.between(t.resolve(this.anchor),t.resolve(this.head))}}class Ul extends zl{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?zl.near(o):new Ul(o)}content(){return new na(Ys.from(this.node),0,0)}eq(t){return t instanceof Ul&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ql(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ul(t.resolve(e.anchor))}static create(t,e){return new Ul(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Ul.prototype.visible=!1,zl.jsonID("node",Ul);class ql{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new Wl(n,n):new ql(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Ul.isSelectable(n)?new Ul(e):zl.near(e)}}class Kl extends zl{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=na.empty){if(e==na.empty){t.delete(0,t.doc.content.size);let e=zl.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Kl(t)}map(t){return new Kl(t)}eq(t){return t instanceof Kl}getBookmark(){return Jl}}zl.jsonID("all",Kl);const Jl={map(){return this},resolve:t=>new Kl(t)};function Gl(t,e,n,r,o,i=!1){if(e.inlineContent)return Bl.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Ul.isSelectable(r))return Ul.create(t,n-(o<0?r.nodeSize:0))}else{let e=Gl(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Yl(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof fl||i instanceof hl)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(zl.near(t.doc.resolve(o),n)))}function Xl(t,e){return e&&t?t.bind(e):t}class Zl{constructor(t,e,n){this.name=t,this.init=Xl(e.init,n),this.apply=Xl(e.apply,n)}}function Ql(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=Ql(o,e,{})),n[r]=o}return n}new Zl("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Zl("selection",{init:(t,e)=>t.selection||zl.atStart(e.doc),apply:t=>t.selection}),new Zl("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new Zl("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class tc{constructor(t){this.spec=t,this.props={},t.props&&Ql(t.props,this,this.props),this.key=t.key?t.key.key:nc("plugin")}getState(t){return t[this.key]}}const ec=Object.create(null);function nc(t){return t in ec?t+"$"+ ++ec[t]:(ec[t]=0,t+"$")}class rc{constructor(t="key"){this.key=nc(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const oc=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},ic=function(t,e,n,r){return n&&(ac(t,e,n,r,-1)||ac(t,e,n,r,1))},sc=/^(img|br|input|textarea|hr)$/i;function ac(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:lc(t))){let n=t.parentNode;if(!n||1!=n.nodeType||cc(t)||sc.test(t.nodeName)||"false"==t.contentEditable)return!1;e=oc(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?lc(t):0}}}function lc(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function cc(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const uc=function(t){return t.focusNode&&ic(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function pc(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const dc="undefined"!=typeof navigator?navigator:null,fc="undefined"!=typeof document?document:null,hc=dc&&dc.userAgent||"",mc=/Edge\/(\d+)/.exec(hc),gc=/MSIE \d/.exec(hc),vc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hc),yc=!!(gc||vc||mc),_c=gc?document.documentMode:vc?+vc[1]:mc?+mc[1]:0,bc=!yc&&/gecko\/(\d+)/i.test(hc);bc&&(/Firefox\/(\d+)/.exec(hc)||[0,0])[1];const wc=!yc&&/Chrome\/(\d+)/.exec(hc),kc=!!wc,xc=wc?+wc[1]:0,Sc=!yc&&!!dc&&/Apple Computer/.test(dc.vendor),Ec=Sc&&(/Mobile\/\w+/.test(hc)||!!dc&&dc.maxTouchPoints>2),Oc=Ec||!!dc&&/Mac/.test(dc.platform),Cc=/Android \d/.test(hc),Ac=!!fc&&"webkitFontSmoothing"in fc.documentElement.style,Nc=Ac?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Tc(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(uc(n)){for(a=c;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Ul.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==lc(t);r||o;){if(t==n)return!0;let e=oc(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==lc(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new Ul(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!l){l=jc(t,a,c,"pointer"==e||t.state.selection.head<c.pos&&!i?1:-1)}return l}function Mc(t){return t.editable?t.hasFocus():function(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ic(t,e=!1){let n=t.state.selection;if(function(t,e){if(e instanceof Ul){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Pc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Pc(t)}(t,n),Mc(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&kc){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&ic(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,oc(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&yc&&_c<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!$c||n instanceof Bl||(n.$from.parent.inlineContent||(r=Dc(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=Dc(t,n.to))),t.docView.setSelection(i,s,t.root,e),$c&&(r&&Rc(r),o&&Rc(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Mc(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const $c=Sc||kc&&xc<63;function Dc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Sc&&o&&"false"==o.contentEditable)return Lc(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Lc(o);if(i)return Lc(i)}}function Lc(t){return t.contentEditable="true",Sc&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Rc(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Pc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function jc(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||Bl.between(e,n,r)}function zc(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&zl.findFrom(i,e)}function Fc(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Hc(t,e,n){let r=t.state.selection;if(!(r instanceof Bl)){if(r instanceof Ul&&r.node.isInline)return Fc(t,new Bl(e>0?r.$to:r.$from));{let n=zc(t.state,e);return!!n&&Fc(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=zc(t.state,e);return!!(n&&n instanceof Ul)&&Fc(t,n)}if(!(Oc&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Ul.isSelectable(i)?Fc(t,new Ul(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Ac&&Fc(t,new Bl(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Vc(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Bc(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Wc(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(bc&&1==n.nodeType&&r<Vc(n)&&Bc(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Bc(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(qc(n))break;{let e=n.previousSibling;for(;e&&Bc(e);)o=n.parentNode,i=oc(e),e=e.previousSibling;if(e)n=e,r=Vc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Kc(t,n,r):o&&Kc(t,o,i)}function Uc(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Vc(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Bc(n.childNodes[r]))break;o=n,i=++r}else{if(qc(n))break;{let e=n.nextSibling;for(;e&&Bc(e);)o=e.parentNode,i=oc(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Vc(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Kc(t,o,i)}function qc(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Kc(t,e,n){let r=t.domSelection();if(uc(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&Ic(t)}),50)}function Jc(t,e,n){let r=t.state.selection;if(r instanceof Bl&&!r.empty||n.indexOf("s")>-1)return!1;if(Oc&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=zc(t.state,e);if(n&&n instanceof Ul)return Fc(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Kl?zl.near(n,e):zl.findFrom(n,e);return!!s&&Fc(t,s)}return!1}function Gc(t,e){if(!(t.state.selection instanceof Bl))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function Yc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Xc(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Oc&&72==n&&"c"==r?Gc(t,-1)||Wc(t):46==n||Oc&&68==n&&"c"==r?Gc(t,1)||Uc(t):13==n||27==n||(37==n||Oc&&66==n&&"c"==r?Hc(t,-1,r)||Wc(t):39==n||Oc&&70==n&&"c"==r?Hc(t,1,r)||Uc(t):38==n||Oc&&80==n&&"c"==r?Jc(t,-1,r)||Wc(t):40==n||Oc&&78==n&&"c"==r?function(t){if(!Sc||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Yc(t,n,"true"),setTimeout((()=>Yc(t,n,"false")),20)}return!1}(t)||Jc(t,1,r)||Uc(t):r==(Oc?"m":"c")&&(66==n||73==n||89==n||90==n))}function Zc(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||Ya.fromSchema(t.state.schema),a=lu(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,p=0;for(;u&&1==u.nodeType&&(c=su[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),p++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Qc(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let l=e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",(n=>{e=n(e,a||r,t)})),a)return e?new na(Ys.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):na.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,o,r,t)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=Ya.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=lu().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&su[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join(""));if(r.innerHTML=t,n)for(let t=0;t<n.length;t++)r=r.querySelector(n[t])||r;return r}(n),Ac&&function(t){let e=t.querySelectorAll(kc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let t=+u[3];t>0;t--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Fa.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||tu.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;o=Ys.from(e.create(n[t+1],o)),i++,s++}return new na(o,i,s)}(iu(s,+u[1],+u[2]),u[4]);else if(s=na.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&nu(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=ru(i[i.length-1],r.length));let e=eu(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return Ys.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=iu(s,t,e)}return t.someProp("transformPasted",(e=>{s=e(s,t)})),s}const tu=/^(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 eu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Ys.from(t));return t}function nu(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=nu(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(Ys.from(eu(n,t,o+1))))}}function ru(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,ru(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Ys.empty,!0);return t.copy(n.append(r))}function ou(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return o<r-1&&(a=ou(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ys.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function iu(t,e,n){return e<t.openStart&&(t=new na(ou(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new na(ou(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const su={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let au=null;function lu(){return au||(au=document.implementation.createHTMLDocument("title"))}const cu={},uu={};function pu(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function du(t){return{left:t.clientX,top:t.clientY}}function fu(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,(e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function hu(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function mu(t,e,n,r,o){return fu(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Ul&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(Ul.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(hu(t,Ul.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Ul.isSelectable(r))&&(hu(t,new Ul(n),"pointer"),!0)}(t,n))}function gu(t,e,n,r){return fu(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function vu(t,e,n,r){return fu(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(hu(t,Bl.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(n.inlineContent)hu(t,Bl.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Ul.isSelectable(n))continue;hu(t,Ul.create(r,i),"pointer")}return!0}}(t,n,r)}function yu(t){return Eu(t)}uu.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!wu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Cc||!kc||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Ec||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Xc(t,n)?n.preventDefault():pu(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,pc(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},uu.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},uu.keypress=(t,e)=>{let n=e;if(wu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Oc&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Bl&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const _u=Oc?"metaKey":"ctrlKey";cu.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=yu(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[_u]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(du(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new bu(t,s,n,!!r)):("doubleClick"==i?gu:vu)(t,s.pos,s.inside,n)?n.preventDefault():pu(t,"pointer"))};class bu{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[_u],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Ul&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!bc||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),pu(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Ic(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(du(t))),this.updateAllowDefault(t),this.allowDefault||!e?pu(this.view,"pointer"):mu(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Sc&&this.mightDrag&&!this.mightDrag.node.isAtom||kc&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(hu(this.view,zl.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):pu(this.view,"pointer")}move(t){this.updateAllowDefault(t),pu(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function wu(t,e){return!!t.composing||!!(Sc&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}cu.touchstart=t=>{t.input.lastTouch=Date.now(),yu(t),pu(t,"pointer")},cu.touchmove=t=>{t.input.lastTouch=Date.now(),pu(t,"pointer")},cu.contextmenu=t=>yu(t);const ku=Cc?5e3:-1;function xu(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Eu(t)),e))}function Su(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Eu(t,e=!1){if(!(Cc&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Su(t),e||t.docView&&t.docView.dirty){let e=Tc(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}uu.compositionstart=uu.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Eu(t,!0),t.markCursor=null;else if(Eu(t),bc&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}xu(t,ku)},uu.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,xu(t,20))};const Ou=yc&&_c<15||Ec&&Nc<604;function Cu(t,e,n,r){let o=Qc(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||na.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}cu.copy=uu.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Ou?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Zc(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},uu.paste=(t,e)=>{let n=e;if(t.composing&&!Cc)return;let r=Ou?null:n.clipboardData;r&&Cu(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Cu(t,r.value,null,e):Cu(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Au{constructor(t,e){this.slice=t,this.move=e}}const Nu=Oc?"altKey":"ctrlKey";cu.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(du(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Ul?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Ul.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Ul.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=Zc(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Ou?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ou||n.dataTransfer.setData("text/plain",l),t.dragging=new Au(s,!n[Nu])},cu.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},uu.dragover=uu.dragenter=(t,e)=>e.preventDefault(),uu.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(du(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=Qc(t,n.dataTransfer.getData(Ou?"Text":"text/plain"),Ou?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Nu]);if(t.someProp("handleDrop",(e=>e(t,n,s||na.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}(t.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),p=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(p?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let f=c.doc.resolve(u);if(p&&Ul.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ul(f));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),c.setSelection(jc(t,f,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},cu.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ic(t)}),20))},cu.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},cu.beforeinput=(t,e)=>{if(kc&&Cc&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,pc(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in uu)cu[t]=uu[t];function Tu(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Mu{constructor(t,e){this.toDOM=t,this.spec=e||Ru,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new Du(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Mu&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Tu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Iu{constructor(t,e){this.attrs=t,this.spec=e||Ru}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Du(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Iu&&Tu(this.attrs,t.attrs)&&Tu(this.spec,t.spec)}static is(t){return t.type instanceof Iu}destroy(){}}class $u{constructor(t,e){this.attrs=t,this.spec=e||Ru}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Du(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof $u&&Tu(this.attrs,t.attrs)&&Tu(this.spec,t.spec)}destroy(){}}class Du{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new Du(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new Du(t,t,new Mu(e,n))}static inline(t,e,n,r){return new Du(t,e,new Iu(n,r))}static node(t,e,n,r){return new Du(t,e,new $u(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Iu}}const Lu=[],Ru={};class Pu{constructor(t,e){this.local=t.length?t:Lu,this.children=e.length?e:Lu}static create(t,e){return e.length?Bu(e,t,0,Ru):ju}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==ju||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Ru)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice();for(let t=0,e=i;t<n.maps.length;t++){let r=0;n.maps[t].forEach(((t,n,i,s)=>{let l=s-i-(n-t);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||t>c+e-r)continue;let u=a[s]+e-r;n>=u?a[s+1]=t<=u?-2:-1:i>=o&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),e=n.maps[t].map(e,-1)}let l=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){l=!0,a[e+1]=-1;continue}let c=n.map(t[e]+i),u=c-o;if(u<0||u>=r.content.size){l=!0;continue}let p=n.map(t[e+1]+i,-1)-o,{index:d,offset:f}=r.content.findIndex(u),h=r.maybeChild(d);if(h&&f==u&&f+h.nodeSize==p){let r=a[e+2].mapInner(n,h,c+1,t[e]+i+1,s);r!=ju?(a[e]=u,a[e+1]=p,a[e+2]=r):(a[e+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),c=Bu(l,r,0,s);e=c.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<c.children.length;t+=3){let n=c.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,c.children[t],c.children[t+1],c.children[t+2])}}return new Pu(e.sort(Wu),a)}(this.children,i||[],t,e,n,r,o):i?new Pu(i.sort(Wu),Lu):ju}add(t,e){return e.length?this==ju?Pu.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=Hu(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,Bu(s,t,a+1,Ru)),o+=3}}));let i=Fu(o?Vu(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new Pu(i.length?this.local.concat(i).sort(Wu):this.local,r||this.children)}remove(t){return 0==t.length||this==ju?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=ju?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Pu(r,n):ju}forChild(t,e){if(this==ju)return this;if(e.isLeaf)return Pu.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof Iu){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new Pu(r.sort(Wu),Lu);return n?new zu([t,n]):t}return n||ju}eq(t){if(this==t)return!0;if(!(t instanceof Pu)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Uu(this.localsInner(t))}localsInner(t){if(this==ju)return Lu;if(t.inlineContent||!this.local.some(Iu.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Iu||e.push(this.local[t]);return e}}Pu.empty=new Pu([],[]),Pu.removeOverlap=Uu;const ju=Pu.empty;class zu{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,Ru)));return zu.from(n)}forChild(t,e){if(e.isLeaf)return Pu.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=ju&&(o instanceof zu?n=n.concat(o.members):n.push(o))}return zu.from(n)}eq(t){if(!(t instanceof zu)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?Uu(n?e:e.sort(Wu)):Lu}static from(t){switch(t.length){case 0:return ju;case 1:return t[0];default:return new zu(t.every((t=>t instanceof Pu))?t:t.reduce(((t,e)=>t.concat(e instanceof Pu?e:e.members)),[]))}}}function Fu(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Du(o.from+e,o.to+e,o.type))}return n}function Hu(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function Vu(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Bu(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Hu(t,e,s+n);if(a){i=!0;let t=Bu(a,e,n+s+1,r);t!=ju&&o.push(s,s+e.nodeSize,t)}}));let s=Fu(i?Vu(t):t,-n).sort(Wu);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new Pu(s,o):ju}function Wu(t,e){return t.from-e.from||t.to-e.to}function Uu(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),qu(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),qu(e,o+1,i.copy(r.to,i.to)))}}return e}function qu(t,e,n){for(;e<t.length&&Wu(n,t[e])>0;)e++;t.splice(e,0,n)}for(var Ku={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:"'"},Ju={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Gu="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Yu="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Xu="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Zu=Yu||Gu&&+Gu[1]<57,Qu=0;Qu<10;Qu++)Ku[48+Qu]=Ku[96+Qu]=String(Qu);for(Qu=1;Qu<=24;Qu++)Ku[Qu+111]="F"+Qu;for(Qu=65;Qu<=90;Qu++)Ku[Qu]=String.fromCharCode(Qu+32),Ju[Qu]=String.fromCharCode(Qu);for(var tp in Ku)Ju.hasOwnProperty(tp)||(Ju[tp]=Ku[tp]);const ep="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function np(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);ep?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function rp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function op(t){let e=function(t){let e=Object.create(null);for(let n in t)e[np(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(Zu&&(t.ctrlKey||t.altKey||t.metaKey)||Xu&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Ju:Ku)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[rp(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Ku[n.keyCode])&&r!=o){let o=e[rp(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[rp(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}function ip(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function sp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ap(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function lp(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function cp(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!wl(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=Ys.empty;for(let t=r.length-1;t>=0;t--)a=Ys.from(r[t].create(null,a));a=Ys.from(i.copy(a));let l=t.tr.step(new hl(e.pos-1,o,e.pos,o,new na(a,1,0),r.length,!0)),c=o+2*r.length;wl(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=zl.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&vl(c);if(null!=u&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&ip(s,"start",!0)&&ip(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=Ys.empty;for(let t=o.length-1;t>=0;t--)r=Ys.from(o[t].copy(r));n(t.tr.step(new hl(e.pos-o.length,e.pos+s.nodeSize,e.pos+l,e.pos+s.nodeSize-l,new na(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function up(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Bl.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const pp=up(-1),dp=up(1);function fp(t,e=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!0}}function hp(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);l=new ya(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new ya(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=yl(l,t,e,s);return!!c&&(r&&r(function(t,e,n,r,o){let i=Ys.empty;for(let t=n.length-1;t>=0;t--)i=Ys.from(n[t].type.create(n[t].attrs,i));t.step(new hl(e.start-(r?2:0),e.end,e.start,e.end,new na(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&bl(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return t}(n.tr,s,c,a,t).scrollIntoView()),!0)}}function mp(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!n||(r.node(i.depth-1).type==t?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new hl(i-1,s,i,s,new na(Ys.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ya(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=vl(r);if(null==a)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;wl(o.doc,l)&&o.join(l);return e(o.scrollIntoView()),!0}(e,n,t,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Ys.empty:Ys.from(o))))return!1;let p=i.pos,d=p+s.nodeSize;return r.step(new hl(p-(a?1:0),d+(l?1:0),p+1,d-1,new na((a?Ys.empty:Ys.from(o.copy(Ys.empty))).append(l?Ys.empty:Ys.from(o.copy(Ys.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function gp(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class vp{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!t,l=t||o.tr,c={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(l,e),o=n(...t)(r);return s.push(o),c}]))),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((t=>!0===t)))};return c}createCan(t){const{rawCommands:e,state:n}=this,r=t||n.tr,o=this.buildProps(r,false),i=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...o,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,false)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:r,view:i,state:gp({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}function yp(t,e,n){if(void 0===t.config[e]&&t.parent)return yp(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?yp(t.parent,e,n):null})}return t.config[e]}function _p(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function bp(t){const e=[],{nodeExtensions:n,markExtensions:r}=_p(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=yp(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:{...i,...r}})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},r=yp(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function wp(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function kp(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function xp(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>kp(t,e)),{})}function Sp(t,e,...n){return function(t){return"function"==typeof t}(t)?e?t.bind(e)(...n):t(...n):t}function Ep(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}}),{});return{...r,...o}}}}function Op(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function Cp(t,e){var n;const r=bp(t),{nodeExtensions:o,markExtensions:i}=_p(t),s=null===(n=o.find((t=>yp(t,"topNode"))))||void 0===n?void 0:n.name,a=Object.fromEntries(o.map((n=>{const o=r.filter((t=>t.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=Op({...t.reduce(((t,e)=>{const r=yp(e,"extendNodeSchema",i);return{...t,...r?r(n):{}}}),{}),content:Sp(yp(n,"content",i)),marks:Sp(yp(n,"marks",i)),group:Sp(yp(n,"group",i)),inline:Sp(yp(n,"inline",i)),atom:Sp(yp(n,"atom",i)),selectable:Sp(yp(n,"selectable",i)),draggable:Sp(yp(n,"draggable",i)),code:Sp(yp(n,"code",i)),defining:Sp(yp(n,"defining",i)),isolating:Sp(yp(n,"isolating",i)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=Sp(yp(n,"parseHTML",i));a&&(s.parseDOM=a.map((t=>Ep(t,o))));const l=yp(n,"renderHTML",i);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:xp(t,o)}));const c=yp(n,"renderText",i);return c&&(s.toText=c),[n.name,s]}))),l=Object.fromEntries(i.map((n=>{const o=r.filter((t=>t.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=Op({...t.reduce(((t,e)=>{const r=yp(e,"extendMarkSchema",i);return{...t,...r?r(n):{}}}),{}),inclusive:Sp(yp(n,"inclusive",i)),excludes:Sp(yp(n,"excludes",i)),group:Sp(yp(n,"group",i)),spanning:Sp(yp(n,"spanning",i)),code:Sp(yp(n,"code",i)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=Sp(yp(n,"parseHTML",i));a&&(s.parseDOM=a.map((t=>Ep(t,o))));const l=yp(n,"renderHTML",i);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:xp(t,o)})),[n.name,s]})));return new ja({topNode:s,nodes:a,marks:l})}function Ap(t,e){return e.nodes[t]||e.marks[t]||null}function Np(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function Tp(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class Mp{constructor(t){this.find=t.find,this.handler=t.handler}}function Ip(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let u=!1;const p=((t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,((t,e,o,i)=>{var s,a;const l=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-e))})),n})(c)+i;return s.forEach((t=>{if(u)return;const e=((t,e)=>{if(Tp(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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})(p,t.find);if(!e)return;const s=l.state.tr,c=gp({state:l.state,transaction:s}),d={from:r-(e[0].length-i.length),to:o},{commands:f,chain:h,can:m}=new vp({editor:n,state:c});null!==t.handler({state:c,range:d,match:e,commands:f,chain:h,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function $p(t){const{editor:e,rules:n}=t,r=new tc({state:{init:()=>null,apply(t,e){const n=t.getMeta(r);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(t,o,i,s)=>Ip({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&Ip({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&Ip({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Dp{constructor(t){this.find=t.find,this.handler=t.handler}}function Lp(t){const{editor:e,state:n,from:r,to:o,rule:i}=t,{commands:s,chain:a,can:l}=new vp({editor:e,state:n}),c=[];n.doc.nodesBetween(r,o,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const u=Math.max(r,e),p=Math.min(o,e+t.content.size),d=((t,e)=>{if(Tp(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(u-e,p-e,void 0,""),i.find);d.forEach((t=>{if(void 0===t.index)return;const e=u+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:t,commands:s,chain:a,can:l});c.push(p)}))}));return c.every((t=>null!==t))}function Rp(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1;const s=n.map((t=>new tc({view(t){const e=e=>{var n;r=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:t=>(i=r===t.dom.parentElement,!1),paste:(t,e)=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!i;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),p=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!p||u===p.b)return;const d=s.tr,f=gp({state:s,transaction:d});return Lp({editor:e,state:f,from:Math.max(u-1,0),to:p.b-1,rule:t})&&d.steps.length?d:void 0}})));return s}class Pp{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Pp.resolve(t),this.schema=Cp(this.extensions,e),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Ap(t.name,this.schema)};if("mark"===t.type){(null===(e=Sp(yp(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=yp(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=yp(t,"onCreate",n);o&&this.editor.on("create",o);const i=yp(t,"onUpdate",n);i&&this.editor.on("update",i);const s=yp(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=yp(t,"onTransaction",n);a&&this.editor.on("transaction",a);const l=yp(t,"onFocus",n);l&&this.editor.on("focus",l);const c=yp(t,"onBlur",n);c&&this.editor.on("blur",c);const u=yp(t,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(t){const e=Pp.sort(Pp.flatten(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=yp(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=yp(t,"priority")||100,r=yp(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=yp(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ap(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=Pp.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Ap(e.name,this.schema)},i=[],s=yp(e,"addKeyboardShortcuts",o);let a={};if("mark"===e.type&&e.config.exitable&&(a.ArrowRight=()=>dd.handleExit({editor:t,mark:e})),s){const e=Object.fromEntries(Object.entries(s()).map((([e,n])=>[e,()=>n({editor:t})])));a={...a,...e}}const l=new tc({props:{handleKeyDown:op(a)}});i.push(l);const c=yp(e,"addInputRules",o);Np(e,t.options.enableInputRules)&&c&&n.push(...c());const u=yp(e,"addPasteRules",o);Np(e,t.options.enablePasteRules)&&u&&r.push(...u());const p=yp(e,"addProseMirrorPlugins",o);if(p){const t=p();i.push(...t)}return i})).flat();return[$p({editor:t,rules:n}),...Rp({editor:t,rules:r}),...o]}get attributes(){return bp(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=_p(this.extensions);return Object.fromEntries(e.filter((t=>!!yp(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:wp(e.name,this.schema)},o=yp(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const l=xp(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]})))}}function jp(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function zp(t,e){const n={...t};return jp(t)&&jp(e)&&Object.keys(e).forEach((r=>{jp(e[r])?r in t?n[r]=zp(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Fp{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...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: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sp(yp(this,"addOptions",{name:this.name}))),this.storage=Sp(yp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Fp(t)}configure(t={}){const e=this.extend();return e.options=zp(this.options,t),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Fp(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Sp(yp(e,"addOptions",{name:e.name})),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}}Fp.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new tc({key:new rc("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map((t=>t.$from.pos))),a=Math.max(...i.map((t=>t.$to.pos))),l=function(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}(n);return function(t,e,n){const{from:r,to:o}=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(r,o,((t,n,c,u)=>{var p;const d=null==s?void 0:s[t.type.name];d?(t.isBlock&&!l&&(a+=i,l=!0),c&&(a+=d({node:t,pos:n,parent:c,index:u,range:e}))):t.isText?(a+=null===(p=null==t?void 0:t.text)||void 0===p?void 0:p.slice(Math.max(r,n)-n,o-n),l=!1):t.isBlock&&!l&&(a+=i,l=!0)})),a}(r,{from:s,to:a},{textSerializers:l})}}})]}});function Hp(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:Tp(e[r])?e[r].test(t[r]):e[r]===t[r]))}function Vp(t,e,n={}){return t.find((t=>t.type===e&&Hp(t.attrs,n)))}function Bp(t,e,n={}){return!!Vp(t,e,n)}function Wp(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=Vp([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Vp([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&Bp([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Up(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function qp(t){return t instanceof Bl}function Kp(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Jp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Gp(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Yp(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Ys.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Yp("",e,n)}if("string"==typeof t){const r=Fa.fromSchema(e);return n.slice?r.parseSlice(Gp(t),n.parseOptions).content:r.parse(Gp(t),n.parseOptions)}return Yp("",e,n)}function Xp(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Zp(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?wp(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const l=o-r,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>Hp(t.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((t,e)=>t+e.to-e.from),0)>=l}function Qp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function td(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}function ed(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function nd(t,e){const n=Up(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function rd(t,e){const n=Qp("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=wp(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,(t=>{i.push(t)}));const s=i.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}(t,e):"mark"===n?nd(t,e):{}}function od(t){const e=function(t,e=JSON.stringify){const n={};return t.filter((t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(t);return 1===e.length?e:e.filter(((t,n)=>{const r=e.filter(((t,e)=>e!==n));return!r.some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}))}function id(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach((e=>{const o=Wp(n.resolve(t-1),e.type);o&&r.push({mark:e,...o})})):n.nodesBetween(t,e,((t,e)=>{r.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),r}function sd(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function ad(t,e){const{nodeExtensions:n}=_p(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=Sp(yp(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function ld(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}const cd=(t,e)=>{const n=ed((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!wl(t.doc,n.pos)||(t.join(n.pos),!0)},ud=(t,e)=>{const n=ed((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!wl(t.doc,r)||(t.join(r),!0)};var pd=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,((t,n)=>{if(t.type.isText)return;const{doc:r,mapping:o}=e,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+t.nodeSize)),a=i.blockRange(s);if(!a)return;const l=vl(a);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(a.start,t)}(l||0===l)&&e.lift(a,l)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>((t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Kl||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=lp(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(Bl.create(s.doc,n+1)),e(s.scrollIntoView())}return!0})(t,e),deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let n=o.depth;n>0;n-=1){if(o.node(n).type===r.type){if(e){const e=o.before(n),r=o.after(n);t.delete(e,r).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=wp(t,n.schema),i=e.selection.$anchor;for(let t=i.depth;t>0;t-=1){if(i.node(t).type===o){if(r){const n=i.before(t),r=i.after(t);e.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},deleteSelection:()=>({state:t,dispatch:e})=>((t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0))(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=lp(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(zl.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0})(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Up(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const t=Wp(l,i,e);if(t&&t.from<=c&&t.to>=u){const e=Bl.create(s,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Jp()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===t||!1===t)return!0;if(i&&null===t&&!qp(n.state.selection))return s(),!0;const a=function(t,e=null){if(!e)return null;const n=zl.atStart(t),r=zl.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Bl.create(t,Kp(0,o,i),Kp(t.content.size,o,i)):Bl.create(t,Kp(e,o,i),Kp(e,o,i))}(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,r)=>e(t,{...n,index:r}))),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Yp(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:t,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((t=>{t.check(),l=!!l&&(t.isText&&0===t.marks.length),c=!!c&&t.isBlock})),s===a&&c){const{parent:t}=r.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}l?Array.isArray(e)?r.insertText(e.map((t=>t.text||"")).join(""),s,a):"object"==typeof e&&e&&e.text?r.insertText(e.text,s,a):r.insertText(e,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof fl||o instanceof hl))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(zl.near(t.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinUp:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection,o=r instanceof Ul;if(o){if(r.node.isTextblock||!wl(t.doc,r.from))return!1;n=r.from}else if(n=xl(t.doc,r.from,-1),null==n)return!1;if(e){let r=t.tr.join(n);o&&r.setSelection(Ul.create(r.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0})(t,e),joinDown:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection;if(r instanceof Ul){if(r.node.isTextblock||!wl(t.doc,r.to))return!1;n=r.to}else if(n=xl(t.doc,r.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t,e),joinBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let o=sp(r);if(!o){let n=r.blockRange(),o=n&&vl(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&cp(t,o,e))return!0;if(0==r.parent.content.size&&(ip(i,"end")||Ul.isSelectable(i))){let n=Sl(t.doc,r.before(),r.after(),na.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(ip(i,"end")?zl.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Ul.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))})(t,e),joinForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!r)return!1;let o=ap(r);if(!o)return!1;let i=o.nodeAfter;if(cp(t,o,e))return!0;if(0==r.parent.content.size&&(ip(i,"start")||Ul.isSelectable(i))){let n=Sl(t.doc,r.before(),r.after(),na.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(ip(i,"start")?zl.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Ul.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Jp()||Xp()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),s=i.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==l||l.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:r})=>!!Zp(n,wp(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&vl(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:t,dispatch:e})=>((t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(bl(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&vl(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)})(t,e),liftListItem:t=>({state:e,dispatch:n})=>mp(wp(t,e.schema))(e,n),newlineInCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))})(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Qp("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=wp(t,r.schema)),"mark"===a&&(s=Up(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,td(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(td(o.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=sp(r)}let s=i&&i.nodeBefore;return!(!s||!Ul.isSelectable(s)||(e&&e(t.tr.setSelection(Ul.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=ap(r)}let s=i&&i.nodeAfter;return!(!s||!Ul.isSelectable(s)||(e&&e(t.tr.setSelection(Ul.create(t.doc,i.pos)).scrollIntoView()),0))})(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(Ul.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>dp(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>pp(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=function(t,e,n={}){return Yp(t,e,{slice:!1,parseOptions:n})}(t,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Up(t,r.schema);if(o)if(s){const t=nd(r,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i),c=t.marks.find((t=>t.type===l));c?t.marks.forEach((t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))})):n.addMark(s,a,l.create(e))}))}));return function(t,e,n){var r;const{selection:o}=e;let i=null;if(qp(o)&&(i=o.$cursor),i){const e=null!==(r=t.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:s}=o;return s.some((({$from:e,$to:r})=>{let o=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,r.pos,((t,e,r)=>{if(o)return!1;if(t.isInline){const e=!r||r.type.allowsMarkType(n),i=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));o=e&&i}return!o})),o}))}(r,n,l)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=wp(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!fp(i,e)(n)||t.clearNodes())).command((({state:t})=>fp(i,e)(t,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=Kp(t,0,n.content.size),o=Ul.create(n,r);e.setSelection(o)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=Bl.atStart(n).from,s=Bl.atEnd(n).to,a=Kp(r,i,s),l=Kp(o,i,s),c=Bl.create(n,a,l);e.setSelection(c)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=wp(t,e.schema);return(o=r,function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(e){let n=l.lastChild&&l.lastChild.type==a.type,r=Ys.from(n?o.create():null),s=new na(Ys.from(o.create(null,Ys.from(a.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;e(t.tr.step(new hl(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(e,n);var o},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=sd(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Ul&&i.node.isBlock)return!(!a.parentOffset||!bl(s,a.pos))&&(r&&(t&&ld(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof Bl&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,p=bl(e.doc,e.mapping.map(a.pos),1,u);if(u||p||!bl(e.doc,e.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(p=!0,u=s?[{type:s,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&e.setNodeMarkup(e.mapping.map(a.before()),s)}t&&ld(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=wp(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const p=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let t=Ys.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-n;e>=a.depth-3;e-=1)t=Ys.from(a.node(e).copy(t));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=sd(p,a.node().type.name,a.node().attrs),l=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;t=t.append(Ys.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));e.replace(c,a.after(-r),new na(t,4-n,0));let u=-1;e.doc.nodesBetween(c,e.doc.content.size,((t,e)=>{if(u>-1)return!1;t.isTextblock&&0===t.content.size&&(u=e+1)})),u>-1&&e.setSelection(Bl.near(e.doc.resolve(u))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,f=sd(p,u.type.name,u.attrs),h=sd(p,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:f},{type:d,attrs:h}]:[{type:s,attrs:f}];if(!bl(e.doc,a.pos,2))return!1;if(r){const{selection:t,storedMarks:i}=n,{splittableMarks:s}=o.extensionManager,l=i||t.$to.parentOffset&&t.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!l||!r)return!0;const c=l.filter((t=>s.includes(t.type.name)));e.ensureMarks(c)}return!0},toggleList:(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:p,splittableMarks:d}=o.extensionManager,f=wp(t,s.schema),h=wp(e,s.schema),{selection:m,storedMarks:g}=s,{$from:v,$to:y}=m,_=v.blockRange(y),b=g||m.$to.parentOffset&&m.$from.marks();if(!_)return!1;const w=ed((t=>ad(t.type.name,p)))(m);if(_.depth>=1&&w&&_.depth-w.depth<=1){if(w.node.type===f)return c.liftListItem(h);if(ad(w.node.type.name,p)&&f.validContent(w.node.content)&&a)return l().command((()=>(i.setNodeMarkup(w.pos,f),!0))).command((()=>cd(i,f))).command((()=>ud(i,f))).run()}return n&&b&&a?l().command((()=>{const t=u().wrapInList(f,r),e=b.filter((t=>d.includes(t.type.name)));return i.ensureMarks(e),!!t||c.clearNodes()})).wrapInList(f,r).command((()=>cd(i,f))).command((()=>ud(i,f))).run():l().command((()=>!!u().wrapInList(f,r)||c.clearNodes())).wrapInList(f,r).command((()=>cd(i,f))).command((()=>ud(i,f))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Up(t,r.schema),a=function(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Up(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>Hp(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:e,$to:n})=>{const r=e.pos,o=n.pos;t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);s+=i-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>Hp(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}(r,s,e);return a?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=wp(t,r.schema),s=wp(e,r.schema);return Zp(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=wp(t,n.schema);return Zp(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){const n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Up(t,r.schema),{$from:c,empty:u,ranges:p}=a;if(!o)return!0;if(u&&s){let{from:t,to:e}=a;const r=null===(i=c.marks().find((t=>t.type===l)))||void 0===i?void 0:i.attrs,o=Wp(c,l,r);o&&(t=o.from,e=o.to),n.removeMark(t,e,l)}else p.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Qp("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=wp(t,r.schema)),"mark"===a&&(s=Up(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+t.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&yl(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(wp(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>hp(wp(t,n.schema),e)(n,r)});Fp.create({name:"commands",addCommands:()=>({...pd})}),Fp.create({name:"editable",addProseMirrorPlugins(){return[new tc({key:new rc("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Fp.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new tc({key:new rc("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Fp.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=zl.atStart(r).from===s;return!(!(o&&l&&a.type.isTextblock)||a.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Jp()||Xp()?o:r},addProseMirrorPlugins(){return[new tc({key:new rc("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some((t=>t.docChanged))&&!e.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=e.selection,s=zl.atStart(e.doc).from,a=zl.atEnd(e.doc).to;if(r||!(o===s&&i===a))return;if(!(0===n.doc.textBetween(0,n.doc.content.size," "," ").length))return;const l=n.tr,c=gp({state:n,transaction:l}),{commands:u}=new vp({editor:this.editor,state:c});return u.clearNodes(),l.steps.length?l:void 0}})]}}),Fp.create({name:"tabindex",addProseMirrorPlugins(){return[new tc({key:new rc("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class dd{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...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: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sp(yp(this,"addOptions",{name:this.name}))),this.storage=Sp(yp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new dd(t)}configure(t={}){const e=this.extend();return e.options=zp(this.options,t),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new dd(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Sp(yp(e,"addOptions",{name:e.name})),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const i=o.find((t=>(null==t?void 0:t.type.name)===e.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),t.view.dispatch(n),!0}return!1}}class fd{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...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: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sp(yp(this,"addOptions",{name:this.name}))),this.storage=Sp(yp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new fd(t)}configure(t={}){const e=this.extend();return e.options=zp(this.options,t),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new fd(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Sp(yp(e,"addOptions",{name:e.name})),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}}function hd(t){return new Dp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Sp(t.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(id(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>c)).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+r,c),l=n.from+r+s.length,i.addMark(n.from+r,l,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}const md=fd.create({name:"text",group:"inline"});var gd=200,vd=function(){};vd.prototype.append=function(t){return t.length?(t=vd.from(t),!this.length&&t||t.length<gd&&this.leafAppend(t)||this.length<gd&&t.leafPrepend(this)||this.appendInner(t)):this},vd.prototype.prepend=function(t){return t.length?vd.from(t).append(this):this},vd.prototype.appendInner=function(t){return new _d(this,t)},vd.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?vd.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},vd.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},vd.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},vd.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},vd.from=function(t){return t instanceof vd?t:t&&t.length?new yd(t):vd.empty};var yd=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=gd)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=gd)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(vd);vd.empty=new yd([]);var _d=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(vd),bd=vd;class wd{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new kd(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new kd(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new wd(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,c=t.steps[n].invert(t.docs[n]),u=new kd(t.mapping.maps[n],c,e);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),e&&(i++,e=void 0),r||(a=u)}let l=i-n.depth;return l>Sd&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new wd(s.append(o),i)}remapping(t,e){let n=new ol;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new wd(this.items.append(t.map((t=>new kd(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new kd(l,i,c))}else n.push(new kd(l))}),r);let l=[];for(let t=e;t<i;t++)l.push(new kd(o.maps[t]));let c=this.items.slice(0,r).append(l).append(n),u=new wd(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new kd(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new wd(bd.from(r.reverse()),o)}}wd.empty=new wd(bd.empty,0);class kd{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new kd(e.getMap().invert(),e,this.selection)}}}class xd{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const Sd=20;function Ed(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function Od(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function Cd(t,e,n,r){let o=Td(e),i=Md.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),c=new xd(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(Md,{redo:r,historyState:c}).scrollIntoView())}let Ad=!1,Nd=null;function Td(t){let e=t.plugins;if(Nd!=e){Ad=!1,Nd=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ad=!0;break}}return Ad}const Md=new rc("history"),Id=new rc("closeHistory");function $d(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new tc({key:Md,state:{init:()=>new xd(wd.empty,wd.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(Md);if(i)return i.historyState;n.getMeta(Id)&&(t=new xd(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Md))return s.getMeta(Md).redo?new xd(t.done.addTransform(n,void 0,r,Td(e)),t.undone,Ed(n.mapping.maps[n.steps.length-1]),t.prevTime):new xd(t.done,t.undone.addTransform(n,void 0,r,Td(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new xd(t.done.rebased(n,o),t.undone.rebased(n,o),Od(t.prevRanges,n.mapping),t.prevTime):new xd(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Od(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?Od(t.prevRanges,n.mapping):Ed(n.mapping.maps[n.steps.length-1]);return new xd(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,Td(e)),wd.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Dd:"historyRedo"==n?Ld:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const Dd=(t,e)=>{let n=Md.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Cd(n,t,e,!1),!0)},Ld=(t,e)=>{let n=Md.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Cd(n,t,e,!0),!0)},Rd=Fp.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Dd(t,e),redo:()=>({state:t,dispatch:e})=>Ld(t,e)}),addProseMirrorPlugins(){return[$d(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Pd=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),jd=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),zd=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),Fd=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Hd=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),Vd=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),Bd=Object.freeze({SETTINGS:"settings",ALL:"_"}),Wd=Object.freeze({BLANK:"_blank",SELF:"_self"}),Ud=Object.freeze({URL:"url",BLOCK:"block"});class qd{static create(t,e){const n=new this(t,e||{});return new tc({key:new rc(this.name),props:n._buildProps()})}constructor(t,e){this.options=e,this.editor=t}_buildProps(){const t=Object.entries(this.addProps()).map((([t,e])=>[t,e.bind(this)]));return Object.fromEntries(t)}addProps(){return{}}}class Kd extends qd{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(t){if(t.includes("data-pm-slice")&&t.includes("zw-style"))return t;const e=qm.build(t);return e.normalizeHTML(),this._removeDeprecatedStyles(e),e.normalizedHTML}_removeDeprecatedStyles(t){const e=t.dom.querySelectorAll('[style*="margin"]');for(const t of Array.from(e))t.style.removeProperty("margin"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-right"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("margin-left")}_handlePaste(t,e,n){const r=this._insertPastedContent(t,n).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return t.dispatch(r),!0}_insertPastedContent({state:t,input:e},n){return this._isFullBlockSelected(t)?t.tr.replaceSelectionWith(n.content,e.shiftKey):t.tr.replaceSelection(n)}_isFullBlockSelected(t){const e=this._expandSelectionToBlocks(t),n=this._isMatchPosition(e.from,t.selection.from),r=this._isMatchPosition(e.to,t.selection.to);return n&&r}_expandSelectionToBlocks({selection:t,doc:e}){let n=t.from,r=t.to;return e.nodesBetween(n,r,((t,e,o)=>{o.type.name===Fd.DOCUMENT&&(n=Math.min(n,e+1),r=Math.max(r,e+t.nodeSize-1))})),{from:n,to:r}}_isMatchPosition(t,e){return Math.abs(t-e)<5}}class Jd extends qd{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:t}){const e=[];return this.editor.isEditable?t.childCount>1?void 0:(t.descendants(((t,n)=>{if(!t.childCount){const r=Du.node(n,n+t.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});e.push(r)}return!1})),Pu.create(t,e)):null}}const Gd=(t,e)=>{for(const n in e)t[n]=e[n];return t},Yd="numeric",Xd="ascii",Zd="alpha",Qd="asciinumeric",tf="alphanumeric",ef="domain",nf="emoji",rf="whitespace";function of(t,e){return t in e||(e[t]=[]),e[t]}function sf(t,e,n){e[Yd]&&(e[Qd]=!0,e[tf]=!0),e[Xd]&&(e[Qd]=!0,e[Zd]=!0),e[Qd]&&(e[tf]=!0),e[Zd]&&(e[tf]=!0),e[tf]&&(e[ef]=!0),e[nf]&&(e[ef]=!0);for(const r in e){const e=of(r,n);e.indexOf(t)<0&&e.push(t)}}function af(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}af.groups={},af.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.test(t))return o}return e.jd},has(t,e){return void 0===e&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){let o;return r=r||af.groups,e&&e.j?o=e:(o=new af(e),n&&r&&sf(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let e=0;e<i-1;e++)o=o.tt(t[e]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||af.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new af,Gd(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new af,i){if(r)if(s.t&&"string"==typeof s.t){const t=Gd(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);sf(i,t,r)}else n&&sf(i,n,r);s.t=i}return o.j[t]=s,s}};const lf=(t,e,n,r,o)=>t.ta(e,n,r,o),cf=(t,e,n,r,o)=>t.tr(e,n,r,o),uf=(t,e,n,r,o)=>t.ts(e,n,r,o),pf=(t,e,n,r,o)=>t.tt(e,n,r,o),df="WORD",ff="UWORD",hf="LOCALHOST",mf="TLD",gf="UTLD",vf="SCHEME",yf="SLASH_SCHEME",_f="NUM",bf="NL",wf="OPENBRACE",kf="OPENBRACKET",xf="OPENANGLEBRACKET",Sf="OPENPAREN",Ef="CLOSEBRACE",Of="CLOSEBRACKET",Cf="CLOSEANGLEBRACKET",Af="CLOSEPAREN",Nf="AMPERSAND",Tf="APOSTROPHE",Mf="ASTERISK",If="AT",$f="BACKSLASH",Df="BACKTICK",Lf="CARET",Rf="COLON",Pf="COMMA",jf="DOLLAR",zf="DOT",Ff="EQUALS",Hf="EXCLAMATION",Vf="HYPHEN",Bf="PERCENT",Wf="PIPE",Uf="PLUS",qf="POUND",Kf="QUERY",Jf="QUOTE",Gf="SEMI",Yf="SLASH",Xf="TILDE",Zf="UNDERSCORE",Qf="EMOJI",th="SYM";var eh=Object.freeze({__proto__:null,WORD:df,UWORD:ff,LOCALHOST:hf,TLD:mf,UTLD:gf,SCHEME:vf,SLASH_SCHEME:yf,NUM:_f,WS:"WS",NL:bf,OPENBRACE:wf,OPENBRACKET:kf,OPENANGLEBRACKET:xf,OPENPAREN:Sf,CLOSEBRACE:Ef,CLOSEBRACKET:Of,CLOSEANGLEBRACKET:Cf,CLOSEPAREN:Af,AMPERSAND:Nf,APOSTROPHE:Tf,ASTERISK:Mf,AT:If,BACKSLASH:$f,BACKTICK:Df,CARET:Lf,COLON:Rf,COMMA:Pf,DOLLAR:jf,DOT:zf,EQUALS:Ff,EXCLAMATION:Hf,HYPHEN:Vf,PERCENT:Bf,PIPE:Wf,PLUS:Uf,POUND:qf,QUERY:Kf,QUOTE:Jf,SEMI:Gf,SLASH:Yf,TILDE:Xf,UNDERSCORE:Zf,EMOJI:Qf,SYM:th});const nh=/[a-z]/,rh=/\p{L}/u,oh=/\p{Emoji}/u,ih=/\d/,sh=/\s/;let ah=null,lh=null;function ch(t,e,n,r,o){let i;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?i=t.j[s]:(i=new af(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new af(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function uh(t){const e=[],n=[];let r=0;for(;r<t.length;){let o=0;for(;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+o),10);e>0;e--)n.pop();r+=o}else n.push(t[r]),r++}return e}const ph={defaultProtocol:"http",events:null,format:fh,formatHref:fh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function dh(t,e){void 0===e&&(e=null);let n=Gd({},ph);t&&(n=Gd(n,t instanceof dh?t.o:t));const r=n.ignoreTags,o=[];for(let t=0;t<r.length;t++)o.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function fh(t){return t}function hh(t,e){this.t="token",this.v=t,this.tk=e}function mh(t,e){class n extends hh{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}dh.prototype={o:ph,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let o=this.o[t];return o?("object"==typeof o?(o=n.t in o?o[n.t]:ph[t],"function"==typeof o&&r&&(o=o(e,n))):"function"==typeof o&&r&&(o=o(e,n.t,n)),o):o},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},hh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=ph.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Gd(s,u),{tagName:o,attributes:s,content:i,eventListeners:p}}};const gh=mh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),vh=mh("text"),yh=mh("nl"),_h=mh("url",{isLink:!0,toHref(t){return void 0===t&&(t=ph.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==hf&&t[1].t===Rf}}),bh=t=>new af(t);function wh(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const kh="undefined"!=typeof console&&console&&console.warn||(()=>{}),xh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Sh(t,e){if(void 0===e&&(e=!1),xh.initialized&&kh(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n 1. Must only contain digits, lowercase ASCII letters or "-"\n 2. Cannot start or end with "-"\n 3. "-" cannot repeat');xh.customSchemes.push([t,e])}function Eh(){xh.scanner=function(t){void 0===t&&(t=[]);const e={};af.groups=e;const n=new af;null==ah&&(ah=uh("aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==lh&&(lh=uh("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),pf(n,"'",Tf),pf(n,"{",wf),pf(n,"[",kf),pf(n,"<",xf),pf(n,"(",Sf),pf(n,"}",Ef),pf(n,"]",Of),pf(n,">",Cf),pf(n,")",Af),pf(n,"&",Nf),pf(n,"*",Mf),pf(n,"@",If),pf(n,"`",Df),pf(n,"^",Lf),pf(n,":",Rf),pf(n,",",Pf),pf(n,"$",jf),pf(n,".",zf),pf(n,"=",Ff),pf(n,"!",Hf),pf(n,"-",Vf),pf(n,"%",Bf),pf(n,"|",Wf),pf(n,"+",Uf),pf(n,"#",qf),pf(n,"?",Kf),pf(n,'"',Jf),pf(n,"/",Yf),pf(n,";",Gf),pf(n,"~",Xf),pf(n,"_",Zf),pf(n,"\\",$f);const r=cf(n,ih,_f,{[Yd]:!0});cf(r,ih,r);const o=cf(n,nh,df,{[Xd]:!0});cf(o,nh,o);const i=cf(n,rh,ff,{[Zd]:!0});cf(i,nh),cf(i,rh,i);const s=cf(n,sh,"WS",{[rf]:!0});pf(n,"\n",bf,{[rf]:!0}),pf(s,"\n"),cf(s,sh,s);const a=cf(n,oh,Qf,{[nf]:!0});cf(a,oh,a),pf(a,"️",a);const l=pf(a,"‍");cf(l,oh,a);const c=[[nh,o]],u=[[nh,null],[rh,i]];for(let t=0;t<ah.length;t++)ch(n,ah[t],mf,df,c);for(let t=0;t<lh.length;t++)ch(n,lh[t],gf,ff,u);sf(mf,{tld:!0,ascii:!0},e),sf(gf,{utld:!0,alpha:!0},e),ch(n,"file",vf,df,c),ch(n,"mailto",vf,df,c),ch(n,"http",yf,df,c),ch(n,"https",yf,df,c),ch(n,"ftp",yf,df,c),ch(n,"ftps",yf,df,c),sf(vf,{scheme:!0,ascii:!0},e),sf(yf,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let e=0;e<t.length;e++){const r=t[e][0],o=t[e][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?o[ef]=!0:nh.test(r)?ih.test(r)?o[Qd]=!0:o[Xd]=!0:o[Yd]=!0,uf(n,r,r,o)}return uf(n,"localhost",hf,{ascii:!0}),n.jd=new af(th),{start:n,tokens:Gd({groups:e},eh)}}(xh.customSchemes);for(let t=0;t<xh.tokenQueue.length;t++)xh.tokenQueue[t][1]({scanner:xh.scanner});xh.parser=function(t){let{groups:e}=t;const n=e.domain.concat([Nf,Mf,If,$f,Df,Lf,jf,Ff,Vf,_f,Bf,Wf,Uf,qf,Yf,th,Xf,Zf]),r=[Tf,Cf,Ef,Of,Af,Rf,Pf,zf,Hf,xf,wf,kf,Sf,Kf,Jf,Gf],o=[Nf,Tf,Mf,$f,Df,Lf,Ef,jf,Ff,Vf,wf,Bf,Wf,Uf,qf,Kf,Yf,th,Xf,Zf],i=bh(),s=pf(i,Xf);lf(s,o,s),lf(s,e.domain,s);const a=bh(),l=bh(),c=bh();lf(i,e.domain,a),lf(i,e.scheme,l),lf(i,e.slashscheme,c),lf(a,o,s),lf(a,e.domain,a);const u=pf(a,If);pf(s,If,u),pf(l,If,u),pf(c,If,u);const p=pf(s,zf);lf(p,o,s),lf(p,e.domain,s);const d=bh();lf(u,e.domain,d),lf(d,e.domain,d);const f=pf(d,zf);lf(f,e.domain,d);const h=bh(gh);lf(f,e.tld,h),lf(f,e.utld,h),pf(u,hf,h);const m=pf(d,Vf);lf(m,e.domain,d),lf(h,e.domain,d),pf(h,zf,f),pf(h,Vf,m);const g=pf(h,Rf);lf(g,e.numeric,gh);const v=pf(a,Vf),y=pf(a,zf);lf(v,e.domain,a),lf(y,o,s),lf(y,e.domain,a);const _=bh(_h);lf(y,e.tld,_),lf(y,e.utld,_),lf(_,e.domain,a),lf(_,o,s),pf(_,zf,y),pf(_,Vf,v),pf(_,If,u);const b=pf(_,Rf),w=bh(_h);lf(b,e.numeric,w);const k=bh(_h),x=bh();lf(k,n,k),lf(k,r,x),lf(x,n,k),lf(x,r,x),pf(_,Yf,k),pf(w,Yf,k);const S=pf(l,Rf),E=pf(c,Rf),O=pf(E,Yf),C=pf(O,Yf);lf(l,e.domain,a),pf(l,zf,y),pf(l,Vf,v),lf(c,e.domain,a),pf(c,zf,y),pf(c,Vf,v),lf(S,e.domain,k),pf(S,Yf,k),lf(C,e.domain,k),lf(C,n,k),pf(C,Yf,k);const A=pf(k,wf),N=pf(k,kf),T=pf(k,xf),M=pf(k,Sf);pf(x,wf,A),pf(x,kf,N),pf(x,xf,T),pf(x,Sf,M),pf(A,Ef,k),pf(N,Of,k),pf(T,Cf,k),pf(M,Af,k),pf(A,Ef,k);const I=bh(_h),$=bh(_h),D=bh(_h),L=bh(_h);lf(A,n,I),lf(N,n,$),lf(T,n,D),lf(M,n,L);const R=bh(),P=bh(),j=bh(),z=bh();return lf(A,r),lf(N,r),lf(T,r),lf(M,r),lf(I,n,I),lf($,n,$),lf(D,n,D),lf(L,n,L),lf(I,r,I),lf($,r,$),lf(D,r,D),lf(L,r,L),lf(R,n,R),lf(P,n,$),lf(j,n,D),lf(z,n,L),lf(R,r,R),lf(P,r,P),lf(j,r,j),lf(z,r,z),pf($,Of,k),pf(D,Cf,k),pf(L,Af,k),pf(I,Ef,k),pf(P,Of,k),pf(j,Cf,k),pf(z,Af,k),pf(R,Af,k),pf(i,hf,_),pf(i,bf,yh),{start:i,tokens:eh}}(xh.scanner.tokens);for(let t=0;t<xh.pluginQueue.length;t++)xh.pluginQueue[t][1]({scanner:xh.scanner,parser:xh.parser});xh.initialized=!0}function Oh(t){return xh.initialized||Eh(),function(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,p=null,d=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(d=0,p=a):d>=0&&d++,o++,u++;if(d<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(wh(vh,e,s)),s=[]),o-=d,u-=d;const t=p.t,r=n.slice(o-u,o);i.push(wh(t,e,r))}}return s.length>0&&i.push(wh(vh,e,s)),i}(xh.parser.start,t,function(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let o,i=t.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,p=-1,d=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,d=0,u=a):p>=0&&(p+=n[s].length,d++),c+=n[s].length,i+=n[s].length,s++;i-=p,s-=d,c-=p,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}(xh.scanner.start,t))}function Ch(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new dh(n),o=Oh(t),i=[];for(let t=0;t<o.length;t++){const n=o[t];!n.isLink||e&&n.t!==e||i.push(n.toFormattedObject(r))}return i}function Ah(t,e){void 0===e&&(e=null);const n=Oh(t);return 1===n.length&&n[0].isLink&&(!e||n[0].t===e)}class Nh extends qd{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(t,e,n){if(t.state.selection.empty)return!1;const r=n.content.textBetween(0,n.content.size).trim(),o=Ah(r);if(!r||!o)return!1;const i=this._createLinkAttrs(r,n.content);return this.editor.commands.applyLink(i),!0}_createLinkAttrs(t,e){return Xm.query(e,{typeName:Fd.TEXT,mark:{typeName:Vd.LINK},getMark:{typeName:Vd.LINK}})?.attrs||{href:t}}}function Th(t){return(...e)=>n=>t(n,...e)}function Mh(t){const e=Object.entries(t).reduce(((t,[e,n])=>{if(!n)return t;return`${t}--zw-${e.replace(/_/g,"-")}:${n};`}),"");return e?{style:e}:null}function Ih(t){const e=Mh(t);return["span",e?{...e,class:"zw-style"}:{},0]}function $h(t,...e){return({editor:n})=>(n.commands[t](...e),!0)}var Dh=Object.defineProperty,Lh=(t,e,n)=>(((t,e,n)=>{e in t?Dh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);const Rh=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),Ph="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",jh=`[\\s|\\(]+(${Ph})[,|\\s]+(${Ph})[,|\\s]+(${Ph})\\s*\\)?`,zh=`[\\s|\\(]+(${Ph})[,|\\s]+(${Ph})[,|\\s]+(${Ph})[,|\\s]+(${Ph})\\s*\\)?`,Fh=Object.freeze({CSS_UNIT:new RegExp(Ph),RGB:new RegExp(`rgb${jh}`),RGBA:new RegExp(`rgba${zh}`),HSL:new RegExp(`hsl${jh}`),HSLA:new RegExp(`hsla${zh}`),HSV:new RegExp(`hsv${jh}`),HSVA:new RegExp(`hsva${zh}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),Hh=Object.freeze({WINDOW:Symbol("window")});function Vh(t,e){let n=!1;return function(){n||(t.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),e))}}function Bh(t){return t>1||t<-1?t/100:t}const Wh=t=>Number.parseFloat(t.toFixed(5).substr(0,5));function Uh(t){const e=function(t,e=1){const n=[];let r=0;for(;r<t.length;)n.push(t.substr(r,e)),r+=e;return n}(t.slice(1),2).map((t=>parseInt(t,16))),n=void 0!==e[3]?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:n}}function qh(t){const{h:e,s:n,v:r,a:o}=t,i=t=>{const o=(t+e/60)%6;return r-r*n*Math.max(Math.min(o,4-o,1),0)},s=[i(5),i(3),i(1)].map((t=>Math.round(255*t)));return{r:s[0],g:s[1],b:s[2],a:o}}function Kh(t){if(!t)return{h:0,s:1,v:1,a:1};const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),i=Math.min(e,n,r);let s=0;o!==i&&(o===e?s=60*(0+(n-r)/(o-i)):o===n?s=60*(2+(r-e)/(o-i)):o===r&&(s=60*(4+(e-n)/(o-i)))),s<0&&(s+=360);const a=[s,0===o?0:(o-i)/o,o],l=Wh(a[1]),c=Wh(a[2]);return{h:Math.floor(a[0]),s:l,v:c,a:t.a}}function Jh(t){const e=Kh(Uh(t));const n=function(t){const{h:e,s:n,v:r,a:o}=t,i=r-r*n/2,s=1===i||0===i?0:(r-i)/Math.min(i,1-i);return{h:e,s:Wh(s),l:Wh(i),a:o}}(e),r=Uh(t);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:n,hsva:e,hue:e.h,rgba:r}}function Gh(t,e,n="0"){return t+n.repeat(Math.max(0,e-t.length))}function Yh(t){return Jh(function(t){let e=t;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),3!==e.length&&4!==e.length||(e=e.split("").map((t=>t+t)).join("")),e=6===e.length?Gh(e,8,"F"):Gh(Gh(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}(t))}const Xh=class{static create(t){if(!t)return Xh.fromBlack();let e=t.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(Rh[e])e=Rh[e];else if(e===this.TRANSPARENT)return Xh.fromTransparent();const n=Fh.RGB.exec(e)||Fh.RGBA.exec(e);if(n){const t=void 0===n[4]?1:n[4];return Xh.fromRgba({r:Number.parseInt(n[1]),g:Number.parseInt(n[2]),b:Number.parseInt(n[3]),a:Number.parseFloat(t)})}const r=Fh.HSL.exec(e)||Fh.HSLA.exec(e);if(r){const t=void 0===r[4]?1:r[4];return Xh.fromHsla({h:Number.parseInt(r[1]),s:Number.parseFloat(r[2]),l:Number.parseFloat(r[3]),a:Number.parseFloat(t)})}const o=Fh.HSV.exec(e)||Fh.HSVA.exec(e);if(o){const t=void 0===o[4]?1:o[4];return Xh.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(t)})}return Fh.HEX8.exec(e)||Fh.HEX6.exec(e)||Fh.HEX4.exec(e)||Fh.HEX3.exec(e)?Xh.fromHex(e):Xh.fromBlack()}static fromHex(t){const{rgba:e}=Yh(t);return new Xh(e)}static fromRgba({r:t,g:e,b:n,a:r}){const o=Bh(r);return new Xh({r:t,g:e,b:n,a:o})}static fromHsla({h:t,s:e,l:n,a:r}){const o=Bh(e),i=Bh(n),s=Bh(r);return Xh.fromHsva(function(t){const{h:e,s:n,l:r,a:o}=t,i=r+n*Math.min(r,1-r);return{h:e,s:Wh(0===i?0:2-2*r/i),v:Wh(i),a:o}}({h:t,s:o,l:i,a:s}))}static fromHsva({h:t,s:e,v:n,a:r}){const o=qh({h:t,s:Bh(e),v:Bh(n),a:Bh(r)});return new Xh(o)}static fromTransparent(){return new Xh({r:0,g:0,b:0,a:0})}static fromWhite(){return new Xh({r:255,g:255,b:255,a:1})}static fromBlack(){return new Xh({r:0,g:0,b:0,a:1})}static isTransparent(t){return Xh.create(t).isTransparent()}static isDark(t){return Xh.create(t).isDark()}constructor(t){this._rgba=t,this._hsva=this._calcHsva(),this._alpha=t.a}get hex(){return this.toHexString()}get r(){return this._rgba.r}get b(){return this._rgba.b}get g(){return this._rgba.g}get h(){return this._hsva.h}get s(){return this._hsva.s}get v(){return this._hsva.v}get alpha(){return this._alpha}setAlpha(t){return this._alpha=t,this}toHexString(){return function(t){const e=t=>{const e=Math.round(t).toString(16);return("00".substr(0,2-e.length)+e).toUpperCase()};return`#${[e(t.r),e(t.g),e(t.b)].join("")}`}({r:this.r,g:this.g,b:this.b,a:this.alpha})}toRgbaString(){const t=`${Math.floor(100*this.alpha)}%`;return`rgba(${[this.r,this.g,this.b,t].join(", ")})`}get rgba(){return this._rgba}updateRgb(t){this._rgba={...this._rgba,...t},this._hsva=this._calcHsva()}get hsva(){return this._hsva}updateHsv(t){this._hsva={...this._hsva,...t},this._rgba=this._calcRgba()}isTransparent(){return 0===this.alpha}isDark(){return this.getBrightness()<128}getBrightness(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3}_calcHsva(){return Kh(this.rgba)}_calcRgba(){return qh(this.hsva)}};let Zh=Xh;Lh(Zh,"TRANSPARENT","transparent"),Lh(Zh,"NONE","none"),Hh.WINDOW;function Qh(t){const e=Zh.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}function tm(t,e){if(!t.includes("em"))return parseInt(t);const n=Km.getComputedStyle(e).fontSize,r=parseFloat(t)*parseFloat(n);return Math.round(r)}function em(t,e,n){if(!t.includes("px"))return t;const r=function(t,e){return(t.firstElementChild||t).style.fontSize||Km.getComputedStyle(e).fontSize}(e,n),o=tm(r,n);return o?(parseInt(t)/o).toFixed(2):null}Hh.WINDOW,Hh.WINDOW,Vh(((t,e)=>{t(e)}),20);const nm={start:zd.LEFT,end:zd.RIGHT};const rm=(t,e,n,r)=>({from:Math.max(r,t.pos),to:Math.min(r+n.nodeSize,e.pos)});function om(t,e){return t.resolve(e).depth+1}const im=(t,e)=>t.eq(e);var sm,am,lm={};function cm(t){return t.type.create(lm.cloneDeep(t.attrs))}
6
+ */var J=Object.freeze({}),G=Array.isArray;function Y(t){return null==t}function X(t){return null!=t}function Z(t){return!0===t}function Q(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function tt(t){return"function"==typeof t}function et(t){return null!==t&&"object"==typeof t}var nt=Object.prototype.toString;function rt(t){return nt.call(t).slice(8,-1)}function ot(t){return"[object Object]"===nt.call(t)}function it(t){return"[object RegExp]"===nt.call(t)}function st(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function at(t){return X(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function lt(t){return null==t?"":Array.isArray(t)||ot(t)&&t.toString===nt?JSON.stringify(t,null,2):String(t)}function ct(t){var e=parseFloat(t);return isNaN(e)?t:e}function ut(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}var pt=ut("slot,component",!0),dt=ut("key,ref,slot,slot-scope,is");function ft(t,e){var n=t.length;if(n){if(e===t[n-1])return void(t.length=n-1);var r=t.indexOf(e);if(r>-1)return t.splice(r,1)}}var ht=Object.prototype.hasOwnProperty;function mt(t,e){return ht.call(t,e)}function gt(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var vt=/-(\w)/g,yt=gt((function(t){return t.replace(vt,(function(t,e){return e?e.toUpperCase():""}))})),_t=gt((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),bt=/\B([A-Z])/g,wt=gt((function(t){return t.replace(bt,"-$1").toLowerCase()}));var kt=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function xt(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function St(t,e){for(var n in e)t[n]=e[n];return t}function Et(t){for(var e={},n=0;n<t.length;n++)t[n]&&St(e,t[n]);return e}function Ot(t,e,n){}var Ct=function(t,e,n){return!1},At=function(t){return t};function Nt(t,e){if(t===e)return!0;var n=et(t),r=et(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=Array.isArray(t),i=Array.isArray(e);if(o&&i)return t.length===e.length&&t.every((function(t,n){return Nt(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||i)return!1;var s=Object.keys(t),a=Object.keys(e);return s.length===a.length&&s.every((function(n){return Nt(t[n],e[n])}))}catch(t){return!1}}function Tt(t,e){for(var n=0;n<t.length;n++)if(Nt(t[n],e))return n;return-1}function Mt(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}function It(t,e){return t===e?0===t&&1/t!=1/e:t==t||e==e}var $t="data-server-rendered",Dt=["component","directive","filter"],Lt=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"],Rt={optionMergeStrategies:Object.create(null),silent:!1,productionTip:"production"!==process.env.NODE_ENV,devtools:"production"!==process.env.NODE_ENV,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Ct,isReservedAttr:Ct,isUnknownElement:Ct,getTagNamespace:Ot,parsePlatformTagName:At,mustUseProp:Ct,async:!0,_lifecycleHooks:Lt},Pt=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function jt(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function zt(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var Ft=new RegExp("[^".concat(Pt.source,".$_\\d]"));var Ht="__proto__"in{},Vt="undefined"!=typeof window,Bt=Vt&&window.navigator.userAgent.toLowerCase(),Wt=Bt&&/msie|trident/.test(Bt),Ut=Bt&&Bt.indexOf("msie 9.0")>0,qt=Bt&&Bt.indexOf("edge/")>0;Bt&&Bt.indexOf("android");var Kt,Jt=Bt&&/iphone|ipad|ipod|ios/.test(Bt),Gt=Bt&&Bt.match(/firefox\/(\d+)/),Yt={}.watch,Xt=!1;if(Vt)try{var Zt={};Object.defineProperty(Zt,"passive",{get:function(){Xt=!0}}),window.addEventListener("test-passive",null,Zt)}catch(t){}var Qt=function(){return void 0===Kt&&(Kt=!Vt&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Kt},te=Vt&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(t){return"function"==typeof t&&/native code/.test(t.toString())}var ne,re="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);ne="undefined"!=typeof Set&&ee(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var oe=null;function ie(t){void 0===t&&(t=null),t||oe&&oe._scope.off(),oe=t,t&&t._scope.on()}var se=function(){function t(t,e,n,r,o,i,s,a){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),ae=function(t){void 0===t&&(t="");var e=new se;return e.text=t,e.isComment=!0,e};function le(t){return new se(void 0,void 0,void 0,String(t))}function ce(t){var e=new se(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var ue=function(){return ue=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ue.apply(this,arguments)},pe=0,de=[],fe=function(){function t(){this._pending=!1,this.id=pe++,this.subs=[]}return t.prototype.addSub=function(t){this.subs.push(t)},t.prototype.removeSub=function(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,de.push(this))},t.prototype.depend=function(e){t.target&&(t.target.addDep(this),"production"!==process.env.NODE_ENV&&e&&t.target.onTrack&&t.target.onTrack(ue({effect:t.target},e)))},t.prototype.notify=function(t){var e=this.subs.filter((function(t){return t}));"production"===process.env.NODE_ENV||Rt.async||e.sort((function(t,e){return t.id-e.id}));for(var n=0,r=e.length;n<r;n++){var o=e[n];"production"!==process.env.NODE_ENV&&t&&o.onTrigger&&o.onTrigger(ue({effect:e[n]},t)),o.update()}},t}();fe.target=null;var he=[];function me(t){he.push(t),fe.target=t}function ge(){he.pop(),fe.target=he[he.length-1]}var ve=Array.prototype,ye=Object.create(ve);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){var e=ve[t];zt(ye,t,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o,i=e.apply(this,n),s=this.__ob__;switch(t){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&s.observeArray(o),"production"!==process.env.NODE_ENV?s.dep.notify({type:"array mutation",target:this,key:t}):s.dep.notify(),i}))}));var _e=Object.getOwnPropertyNames(ye),be={},we=!0;function ke(t){we=t}var xe={notify:Ot,depend:Ot,addSub:Ot,removeSub:Ot},Se=function(){function t(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!1),this.value=t,this.shallow=e,this.mock=n,this.dep=n?xe:new fe,this.vmCount=0,zt(t,"__ob__",this),G(t)){if(!n)if(Ht)t.__proto__=ye;else for(var r=0,o=_e.length;r<o;r++){zt(t,s=_e[r],ye[s])}e||this.observeArray(t)}else{var i=Object.keys(t);for(r=0;r<i.length;r++){var s;Oe(t,s=i[r],be,void 0,e,n)}}}return t.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)Ee(t[e],!1,this.mock)},t}();function Ee(t,e,n){return t&&mt(t,"__ob__")&&t.__ob__ instanceof Se?t.__ob__:!we||!n&&Qt()||!G(t)&&!ot(t)||!Object.isExtensible(t)||t.__v_skip||Re(t)||t instanceof se?void 0:new Se(t,e,n)}function Oe(t,e,n,r,o,i){var s=new fe,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var l=a&&a.get,c=a&&a.set;l&&!c||n!==be&&2!==arguments.length||(n=t[e]);var u=!o&&Ee(n,!1,i);return Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var r=l?l.call(t):n;return fe.target&&("production"!==process.env.NODE_ENV?s.depend({target:t,type:"get",key:e}):s.depend(),u&&(u.dep.depend(),G(r)&&Ne(r))),Re(r)&&!o?r.value:r},set:function(a){var p=l?l.call(t):n;if(It(p,a)){if("production"!==process.env.NODE_ENV&&r&&r(),c)c.call(t,a);else{if(l)return;if(!o&&Re(p)&&!Re(a))return void(p.value=a);n=a}u=!o&&Ee(a,!1,i),"production"!==process.env.NODE_ENV?s.notify({type:"set",target:t,key:e,newValue:a,oldValue:p}):s.notify()}}}),s}}function Ce(t,e,n){if("production"!==process.env.NODE_ENV&&(Y(t)||Q(t))&&Fr("Cannot set reactive property on undefined, null, or primitive value: ".concat(t)),!De(t)){var r=t.__ob__;return G(t)&&st(e)?(t.length=Math.max(t.length,e),t.splice(e,1,n),r&&!r.shallow&&r.mock&&Ee(n,!1,!0),n):e in t&&!(e in Object.prototype)?(t[e]=n,n):t._isVue||r&&r.vmCount?("production"!==process.env.NODE_ENV&&Fr("Avoid adding reactive properties to a Vue instance or its root $data at runtime - declare it upfront in the data option."),n):r?(Oe(r.value,e,n,void 0,r.shallow,r.mock),"production"!==process.env.NODE_ENV?r.dep.notify({type:"add",target:t,key:e,newValue:n,oldValue:void 0}):r.dep.notify(),n):(t[e]=n,n)}"production"!==process.env.NODE_ENV&&Fr('Set operation on key "'.concat(e,'" failed: target is readonly.'))}function Ae(t,e){if("production"!==process.env.NODE_ENV&&(Y(t)||Q(t))&&Fr("Cannot delete reactive property on undefined, null, or primitive value: ".concat(t)),G(t)&&st(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount?"production"!==process.env.NODE_ENV&&Fr("Avoid deleting properties on a Vue instance or its root $data - just set it to null."):De(t)?"production"!==process.env.NODE_ENV&&Fr('Delete operation on key "'.concat(e,'" failed: target is readonly.')):mt(t,e)&&(delete t[e],n&&("production"!==process.env.NODE_ENV?n.dep.notify({type:"delete",target:t,key:e}):n.dep.notify()))}}function Ne(t){for(var e=void 0,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),G(e)&&Ne(e)}function Te(t){return Me(t,!0),zt(t,"__v_isShallow",!0),t}function Me(t,e){if(!De(t)){if("production"!==process.env.NODE_ENV){G(t)&&Fr("Avoid using Array as root value for ".concat(e?"shallowReactive()":"reactive()"," as it cannot be tracked in watch() or watchEffect(). Use ").concat(e?"shallowRef()":"ref()"," instead. This is a Vue-2-only limitation."));var n=t&&t.__ob__;n&&n.shallow!==e&&Fr("Target is already a ".concat(n.shallow?"":"non-","shallow reactive object, and cannot be converted to ").concat(e?"":"non-","shallow."))}var r=Ee(t,e,Qt());"production"===process.env.NODE_ENV||r||((null==t||Q(t))&&Fr("value cannot be made reactive: ".concat(String(t))),("Map"===(o=rt(t))||"WeakMap"===o||"Set"===o||"WeakSet"===o)&&Fr("Vue 2 does not support reactive collection types such as Map or Set."))}var o}function Ie(t){return De(t)?Ie(t.__v_raw):!(!t||!t.__ob__)}function $e(t){return!(!t||!t.__v_isShallow)}function De(t){return!(!t||!t.__v_isReadonly)}var Le="__v_isRef";function Re(t){return!(!t||!0!==t.__v_isRef)}function Pe(t){return function(t,e){if(Re(t))return t;var n={};return zt(n,Le,!0),zt(n,"__v_isShallow",e),zt(n,"dep",Oe(n,"value",t,null,e,Qt())),n}(t,!1)}function je(t){return Re(t)?t.value:t}function ze(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){var t=e[n];if(Re(t))return t.value;var r=t&&t.__ob__;return r&&r.dep.depend(),t},set:function(t){var r=e[n];Re(r)&&!Re(t)?r.value=t:e[n]=t}})}function Fe(t,e,n){var r=t[e];if(Re(r))return r;var o={get value(){var r=t[e];return void 0===r?n:r},set value(n){t[e]=n}};return zt(o,Le,!0),o}function He(t,e){var n,r,o=tt(t);o?(n=t,r="production"!==process.env.NODE_ENV?function(){Fr("Write operation failed: computed value is readonly")}:Ot):(n=t.get,r=t.set);var i=Qt()?null:new nr(oe,n,Ot,{lazy:!0});"production"!==process.env.NODE_ENV&&i&&e&&(i.onTrack=e.onTrack,i.onTrigger=e.onTrigger);var s={effect:i,get value(){return i?(i.dirty&&i.evaluate(),fe.target&&("production"!==process.env.NODE_ENV&&fe.target.onTrack&&fe.target.onTrack({effect:fe.target,target:s,type:"get",key:"value"}),i.depend()),i.value):n()},set value(t){r(t)}};return zt(s,Le,!0),zt(s,"__v_isReadonly",o),s}var Ve,Be="watcher",We="".concat(Be," callback"),Ue="".concat(Be," getter"),qe="".concat(Be," cleanup"),Ke={};function Je(t,e,n){return"production"!==process.env.NODE_ENV&&"function"!=typeof e&&Fr("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),function(t,e,n){var r=void 0===n?J:n,o=r.immediate,i=r.deep,s=r.flush,a=void 0===s?"pre":s,l=r.onTrack,c=r.onTrigger;"production"===process.env.NODE_ENV||e||(void 0!==o&&Fr('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==i&&Fr('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));var u,p,d=function(t){Fr("Invalid watch source: ".concat(t,". A watch source can only be a getter/effect ")+"function, a ref, a reactive object, or an array of these types.")},f=oe,h=function(t,e,n){return void 0===n&&(n=null),Rn(t,null,n,f,e)},m=!1,g=!1;Re(t)?(u=function(){return t.value},m=$e(t)):Ie(t)?(u=function(){return t.__ob__.dep.depend(),t},i=!0):G(t)?(g=!0,m=t.some((function(t){return Ie(t)||$e(t)})),u=function(){return t.map((function(t){return Re(t)?t.value:Ie(t)?Yn(t):tt(t)?h(t,Ue):void("production"!==process.env.NODE_ENV&&d(t))}))}):tt(t)?u=e?function(){return h(t,Ue)}:function(){if(!f||!f._isDestroyed)return p&&p(),h(t,Be,[y])}:(u=Ot,"production"!==process.env.NODE_ENV&&d(t));if(e&&i){var v=u;u=function(){return Yn(v())}}var y=function(t){p=_.onStop=function(){h(t,qe)}};if(Qt())return y=Ot,e?o&&h(e,We,[u(),g?[]:void 0,y]):u(),Ot;var _=new nr(oe,u,Ot,{lazy:!0});_.noRecurse=!e;var b=g?[]:Ke;_.run=function(){if(_.active)if(e){var t=_.get();(i||m||(g?t.some((function(t,e){return It(t,b[e])})):It(t,b)))&&(p&&p(),h(e,We,[t,b===Ke?void 0:b,y]),b=t)}else _.get()},"sync"===a?_.update=_.run:"post"===a?(_.post=!0,_.update=function(){return Cr(_)}):_.update=function(){if(f&&f===oe&&!f._isMounted){var t=f._preWatchers||(f._preWatchers=[]);t.indexOf(_)<0&&t.push(_)}else Cr(_)};"production"!==process.env.NODE_ENV&&(_.onTrack=l,_.onTrigger=c);e?o?_.run():b=_.get():"post"===a&&f?f.$once("hook:mounted",(function(){return _.get()})):_.get();return function(){_.teardown()}}(t,e,n)}var Ge=function(){function t(t){void 0===t&&(t=!1),this.detached=t,this.active=!0,this.effects=[],this.cleanups=[],this.parent=Ve,!t&&Ve&&(this.index=(Ve.scopes||(Ve.scopes=[])).push(this)-1)}return t.prototype.run=function(t){if(this.active){var e=Ve;try{return Ve=this,t()}finally{Ve=e}}else"production"!==process.env.NODE_ENV&&Fr("cannot run an inactive effect scope.")},t.prototype.on=function(){Ve=this},t.prototype.off=function(){Ve=this.parent},t.prototype.stop=function(t){if(this.active){var e=void 0,n=void 0;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].teardown();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){var r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this.active=!1}},t}();var Ye=gt((function(t){var e="&"===t.charAt(0),n="~"===(t=e?t.slice(1):t).charAt(0),r="!"===(t=n?t.slice(1):t).charAt(0);return{name:t=r?t.slice(1):t,once:n,capture:r,passive:e}}));function Xe(t,e){function n(){var t=n.fns;if(!G(t))return Rn(t,null,arguments,e,"v-on handler");for(var r=t.slice(),o=0;o<r.length;o++)Rn(r[o],null,arguments,e,"v-on handler")}return n.fns=t,n}function Ze(t,e,n,r,o,i){var s,a,l,c;for(s in t)a=t[s],l=e[s],c=Ye(s),Y(a)?"production"!==process.env.NODE_ENV&&Fr('Invalid handler for event "'.concat(c.name,'": got ')+String(a),i):Y(l)?(Y(a.fns)&&(a=t[s]=Xe(a,i)),Z(c.once)&&(a=t[s]=o(c.name,a,c.capture)),n(c.name,a,c.capture,c.passive,c.params)):a!==l&&(l.fns=a,t[s]=l);for(s in e)Y(t[s])&&r((c=Ye(s)).name,e[s],c.capture)}function Qe(t,e,n){var r;t instanceof se&&(t=t.data.hook||(t.data.hook={}));var o=t[e];function i(){n.apply(this,arguments),ft(r.fns,i)}Y(o)?r=Xe([i]):X(o.fns)&&Z(o.merged)?(r=o).fns.push(i):r=Xe([o,i]),r.merged=!0,t[e]=r}function tn(t,e,n,r,o){if(X(e)){if(mt(e,n))return t[n]=e[n],o||delete e[n],!0;if(mt(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function en(t){return Q(t)?[le(t)]:G(t)?rn(t):void 0}function nn(t){return X(t)&&X(t.text)&&!1===t.isComment}function rn(t,e){var n,r,o,i,s=[];for(n=0;n<t.length;n++)Y(r=t[n])||"boolean"==typeof r||(i=s[o=s.length-1],G(r)?r.length>0&&(nn((r=rn(r,"".concat(e||"","_").concat(n)))[0])&&nn(i)&&(s[o]=le(i.text+r[0].text),r.shift()),s.push.apply(s,r)):Q(r)?nn(i)?s[o]=le(i.text+r):""!==r&&s.push(le(r)):nn(r)&&nn(i)?s[o]=le(i.text+r.text):(Z(t._isVList)&&X(r.tag)&&Y(r.key)&&X(e)&&(r.key="__vlist".concat(e,"_").concat(n,"__")),s.push(r)));return s}function on(t,e){var n,r,o,i,s=null;if(G(t)||"string"==typeof t)for(s=new Array(t.length),n=0,r=t.length;n<r;n++)s[n]=e(t[n],n);else if("number"==typeof t)for(s=new Array(t),n=0;n<t;n++)s[n]=e(n+1,n);else if(et(t))if(re&&t[Symbol.iterator]){s=[];for(var a=t[Symbol.iterator](),l=a.next();!l.done;)s.push(e(l.value,s.length)),l=a.next()}else for(o=Object.keys(t),s=new Array(o.length),n=0,r=o.length;n<r;n++)i=o[n],s[n]=e(t[i],i,n);return X(s)||(s=[]),s._isVList=!0,s}function sn(t,e,n,r){var o,i=this.$scopedSlots[t];i?(n=n||{},r&&("production"===process.env.NODE_ENV||et(r)||Fr("slot v-bind without argument expects an Object",this),n=St(St({},r),n)),o=i(n)||(tt(e)?e():e)):o=this.$slots[t]||(tt(e)?e():e);var s=n&&n.slot;return s?this.$createElement("template",{slot:s},o):o}function an(t){return Qr(this.$options,"filters",t,!0)||At}function ln(t,e){return G(t)?-1===t.indexOf(e):t!==e}function cn(t,e,n,r,o){var i=Rt.keyCodes[e]||n;return o&&r&&!Rt.keyCodes[e]?ln(o,r):i?ln(i,t):r?wt(r)!==e:void 0===t}function un(t,e,n,r,o){if(n)if(et(n)){G(n)&&(n=Et(n));var i=void 0,s=function(s){if("class"===s||"style"===s||dt(s))i=t;else{var a=t.attrs&&t.attrs.type;i=r||Rt.mustUseProp(e,a,s)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var l=yt(s),c=wt(s);l in i||c in i||(i[s]=n[s],o&&((t.on||(t.on={}))["update:".concat(s)]=function(t){n[s]=t}))};for(var a in n)s(a)}else"production"!==process.env.NODE_ENV&&Fr("v-bind without argument expects an Object or Array value",this);return t}function pn(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||fn(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),"__static__".concat(t),!1),r}function dn(t,e,n){return fn(t,"__once__".concat(e).concat(n?"_".concat(n):""),!0),t}function fn(t,e,n){if(G(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&hn(t[r],"".concat(e,"_").concat(r),n);else hn(t,e,n)}function hn(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function mn(t,e){if(e)if(ot(e)){var n=t.on=t.on?St({},t.on):{};for(var r in e){var o=n[r],i=e[r];n[r]=o?[].concat(o,i):i}}else"production"!==process.env.NODE_ENV&&Fr("v-on without argument expects an Object value",this);return t}function gn(t,e,n,r){e=e||{$stable:!n};for(var o=0;o<t.length;o++){var i=t[o];G(i)?gn(i,e,n):i&&(i.proxy&&(i.fn.proxy=!0),e[i.key]=i.fn)}return r&&(e.$key=r),e}function vn(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];"string"==typeof r&&r?t[e[n]]=e[n+1]:"production"!==process.env.NODE_ENV&&""!==r&&null!==r&&Fr("Invalid value for dynamic directive argument (expected string or null): ".concat(r),this)}return t}function yn(t,e){return"string"==typeof t?e+t:t}function _n(t){t._o=dn,t._n=ct,t._s=lt,t._l=on,t._t=sn,t._q=Nt,t._i=Tt,t._m=pn,t._f=an,t._k=cn,t._b=un,t._v=le,t._e=ae,t._u=gn,t._g=mn,t._d=vn,t._p=yn}function bn(t,e){if(!t||!t.length)return{};for(var n={},r=0,o=t.length;r<o;r++){var i=t[r],s=i.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,i.context!==e&&i.fnContext!==e||!s||null==s.slot)(n.default||(n.default=[])).push(i);else{var a=s.slot,l=n[a]||(n[a]=[]);"template"===i.tag?l.push.apply(l,i.children||[]):l.push(i)}}for(var c in n)n[c].every(wn)&&delete n[c];return n}function wn(t){return t.isComment&&!t.asyncFactory||" "===t.text}function kn(t){return t.isComment&&t.asyncFactory}function xn(t,e,n,r){var o,i=Object.keys(n).length>0,s=e?!!e.$stable:!i,a=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&r&&r!==J&&a===r.$key&&!i&&!r.$hasNormal)return r;for(var l in o={},e)e[l]&&"$"!==l[0]&&(o[l]=Sn(t,n,l,e[l]))}else o={};for(var c in n)c in o||(o[c]=En(n,c));return e&&Object.isExtensible(e)&&(e._normalized=o),zt(o,"$stable",s),zt(o,"$key",a),zt(o,"$hasNormal",i),o}function Sn(t,e,n,r){var o=function(){var e=oe;ie(t);var n=arguments.length?r.apply(null,arguments):r({}),o=(n=n&&"object"==typeof n&&!G(n)?[n]:en(n))&&n[0];return ie(e),n&&(!o||1===n.length&&o.isComment&&!kn(o))?void 0:n};return r.proxy&&Object.defineProperty(e,n,{get:o,enumerable:!0,configurable:!0}),o}function En(t,e){return function(){return t[e]}}function On(t){var e=t.$options,n=e.setup;if(n){var r=t._setupContext=function(t){var e=!1;return{get attrs(){if(!t._attrsProxy){var e=t._attrsProxy={};zt(e,"_v_attr_proxy",!0),Cn(e,t.$attrs,J,t,"$attrs")}return t._attrsProxy},get listeners(){t._listenersProxy||Cn(t._listenersProxy={},t.$listeners,J,t,"$listeners");return t._listenersProxy},get slots(){return function(t){t._slotsProxy||Nn(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(t)},emit:kt(t.$emit,t),expose:function(n){"production"!==process.env.NODE_ENV&&(e&&Fr("expose() should be called only once per setup().",t),e=!0),n&&Object.keys(n).forEach((function(e){return ze(t,n,e)}))}}}(t);ie(t),me();var o=Rn(n,null,[t._props||Te({}),r],t,"setup");if(ge(),ie(),tt(o))e.render=o;else if(et(o))if("production"!==process.env.NODE_ENV&&o instanceof se&&Fr("setup() should not return VNodes directly - return a render function instead."),t._setupState=o,o.__sfc){var i=t._setupProxy={};for(var s in o)"__sfc"!==s&&ze(i,o,s)}else for(var s in o)jt(s)?"production"!==process.env.NODE_ENV&&Fr("Avoid using variables that start with _ or $ in setup()."):ze(t,o,s);else"production"!==process.env.NODE_ENV&&void 0!==o&&Fr("setup() should return an object. Received: ".concat(null===o?"null":typeof o))}}function Cn(t,e,n,r,o){var i=!1;for(var s in e)s in t?e[s]!==n[s]&&(i=!0):(i=!0,An(t,s,r,o));for(var s in t)s in e||(i=!0,delete t[s]);return i}function An(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function Nn(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}var Tn=null;function Mn(t,e){return(t.__esModule||re&&"Module"===t[Symbol.toStringTag])&&(t=t.default),et(t)?e.extend(t):t}function In(t){if(G(t))for(var e=0;e<t.length;e++){var n=t[e];if(X(n)&&(X(n.componentOptions)||kn(n)))return n}}function $n(t,e,n,r,o,i){return(G(n)||Q(n))&&(o=r,r=n,n=void 0),Z(i)&&(o=2),function(t,e,n,r,o){if(X(n)&&X(n.__ob__))return"production"!==process.env.NODE_ENV&&Fr("Avoid using observed data object as vnode data: ".concat(JSON.stringify(n),"\n")+"Always create fresh vnode data objects in each render!",t),ae();X(n)&&X(n.is)&&(e=n.is);if(!e)return ae();"production"!==process.env.NODE_ENV&&X(n)&&X(n.key)&&!Q(n.key)&&Fr("Avoid using non-primitive value as key, use string/number value instead.",t);G(r)&&tt(r[0])&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);2===o?r=en(r):1===o&&(r=function(t){for(var e=0;e<t.length;e++)if(G(t[e]))return Array.prototype.concat.apply([],t);return t}(r));var i,s;if("string"==typeof e){var a=void 0;s=t.$vnode&&t.$vnode.ns||Rt.getTagNamespace(e),Rt.isReservedTag(e)?("production"!==process.env.NODE_ENV&&X(n)&&X(n.nativeOn)&&"component"!==n.tag&&Fr("The .native modifier for v-on is only valid on components but it was used on <".concat(e,">."),t),i=new se(Rt.parsePlatformTagName(e),n,r,void 0,void 0,t)):i=n&&n.pre||!X(a=Qr(t.$options,"components",e))?new se(e,n,r,void 0,void 0,t):Rr(a,n,t,r,e)}else i=Rr(e,n,t,r);return G(i)?i:X(i)?(X(s)&&Dn(i,s),X(n)&&function(t){et(t.style)&&Yn(t.style);et(t.class)&&Yn(t.class)}(n),i):ae()}(t,e,n,r,o)}function Dn(t,e,n){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,n=!0),X(t.children))for(var r=0,o=t.children.length;r<o;r++){var i=t.children[r];X(i.tag)&&(Y(i.ns)||Z(n)&&"svg"!==i.tag)&&Dn(i,e,n)}}function Ln(t,e,n){me();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,t,e,n))return}catch(t){Pn(t,r,"errorCaptured hook")}}Pn(t,e,n)}finally{ge()}}function Rn(t,e,n,r,o){var i;try{(i=n?t.apply(e,n):t.call(e))&&!i._isVue&&at(i)&&!i._handled&&(i.catch((function(t){return Ln(t,r,o+" (Promise/async)")})),i._handled=!0)}catch(t){Ln(t,r,o)}return i}function Pn(t,e,n){if(Rt.errorHandler)try{return Rt.errorHandler.call(null,t,e,n)}catch(e){e!==t&&jn(e,null,"config.errorHandler")}jn(t,e,n)}function jn(t,e,n){if("production"!==process.env.NODE_ENV&&Fr("Error in ".concat(n,': "').concat(t.toString(),'"'),e),!Vt||"undefined"==typeof console)throw t;console.error(t)}var zn,Fn=!1,Hn=[],Vn=!1;function Bn(){Vn=!1;var t=Hn.slice(0);Hn.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&ee(Promise)){var Wn=Promise.resolve();zn=function(){Wn.then(Bn),Jt&&setTimeout(Ot)},Fn=!0}else if(Wt||"undefined"==typeof MutationObserver||!ee(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())zn="undefined"!=typeof setImmediate&&ee(setImmediate)?function(){setImmediate(Bn)}:function(){setTimeout(Bn,0)};else{var Un=1,qn=new MutationObserver(Bn),Kn=document.createTextNode(String(Un));qn.observe(Kn,{characterData:!0}),zn=function(){Un=(Un+1)%2,Kn.data=String(Un)},Fn=!0}function Jn(t,e){var n;if(Hn.push((function(){if(t)try{t.call(e)}catch(t){Ln(t,e,"nextTick")}else n&&n(e)})),Vn||(Vn=!0,zn()),!t&&"undefined"!=typeof Promise)return new Promise((function(t){n=t}))}var Gn=new ne;function Yn(t){return Xn(t,Gn),Gn.clear(),t}function Xn(t,e){var n,r,o=G(t);if(!(!o&&!et(t)||t.__v_skip||Object.isFrozen(t)||t instanceof se)){if(t.__ob__){var i=t.__ob__.dep.id;if(e.has(i))return;e.add(i)}if(o)for(n=t.length;n--;)Xn(t[n],e);else if(Re(t))Xn(t.value,e);else for(n=(r=Object.keys(t)).length;n--;)Xn(t[r[n]],e)}}var Zn,Qn,tr,er=0,nr=function(){function t(t,e,n,r,o){var i,s;i=this,void 0===(s=Ve&&!Ve._vm?Ve:t?t._scope:void 0)&&(s=Ve),s&&s.active&&s.effects.push(i),(this.vm=t)&&o&&(t._watcher=this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before,"production"!==process.env.NODE_ENV&&(this.onTrack=r.onTrack,this.onTrigger=r.onTrigger)):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++er,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ne,this.newDepIds=new ne,this.expression="production"!==process.env.NODE_ENV?e.toString():"",tt(e)?this.getter=e:(this.getter=function(t){if(!Ft.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}(e),this.getter||(this.getter=Ot,"production"!==process.env.NODE_ENV&&Fr('Failed watching path: "'.concat(e,'" ')+"Watcher only accepts simple dot-delimited paths. For full control, use a function instead.",t))),this.value=this.lazy?void 0:this.get()}return t.prototype.get=function(){var t;me(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;Ln(t,e,'getter for watcher "'.concat(this.expression,'"'))}finally{this.deep&&Yn(t),ge(),this.cleanupDeps()}return t},t.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},t.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},t.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Cr(this)},t.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||et(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'.concat(this.expression,'"');Rn(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},t.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},t.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},t.prototype.teardown=function(){if(this.vm&&!this.vm._isBeingDestroyed&&ft(this.vm._scope.effects,this),this.active){for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop()}},t}();if("production"!==process.env.NODE_ENV){var rr=Vt&&window.performance;rr&&rr.mark&&rr.measure&&rr.clearMarks&&rr.clearMeasures&&(Zn=function(t){return rr.mark(t)},Qn=function(t,e,n){rr.measure(t,e,n),rr.clearMarks(e),rr.clearMarks(n)})}function or(t,e){tr.$on(t,e)}function ir(t,e){tr.$off(t,e)}function sr(t,e){var n=tr;return function r(){var o=e.apply(null,arguments);null!==o&&n.$off(t,r)}}function ar(t,e,n){tr=t,Ze(e,n||{},or,ir,sr,t),tr=void 0}var lr=null,cr=!1;function ur(t){var e=lr;return lr=t,function(){lr=e}}function pr(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function dr(t,e){if(e){if(t._directInactive=!1,pr(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)dr(t.$children[n]);hr(t,"activated")}}function fr(t,e){if(!(e&&(t._directInactive=!0,pr(t))||t._inactive)){t._inactive=!0;for(var n=0;n<t.$children.length;n++)fr(t.$children[n]);hr(t,"deactivated")}}function hr(t,e,n,r){void 0===r&&(r=!0),me();var o=oe;r&&ie(t);var i=t.$options[e],s="".concat(e," hook");if(i)for(var a=0,l=i.length;a<l;a++)Rn(i[a],t,n||null,t,s);t._hasHookEvent&&t.$emit("hook:"+e),r&&ie(o),ge()}var mr=[],gr=[],vr={},yr={},_r=!1,br=!1,wr=0;var kr=0,xr=Date.now;if(Vt&&!Wt){var Sr=window.performance;Sr&&"function"==typeof Sr.now&&xr()>document.createEvent("Event").timeStamp&&(xr=function(){return Sr.now()})}var Er=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function Or(){var t,e;for(kr=xr(),br=!0,mr.sort(Er),wr=0;wr<mr.length;wr++)if((t=mr[wr]).before&&t.before(),e=t.id,vr[e]=null,t.run(),"production"!==process.env.NODE_ENV&&null!=vr[e]&&(yr[e]=(yr[e]||0)+1,yr[e]>100)){Fr("You may have an infinite update loop "+(t.user?'in watcher with expression "'.concat(t.expression,'"'):"in a component render function."),t.vm);break}var n=gr.slice(),r=mr.slice();wr=mr.length=gr.length=0,vr={},"production"!==process.env.NODE_ENV&&(yr={}),_r=br=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,dr(t[e],!0)}(n),function(t){var e=t.length;for(;e--;){var n=t[e],r=n.vm;r&&r._watcher===n&&r._isMounted&&!r._isDestroyed&&hr(r,"updated")}}(r),function(){for(var t=0;t<de.length;t++){var e=de[t];e.subs=e.subs.filter((function(t){return t})),e._pending=!1}de.length=0}(),te&&Rt.devtools&&te.emit("flush")}function Cr(t){var e=t.id;if(null==vr[e]&&(t!==fe.target||!t.noRecurse)){if(vr[e]=!0,br){for(var n=mr.length-1;n>wr&&mr[n].id>t.id;)n--;mr.splice(n+1,0,t)}else mr.push(t);if(!_r){if(_r=!0,"production"!==process.env.NODE_ENV&&!Rt.async)return void Or();Jn(Or)}}}function Ar(t){var e=t.$options.provide;if(e){var n=tt(e)?e.call(t):e;if(!et(n))return;for(var r=function(t){var e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}(t),o=re?Reflect.ownKeys(n):Object.keys(n),i=0;i<o.length;i++){var s=o[i];Object.defineProperty(r,s,Object.getOwnPropertyDescriptor(n,s))}}}function Nr(t,e){if(t){for(var n=Object.create(null),r=re?Reflect.ownKeys(t):Object.keys(t),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){var s=t[i].from;if(s in e._provided)n[i]=e._provided[s];else if("default"in t[i]){var a=t[i].default;n[i]=tt(a)?a.call(e):a}else"production"!==process.env.NODE_ENV&&Fr('Injection "'.concat(i,'" not found'),e)}}return n}}function Tr(t,e,n,r,o){var i,s=this,a=o.options;mt(r,"_uid")?(i=Object.create(r))._original=r:(i=r,r=r._original);var l=Z(a._compiled),c=!l;this.data=t,this.props=e,this.children=n,this.parent=r,this.listeners=t.on||J,this.injections=Nr(a.inject,r),this.slots=function(){return s.$slots||xn(r,t.scopedSlots,s.$slots=bn(n,r)),s.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return xn(r,t.scopedSlots,this.slots())}}),l&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=xn(r,t.scopedSlots,this.$slots)),a._scopeId?this._c=function(t,e,n,o){var s=$n(i,t,e,n,o,c);return s&&!G(s)&&(s.fnScopeId=a._scopeId,s.fnContext=r),s}:this._c=function(t,e,n,r){return $n(i,t,e,n,r,c)}}function Mr(t,e,n,r,o){var i=ce(t);return i.fnContext=n,i.fnOptions=r,"production"!==process.env.NODE_ENV&&((i.devtoolsMeta=i.devtoolsMeta||{}).renderContext=o),e.slot&&((i.data||(i.data={})).slot=e.slot),i}function Ir(t,e){for(var n in e)t[yt(n)]=e[n]}function $r(t){return t.name||t.__name||t._componentTag}_n(Tr.prototype);var Dr={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Dr.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;X(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,lr)).$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var n=e.componentOptions;!function(t,e,n,r,o){"production"!==process.env.NODE_ENV&&(cr=!0);var i=r.data.scopedSlots,s=t.$scopedSlots,a=!!(i&&!i.$stable||s!==J&&!s.$stable||i&&t.$scopedSlots.$key!==i.$key||!i&&t.$scopedSlots.$key),l=!!(o||t.$options._renderChildren||a),c=t.$vnode;t.$options._parentVnode=r,t.$vnode=r,t._vnode&&(t._vnode.parent=r),t.$options._renderChildren=o;var u=r.data.attrs||J;t._attrsProxy&&Cn(t._attrsProxy,u,c.data&&c.data.attrs||J,t,"$attrs")&&(l=!0),t.$attrs=u,n=n||J;var p=t.$options._parentListeners;if(t._listenersProxy&&Cn(t._listenersProxy,n,p||J,t,"$listeners"),t.$listeners=t.$options._parentListeners=n,ar(t,n,p),e&&t.$options.props){ke(!1);for(var d=t._props,f=t.$options._propKeys||[],h=0;h<f.length;h++){var m=f[h],g=t.$options.props;d[m]=to(m,g,e,t)}ke(!0),t.$options.propsData=e}l&&(t.$slots=bn(o,r.context),t.$forceUpdate()),"production"!==process.env.NODE_ENV&&(cr=!1)}(e.componentInstance=t.componentInstance,n.propsData,n.listeners,e,n.children)},insert:function(t){var e,n=t.context,r=t.componentInstance;r._isMounted||(r._isMounted=!0,hr(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,gr.push(e)):dr(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?fr(e,!0):e.$destroy())}},Lr=Object.keys(Dr);function Rr(t,e,n,r,o){if(!Y(t)){var i=n.$options._base;if(et(t)&&(t=i.extend(t)),"function"==typeof t){var s;if(Y(t.cid)&&(t=function(t,e){if(Z(t.error)&&X(t.errorComp))return t.errorComp;if(X(t.resolved))return t.resolved;var n=Tn;if(n&&X(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n),Z(t.loading)&&X(t.loadingComp))return t.loadingComp;if(n&&!X(t.owners)){var r=t.owners=[n],o=!0,i=null,s=null;n.$on("hook:destroyed",(function(){return ft(r,n)}));var a=function(t){for(var e=0,n=r.length;e<n;e++)r[e].$forceUpdate();t&&(r.length=0,null!==i&&(clearTimeout(i),i=null),null!==s&&(clearTimeout(s),s=null))},l=Mt((function(n){t.resolved=Mn(n,e),o?r.length=0:a(!0)})),c=Mt((function(e){"production"!==process.env.NODE_ENV&&Fr("Failed to resolve async component: ".concat(String(t))+(e?"\nReason: ".concat(e):"")),X(t.errorComp)&&(t.error=!0,a(!0))})),u=t(l,c);return et(u)&&(at(u)?Y(t.resolved)&&u.then(l,c):at(u.component)&&(u.component.then(l,c),X(u.error)&&(t.errorComp=Mn(u.error,e)),X(u.loading)&&(t.loadingComp=Mn(u.loading,e),0===u.delay?t.loading=!0:i=setTimeout((function(){i=null,Y(t.resolved)&&Y(t.error)&&(t.loading=!0,a(!1))}),u.delay||200)),X(u.timeout)&&(s=setTimeout((function(){s=null,Y(t.resolved)&&c("production"!==process.env.NODE_ENV?"timeout (".concat(u.timeout,"ms)"):null)}),u.timeout)))),o=!1,t.loading?t.loadingComp:t.resolved}}(s=t,i),void 0===t))return function(t,e,n,r,o){var i=ae();return i.asyncFactory=t,i.asyncMeta={data:e,context:n,children:r,tag:o},i}(s,e,n,r,o);e=e||{},Ao(t),X(e.model)&&function(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var o=e.on||(e.on={}),i=o[r],s=e.model.callback;X(i)?(G(i)?-1===i.indexOf(s):i!==s)&&(o[r]=[s].concat(i)):o[r]=s}(t.options,e);var a=function(t,e,n){var r=e.options.props;if(!Y(r)){var o={},i=t.attrs,s=t.props;if(X(i)||X(s))for(var a in r){var l=wt(a);if("production"!==process.env.NODE_ENV){var c=a.toLowerCase();a!==c&&i&&mt(i,c)&&Hr('Prop "'.concat(c,'" is passed to component ')+"".concat(zr(n||e),", but the declared prop name is")+' "'.concat(a,'". ')+"Note that HTML attributes are case-insensitive and camelCased props need to use their kebab-case equivalents when using in-DOM "+'templates. You should probably use "'.concat(l,'" instead of "').concat(a,'".'))}tn(o,s,a,l,!0)||tn(o,i,a,l,!1)}return o}}(e,t,o);if(Z(t.options.functional))return function(t,e,n,r,o){var i=t.options,s={},a=i.props;if(X(a))for(var l in a)s[l]=to(l,a,e||J);else X(n.attrs)&&Ir(s,n.attrs),X(n.props)&&Ir(s,n.props);var c=new Tr(n,s,o,r,t),u=i.render.call(null,c._c,c);if(u instanceof se)return Mr(u,n,c.parent,i,c);if(G(u)){for(var p=en(u)||[],d=new Array(p.length),f=0;f<p.length;f++)d[f]=Mr(p[f],n,c.parent,i,c);return d}}(t,a,e,n,r);var l=e.on;if(e.on=e.nativeOn,Z(t.options.abstract)){var c=e.slot;e={},c&&(e.slot=c)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<Lr.length;n++){var r=Lr[n],o=e[r],i=Dr[r];o===i||o&&o._merged||(e[r]=o?Pr(i,o):i)}}(e);var u=$r(t.options)||o;return new se("vue-component-".concat(t.cid).concat(u?"-".concat(u):""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:a,listeners:l,tag:o,children:r},s)}"production"!==process.env.NODE_ENV&&Fr("Invalid Component definition: ".concat(String(t)),n)}}function Pr(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}var jr,zr,Fr=Ot,Hr=Ot;if("production"!==process.env.NODE_ENV){var Vr="undefined"!=typeof console,Br=/(?:^|[-_])(\w)/g;Fr=function(t,e){void 0===e&&(e=oe);var n=e?jr(e):"";Rt.warnHandler?Rt.warnHandler.call(null,t,e,n):Vr&&!Rt.silent&&console.error("[Vue warn]: ".concat(t).concat(n))},Hr=function(t,e){Vr&&!Rt.silent&&console.warn("[Vue tip]: ".concat(t)+(e?jr(e):""))},zr=function(t,e){if(t.$root===t)return"<Root>";var n=tt(t)&&null!=t.cid?t.options:t._isVue?t.$options||t.constructor.options:t,r=$r(n),o=n.__file;if(!r&&o){var i=o.match(/([^/\\]+)\.vue$/);r=i&&i[1]}return(r?"<".concat(r.replace(Br,(function(t){return t.toUpperCase()})).replace(/[-_]/g,""),">"):"<Anonymous>")+(o&&!1!==e?" at ".concat(o):"")};jr=function(t){if(t._isVue&&t.$parent){for(var e=[],n=0;t;){if(e.length>0){var r=e[e.length-1];if(r.constructor===t.constructor){n++,t=t.$parent;continue}n>0&&(e[e.length-1]=[r,n],n=0)}e.push(t),t=t.$parent}return"\n\nfound in\n\n"+e.map((function(t,e){return"".concat(0===e?"---\x3e ":function(t,e){for(var n="";e;)e%2==1&&(n+=t),e>1&&(t+=t),e>>=1;return n}(" ",5+2*e)).concat(G(t)?"".concat(zr(t[0]),"... (").concat(t[1]," recursive calls)"):zr(t))})).join("\n")}return"\n\n(found in ".concat(zr(t),")")}}var Wr=Rt.optionMergeStrategies;function Ur(t,e,n){if(void 0===n&&(n=!0),!e)return t;for(var r,o,i,s=re?Reflect.ownKeys(e):Object.keys(e),a=0;a<s.length;a++)"__ob__"!==(r=s[a])&&(o=t[r],i=e[r],n&&mt(t,r)?o!==i&&ot(o)&&ot(i)&&Ur(o,i):Ce(t,r,i));return t}function qr(t,e,n){return n?function(){var r=tt(e)?e.call(n,n):e,o=tt(t)?t.call(n,n):t;return r?Ur(r,o):o}:e?t?function(){return Ur(tt(e)?e.call(this,this):e,tt(t)?t.call(this,this):t)}:e:t}function Kr(t,e){var n=e?t?t.concat(e):G(e)?e:[e]:t;return n?function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(n):n}function Jr(t,e,n,r){var o=Object.create(t||null);return e?("production"!==process.env.NODE_ENV&&Xr(r,e,n),St(o,e)):o}"production"!==process.env.NODE_ENV&&(Wr.el=Wr.propsData=function(t,e,n,r){return n||Fr('option "'.concat(r,'" can only be used during instance ')+"creation with the `new` keyword."),Gr(t,e)}),Wr.data=function(t,e,n){return n?qr(t,e,n):e&&"function"!=typeof e?("production"!==process.env.NODE_ENV&&Fr('The "data" option should be a function that returns a per-instance value in component definitions.',n),t):qr(t,e)},Lt.forEach((function(t){Wr[t]=Kr})),Dt.forEach((function(t){Wr[t+"s"]=Jr})),Wr.watch=function(t,e,n,r){if(t===Yt&&(t=void 0),e===Yt&&(e=void 0),!e)return Object.create(t||null);if("production"!==process.env.NODE_ENV&&Xr(r,e,n),!t)return e;var o={};for(var i in St(o,t),e){var s=o[i],a=e[i];s&&!G(s)&&(s=[s]),o[i]=s?s.concat(a):G(a)?a:[a]}return o},Wr.props=Wr.methods=Wr.inject=Wr.computed=function(t,e,n,r){if(e&&"production"!==process.env.NODE_ENV&&Xr(r,e,n),!t)return e;var o=Object.create(null);return St(o,t),e&&St(o,e),o},Wr.provide=function(t,e){return t?function(){var n=Object.create(null);return Ur(n,tt(t)?t.call(this):t),e&&Ur(n,tt(e)?e.call(this):e,!1),n}:e};var Gr=function(t,e){return void 0===e?t:e};function Yr(t){new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(Pt.source,"]*$")).test(t)||Fr('Invalid component name: "'+t+'". Component names should conform to valid custom element name in html5 specification.'),(pt(t)||Rt.isReservedTag(t))&&Fr("Do not use built-in or reserved HTML elements as component id: "+t)}function Xr(t,e,n){ot(e)||Fr('Invalid value for option "'.concat(t,'": expected an Object, ')+"but got ".concat(rt(e),"."),n)}function Zr(t,e,n){if("production"!==process.env.NODE_ENV&&function(t){for(var e in t.components)Yr(e)}(e),tt(e)&&(e=e.options),function(t,e){var n=t.props;if(n){var r,o,i={};if(G(n))for(r=n.length;r--;)"string"==typeof(o=n[r])?i[yt(o)]={type:null}:"production"!==process.env.NODE_ENV&&Fr("props must be strings when using array syntax.");else if(ot(n))for(var s in n)o=n[s],i[yt(s)]=ot(o)?o:{type:o};else"production"!==process.env.NODE_ENV&&Fr('Invalid value for option "props": expected an Array or an Object, '+"but got ".concat(rt(n),"."),e);t.props=i}}(e,n),function(t,e){var n=t.inject;if(n){var r=t.inject={};if(G(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(ot(n))for(var i in n){var s=n[i];r[i]=ot(s)?St({from:i},s):{from:s}}else"production"!==process.env.NODE_ENV&&Fr('Invalid value for option "inject": expected an Array or an Object, '+"but got ".concat(rt(n),"."),e)}}(e,n),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];tt(r)&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=Zr(t,e.extends,n)),e.mixins))for(var r=0,o=e.mixins.length;r<o;r++)t=Zr(t,e.mixins[r],n);var i,s={};for(i in t)a(i);for(i in e)mt(t,i)||a(i);function a(r){var o=Wr[r]||Gr;s[r]=o(t[r],e[r],n,r)}return s}function Qr(t,e,n,r){if("string"==typeof n){var o=t[e];if(mt(o,n))return o[n];var i=yt(n);if(mt(o,i))return o[i];var s=_t(i);if(mt(o,s))return o[s];var a=o[n]||o[i]||o[s];return"production"!==process.env.NODE_ENV&&r&&!a&&Fr("Failed to resolve "+e.slice(0,-1)+": "+n),a}}function to(t,e,n,r){var o=e[t],i=!mt(n,t),s=n[t],a=so(Boolean,o.type);if(a>-1)if(i&&!mt(o,"default"))s=!1;else if(""===s||s===wt(t)){var l=so(String,o.type);(l<0||a<l)&&(s=!0)}if(void 0===s){s=function(t,e,n){if(!mt(e,"default"))return;var r=e.default;"production"!==process.env.NODE_ENV&&et(r)&&Fr('Invalid default value for prop "'+n+'": Props with type Object/Array must use a factory function to return the default value.',t);if(t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n])return t._props[n];return tt(r)&&"Function"!==oo(e.type)?r.call(t):r}(r,o,t);var c=we;ke(!0),Ee(s),ke(c)}return"production"!==process.env.NODE_ENV&&function(t,e,n,r,o){if(t.required&&o)return void Fr('Missing required prop: "'+e+'"',r);if(null==n&&!t.required)return;var i=t.type,s=!i||!0===i,a=[];if(i){G(i)||(i=[i]);for(var l=0;l<i.length&&!s;l++){var c=no(n,i[l],r);a.push(c.expectedType||""),s=c.valid}}var u=a.some((function(t){return t}));if(!s&&u)return void Fr(function(t,e,n){var r='Invalid prop: type check failed for prop "'.concat(t,'".')+" Expected ".concat(n.map(_t).join(", ")),o=n[0],i=rt(e);1===n.length&&uo(o)&&uo(typeof e)&&!function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.some((function(t){return"boolean"===t.toLowerCase()}))}(o,i)&&(r+=" with value ".concat(ao(e,o)));r+=", got ".concat(i," "),uo(i)&&(r+="with value ".concat(ao(e,i),"."));return r}(e,n,a),r);var p=t.validator;p&&(p(n)||Fr('Invalid prop: custom validator check failed for prop "'+e+'".',r))}(o,t,s,r,i),s}var eo=/^(String|Number|Boolean|Function|Symbol|BigInt)$/;function no(t,e,n){var r,o=oo(e);if(eo.test(o)){var i=typeof t;(r=i===o.toLowerCase())||"object"!==i||(r=t instanceof e)}else if("Object"===o)r=ot(t);else if("Array"===o)r=G(t);else try{r=t instanceof e}catch(t){Fr('Invalid prop type: "'+String(e)+'" is not a constructor',n),r=!1}return{valid:r,expectedType:o}}var ro=/^\s*function (\w+)/;function oo(t){var e=t&&t.toString().match(ro);return e?e[1]:""}function io(t,e){return oo(t)===oo(e)}function so(t,e){if(!G(e))return io(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(io(e[n],t))return n;return-1}function ao(t,e){return"String"===e?'"'.concat(t,'"'):"".concat("Number"===e?Number(t):t)}var lo,co=["string","number","boolean"];function uo(t){return co.some((function(e){return t.toLowerCase()===e}))}if("production"!==process.env.NODE_ENV){var po=ut("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,require"),fo=function(t,e){Fr('Property or method "'.concat(e,'" is not defined on the instance but ')+"referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.",t)},ho=function(t,e){Fr('Property "'.concat(e,'" must be accessed with "$data.').concat(e,'" because ')+'properties starting with "$" or "_" are not proxied in the Vue instance to prevent conflicts with Vue internals. See: https://v2.vuejs.org/v2/api/#data',t)},mo="undefined"!=typeof Proxy&&ee(Proxy);if(mo){var go=ut("stop,prevent,self,ctrl,shift,alt,meta,exact");Rt.keyCodes=new Proxy(Rt.keyCodes,{set:function(t,e,n){return go(e)?(Fr("Avoid overwriting built-in modifier in config.keyCodes: .".concat(e)),!1):(t[e]=n,!0)}})}var vo={has:function(t,e){var n=e in t,r=po(e)||"string"==typeof e&&"_"===e.charAt(0)&&!(e in t.$data);return n||r||(e in t.$data?ho(t,e):fo(t,e)),n||!r}},yo={get:function(t,e){return"string"!=typeof e||e in t||(e in t.$data?ho(t,e):fo(t,e)),t[e]}};lo=function(t){if(mo){var e=t.$options,n=e.render&&e.render._withStripped?yo:vo;t._renderProxy=new Proxy(t,n)}else t._renderProxy=t}}var _o={enumerable:!0,configurable:!0,get:Ot,set:Ot};function bo(t,e,n){_o.get=function(){return this[e][n]},_o.set=function(t){this[e][n]=t},Object.defineProperty(t,n,_o)}function wo(t){var e=t.$options;if(e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props=Te({}),o=t.$options._propKeys=[],i=!t.$parent;i||ke(!1);var s=function(s){o.push(s);var a=to(s,e,n,t);if("production"!==process.env.NODE_ENV){var l=wt(s);(dt(l)||Rt.isReservedAttr(l))&&Fr('"'.concat(l,'" is a reserved attribute and cannot be used as component prop.'),t),Oe(r,s,a,(function(){i||cr||Fr("Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's "+'value. Prop being mutated: "'.concat(s,'"'),t)}))}else Oe(r,s,a);s in t||bo(t,"_props",s)};for(var a in e)s(a);ke(!0)}(t,e.props),On(t),e.methods&&function(t,e){var n=t.$options.props;for(var r in e)"production"!==process.env.NODE_ENV&&("function"!=typeof e[r]&&Fr('Method "'.concat(r,'" has type "').concat(typeof e[r],'" in the component definition. ')+"Did you reference the function correctly?",t),n&&mt(n,r)&&Fr('Method "'.concat(r,'" has already been defined as a prop.'),t),r in t&&jt(r)&&Fr('Method "'.concat(r,'" conflicts with an existing Vue instance method. ')+"Avoid defining component methods that start with _ or $.")),t[r]="function"!=typeof e[r]?Ot:kt(e[r],t)}(t,e.methods),e.data)!function(t){var e=t.$options.data;e=t._data=tt(e)?function(t,e){me();try{return t.call(e,e)}catch(t){return Ln(t,e,"data()"),{}}finally{ge()}}(e,t):e||{},ot(e)||(e={},"production"!==process.env.NODE_ENV&&Fr("data functions should return an object:\nhttps://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function",t));var n=Object.keys(e),r=t.$options.props,o=t.$options.methods,i=n.length;for(;i--;){var s=n[i];"production"!==process.env.NODE_ENV&&o&&mt(o,s)&&Fr('Method "'.concat(s,'" has already been defined as a data property.'),t),r&&mt(r,s)?"production"!==process.env.NODE_ENV&&Fr('The data property "'.concat(s,'" is already declared as a prop. ')+"Use prop default value instead.",t):jt(s)||bo(t,"_data",s)}var a=Ee(e);a&&a.vmCount++}(t);else{var n=Ee(t._data={});n&&n.vmCount++}e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=Qt();for(var o in e){var i=e[o],s=tt(i)?i:i.get;"production"!==process.env.NODE_ENV&&null==s&&Fr('Getter is missing for computed property "'.concat(o,'".'),t),r||(n[o]=new nr(t,s||Ot,Ot,ko)),o in t?"production"!==process.env.NODE_ENV&&(o in t.$data?Fr('The computed property "'.concat(o,'" is already defined in data.'),t):t.$options.props&&o in t.$options.props?Fr('The computed property "'.concat(o,'" is already defined as a prop.'),t):t.$options.methods&&o in t.$options.methods&&Fr('The computed property "'.concat(o,'" is already defined as a method.'),t)):xo(t,o,i)}}(t,e.computed),e.watch&&e.watch!==Yt&&function(t,e){for(var n in e){var r=e[n];if(G(r))for(var o=0;o<r.length;o++)Oo(t,n,r[o]);else Oo(t,n,r)}}(t,e.watch)}var ko={lazy:!0};function xo(t,e,n){var r=!Qt();tt(n)?(_o.get=r?So(e):Eo(n),_o.set=Ot):(_o.get=n.get?r&&!1!==n.cache?So(e):Eo(n.get):Ot,_o.set=n.set||Ot),"production"!==process.env.NODE_ENV&&_o.set===Ot&&(_o.set=function(){Fr('Computed property "'.concat(e,'" was assigned to but it has no setter.'),this)}),Object.defineProperty(t,e,_o)}function So(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),fe.target&&("production"!==process.env.NODE_ENV&&fe.target.onTrack&&fe.target.onTrack({effect:fe.target,target:this,type:"get",key:t}),e.depend()),e.value}}function Eo(t){return function(){return t.call(this,this)}}function Oo(t,e,n,r){return ot(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var Co=0;function Ao(t){var e=t.options;if(t.super){var n=Ao(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var o in n)n[o]!==r[o]&&(e||(e={}),e[o]=n[o]);return e}(t);r&&St(t.extendOptions,r),(e=t.options=Zr(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function No(t){"production"===process.env.NODE_ENV||this instanceof No||Fr("Vue is a constructor and should be called with the `new` keyword"),this._init(t)}function To(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=$r(t)||$r(n.options);"production"!==process.env.NODE_ENV&&i&&Yr(i);var s=function(t){this._init(t)};return(s.prototype=Object.create(n.prototype)).constructor=s,s.cid=e++,s.options=Zr(n.options,t),s.super=n,s.options.props&&function(t){var e=t.options.props;for(var n in e)bo(t.prototype,"_props",n)}(s),s.options.computed&&function(t){var e=t.options.computed;for(var n in e)xo(t.prototype,n,e[n])}(s),s.extend=n.extend,s.mixin=n.mixin,s.use=n.use,Dt.forEach((function(t){s[t]=n[t]})),i&&(s.options.components[i]=s),s.superOptions=n.options,s.extendOptions=t,s.sealedOptions=St({},s.options),o[r]=s,s}}function Mo(t){return t&&($r(t.Ctor.options)||t.tag)}function Io(t,e){return G(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!it(t)&&t.test(e)}function $o(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var s=n[i];if(s){var a=s.name;a&&!e(a)&&Do(n,i,r,o)}}}function Do(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,ft(n,e)}!function(t){t.prototype._init=function(t){var e,n,r=this;r._uid=Co++,"production"!==process.env.NODE_ENV&&Rt.performance&&Zn&&(e="vue-perf-start:".concat(r._uid),n="vue-perf-end:".concat(r._uid),Zn(e)),r._isVue=!0,r.__v_skip=!0,r._scope=new Ge(!0),r._scope._vm=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(r,t):r.$options=Zr(Ao(r.constructor),t||{},r),"production"!==process.env.NODE_ENV?lo(r):r._renderProxy=r,r._self=r,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(r),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&ar(t,e)}(r),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,r=n&&n.context;t.$slots=bn(e._renderChildren,r),t.$scopedSlots=n?xn(t.$parent,n.data.scopedSlots,t.$slots):J,t._c=function(e,n,r,o){return $n(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return $n(t,e,n,r,o,!0)};var o=n&&n.data;"production"!==process.env.NODE_ENV?(Oe(t,"$attrs",o&&o.attrs||J,(function(){!cr&&Fr("$attrs is readonly.",t)}),!0),Oe(t,"$listeners",e._parentListeners||J,(function(){!cr&&Fr("$listeners is readonly.",t)}),!0)):(Oe(t,"$attrs",o&&o.attrs||J,null,!0),Oe(t,"$listeners",e._parentListeners||J,null,!0))}(r),hr(r,"beforeCreate",void 0,!1),function(t){var e=Nr(t.$options.inject,t);e&&(ke(!1),Object.keys(e).forEach((function(n){"production"!==process.env.NODE_ENV?Oe(t,n,e[n],(function(){Fr("Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. "+'injection being mutated: "'.concat(n,'"'),t)})):Oe(t,n,e[n])})),ke(!0))}(r),wo(r),Ar(r),hr(r,"created"),"production"!==process.env.NODE_ENV&&Rt.performance&&Zn&&(r._name=zr(r,!1),Zn(n),Qn("vue ".concat(r._name," init"),e,n)),r.$options.el&&r.$mount(r.$options.el)}}(No),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};"production"!==process.env.NODE_ENV&&(e.set=function(){Fr("Avoid replacing instance root $data. Use nested data properties instead.",this)},n.set=function(){Fr("$props is readonly.",this)}),Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Ce,t.prototype.$delete=Ae,t.prototype.$watch=function(t,e,n){var r=this;if(ot(e))return Oo(r,t,e,n);(n=n||{}).user=!0;var o=new nr(r,t,e,n);if(n.immediate){var i='callback for immediate watcher "'.concat(o.expression,'"');me(),Rn(e,r,[o.value],r,i),ge()}return function(){o.teardown()}}}(No),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(G(t))for(var o=0,i=t.length;o<i;o++)r.$on(t[o],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){var n=this;function r(){n.$off(t,r),e.apply(n,arguments)}return r.fn=e,n.$on(t,r),n},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(G(t)){for(var r=0,o=t.length;r<o;r++)n.$off(t[r],e);return n}var i,s=n._events[t];if(!s)return n;if(!e)return n._events[t]=null,n;for(var a=s.length;a--;)if((i=s[a])===e||i.fn===e){s.splice(a,1);break}return n},t.prototype.$emit=function(t){var e=this;if("production"!==process.env.NODE_ENV){var n=t.toLowerCase();n!==t&&e._events[n]&&Hr('Event "'.concat(n,'" is emitted in component ')+"".concat(zr(e),' but the handler is registered for "').concat(t,'". ')+"Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. "+'You should probably use "'.concat(wt(t),'" instead of "').concat(t,'".'))}var r=e._events[t];if(r){r=r.length>1?xt(r):r;for(var o=xt(arguments,1),i='event handler for "'.concat(t,'"'),s=0,a=r.length;s<a;s++)Rn(r[s],e,o,e,i)}return e}}(No),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,o=n._vnode,i=ur(n);n._vnode=t,n.$el=o?n.__patch__(o,t):n.__patch__(n.$el,t,e,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n);for(var s=n;s&&s.$vnode&&s.$parent&&s.$vnode===s.$parent._vnode;)s.$parent.$el=s.$el,s=s.$parent},t.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){hr(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||ft(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),hr(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(No),function(t){_n(t.prototype),t.prototype.$nextTick=function(t){return Jn(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,o=n._parentVnode;o&&e._isMounted&&(e.$scopedSlots=xn(e.$parent,o.data.scopedSlots,e.$slots,e.$scopedSlots),e._slotsProxy&&Nn(e._slotsProxy,e.$scopedSlots)),e.$vnode=o;try{ie(e),Tn=e,t=r.call(e._renderProxy,e.$createElement)}catch(n){if(Ln(n,e,"render"),"production"!==process.env.NODE_ENV&&e.$options.renderError)try{t=e.$options.renderError.call(e._renderProxy,e.$createElement,n)}catch(n){Ln(n,e,"renderError"),t=e._vnode}else t=e._vnode}finally{Tn=null,ie()}return G(t)&&1===t.length&&(t=t[0]),t instanceof se||("production"!==process.env.NODE_ENV&&G(t)&&Fr("Multiple root nodes returned from render function. Render function should return a single root node.",e),t=ae()),t.parent=o,t}}(No);var Lo=[String,RegExp,Array],Ro={name:"keep-alive",abstract:!0,props:{include:Lo,exclude:Lo,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,r=t.vnodeToCache,o=t.keyToCache;if(r){var i=r.tag,s=r.componentInstance,a=r.componentOptions;e[o]={name:Mo(a),tag:i,componentInstance:s},n.push(o),this.max&&n.length>parseInt(this.max)&&Do(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Do(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){$o(t,(function(t){return Io(e,t)}))})),this.$watch("exclude",(function(e){$o(t,(function(t){return!Io(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=In(t),n=e&&e.componentOptions;if(n){var r=Mo(n),o=this.include,i=this.exclude;if(o&&(!r||!Io(o,r))||i&&r&&Io(i,r))return e;var s=this.cache,a=this.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;s[l]?(e.componentInstance=s[l].componentInstance,ft(a,l),a.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}},Po={KeepAlive:Ro};!function(t){var e={get:function(){return Rt}};"production"!==process.env.NODE_ENV&&(e.set=function(){Fr("Do not replace the Vue.config object, set individual fields instead.")}),Object.defineProperty(t,"config",e),t.util={warn:Fr,extend:St,mergeOptions:Zr,defineReactive:Oe},t.set=Ce,t.delete=Ae,t.nextTick=Jn,t.observable=function(t){return Ee(t),t},t.options=Object.create(null),Dt.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,St(t.options.components,Po),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=xt(arguments,1);return n.unshift(this),tt(t.install)?t.install.apply(t,n):tt(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Zr(this.options,t),this}}(t),To(t),function(t){Dt.forEach((function(e){t[e]=function(t,n){return n?("production"!==process.env.NODE_ENV&&"component"===e&&Yr(t),"component"===e&&ot(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&tt(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(No),Object.defineProperty(No.prototype,"$isServer",{get:Qt}),Object.defineProperty(No.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(No,"FunctionalRenderContext",{value:Tr}),No.version="2.7.14";var jo=ut("style,class"),zo=ut("input,textarea,option,select,progress"),Fo=ut("contenteditable,draggable,spellcheck"),Ho=ut("events,caret,typing,plaintext-only"),Vo=ut("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Bo="http://www.w3.org/1999/xlink",Wo=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Uo=function(t){return Wo(t)?t.slice(6,t.length):""},qo=function(t){return null==t||!1===t};function Ko(t){for(var e=t.data,n=t,r=t;X(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Jo(r.data,e));for(;X(n=n.parent);)n&&n.data&&(e=Jo(e,n.data));return function(t,e){if(X(t)||X(e))return Go(t,Yo(e));return""}(e.staticClass,e.class)}function Jo(t,e){return{staticClass:Go(t.staticClass,e.staticClass),class:X(t.class)?[t.class,e.class]:e.class}}function Go(t,e){return t?e?t+" "+e:t:e||""}function Yo(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r<o;r++)X(e=Yo(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):et(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var Xo={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Zo=ut("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Qo=ut("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),ti=function(t){return Zo(t)||Qo(t)};var ei=Object.create(null);var ni=ut("text,number,password,search,email,tel,url");var ri=Object.freeze({__proto__:null,createElement:function(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(t,e){return document.createElementNS(Xo[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setStyleScope:function(t,e){t.setAttribute(e,"")}}),oi={create:function(t,e){ii(e)},update:function(t,e){t.data.ref!==e.data.ref&&(ii(t,!0),ii(e))},destroy:function(t){ii(t,!0)}};function ii(t,e){var n=t.data.ref;if(X(n)){var r=t.context,o=t.componentInstance||t.elm,i=e?null:o,s=e?void 0:o;if(tt(n))Rn(n,r,[i],r,"template ref function");else{var a=t.data.refInFor,l="string"==typeof n||"number"==typeof n,c=Re(n),u=r.$refs;if(l||c)if(a){var p=l?u[n]:n.value;e?G(p)&&ft(p,o):G(p)?p.includes(o)||p.push(o):l?(u[n]=[o],si(r,n,u[n])):n.value=[o]}else if(l){if(e&&u[n]!==o)return;u[n]=s,si(r,n,i)}else if(c){if(e&&n.value!==o)return;n.value=i}else"production"!==process.env.NODE_ENV&&Fr("Invalid template ref type: ".concat(typeof n))}}}function si(t,e,n){var r=t._setupState;r&&mt(r,e)&&(Re(r[e])?r[e].value=n:r[e]=n)}var ai=new se("",{},[]),li=["create","activate","update","remove","destroy"];function ci(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&X(t.data)===X(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=X(n=t.data)&&X(n=n.attrs)&&n.type,o=X(n=e.data)&&X(n=n.attrs)&&n.type;return r===o||ni(r)&&ni(o)}(t,e)||Z(t.isAsyncPlaceholder)&&Y(e.asyncFactory.error))}function ui(t,e,n){var r,o,i={};for(r=e;r<=n;++r)X(o=t[r].key)&&(i[o]=r);return i}var pi={create:di,update:di,destroy:function(t){di(t,ai)}};function di(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,o,i=t===ai,s=e===ai,a=hi(t.data.directives,t.context),l=hi(e.data.directives,e.context),c=[],u=[];for(n in l)r=a[n],o=l[n],r?(o.oldValue=r.value,o.oldArg=r.arg,gi(o,"update",e,t),o.def&&o.def.componentUpdated&&u.push(o)):(gi(o,"bind",e,t),o.def&&o.def.inserted&&c.push(o));if(c.length){var p=function(){for(var n=0;n<c.length;n++)gi(c[n],"inserted",e,t)};i?Qe(e,"insert",p):p()}u.length&&Qe(e,"postpatch",(function(){for(var n=0;n<u.length;n++)gi(u[n],"componentUpdated",e,t)}));if(!i)for(n in a)l[n]||gi(a[n],"unbind",t,t,s)}(t,e)}var fi=Object.create(null);function hi(t,e){var n,r,o=Object.create(null);if(!t)return o;for(n=0;n<t.length;n++){if((r=t[n]).modifiers||(r.modifiers=fi),o[mi(r)]=r,e._setupState&&e._setupState.__sfc){var i=r.def||Qr(e,"_setupState","v-"+r.name);r.def="function"==typeof i?{bind:i,update:i}:i}r.def=r.def||Qr(e.$options,"directives",r.name,!0)}return o}function mi(t){return t.rawName||"".concat(t.name,".").concat(Object.keys(t.modifiers||{}).join("."))}function gi(t,e,n,r,o){var i=t.def&&t.def[e];if(i)try{i(n.elm,t,n,r,o)}catch(r){Ln(r,n.context,"directive ".concat(t.name," ").concat(e," hook"))}}var vi=[oi,pi];function yi(t,e){var n=e.componentOptions;if(!(X(n)&&!1===n.Ctor.options.inheritAttrs||Y(t.data.attrs)&&Y(e.data.attrs))){var r,o,i=e.elm,s=t.data.attrs||{},a=e.data.attrs||{};for(r in(X(a.__ob__)||Z(a._v_attr_proxy))&&(a=e.data.attrs=St({},a)),a)o=a[r],s[r]!==o&&_i(i,r,o,e.data.pre);for(r in(Wt||qt)&&a.value!==s.value&&_i(i,"value",a.value),s)Y(a[r])&&(Wo(r)?i.removeAttributeNS(Bo,Uo(r)):Fo(r)||i.removeAttribute(r))}}function _i(t,e,n,r){r||t.tagName.indexOf("-")>-1?bi(t,e,n):Vo(e)?qo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Fo(e)?t.setAttribute(e,function(t,e){return qo(e)||"false"===e?"false":"contenteditable"===t&&Ho(e)?e:"true"}(e,n)):Wo(e)?qo(n)?t.removeAttributeNS(Bo,Uo(e)):t.setAttributeNS(Bo,e,n):bi(t,e,n)}function bi(t,e,n){if(qo(n))t.removeAttribute(e);else{if(Wt&&!Ut&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var wi={create:yi,update:yi};function ki(t,e){var n=e.elm,r=e.data,o=t.data;if(!(Y(r.staticClass)&&Y(r.class)&&(Y(o)||Y(o.staticClass)&&Y(o.class)))){var i=Ko(e),s=n._transitionClasses;X(s)&&(i=Go(i,Yo(s))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var xi,Si={create:ki,update:ki},Ei="__r",Oi="__c";function Ci(t,e,n){var r=xi;return function o(){var i=e.apply(null,arguments);null!==i&&Ti(t,o,n,r)}}var Ai=Fn&&!(Gt&&Number(Gt[1])<=53);function Ni(t,e,n,r){if(Ai){var o=kr,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}xi.addEventListener(t,e,Xt?{capture:n,passive:r}:n)}function Ti(t,e,n,r){(r||xi).removeEventListener(t,e._wrapper||e,n)}function Mi(t,e){if(!Y(t.data.on)||!Y(e.data.on)){var n=e.data.on||{},r=t.data.on||{};xi=e.elm||t.elm,function(t){if(X(t[Ei])){var e=Wt?"change":"input";t[e]=[].concat(t[Ei],t[e]||[]),delete t[Ei]}X(t[Oi])&&(t.change=[].concat(t[Oi],t.change||[]),delete t[Oi])}(n),Ze(n,r,Ni,Ti,Ci,e.context),xi=void 0}}var Ii,$i={create:Mi,update:Mi,destroy:function(t){return Mi(t,ai)}};function Di(t,e){if(!Y(t.data.domProps)||!Y(e.data.domProps)){var n,r,o=e.elm,i=t.data.domProps||{},s=e.data.domProps||{};for(n in(X(s.__ob__)||Z(s._v_attr_proxy))&&(s=e.data.domProps=St({},s)),i)n in s||(o[n]="");for(n in s){if(r=s[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===i[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){o._value=r;var a=Y(r)?"":String(r);Li(o,a)&&(o.value=a)}else if("innerHTML"===n&&Qo(o.tagName)&&Y(o.innerHTML)){(Ii=Ii||document.createElement("div")).innerHTML="<svg>".concat(r,"</svg>");for(var l=Ii.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}else if(r!==i[n])try{o[n]=r}catch(t){}}}}function Li(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(X(r)){if(r.number)return ct(n)!==ct(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Ri={create:Di,update:Di},Pi=gt((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function ji(t){var e=zi(t.style);return t.staticStyle?St(t.staticStyle,e):e}function zi(t){return Array.isArray(t)?Et(t):"string"==typeof t?Pi(t):t}var Fi,Hi=/^--/,Vi=/\s*!important$/,Bi=function(t,e,n){if(Hi.test(e))t.style.setProperty(e,n);else if(Vi.test(n))t.style.setProperty(wt(e),n.replace(Vi,""),"important");else{var r=Ui(e);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)t.style[r]=n[o];else t.style[r]=n}},Wi=["Webkit","Moz","ms"],Ui=gt((function(t){if(Fi=Fi||document.createElement("div").style,"filter"!==(t=yt(t))&&t in Fi)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Wi.length;n++){var r=Wi[n]+e;if(r in Fi)return r}}));function qi(t,e){var n=e.data,r=t.data;if(!(Y(n.staticStyle)&&Y(n.style)&&Y(r.staticStyle)&&Y(r.style))){var o,i,s=e.elm,a=r.staticStyle,l=r.normalizedStyle||r.style||{},c=a||l,u=zi(e.data.style)||{};e.data.normalizedStyle=X(u.__ob__)?St({},u):u;var p=function(t,e){var n,r={};if(e)for(var o=t;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=ji(o.data))&&St(r,n);(n=ji(t.data))&&St(r,n);for(var i=t;i=i.parent;)i.data&&(n=ji(i.data))&&St(r,n);return r}(e,!0);for(i in c)Y(p[i])&&Bi(s,i,"");for(i in p)(o=p[i])!==c[i]&&Bi(s,i,null==o?"":o)}}var Ki={create:qi,update:qi},Ji=/\s+/;function Gi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ji).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Yi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ji).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Xi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&St(e,Zi(t.name||"v")),St(e,t),e}return"string"==typeof t?Zi(t):void 0}}var Zi=gt((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),Qi=Vt&&!Ut,ts="transition",es="animation",ns="transition",rs="transitionend",is="animation",ss="animationend";Qi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ns="WebkitTransition",rs="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(is="WebkitAnimation",ss="webkitAnimationEnd"));var as=Vt?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function ls(t){as((function(){as(t)}))}function cs(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Gi(t,e))}function us(t,e){t._transitionClasses&&ft(t._transitionClasses,e),Yi(t,e)}function ps(t,e,n){var r=fs(t,e),o=r.type,i=r.timeout,s=r.propCount;if(!o)return n();var a=o===ts?rs:ss,l=0,c=function(){t.removeEventListener(a,u),n()},u=function(e){e.target===t&&++l>=s&&c()};setTimeout((function(){l<s&&c()}),i+1),t.addEventListener(a,u)}var ds=/\b(transform|all)(,|$)/;function fs(t,e){var n,r=window.getComputedStyle(t),o=(r[ns+"Delay"]||"").split(", "),i=(r[ns+"Duration"]||"").split(", "),s=hs(o,i),a=(r[is+"Delay"]||"").split(", "),l=(r[is+"Duration"]||"").split(", "),c=hs(a,l),u=0,p=0;return e===ts?s>0&&(n=ts,u=s,p=i.length):e===es?c>0&&(n=es,u=c,p=l.length):p=(n=(u=Math.max(s,c))>0?s>c?ts:es:null)?n===ts?i.length:l.length:0,{type:n,timeout:u,propCount:p,hasTransform:n===ts&&ds.test(r[ns+"Property"])}}function hs(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return ms(e)+ms(t[n])})))}function ms(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function gs(t,e){var n=t.elm;X(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=Xi(t.data.transition);if(!Y(r)&&!X(n._enterCb)&&1===n.nodeType){for(var o=r.css,i=r.type,s=r.enterClass,a=r.enterToClass,l=r.enterActiveClass,c=r.appearClass,u=r.appearToClass,p=r.appearActiveClass,d=r.beforeEnter,f=r.enter,h=r.afterEnter,m=r.enterCancelled,g=r.beforeAppear,v=r.appear,y=r.afterAppear,_=r.appearCancelled,b=r.duration,w=lr,k=lr.$vnode;k&&k.parent;)w=k.context,k=k.parent;var x=!w._isMounted||!t.isRootInsert;if(!x||v||""===v){var S=x&&c?c:s,E=x&&p?p:l,O=x&&u?u:a,C=x&&g||d,A=x&&tt(v)?v:f,N=x&&y||h,T=x&&_||m,M=ct(et(b)?b.enter:b);"production"!==process.env.NODE_ENV&&null!=M&&ys(M,"enter",t);var I=!1!==o&&!Ut,$=bs(A),D=n._enterCb=Mt((function(){I&&(us(n,O),us(n,E)),D.cancelled?(I&&us(n,S),T&&T(n)):N&&N(n),n._enterCb=null}));t.data.show||Qe(t,"insert",(function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),A&&A(n,D)})),C&&C(n),I&&(cs(n,S),cs(n,E),ls((function(){us(n,S),D.cancelled||(cs(n,O),$||(_s(M)?setTimeout(D,M):ps(n,i,D)))}))),t.data.show&&(e&&e(),A&&A(n,D)),I||$||D()}}}function vs(t,e){var n=t.elm;X(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=Xi(t.data.transition);if(Y(r)||1!==n.nodeType)return e();if(!X(n._leaveCb)){var o=r.css,i=r.type,s=r.leaveClass,a=r.leaveToClass,l=r.leaveActiveClass,c=r.beforeLeave,u=r.leave,p=r.afterLeave,d=r.leaveCancelled,f=r.delayLeave,h=r.duration,m=!1!==o&&!Ut,g=bs(u),v=ct(et(h)?h.leave:h);"production"!==process.env.NODE_ENV&&X(v)&&ys(v,"leave",t);var y=n._leaveCb=Mt((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),m&&(us(n,a),us(n,l)),y.cancelled?(m&&us(n,s),d&&d(n)):(e(),p&&p(n)),n._leaveCb=null}));f?f(_):_()}function _(){y.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),c&&c(n),m&&(cs(n,s),cs(n,l),ls((function(){us(n,s),y.cancelled||(cs(n,a),g||(_s(v)?setTimeout(y,v):ps(n,i,y)))}))),u&&u(n,y),m||g||y())}}function ys(t,e,n){"number"!=typeof t?Fr("<transition> explicit ".concat(e," duration is not a valid number - ")+"got ".concat(JSON.stringify(t),"."),n.context):isNaN(t)&&Fr("<transition> explicit ".concat(e," duration is NaN - ")+"the duration expression might be incorrect.",n.context)}function _s(t){return"number"==typeof t&&!isNaN(t)}function bs(t){if(Y(t))return!1;var e=t.fns;return X(e)?bs(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function ws(t,e){!0!==e.data.show&&gs(e)}var ks=function(t){var e,n,r={},o=t.modules,i=t.nodeOps;for(e=0;e<li.length;++e)for(r[li[e]]=[],n=0;n<o.length;++n)X(o[n][li[e]])&&r[li[e]].push(o[n][li[e]]);function s(t){var e=i.parentNode(t);X(e)&&i.removeChild(e,t)}function a(t,e){return!e&&!t.ns&&!(Rt.ignoredElements.length&&Rt.ignoredElements.some((function(e){return it(e)?e.test(t.tag):e===t.tag})))&&Rt.isUnknownElement(t.tag)}var l=0;function c(t,e,n,o,s,c,f){if(X(t.elm)&&X(c)&&(t=c[f]=ce(t)),t.isRootInsert=!s,!function(t,e,n,o){var i=t.data;if(X(i)){var s=X(t.componentInstance)&&i.keepAlive;if(X(i=i.hook)&&X(i=i.init)&&i(t,!1),X(t.componentInstance))return u(t,e),p(n,t.elm,o),Z(s)&&function(t,e,n,o){var i,s=t;for(;s.componentInstance;)if(X(i=(s=s.componentInstance._vnode).data)&&X(i=i.transition)){for(i=0;i<r.activate.length;++i)r.activate[i](ai,s);e.push(s);break}p(n,t.elm,o)}(t,e,n,o),!0}}(t,e,n,o)){var g=t.data,v=t.children,y=t.tag;X(y)?("production"!==process.env.NODE_ENV&&(g&&g.pre&&l++,a(t,l)&&Fr("Unknown custom element: <"+y+'> - did you register the component correctly? For recursive components, make sure to provide the "name" option.',t.context)),t.elm=t.ns?i.createElementNS(t.ns,y):i.createElement(y,t),m(t),d(t,v,e),X(g)&&h(t,e),p(n,t.elm,o),"production"!==process.env.NODE_ENV&&g&&g.pre&&l--):Z(t.isComment)?(t.elm=i.createComment(t.text),p(n,t.elm,o)):(t.elm=i.createTextNode(t.text),p(n,t.elm,o))}}function u(t,e){X(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,f(t)?(h(t,e),m(t)):(ii(t),e.push(t))}function p(t,e,n){X(t)&&(X(n)?i.parentNode(n)===t&&i.insertBefore(t,e,n):i.appendChild(t,e))}function d(t,e,n){if(G(e)){"production"!==process.env.NODE_ENV&&b(e);for(var r=0;r<e.length;++r)c(e[r],n,t.elm,null,!0,e,r)}else Q(t.text)&&i.appendChild(t.elm,i.createTextNode(String(t.text)))}function f(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return X(t.tag)}function h(t,n){for(var o=0;o<r.create.length;++o)r.create[o](ai,t);X(e=t.data.hook)&&(X(e.create)&&e.create(ai,t),X(e.insert)&&n.push(t))}function m(t){var e;if(X(e=t.fnScopeId))i.setStyleScope(t.elm,e);else for(var n=t;n;)X(e=n.context)&&X(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e),n=n.parent;X(e=lr)&&e!==t.context&&e!==t.fnContext&&X(e=e.$options._scopeId)&&i.setStyleScope(t.elm,e)}function g(t,e,n,r,o,i){for(;r<=o;++r)c(n[r],i,t,e,!1,n,r)}function v(t){var e,n,o=t.data;if(X(o))for(X(e=o.hook)&&X(e=e.destroy)&&e(t),e=0;e<r.destroy.length;++e)r.destroy[e](t);if(X(e=t.children))for(n=0;n<t.children.length;++n)v(t.children[n])}function y(t,e,n){for(;e<=n;++e){var r=t[e];X(r)&&(X(r.tag)?(_(r),v(r)):s(r.elm))}}function _(t,e){if(X(e)||X(t.data)){var n,o=r.remove.length+1;for(X(e)?e.listeners+=o:e=function(t,e){function n(){0==--n.listeners&&s(t)}return n.listeners=e,n}(t.elm,o),X(n=t.componentInstance)&&X(n=n._vnode)&&X(n.data)&&_(n,e),n=0;n<r.remove.length;++n)r.remove[n](t,e);X(n=t.data.hook)&&X(n=n.remove)?n(t,e):e()}else s(t.elm)}function b(t){for(var e={},n=0;n<t.length;n++){var r=t[n],o=r.key;X(o)&&(e[o]?Fr("Duplicate keys detected: '".concat(o,"'. This may cause an update error."),r.context):e[o]=!0)}}function w(t,e,n,r){for(var o=n;o<r;o++){var i=e[o];if(X(i)&&ci(t,i))return o}}function k(t,e,n,o,s,a){if(t!==e){X(e.elm)&&X(o)&&(e=o[s]=ce(e));var l=e.elm=t.elm;if(Z(t.isAsyncPlaceholder))X(e.asyncFactory.resolved)?O(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(Z(e.isStatic)&&Z(t.isStatic)&&e.key===t.key&&(Z(e.isCloned)||Z(e.isOnce)))e.componentInstance=t.componentInstance;else{var u,p=e.data;X(p)&&X(u=p.hook)&&X(u=u.prepatch)&&u(t,e);var d=t.children,h=e.children;if(X(p)&&f(e)){for(u=0;u<r.update.length;++u)r.update[u](t,e);X(u=p.hook)&&X(u=u.update)&&u(t,e)}Y(e.text)?X(d)&&X(h)?d!==h&&function(t,e,n,r,o){var s,a,l,u=0,p=0,d=e.length-1,f=e[0],h=e[d],m=n.length-1,v=n[0],_=n[m],x=!o;for("production"!==process.env.NODE_ENV&&b(n);u<=d&&p<=m;)Y(f)?f=e[++u]:Y(h)?h=e[--d]:ci(f,v)?(k(f,v,r,n,p),f=e[++u],v=n[++p]):ci(h,_)?(k(h,_,r,n,m),h=e[--d],_=n[--m]):ci(f,_)?(k(f,_,r,n,m),x&&i.insertBefore(t,f.elm,i.nextSibling(h.elm)),f=e[++u],_=n[--m]):ci(h,v)?(k(h,v,r,n,p),x&&i.insertBefore(t,h.elm,f.elm),h=e[--d],v=n[++p]):(Y(s)&&(s=ui(e,u,d)),Y(a=X(v.key)?s[v.key]:w(v,e,u,d))?c(v,r,t,f.elm,!1,n,p):ci(l=e[a],v)?(k(l,v,r,n,p),e[a]=void 0,x&&i.insertBefore(t,l.elm,f.elm)):c(v,r,t,f.elm,!1,n,p),v=n[++p]);u>d?g(t,Y(n[m+1])?null:n[m+1].elm,n,p,m,r):p>m&&y(e,u,d)}(l,d,h,n,a):X(h)?("production"!==process.env.NODE_ENV&&b(h),X(t.text)&&i.setTextContent(l,""),g(l,null,h,0,h.length-1,n)):X(d)?y(d,0,d.length-1):X(t.text)&&i.setTextContent(l,""):t.text!==e.text&&i.setTextContent(l,e.text),X(p)&&X(u=p.hook)&&X(u=u.postpatch)&&u(t,e)}}}function x(t,e,n){if(Z(n)&&X(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var S=!1,E=ut("attrs,class,staticClass,staticStyle,key");function O(t,e,n,r){var o,i=e.tag,s=e.data,l=e.children;if(r=r||s&&s.pre,e.elm=t,Z(e.isComment)&&X(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if("production"!==process.env.NODE_ENV&&!function(t,e,n){return X(e.tag)?0===e.tag.indexOf("vue-component")||!a(e,n)&&e.tag.toLowerCase()===(t.tagName&&t.tagName.toLowerCase()):t.nodeType===(e.isComment?8:3)}(t,e,r))return!1;if(X(s)&&(X(o=s.hook)&&X(o=o.init)&&o(e,!0),X(o=e.componentInstance)))return u(e,n),!0;if(X(i)){if(X(l))if(t.hasChildNodes())if(X(o=s)&&X(o=o.domProps)&&X(o=o.innerHTML)){if(o!==t.innerHTML)return"production"===process.env.NODE_ENV||"undefined"==typeof console||S||(S=!0,console.warn("Parent: ",t),console.warn("server innerHTML: ",o),console.warn("client innerHTML: ",t.innerHTML)),!1}else{for(var c=!0,p=t.firstChild,f=0;f<l.length;f++){if(!p||!O(p,l[f],n,r)){c=!1;break}p=p.nextSibling}if(!c||p)return"production"===process.env.NODE_ENV||"undefined"==typeof console||S||(S=!0,console.warn("Parent: ",t),console.warn("Mismatching childNodes vs. VNodes: ",t.childNodes,l)),!1}else d(e,l,n);if(X(s)){var m=!1;for(var g in s)if(!E(g)){m=!0,h(e,n);break}!m&&s.class&&Yn(s.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,o){if(!Y(e)){var s,a=!1,l=[];if(Y(t))a=!0,c(e,l);else{var u=X(t.nodeType);if(!u&&ci(t,e))k(t,e,l,null,null,o);else{if(u){if(1===t.nodeType&&t.hasAttribute($t)&&(t.removeAttribute($t),n=!0),Z(n)){if(O(t,e,l))return x(e,l,!0),t;"production"!==process.env.NODE_ENV&&Fr("The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.")}s=t,t=new se(i.tagName(s).toLowerCase(),{},[],void 0,s)}var p=t.elm,d=i.parentNode(p);if(c(e,l,p._leaveCb?null:d,i.nextSibling(p)),X(e.parent))for(var h=e.parent,m=f(e);h;){for(var g=0;g<r.destroy.length;++g)r.destroy[g](h);if(h.elm=e.elm,m){for(var _=0;_<r.create.length;++_)r.create[_](ai,h);var b=h.data.hook.insert;if(b.merged)for(var w=1;w<b.fns.length;w++)b.fns[w]()}else ii(h);h=h.parent}X(d)?y([t],0,0):X(t.tag)&&v(t)}}return x(e,l,a),e.elm}X(t)&&v(t)}}({nodeOps:ri,modules:[wi,Si,$i,Ri,Ki,Vt?{create:ws,activate:ws,remove:function(t,e){!0!==t.data.show?vs(t,e):e()}}:{}].concat(vi)});Ut&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&Ts(t,"input")}));var xs={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Qe(n,"postpatch",(function(){xs.componentUpdated(t,e,n)})):Ss(t,e,n.context),t._vOptions=[].map.call(t.options,Cs)):("textarea"===n.tag||ni(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",As),t.addEventListener("compositionend",Ns),t.addEventListener("change",Ns),Ut&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Ss(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,Cs);if(o.some((function(t,e){return!Nt(t,r[e])})))(t.multiple?e.value.some((function(t){return Os(t,o)})):e.value!==e.oldValue&&Os(e.value,o))&&Ts(t,"change")}}};function Ss(t,e,n){Es(t,e,n),(Wt||qt)&&setTimeout((function(){Es(t,e,n)}),0)}function Es(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var i,s,a=0,l=t.options.length;a<l;a++)if(s=t.options[a],o)i=Tt(r,Cs(s))>-1,s.selected!==i&&(s.selected=i);else if(Nt(Cs(s),r))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}else"production"!==process.env.NODE_ENV&&Fr('<select multiple v-model="'.concat(e.expression,'"> ')+"expects an Array value for its binding, but got ".concat(Object.prototype.toString.call(r).slice(8,-1)),n)}function Os(t,e){return e.every((function(e){return!Nt(e,t)}))}function Cs(t){return"_value"in t?t._value:t.value}function As(t){t.target.composing=!0}function Ns(t){t.target.composing&&(t.target.composing=!1,Ts(t.target,"input"))}function Ts(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ms(t){return!t.componentInstance||t.data&&t.data.transition?t:Ms(t.componentInstance._vnode)}var Is={bind:function(t,e,n){var r=e.value,o=(n=Ms(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,gs(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Ms(n)).data&&n.data.transition?(n.data.show=!0,r?gs(n,(function(){t.style.display=t.__vOriginalDisplay})):vs(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}},$s={model:xs,show:Is},Ds={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Ls(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Ls(In(e.children)):t}function Rs(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[yt(r)]=o[r];return e}function Ps(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var js=function(t){return t.tag||kn(t)},zs=function(t){return"show"===t.name},Fs={name:"transition",props:Ds,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(js)).length){"production"!==process.env.NODE_ENV&&n.length>1&&Fr("<transition> can only be used on a single element. Use <transition-group> for lists.",this.$parent);var r=this.mode;"production"!==process.env.NODE_ENV&&r&&"in-out"!==r&&"out-in"!==r&&Fr("invalid <transition> mode: "+r,this.$parent);var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=Ls(o);if(!i)return o;if(this._leaving)return Ps(t,o);var s="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?s+"comment":s+i.tag:Q(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var a=(i.data||(i.data={})).transition=Rs(this),l=this._vnode,c=Ls(l);if(i.data.directives&&i.data.directives.some(zs)&&(i.data.show=!0),c&&c.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,c)&&!kn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var u=c.data.transition=St({},a);if("out-in"===r)return this._leaving=!0,Qe(u,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Ps(t,o);if("in-out"===r){if(kn(i))return l;var p,d=function(){p()};Qe(a,"afterEnter",d),Qe(a,"enterCancelled",d),Qe(u,"delayLeave",(function(t){p=t}))}}return o}}},Hs=St({tag:String,moveClass:String},Ds);delete Hs.mode;var Vs={props:Hs,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=ur(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],s=Rs(this),a=0;a<o.length;a++){if((d=o[a]).tag)if(null!=d.key&&0!==String(d.key).indexOf("__vlist"))i.push(d),n[d.key]=d,(d.data||(d.data={})).transition=s;else if("production"!==process.env.NODE_ENV){var l=d.componentOptions,c=l?$r(l.Ctor.options)||l.tag||"":d.tag;Fr("<transition-group> children must be keyed: <".concat(c,">"))}}if(r){var u=[],p=[];for(a=0;a<r.length;a++){var d;(d=r[a]).data.transition=s,d.data.pos=d.elm.getBoundingClientRect(),n[d.key]?u.push(d):p.push(d)}this.kept=t(e,null,u),this.removed=p}return t(e,null,i)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Bs),t.forEach(Ws),t.forEach(Us),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;cs(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(rs,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(rs,t),n._moveCb=null,us(n,e))})}})))},methods:{hasMove:function(t,e){if(!Qi)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){Yi(n,t)})),Gi(n,e),n.style.display="none",this.$el.appendChild(n);var r=fs(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}};function Bs(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Ws(t){t.data.newPos=t.elm.getBoundingClientRect()}function Us(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate(".concat(r,"px,").concat(o,"px)"),i.transitionDuration="0s"}}var qs={Transition:Fs,TransitionGroup:Vs};function Ks(t){this.content=t}function Js(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let t=0;o.text[t]==i.text[t];t++)n++;return n}if(o.content.size||i.content.size){let t=Js(o.content,i.content,n+1);if(null!=t)return t}n+=o.nodeSize}else n+=o.nodeSize}}function Gs(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let t=0,e=Math.min(s.text.length,a.text.length);for(;t<e&&s.text[s.text.length-t-1]==a.text[a.text.length-t-1];)t++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let t=Gs(s.content,a.content,n-1,r-1);if(t)return t}n-=l,r-=l}else n-=l,r-=l}}No.config.mustUseProp=function(t,e,n){return"value"===n&&zo(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},No.config.isReservedTag=ti,No.config.isReservedAttr=jo,No.config.getTagNamespace=function(t){return Qo(t)?"svg":"math"===t?"math":void 0},No.config.isUnknownElement=function(t){if(!Vt)return!0;if(ti(t))return!1;if(t=t.toLowerCase(),null!=ei[t])return ei[t];var e=document.createElement(t);return t.indexOf("-")>-1?ei[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ei[t]=/HTMLUnknownElement/.test(e.toString())},St(No.options.directives,$s),St(No.options.components,qs),No.prototype.__patch__=Vt?ks:Ot,No.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=ae,"production"!==process.env.NODE_ENV&&(t.$options.template&&"#"!==t.$options.template.charAt(0)||t.$options.el||e?Fr("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.",t):Fr("Failed to mount component: template or render function not defined.",t))),hr(t,"beforeMount"),r="production"!==process.env.NODE_ENV&&Rt.performance&&Zn?function(){var e=t._name,r=t._uid,o="vue-perf-start:".concat(r),i="vue-perf-end:".concat(r);Zn(o);var s=t._render();Zn(i),Qn("vue ".concat(e," render"),o,i),Zn(o),t._update(s,n),Zn(i),Qn("vue ".concat(e," patch"),o,i)}:function(){t._update(t._render(),n)};var o={before:function(){t._isMounted&&!t._isDestroyed&&hr(t,"beforeUpdate")}};"production"!==process.env.NODE_ENV&&(o.onTrack=function(e){return hr(t,"renderTracked",[e])},o.onTrigger=function(e){return hr(t,"renderTriggered",[e])}),new nr(t,r,Ot,o,!0),n=!1;var i=t._preWatchers;if(i)for(var s=0;s<i.length;s++)i[s].run();return null==t.$vnode&&(t._isMounted=!0,hr(t,"mounted")),t}(this,t=t&&Vt?function(t){if("string"==typeof t){return document.querySelector(t)||("production"!==process.env.NODE_ENV&&Fr("Cannot find element: "+t),document.createElement("div"))}return t}(t):void 0,e)},Vt&&setTimeout((function(){Rt.devtools&&(te?te.emit("init",No):"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&console[console.info?"info":"log"]("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&!1!==Rt.productionTip&&"undefined"!=typeof console&&console[console.info?"info":"log"]("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html")}),0),Ks.prototype={constructor:Ks,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return-1==o?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Ks(i)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new Ks(n)},addToStart:function(t,e){return new Ks([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ks(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(-1==i?o.length:i,0,e,n),new Ks(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Ks.from(t)).size?new Ks(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Ks.from(t)).size?new Ks(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ks.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},Ks.from=function(t){if(t instanceof Ks)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ks(e)};class Ys{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,o){for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),n,r+o)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf?(r?o+="function"==typeof r?r(s):r:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new Ys(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let o=0,i=0;i<e;o++){let s=this.content[o],a=i+s.nodeSize;a>t&&((i<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new Ys(n,r)}cutByIndex(t,e){return t==e?Ys.empty:0==t&&e==this.content.length?this:new Ys(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new Ys(r,o)}addToStart(t){return new Ys([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Ys(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return Js(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return Gs(this,t,e,n)}findIndex(t,e=-1){if(0==t)return Zs(0,t);if(t==this.size)return Zs(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?Zs(n+1,o):Zs(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((t=>t.toJSON())):null}static fromJSON(t,e){if(!e)return Ys.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ys(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Ys.empty;let e,n=0;for(let r=0;r<t.length;r++){let o=t[r];n+=o.nodeSize,r&&o.isText&&t[r-1].sameMarkup(o)?(e||(e=t.slice(0,r)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new Ys(e||t,n)}static from(t){if(!t)return Ys.empty;if(t instanceof Ys)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Ys([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ys.empty=new Ys([],0);const Xs={index:0,offset:0};function Zs(t,e){return Xs.index=t,Xs.offset=e,Xs}function Qs(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Qs(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Qs(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ta=class t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Qs(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];let n=e.slice();return n.sort(((t,e)=>t.type.rank-e.type.rank)),n}};ta.none=[];class ea extends Error{}class na{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=oa(this.content,t+this.openStart,e);return n&&new na(n,this.openStart,this.openEnd)}removeBetween(t,e){return new na(ra(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return na.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new na(Ys.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new na(t,n,r)}}function ra(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(ra(i.content,e-o-1,n-o-1)))}function oa(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=oa(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function ia(t,e,n){if(n.openStart>t.depth)throw new ea("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ea("Inconsistent open depths");return sa(t,e,n,0)}function sa(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=sa(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:o,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(Ys.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return pa(i,da(t,o,s,e,r))}{let r=t.parent,o=r.content;return pa(r,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}}return pa(i,fa(t,e,r))}function aa(t,e){if(!e.type.compatibleContent(t.type))throw new ea("Cannot join "+e.type.name+" onto "+t.type.name)}function la(t,e,n){let r=t.node(n);return aa(r,e.node(n)),r}function ca(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ua(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ca(t.nodeAfter,r),i++));for(let t=i;t<s;t++)ca(o.child(t),r);e&&e.depth==n&&e.textOffset&&ca(e.nodeBefore,r)}function pa(t,e){return t.type.checkContent(e),t.copy(e)}function da(t,e,n,r,o){let i=t.depth>o&&la(t,e,o+1),s=r.depth>o&&la(n,r,o+1),a=[];return ua(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(aa(i,s),ca(pa(i,da(t,e,n,r,o+1)),a)):(i&&ca(pa(i,fa(t,e,o+1)),a),ua(e,n,o,a),s&&ca(pa(s,fa(n,r,o+1)),a)),ua(r,null,o,a),new Ys(a)}function fa(t,e,n){let r=[];if(ua(null,t,n,r),t.depth>n){ca(pa(la(t,e,n+1),fa(t,e,n+1)),r)}return ua(e,null,n,r),new Ys(r)}na.empty=new na(Ys.empty,0,0);class ha{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return ta.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var 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}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new ya(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(n.push(e,t,r+i),!s)break;if(e=e.child(t),e.isText)break;o=s-1,r+=i+1}return new ha(e,n,o)}static resolveCached(t,e){for(let n=0;n<ma.length;n++){let r=ma[n];if(r.pos==e&&r.doc==t)return r}let n=ma[ga]=ha.resolve(t,e);return ga=(ga+1)%va,n}}let ma=[],ga=0,va=12;class ya{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const _a=Object.create(null);let ba=class t{constructor(t,e,n,r=ta.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||Ys.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&Qs(this.attrs,e||t.defaultAttrs||_a)&&ta.sameSet(this.marks,n||ta.none)}copy(e=null){return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return na.empty;let r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new na(a,r.depth-i,o.depth-i)}replace(t,e,n){return ia(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return ha.resolveCached(this,t)}resolveNoCache(t){return ha.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,(t=>(n.isInSet(t.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ka(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=Ys.empty,r=0,o=n.childCount){let i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=ta.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!ta.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((t=>t.type.name))}`);this.content.forEach((t=>t.check()))}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=Ys.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}};ba.prototype.text=void 0;class wa extends ba{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ka(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new wa(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new wa(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function ka(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class xa{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new Sa(t,e);if(null==n.next)return xa.empty;let r=Ea(n);n.next&&n.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return n(Ma(t,0));function n(r){let o=[];r.forEach((e=>{t[e].forEach((({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);Ma(t,n).forEach((t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)}))}))}));let i=e[r.join(",")]=new xa(r.indexOf(t.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(Ta);i.next.push({type:o[t][0],next:e[r.join(",")]||n(r)})}return i}}(function(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((t=>t.to=e))}function i(t,e){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(i(n,e))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(e,s),o(i(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){let s=e;for(let e=0;e<t.min;e++){let e=n();o(i(t.expr,s),e),s=e}if(-1==t.max)o(i(t.expr,s),s);else for(let e=t.min;e<t.max;e++){let e=n();r(s,e),o(i(t.expr,s),e),s=e}return[r(s)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(t.exprs[r],e);if(r==t.exprs.length-1)return s;o(s,e=n())}}}(r));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],o=!t.validEnd,i=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(t,n);if(a&&(!e||a.validEnd))return Ys.from(s.map((t=>t.createAndFill())));for(let t=0;t<i.next.length;t++){let{type:e,next:n}=i.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=o(n,s.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<o.next.length;t++){let{type:i,next:s}=o.next[t];i.isLeaf||i.hasRequiredAttrs()||i.name in e||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),e[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r})).join("\n")}}xa.empty=new xa(!0);class Sa{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function Ea(t){let e=[];do{e.push(Oa(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Oa(t){let e=[];do{e.push(Ca(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Ca(t){let e=function(t){if(t.eat("(")){let e=Ea(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&o.push(r)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Na(t,e)}return e}function Aa(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Na(t,e){let n=Aa(t),r=n;return t.eat(",")&&(r="}"!=t.next?Aa(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Ta(t,e){return e-t}function Ma(t,e){let n=[];return function e(r){let o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(let t=0;t<o.length;t++){let{term:r,to:i}=o[t];r||-1!=n.indexOf(i)||e(i)}}(e),n.sort(Ta)}function Ia(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function $a(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(void 0===o){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=e.default}n[r]=o}return n}function Da(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Ra(t[n]);return e}let La=class t{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Da(n.attrs),this.defaultAttrs=Ia(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xa.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:$a(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ba(this,this.computeAttrs(t),Ys.from(e),ta.setFrom(n))}createChecked(t=null,e,n){return e=Ys.from(e),this.checkContent(e),new ba(this,this.computeAttrs(t),e,ta.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=Ys.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(Ys.empty,!0);return o?new ba(this,t,e.append(o),ta.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:ta.none:t}static compile(e,n){let r=Object.create(null);e.forEach(((e,o)=>r[e]=new t(e,n,o)));let 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(let t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Ra{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Pa{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Da(r.attrs),this.excluded=null;let o=Ia(this.attrs);this.instance=o?new ta(this,o):null}create(t=null){return!t&&this.instance?this.instance:new ta(this,$a(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach(((t,o)=>n[t]=new Pa(t,r++,e,o))),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class ja{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=Ks.from(t.nodes),e.marks=Ks.from(t.marks||{}),this.nodes=La.compile(this.spec.nodes,this),this.marks=Pa.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",o=e.spec.marks;e.contentMatch=n[r]||(n[r]=xa.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==o?null:o?za(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:za(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof La))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new wa(n,n.defaultAttrs,t,ta.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return ba.fromJSON(this,t)}markFromJSON(t){return ta.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function za(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let e in t.marks){let r=t.marks[e];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}let Fa=class t{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}parse(t,e={}){let n=new qa(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new qa(this,e,!0);return n.addAll(t,e.from,e.to),na.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Ka(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(t)||r.context&&!n.matchesContext(r.context)||i.length>t.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach((t=>{n(t=Ja(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach((t=>{n(t=Ja(t)),t.node||t.ignore||t.mark||(t.node=e)}))}return e}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}};const Ha={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},Va={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ba={ol:!0,ul:!0};function Wa(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class Ua{constructor(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=ta.none,this.stashMarks=[],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(Ys.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=Ys.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(Ys.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):Ga(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Ha.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class qa{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r,o=e.topNode,i=Wa(null,e.preserveWhitespace,0)|(n?4:0);r=o?new Ua(o.type,o.attrs,ta.none,ta.none,!0,e.topMatch||o.type.contentMatch,i):new Ua(n?null:t.schema.topNodeType,null,ta.none,ta.none,!0,null,i),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let e=t.getAttribute("style");if(e){let n=this.readStyles(function(t){let e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e));if(!n)return;let[r,o]=n,i=this.top;for(let t=0;t<o.length;t++)this.removePendingMark(o[t],i);for(let t=0;t<r.length;t++)this.addPendingMark(r[t]);this.addElement(t);for(let t=0;t<r.length;t++)this.removePendingMark(r[t],i);for(let t=0;t<o.length;t++)this.addPendingMark(o[t])}else this.addElement(t)}}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],o=t.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n,r=t.nodeName.toLowerCase();Ba.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&Ba.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:Va.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let e,n=this.top,i=this.needsBlock;if(Ha.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),e=!0,n.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),e&&this.sync(n),this.needsBlock=i}else this.addElementByRule(t,o,!1===o.consuming?n:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=ta.none,n=ta.none;t:for(let r=0;r<t.length;r+=2)for(let o;;){let i=this.parser.matchStyle(t[r],t[r+1],this,o);if(!i)continue t;if(i.ignore)return null;if(i.clearMark?this.top.pendingMarks.forEach((t=>{i.clearMark(t)&&(n=t.addToSet(n))})):e=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(e),!1!==i.consuming)break;o=i}return[e,n]}addElementByRule(t,e,n){let r,o,i;if(e.node)o=this.parser.schema.nodes[e.node],o.isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):r=this.enter(o,e.attrs||null,e.preserveWhitespace);else{i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i)}let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,n){let r=e||0;for(let o=e?t.childNodes[e]:t.firstChild,i=null==n?null:t.childNodes[n];o!=i;o=o.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(o);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)e.type&&!e.type.allowsMarkType(t.marks[r].type)||(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let i=Wa(t,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new Ua(t,e,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function Ka(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ja(t){let e={};for(let n in t)e[n]=t[n];return e}function Ga(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=t=>{i.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:o}=t.edge(n);if(r==e)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Ya{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Za(e).createDocumentFragment());let r=n,o=[];return t.forEach((t=>{if(o.length||t.marks.length){let n=0,i=0;for(;n<o.length&&i<t.marks.length;){let e=t.marks[i];if(this.marks[e.type.name]){if(!e.eq(o[n][0])||!1===e.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<t.marks.length;){let n=t.marks[i++],s=this.serializeMark(n,t.isInline,e);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))})),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Ya.renderSpec(Za(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Ya.renderSpec(Za(n),r(t,e))}static renderSpec(t,e,n=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let r,o=e[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s=n?t.createElementNS(n,o):t.createElement(o),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let o=l;o<e.length;o++){let i=e[o];if(0===i){if(o<e.length-1||o>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=Ya.renderSpec(t,i,n);if(s.appendChild(e),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ya(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Xa(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Xa(t.marks)}}function Xa(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Za(t){return t.document||window.document}const Qa=Math.pow(2,16);function tl(t,e){return t+e*Qa}function el(t){return 65535&t}class nl{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class rl{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&rl.empty)return rl.empty}recover(t){let e=0,n=el(t);if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/Qa}(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(t<=u){let o=a+r+((l?t==a?-1:t==u?1:e:e)<0?0:c);if(n)return o;let i=t==(e<0?a:u)?null:tl(s/3,t-a),p=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(p|=8),new nl(o,p,i)}r+=c-l}return n?t+r:new nl(t+r,0,null)}touches(t,e){let n=0,r=el(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+o];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+i]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),o+=c-l}}invert(){return new rl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?rl.empty:new rl(t<0?[0,-t,0]:[0,0,t])}}rl.empty=new rl([]);class ol{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new ol(this.maps,this.mirror,t,e)}copy(){return new ol(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new ol;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this.maps[n].mapResult(t,e);if(null!=o.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new nl(t,r,null)}}const il=Object.create(null);class sl{getMap(){return rl.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=il[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in il)throw new RangeError("Duplicate use of step JSON ID "+t);return il[t]=e,e.prototype.jsonID=t,e}}class al{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new al(t,null)}static fail(t){return new al(null,t)}static fromReplace(t,e,n,r){try{return al.ok(t.replace(e,n,r))}catch(t){if(t instanceof ea)return al.fail(t.message);throw t}}}function ll(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(ll(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return Ys.fromArray(r)}class cl extends sl{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new na(ll(e.content,((t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),r),e.openStart,e.openEnd);return al.fromReplace(t,this.from,this.to,o)}invert(){return new ul(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new cl(e.pos,n.pos,this.mark)}merge(t){return t instanceof cl&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new cl(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new cl(e.from,e.to,t.markFromJSON(e.mark))}}sl.jsonID("addMark",cl);class ul extends sl{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new na(ll(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return al.fromReplace(t,this.from,this.to,n)}invert(){return new cl(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new ul(e.pos,n.pos,this.mark)}merge(t){return t instanceof ul&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ul(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ul(e.from,e.to,t.markFromJSON(e.mark))}}sl.jsonID("removeMark",ul);class pl extends sl{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return al.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return al.fromReplace(t,this.pos,this.pos+1,new na(Ys.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new pl(this.pos,e.marks[n]);return new pl(this.pos,this.mark)}}return new dl(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new pl(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new pl(e.pos,t.markFromJSON(e.mark))}}sl.jsonID("addNodeMark",pl);class dl extends sl{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return al.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return al.fromReplace(t,this.pos,this.pos+1,new na(Ys.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new pl(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new dl(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new dl(e.pos,t.markFromJSON(e.mark))}}sl.jsonID("removeNodeMark",dl);class fl extends sl{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&ml(t,this.from,this.to)?al.fail("Structure replace would overwrite content"):al.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new rl([this.from,this.to-this.from,this.slice.size])}invert(t){return new fl(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new fl(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof fl)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?na.empty:new na(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new fl(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?na.empty:new na(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new fl(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new fl(e.from,e.to,na.fromJSON(t,e.slice),!!e.structure)}}sl.jsonID("replace",fl);class hl extends sl{constructor(t,e,n,r,o,i,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(t){if(this.structure&&(ml(t,this.from,this.gapFrom)||ml(t,this.gapTo,this.to)))return al.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return al.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?al.fromReplace(t,this.from,this.to,n):al.fail("Content does not fit in gap")}getMap(){return new rl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new hl(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||o>n.pos?null:new hl(e.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new hl(e.from,e.to,e.gapFrom,e.gapTo,na.fromJSON(t,e.slice),e.insert,!!e.structure)}}function ml(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let t=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function gl(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function vl(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(0==n||r.type.spec.isolating||!gl(r,o,i))break}return null}function yl(t,e,n=null,r=t){let o=function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}(t,e),i=o&&function(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<o;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return i?o.map(_l).concat({type:e,attrs:n}).concat(i.map(_l)):null}function _l(t){return{type:t,attrs:null}}function bl(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let t=o.depth-1,e=n-2;t>i;t--,e--){let n=o.node(t),i=o.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[e]||n;if(a!=n&&(s=s.replaceChild(0,a.type.create(a.attrs))),!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function wl(t,e){let n=t.resolve(e),r=n.index();return kl(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function kl(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function xl(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let o,i,s=r.index(t);if(t==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(t+1),s++,i=r.node(t).maybeChild(s)):(o=r.node(t).maybeChild(s-1),i=r.node(t+1)),o&&!o.isTextblock&&kl(o,i)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function Sl(t,e,n=e,r=na.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return El(o,i,r)?new fl(e,n,r):new Ol(o,i,r).fit()}function El(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}sl.jsonID("replaceAround",hl);class Ol{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=Ys.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=Ys.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new na(o,i,s);return t>-1?new hl(n.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||n.pos!=this.$to.pos?new fl(n.pos,r.pos,a):null}findFittable(){for(let t=1;t<=2;t++)for(let e=this.unplaced.openStart;e>=0;e--){let n,r=null;e?(r=Nl(this.unplaced.content,e-1).firstChild,n=r.content):n=this.unplaced.content;let o=n.firstChild;for(let n=this.depth;n>=0;n--){let i,{type:s,match:a}=this.frontier[n],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(Ys.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:e,frontierDepth:n,parent:r,inject:l};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:n,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Nl(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new na(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=Nl(t,e);if(r.childCount<=1&&e>0){let o=t.size-e<=e+r.size;this.unplaced=new na(Cl(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new na(Cl(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-t,l=0,c=[],{match:u,type:p}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)c.push(r.child(t));u=u.matchFragment(r)}let d=s.size+t-(i.content.size-i.openEnd);for(;l<s.childCount;){let t=s.child(l),e=u.matchType(t.type);if(!e)break;l++,(l>1||0==a||t.content.size)&&(u=e,c.push(Tl(t.mark(p.allowedMarks(t.marks)),1==l?a:0,l==s.childCount?d:-1)))}let f=l==s.childCount;f||(d=-1),this.placed=Al(this.placed,e,Ys.from(c)),this.frontier[e].match=u,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t<d;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=f?0==t?na.empty:new na(Cl(i.content,t-1,1),t-1,d<0?i.openEnd:t-1):new na(Cl(i.content,t,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Ml(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),i=Ml(t,e,r,n,o);if(i){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],o=Ml(t,n,r,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Al(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Al(this.placed,this.depth,Ys.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Ys.empty,!0);t.childCount&&(this.placed=Al(this.placed,this.frontier.length,t))}}function Cl(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Cl(t.firstChild.content,e-1,n)))}function Al(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Al(t.lastChild.content,e-1,n)))}function Nl(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Tl(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Tl(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Ys.empty,!0)))),t.copy(r)}function Ml(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function Il(t){return t.spec.defining||t.spec.definingForContent}function $l(t,e,n,r,o){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy($l(o.content,e+1,n,r,o)))}if(e>r){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(Ys.empty,!0))}return t}function Dl(t,e){let n=[];for(let r=Math.min(t.depth,e.depth);r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class Ll extends sl{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return al.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return al.fromReplace(t,this.pos,this.pos+1,new na(Ys.from(r),0,e.isLeaf?0:1))}getMap(){return rl.empty}invert(t){return new Ll(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Ll(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ll(e.pos,e.attr,e.value)}}sl.jsonID("attr",Ll);let Rl=class extends Error{};Rl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Rl.prototype=Object.create(Error.prototype)).constructor=Rl,Rl.prototype.name="TransformError";class Pl{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ol}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Rl(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=na.empty){let r=Sl(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new na(Ys.from(n),0,0))}delete(t,e){return this.replace(t,e,na.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(El(o,i,r))return t.step(new fl(e,n,r));let s=Dl(o,t.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let l=s.indexOf(a),c=[],u=r.openStart;for(let t=r.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==r.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){let e=c[t].type,n=Il(e);if(n&&o.node(l).type!=e)u=t;else if(n||!e.isTextblock)break}for(let e=r.openStart;e>=0;e--){let a=(e+u+1)%(r.openStart+1),p=c[a];if(p)for(let e=0;e<s.length;e++){let c=s[(e+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let d=o.node(c-1),f=o.index(c-1);if(d.canReplaceWith(f,f,p.type,p.marks))return t.replace(o.before(c),u?i.after(c):n,new na($l(r.content,0,r.openStart,a),a,r.openEnd))}}let p=t.steps.length;for(let a=s.length-1;a>=0&&(t.replace(e,n,r),!(t.steps.length>p));a--){let t=s[a];t<0||(e=o.before(t),n=i.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)return null}return null}(t.doc,e,r.type);null!=o&&(e=n=o)}t.replaceRange(e,n,new na(Ys.from(r),0,0))}(this,t,e,n),this}deleteRange(t,e){return function(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Dl(r,o);for(let e=0;e<i.length;e++){let n=i[e],s=e==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return t.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i)return t.delete(r.before(i),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return function(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=Ys.empty,p=0;for(let t=i,e=!1;t>n;t--)e||r.index(t)>0?(e=!0,u=Ys.from(r.node(t).copy(u)),p++):l--;let d=Ys.empty,f=0;for(let t=i,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,d=Ys.from(o.node(t).copy(d)),f++):c++;t.step(new hl(l,c,s,a,new na(u.append(d),p,f),u.size-p,!0))}(this,t,e),this}join(t,e=1){return function(t,e,n){let r=new fl(e-n,e+n,na.empty,!0);t.step(r)}(this,t,e),this}wrap(t,e){return function(t,e,n){let r=Ys.empty;for(let t=n.length-1;t>=0;t--){if(r.size){let e=n[t].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ys.from(n[t].type.create(n[t].attrs,r))}let o=e.start,i=e.end;t.step(new hl(o,i,o,i,new na(r,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,r=null){return function(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,((e,n)=>{if(e.isTextblock&&!e.hasMarkup(r,o)&&function(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(i).map(n),r)){t.clearIncompatible(t.mapping.slice(i).map(n,1),r);let s=t.mapping.slice(i),a=s.map(n,1),l=s.map(n+e.nodeSize,1);return t.step(new hl(a,l,a+1,l-1,new na(Ys.from(r.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r=[]){return function(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new hl(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new na(Ys.from(s),0,0),1,!0))}(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new Ll(t,e,n)),this}addNodeMark(t,e){return this.step(new pl(t,e)),this}removeNodeMark(t,e){if(!(e instanceof ta)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new dl(t,e)),this}split(t,e=1,n){return function(t,e,n=1,r){let o=t.doc.resolve(e),i=Ys.empty,s=Ys.empty;for(let t=o.depth,e=o.depth-n,a=n-1;t>e;t--,a--){i=Ys.from(o.node(t).copy(i));let e=r&&r[a];s=Ys.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new fl(e,e,new na(i.append(s),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){return function(t,e,n,r){let o,i,s=[],a=[];t.doc.nodesBetween(e,n,((t,l,c)=>{if(!t.isInline)return;let u=t.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),p=Math.min(l+t.nodeSize,n),d=r.addToSet(u);for(let t=0;t<u.length;t++)u[t].isInSet(d)||(o&&o.to==c&&o.mark.eq(u[t])?o.to=p:s.push(o=new ul(c,p,u[t])));i&&i.to==c?i.to=p:a.push(i=new cl(c,p,r))}})),s.forEach((e=>t.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,n),this}removeMark(t,e,n){return function(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(r instanceof Pa){let e,n=t.marks;for(;e=r.isInSet(n);)(a||(a=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(a=[r]):a=t.marks;if(a&&a.length){let r=Math.min(s+t.nodeSize,n);for(let t=0;t<a.length;t++){let n,l=a[t];for(let t=0;t<o.length;t++){let e=o[t];e.step==i-1&&l.eq(o[t].style)&&(n=e)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,e),to:r,step:i})}}})),o.forEach((e=>t.step(new ul(e.from,e.to,e.style))))}(this,t,e,n),this}clearIncompatible(t,e,n){return function(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let e=0;e<o.childCount;e++){let a=o.child(e),l=s+a.nodeSize,c=r.matchType(a.type);if(c){r=c;for(let e=0;e<a.marks.length;e++)n.allowsMarkType(a.marks[e].type)||t.step(new ul(s,l,a.marks[e]))}else i.push(new fl(s,l,na.empty));s=l}if(!r.validEnd){let e=r.fillBefore(Ys.empty,!0);t.replace(s,s,new na(e,0,0))}for(let e=i.length-1;e>=0;e--)t.step(i[e])}(this,t,e,n),this}}const jl=Object.create(null);class zl{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new Fl(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=na.empty){let n=e.content.lastChild,r=null;for(let t=0;t<e.openEnd;t++)r=n,n=n.lastChild;let o=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=t.mapping.slice(o);t.replaceRange(c.map(a.pos),c.map(l.pos),s?na.empty:e),0==s&&Yl(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=t.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),Yl(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new Bl(t):Gl(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let o=e<0?Gl(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):Gl(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Kl(t.node(0))}static atStart(t){return Gl(t,t,0,0,1)||new Kl(t)}static atEnd(t){return Gl(t,t,t.content.size,t.childCount,-1)||new Kl(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=jl[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in jl)throw new RangeError("Duplicate use of selection JSON ID "+t);return jl[t]=e,e.prototype.jsonID=t,e}getBookmark(){return Bl.between(this.$anchor,this.$head).getBookmark()}}zl.prototype.visible=!0;class Fl{constructor(t,e){this.$from=t,this.$to=e}}let Hl=!1;function Vl(t){Hl||t.parent.inlineContent||(Hl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Bl extends zl{constructor(t,e=t){Vl(t),Vl(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return zl.near(n);let r=t.resolve(e.map(this.anchor));return new Bl(r.parent.inlineContent?r:n,n)}replace(t,e=na.empty){if(super.replace(t,e),e==na.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof Bl&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Wl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Bl(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=zl.findFrom(e,n,!0)||zl.findFrom(e,-n,!0);if(!t)return zl.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r||(t=(zl.findFrom(t,-n,!0)||zl.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0)&&(t=e),new Bl(t,e)}}zl.jsonID("text",Bl);class Wl{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Wl(t.map(this.anchor),t.map(this.head))}resolve(t){return Bl.between(t.resolve(this.anchor),t.resolve(this.head))}}class Ul extends zl{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),o=t.resolve(r);return n?zl.near(o):new Ul(o)}content(){return new na(Ys.from(this.node),0,0)}eq(t){return t instanceof Ul&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ql(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ul(t.resolve(e.anchor))}static create(t,e){return new Ul(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Ul.prototype.visible=!1,zl.jsonID("node",Ul);class ql{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new Wl(n,n):new ql(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Ul.isSelectable(n)?new Ul(e):zl.near(e)}}class Kl extends zl{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=na.empty){if(e==na.empty){t.delete(0,t.doc.content.size);let e=zl.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new Kl(t)}map(t){return new Kl(t)}eq(t){return t instanceof Kl}getBookmark(){return Jl}}zl.jsonID("all",Kl);const Jl={map(){return this},resolve:t=>new Kl(t)};function Gl(t,e,n,r,o,i=!1){if(e.inlineContent)return Bl.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let r=e.child(s);if(r.isAtom){if(!i&&Ul.isSelectable(r))return Ul.create(t,n-(o<0?r.nodeSize:0))}else{let e=Gl(t,r,n+o,o<0?r.childCount:0,o,i);if(e)return e}n+=r.nodeSize*o}return null}function Yl(t,e,n){let r=t.steps.length-1;if(r<e)return;let o,i=t.steps[r];(i instanceof fl||i instanceof hl)&&(t.mapping.maps[r].forEach(((t,e,n,r)=>{null==o&&(o=r)})),t.setSelection(zl.near(t.doc.resolve(o),n)))}function Xl(t,e){return e&&t?t.bind(e):t}class Zl{constructor(t,e,n){this.name=t,this.init=Xl(e.init,n),this.apply=Xl(e.apply,n)}}function Ql(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=Ql(o,e,{})),n[r]=o}return n}new Zl("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Zl("selection",{init:(t,e)=>t.selection||zl.atStart(e.doc),apply:t=>t.selection}),new Zl("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new Zl("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class tc{constructor(t){this.spec=t,this.props={},t.props&&Ql(t.props,this,this.props),this.key=t.key?t.key.key:nc("plugin")}getState(t){return t[this.key]}}const ec=Object.create(null);function nc(t){return t in ec?t+"$"+ ++ec[t]:(ec[t]=0,t+"$")}class rc{constructor(t="key"){this.key=nc(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const oc=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},ic=function(t,e,n,r){return n&&(ac(t,e,n,r,-1)||ac(t,e,n,r,1))},sc=/^(img|br|input|textarea|hr)$/i;function ac(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:lc(t))){let n=t.parentNode;if(!n||1!=n.nodeType||cc(t)||sc.test(t.nodeName)||"false"==t.contentEditable)return!1;e=oc(t)+(o<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?lc(t):0}}}function lc(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function cc(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const uc=function(t){return t.focusNode&&ic(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function pc(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const dc="undefined"!=typeof navigator?navigator:null,fc="undefined"!=typeof document?document:null,hc=dc&&dc.userAgent||"",mc=/Edge\/(\d+)/.exec(hc),gc=/MSIE \d/.exec(hc),vc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hc),yc=!!(gc||vc||mc),_c=gc?document.documentMode:vc?+vc[1]:mc?+mc[1]:0,bc=!yc&&/gecko\/(\d+)/i.test(hc);bc&&(/Firefox\/(\d+)/.exec(hc)||[0,0])[1];const wc=!yc&&/Chrome\/(\d+)/.exec(hc),kc=!!wc,xc=wc?+wc[1]:0,Sc=!yc&&!!dc&&/Apple Computer/.test(dc.vendor),Ec=Sc&&(/Mobile\/\w+/.test(hc)||!!dc&&dc.maxTouchPoints>2),Oc=Ec||!!dc&&/Mac/.test(dc.platform),Cc=/Android \d/.test(hc),Ac=!!fc&&"webkitFontSmoothing"in fc.documentElement.style,Nc=Ac?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Tc(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(uc(n)){for(a=c;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&Ul.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,n){for(let r=0==e,o=e==lc(t);r||o;){if(t==n)return!0;let e=oc(t);if(!(t=t.parentNode))return!1;r=r&&0==e,o=o&&e==lc(t)}}(n.focusNode,n.focusOffset,o.dom))){let t=o.posBefore;l=new Ul(s==t?c:r.resolve(t))}}else{let e=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(e<0)return null;a=r.resolve(e)}if(!l){l=jc(t,a,c,"pointer"==e||t.state.selection.head<c.pos&&!i?1:-1)}return l}function Mc(t){return t.editable?t.hasFocus():function(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ic(t,e=!1){let n=t.state.selection;if(function(t,e){if(e instanceof Ul){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Pc(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Pc(t)}(t,n),Mc(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&kc){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&ic(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setEnd(r.parentNode,oc(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&yc&&_c<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{let r,o,{anchor:i,head:s}=n;!$c||n instanceof Bl||(n.$from.parent.inlineContent||(r=Dc(t,n.from)),n.empty||n.$from.parent.inlineContent||(o=Dc(t,n.to))),t.docView.setSelection(i,s,t.root,e),$c&&(r&&Rc(r),o&&Rc(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Mc(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const $c=Sc||kc&&xc<63;function Dc(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Sc&&o&&"false"==o.contentEditable)return Lc(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Lc(o);if(i)return Lc(i)}}function Lc(t){return t.contentEditable="true",Sc&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Rc(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Pc(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function jc(t,e,n,r){return t.someProp("createSelectionBetween",(r=>r(t,e,n)))||Bl.between(e,n,r)}function zc(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&zl.findFrom(i,e)}function Fc(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Hc(t,e,n){let r=t.state.selection;if(!(r instanceof Bl)){if(r instanceof Ul&&r.node.isInline)return Fc(t,new Bl(e>0?r.$to:r.$from));{let n=zc(t.state,e);return!!n&&Fc(t,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let n=zc(t.state,e);return!!(n&&n instanceof Ul)&&Fc(t,n)}if(!(Oc&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=t.docView.descAt(s))&&!n.contentDOM)&&(Ul.isSelectable(i)?Fc(t,new Ul(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Ac&&Fc(t,new Bl(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Vc(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Bc(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Wc(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(bc&&1==n.nodeType&&r<Vc(n)&&Bc(n.childNodes[r])&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(Bc(t))o=n,i=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(qc(n))break;{let e=n.previousSibling;for(;e&&Bc(e);)o=n.parentNode,i=oc(e),e=e.previousSibling;if(e)n=e,r=Vc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Kc(t,n,r):o&&Kc(t,o,i)}function Uc(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=Vc(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Bc(n.childNodes[r]))break;o=n,i=++r}else{if(qc(n))break;{let e=n.nextSibling;for(;e&&Bc(e);)o=e.parentNode,i=oc(e)+1,e=e.nextSibling;if(e)n=e,r=0,s=Vc(n);else{if(n=n.parentNode,n==t.dom)break;r=s=0}}}o&&Kc(t,o,i)}function qc(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Kc(t,e,n){let r=t.domSelection();if(uc(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout((()=>{t.state==o&&Ic(t)}),50)}function Jc(t,e,n){let r=t.state.selection;if(r instanceof Bl&&!r.empty||n.indexOf("s")>-1)return!1;if(Oc&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=zc(t.state,e);if(n&&n instanceof Ul)return Fc(t,n)}if(!o.parent.inlineContent){let n=e<0?o:i,s=r instanceof Kl?zl.near(n,e):zl.findFrom(n,e);return!!s&&Fc(t,s)}return!1}function Gc(t,e){if(!(t.state.selection instanceof Bl))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=t.state.tr;return e<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),t.dispatch(r),!0}return!1}function Yc(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Xc(t,e){let n=e.keyCode,r=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Oc&&72==n&&"c"==r?Gc(t,-1)||Wc(t):46==n||Oc&&68==n&&"c"==r?Gc(t,1)||Uc(t):13==n||27==n||(37==n||Oc&&66==n&&"c"==r?Hc(t,-1,r)||Wc(t):39==n||Oc&&70==n&&"c"==r?Hc(t,1,r)||Uc(t):38==n||Oc&&80==n&&"c"==r?Jc(t,-1,r)||Wc(t):40==n||Oc&&78==n&&"c"==r?function(t){if(!Sc||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;Yc(t,n,"true"),setTimeout((()=>Yc(t,n,"false")),20)}return!1}(t)||Jc(t,1,r)||Uc(t):r==(Oc?"m":"c")&&(66==n||73==n||89==n||90==n))}function Zc(t,e){t.someProp("transformCopied",(n=>{e=n(e,t)}));let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let s=t.someProp("clipboardSerializer")||Ya.fromSchema(t.state.schema),a=lu(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,p=0;for(;u&&1==u.nodeType&&(c=su[u.nodeName.toLowerCase()]);){for(let t=c.length-1;t>=0;t--){let e=a.createElement(c[t]);for(;l.firstChild;)e.appendChild(l.firstChild);l.appendChild(e),p++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:l,text:t.someProp("clipboardTextSerializer",(n=>n(e,t)))||e.content.textBetween(0,e.content.size,"\n\n")}}function Qc(t,e,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!e)return null;let l=e&&(r||a||!n);if(l){if(t.someProp("transformPastedText",(n=>{e=n(e,a||r,t)})),a)return e?new na(Ys.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):na.empty;let n=t.someProp("clipboardTextParser",(n=>n(e,o,r,t)));if(n)s=n;else{let n=o.marks(),{schema:r}=t.state,s=Ya.fromSchema(r);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(r.text(t,n)))}))}}else t.someProp("transformPastedHTML",(e=>{n=e(n,t)})),i=function(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=lu().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&su[o[1].toLowerCase()])&&(t=n.map((t=>"<"+t+">")).join("")+t+n.map((t=>"</"+t+">")).reverse().join(""));if(r.innerHTML=t,n)for(let t=0;t<n.length;t++)r=r.querySelector(n[t])||r;return r}(n),Ac&&function(t){let e=t.querySelectorAll(kc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let t=+u[3];t>0;t--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Fa.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!l&&!u),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||tu.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=n.length-2;t>=0;t-=2){let e=r.nodes[n[t]];if(!e||e.hasRequiredAttrs())break;o=Ys.from(e.create(n[t+1],o)),i++,s++}return new na(o,i,s)}(iu(s,+u[1],+u[2]),u[4]);else if(s=na.maxOpen(function(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,o=e.node(n).contentMatchAt(e.index(n)),i=[];if(t.forEach((t=>{if(!i)return;let e,n=o.findWrapping(t.type);if(!n)return i=null;if(e=i.length&&r.length&&nu(n,r,t,i[i.length-1],0))i[i.length-1]=e;else{i.length&&(i[i.length-1]=ru(i[i.length-1],r.length));let e=eu(t,n);i.push(e),o=o.matchType(e.type),r=n}})),i)return Ys.from(i)}return t}(s.content,o),!0),s.openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t<s.openStart&&!e.type.spec.isolating;t++,e=e.firstChild);for(let t=s.content.lastChild;e<s.openEnd&&!t.type.spec.isolating;e++,t=t.lastChild);s=iu(s,t,e)}return t.someProp("transformPasted",(e=>{s=e(s,t)})),s}const tu=/^(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 eu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Ys.from(t));return t}function nu(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=nu(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(Ys.from(eu(n,t,o+1))))}}function ru(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,ru(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Ys.empty,!0);return t.copy(n.append(r))}function ou(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return o<r-1&&(a=ou(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ys.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function iu(t,e,n){return e<t.openStart&&(t=new na(ou(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new na(ou(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const su={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let au=null;function lu(){return au||(au=document.implementation.createHTMLDocument("title"))}const cu={},uu={};function pu(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function du(t){return{left:t.clientX,top:t.clientY}}function fu(t,e,n,r,o){if(-1==r)return!1;let i=t.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(t.someProp(e,(e=>r>i.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function hu(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function mu(t,e,n,r,o){return fu(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(n=>n(t,e,r)))||(o?function(t,e){if(-1==e)return!1;let n,r,o=t.state.selection;o instanceof Ul&&(n=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(Ul.isSelectable(e)){r=n&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=r&&(hu(t,Ul.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Ul.isSelectable(r))&&(hu(t,new Ul(n),"pointer"),!0)}(t,n))}function gu(t,e,n,r){return fu(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(n=>n(t,e,r)))}function vu(t,e,n,r){return fu(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(n=>n(t,e,r)))||function(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(hu(t,Bl.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(e);for(let e=o.depth+1;e>0;e--){let n=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(n.inlineContent)hu(t,Bl.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Ul.isSelectable(n))continue;hu(t,Ul.create(r,i),"pointer")}return!0}}(t,n,r)}function yu(t){return Eu(t)}uu.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!wu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Cc||!kc||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!Ec||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(e=>e(t,n)))||Xc(t,n)?n.preventDefault():pu(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,pc(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},uu.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},uu.keypress=(t,e)=>{let n=e;if(wu(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Oc&&n.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,n))))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof Bl&&r.$from.sameParent(r.$to))){let e=String.fromCharCode(n.charCode);t.someProp("handleTextInput",(n=>n(t,r.$from.pos,r.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const _u=Oc?"metaKey":"ctrlKey";cu.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=yu(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[_u]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(du(n));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new bu(t,s,n,!!r)):("doubleClick"==i?gu:vu)(t,s.pos,s.inside,n)?n.preventDefault():pu(t,"pointer"))};class bu{constructor(t,e,n,r){let o,i;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[_u],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let n=t.state.doc.resolve(e.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=t.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Ul&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!bc||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),pu(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Ic(this.view))),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(du(t))),this.updateAllowDefault(t),this.allowDefault||!e?pu(this.view,"pointer"):mu(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Sc&&this.mightDrag&&!this.mightDrag.node.isAtom||kc&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(hu(this.view,zl.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):pu(this.view,"pointer")}move(t){this.updateAllowDefault(t),pu(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function wu(t,e){return!!t.composing||!!(Sc&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}cu.touchstart=t=>{t.input.lastTouch=Date.now(),yu(t),pu(t,"pointer")},cu.touchmove=t=>{t.input.lastTouch=Date.now(),pu(t,"pointer")},cu.contextmenu=t=>yu(t);const ku=Cc?5e3:-1;function xu(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Eu(t)),e))}function Su(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Eu(t,e=!1){if(!(Cc&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Su(t),e||t.docView&&t.docView.dirty){let e=Tc(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}uu.compositionstart=uu.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||n.marks(),Eu(t,!0),t.markCursor=null;else if(Eu(t),bc&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}xu(t,ku)},uu.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,xu(t,20))};const Ou=yc&&_c<15||Ec&&Nc<604;function Cu(t,e,n,r){let o=Qc(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,r,o||na.empty))))return!0;if(!o)return!1;let i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}cu.copy=uu.cut=(t,e)=>{let n=e,r=t.state.selection,o="cut"==n.type;if(r.empty)return;let i=Ou?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Zc(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},uu.paste=(t,e)=>{let n=e;if(t.composing&&!Cc)return;let r=Ou?null:n.clipboardData;r&&Cu(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Cu(t,r.value,null,e):Cu(t,r.textContent,r.innerHTML,e)}),50)}(t,n)};class Au{constructor(t,e){this.slice=t,this.move=e}}const Nu=Oc?"altKey":"ctrlKey";cu.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(du(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof Ul?o.to-1:o.to));else if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Ul.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(Ul.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:l}=Zc(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Ou?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ou||n.dataTransfer.setData("text/plain",l),t.dragging=new Au(s,!n[Nu])},cu.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},uu.dragover=uu.dragenter=(t,e)=>e.preventDefault(),uu.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(du(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=Qc(t,n.dataTransfer.getData(Ou?"Text":"text/plain"),Ou?null:n.dataTransfer.getData("text/html"),!1,i);let a=!(!r||n[Nu]);if(t.someProp("handleDrop",(e=>e(t,n,s||na.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let t=0;t<n.openStart;t++)o=o.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,i=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}(t.state.doc,i.pos,s):i.pos;null==l&&(l=i.pos);let c=t.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),p=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=c.doc;if(p?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let f=c.doc.resolve(u);if(p&&Ul.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ul(f));else{let e=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),c.setSelection(jc(t,f,c.doc.resolve(e)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},cu.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ic(t)}),20))},cu.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},cu.beforeinput=(t,e)=>{if(kc&&Cc&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,pc(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let t in uu)cu[t]=uu[t];function Tu(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Mu{constructor(t,e){this.toDOM=t,this.spec=e||Ru,this.side=this.spec.side||0}map(t,e,n,r){let{pos:o,deleted:i}=t.mapResult(e.from+r,this.side<0?-1:1);return i?null:new Du(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Mu&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Tu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Iu{constructor(t,e){this.attrs=t,this.spec=e||Ru}map(t,e,n,r){let o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Du(o,i,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof Iu&&Tu(this.attrs,t.attrs)&&Tu(this.spec,t.spec)}static is(t){return t.type instanceof Iu}destroy(){}}class $u{constructor(t,e){this.attrs=t,this.spec=e||Ru}map(t,e,n,r){let o=t.mapResult(e.from+r,1);if(o.deleted)return null;let i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Du(o.pos-n,i.pos-n,this)}valid(t,e){let n,{index:r,offset:o}=t.content.findIndex(e.from);return o==e.from&&!(n=t.child(r)).isText&&o+n.nodeSize==e.to}eq(t){return this==t||t instanceof $u&&Tu(this.attrs,t.attrs)&&Tu(this.spec,t.spec)}destroy(){}}class Du{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new Du(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new Du(t,t,new Mu(e,n))}static inline(t,e,n,r){return new Du(t,e,new Iu(n,r))}static node(t,e,n,r){return new Du(t,e,new $u(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Iu}}const Lu=[],Ru={};class Pu{constructor(t,e){this.local=t.length?t:Lu,this.children=e.length?e:Lu}static create(t,e){return e.length?Bu(e,t,0,Ru):ju}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=e&&s.to>=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<e&&this.children[i+1]>t){let s=this.children[i]+1;this.children[i+2].findInner(t-s,e-s,n,r+s,o)}}map(t,e,n){return this==ju||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Ru)}mapInner(t,e,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(t,n,r);a&&a.type.valid(e,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(t,e,n,r,o,i,s){let a=t.slice();for(let t=0,e=i;t<n.maps.length;t++){let r=0;n.maps[t].forEach(((t,n,i,s)=>{let l=s-i-(n-t);for(let s=0;s<a.length;s+=3){let c=a[s+1];if(c<0||t>c+e-r)continue;let u=a[s]+e-r;n>=u?a[s+1]=t<=u?-2:-1:i>=o&&l&&(a[s]+=l,a[s+1]+=l)}r+=l})),e=n.maps[t].map(e,-1)}let l=!1;for(let e=0;e<a.length;e+=3)if(a[e+1]<0){if(-2==a[e+1]){l=!0,a[e+1]=-1;continue}let c=n.map(t[e]+i),u=c-o;if(u<0||u>=r.content.size){l=!0;continue}let p=n.map(t[e+1]+i,-1)-o,{index:d,offset:f}=r.content.findIndex(u),h=r.maybeChild(d);if(h&&f==u&&f+h.nodeSize==p){let r=a[e+2].mapInner(n,h,c+1,t[e]+i+1,s);r!=ju?(a[e]=u,a[e+1]=p,a[e+2]=r):(a[e+1]=-2,l=!0)}else l=!0}if(l){let l=function(t,e,n,r,o,i,s){function a(t,e){for(let i=0;i<t.local.length;i++){let a=t.local[i].map(r,o,e);a?n.push(a):s.onRemove&&s.onRemove(t.local[i].spec)}for(let n=0;n<t.children.length;n+=3)a(t.children[n+2],t.children[n]+e+1)}for(let n=0;n<t.length;n+=3)-1==t[n+1]&&a(t[n+2],e[n]+i+1);return n}(a,t,e,n,o,i,s),c=Bu(l,r,0,s);e=c.local;for(let t=0;t<a.length;t+=3)a[t+1]<0&&(a.splice(t,3),t-=3);for(let t=0,e=0;t<c.children.length;t+=3){let n=c.children[t];for(;e<a.length&&a[e]<n;)e+=3;a.splice(e,0,c.children[t],c.children[t+1],c.children[t+2])}}return new Pu(e.sort(Wu),a)}(this.children,i||[],t,e,n,r,o):i?new Pu(i.sort(Wu),Lu):ju}add(t,e){return e.length?this==ju?Pu.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,o=0;t.forEach(((t,i)=>{let s,a=i+n;if(s=Hu(e,t,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(t,s,a+1):r.splice(o,0,i,i+t.nodeSize,Bu(s,t,a+1,Ru)),o+=3}}));let i=Fu(o?Vu(e):e,-n);for(let e=0;e<i.length;e++)i[e].type.valid(t,i[e])||i.splice(e--,1);return new Pu(i.length?this.local.concat(i).sort(Wu):this.local,r||this.children)}remove(t){return 0==t.length||this==ju?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+e,s=n[r+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=ju?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<t.length;o++)if(n=t[o])for(let t=0;t<r.length;t++)r[t].eq(n,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Pu(r,n):ju}forChild(t,e){if(this==ju)return this;if(e.isLeaf)return Pu.empty;let n,r;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(n=this.children[e+2]);break}let o=t+1,i=o+e.content.size;for(let t=0;t<this.local.length;t++){let e=this.local[t];if(e.from<i&&e.to>o&&e.type instanceof Iu){let t=Math.max(o,e.from)-o,n=Math.min(i,e.to)-o;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let t=new Pu(r.sort(Wu),Lu);return n?new zu([t,n]):t}return n||ju}eq(t){if(this==t)return!0;if(!(t instanceof Pu)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Uu(this.localsInner(t))}localsInner(t){if(this==ju)return Lu;if(t.inlineContent||!this.local.some(Iu.is))return this.local;let e=[];for(let t=0;t<this.local.length;t++)this.local[t].type instanceof Iu||e.push(this.local[t]);return e}}Pu.empty=new Pu([],[]),Pu.removeOverlap=Uu;const ju=Pu.empty;class zu{constructor(t){this.members=t}map(t,e){const n=this.members.map((n=>n.map(t,e,Ru)));return zu.from(n)}forChild(t,e){if(e.isLeaf)return Pu.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(t,e);o!=ju&&(o instanceof zu?n=n.concat(o.members):n.push(o))}return zu.from(n)}eq(t){if(!(t instanceof zu)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<o.length;t++)e.push(o[t])}else e=o}return e?Uu(n?e:e.sort(Wu)):Lu}static from(t){switch(t.length){case 0:return ju;case 1:return t[0];default:return new zu(t.every((t=>t instanceof Pu))?t:t.reduce(((t,e)=>t.concat(e instanceof Pu?e:e.members)),[]))}}}function Fu(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Du(o.from+e,o.to+e,o.type))}return n}function Hu(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let e,i=0;i<t.length;i++)(e=t[i])&&e.from>n&&e.to<r&&((o||(o=[])).push(e),t[i]=null);return o}function Vu(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Bu(t,e,n,r){let o=[],i=!1;e.forEach(((e,s)=>{let a=Hu(t,e,s+n);if(a){i=!0;let t=Bu(a,e,n+s+1,r);t!=ju&&o.push(s,s+e.nodeSize,t)}}));let s=Fu(i?Vu(t):t,-n).sort(Wu);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||(r.onRemove&&r.onRemove(s[t].spec),s.splice(t--,1));return s.length||o.length?new Pu(s,o):ju}function Wu(t,e){return t.from-e.from||t.to-e.to}function Uu(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),qu(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),qu(e,o+1,i.copy(r.to,i.to)))}}return e}function qu(t,e,n){for(;e<t.length&&Wu(n,t[e])>0;)e++;t.splice(e,0,n)}for(var Ku={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:"'"},Ju={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Gu="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Yu="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Xu="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Zu=Yu||Gu&&+Gu[1]<57,Qu=0;Qu<10;Qu++)Ku[48+Qu]=Ku[96+Qu]=String(Qu);for(Qu=1;Qu<=24;Qu++)Ku[Qu+111]="F"+Qu;for(Qu=65;Qu<=90;Qu++)Ku[Qu]=String.fromCharCode(Qu+32),Ju[Qu]=String.fromCharCode(Qu);for(var tp in Ku)Ju.hasOwnProperty(tp)||(Ju[tp]=Ku[tp]);const ep="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function np(t){let e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let t=0;t<i.length-1;t++){let s=i[t];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);ep?o=!0:n=!0}}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function rp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function op(t){let e=function(t){let e=Object.create(null);for(let n in t)e[np(n)]=t[n];return e}(t);return function(t,n){let r,o=function(t){var e=!(Zu&&(t.ctrlKey||t.altKey||t.metaKey)||Xu&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Ju:Ku)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==o.length&&" "!=o,s=e[rp(o,n,!i)];if(s&&s(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(r=Ku[n.keyCode])&&r!=o){let o=e[rp(r,n,!0)];if(o&&o(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){let r=e[rp(o,n,!0)];if(r&&r(t.state,t.dispatch,t))return!0}return!1}}function ip(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function sp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ap(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function lp(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function cp(t,e,n){let r,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!wl(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(r[0]||s.type).validEnd){if(n){let o=e.pos+s.nodeSize,a=Ys.empty;for(let t=r.length-1;t>=0;t--)a=Ys.from(r[t].create(null,a));a=Ys.from(i.copy(a));let l=t.tr.step(new hl(e.pos-1,o,e.pos,o,new na(a,1,0),r.length,!0)),c=o+2*r.length;wl(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=zl.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&vl(c);if(null!=u&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&ip(s,"start",!0)&&ip(i,"end")){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=Ys.empty;for(let t=o.length-1;t>=0;t--)r=Ys.from(o[t].copy(r));n(t.tr.step(new hl(e.pos-o.length,e.pos+s.nodeSize,e.pos+l,e.pos+s.nodeSize-l,new na(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function up(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(e.tr.setSelection(Bl.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const pp=up(-1),dp=up(1);function fp(t,e=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{let e=n.doc.resolve(i),r=e.index();o=e.parent.canReplaceWith(r,r+1,t)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,t,e)}r(o.scrollIntoView())}return!0}}function hp(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;let t=n.doc.resolve(s.start-2);l=new ya(t,t,s.depth),s.endIndex<s.parent.childCount&&(s=new ya(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=yl(l,t,e,s);return!!c&&(r&&r(function(t,e,n,r,o){let i=Ys.empty;for(let t=n.length-1;t>=0;t--)i=Ys.from(n[t].type.create(n[t].attrs,i));t.step(new hl(e.start-(r?2:0),e.end,e.start,e.end,new na(i,0,0),n.length,!0));let s=0;for(let t=0;t<n.length;t++)n[t].type==o&&(s=t+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let n=e.startIndex,r=e.endIndex,o=!0;n<r;n++,o=!1)!o&&bl(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(n).nodeSize;return t}(n.tr,s,c,a,t).scrollIntoView()),!0)}}function mp(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!n||(r.node(i.depth-1).type==t?function(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new hl(i-1,s,i,s,new na(Ys.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ya(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=vl(r);if(null==a)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;wl(o.doc,l)&&o.join(l);return e(o.scrollIntoView()),!0}(e,n,t,i):function(t,e,n){let r=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,i=n.startIndex;e>i;e--)t-=o.child(e).nodeSize,r.delete(t-1,t+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Ys.empty:Ys.from(o))))return!1;let p=i.pos,d=p+s.nodeSize;return r.step(new hl(p-(a?1:0),d+(l?1:0),p+1,d-1,new na((a?Ys.empty:Ys.from(o.copy(Ys.empty))).append(l?Ys.empty:Ys.from(o.copy(Ys.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}(e,n,i)))}}function gp(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class vp{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!t,l=t||o.tr,c={...Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(l,e),o=n(...t)(r);return s.push(o),c}]))),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((t=>!0===t)))};return c}createCan(t){const{rawCommands:e,state:n}=this,r=t||n.tr,o=this.buildProps(r,false),i=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)({...o,dispatch:void 0})])));return{...i,chain:()=>this.createChain(r,false)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:r,view:i,state:gp({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}}function yp(t,e,n){if(void 0===t.config[e]&&t.parent)return yp(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?yp(t.parent,e,n):null})}return t.config[e]}function _p(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function bp(t){const e=[],{nodeExtensions:n,markExtensions:r}=_p(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((t=>{const n=yp(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:{...i,...r}})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options,storage:t.storage},r=yp(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,e.push({type:t.name,name:n,attribute:o})}))})),e}function wp(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function kp(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n={...t};return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function xp(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>kp(t,e)),{})}function Sp(t,e,...n){return function(t){return"function"==typeof t}(t)?e?t.bind(e)(...n):t(...n):t}function Ep(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:{...t,[e.name]:r}}),{});return{...r,...o}}}}function Op(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function Cp(t,e){var n;const r=bp(t),{nodeExtensions:o,markExtensions:i}=_p(t),s=null===(n=o.find((t=>yp(t,"topNode"))))||void 0===n?void 0:n.name,a=Object.fromEntries(o.map((n=>{const o=r.filter((t=>t.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=Op({...t.reduce(((t,e)=>{const r=yp(e,"extendNodeSchema",i);return{...t,...r?r(n):{}}}),{}),content:Sp(yp(n,"content",i)),marks:Sp(yp(n,"marks",i)),group:Sp(yp(n,"group",i)),inline:Sp(yp(n,"inline",i)),atom:Sp(yp(n,"atom",i)),selectable:Sp(yp(n,"selectable",i)),draggable:Sp(yp(n,"draggable",i)),code:Sp(yp(n,"code",i)),defining:Sp(yp(n,"defining",i)),isolating:Sp(yp(n,"isolating",i)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=Sp(yp(n,"parseHTML",i));a&&(s.parseDOM=a.map((t=>Ep(t,o))));const l=yp(n,"renderHTML",i);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:xp(t,o)}));const c=yp(n,"renderText",i);return c&&(s.toText=c),[n.name,s]}))),l=Object.fromEntries(i.map((n=>{const o=r.filter((t=>t.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:e},s=Op({...t.reduce(((t,e)=>{const r=yp(e,"extendMarkSchema",i);return{...t,...r?r(n):{}}}),{}),inclusive:Sp(yp(n,"inclusive",i)),excludes:Sp(yp(n,"excludes",i)),group:Sp(yp(n,"group",i)),spanning:Sp(yp(n,"spanning",i)),code:Sp(yp(n,"code",i)),attrs:Object.fromEntries(o.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))}),a=Sp(yp(n,"parseHTML",i));a&&(s.parseDOM=a.map((t=>Ep(t,o))));const l=yp(n,"renderHTML",i);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:xp(t,o)})),[n.name,s]})));return new ja({topNode:s,nodes:a,marks:l})}function Ap(t,e){return e.nodes[t]||e.marks[t]||null}function Np(t,e){return Array.isArray(e)?e.some((e=>("string"==typeof e?e:e.name)===t.name)):e}function Tp(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class Mp{constructor(t){this.find=t.find,this.handler=t.handler}}function Ip(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find((t=>t.type.spec.code))))return!1;let u=!1;const p=((t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,((t,e,o,i)=>{var s,a;const l=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-e))})),n})(c)+i;return s.forEach((t=>{if(u)return;const e=((t,e)=>{if(Tp(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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})(p,t.find);if(!e)return;const s=l.state.tr,c=gp({state:l.state,transaction:s}),d={from:r-(e[0].length-i.length),to:o},{commands:f,chain:h,can:m}=new vp({editor:n,state:c});null!==t.handler({state:c,range:d,match:e,commands:f,chain:h,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)})),u}function $p(t){const{editor:e,rules:n}=t,r=new tc({state:{init:()=>null,apply(t,e){const n=t.getMeta(r);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(t,o,i,s)=>Ip({editor:e,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout((()=>{const{$cursor:o}=t.state.selection;o&&Ip({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;const{$cursor:i}=t.state.selection;return!!i&&Ip({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}class Dp{constructor(t){this.find=t.find,this.handler=t.handler}}function Lp(t){const{editor:e,state:n,from:r,to:o,rule:i}=t,{commands:s,chain:a,can:l}=new vp({editor:e,state:n}),c=[];n.doc.nodesBetween(r,o,((t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const u=Math.max(r,e),p=Math.min(o,e+t.content.size),d=((t,e)=>{if(Tp(e))return[...t.matchAll(e)];const n=e(t);return n?n.map((e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.textBetween(u-e,p-e,void 0,""),i.find);d.forEach((t=>{if(void 0===t.index)return;const e=u+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:t,commands:s,chain:a,can:l});c.push(p)}))}));return c.every((t=>null!==t))}function Rp(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1;const s=n.map((t=>new tc({view(t){const e=e=>{var n;r=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:t=>(i=r===t.dom.parentElement,!1),paste:(t,e)=>{var n;const r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,s)=>{const a=n[0],l="paste"===a.getMeta("uiEvent")&&!o,c="drop"===a.getMeta("uiEvent")&&!i;if(!l&&!c)return;const u=r.doc.content.findDiffStart(s.doc.content),p=r.doc.content.findDiffEnd(s.doc.content);if("number"!=typeof u||!p||u===p.b)return;const d=s.tr,f=gp({state:s,transaction:d});return Lp({editor:e,state:f,from:Math.max(u-1,0),to:p.b-1,rule:t})&&d.steps.length?d:void 0}})));return s}class Pp{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Pp.resolve(t),this.schema=Cp(this.extensions,e),this.extensions.forEach((t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Ap(t.name,this.schema)};if("mark"===t.type){(null===(e=Sp(yp(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=yp(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=yp(t,"onCreate",n);o&&this.editor.on("create",o);const i=yp(t,"onUpdate",n);i&&this.editor.on("update",i);const s=yp(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=yp(t,"onTransaction",n);a&&this.editor.on("transaction",a);const l=yp(t,"onFocus",n);l&&this.editor.on("focus",l);const c=yp(t,"onBlur",n);c&&this.editor.on("blur",c);const u=yp(t,"onDestroy",n);u&&this.editor.on("destroy",u)}))}static resolve(t){const e=Pp.sort(Pp.flatten(t)),n=function(t){const e=t.filter(((e,n)=>t.indexOf(e)!==n));return[...new Set(e)]}(e.map((t=>t.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((t=>`'${t}'`)).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map((t=>{const e=yp(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=yp(t,"priority")||100,r=yp(e,"priority")||100;return n>r?-1:n<r?1:0}))}get commands(){return this.extensions.reduce(((t,e)=>{const n=yp(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Ap(e.name,this.schema)});return n?{...t,...n()}:t}),{})}get plugins(){const{editor:t}=this,e=Pp.sort([...this.extensions].reverse()),n=[],r=[],o=e.map((e=>{const o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Ap(e.name,this.schema)},i=[],s=yp(e,"addKeyboardShortcuts",o);let a={};if("mark"===e.type&&e.config.exitable&&(a.ArrowRight=()=>dd.handleExit({editor:t,mark:e})),s){const e=Object.fromEntries(Object.entries(s()).map((([e,n])=>[e,()=>n({editor:t})])));a={...a,...e}}const l=new tc({props:{handleKeyDown:op(a)}});i.push(l);const c=yp(e,"addInputRules",o);Np(e,t.options.enableInputRules)&&c&&n.push(...c());const u=yp(e,"addPasteRules",o);Np(e,t.options.enablePasteRules)&&u&&r.push(...u());const p=yp(e,"addProseMirrorPlugins",o);if(p){const t=p();i.push(...t)}return i})).flat();return[$p({editor:t,rules:n}),...Rp({editor:t,rules:r}),...o]}get attributes(){return bp(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=_p(this.extensions);return Object.fromEntries(e.filter((t=>!!yp(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:wp(e.name,this.schema)},o=yp(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const l=xp(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]})))}}function jp(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function zp(t,e){const n={...t};return jp(t)&&jp(e)&&Object.keys(e).forEach((r=>{jp(e[r])?r in t?n[r]=zp(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Fp{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...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: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sp(yp(this,"addOptions",{name:this.name}))),this.storage=Sp(yp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Fp(t)}configure(t={}){const e=this.extend();return e.options=zp(this.options,t),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new Fp(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Sp(yp(e,"addOptions",{name:e.name})),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}}Fp.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new tc({key:new rc("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map((t=>t.$from.pos))),a=Math.max(...i.map((t=>t.$to.pos))),l=function(t){return Object.fromEntries(Object.entries(t.nodes).filter((([,t])=>t.spec.toText)).map((([t,e])=>[t,e.spec.toText])))}(n);return function(t,e,n){const{from:r,to:o}=e,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="",l=!0;return t.nodesBetween(r,o,((t,n,c,u)=>{var p;const d=null==s?void 0:s[t.type.name];d?(t.isBlock&&!l&&(a+=i,l=!0),c&&(a+=d({node:t,pos:n,parent:c,index:u,range:e}))):t.isText?(a+=null===(p=null==t?void 0:t.text)||void 0===p?void 0:p.slice(Math.max(r,n)-n,o-n),l=!1):t.isBlock&&!l&&(a+=i,l=!0)})),a}(r,{from:s,to:a},{textSerializers:l})}}})]}});function Hp(t,e,n={strict:!0}){const r=Object.keys(e);return!r.length||r.every((r=>n.strict?e[r]===t[r]:Tp(e[r])?e[r].test(t[r]):e[r]===t[r]))}function Vp(t,e,n={}){return t.find((t=>t.type===e&&Hp(t.attrs,n)))}function Bp(t,e,n={}){return!!Vp(t,e,n)}function Wp(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=Vp([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(Vp([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&Bp([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Up(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function qp(t){return t instanceof Bl}function Kp(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Jp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Gp(t){const e=`<body>${t}</body>`;return(new window.DOMParser).parseFromString(e,"text/html").body}function Yp(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Ys.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),Yp("",e,n)}if("string"==typeof t){const r=Fa.fromSchema(e);return n.slice?r.parseSlice(Gp(t),n.parseOptions).content:r.parse(Gp(t),n.parseOptions)}return Yp("",e,n)}function Xp(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function Zp(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?wp(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a.push({node:t,from:n,to:i})}));const l=o-r,c=a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>Hp(t.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((t,e)=>t+e.to-e.from),0)>=l}function Qp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function td(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}function ed(t){return e=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(e.$from,t)}function nd(t,e){const n=Up(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,(t=>{s.push(...t.marks)}));const a=s.find((t=>t.type.name===n.name));return a?{...a.attrs}:{}}function rd(t,e){const n=Qp("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){const n=wp(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,(t=>{i.push(t)}));const s=i.reverse().find((t=>t.type.name===n.name));return s?{...s.attrs}:{}}(t,e):"mark"===n?nd(t,e):{}}function od(t){const e=function(t,e=JSON.stringify){const n={};return t.filter((t=>{const r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(t);return 1===e.length?e:e.filter(((t,n)=>{const r=e.filter(((t,e)=>e!==n));return!r.some((e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}))}function id(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach((e=>{const o=Wp(n.resolve(t-1),e.type);o&&r.push({mark:e,...o})})):n.nodesBetween(t,e,((t,e)=>{r.push(...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n}))))})),r}function sd(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function ad(t,e){const{nodeExtensions:n}=_p(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=Sp(yp(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function ld(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}const cd=(t,e)=>{const n=ed((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!wl(t.doc,n.pos)||(t.join(n.pos),!0)},ud=(t,e)=>{const n=ed((t=>t.type===e))(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!wl(t.doc,r)||(t.join(r),!0)};var pd=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame((()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())})),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,((t,n)=>{if(t.type.isText)return;const{doc:r,mapping:o}=e,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+t.nodeSize)),a=i.blockRange(s);if(!a)return;const l=vl(a);if(t.type.isTextblock){const{defaultType:t}=i.parent.contentMatchAt(i.index());e.setNodeMarkup(a.start,t)}(l||0===l)&&e.lift(a,l)}))})),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>((t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Kl||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=lp(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=t.tr.insert(n,i.createAndFill());s.setSelection(Bl.create(s.doc,n+1)),e(s.scrollIntoView())}return!0})(t,e),deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let n=o.depth;n>0;n-=1){if(o.node(n).type===r.type){if(e){const e=o.before(n),r=o.after(n);t.delete(e,r).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:r})=>{const o=wp(t,n.schema),i=e.selection.$anchor;for(let t=i.depth;t>0;t-=1){if(i.node(t).type===o){if(r){const n=i.before(t),r=i.after(t);e.delete(n,r).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},deleteSelection:()=>({state:t,dispatch:e})=>((t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0))(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=lp(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let r=n.after(),o=t.tr.replaceWith(r,r,s.createAndFill());o.setSelection(zl.near(o.doc.resolve(r),1)),e(o.scrollIntoView())}return!0})(t,e),extendMarkRange:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Up(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const t=Wp(l,i,e);if(t&&t.from<=c&&t.to>=u){const e=Bl.create(s,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Jp()&&r.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())}))};if(r.hasFocus()&&null===t||!1===t)return!0;if(i&&null===t&&!qp(n.state.selection))return s(),!0;const a=function(t,e=null){if(!e)return null;const n=zl.atStart(t),r=zl.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;const o=n.from,i=r.to;return"all"===e?Bl.create(t,Kp(0,o,i),Kp(t.content.size,o,i)):Bl.create(t,Kp(e,o,i),Kp(e,o,i))}(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every(((t,r)=>e(t,{...n,index:r}))),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const o=Yp(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:s,to:a}="number"==typeof t?{from:t,to:t}:t,l=!0,c=!0;if((o.toString().startsWith("<")?o:[o]).forEach((t=>{t.check(),l=!!l&&(t.isText&&0===t.marks.length),c=!!c&&t.isBlock})),s===a&&c){const{parent:t}=r.doc.resolve(s);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(s-=1,a+=1)}l?Array.isArray(e)?r.insertText(e.map((t=>t.text||"")).join(""),s,a):"object"==typeof e&&e&&e.text?r.insertText(e.text,s,a):r.insertText(e,s,a):r.replaceWith(s,a,o),n.updateSelection&&function(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof fl||o instanceof hl))return;const i=t.mapping.maps[r];let s=0;i.forEach(((t,e,n,r)=>{0===s&&(s=r)})),t.setSelection(zl.near(t.doc.resolve(s),n))}(r,r.steps.length-1,-1)}return!0},joinUp:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection,o=r instanceof Ul;if(o){if(r.node.isTextblock||!wl(t.doc,r.from))return!1;n=r.from}else if(n=xl(t.doc,r.from,-1),null==n)return!1;if(e){let r=t.tr.join(n);o&&r.setSelection(Ul.create(r.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(r.scrollIntoView())}return!0})(t,e),joinDown:()=>({state:t,dispatch:e})=>((t,e)=>{let n,r=t.selection;if(r instanceof Ul){if(r.node.isTextblock||!wl(t.doc,r.to))return!1;n=r.to}else if(n=xl(t.doc,r.to,1),null==n)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0})(t,e),joinBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;let o=sp(r);if(!o){let n=r.blockRange(),o=n&&vl(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&cp(t,o,e))return!0;if(0==r.parent.content.size&&(ip(i,"end")||Ul.isSelectable(i))){let n=Sl(t.doc,r.before(),r.after(),na.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(ip(i,"end")?zl.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Ul.create(r.doc,o.pos-i.nodeSize)),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))})(t,e),joinForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!r)return!1;let o=ap(r);if(!o)return!1;let i=o.nodeAfter;if(cp(t,o,e))return!0;if(0==r.parent.content.size&&(ip(i,"start")||Ul.isSelectable(i))){let n=Sl(t.doc,r.before(),r.after(),na.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(ip(i,"start")?zl.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Ul.create(r.doc,r.mapping.map(o.pos))),e(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))})(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let t=0;t<e.length-1;t+=1){const s=e[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Jp()||Xp()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(t).split(/-(?!$)/),s=i.find((t=>!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==l||l.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0},lift:(t,e={})=>({state:n,dispatch:r})=>!!Zp(n,wp(t,n.schema),e)&&((t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&vl(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:t,dispatch:e})=>((t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(bl(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&vl(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)})(t,e),liftListItem:t=>({state:e,dispatch:n})=>mp(wp(t,e.schema))(e,n),newlineInCode:()=>({state:t,dispatch:e})=>((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(e&&e(t.tr.insertText("\n").scrollIntoView()),0))})(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Qp("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=wp(t,r.schema)),"mark"===a&&(s=Up(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,td(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(td(o.attrs,e)))}))}))})),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=sp(r)}let s=i&&i.nodeBefore;return!(!s||!Ul.isSelectable(s)||(e&&e(t.tr.setSelection(Ul.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))})(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>((t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=ap(r)}let s=i&&i.nodeAfter;return!(!s||!Ul.isSelectable(s)||(e&&e(t.tr.setSelection(Ul.create(t.doc,i.pos)).scrollIntoView()),0))})(t,e),selectParentNode:()=>({state:t,dispatch:e})=>((t,e)=>{let n,{$from:r,to:o}=t.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),e&&e(t.tr.setSelection(Ul.create(t.doc,n))),!0)})(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>dp(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>pp(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=function(t,e,n={}){return Yp(t,e,{slice:!1,parseOptions:n})}(t,o.schema,n);return i&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Up(t,r.schema);if(o)if(s){const t=nd(r,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i),c=t.marks.find((t=>t.type===l));c?t.marks.forEach((t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))})):n.addMark(s,a,l.create(e))}))}));return function(t,e,n){var r;const{selection:o}=e;let i=null;if(qp(o)&&(i=o.$cursor),i){const e=null!==(r=t.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(e)||!e.some((t=>t.type.excludes(n)))}const{ranges:s}=o;return s.some((({$from:e,$to:r})=>{let o=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,r.pos,((t,e,r)=>{if(o)return!1;if(t.isInline){const e=!r||r.type.allowsMarkType(n),i=!!n.isInSet(t.marks)||!t.marks.some((t=>t.type.excludes(n)));o=e&&i}return!o})),o}))}(r,n,l)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=wp(t,n.schema);return i.isTextblock?o().command((({commands:t})=>!!fp(i,e)(n)||t.clearNodes())).command((({state:t})=>fp(i,e)(t,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=Kp(t,0,n.content.size),o=Ul.create(n,r);e.setSelection(o)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=Bl.atStart(n).from,s=Bl.atEnd(n).to,a=Kp(r,i,s),l=Kp(o,i,s),c=Bl.create(n,a,l);e.setSelection(c)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const r=wp(t,e.schema);return(o=r,function(t,e){let{$from:n,$to:r}=t.selection,i=n.blockRange(r,(t=>t.childCount>0&&t.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(e){let n=l.lastChild&&l.lastChild.type==a.type,r=Ys.from(n?o.create():null),s=new na(Ys.from(o.create(null,Ys.from(a.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;e(t.tr.step(new hl(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(e,n);var o},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=sd(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Ul&&i.node.isBlock)return!(!a.parentOffset||!bl(s,a.pos))&&(r&&(t&&ld(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=l.parentOffset===l.parent.content.size;i instanceof Bl&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let u=r&&s?[{type:s,attrs:c}]:void 0,p=bl(e.doc,e.mapping.map(a.pos),1,u);if(u||p||!bl(e.doc,e.mapping.map(a.pos),1,s?[{type:s}]:void 0)||(p=!0,u=s?[{type:s,attrs:c}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,u),s&&!r&&!a.parentOffset&&a.parent.type!==s)){const t=e.mapping.map(a.before()),n=e.doc.resolve(t);a.node(-1).canReplaceWith(n.index(),n.index()+1,s)&&e.setNodeMarkup(e.mapping.map(a.before()),s)}t&&ld(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:r,editor:o})=>{var i;const s=wp(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const p=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let t=Ys.empty;const n=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-n;e>=a.depth-3;e-=1)t=Ys.from(a.node(e).copy(t));const r=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o=sd(p,a.node().type.name,a.node().attrs),l=(null===(i=s.contentMatch.defaultType)||void 0===i?void 0:i.createAndFill(o))||void 0;t=t.append(Ys.from(s.createAndFill(null,l)||void 0));const c=a.before(a.depth-(n-1));e.replace(c,a.after(-r),new na(t,4-n,0));let u=-1;e.doc.nodesBetween(c,e.doc.content.size,((t,e)=>{if(u>-1)return!1;t.isTextblock&&0===t.content.size&&(u=e+1)})),u>-1&&e.setSelection(Bl.near(e.doc.resolve(u))),e.scrollIntoView()}return!0}const d=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,f=sd(p,u.type.name,u.attrs),h=sd(p,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const m=d?[{type:s,attrs:f},{type:d,attrs:h}]:[{type:s,attrs:f}];if(!bl(e.doc,a.pos,2))return!1;if(r){const{selection:t,storedMarks:i}=n,{splittableMarks:s}=o.extensionManager,l=i||t.$to.parentOffset&&t.$from.marks();if(e.split(a.pos,2,m).scrollIntoView(),!l||!r)return!0;const c=l.filter((t=>s.includes(t.type.name)));e.ensureMarks(c)}return!0},toggleList:(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:p,splittableMarks:d}=o.extensionManager,f=wp(t,s.schema),h=wp(e,s.schema),{selection:m,storedMarks:g}=s,{$from:v,$to:y}=m,_=v.blockRange(y),b=g||m.$to.parentOffset&&m.$from.marks();if(!_)return!1;const w=ed((t=>ad(t.type.name,p)))(m);if(_.depth>=1&&w&&_.depth-w.depth<=1){if(w.node.type===f)return c.liftListItem(h);if(ad(w.node.type.name,p)&&f.validContent(w.node.content)&&a)return l().command((()=>(i.setNodeMarkup(w.pos,f),!0))).command((()=>cd(i,f))).command((()=>ud(i,f))).run()}return n&&b&&a?l().command((()=>{const t=u().wrapInList(f,r),e=b.filter((t=>d.includes(t.type.name)));return i.ensureMarks(e),!!t||c.clearNodes()})).wrapInList(f,r).command((()=>cd(i,f))).command((()=>ud(i,f))).run():l().command((()=>!!u().wrapInList(f,r)||c.clearNodes())).wrapInList(f,r).command((()=>cd(i,f))).command((()=>ud(i,f))).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Up(t,r.schema),a=function(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Up(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!i||i.name===t.type.name)).find((t=>Hp(t.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:e,$to:n})=>{const r=e.pos,o=n.pos;t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);s+=i-n,a.push(...t.marks.map((t=>({mark:t,from:n,to:i}))))}))})),0===s)return!1;const l=a.filter((t=>!i||i.name===t.mark.type.name)).filter((t=>Hp(t.mark.attrs,n,{strict:!1}))).reduce(((t,e)=>t+e.to-e.from),0),c=a.filter((t=>!i||t.mark.type!==i&&t.mark.type.excludes(i))).reduce(((t,e)=>t+e.to-e.from),0);return(l>0?l+c:l)>=s}(r,s,e);return a?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=wp(t,r.schema),s=wp(e,r.schema);return Zp(r,i,n)?o.setNode(s):o.setNode(i,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=wp(t,n.schema);return Zp(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){const n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach((e=>{t.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Up(t,r.schema),{$from:c,empty:u,ranges:p}=a;if(!o)return!0;if(u&&s){let{from:t,to:e}=a;const r=null===(i=c.marks().find((t=>t.type===l)))||void 0===i?void 0:i.attrs,o=Wp(c,l,r);o&&(t=o.from,e=o.to),n.removeMark(t,e,l)}else p.forEach((t=>{n.removeMark(t.$from.pos,t.$to.pos,l)}));return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Qp("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=wp(t,r.schema)),"mark"===a&&(s=Up(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const l=Math.max(r,o),c=Math.min(r+t.nodeSize,a);n.addMark(l,c,s.create({...i.attrs,...e}))}}))}))})),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>function(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&yl(s,t,e);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(wp(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>hp(wp(t,n.schema),e)(n,r)});Fp.create({name:"commands",addCommands:()=>({...pd})}),Fp.create({name:"editable",addProseMirrorPlugins(){return[new tc({key:new rc("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Fp.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new tc({key:new rc("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Fp.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.command((({tr:e})=>{const{selection:n,doc:r}=e,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=zl.atStart(r).from===s;return!(!(o&&l&&a.type.isTextblock)||a.textContent.length)&&t.clearNodes()})),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Jp()||Xp()?o:r},addProseMirrorPlugins(){return[new tc({key:new rc("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some((t=>t.docChanged))&&!e.doc.eq(n.doc)))return;const{empty:r,from:o,to:i}=e.selection,s=zl.atStart(e.doc).from,a=zl.atEnd(e.doc).to;if(r||!(o===s&&i===a))return;if(!(0===n.doc.textBetween(0,n.doc.content.size," "," ").length))return;const l=n.tr,c=gp({state:n,transaction:l}),{commands:u}=new vp({editor:this.editor,state:c});return u.clearNodes(),l.steps.length?l:void 0}})]}}),Fp.create({name:"tabindex",addProseMirrorPlugins(){return[new tc({key:new rc("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class dd{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...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: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sp(yp(this,"addOptions",{name:this.name}))),this.storage=Sp(yp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new dd(t)}configure(t={}){const e=this.extend();return e.options=zp(this.options,t),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new dd(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Sp(yp(e,"addOptions",{name:e.name})),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((t=>(null==t?void 0:t.type.name)===e.name)))return!1;const i=o.find((t=>(null==t?void 0:t.type.name)===e.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),t.view.dispatch(n),!0}return!1}}class fd{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...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: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sp(yp(this,"addOptions",{name:this.name}))),this.storage=Sp(yp(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new fd(t)}configure(t={}){const e=this.extend();return e.options=zp(this.options,t),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){const e=new fd(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=Sp(yp(e,"addOptions",{name:e.name})),e.storage=Sp(yp(e,"addStorage",{name:e.name,options:e.options})),e}}function hd(t){return new Dp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Sp(t.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];let l=n.to;if(s){const r=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(id(n.from,n.to,e.doc).filter((e=>e.mark.type.excluded.find((n=>n===t.type&&n!==e.mark.type)))).filter((t=>t.to>c)).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+r,c),l=n.from+r+s.length,i.addMark(n.from+r,l,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}const md=fd.create({name:"text",group:"inline"});var gd=200,vd=function(){};vd.prototype.append=function(t){return t.length?(t=vd.from(t),!this.length&&t||t.length<gd&&this.leafAppend(t)||this.length<gd&&t.leafPrepend(this)||this.appendInner(t)):this},vd.prototype.prepend=function(t){return t.length?vd.from(t).append(this):this},vd.prototype.appendInner=function(t){return new _d(this,t)},vd.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?vd.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},vd.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},vd.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},vd.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},vd.from=function(t){return t instanceof vd?t:t&&t.length?new yd(t):vd.empty};var yd=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=gd)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=gd)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(vd);vd.empty=new yd([]);var _d=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(vd),bd=vd;class wd{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=t.tr,l=[],c=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(o,e+1),r=n.maps.length),r--,void c.push(t);if(n){c.push(new kd(t.map));let e,o=t.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(e=a.mapping.maps[a.mapping.maps.length-1],l.push(new kd(e,void 0,void 0,l.length+c.length))),r--,e&&n.appendMap(e,r)}else a.maybeStep(t.step);return t.selection?(i=n?t.selection.map(n.slice(r)):t.selection,s=new wd(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,c=t.steps[n].invert(t.docs[n]),u=new kd(t.mapping.maps[n],c,e);(l=a&&a.merge(u))&&(u=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(u),e&&(i++,e=void 0),r||(a=u)}let l=i-n.depth;return l>Sd&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),i-=l),new wd(s.append(o),i)}remapping(t,e){let n=new ol;return this.items.forEach(((e,r)=>{let o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new wd(this.items.append(t.map((t=>new kd(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let a=e;this.items.forEach((e=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(e.step){let i=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(o.slice(a+1,r));c&&s++,n.push(new kd(l,i,c))}else n.push(new kd(l))}),r);let l=[];for(let t=e;t<i;t++)l.push(new kd(o.maps[t]));let c=this.items.slice(0,r).append(l).append(n),u=new wd(c,s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=t)r.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=i.selection&&i.selection.map(e.slice(n));a&&o++;let l,c=new kd(s.invert(),t,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new wd(bd.from(r.reverse()),o)}}wd.empty=new wd(bd.empty,0);class kd{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new kd(e.getMap().invert(),e,this.selection)}}}class xd{constructor(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r}}const Sd=20;function Ed(t){let e=[];return t.forEach(((t,n,r,o)=>e.push(r,o))),e}function Od(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function Cd(t,e,n,r){let o=Td(e),i=Md.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),c=new xd(r?l:s.remaining,r?s.remaining:l,null,0);n(s.transform.setSelection(a).setMeta(Md,{redo:r,historyState:c}).scrollIntoView())}let Ad=!1,Nd=null;function Td(t){let e=t.plugins;if(Nd!=e){Ad=!1,Nd=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Ad=!0;break}}return Ad}const Md=new rc("history"),Id=new rc("closeHistory");function $d(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new tc({key:Md,state:{init:()=>new xd(wd.empty,wd.empty,null,0),apply:(e,n,r)=>function(t,e,n,r){let o,i=n.getMeta(Md);if(i)return i.historyState;n.getMeta(Id)&&(t=new xd(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(Md))return s.getMeta(Md).redo?new xd(t.done.addTransform(n,void 0,r,Td(e)),t.undone,Ed(n.mapping.maps[n.steps.length-1]),t.prevTime):new xd(t.done,t.undone.addTransform(n,void 0,r,Td(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new xd(t.done.rebased(n,o),t.undone.rebased(n,o),Od(t.prevRanges,n.mapping),t.prevTime):new xd(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Od(t.prevRanges,n.mapping),t.prevTime);{let o=0==t.prevTime||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),i=s?Od(t.prevRanges,n.mapping):Ed(n.mapping.maps[n.steps.length-1]);return new xd(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,Td(e)),wd.empty,i,n.time)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?Dd:"historyRedo"==n?Ld:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}const Dd=(t,e)=>{let n=Md.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Cd(n,t,e,!1),!0)},Ld=(t,e)=>{let n=Md.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Cd(n,t,e,!0),!0)},Rd=Fp.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Dd(t,e),redo:()=>({state:t,dispatch:e})=>Ld(t,e)}),addProseMirrorPlugins(){return[$d(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Pd=Object.freeze({COMMON:"common",DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile",get values(){return[this.COMMON,this.MOBILE,this.TABLET,this.DESKTOP]}}),jd=Object.freeze({UPPERCASE:"uppercase",LOWERCASE:"lowercase",CAPITALIZE:"capitalize"}),zd=Object.freeze({LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify",get values(){return[this.LEFT,this.CENTER,this.RIGHT,this.JUSTIFY]}}),Fd=Object.freeze({DOCUMENT:"doc",PARAGRAPH:"paragraph",HEADING:"heading",LIST:"list",LIST_ITEM:"listItem",TEXT:"text",get blocks(){return[this.PARAGRAPH,this.LIST,this.HEADING]}}),Hd=Object.freeze({DISC:"disc",CIRCLE:"circle",SQUARE:"square",DECIMAL:"decimal",ROMAN:"roman",LATIN:"latin",get values(){return[this.DISC,this.CIRCLE,this.SQUARE,this.DECIMAL,this.ROMAN,this.LATIN]},get ordered(){return[this.DECIMAL,this.ROMAN,this.LATIN]}}),Vd=Object.freeze({ALIGNMENT:"alignment",BACKGROUND_COLOR:"background_color",FONT_COLOR:"font_color",FONT_FAMILY:"font_family",FONT_SIZE:"font_size",FONT_STYLE:"font_style",FONT_WEIGHT:"font_weight",LINE_HEIGHT:"line_height",TEXT_DECORATION:"text_decoration",SUPERSCRIPT:"superscript",MARGIN:"margin",LINK:"link",STYLE_PRESET:"style_preset",get attributes(){return[this.ALIGNMENT,this.LINE_HEIGHT,this.MARGIN]},get presetAttributes(){return[this.LINE_HEIGHT]},get inlineMarks(){return[this.TEXT_DECORATION,this.LINK,this.SUPERSCRIPT,this.BACKGROUND_COLOR]},get marks(){return[this.BACKGROUND_COLOR,this.FONT_COLOR,this.FONT_FAMILY,this.FONT_SIZE,this.FONT_STYLE,this.FONT_WEIGHT,this.TEXT_DECORATION,this.SUPERSCRIPT]}}),Bd=Object.freeze({SETTINGS:"settings",ALL:"_"}),Wd=Object.freeze({BLANK:"_blank",SELF:"_self"}),Ud=Object.freeze({URL:"url",BLOCK:"block"});class qd{static create(t,e){const n=new this(t,e||{});return new tc({key:new rc(this.name),props:n._buildProps()})}constructor(t,e){this.options=e,this.editor=t}_buildProps(){const t=Object.entries(this.addProps()).map((([t,e])=>[t,e.bind(this)]));return Object.fromEntries(t)}addProps(){return{}}}class Kd extends qd{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(t){if(t.includes("data-pm-slice")&&t.includes("zw-style"))return t;const e=Um.build(t);return e.normalizeHTML(),this._removeDeprecatedStyles(e),e.normalizedHTML}_removeDeprecatedStyles(t){const e=t.dom.querySelectorAll('[style*="margin"]');for(const t of Array.from(e))t.style.removeProperty("margin"),t.style.removeProperty("margin-top"),t.style.removeProperty("margin-right"),t.style.removeProperty("margin-bottom"),t.style.removeProperty("margin-left")}_handlePaste(t,e,n){const r=this._insertPastedContent(t,n).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return t.dispatch(r),!0}_insertPastedContent({state:t},e){return this._isFullBlockSelected(t)?t.tr.replaceSelectionWith(e.content,!1):t.tr.replaceSelection(e)}_isFullBlockSelected(t){const e=this._expandSelectionToBlocks(t),n=this._isMatchPosition(e.from,t.selection.from),r=this._isMatchPosition(e.to,t.selection.to);return n&&r}_expandSelectionToBlocks({selection:t,doc:e}){let n=t.from,r=t.to;return e.nodesBetween(n,r,((t,e,o)=>{o.type.name===Fd.DOCUMENT&&(n=Math.min(n,e+1),r=Math.max(r,e+t.nodeSize-1))})),{from:n,to:r}}_isMatchPosition(t,e){return Math.abs(t-e)<5}}class Jd extends qd{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:t}){const e=[];return this.editor.isEditable?t.childCount>1?void 0:(t.descendants(((t,n)=>{if(!t.childCount){const r=Du.node(n,n+t.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});e.push(r)}return!1})),Pu.create(t,e)):null}}const Gd=(t,e)=>{for(const n in e)t[n]=e[n];return t},Yd="numeric",Xd="ascii",Zd="alpha",Qd="asciinumeric",tf="alphanumeric",ef="domain",nf="emoji",rf="whitespace";function of(t,e){return t in e||(e[t]=[]),e[t]}function sf(t,e,n){e[Yd]&&(e[Qd]=!0,e[tf]=!0),e[Xd]&&(e[Qd]=!0,e[Zd]=!0),e[Qd]&&(e[tf]=!0),e[Zd]&&(e[tf]=!0),e[tf]&&(e[ef]=!0),e[nf]&&(e[ef]=!0);for(const r in e){const e=of(r,n);e.indexOf(t)<0&&e.push(t)}}function af(t){void 0===t&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}af.groups={},af.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],o=e.jr[n][1];if(o&&r.test(t))return o}return e.jd},has(t,e){return void 0===e&&(e=!1),e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){let o;return r=r||af.groups,e&&e.j?o=e:(o=new af(e),n&&r&&sf(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let e=0;e<i-1;e++)o=o.tt(t[e]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||af.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new af,Gd(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new af,i){if(r)if(s.t&&"string"==typeof s.t){const t=Gd(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);sf(i,t,r)}else n&&sf(i,n,r);s.t=i}return o.j[t]=s,s}};const lf=(t,e,n,r,o)=>t.ta(e,n,r,o),cf=(t,e,n,r,o)=>t.tr(e,n,r,o),uf=(t,e,n,r,o)=>t.ts(e,n,r,o),pf=(t,e,n,r,o)=>t.tt(e,n,r,o),df="WORD",ff="UWORD",hf="LOCALHOST",mf="TLD",gf="UTLD",vf="SCHEME",yf="SLASH_SCHEME",_f="NUM",bf="NL",wf="OPENBRACE",kf="OPENBRACKET",xf="OPENANGLEBRACKET",Sf="OPENPAREN",Ef="CLOSEBRACE",Of="CLOSEBRACKET",Cf="CLOSEANGLEBRACKET",Af="CLOSEPAREN",Nf="AMPERSAND",Tf="APOSTROPHE",Mf="ASTERISK",If="AT",$f="BACKSLASH",Df="BACKTICK",Lf="CARET",Rf="COLON",Pf="COMMA",jf="DOLLAR",zf="DOT",Ff="EQUALS",Hf="EXCLAMATION",Vf="HYPHEN",Bf="PERCENT",Wf="PIPE",Uf="PLUS",qf="POUND",Kf="QUERY",Jf="QUOTE",Gf="SEMI",Yf="SLASH",Xf="TILDE",Zf="UNDERSCORE",Qf="EMOJI",th="SYM";var eh=Object.freeze({__proto__:null,WORD:df,UWORD:ff,LOCALHOST:hf,TLD:mf,UTLD:gf,SCHEME:vf,SLASH_SCHEME:yf,NUM:_f,WS:"WS",NL:bf,OPENBRACE:wf,OPENBRACKET:kf,OPENANGLEBRACKET:xf,OPENPAREN:Sf,CLOSEBRACE:Ef,CLOSEBRACKET:Of,CLOSEANGLEBRACKET:Cf,CLOSEPAREN:Af,AMPERSAND:Nf,APOSTROPHE:Tf,ASTERISK:Mf,AT:If,BACKSLASH:$f,BACKTICK:Df,CARET:Lf,COLON:Rf,COMMA:Pf,DOLLAR:jf,DOT:zf,EQUALS:Ff,EXCLAMATION:Hf,HYPHEN:Vf,PERCENT:Bf,PIPE:Wf,PLUS:Uf,POUND:qf,QUERY:Kf,QUOTE:Jf,SEMI:Gf,SLASH:Yf,TILDE:Xf,UNDERSCORE:Zf,EMOJI:Qf,SYM:th});const nh=/[a-z]/,rh=/\p{L}/u,oh=/\p{Emoji}/u,ih=/\d/,sh=/\s/;let ah=null,lh=null;function ch(t,e,n,r,o){let i;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?i=t.j[s]:(i=new af(r),i.jr=o.slice(),t.j[s]=i),t=i}return i=new af(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function uh(t){const e=[],n=[];let r=0;for(;r<t.length;){let o=0;for(;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+o),10);e>0;e--)n.pop();r+=o}else n.push(t[r]),r++}return e}const ph={defaultProtocol:"http",events:null,format:fh,formatHref:fh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function dh(t,e){void 0===e&&(e=null);let n=Gd({},ph);t&&(n=Gd(n,t instanceof dh?t.o:t));const r=n.ignoreTags,o=[];for(let t=0;t<r.length;t++)o.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function fh(t){return t}function hh(t,e){this.t="token",this.v=t,this.tk=e}function mh(t,e){class n extends hh{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}dh.prototype={o:ph,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let o=this.o[t];return o?("object"==typeof o?(o=n.t in o?o[n.t]:ph[t],"function"==typeof o&&r&&(o=o(e,n))):"function"==typeof o&&r&&(o=o(e,n.t,n)),o):o},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},hh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return void 0===t&&(t=ph.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Gd(s,u),{tagName:o,attributes:s,content:i,eventListeners:p}}};const gh=mh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),vh=mh("text"),yh=mh("nl"),_h=mh("url",{isLink:!0,toHref(t){return void 0===t&&(t=ph.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==hf&&t[1].t===Rf}}),bh=t=>new af(t);function wh(t,e,n){const r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}const kh="undefined"!=typeof console&&console&&console.warn||(()=>{}),xh={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Sh(t,e){if(void 0===e&&(e=!1),xh.initialized&&kh(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n 1. Must only contain digits, lowercase ASCII letters or "-"\n 2. Cannot start or end with "-"\n 3. "-" cannot repeat');xh.customSchemes.push([t,e])}function Eh(){xh.scanner=function(t){void 0===t&&(t=[]);const e={};af.groups=e;const n=new af;null==ah&&(ah=uh("aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==lh&&(lh=uh("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),pf(n,"'",Tf),pf(n,"{",wf),pf(n,"[",kf),pf(n,"<",xf),pf(n,"(",Sf),pf(n,"}",Ef),pf(n,"]",Of),pf(n,">",Cf),pf(n,")",Af),pf(n,"&",Nf),pf(n,"*",Mf),pf(n,"@",If),pf(n,"`",Df),pf(n,"^",Lf),pf(n,":",Rf),pf(n,",",Pf),pf(n,"$",jf),pf(n,".",zf),pf(n,"=",Ff),pf(n,"!",Hf),pf(n,"-",Vf),pf(n,"%",Bf),pf(n,"|",Wf),pf(n,"+",Uf),pf(n,"#",qf),pf(n,"?",Kf),pf(n,'"',Jf),pf(n,"/",Yf),pf(n,";",Gf),pf(n,"~",Xf),pf(n,"_",Zf),pf(n,"\\",$f);const r=cf(n,ih,_f,{[Yd]:!0});cf(r,ih,r);const o=cf(n,nh,df,{[Xd]:!0});cf(o,nh,o);const i=cf(n,rh,ff,{[Zd]:!0});cf(i,nh),cf(i,rh,i);const s=cf(n,sh,"WS",{[rf]:!0});pf(n,"\n",bf,{[rf]:!0}),pf(s,"\n"),cf(s,sh,s);const a=cf(n,oh,Qf,{[nf]:!0});cf(a,oh,a),pf(a,"️",a);const l=pf(a,"‍");cf(l,oh,a);const c=[[nh,o]],u=[[nh,null],[rh,i]];for(let t=0;t<ah.length;t++)ch(n,ah[t],mf,df,c);for(let t=0;t<lh.length;t++)ch(n,lh[t],gf,ff,u);sf(mf,{tld:!0,ascii:!0},e),sf(gf,{utld:!0,alpha:!0},e),ch(n,"file",vf,df,c),ch(n,"mailto",vf,df,c),ch(n,"http",yf,df,c),ch(n,"https",yf,df,c),ch(n,"ftp",yf,df,c),ch(n,"ftps",yf,df,c),sf(vf,{scheme:!0,ascii:!0},e),sf(yf,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let e=0;e<t.length;e++){const r=t[e][0],o=t[e][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?o[ef]=!0:nh.test(r)?ih.test(r)?o[Qd]=!0:o[Xd]=!0:o[Yd]=!0,uf(n,r,r,o)}return uf(n,"localhost",hf,{ascii:!0}),n.jd=new af(th),{start:n,tokens:Gd({groups:e},eh)}}(xh.customSchemes);for(let t=0;t<xh.tokenQueue.length;t++)xh.tokenQueue[t][1]({scanner:xh.scanner});xh.parser=function(t){let{groups:e}=t;const n=e.domain.concat([Nf,Mf,If,$f,Df,Lf,jf,Ff,Vf,_f,Bf,Wf,Uf,qf,Yf,th,Xf,Zf]),r=[Tf,Cf,Ef,Of,Af,Rf,Pf,zf,Hf,xf,wf,kf,Sf,Kf,Jf,Gf],o=[Nf,Tf,Mf,$f,Df,Lf,Ef,jf,Ff,Vf,wf,Bf,Wf,Uf,qf,Kf,Yf,th,Xf,Zf],i=bh(),s=pf(i,Xf);lf(s,o,s),lf(s,e.domain,s);const a=bh(),l=bh(),c=bh();lf(i,e.domain,a),lf(i,e.scheme,l),lf(i,e.slashscheme,c),lf(a,o,s),lf(a,e.domain,a);const u=pf(a,If);pf(s,If,u),pf(l,If,u),pf(c,If,u);const p=pf(s,zf);lf(p,o,s),lf(p,e.domain,s);const d=bh();lf(u,e.domain,d),lf(d,e.domain,d);const f=pf(d,zf);lf(f,e.domain,d);const h=bh(gh);lf(f,e.tld,h),lf(f,e.utld,h),pf(u,hf,h);const m=pf(d,Vf);lf(m,e.domain,d),lf(h,e.domain,d),pf(h,zf,f),pf(h,Vf,m);const g=pf(h,Rf);lf(g,e.numeric,gh);const v=pf(a,Vf),y=pf(a,zf);lf(v,e.domain,a),lf(y,o,s),lf(y,e.domain,a);const _=bh(_h);lf(y,e.tld,_),lf(y,e.utld,_),lf(_,e.domain,a),lf(_,o,s),pf(_,zf,y),pf(_,Vf,v),pf(_,If,u);const b=pf(_,Rf),w=bh(_h);lf(b,e.numeric,w);const k=bh(_h),x=bh();lf(k,n,k),lf(k,r,x),lf(x,n,k),lf(x,r,x),pf(_,Yf,k),pf(w,Yf,k);const S=pf(l,Rf),E=pf(c,Rf),O=pf(E,Yf),C=pf(O,Yf);lf(l,e.domain,a),pf(l,zf,y),pf(l,Vf,v),lf(c,e.domain,a),pf(c,zf,y),pf(c,Vf,v),lf(S,e.domain,k),pf(S,Yf,k),lf(C,e.domain,k),lf(C,n,k),pf(C,Yf,k);const A=pf(k,wf),N=pf(k,kf),T=pf(k,xf),M=pf(k,Sf);pf(x,wf,A),pf(x,kf,N),pf(x,xf,T),pf(x,Sf,M),pf(A,Ef,k),pf(N,Of,k),pf(T,Cf,k),pf(M,Af,k),pf(A,Ef,k);const I=bh(_h),$=bh(_h),D=bh(_h),L=bh(_h);lf(A,n,I),lf(N,n,$),lf(T,n,D),lf(M,n,L);const R=bh(),P=bh(),j=bh(),z=bh();return lf(A,r),lf(N,r),lf(T,r),lf(M,r),lf(I,n,I),lf($,n,$),lf(D,n,D),lf(L,n,L),lf(I,r,I),lf($,r,$),lf(D,r,D),lf(L,r,L),lf(R,n,R),lf(P,n,$),lf(j,n,D),lf(z,n,L),lf(R,r,R),lf(P,r,P),lf(j,r,j),lf(z,r,z),pf($,Of,k),pf(D,Cf,k),pf(L,Af,k),pf(I,Ef,k),pf(P,Of,k),pf(j,Cf,k),pf(z,Af,k),pf(R,Af,k),pf(i,hf,_),pf(i,bf,yh),{start:i,tokens:eh}}(xh.scanner.tokens);for(let t=0;t<xh.pluginQueue.length;t++)xh.pluginQueue[t][1]({scanner:xh.scanner,parser:xh.parser});xh.initialized=!0}function Oh(t){return xh.initialized||Eh(),function(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,p=null,d=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(d=0,p=a):d>=0&&d++,o++,u++;if(d<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(wh(vh,e,s)),s=[]),o-=d,u-=d;const t=p.t,r=n.slice(o-u,o);i.push(wh(t,e,r))}}return s.length>0&&i.push(wh(vh,e,s)),i}(xh.parser.start,t,function(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let o,i=t.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,p=-1,d=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,d=0,u=a):p>=0&&(p+=n[s].length,d++),c+=n[s].length,i+=n[s].length,s++;i-=p,s-=d,c-=p,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}(xh.scanner.start,t))}function Ch(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new dh(n),o=Oh(t),i=[];for(let t=0;t<o.length;t++){const n=o[t];!n.isLink||e&&n.t!==e||i.push(n.toFormattedObject(r))}return i}function Ah(t,e){void 0===e&&(e=null);const n=Oh(t);return 1===n.length&&n[0].isLink&&(!e||n[0].t===e)}class Nh extends qd{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(t,e,n){if(t.state.selection.empty)return!1;const r=n.content.textBetween(0,n.content.size).trim(),o=Ah(r);if(!r||!o)return!1;const i=this._createLinkAttrs(r,n.content);return this.editor.commands.applyLink(i),!0}_createLinkAttrs(t,e){return Ym.query(e,{typeName:Fd.TEXT,mark:{typeName:Vd.LINK},getMark:{typeName:Vd.LINK}})?.attrs||{href:t}}}function Th(t){return(...e)=>n=>t(n,...e)}function Mh(t){const e=Object.entries(t).reduce(((t,[e,n])=>{if(!n)return t;return`${t}--zw-${e.replace(/_/g,"-")}:${n};`}),"");return e?{style:e}:null}function Ih(t){const e=Mh(t);return["span",e?{...e,class:"zw-style"}:{},0]}function $h(t,...e){return({editor:n})=>(n.commands[t](...e),!0)}var Dh=Object.defineProperty,Lh=(t,e,n)=>(((t,e,n)=>{e in t?Dh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);const Rh=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}),Ph="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",jh=`[\\s|\\(]+(${Ph})[,|\\s]+(${Ph})[,|\\s]+(${Ph})\\s*\\)?`,zh=`[\\s|\\(]+(${Ph})[,|\\s]+(${Ph})[,|\\s]+(${Ph})[,|\\s]+(${Ph})\\s*\\)?`,Fh=Object.freeze({CSS_UNIT:new RegExp(Ph),RGB:new RegExp(`rgb${jh}`),RGBA:new RegExp(`rgba${zh}`),HSL:new RegExp(`hsl${jh}`),HSLA:new RegExp(`hsla${zh}`),HSV:new RegExp(`hsv${jh}`),HSVA:new RegExp(`hsva${zh}`),HEX3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,HEX4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HEX8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}),Hh=Object.freeze({WINDOW:Symbol("window")});function Vh(t,e){let n=!1;return function(){n||(t.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),e))}}function Bh(t){return t>1||t<-1?t/100:t}const Wh=t=>Number.parseFloat(t.toFixed(5).substr(0,5));function Uh(t){const e=function(t,e=1){const n=[];let r=0;for(;r<t.length;)n.push(t.substr(r,e)),r+=e;return n}(t.slice(1),2).map((t=>parseInt(t,16))),n=void 0!==e[3]?Math.round(e[3]/255*100)/100:1;return{r:e[0],g:e[1],b:e[2],a:n}}function qh(t){const{h:e,s:n,v:r,a:o}=t,i=t=>{const o=(t+e/60)%6;return r-r*n*Math.max(Math.min(o,4-o,1),0)},s=[i(5),i(3),i(1)].map((t=>Math.round(255*t)));return{r:s[0],g:s[1],b:s[2],a:o}}function Kh(t){if(!t)return{h:0,s:1,v:1,a:1};const e=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(e,n,r),i=Math.min(e,n,r);let s=0;o!==i&&(o===e?s=60*(0+(n-r)/(o-i)):o===n?s=60*(2+(r-e)/(o-i)):o===r&&(s=60*(4+(e-n)/(o-i)))),s<0&&(s+=360);const a=[s,0===o?0:(o-i)/o,o],l=Wh(a[1]),c=Wh(a[2]);return{h:Math.floor(a[0]),s:l,v:c,a:t.a}}function Jh(t){const e=Kh(Uh(t));const n=function(t){const{h:e,s:n,v:r,a:o}=t,i=r-r*n/2,s=1===i||0===i?0:(r-i)/Math.min(i,1-i);return{h:e,s:Wh(s),l:Wh(i),a:o}}(e),r=Uh(t);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:n,hsva:e,hue:e.h,rgba:r}}function Gh(t,e,n="0"){return t+n.repeat(Math.max(0,e-t.length))}function Yh(t){return Jh(function(t){let e=t;return e.startsWith("#")&&(e=e.slice(1)),e=e.replace(/([^0-9a-f])/gi,"F"),3!==e.length&&4!==e.length||(e=e.split("").map((t=>t+t)).join("")),e=6===e.length?Gh(e,8,"F"):Gh(Gh(e,6),8,"F"),`#${e}`.toUpperCase().substr(0,9)}(t))}const Xh=class{static create(t){if(!t)return Xh.fromBlack();let e=t.replace(/^\s+/,"").replace(/\s+$/,"").toLowerCase();if(Rh[e])e=Rh[e];else if(e===this.TRANSPARENT)return Xh.fromTransparent();const n=Fh.RGB.exec(e)||Fh.RGBA.exec(e);if(n){const t=void 0===n[4]?1:n[4];return Xh.fromRgba({r:Number.parseInt(n[1]),g:Number.parseInt(n[2]),b:Number.parseInt(n[3]),a:Number.parseFloat(t)})}const r=Fh.HSL.exec(e)||Fh.HSLA.exec(e);if(r){const t=void 0===r[4]?1:r[4];return Xh.fromHsla({h:Number.parseInt(r[1]),s:Number.parseFloat(r[2]),l:Number.parseFloat(r[3]),a:Number.parseFloat(t)})}const o=Fh.HSV.exec(e)||Fh.HSVA.exec(e);if(o){const t=void 0===o[4]?1:o[4];return Xh.fromHsva({h:Number.parseInt(o[1]),s:Number.parseFloat(o[2]),v:Number.parseFloat(o[3]),a:Number.parseFloat(t)})}return Fh.HEX8.exec(e)||Fh.HEX6.exec(e)||Fh.HEX4.exec(e)||Fh.HEX3.exec(e)?Xh.fromHex(e):Xh.fromBlack()}static fromHex(t){const{rgba:e}=Yh(t);return new Xh(e)}static fromRgba({r:t,g:e,b:n,a:r}){const o=Bh(r);return new Xh({r:t,g:e,b:n,a:o})}static fromHsla({h:t,s:e,l:n,a:r}){const o=Bh(e),i=Bh(n),s=Bh(r);return Xh.fromHsva(function(t){const{h:e,s:n,l:r,a:o}=t,i=r+n*Math.min(r,1-r);return{h:e,s:Wh(0===i?0:2-2*r/i),v:Wh(i),a:o}}({h:t,s:o,l:i,a:s}))}static fromHsva({h:t,s:e,v:n,a:r}){const o=qh({h:t,s:Bh(e),v:Bh(n),a:Bh(r)});return new Xh(o)}static fromTransparent(){return new Xh({r:0,g:0,b:0,a:0})}static fromWhite(){return new Xh({r:255,g:255,b:255,a:1})}static fromBlack(){return new Xh({r:0,g:0,b:0,a:1})}static isTransparent(t){return Xh.create(t).isTransparent()}static isDark(t){return Xh.create(t).isDark()}constructor(t){this._rgba=t,this._hsva=this._calcHsva(),this._alpha=t.a}get hex(){return this.toHexString()}get r(){return this._rgba.r}get b(){return this._rgba.b}get g(){return this._rgba.g}get h(){return this._hsva.h}get s(){return this._hsva.s}get v(){return this._hsva.v}get alpha(){return this._alpha}setAlpha(t){return this._alpha=t,this}toHexString(){return function(t){const e=t=>{const e=Math.round(t).toString(16);return("00".substr(0,2-e.length)+e).toUpperCase()};return`#${[e(t.r),e(t.g),e(t.b)].join("")}`}({r:this.r,g:this.g,b:this.b,a:this.alpha})}toRgbaString(){const t=`${Math.floor(100*this.alpha)}%`;return`rgba(${[this.r,this.g,this.b,t].join(", ")})`}get rgba(){return this._rgba}updateRgb(t){this._rgba={...this._rgba,...t},this._hsva=this._calcHsva()}get hsva(){return this._hsva}updateHsv(t){this._hsva={...this._hsva,...t},this._rgba=this._calcRgba()}isTransparent(){return 0===this.alpha}isDark(){return this.getBrightness()<128}getBrightness(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3}_calcHsva(){return Kh(this.rgba)}_calcRgba(){return qh(this.hsva)}};let Zh=Xh;Lh(Zh,"TRANSPARENT","transparent"),Lh(Zh,"NONE","none"),Hh.WINDOW;function Qh(t){const e=Zh.create(t);return 1===e.alpha?e.toHexString():e.toRgbaString()}function tm(t,e){if(!t.includes("em"))return parseInt(t);const n=qm.getComputedStyle(e).fontSize,r=parseFloat(t)*parseFloat(n);return Math.round(r)}function em(t,e,n){if(!t.includes("px"))return t;const r=function(t,e){return(t.firstElementChild||t).style.fontSize||qm.getComputedStyle(e).fontSize}(e,n),o=tm(r,n);return o?(parseInt(t)/o).toFixed(2):null}Hh.WINDOW,Hh.WINDOW,Vh(((t,e)=>{t(e)}),20);const nm={start:zd.LEFT,end:zd.RIGHT};const rm=(t,e,n,r)=>({from:Math.max(r,t.pos),to:Math.min(r+n.nodeSize,e.pos)});function om(t,e){return t.resolve(e).depth+1}const im=(t,e)=>t.eq(e);var sm,am,lm={};function cm(t){return t.type.create(lm.cloneDeep(t.attrs))}
7
7
  /**
8
8
  * @license
9
9
  * Lodash <https://lodash.com/>
@@ -12,4 +12,4 @@
12
12
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13
13
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
14
14
  */
15
- sm={get exports(){return lm},set exports(t){lm=t}},am=lm,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",o=16,i=32,a=64,l=128,c=256,u=1/0,p=9007199254740991,d=NaN,f=4294967295,h=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",i],["partialRight",a],["rearg",c]],m="[object Arguments]",g="[object Array]",v="[object Boolean]",y="[object Date]",_="[object Error]",b="[object Function]",w="[object GeneratorFunction]",k="[object Map]",x="[object Number]",S="[object Object]",E="[object Promise]",O="[object RegExp]",C="[object Set]",A="[object String]",N="[object Symbol]",T="[object WeakMap]",M="[object ArrayBuffer]",I="[object DataView]",$="[object Float32Array]",D="[object Float64Array]",L="[object Int8Array]",R="[object Int16Array]",P="[object Int32Array]",j="[object Uint8Array]",z="[object Uint8ClampedArray]",F="[object Uint16Array]",H="[object Uint32Array]",V=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,K=RegExp(U.source),J=RegExp(q.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ut=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,ft=/^[-+]0x[0-9a-f]+$/i,ht=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_t=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="['’]",Nt="["+wt+"]",Tt="["+Ct+"]",Mt="["+kt+"]",It="\\d+",$t="["+xt+"]",Dt="["+St+"]",Lt="[^"+wt+Ct+It+xt+St+Et+"]",Rt="\\ud83c[\\udffb-\\udfff]",Pt="[^"+wt+"]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",zt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Et+"]",Ht="\\u200d",Vt="(?:"+Dt+"|"+Lt+")",Bt="(?:"+Ft+"|"+Lt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",qt="(?:"+Mt+"|"+Rt+")?",Kt="["+Ot+"]?",Jt=Kt+qt+"(?:"+Ht+"(?:"+[Pt,jt,zt].join("|")+")"+Kt+qt+")*",Gt="(?:"+[$t,jt,zt].join("|")+")"+Jt,Yt="(?:"+[Pt+Mt+"?",Mt,jt,zt,Nt].join("|")+")",Xt=RegExp(At,"g"),Zt=RegExp(Mt,"g"),Qt=RegExp(Rt+"(?="+Rt+")|"+Yt+Jt,"g"),te=RegExp([Ft+"?"+Dt+"+"+Wt+"(?="+[Tt,Ft,"$"].join("|")+")",Bt+"+"+Ut+"(?="+[Tt,Ft+Vt,"$"].join("|")+")",Ft+"?"+Vt+"+"+Wt,Ft+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It,Gt].join("|"),"g"),ee=RegExp("["+Ht+wt+kt+Ot+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ie={};ie[$]=ie[D]=ie[L]=ie[R]=ie[P]=ie[j]=ie[z]=ie[F]=ie[H]=!0,ie[m]=ie[g]=ie[M]=ie[v]=ie[I]=ie[y]=ie[_]=ie[b]=ie[k]=ie[x]=ie[S]=ie[O]=ie[C]=ie[A]=ie[T]=!1;var se={};se[m]=se[g]=se[M]=se[I]=se[v]=se[y]=se[$]=se[D]=se[L]=se[R]=se[P]=se[k]=se[x]=se[S]=se[O]=se[C]=se[A]=se[N]=se[j]=se[z]=se[F]=se[H]=!0,se[_]=se[b]=se[T]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,ue="object"==typeof s&&s&&s.Object===Object&&s,pe="object"==typeof self&&self&&self.Object===Object&&self,de=ue||pe||Function("return this")(),fe=am&&!am.nodeType&&am,he=fe&&sm&&!sm.nodeType&&sm,me=he&&he.exports===fe,ge=me&&ue.process,ve=function(){try{var t=he&&he.require&&he.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=ve&&ve.isArrayBuffer,_e=ve&&ve.isDate,be=ve&&ve.isMap,we=ve&&ve.isRegExp,ke=ve&&ve.isSet,xe=ve&&ve.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(r,s,n(s),t)}return r}function Oe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ce(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ne(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function Te(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function Me(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Ie(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function $e(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function De(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function Le(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function Re(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Pe=We("length");function je(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function ze(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Fe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):ze(t,Ve,n)}function He(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Ve(t){return t!=t}function Be(t,e){var n=null==t?0:t.length;return n?Ke(t,e)/n:d}function We(e){return function(n){return null==n?t:n[e]}}function Ue(e){return function(n){return null==e?t:e[n]}}function qe(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Ke(e,n){for(var r,o=-1,i=e.length;++o<i;){var s=n(e[o]);s!==t&&(r=r===t?s:r+s)}return r}function Je(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function Ye(t){return function(e){return t(e)}}function Xe(t,e){return Ie(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function Qe(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var nn=Ue({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rn=Ue({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(t){return"\\"+ae[t]}function sn(t){return ee.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function ln(t,e){return function(n){return t(e(n))}}function cn(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==r||(t[n]=r,s[i++]=n)}return s}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function pn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function dn(t){return sn(t)?function(t){for(var e=Qt.lastIndex=0;Qt.test(t);)++e;return e}(t):Pe(t)}function fn(t){return sn(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var mn=Ue({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),gn=function s(ot){var wt=(ot=null==ot?de:gn.defaults(de.Object(),ot,gn.pick(de,re))).Array,kt=ot.Date,xt=ot.Error,St=ot.Function,Et=ot.Math,Ot=ot.Object,Ct=ot.RegExp,At=ot.String,Nt=ot.TypeError,Tt=wt.prototype,Mt=St.prototype,It=Ot.prototype,$t=ot["__core-js_shared__"],Dt=Mt.toString,Lt=It.hasOwnProperty,Rt=0,Pt=function(){var t=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),jt=It.toString,zt=Dt.call(Ot),Ft=de._,Ht=Ct("^"+Dt.call(Lt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=me?ot.Buffer:t,Bt=ot.Symbol,Wt=ot.Uint8Array,Ut=Vt?Vt.allocUnsafe:t,qt=ln(Ot.getPrototypeOf,Ot),Kt=Ot.create,Jt=It.propertyIsEnumerable,Gt=Tt.splice,Yt=Bt?Bt.isConcatSpreadable:t,Qt=Bt?Bt.iterator:t,ee=Bt?Bt.toStringTag:t,ae=function(){try{var t=fi(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=ot.clearTimeout!==de.clearTimeout&&ot.clearTimeout,pe=kt&&kt.now!==de.Date.now&&kt.now,fe=ot.setTimeout!==de.setTimeout&&ot.setTimeout,he=Et.ceil,ge=Et.floor,ve=Ot.getOwnPropertySymbols,Pe=Vt?Vt.isBuffer:t,Ue=ot.isFinite,vn=Tt.join,yn=ln(Ot.keys,Ot),_n=Et.max,bn=Et.min,wn=kt.now,kn=ot.parseInt,xn=Et.random,Sn=Tt.reverse,En=fi(ot,"DataView"),On=fi(ot,"Map"),Cn=fi(ot,"Promise"),An=fi(ot,"Set"),Nn=fi(ot,"WeakMap"),Tn=fi(Ot,"create"),Mn=Nn&&new Nn,In={},$n=Fi(En),Dn=Fi(On),Ln=Fi(Cn),Rn=Fi(An),Pn=Fi(Nn),jn=Bt?Bt.prototype:t,zn=jn?jn.valueOf:t,Fn=jn?jn.toString:t;function Hn(t){if(ra(t)&&!qs(t)&&!(t instanceof Un)){if(t instanceof Wn)return t;if(Lt.call(t,"__wrapped__"))return Hi(t)}return new Wn(t)}var Vn=function(){function e(){}return function(n){if(!na(n))return{};if(Kt)return Kt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Bn(){}function Wn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Kn(t);this.size=e.size}function Xn(t,e){var n=qs(t),r=!n&&Us(t),o=!n&&!r&&Ys(t),i=!n&&!r&&!o&&pa(t),s=n||r||o||i,a=s?Je(t.length,At):[],l=a.length;for(var c in t)!e&&!Lt.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||bi(c,l))||a.push(c);return a}function Zn(e){var n=e.length;return n?e[Gr(0,n-1)]:t}function Qn(t,e){return Pi(Mo(t),lr(e,0,t.length))}function tr(t){return Pi(Mo(t))}function er(e,n,r){(r!==t&&!Vs(e[n],r)||r===t&&!(n in e))&&sr(e,n,r)}function nr(e,n,r){var o=e[n];Lt.call(e,n)&&Vs(o,r)&&(r!==t||n in e)||sr(e,n,r)}function rr(t,e){for(var n=t.length;n--;)if(Vs(t[n][0],e))return n;return-1}function or(t,e,n,r){return fr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function ir(t,e){return t&&Io(e,$a(e),t)}function sr(t,e,n){"__proto__"==e&&ae?ae(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(e,n){for(var r=-1,o=n.length,i=wt(o),s=null==e;++r<o;)i[r]=s?t:Aa(e,n[r]);return i}function lr(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function cr(e,n,r,o,i,s){var a,l=1&n,c=2&n,u=4&n;if(r&&(a=i?r(e,o,i,s):r(e)),a!==t)return a;if(!na(e))return e;var p=qs(e);if(p){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return Mo(e,a)}else{var d=gi(e),f=d==b||d==w;if(Ys(e))return Eo(e,l);if(d==S||d==m||f&&!i){if(a=c||f?{}:yi(e),!l)return c?function(t,e){return Io(t,mi(t),e)}(e,function(t,e){return t&&Io(e,Da(e),t)}(a,e)):function(t,e){return Io(t,hi(t),e)}(e,ir(a,e))}else{if(!se[d])return i?e:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case M:return Oo(t);case v:case y:return new o(+t);case I:return function(t,e){var n=e?Oo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case $:case D:case L:case R:case P:case j:case z:case F:case H:return Co(t,n);case k:return new o;case x:case A:return new o(t);case O:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new o;case N:return r=t,zn?Ot(zn.call(r)):{}}}(e,d,l)}}s||(s=new Yn);var h=s.get(e);if(h)return h;s.set(e,a),la(e)?e.forEach((function(t){a.add(cr(t,n,r,t,e,s))})):oa(e)&&e.forEach((function(t,o){a.set(o,cr(t,n,r,o,e,s))}));var g=p?t:(u?c?si:ii:c?Da:$a)(e);return Oe(g||e,(function(t,o){g&&(t=e[o=t]),nr(a,o,cr(t,n,r,o,e,s))})),a}function ur(e,n,r){var o=r.length;if(null==e)return!o;for(e=Ot(e);o--;){var i=r[o],s=n[i],a=e[i];if(a===t&&!(i in e)||!s(a))return!1}return!0}function pr(n,r,o){if("function"!=typeof n)throw new Nt(e);return $i((function(){n.apply(t,o)}),r)}function dr(t,e,n,r){var o=-1,i=Te,s=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=Ie(e,Ye(n))),r?(i=Me,s=!1):e.length>=200&&(i=Ze,s=!1,e=new Gn(e));t:for(;++o<a;){var u=t[o],p=null==n?u:n(u);if(u=r||0!==u?u:0,s&&p==p){for(var d=c;d--;)if(e[d]===p)continue t;l.push(u)}else i(e,p,r)||l.push(u)}return l}Hn.templateSettings={escape:G,evaluate:Y,interpolate:X,variable:"",imports:{_:Hn}},Hn.prototype=Bn.prototype,Hn.prototype.constructor=Hn,Wn.prototype=Vn(Bn.prototype),Wn.prototype.constructor=Wn,Un.prototype=Vn(Bn.prototype),Un.prototype.constructor=Un,qn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(e){var r=this.__data__;if(Tn){var o=r[e];return o===n?t:o}return Lt.call(r,e)?r[e]:t},qn.prototype.has=function(e){var n=this.__data__;return Tn?n[e]!==t:Lt.call(n,e)},qn.prototype.set=function(e,r){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Tn&&r===t?n:r,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0||(n==e.length-1?e.pop():Gt.call(e,n,1),--this.size,0))},Kn.prototype.get=function(e){var n=this.__data__,r=rr(n,e);return r<0?t:n[r][1]},Kn.prototype.has=function(t){return rr(this.__data__,t)>-1},Kn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(On||Kn),string:new qn}},Jn.prototype.delete=function(t){var e=pi(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return pi(this,t).get(t)},Jn.prototype.has=function(t){return pi(this,t).has(t)},Jn.prototype.set=function(t,e){var n=pi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,n),this},Gn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Kn){var r=n.__data__;if(!On||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var fr=Lo(wr),hr=Lo(kr,!0);function mr(t,e){var n=!0;return fr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function gr(e,n,r){for(var o=-1,i=e.length;++o<i;){var s=e[o],a=n(s);if(null!=a&&(l===t?a==a&&!ua(a):r(a,l)))var l=a,c=s}return c}function vr(t,e){var n=[];return fr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function yr(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=_i),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?yr(a,e-1,n,r,o):$e(o,a):r||(o[o.length]=a)}return o}var _r=Ro(),br=Ro(!0);function wr(t,e){return t&&_r(t,e,$a)}function kr(t,e){return t&&br(t,e,$a)}function xr(t,e){return Ne(e,(function(e){return Qs(t[e])}))}function Sr(e,n){for(var r=0,o=(n=wo(n,e)).length;null!=e&&r<o;)e=e[zi(n[r++])];return r&&r==o?e:t}function Er(t,e,n){var r=e(t);return qs(t)?r:$e(r,n(t))}function Or(e){return null==e?e===t?"[object Undefined]":"[object Null]":ee&&ee in Ot(e)?function(e){var n=Lt.call(e,ee),r=e[ee];try{e[ee]=t;var o=!0}catch(t){}var i=jt.call(e);return o&&(n?e[ee]=r:delete e[ee]),i}(e):function(t){return jt.call(t)}(e)}function Cr(t,e){return t>e}function Ar(t,e){return null!=t&&Lt.call(t,e)}function Nr(t,e){return null!=t&&e in Ot(t)}function Tr(e,n,r){for(var o=r?Me:Te,i=e[0].length,s=e.length,a=s,l=wt(s),c=1/0,u=[];a--;){var p=e[a];a&&n&&(p=Ie(p,Ye(n))),c=bn(p.length,c),l[a]=!r&&(n||i>=120&&p.length>=120)?new Gn(a&&p):t}p=e[0];var d=-1,f=l[0];t:for(;++d<i&&u.length<c;){var h=p[d],m=n?n(h):h;if(h=r||0!==h?h:0,!(f?Ze(f,m):o(u,m,r))){for(a=s;--a;){var g=l[a];if(!(g?Ze(g,m):o(e[a],m,r)))continue t}f&&f.push(m),u.push(h)}}return u}function Mr(e,n,r){var o=null==(e=Ni(e,n=wo(n,e)))?e:e[zi(Zi(n))];return null==o?t:Se(o,e,r)}function Ir(t){return ra(t)&&Or(t)==m}function $r(e,n,r,o,i){return e===n||(null==e||null==n||!ra(e)&&!ra(n)?e!=e&&n!=n:function(e,n,r,o,i,s){var a=qs(e),l=qs(n),c=a?g:gi(e),u=l?g:gi(n),p=(c=c==m?S:c)==S,d=(u=u==m?S:u)==S,f=c==u;if(f&&Ys(e)){if(!Ys(n))return!1;a=!0,p=!1}if(f&&!p)return s||(s=new Yn),a||pa(e)?ri(e,n,r,o,i,s):function(t,e,n,r,o,i,s){switch(n){case I:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case M:return!(t.byteLength!=e.byteLength||!i(new Wt(t),new Wt(e)));case v:case y:case x:return Vs(+t,+e);case _:return t.name==e.name&&t.message==e.message;case O:case A:return t==e+"";case k:var a=an;case C:var l=1&r;if(a||(a=un),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var u=ri(a(t),a(e),r,o,i,s);return s.delete(t),u;case N:if(zn)return zn.call(t)==zn.call(e)}return!1}(e,n,c,r,o,i,s);if(!(1&r)){var h=p&&Lt.call(e,"__wrapped__"),b=d&&Lt.call(n,"__wrapped__");if(h||b){var w=h?e.value():e,E=b?n.value():n;return s||(s=new Yn),i(w,E,r,o,s)}}return!!f&&(s||(s=new Yn),function(e,n,r,o,i,s){var a=1&r,l=ii(e),c=l.length,u=ii(n),p=u.length;if(c!=p&&!a)return!1;for(var d=c;d--;){var f=l[d];if(!(a?f in n:Lt.call(n,f)))return!1}var h=s.get(e),m=s.get(n);if(h&&m)return h==n&&m==e;var g=!0;s.set(e,n),s.set(n,e);for(var v=a;++d<c;){var y=e[f=l[d]],_=n[f];if(o)var b=a?o(_,y,f,n,e,s):o(y,_,f,e,n,s);if(!(b===t?y===_||i(y,_,r,o,s):b)){g=!1;break}v||(v="constructor"==f)}if(g&&!v){var w=e.constructor,k=n.constructor;w==k||!("constructor"in e)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof k&&k instanceof k||(g=!1)}return s.delete(e),s.delete(n),g}(e,n,r,o,i,s))}(e,n,r,o,$r,i))}function Dr(e,n,r,o){var i=r.length,s=i,a=!o;if(null==e)return!s;for(e=Ot(e);i--;){var l=r[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){var c=(l=r[i])[0],u=e[c],p=l[1];if(a&&l[2]){if(u===t&&!(c in e))return!1}else{var d=new Yn;if(o)var f=o(u,p,c,e,n,d);if(!(f===t?$r(p,u,3,o,d):f))return!1}}return!0}function Lr(t){return!(!na(t)||(e=t,Pt&&Pt in e))&&(Qs(t)?Ht:mt).test(Fi(t));var e}function Rr(t){return"function"==typeof t?t:null==t?il:"object"==typeof t?qs(t)?Vr(t[0],t[1]):Hr(t):hl(t)}function Pr(t){if(!Ei(t))return yn(t);var e=[];for(var n in Ot(t))Lt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function jr(t){if(!na(t))return function(t){var e=[];if(null!=t)for(var n in Ot(t))e.push(n);return e}(t);var e=Ei(t),n=[];for(var r in t)("constructor"!=r||!e&&Lt.call(t,r))&&n.push(r);return n}function zr(t,e){return t<e}function Fr(t,e){var n=-1,r=Js(t)?wt(t.length):[];return fr(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function Hr(t){var e=di(t);return 1==e.length&&e[0][2]?Ci(e[0][0],e[0][1]):function(n){return n===t||Dr(n,t,e)}}function Vr(e,n){return ki(e)&&Oi(n)?Ci(zi(e),n):function(r){var o=Aa(r,e);return o===t&&o===n?Na(r,e):$r(n,o,3)}}function Br(e,n,r,o,i){e!==n&&_r(n,(function(s,a){if(i||(i=new Yn),na(s))!function(e,n,r,o,i,s,a){var l=Mi(e,r),c=Mi(n,r),u=a.get(c);if(u)er(e,r,u);else{var p=s?s(l,c,r+"",e,n,a):t,d=p===t;if(d){var f=qs(c),h=!f&&Ys(c),m=!f&&!h&&pa(c);p=c,f||h||m?qs(l)?p=l:Gs(l)?p=Mo(l):h?(d=!1,p=Eo(c,!0)):m?(d=!1,p=Co(c,!0)):p=[]:sa(c)||Us(c)?(p=l,Us(l)?p=_a(l):na(l)&&!Qs(l)||(p=yi(c))):d=!1}d&&(a.set(c,p),i(p,c,o,s,a),a.delete(c)),er(e,r,p)}}(e,n,a,r,Br,o,i);else{var l=o?o(Mi(e,a),s,a+"",e,n,i):t;l===t&&(l=s),er(e,a,l)}}),Da)}function Wr(e,n){var r=e.length;if(r)return bi(n+=n<0?r:0,r)?e[n]:t}function Ur(t,e,n){e=e.length?Ie(e,(function(t){return qs(t)?function(e){return Sr(e,1===t.length?t[0]:t)}:t})):[il];var r=-1;e=Ie(e,Ye(ui()));var o=Fr(t,(function(t,n,o){var i=Ie(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,s=o.length,a=n.length;++r<s;){var l=Ao(o[r],i[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Sr(t,s);n(a,s)&&to(i,wo(s,t),a)}return i}function Kr(t,e,n,r){var o=r?He:Fe,i=-1,s=e.length,a=t;for(t===e&&(e=Mo(e)),n&&(a=Ie(t,Ye(n)));++i<s;)for(var l=0,c=e[i],u=n?n(c):c;(l=o(a,u,l,r))>-1;)a!==t&&Gt.call(a,l,1),Gt.call(t,l,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;bi(o)?Gt.call(t,o,1):fo(t,o)}}return t}function Gr(t,e){return t+ge(xn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>p)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Di(Ai(t,e,il),t+"")}function Zr(t){return Zn(Va(t))}function Qr(t,e){var n=Va(t);return Pi(n,lr(e,0,n.length))}function to(e,n,r,o){if(!na(e))return e;for(var i=-1,s=(n=wo(n,e)).length,a=s-1,l=e;null!=l&&++i<s;){var c=zi(n[i]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var p=l[c];(u=o?o(p,c,l):t)===t&&(u=na(p)?p:bi(n[i+1])?[]:{})}nr(l,c,u),l=l[c]}return e}var eo=Mn?function(t,e){return Mn.set(t,e),t}:il,no=ae?function(t,e){return ae(t,"toString",{configurable:!0,enumerable:!1,value:nl(e),writable:!0})}:il;function ro(t){return Pi(Va(t))}function oo(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=wt(o);++r<o;)i[r]=t[r+e];return i}function io(t,e){var n;return fr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function so(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,s=t[i];null!==s&&!ua(s)&&(n?s<=e:s<e)?r=i+1:o=i}return o}return ao(t,e,il,n)}function ao(e,n,r,o){var i=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(n=r(n))!=n,l=null===n,c=ua(n),u=n===t;i<s;){var p=ge((i+s)/2),d=r(e[p]),f=d!==t,h=null===d,m=d==d,g=ua(d);if(a)var v=o||m;else v=u?m&&(o||f):l?m&&f&&(o||!h):c?m&&f&&!h&&(o||!g):!h&&!g&&(o?d<=n:d<n);v?i=p+1:s=p}return bn(s,4294967294)}function lo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Vs(a,l)){var l=a;i[o++]=0===s?0:s}}return i}function co(t){return"number"==typeof t?t:ua(t)?d:+t}function uo(t){if("string"==typeof t)return t;if(qs(t))return Ie(t,uo)+"";if(ua(t))return Fn?Fn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function po(t,e,n){var r=-1,o=Te,i=t.length,s=!0,a=[],l=a;if(n)s=!1,o=Me;else if(i>=200){var c=e?null:Xo(t);if(c)return un(c);s=!1,o=Ze,l=new Gn}else l=e?[]:a;t:for(;++r<i;){var u=t[r],p=e?e(u):u;if(u=n||0!==u?u:0,s&&p==p){for(var d=l.length;d--;)if(l[d]===p)continue t;e&&l.push(p),a.push(u)}else o(l,p,n)||(l!==a&&l.push(p),a.push(u))}return a}function fo(t,e){return null==(t=Ni(t,e=wo(e,t)))||delete t[zi(Zi(e))]}function ho(t,e,n,r){return to(t,e,n(Sr(t,e)),r)}function mo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?oo(t,r?0:i,r?i+1:o):oo(t,r?i+1:0,r?o:i)}function go(t,e){var n=t;return n instanceof Un&&(n=n.value()),De(e,(function(t,e){return e.func.apply(e.thisArg,$e([t],e.args))}),n)}function vo(t,e,n){var r=t.length;if(r<2)return r?po(t[0]):[];for(var o=-1,i=wt(r);++o<r;)for(var s=t[o],a=-1;++a<r;)a!=o&&(i[o]=dr(i[o]||s,t[a],e,n));return po(yr(i,1),e,n)}function yo(e,n,r){for(var o=-1,i=e.length,s=n.length,a={};++o<i;){var l=o<s?n[o]:t;r(a,e[o],l)}return a}function _o(t){return Gs(t)?t:[]}function bo(t){return"function"==typeof t?t:il}function wo(t,e){return qs(t)?t:ki(t,e)?[t]:ji(ba(t))}var ko=Xr;function xo(e,n,r){var o=e.length;return r=r===t?o:r,!n&&r>=o?e:oo(e,n,r)}var So=ue||function(t){return de.clearTimeout(t)};function Eo(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function Oo(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Co(t,e){var n=e?Oo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ao(e,n){if(e!==n){var r=e!==t,o=null===e,i=e==e,s=ua(e),a=n!==t,l=null===n,c=n==n,u=ua(n);if(!l&&!u&&!s&&e>n||s&&a&&c&&!l&&!u||o&&a&&c||!r&&c||!i)return 1;if(!o&&!s&&!u&&e<n||u&&r&&i&&!o&&!s||l&&r&&i||!a&&i||!c)return-1}return 0}function No(t,e,n,r){for(var o=-1,i=t.length,s=n.length,a=-1,l=e.length,c=_n(i-s,0),u=wt(l+c),p=!r;++a<l;)u[a]=e[a];for(;++o<s;)(p||o<i)&&(u[n[o]]=t[o]);for(;c--;)u[a++]=t[o++];return u}function To(t,e,n,r){for(var o=-1,i=t.length,s=-1,a=n.length,l=-1,c=e.length,u=_n(i-a,0),p=wt(u+c),d=!r;++o<u;)p[o]=t[o];for(var f=o;++l<c;)p[f+l]=e[l];for(;++s<a;)(d||o<i)&&(p[f+n[s]]=t[o++]);return p}function Mo(t,e){var n=-1,r=t.length;for(e||(e=wt(r));++n<r;)e[n]=t[n];return e}function Io(e,n,r,o){var i=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var l=n[s],c=o?o(r[l],e[l],l,r,e):t;c===t&&(c=e[l]),i?sr(r,l,c):nr(r,l,c)}return r}function $o(t,e){return function(n,r){var o=qs(n)?Ee:or,i=e?e():{};return o(n,t,ui(r,2),i)}}function Do(e){return Xr((function(n,r){var o=-1,i=r.length,s=i>1?r[i-1]:t,a=i>2?r[2]:t;for(s=e.length>3&&"function"==typeof s?(i--,s):t,a&&wi(r[0],r[1],a)&&(s=i<3?t:s,i=1),n=Ot(n);++o<i;){var l=r[o];l&&e(n,l,o,s)}return n}))}function Lo(t,e){return function(n,r){if(null==n)return n;if(!Js(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=Ot(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}function Ro(t){return function(e,n,r){for(var o=-1,i=Ot(e),s=r(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===n(i[l],l,i))break}return e}}function Po(e){return function(n){var r=sn(n=ba(n))?fn(n):t,o=r?r[0]:n.charAt(0),i=r?xo(r,1).join(""):n.slice(1);return o[e]()+i}}function jo(t){return function(e){return De(Qa(Ua(e).replace(Xt,"")),t,"")}}function zo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Vn(t.prototype),r=t.apply(n,e);return na(r)?r:n}}function Fo(e){return function(n,r,o){var i=Ot(n);if(!Js(n)){var s=ui(r,3);n=$a(n),r=function(t){return s(i[t],t,i)}}var a=e(n,r,o);return a>-1?i[s?n[a]:a]:t}}function Ho(n){return oi((function(r){var o=r.length,i=o,s=Wn.prototype.thru;for(n&&r.reverse();i--;){var a=r[i];if("function"!=typeof a)throw new Nt(e);if(s&&!l&&"wrapper"==li(a))var l=new Wn([],!0)}for(i=l?i:o;++i<o;){var c=li(a=r[i]),u="wrapper"==c?ai(a):t;l=u&&xi(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[li(u[0])].apply(l,u[3]):1==a.length&&xi(a)?l[c]():l.thru(a)}return function(){var t=arguments,e=t[0];if(l&&1==t.length&&qs(e))return l.plant(e).value();for(var n=0,i=o?r[n].apply(this,t):e;++n<o;)i=r[n].call(this,i);return i}}))}function Vo(e,n,r,o,i,s,a,c,u,p){var d=n&l,f=1&n,h=2&n,m=24&n,g=512&n,v=h?t:zo(e);return function t(){for(var l=arguments.length,y=wt(l),_=l;_--;)y[_]=arguments[_];if(m)var b=ci(t),w=en(y,b);if(o&&(y=No(y,o,i,m)),s&&(y=To(y,s,a,m)),l-=w,m&&l<p){var k=cn(y,b);return Go(e,n,Vo,t.placeholder,r,y,k,c,u,p-l)}var x=f?r:this,S=h?x[e]:e;return l=y.length,c?y=Ti(y,c):g&&l>1&&y.reverse(),d&&u<l&&(y.length=u),this&&this!==de&&this instanceof t&&(S=v||zo(S)),S.apply(x,y)}}function Bo(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function Wo(e,n){return function(r,o){var i;if(r===t&&o===t)return n;if(r!==t&&(i=r),o!==t){if(i===t)return o;"string"==typeof r||"string"==typeof o?(r=uo(r),o=uo(o)):(r=co(r),o=co(o)),i=e(r,o)}return i}}function Uo(t){return oi((function(e){return e=Ie(e,Ye(ui())),Xr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function qo(e,n){var r=(n=n===t?" ":uo(n)).length;if(r<2)return r?Yr(n,e):n;var o=Yr(n,he(e/dn(n)));return sn(n)?xo(fn(o),0,e).join(""):o.slice(0,e)}function Ko(e){return function(n,r,o){return o&&"number"!=typeof o&&wi(n,r,o)&&(r=o=t),n=ma(n),r===t?(r=n,n=0):r=ma(r),function(t,e,n,r){for(var o=-1,i=_n(he((e-t)/(n||1)),0),s=wt(i);i--;)s[r?i:++o]=t,t+=n;return s}(n,r,o=o===t?n<r?1:-1:ma(o),e)}}function Jo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ya(e),n=ya(n)),t(e,n)}}function Go(e,n,r,o,s,l,c,u,p,d){var f=8&n;n|=f?i:a,4&(n&=~(f?a:i))||(n&=-4);var h=[e,n,s,f?l:t,f?c:t,f?t:l,f?t:c,u,p,d],m=r.apply(t,h);return xi(e)&&Ii(m,h),m.placeholder=o,Li(m,e,n)}function Yo(t){var e=Et[t];return function(t,n){if(t=ya(t),(n=null==n?0:bn(ga(n),292))&&Ue(t)){var r=(ba(t)+"e").split("e");return+((r=(ba(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Xo=An&&1/un(new An([,-0]))[1]==u?function(t){return new An(t)}:ul;function Zo(t){return function(e){var n=gi(e);return n==k?an(e):n==C?pn(e):function(t,e){return Ie(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Qo(n,s,u,p,d,f,h,m){var g=2&s;if(!g&&"function"!=typeof n)throw new Nt(e);var v=p?p.length:0;if(v||(s&=-97,p=d=t),h=h===t?h:_n(ga(h),0),m=m===t?m:ga(m),v-=d?d.length:0,s&a){var y=p,_=d;p=d=t}var b=g?t:ai(n),w=[n,s,u,p,d,y,_,f,h,m];if(b&&function(t,e){var n=t[1],o=e[1],i=n|o,s=i<131,a=o==l&&8==n||o==l&&n==c&&t[7].length<=e[8]||384==o&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&o&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var p=t[3];t[3]=p?No(p,u,e[4]):u,t[4]=p?cn(t[3],r):e[4]}(u=e[5])&&(p=t[5],t[5]=p?To(p,u,e[6]):u,t[6]=p?cn(t[5],r):e[6]),(u=e[7])&&(t[7]=u),o&l&&(t[8]=null==t[8]?e[8]:bn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(w,b),n=w[0],s=w[1],u=w[2],p=w[3],d=w[4],!(m=w[9]=w[9]===t?g?0:n.length:_n(w[9]-v,0))&&24&s&&(s&=-25),s&&1!=s)k=8==s||s==o?function(e,n,r){var o=zo(e);return function i(){for(var s=arguments.length,a=wt(s),l=s,c=ci(i);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:cn(a,c);return(s-=u.length)<r?Go(e,n,Vo,i.placeholder,t,a,u,t,t,r-s):Se(this&&this!==de&&this instanceof i?o:e,this,a)}}(n,s,m):s!=i&&33!=s||d.length?Vo.apply(t,w):function(t,e,n,r){var o=1&e,i=zo(t);return function e(){for(var s=-1,a=arguments.length,l=-1,c=r.length,u=wt(c+a),p=this&&this!==de&&this instanceof e?i:t;++l<c;)u[l]=r[l];for(;a--;)u[l++]=arguments[++s];return Se(p,o?n:this,u)}}(n,s,u,p);else var k=function(t,e,n){var r=1&e,o=zo(t);return function e(){return(this&&this!==de&&this instanceof e?o:t).apply(r?n:this,arguments)}}(n,s,u);return Li((b?eo:Ii)(k,w),n,s)}function ti(e,n,r,o){return e===t||Vs(e,It[r])&&!Lt.call(o,r)?n:e}function ei(e,n,r,o,i,s){return na(e)&&na(n)&&(s.set(n,e),Br(e,n,t,ei,s),s.delete(n)),e}function ni(e){return sa(e)?t:e}function ri(e,n,r,o,i,s){var a=1&r,l=e.length,c=n.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),p=s.get(n);if(u&&p)return u==n&&p==e;var d=-1,f=!0,h=2&r?new Gn:t;for(s.set(e,n),s.set(n,e);++d<l;){var m=e[d],g=n[d];if(o)var v=a?o(g,m,d,n,e,s):o(m,g,d,e,n,s);if(v!==t){if(v)continue;f=!1;break}if(h){if(!Re(n,(function(t,e){if(!Ze(h,e)&&(m===t||i(m,t,r,o,s)))return h.push(e)}))){f=!1;break}}else if(m!==g&&!i(m,g,r,o,s)){f=!1;break}}return s.delete(e),s.delete(n),f}function oi(e){return Di(Ai(e,t,Ki),e+"")}function ii(t){return Er(t,$a,hi)}function si(t){return Er(t,Da,mi)}var ai=Mn?function(t){return Mn.get(t)}:ul;function li(t){for(var e=t.name+"",n=In[e],r=Lt.call(In,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ci(t){return(Lt.call(Hn,"placeholder")?Hn:t).placeholder}function ui(){var t=Hn.iteratee||sl;return t=t===sl?Rr:t,arguments.length?t(arguments[0],arguments[1]):t}function pi(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function di(t){for(var e=$a(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Oi(o)]}return e}function fi(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Lr(r)?r:t}var hi=ve?function(t){return null==t?[]:(t=Ot(t),Ne(ve(t),(function(e){return Jt.call(t,e)})))}:vl,mi=ve?function(t){for(var e=[];t;)$e(e,hi(t)),t=qt(t);return e}:vl,gi=Or;function vi(t,e,n){for(var r=-1,o=(e=wo(e,t)).length,i=!1;++r<o;){var s=zi(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ea(o)&&bi(s,o)&&(qs(t)||Us(t))}function yi(t){return"function"!=typeof t.constructor||Ei(t)?{}:Vn(qt(t))}function _i(t){return qs(t)||Us(t)||!!(Yt&&t&&t[Yt])}function bi(t,e){var n=typeof t;return!!(e=null==e?p:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function wi(t,e,n){if(!na(n))return!1;var r=typeof e;return!!("number"==r?Js(n)&&bi(e,n.length):"string"==r&&e in n)&&Vs(n[e],t)}function ki(t,e){if(qs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ua(t))||Q.test(t)||!Z.test(t)||null!=e&&t in Ot(e)}function xi(t){var e=li(t),n=Hn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=ai(n);return!!r&&t===r[0]}(En&&gi(new En(new ArrayBuffer(1)))!=I||On&&gi(new On)!=k||Cn&&gi(Cn.resolve())!=E||An&&gi(new An)!=C||Nn&&gi(new Nn)!=T)&&(gi=function(e){var n=Or(e),r=n==S?e.constructor:t,o=r?Fi(r):"";if(o)switch(o){case $n:return I;case Dn:return k;case Ln:return E;case Rn:return C;case Pn:return T}return n});var Si=$t?Qs:yl;function Ei(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function Oi(t){return t==t&&!na(t)}function Ci(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in Ot(r))}}function Ai(e,n,r){return n=_n(n===t?e.length-1:n,0),function(){for(var t=arguments,o=-1,i=_n(t.length-n,0),s=wt(i);++o<i;)s[o]=t[n+o];o=-1;for(var a=wt(n+1);++o<n;)a[o]=t[o];return a[n]=r(s),Se(e,this,a)}}function Ni(t,e){return e.length<2?t:Sr(t,oo(e,0,-1))}function Ti(e,n){for(var r=e.length,o=bn(n.length,r),i=Mo(e);o--;){var s=n[o];e[o]=bi(s,r)?i[s]:t}return e}function Mi(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ii=Ri(eo),$i=fe||function(t,e){return de.setTimeout(t,e)},Di=Ri(no);function Li(t,e,n){var r=e+"";return Di(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Oe(h,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function Ri(e){var n=0,r=0;return function(){var o=wn(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Pi(e,n){var r=-1,o=e.length,i=o-1;for(n=n===t?o:n;++r<n;){var s=Gr(r,i),a=e[s];e[s]=e[r],e[r]=a}return e.length=n,e}var ji=function(t){var e=Rs(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,o){e.push(r?o.replace(ut,"$1"):n||t)})),e}));function zi(t){if("string"==typeof t||ua(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Fi(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Hi(t){if(t instanceof Un)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=Mo(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Vi=Xr((function(t,e){return Gs(t)?dr(t,yr(e,1,Gs,!0)):[]})),Bi=Xr((function(e,n){var r=Zi(n);return Gs(r)&&(r=t),Gs(e)?dr(e,yr(n,1,Gs,!0),ui(r,2)):[]})),Wi=Xr((function(e,n){var r=Zi(n);return Gs(r)&&(r=t),Gs(e)?dr(e,yr(n,1,Gs,!0),t,r):[]}));function Ui(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=_n(r+o,0)),ze(t,ui(e,3),o)}function qi(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return r!==t&&(i=ga(r),i=r<0?_n(o+i,0):bn(i,o-1)),ze(e,ui(n,3),i,!0)}function Ki(t){return null!=t&&t.length?yr(t,1):[]}function Ji(e){return e&&e.length?e[0]:t}var Gi=Xr((function(t){var e=Ie(t,_o);return e.length&&e[0]===t[0]?Tr(e):[]})),Yi=Xr((function(e){var n=Zi(e),r=Ie(e,_o);return n===Zi(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Tr(r,ui(n,2)):[]})),Xi=Xr((function(e){var n=Zi(e),r=Ie(e,_o);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Tr(r,t,n):[]}));function Zi(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Qi=Xr(ts);function ts(t,e){return t&&t.length&&e&&e.length?Kr(t,e):t}var es=oi((function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Jr(t,Ie(e,(function(t){return bi(t,n)?+t:t})).sort(Ao)),r}));function ns(t){return null==t?t:Sn.call(t)}var rs=Xr((function(t){return po(yr(t,1,Gs,!0))})),os=Xr((function(e){var n=Zi(e);return Gs(n)&&(n=t),po(yr(e,1,Gs,!0),ui(n,2))})),is=Xr((function(e){var n=Zi(e);return n="function"==typeof n?n:t,po(yr(e,1,Gs,!0),t,n)}));function ss(t){if(!t||!t.length)return[];var e=0;return t=Ne(t,(function(t){if(Gs(t))return e=_n(t.length,e),!0})),Je(e,(function(e){return Ie(t,We(e))}))}function as(e,n){if(!e||!e.length)return[];var r=ss(e);return null==n?r:Ie(r,(function(e){return Se(n,t,e)}))}var ls=Xr((function(t,e){return Gs(t)?dr(t,e):[]})),cs=Xr((function(t){return vo(Ne(t,Gs))})),us=Xr((function(e){var n=Zi(e);return Gs(n)&&(n=t),vo(Ne(e,Gs),ui(n,2))})),ps=Xr((function(e){var n=Zi(e);return n="function"==typeof n?n:t,vo(Ne(e,Gs),t,n)})),ds=Xr(ss),fs=Xr((function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,as(e,r)}));function hs(t){var e=Hn(t);return e.__chain__=!0,e}function ms(t,e){return e(t)}var gs=oi((function(e){var n=e.length,r=n?e[0]:0,o=this.__wrapped__,i=function(t){return ar(t,e)};return!(n>1||this.__actions__.length)&&o instanceof Un&&bi(r)?((o=o.slice(r,+r+(n?1:0))).__actions__.push({func:ms,args:[i],thisArg:t}),new Wn(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(i)})),vs=$o((function(t,e,n){Lt.call(t,n)?++t[n]:sr(t,n,1)})),ys=Fo(Ui),_s=Fo(qi);function bs(t,e){return(qs(t)?Oe:fr)(t,ui(e,3))}function ws(t,e){return(qs(t)?Ce:hr)(t,ui(e,3))}var ks=$o((function(t,e,n){Lt.call(t,n)?t[n].push(e):sr(t,n,[e])})),xs=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Js(t)?wt(t.length):[];return fr(t,(function(t){i[++r]=o?Se(e,t,n):Mr(t,e,n)})),i})),Ss=$o((function(t,e,n){sr(t,n,e)}));function Es(t,e){return(qs(t)?Ie:Fr)(t,ui(e,3))}var Os=$o((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Cs=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wi(t,e[0],e[1])?e=[]:n>2&&wi(e[0],e[1],e[2])&&(e=[e[0]]),Ur(t,yr(e,1),[])})),As=pe||function(){return de.Date.now()};function Ns(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Qo(e,l,t,t,t,t,n)}function Ts(n,r){var o;if("function"!=typeof r)throw new Nt(e);return n=ga(n),function(){return--n>0&&(o=r.apply(this,arguments)),n<=1&&(r=t),o}}var Ms=Xr((function(t,e,n){var r=1;if(n.length){var o=cn(n,ci(Ms));r|=i}return Qo(t,r,e,n,o)})),Is=Xr((function(t,e,n){var r=3;if(n.length){var o=cn(n,ci(Is));r|=i}return Qo(e,r,t,n,o)}));function $s(n,r,o){var i,s,a,l,c,u,p=0,d=!1,f=!1,h=!0;if("function"!=typeof n)throw new Nt(e);function m(e){var r=i,o=s;return i=s=t,p=e,l=n.apply(o,r)}function g(t){return p=t,c=$i(y,r),d?m(t):l}function v(e){var n=e-u;return u===t||n>=r||n<0||f&&e-p>=a}function y(){var t=As();if(v(t))return _(t);c=$i(y,function(t){var e=r-(t-u);return f?bn(e,a-(t-p)):e}(t))}function _(e){return c=t,h&&i?m(e):(i=s=t,l)}function b(){var e=As(),n=v(e);if(i=arguments,s=this,u=e,n){if(c===t)return g(u);if(f)return So(c),c=$i(y,r),m(u)}return c===t&&(c=$i(y,r)),l}return r=ya(r)||0,na(o)&&(d=!!o.leading,a=(f="maxWait"in o)?_n(ya(o.maxWait)||0,r):a,h="trailing"in o?!!o.trailing:h),b.cancel=function(){c!==t&&So(c),p=0,i=u=s=c=t},b.flush=function(){return c===t?l:_(As())},b}var Ds=Xr((function(t,e){return pr(t,1,e)})),Ls=Xr((function(t,e,n){return pr(t,ya(e)||0,n)}));function Rs(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Nt(e);var r=function(){var e=arguments,o=n?n.apply(this,e):e[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,e);return r.cache=i.set(o,s)||i,s};return r.cache=new(Rs.Cache||Jn),r}function Ps(t){if("function"!=typeof t)throw new Nt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Rs.Cache=Jn;var js=ko((function(t,e){var n=(e=1==e.length&&qs(e[0])?Ie(e[0],Ye(ui())):Ie(yr(e,1),Ye(ui()))).length;return Xr((function(r){for(var o=-1,i=bn(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Se(t,this,r)}))})),zs=Xr((function(e,n){var r=cn(n,ci(zs));return Qo(e,i,t,n,r)})),Fs=Xr((function(e,n){var r=cn(n,ci(Fs));return Qo(e,a,t,n,r)})),Hs=oi((function(e,n){return Qo(e,c,t,t,t,n)}));function Vs(t,e){return t===e||t!=t&&e!=e}var Bs=Jo(Cr),Ws=Jo((function(t,e){return t>=e})),Us=Ir(function(){return arguments}())?Ir:function(t){return ra(t)&&Lt.call(t,"callee")&&!Jt.call(t,"callee")},qs=wt.isArray,Ks=ye?Ye(ye):function(t){return ra(t)&&Or(t)==M};function Js(t){return null!=t&&ea(t.length)&&!Qs(t)}function Gs(t){return ra(t)&&Js(t)}var Ys=Pe||yl,Xs=_e?Ye(_e):function(t){return ra(t)&&Or(t)==y};function Zs(t){if(!ra(t))return!1;var e=Or(t);return e==_||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qs(t){if(!na(t))return!1;var e=Or(t);return e==b||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ta(t){return"number"==typeof t&&t==ga(t)}function ea(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=p}function na(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var oa=be?Ye(be):function(t){return ra(t)&&gi(t)==k};function ia(t){return"number"==typeof t||ra(t)&&Or(t)==x}function sa(t){if(!ra(t)||Or(t)!=S)return!1;var e=qt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==zt}var aa=we?Ye(we):function(t){return ra(t)&&Or(t)==O},la=ke?Ye(ke):function(t){return ra(t)&&gi(t)==C};function ca(t){return"string"==typeof t||!qs(t)&&ra(t)&&Or(t)==A}function ua(t){return"symbol"==typeof t||ra(t)&&Or(t)==N}var pa=xe?Ye(xe):function(t){return ra(t)&&ea(t.length)&&!!ie[Or(t)]},da=Jo(zr),fa=Jo((function(t,e){return t<=e}));function ha(t){if(!t)return[];if(Js(t))return ca(t)?fn(t):Mo(t);if(Qt&&t[Qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Qt]());var e=gi(t);return(e==k?an:e==C?un:Va)(t)}function ma(t){return t?(t=ya(t))===u||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=ma(t),n=e%1;return e==e?n?e-n:e:0}function va(t){return t?lr(ga(t),0,f):0}function ya(t){if("number"==typeof t)return t;if(ua(t))return d;if(na(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=na(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=ht.test(t);return n||gt.test(t)?ce(t.slice(2),n?2:8):ft.test(t)?d:+t}function _a(t){return Io(t,Da(t))}function ba(t){return null==t?"":uo(t)}var wa=Do((function(t,e){if(Ei(e)||Js(e))Io(e,$a(e),t);else for(var n in e)Lt.call(e,n)&&nr(t,n,e[n])})),ka=Do((function(t,e){Io(e,Da(e),t)})),xa=Do((function(t,e,n,r){Io(e,Da(e),t,r)})),Sa=Do((function(t,e,n,r){Io(e,$a(e),t,r)})),Ea=oi(ar),Oa=Xr((function(e,n){e=Ot(e);var r=-1,o=n.length,i=o>2?n[2]:t;for(i&&wi(n[0],n[1],i)&&(o=1);++r<o;)for(var s=n[r],a=Da(s),l=-1,c=a.length;++l<c;){var u=a[l],p=e[u];(p===t||Vs(p,It[u])&&!Lt.call(e,u))&&(e[u]=s[u])}return e})),Ca=Xr((function(e){return e.push(t,ei),Se(Ra,t,e)}));function Aa(e,n,r){var o=null==e?t:Sr(e,n);return o===t?r:o}function Na(t,e){return null!=t&&vi(t,e,Nr)}var Ta=Bo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=n}),nl(il)),Ma=Bo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),Lt.call(t,e)?t[e].push(n):t[e]=[n]}),ui),Ia=Xr(Mr);function $a(t){return Js(t)?Xn(t):Pr(t)}function Da(t){return Js(t)?Xn(t,!0):jr(t)}var La=Do((function(t,e,n){Br(t,e,n)})),Ra=Do((function(t,e,n,r){Br(t,e,n,r)})),Pa=oi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ie(e,(function(e){return e=wo(e,t),r||(r=e.length>1),e})),Io(t,si(t),n),r&&(n=cr(n,7,ni));for(var o=e.length;o--;)fo(n,e[o]);return n})),ja=oi((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Na(t,n)}))}(t,e)}));function za(t,e){if(null==t)return{};var n=Ie(si(t),(function(t){return[t]}));return e=ui(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var Fa=Zo($a),Ha=Zo(Da);function Va(t){return null==t?[]:Xe(t,$a(t))}var Ba=jo((function(t,e,n){return e=e.toLowerCase(),t+(n?Wa(e):e)}));function Wa(t){return Za(ba(t).toLowerCase())}function Ua(t){return(t=ba(t))&&t.replace(yt,nn).replace(Zt,"")}var qa=jo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ka=jo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ja=Po("toLowerCase"),Ga=jo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ya=jo((function(t,e,n){return t+(n?" ":"")+Za(e)})),Xa=jo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Za=Po("toUpperCase");function Qa(e,n,r){return e=ba(e),(n=r?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(lt)||[]}(e):e.match(n)||[]}var tl=Xr((function(e,n){try{return Se(e,t,n)}catch(t){return Zs(t)?t:new xt(t)}})),el=oi((function(t,e){return Oe(e,(function(e){e=zi(e),sr(t,e,Ms(t[e],t))})),t}));function nl(t){return function(){return t}}var rl=Ho(),ol=Ho(!0);function il(t){return t}function sl(t){return Rr("function"==typeof t?t:cr(t,1))}var al=Xr((function(t,e){return function(n){return Mr(n,t,e)}})),ll=Xr((function(t,e){return function(n){return Mr(t,n,e)}}));function cl(t,e,n){var r=$a(e),o=xr(e,r);null!=n||na(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=xr(e,$a(e)));var i=!(na(n)&&"chain"in n&&!n.chain),s=Qs(t);return Oe(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__),o=n.__actions__=Mo(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,$e([this.value()],arguments))})})),t}function ul(){}var pl=Uo(Ie),dl=Uo(Ae),fl=Uo(Re);function hl(t){return ki(t)?We(zi(t)):function(t){return function(e){return Sr(e,t)}}(t)}var ml=Ko(),gl=Ko(!0);function vl(){return[]}function yl(){return!1}var _l,bl=Wo((function(t,e){return t+e}),0),wl=Yo("ceil"),kl=Wo((function(t,e){return t/e}),1),xl=Yo("floor"),Sl=Wo((function(t,e){return t*e}),1),El=Yo("round"),Ol=Wo((function(t,e){return t-e}),0);return Hn.after=function(t,n){if("function"!=typeof n)throw new Nt(e);return t=ga(t),function(){if(--t<1)return n.apply(this,arguments)}},Hn.ary=Ns,Hn.assign=wa,Hn.assignIn=ka,Hn.assignInWith=xa,Hn.assignWith=Sa,Hn.at=Ea,Hn.before=Ts,Hn.bind=Ms,Hn.bindAll=el,Hn.bindKey=Is,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qs(t)?t:[t]},Hn.chain=hs,Hn.chunk=function(e,n,r){n=(r?wi(e,n,r):n===t)?1:_n(ga(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var i=0,s=0,a=wt(he(o/n));i<o;)a[s++]=oo(e,i,i+=n);return a},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=wt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return $e(qs(n)?Mo(n):[n],yr(e,1))},Hn.cond=function(t){var n=null==t?0:t.length,r=ui();return t=n?Ie(t,(function(t){if("function"!=typeof t[1])throw new Nt(e);return[r(t[0]),t[1]]})):[],Xr((function(e){for(var r=-1;++r<n;){var o=t[r];if(Se(o[0],this,e))return Se(o[1],this,e)}}))},Hn.conforms=function(t){return function(t){var e=$a(t);return function(n){return ur(n,t,e)}}(cr(t,1))},Hn.constant=nl,Hn.countBy=vs,Hn.create=function(t,e){var n=Vn(t);return null==e?n:ir(n,e)},Hn.curry=function e(n,r,o){var i=Qo(n,8,t,t,t,t,t,r=o?t:r);return i.placeholder=e.placeholder,i},Hn.curryRight=function e(n,r,i){var s=Qo(n,o,t,t,t,t,t,r=i?t:r);return s.placeholder=e.placeholder,s},Hn.debounce=$s,Hn.defaults=Oa,Hn.defaultsDeep=Ca,Hn.defer=Ds,Hn.delay=Ls,Hn.difference=Vi,Hn.differenceBy=Bi,Hn.differenceWith=Wi,Hn.drop=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=r||n===t?1:ga(n))<0?0:n,o):[]},Hn.dropRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,0,(n=o-(n=r||n===t?1:ga(n)))<0?0:n):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!0):[]},Hn.fill=function(e,n,r,o){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&wi(e,n,r)&&(r=0,o=i),function(e,n,r,o){var i=e.length;for((r=ga(r))<0&&(r=-r>i?0:i+r),(o=o===t||o>i?i:ga(o))<0&&(o+=i),o=r>o?0:va(o);r<o;)e[r++]=n;return e}(e,n,r,o)):[]},Hn.filter=function(t,e){return(qs(t)?Ne:vr)(t,ui(e,3))},Hn.flatMap=function(t,e){return yr(Es(t,e),1)},Hn.flatMapDeep=function(t,e){return yr(Es(t,e),u)},Hn.flatMapDepth=function(e,n,r){return r=r===t?1:ga(r),yr(Es(e,n),r)},Hn.flatten=Ki,Hn.flattenDeep=function(t){return null!=t&&t.length?yr(t,u):[]},Hn.flattenDepth=function(e,n){return null!=e&&e.length?yr(e,n=n===t?1:ga(n)):[]},Hn.flip=function(t){return Qo(t,512)},Hn.flow=rl,Hn.flowRight=ol,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},Hn.functions=function(t){return null==t?[]:xr(t,$a(t))},Hn.functionsIn=function(t){return null==t?[]:xr(t,Da(t))},Hn.groupBy=ks,Hn.initial=function(t){return null!=t&&t.length?oo(t,0,-1):[]},Hn.intersection=Gi,Hn.intersectionBy=Yi,Hn.intersectionWith=Xi,Hn.invert=Ta,Hn.invertBy=Ma,Hn.invokeMap=xs,Hn.iteratee=sl,Hn.keyBy=Ss,Hn.keys=$a,Hn.keysIn=Da,Hn.map=Es,Hn.mapKeys=function(t,e){var n={};return e=ui(e,3),wr(t,(function(t,r,o){sr(n,e(t,r,o),t)})),n},Hn.mapValues=function(t,e){var n={};return e=ui(e,3),wr(t,(function(t,r,o){sr(n,r,e(t,r,o))})),n},Hn.matches=function(t){return Hr(cr(t,1))},Hn.matchesProperty=function(t,e){return Vr(t,cr(e,1))},Hn.memoize=Rs,Hn.merge=La,Hn.mergeWith=Ra,Hn.method=al,Hn.methodOf=ll,Hn.mixin=cl,Hn.negate=Ps,Hn.nthArg=function(t){return t=ga(t),Xr((function(e){return Wr(e,t)}))},Hn.omit=Pa,Hn.omitBy=function(t,e){return za(t,Ps(ui(e)))},Hn.once=function(t){return Ts(2,t)},Hn.orderBy=function(e,n,r,o){return null==e?[]:(qs(n)||(n=null==n?[]:[n]),qs(r=o?t:r)||(r=null==r?[]:[r]),Ur(e,n,r))},Hn.over=pl,Hn.overArgs=js,Hn.overEvery=dl,Hn.overSome=fl,Hn.partial=zs,Hn.partialRight=Fs,Hn.partition=Os,Hn.pick=ja,Hn.pickBy=za,Hn.property=hl,Hn.propertyOf=function(e){return function(n){return null==e?t:Sr(e,n)}},Hn.pull=Qi,Hn.pullAll=ts,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Kr(t,e,ui(n,2)):t},Hn.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?Kr(e,n,t,r):e},Hn.pullAt=es,Hn.range=ml,Hn.rangeRight=gl,Hn.rearg=Hs,Hn.reject=function(t,e){return(qs(t)?Ne:vr)(t,Ps(ui(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=ui(e,3);++r<i;){var s=t[r];e(s,r,t)&&(n.push(s),o.push(r))}return Jr(t,o),n},Hn.rest=function(n,r){if("function"!=typeof n)throw new Nt(e);return Xr(n,r=r===t?r:ga(r))},Hn.reverse=ns,Hn.sampleSize=function(e,n,r){return n=(r?wi(e,n,r):n===t)?1:ga(n),(qs(e)?Qn:Qr)(e,n)},Hn.set=function(t,e,n){return null==t?t:to(t,e,n)},Hn.setWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:to(e,n,r,o)},Hn.shuffle=function(t){return(qs(t)?tr:ro)(t)},Hn.slice=function(e,n,r){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&wi(e,n,r)?(n=0,r=o):(n=null==n?0:ga(n),r=r===t?o:ga(r)),oo(e,n,r)):[]},Hn.sortBy=Cs,Hn.sortedUniq=function(t){return t&&t.length?lo(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?lo(t,ui(e,2)):[]},Hn.split=function(e,n,r){return r&&"number"!=typeof r&&wi(e,n,r)&&(n=r=t),(r=r===t?f:r>>>0)?(e=ba(e))&&("string"==typeof n||null!=n&&!aa(n))&&!(n=uo(n))&&sn(e)?xo(fn(e),0,r):e.split(n,r):[]},Hn.spread=function(t,n){if("function"!=typeof t)throw new Nt(e);return n=null==n?0:_n(ga(n),0),Xr((function(e){var r=e[n],o=xo(e,0,n);return r&&$e(o,r),Se(t,this,o)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},Hn.take=function(e,n,r){return e&&e.length?oo(e,0,(n=r||n===t?1:ga(n))<0?0:n):[]},Hn.takeRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=o-(n=r||n===t?1:ga(n)))<0?0:n,o):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?mo(t,ui(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new Nt(e);return na(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),$s(t,n,{leading:o,maxWait:n,trailing:i})},Hn.thru=ms,Hn.toArray=ha,Hn.toPairs=Fa,Hn.toPairsIn=Ha,Hn.toPath=function(t){return qs(t)?Ie(t,zi):ua(t)?[t]:Mo(ji(ba(t)))},Hn.toPlainObject=_a,Hn.transform=function(t,e,n){var r=qs(t),o=r||Ys(t)||pa(t);if(e=ui(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:na(t)&&Qs(i)?Vn(qt(t)):{}}return(o?Oe:wr)(t,(function(t,r,o){return e(n,t,r,o)})),n},Hn.unary=function(t){return Ns(t,1)},Hn.union=rs,Hn.unionBy=os,Hn.unionWith=is,Hn.uniq=function(t){return t&&t.length?po(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?po(t,ui(e,2)):[]},Hn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?po(e,t,n):[]},Hn.unset=function(t,e){return null==t||fo(t,e)},Hn.unzip=ss,Hn.unzipWith=as,Hn.update=function(t,e,n){return null==t?t:ho(t,e,bo(n))},Hn.updateWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:ho(e,n,bo(r),o)},Hn.values=Va,Hn.valuesIn=function(t){return null==t?[]:Xe(t,Da(t))},Hn.without=ls,Hn.words=Qa,Hn.wrap=function(t,e){return zs(bo(e),t)},Hn.xor=cs,Hn.xorBy=us,Hn.xorWith=ps,Hn.zip=ds,Hn.zipObject=function(t,e){return yo(t||[],e||[],nr)},Hn.zipObjectDeep=function(t,e){return yo(t||[],e||[],to)},Hn.zipWith=fs,Hn.entries=Fa,Hn.entriesIn=Ha,Hn.extend=ka,Hn.extendWith=xa,cl(Hn,Hn),Hn.add=bl,Hn.attempt=tl,Hn.camelCase=Ba,Hn.capitalize=Wa,Hn.ceil=wl,Hn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ya(r))==r?r:0),n!==t&&(n=(n=ya(n))==n?n:0),lr(ya(e),n,r)},Hn.clone=function(t){return cr(t,4)},Hn.cloneDeep=function(t){return cr(t,5)},Hn.cloneDeepWith=function(e,n){return cr(e,5,n="function"==typeof n?n:t)},Hn.cloneWith=function(e,n){return cr(e,4,n="function"==typeof n?n:t)},Hn.conformsTo=function(t,e){return null==e||ur(t,e,$a(e))},Hn.deburr=Ua,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=kl,Hn.endsWith=function(e,n,r){e=ba(e),n=uo(n);var o=e.length,i=r=r===t?o:lr(ga(r),0,o);return(r-=n.length)>=0&&e.slice(r,i)==n},Hn.eq=Vs,Hn.escape=function(t){return(t=ba(t))&&J.test(t)?t.replace(q,rn):t},Hn.escapeRegExp=function(t){return(t=ba(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Hn.every=function(e,n,r){var o=qs(e)?Ae:mr;return r&&wi(e,n,r)&&(n=t),o(e,ui(n,3))},Hn.find=ys,Hn.findIndex=Ui,Hn.findKey=function(t,e){return je(t,ui(e,3),wr)},Hn.findLast=_s,Hn.findLastIndex=qi,Hn.findLastKey=function(t,e){return je(t,ui(e,3),kr)},Hn.floor=xl,Hn.forEach=bs,Hn.forEachRight=ws,Hn.forIn=function(t,e){return null==t?t:_r(t,ui(e,3),Da)},Hn.forInRight=function(t,e){return null==t?t:br(t,ui(e,3),Da)},Hn.forOwn=function(t,e){return t&&wr(t,ui(e,3))},Hn.forOwnRight=function(t,e){return t&&kr(t,ui(e,3))},Hn.get=Aa,Hn.gt=Bs,Hn.gte=Ws,Hn.has=function(t,e){return null!=t&&vi(t,e,Ar)},Hn.hasIn=Na,Hn.head=Ji,Hn.identity=il,Hn.includes=function(t,e,n,r){t=Js(t)?t:Va(t),n=n&&!r?ga(n):0;var o=t.length;return n<0&&(n=_n(o+n,0)),ca(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=_n(r+o,0)),Fe(t,e,o)},Hn.inRange=function(e,n,r){return n=ma(n),r===t?(r=n,n=0):r=ma(r),function(t,e,n){return t>=bn(e,n)&&t<_n(e,n)}(e=ya(e),n,r)},Hn.invoke=Ia,Hn.isArguments=Us,Hn.isArray=qs,Hn.isArrayBuffer=Ks,Hn.isArrayLike=Js,Hn.isArrayLikeObject=Gs,Hn.isBoolean=function(t){return!0===t||!1===t||ra(t)&&Or(t)==v},Hn.isBuffer=Ys,Hn.isDate=Xs,Hn.isElement=function(t){return ra(t)&&1===t.nodeType&&!sa(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(Js(t)&&(qs(t)||"string"==typeof t||"function"==typeof t.splice||Ys(t)||pa(t)||Us(t)))return!t.length;var e=gi(t);if(e==k||e==C)return!t.size;if(Ei(t))return!Pr(t).length;for(var n in t)if(Lt.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return $r(t,e)},Hn.isEqualWith=function(e,n,r){var o=(r="function"==typeof r?r:t)?r(e,n):t;return o===t?$r(e,n,t,r):!!o},Hn.isError=Zs,Hn.isFinite=function(t){return"number"==typeof t&&Ue(t)},Hn.isFunction=Qs,Hn.isInteger=ta,Hn.isLength=ea,Hn.isMap=oa,Hn.isMatch=function(t,e){return t===e||Dr(t,e,di(e))},Hn.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Dr(e,n,di(n),r)},Hn.isNaN=function(t){return ia(t)&&t!=+t},Hn.isNative=function(t){if(Si(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=ia,Hn.isObject=na,Hn.isObjectLike=ra,Hn.isPlainObject=sa,Hn.isRegExp=aa,Hn.isSafeInteger=function(t){return ta(t)&&t>=-9007199254740991&&t<=p},Hn.isSet=la,Hn.isString=ca,Hn.isSymbol=ua,Hn.isTypedArray=pa,Hn.isUndefined=function(e){return e===t},Hn.isWeakMap=function(t){return ra(t)&&gi(t)==T},Hn.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Or(t)},Hn.join=function(t,e){return null==t?"":vn.call(t,e)},Hn.kebabCase=qa,Hn.last=Zi,Hn.lastIndexOf=function(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==t&&(i=(i=ga(r))<0?_n(o+i,0):bn(i,o-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,i):ze(e,Ve,i,!0)},Hn.lowerCase=Ka,Hn.lowerFirst=Ja,Hn.lt=da,Hn.lte=fa,Hn.max=function(e){return e&&e.length?gr(e,il,Cr):t},Hn.maxBy=function(e,n){return e&&e.length?gr(e,ui(n,2),Cr):t},Hn.mean=function(t){return Be(t,il)},Hn.meanBy=function(t,e){return Be(t,ui(e,2))},Hn.min=function(e){return e&&e.length?gr(e,il,zr):t},Hn.minBy=function(e,n){return e&&e.length?gr(e,ui(n,2),zr):t},Hn.stubArray=vl,Hn.stubFalse=yl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Sl,Hn.nth=function(e,n){return e&&e.length?Wr(e,ga(n)):t},Hn.noConflict=function(){return de._===this&&(de._=Ft),this},Hn.noop=ul,Hn.now=As,Hn.pad=function(t,e,n){t=ba(t);var r=(e=ga(e))?dn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return qo(ge(o),n)+t+qo(he(o),n)},Hn.padEnd=function(t,e,n){t=ba(t);var r=(e=ga(e))?dn(t):0;return e&&r<e?t+qo(e-r,n):t},Hn.padStart=function(t,e,n){t=ba(t);var r=(e=ga(e))?dn(t):0;return e&&r<e?qo(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),kn(ba(t).replace(rt,""),e||0)},Hn.random=function(e,n,r){if(r&&"boolean"!=typeof r&&wi(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=ma(e),n===t?(n=e,e=0):n=ma(n)),e>n){var o=e;e=n,n=o}if(r||e%1||n%1){var i=xn();return bn(e+i*(n-e+le("1e-"+((i+"").length-1))),n)}return Gr(e,n)},Hn.reduce=function(t,e,n){var r=qs(t)?De:qe,o=arguments.length<3;return r(t,ui(e,4),n,o,fr)},Hn.reduceRight=function(t,e,n){var r=qs(t)?Le:qe,o=arguments.length<3;return r(t,ui(e,4),n,o,hr)},Hn.repeat=function(e,n,r){return n=(r?wi(e,n,r):n===t)?1:ga(n),Yr(ba(e),n)},Hn.replace=function(){var t=arguments,e=ba(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(e,n,r){var o=-1,i=(n=wo(n,e)).length;for(i||(i=1,e=t);++o<i;){var s=null==e?t:e[zi(n[o])];s===t&&(o=i,s=r),e=Qs(s)?s.call(e):s}return e},Hn.round=El,Hn.runInContext=s,Hn.sample=function(t){return(qs(t)?Zn:Zr)(t)},Hn.size=function(t){if(null==t)return 0;if(Js(t))return ca(t)?dn(t):t.length;var e=gi(t);return e==k||e==C?t.size:Pr(t).length},Hn.snakeCase=Ga,Hn.some=function(e,n,r){var o=qs(e)?Re:io;return r&&wi(e,n,r)&&(n=t),o(e,ui(n,3))},Hn.sortedIndex=function(t,e){return so(t,e)},Hn.sortedIndexBy=function(t,e,n){return ao(t,e,ui(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=so(t,e);if(r<n&&Vs(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return so(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ao(t,e,ui(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=so(t,e,!0)-1;if(Vs(t[n],e))return n}return-1},Hn.startCase=Ya,Hn.startsWith=function(t,e,n){return t=ba(t),n=null==n?0:lr(ga(n),0,t.length),e=uo(e),t.slice(n,n+e.length)==e},Hn.subtract=Ol,Hn.sum=function(t){return t&&t.length?Ke(t,il):0},Hn.sumBy=function(t,e){return t&&t.length?Ke(t,ui(e,2)):0},Hn.template=function(e,n,r){var o=Hn.templateSettings;r&&wi(e,n,r)&&(n=t),e=ba(e),n=xa({},n,o,ti);var i,s,a=xa({},n.imports,o.imports,ti),l=$a(a),c=Xe(a,l),u=0,p=n.interpolate||_t,d="__p += '",f=Ct((n.escape||_t).source+"|"+p.source+"|"+(p===X?pt:_t).source+"|"+(n.evaluate||_t).source+"|$","g"),h="//# sourceURL="+(Lt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";e.replace(f,(function(t,n,r,o,a,l){return r||(r=o),d+=e.slice(u,l).replace(bt,on),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),d+="';\n";var m=Lt.call(n,"variable")&&n.variable;if(m){if(ct.test(m))throw new xt("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(V,""):d).replace(B,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=tl((function(){return St(l,h+"return "+d).apply(t,c)}));if(g.source=d,Zs(g))throw g;return g},Hn.times=function(t,e){if((t=ga(t))<1||t>p)return[];var n=f,r=bn(t,f);e=ui(e),t-=f;for(var o=Je(r,e);++n<t;)e(n);return o},Hn.toFinite=ma,Hn.toInteger=ga,Hn.toLength=va,Hn.toLower=function(t){return ba(t).toLowerCase()},Hn.toNumber=ya,Hn.toSafeInteger=function(t){return t?lr(ga(t),-9007199254740991,p):0===t?t:0},Hn.toString=ba,Hn.toUpper=function(t){return ba(t).toUpperCase()},Hn.trim=function(e,n,r){if((e=ba(e))&&(r||n===t))return Ge(e);if(!e||!(n=uo(n)))return e;var o=fn(e),i=fn(n);return xo(o,Qe(o,i),tn(o,i)+1).join("")},Hn.trimEnd=function(e,n,r){if((e=ba(e))&&(r||n===t))return e.slice(0,hn(e)+1);if(!e||!(n=uo(n)))return e;var o=fn(e);return xo(o,0,tn(o,fn(n))+1).join("")},Hn.trimStart=function(e,n,r){if((e=ba(e))&&(r||n===t))return e.replace(rt,"");if(!e||!(n=uo(n)))return e;var o=fn(e);return xo(o,Qe(o,fn(n))).join("")},Hn.truncate=function(e,n){var r=30,o="...";if(na(n)){var i="separator"in n?n.separator:i;r="length"in n?ga(n.length):r,o="omission"in n?uo(n.omission):o}var s=(e=ba(e)).length;if(sn(e)){var a=fn(e);s=a.length}if(r>=s)return e;var l=r-dn(o);if(l<1)return o;var c=a?xo(a,0,l).join(""):e.slice(0,l);if(i===t)return c+o;if(a&&(l+=c.length-l),aa(i)){if(e.slice(l).search(i)){var u,p=c;for(i.global||(i=Ct(i.source,ba(dt.exec(i))+"g")),i.lastIndex=0;u=i.exec(p);)var d=u.index;c=c.slice(0,d===t?l:d)}}else if(e.indexOf(uo(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Hn.unescape=function(t){return(t=ba(t))&&K.test(t)?t.replace(U,mn):t},Hn.uniqueId=function(t){var e=++Rt;return ba(t)+e},Hn.upperCase=Xa,Hn.upperFirst=Za,Hn.each=bs,Hn.eachRight=ws,Hn.first=Ji,cl(Hn,(_l={},wr(Hn,(function(t,e){Lt.call(Hn.prototype,e)||(_l[e]=t)})),_l),{chain:!1}),Hn.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),Oe(["drop","take"],(function(e,n){Un.prototype[e]=function(r){r=r===t?1:_n(ga(r),0);var o=this.__filtered__&&!n?new Un(this):this.clone();return o.__filtered__?o.__takeCount__=bn(r,o.__takeCount__):o.__views__.push({size:bn(r,f),type:e+(o.__dir__<0?"Right":"")}),o},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ui(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(il)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Mr(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Ps(ui(t)))},Un.prototype.slice=function(e,n){e=ga(e);var r=this;return r.__filtered__&&(e>0||n<0)?new Un(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=ga(n))<0?r.dropRight(-n):r.take(n-e)),r)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(f)},wr(Un.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),i=Hn[o?"take"+("last"==n?"Right":""):n],s=o||/^find/.test(n);i&&(Hn.prototype[n]=function(){var n=this.__wrapped__,a=o?[1]:arguments,l=n instanceof Un,c=a[0],u=l||qs(n),p=function(t){var e=i.apply(Hn,$e([t],a));return o&&d?e[0]:e};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,h=s&&!d,m=l&&!f;if(!s&&u){n=m?n:new Un(this);var g=e.apply(n,a);return g.__actions__.push({func:ms,args:[p],thisArg:t}),new Wn(g,d)}return h&&m?e.apply(this,a):(g=this.thru(p),h?o?g.value()[0]:g.value():g)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(qs(o)?o:[],t)}return this[n]((function(n){return e.apply(qs(n)?n:[],t)}))}})),wr(Un.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Lt.call(In,r)||(In[r]=[]),In[r].push({name:e,func:n})}})),In[Vo(t,2).name]=[{name:"wrapper",func:t}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=Mo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Mo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Mo(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qs(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=bn(e,t+s);break;case"takeRight":t=_n(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,p=u.length,d=0,f=bn(l,this.__takeCount__);if(!n||!r&&o==l&&f==l)return go(t,this.__actions__);var h=[];t:for(;l--&&d<f;){for(var m=-1,g=t[c+=e];++m<p;){var v=u[m],y=v.iteratee,_=v.type,b=y(g);if(2==_)g=b;else if(!b){if(1==_)continue t;break t}}h[d++]=g}return h},Hn.prototype.at=gs,Hn.prototype.chain=function(){return hs(this)},Hn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===t&&(this.__values__=ha(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var n,r=this;r instanceof Bn;){var o=Hi(r);o.__index__=0,o.__values__=t,n?i.__wrapped__=o:n=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,n},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var n=e;return this.__actions__.length&&(n=new Un(this)),(n=n.reverse()).__actions__.push({func:ms,args:[ns],thisArg:t}),new Wn(n,this.__chain__)}return this.thru(ns)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,Qt&&(Hn.prototype[Qt]=function(){return this}),Hn}();he?((he.exports=gn)._=gn,fe._=gn):de._=gn}.call(s);const um=Fp.create({name:"node_processor",addCommands:()=>({setBlockAttributes:Th((({commands:t,state:e},n,r,o={})=>{const i=je(t.getBlockAttributes(n))??{},{doc:s,tr:a}=e,{from:l,to:c}=a.selection;s.nodesBetween(l,c,((t,e)=>{Fd.blocks.includes(t.type.name)&&a.setNodeAttribute(e,n,{...o,...i,...r})}))})),getBlockAttributes:Th((({editor:t},e,n)=>He((()=>{let r=Object.assign({},n||{});for(const n of Fd.blocks)Object.assign(r,t.getAttributes(n)?.[e]||{});return Object.keys(r).length?r:null})))),removeBlockAttributes:Th((({commands:t},e)=>{for(const n of Fd.blocks)t.resetAttributes(n,e)})),applyMark:Th((({state:t,commands:e},n,r,o={})=>{const{tr:i,doc:s,schema:a}=t,{$from:l,$to:c}=i.selection,u=Up(Vd.LINK,a),p=Up(n,a);if(!(p.spec.group||"").includes(Bd.SETTINGS))return e.setMark(n,r);if(l.pos===c.pos)return;s.nodesBetween(l.pos,c.pos,((t,s)=>{if(t.type.name===Fd.LIST)return;const a=function(t,e){const n="string"==typeof e?e:e.name;return t.find((t=>t.type.name===n))}(t.marks,n),d=p.create({...a?.attrs||{},...r}),f=rm(l,c,t,s),h=!u.isInSet(t.marks)&&function(t,e,n,r=im){const o=t.resolve(e).path.reverse();for(const t of o)if("number"!=typeof t)for(const e of t.marks)if(r(e,n))return!0;return!1}(i.doc,s,d,o.isAppliedToParent);if(h)return(t=>{if(!o.onAppliedToParent||!1===o.onAppliedToParent(t)){const{tr:n,node:r,position:o,mark:i}=t;e._removeNodeMark({tr:n,node:r,position:o,mark:i.type})}})({tr:i,node:t,position:s,mark:d});t.isText?i.addMark(f.from,f.to,d):function(t,e,n,r){const o=om(t,r),i=e.from-o<=r,s=e.to+o>=n.nodeSize+r;return i&&s}(i.doc,i.selection,t,s)&&i.addNodeMark(s,d)}))})),getMarks:Th((({editor:t},e)=>{const n=Fe(t,"state");return He((()=>{const{selection:t,doc:r}=je(n),{from:o,to:i}=je(t),s=[];return r.nodesBetween(o,i,(t=>{for(const n of t.marks)n.type.name===e&&s.unshift(n.attrs)})),s}))})),getMark:Th((({commands:t},e)=>{const n=t.getMarks(e);return He((()=>je(n)[0]??null))})),hasMark:Th((({commands:t},e)=>{const n=t.getMark(e);return He((()=>!!je(n)))})),getCommonSettingMark:Th((({commands:t},e,n)=>{const r=t.getMark(e);return He((()=>je(r)?.value??je(n)))})),getDeviceSettingMark:Th((({commands:t},e,n)=>{const r=t.getMarks(e),o=t.getDevice();return He((()=>{for(const t of je(r)){const e=t[je(o)];if(e)return e}return je(n)}))})),removeAllMarks:Th((({state:t,commands:e})=>{const{tr:n,doc:r}=t,{from:o,to:i}=n.selection;r.nodesBetween(o,i,((t,r)=>{for(const o of t.marks)e._removeNodeMark({tr:n,node:t,position:r,mark:o})}))})),removeMarks:Th((({state:t,commands:e},n)=>{const{tr:r,doc:o}=t,{from:i,to:s}=r.selection;o.nodesBetween(i,s,((t,o)=>{const i=t.marks.filter((t=>n.includes(t.type.name)));for(const n of i)e._removeNodeMark({tr:r,node:t,position:o,mark:n})}))})),_removeNodeMark:Th(((t,{tr:e,node:n,position:r,mark:o})=>n.isText?e.removeMark(r,r+n.nodeSize,o):e.removeNodeMark(r,o)))})}),pm=Fp.create({name:"text_processor",addCommands:()=>({getSelectedText:Th((({state:t})=>{const{from:e,to:n}=t.selection;return t.doc.textBetween(e,n," ")})),transformText:Th((({state:t},e)=>{const{$from:n,$to:r}=t.tr.selection;n.pos!==r.pos&&t.doc.nodesBetween(n.pos,r.pos,((o,i)=>{if(!o.isText)return;const s=rm(n,r,o,i),a=Math.max(0,n.pos-i),l=Math.max(0,r.pos-i),c=e({text:o.textContent.substring(a,l)}),u=t.schema.text(c,o.marks);t.tr.replaceWith(s.from,s.to,u)}))}))})}),dm=Fp.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:Th((({state:t})=>{this.storage.selection=t.selection})),restoreSelection:Th((({commands:t})=>{this.storage.selection&&t.setTextSelection(this.storage.selection)})),expandSelection:Th((({tr:t,commands:e},n)=>{let r=t.selection.from,o=t.selection.to;t.doc.nodesBetween(r,o,((e,i,s)=>{if(n({node:e,parent:s})){const n=e.isText?0:om(t.doc,i);r=Math.min(r,i+n),o=Math.max(o,i+e.nodeSize-n)}})),e.setTextSelection({from:r,to:o})})),expandSelectionToBlock:Th((({commands:t})=>{t.expandSelection((({parent:t})=>t.type.name===Fd.DOCUMENT))}))}}}),fm=fd.create({name:"doc",topNode:!0,content:"block+"}).extend({marks:Bd.SETTINGS,onCreate(){this.editor.view.dom.addEventListener("click",(t=>{t.target.closest("a")&&t.preventDefault()}))}}),hm=fd.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",kp(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mm=hm.extend({marks:Bd.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),gm=fd.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,kp(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>function(t){return new Mp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Sp(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}}),vm=gm.extend({marks:Bd.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),ym=Fp.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[Kd.create(this.editor),Jd.create(this.editor)]}}),_m=dd.create({name:Vd.FONT_FAMILY,group:Bd.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e});const n=t.findFontByName(e);let r=je(t.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),t.applyFontWeight(r)),n.isItalicSupported(r)||t.removeItalic()})),getFont:Th((({commands:t})=>{const e=je(this.options.defaultPreset),n=t.findFontByName(e.common.font_family),r=t.getFontFamily();return He((()=>t.findFontByName(je(r))||n))})),findFontByName:Th(((t,e)=>this.options.fonts.find((t=>t.name===e)))),getFontFamily:Th((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontFamily()))),getDefaultFontFamily:Th((({commands:t})=>{const e=t.getPreset();return He((()=>je(e).common.font_family))}))}},parseHTML(){const t=t=>({value:t.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:t},{style:"font-family",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({font_family:t.value?`"${t.value}"`:null})}),bm=Fp.create({name:Vd.STYLE_PRESET,addGlobalAttributes(){return[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{preset:{isRequired:!1,default:{id:this.options.defaultId},parseHTML:t=>{const e=je(this.options.presets);if("LI"===t.parentElement.tagName)return null;for(const{id:n,node:r,fallbackClass:o}of e){if(o&&t.classList.contains(o))return{id:n};const e=this.options.styleRenderer.makePresetCssClass({id:n});if(t.matches(e))return{id:n};if(t.tagName===`H${r?.level}`)return{id:n}}return"P"===t.tagName?{id:this.options.defaultId}:null},renderHTML:t=>t.preset?{class:this.options.styleRenderer.makePresetHtmlClass(t.preset)}:null}}}]},addCommands(){function t(t,e){return t.find((t=>e===t.id))}function e(t,e){const n={};for(const r of Object.keys(t)){const o=t[r],i=e[r],s=!i||"inherit"===i.toLowerCase();n[r]=s?o:i}return n}return{getPresetList:Th((()=>He((()=>this.options.presets.filter((t=>!t.hidden)))))),getPreset:Th((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:this.options.defaultId}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return He((()=>{const n=t(je(o),je(r).id);if(!je(i))return n;const a=je(s);return{id:n.id,common:e(n.common,a.common),mobile:e(n.mobile,a.mobile),tablet:e(n.tablet,a.tablet),desktop:e(n.desktop,a.desktop)}}))})),applyPreset:Th((({commands:e,chain:n},r)=>{const o=t(je(e.getPresetList()),r),i=o.node?.type??Fd.PARAGRAPH,s={preset:{id:r}};o.node&&(s.level=o.node.level);for(const t of Vd.attributes)s[t]=je(e.getBlockAttributes(t));n().removeList().setNode(i,s).run()})),applyDefaultPreset:Th((({commands:t})=>{t.applyPreset(this.options.defaultId)})),removePreset:Th((({commands:t})=>{t.setNode(Fd.PARAGRAPH,{preset:null})})),getPresetCustomization:Th((({editor:t,commands:e})=>{const n=Fe(t,"state");return He((()=>{const{selection:t,doc:r}=je(n),{from:o,to:i}=t;return e._getSettingCustomization(r,o,i)}))})),isSettingCustomized:Th((({commands:t},e)=>{const n=t.getPresetCustomization(),r=Vd.presetAttributes.includes(e)?"attributes":"marks";return He((()=>je(n)[r]?.includes(e)??!1))})),getContentCustomization:Th((({editor:t,commands:e})=>{const n=Fe(t,"state");return He((()=>{const{doc:t}=je(n);return e._getSettingCustomization(t,0,t.content.size)}))})),_getSettingCustomization:Th(((t,e,n,r)=>{const o=new Set,i=new Set;return e.nodesBetween(n,r,(t=>{for(const[e,n]of Object.entries(t.attrs)){Vd.presetAttributes.includes(e)&&n&&i.add(e)}for(const{type:e}of t.marks)Vd.marks.includes(e.name)&&o.add(e.name)})),{attributes:Array.from(i),marks:Array.from(o)}})),removePresetCustomization:Th((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(Vd.marks).resetAttributes(Fd.PARAGRAPH,Vd.presetAttributes).resetAttributes(Fd.HEADING,Vd.presetAttributes).restoreSelection().run()})),removeFormat:Th((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){this.options.styleRenderer.inject(Km.head,this.options.presets)}}),wm=dd.create({name:Vd.FONT_WEIGHT,group:Bd.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e});je(t.getFont()).isItalicSupported(e)||t.removeItalic()})),toggleBold:Th((({commands:t})=>{const e=je(t.getFontWeight()),n=je(t.getFont()),r=Number(e)>=600?"400":"700",o=n.findClosestWeight(r);t.applyFontWeight(o)})),getFontWeight:Th((({commands:t})=>{const e=t.getCommonSettingMark(this.name,t.getDefaultFontWeight()),n=t.getFont();return He((()=>{const t=je(e),r=je(n);return r.isWeightSupported(t)?t:r.findClosestWeight(t)}))})),getDefaultFontWeight:Th((({commands:t})=>{const e=t.getPreset();return He((()=>je(e).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":$h("toggleBold"),"Mod-B":$h("toggleBold")}),parseHTML(){const t=t=>"bold"===t?{value:"700"}:!!Number(t)&&{value:t};return[{style:"--zw-font-weight",getAttrs:t},{style:"font-weight",getAttrs:t},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML:({HTMLAttributes:t})=>Ih({font_weight:t.value})}),km=dd.create({name:Vd.FONT_SIZE,group:Bd.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:Th((({commands:t})=>t.getDeviceSettingMark(this.name,t.getDefaultFontSize()))),getDefaultFontSize:Th((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return He((()=>je(n)[je(e)].font_size.replace("px","")))})),applyFontSize:Th((({commands:t},e)=>{const n=je(t.getDevice());t.applyMark(this.name,{[n]:e},{isAppliedToParent:(t,e)=>t.type.name===e.type.name&&t.attrs[n]===e.attrs[n],onAppliedToParent:({tr:t,node:e,position:r,mark:o})=>{const i={...o.attrs,[n]:null},s=!Object.values(i).some((t=>!!t));if(s)return!1;const a=o.type.create(i);e.isText?t.addMark(r,r+e.nodeSize,a):t.addNodeMark(r,a)}})})),increaseFontSize:Th((({commands:t})=>{const e=Number(je(t.getFontSize())),n=Math.min(e+1,this.options.maxSize);t.applyFontSize(String(n))})),decreaseFontSize:Th((({commands:t})=>{const e=Number(je(t.getFontSize())),n=Math.max(e-1,this.options.minSize);t.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":$h("increaseFontSize"),"Mod-Shift--":$h("decreaseFontSize")}),parseHTML(){const t=t=>{if(!t)return null;const e=tm(t,je(this.options.wrapperRef));return String(e)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:t(e.getPropertyValue("--zw-font-size-mobile")),tablet:t(e.getPropertyValue("--zw-font-size-tablet")),desktop:t(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const n=t(e);return{desktop:n,tablet:n,mobile:null}}}]},renderHTML({HTMLAttributes:t}){const e=t=>t?`${t}px`:null;return Ih({font_size_mobile:e(t.mobile),font_size_tablet:e(t.tablet),font_size_desktop:e(t.desktop)})}}),xm=dd.create({name:Vd.FONT_COLOR,group:Bd.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:Th((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontColor()))),getDefaultFontColor:Th((({commands:t})=>{const e=t.getPreset();return He((()=>je(e).common.color))})),applyFontColor:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Qh(t)});return[{style:"--zw-font-color",getAttrs:t},{style:"color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({font_color:t.value})}),Sm=dd.create({name:Vd.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:Th((({commands:t})=>t.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)"))),applyBackgroundColor:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Qh(t)});return[{style:"--zw-background-color",getAttrs:t},{style:"background-color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({background_color:t.value})}),Em=Fp.create({name:"device_manager",addCommands(){return{getDevice:Th((()=>Fe(this.options,"device")))}}}),Om=dd.create({name:Vd.FONT_STYLE,group:Bd.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:Th((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultFontStyle();return He((()=>je(e)?.italic??je(n).italic))})),isItalicAvailable:Th((({commands:t})=>{const e=t.getFont(),n=t.getFontWeight();return He((()=>{const t=je(e),r=je(n);return t.isItalicSupported(r)&&!t.isWeightItalicOnly(r)}))})),getDefaultFontStyle:Th((({commands:t})=>{const e=t.getPreset();return He((()=>({italic:"italic"===je(e).common.font_style})))})),toggleItalic:Th((({commands:t})=>{je(t.isItalicAvailable())&&(je(t.isItalic())?t.removeItalic():t.applyItalic())})),applyItalic:Th((({commands:t})=>{t.applyMark(this.name,{italic:!0})})),removeItalic:Th((({commands:t})=>{t.applyMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":$h("toggleItalic"),"Mod-I":$h("toggleItalic")}),parseHTML(){const t=t=>({italic:t.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:t},{style:"font-style",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({font_style:t.italic?"italic":"normal"})}),Cm=dd.create({name:Vd.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:Th((({commands:t})=>{const e=t.getTextDecoration();return He((()=>je(e).underline))})),isStrikeThrough:Th((({commands:t})=>{const e=t.getTextDecoration();return He((()=>je(e).strike_through))})),getTextDecoration:Th((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultTextDecoration();return He((()=>{const t=je(e)??{},r=je(n);return{underline:t.underline||r.underline,strike_through:t.strike_through||r.strike_through}}))})),isUnderlineCustomized:Th((({commands:t})=>{const e=t.isUnderline(),n=t.getDefaultTextDecoration();return He((()=>je(e)!==je(n).underline))})),getDefaultTextDecoration:Th((({commands:t})=>{const e=t.getPreset();return He((()=>{const{text_decoration:t}=je(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:Th((({commands:t})=>{t.toggleTextDecoration("underline")})),toggleStrikeThrough:Th((({commands:t})=>{t.toggleTextDecoration("strike_through")})),toggleTextDecoration:Th((({commands:t},e,n=null)=>{const r=je(t.getTextDecoration()),o=n??!r[e];t.applyMark(this.name,{[e]:o})})),applyTextDecoration:Th((({commands:t},e)=>{t.toggleTextDecoration(e,!0)})),removeTextDecoration:Th((({commands:t},e)=>{t.toggleTextDecoration(e,!1)}))}},addKeyboardShortcuts:()=>({"Mod-u":$h("toggleUnderline"),"Mod-U":$h("toggleUnderline")}),parseHTML(){const t=t=>{const e=t.includes("underline"),n=t.includes("line-through");return!(!e&&!n)&&{underline:e,strike_through:n}};return[{style:"--zw-text-decoration",getAttrs:t},{style:"text-decoration-line",getAttrs:t},{style:"text-decoration",getAttrs:t},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:t}){const e=[];return t.underline&&e.push("underline"),t.strike_through&&e.push("line-through"),e.length||e.push("none"),Ih({text_decoration:e.join(" ")})}}),Am=Fp.create({name:"case_style",addCommands:()=>({applyCaseStyle:Th((({commands:t},e)=>{switch(e){case jd.CAPITALIZE:return t.applyCapitalize();case jd.LOWERCASE:return t.applyLowerCase();case jd.UPPERCASE:return t.applyUpperCase()}})),applyCapitalize:Th((({commands:t})=>{t.transformText((({text:t})=>function(t){return t.toLowerCase().replace(/(?:^|\s)\S/g,(t=>t.toUpperCase()))}(t)))})),applyLowerCase:Th((({commands:t})=>{t.transformText((({text:t})=>t.toLowerCase()))})),applyUpperCase:Th((({commands:t})=>{t.transformText((({text:t})=>t.toUpperCase()))}))})}),Nm={mobile:null,tablet:null,desktop:null},Tm=Fp.create({name:Vd.ALIGNMENT,addGlobalAttributes:()=>[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{[Vd.ALIGNMENT]:{isRequired:!1,parseHTML({style:t}){const e=function(t){const e=nm[t]||t;return zd.values.includes(e)?e:null}(t.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const n=t.getPropertyValue("--zw-alignment-mobile")||null,r=t.getPropertyValue("--zw-alignment-tablet")||null,o=t.getPropertyValue("--zw-alignment-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:t=>t.alignment?Mh({alignment_mobile:t.alignment.mobile,alignment_tablet:t.alignment.tablet,alignment_desktop:t.alignment.desktop}):null}}}],addCommands(){return{applyAlignment:Th((({commands:t},e)=>{const n=je(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},Nm)})),removeAlignment:Th((({commands:t})=>t.removeBlockAttributes(this.name))),getAlignment:Th((({commands:t})=>{const e=t.getBlockAttributes(this.name,Nm),n=t.getDevice(),r=t.getDefaultAlignment();return He((()=>je(e)?.[je(n)]??je(r)))})),getDefaultAlignment:Th((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return He((()=>je(n)[je(e)].alignment??zd.LEFT))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":$h("applyAlignment",zd.LEFT),"Mod-Shift-e":$h("applyAlignment",zd.CENTER),"Mod-Shift-r":$h("applyAlignment",zd.RIGHT),"Mod-Shift-j":$h("applyAlignment",zd.JUSTIFY)})}),Mm={mobile:null,tablet:null,desktop:null},Im=Fp.create({name:Vd.LINE_HEIGHT,addGlobalAttributes(){return[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{[Vd.LINE_HEIGHT]:{isRequired:!1,parseHTML:t=>{if(t.matches('[style*="--zw-line-height"]')){return{mobile:null,tablet:t.style.getPropertyValue("--zw-line-height-tablet")||null,desktop:t.style.getPropertyValue("--zw-line-height-desktop")||null}}const e=t.style.lineHeight;if(!e)return null;const n=em(e,t,je(this.options.wrapperRef));return n?{desktop:n,tablet:n,mobile:null}:null},renderHTML:t=>t.line_height?Mh({line_height_mobile:t.line_height.mobile,line_height_tablet:t.line_height.tablet,line_height_desktop:t.line_height.desktop}):null}}}]},addCommands(){return{getLineHeight:Th((({commands:t})=>{const e=t.getBlockAttributes(this.name,Mm),n=t.getDevice(),r=t.getDefaultLineHeight();return He((()=>je(e)?.[je(n)]??je(r)))})),getDefaultLineHeight:Th((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return He((()=>je(n)[je(e)].line_height))})),applyLineHeight:Th((({commands:t},e)=>{const n=je(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},Mm)}))}}}),$m=fd.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",kp(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:Fd.LIST_ITEM,marks:Bd.SETTINGS,addCommands(){const t=({selection:t})=>t.$cursor.before(t.$cursor.depth-1);return{listItemNewline:Th((({commands:e,tr:n})=>{const r=n.doc.nodeAt(t(n));if(!n.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=t(n);for(const t of r.marks)n.addNodeMark(o,cm(t));return!0}))}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:t=>{const{state:e,commands:n}=t.editor,r=e.selection.$cursor?.path.some((t=>t.type?.name===Fd.LIST));if(r)return n.listItemNewline()}})}),Dm=fd.create({name:Fd.LIST,content:`${Fd.LIST_ITEM}+`,group:"block list",marks:Bd.SETTINGS,addExtensions:()=>[$m],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Hd.DISC}}}),parseHTML(){const t={a:Hd.ROMAN,i:Hd.LATIN,1:Hd.DECIMAL},e=e=>{for(const n of Hd.values){const r=`.${this.options.baseClass}${n}`;if(e.matches(r))return n;if(t[e.type.toLowerCase()]===n)return n}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Hd.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Hd.DISC}})}]},renderHTML({HTMLAttributes:t}){const e=[this.options.baseClass+t.bullet.type,this.options.presetClass];return[Hd.ordered.includes(t.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands:()=>({getListType:Th((({commands:t})=>{const e=t.getBlockAttributes("bullet",{type:null});return He((()=>je(e).type??null))})),applyList:Th((({commands:t,chain:e},n)=>{if(je(t.getListType())!==n)return e().applyDefaultPreset().toggleList(Fd.LIST,Fd.LIST_ITEM).setBlockAttributes("bullet",{type:n}).command((({commands:t,tr:e})=>t._bubbleListItemMarks(e))).run();t.removeList()})),_bubbleListItemMarks:Th(((t,e)=>{const{doc:n,selection:r}=e,o=r.$from.start(),i=r.$to.end();function s(t,e){if(Vd.inlineMarks.includes(e.type))return!1;if(e.type.isInSet(t.marks))return!1;for(const n of t.content.content)if(n.childCount){if(!n.marks)return!1;if(!e.isInSet(n.marks))return!1}return!0}n.nodesBetween(o,i,((t,n)=>{if(t.type.name===Fd.LIST)return;if(t.type.name!==Fd.LIST_ITEM)return!1;const r=[];return t.forEach((o=>{for(const i of o.marks)i.isInSet(r)?e.removeNodeMark(n+1,i):s(t,i)&&(e.removeNodeMark(n+1,i),e.addNodeMark(n,cm(i)),r.push(i))})),!1}))})),removeList:Th((({commands:t,state:e})=>{const{tr:n,doc:r,selection:o}=e,i=o.$from.start(),s=o.$to.end();r.nodesBetween(i,s,((t,e,r)=>{if([Fd.LIST,Fd.LIST_ITEM].includes(t.type.name))return;if(r.type.name!==Fd.LIST_ITEM)return!1;const o=r.marks.filter((function(e){return!e.type.isInSet(t.marks)}));for(const t of o)n.addNodeMark(e,cm(t));return!1})),t.liftListItem(Fd.LIST_ITEM)}))}),addInputRules(){const t=(t,e)=>function(t){return new Mp({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=Sp(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&yl(a,t.type,i);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){const{selection:n,storedMarks:r}=e,{splittableMarks:o}=t.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){const t=i.filter((t=>o.includes(t.type.name)));s.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(e,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&wl(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}({find:e,type:this.type,getAttributes:{bullet:{type:t}},joinPredicate:(e,{attrs:n})=>n.bullet.type===t});return[t(Hd.DISC,/^\s*([-+*])\s$/),t(Hd.DECIMAL,/^(\d+)\.\s$/),t(Hd.LATIN,/^([ivx]{1,3})\.\s$/i),t(Hd.ROMAN,/^([a-z])\.\s$/i)]}});function Lm(t){return new tc({key:new rc("autolink"),appendTransaction:(e,n,r)=>{const o=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),i=e.some((t=>t.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(t,e){const n=new Pl(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}(n.doc,[...e]),{mapping:l}=a,c=function(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((({from:t,to:n})=>{const i=e.slice(o).map(t,-1),s=e.slice(o).map(n),a=e.invert().map(i,-1),l=e.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),od(r)}(a);return c.forEach((({oldRange:e,newRange:o})=>{id(e.from,e.to,n.doc).filter((e=>e.mark.type===t.type)).forEach((e=>{const o=id(l.map(e.from),l.map(e.to),r.doc).filter((e=>e.mark.type===t.type));if(!o.length)return;const i=o[0],a=n.doc.textBetween(e.from,e.to,void 0," "),c=r.doc.textBetween(i.from,i.to,void 0," "),u=Ah(a),p=Ah(c);u&&!p&&s.removeMark(i.from,i.to,t.type)}));const i=function(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}(r.doc,o,(t=>t.isTextblock));let a,c;if(i.length>1?(a=i[0],c=r.doc.textBetween(a.pos,a.pos+a.node.nodeSize,void 0," ")):i.length&&r.doc.textBetween(o.from,o.to," "," ").endsWith(" ")&&(a=i[0],c=r.doc.textBetween(a.pos,o.to,void 0," ")),a&&c){const e=c.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],r=a.pos+c.lastIndexOf(n);if(!n)return!1;Ch(n).filter((t=>t.isLink)).filter((e=>!t.validate||t.validate(e.value))).map((t=>({...t,from:r+t.start+1,to:r+t.end+1}))).forEach((e=>{s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length?s:void 0}})}const Rm=dd.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach((t=>{"string"!=typeof t?Sh(t.scheme,t.optionalSlashes):Sh(t)}))},onDestroy(){af.groups={},xh.scanner=null,xh.parser=null,xh.tokenQueue=[],xh.pluginQueue=[],xh.customSchemes=[],xh.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",kp(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[hd({find:t=>Ch(t).filter((t=>!this.options.validate||this.options.validate(t.value))).filter((t=>t.isLink)).map((t=>({text:t.value,index:t.start,data:t}))),type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];var e;return this.options.autolink&&t.push(Lm({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new tc({key:new rc("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i,s;if(1!==r.button)return!1;const a=rd(t.state,e.type.name),l=null===(o=r.target)||void 0===o?void 0:o.closest("a"),c=null!==(i=null==l?void 0:l.href)&&void 0!==i?i:a.href,u=null!==(s=null==l?void 0:l.target)&&void 0!==s?s:a.target;return!(!l||!c||(window.open(c,u),0))}}}))),this.options.linkOnPaste&&t.push(function(t){return new tc({key:new rc("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const l=Ch(a).find((t=>t.isLink&&t.value===a));return!(!a||!l||(t.editor.commands.setMark(t.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),t}}),Pm=Rm.extend({name:Vd.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:t=>{const e=t.getAttribute("href");return e.startsWith("#")?parseFloat(t.getAttribute("href").replace("#","")):e}},target:{default:Wd.SELF,parseHTML:t=>t.getAttribute("target")||Wd.SELF},destination:{default:Ud.URL,parseHTML:t=>{const e=t.getAttribute("href");if(!e.startsWith("#"))return Ud.URL;const n=e.replace("#","");return je(this.options.pageBlocks).find((t=>t.id===parseInt(n)))?Ud.BLOCK:Ud.URL}}}},addCommands(){const{unsetLink:t}=this.parent();return{removeLink:t,applyLink:Th((({commands:t,chain:e},n)=>(t.setMeta("preventAutolink",!0),t.getSelectedText()?e().applyMark(this.name,n).expandSelectionToLink().command((({tr:t})=>(n.text&&t.insertText(n.text,t.selection.from,t.selection.to),!0))).run():t.insertContent(Gm.text(n.text,[Gm.mark(Vd.LINK,n)]))))),expandSelectionToLink:Th((({commands:t})=>{t.expandSelection((({node:t})=>this.type.isInSet(t.marks)))})),isLink:Th((({commands:t})=>t.hasMark(this.name))),getLinkPreset:Th((()=>He((()=>this.options.preset))))}},addProseMirrorPlugins(){return[...this.parent(),Nh.create(this.editor)]},renderHTML({HTMLAttributes:t}){const e=t.destination===Ud.BLOCK?`#${t.href}`:t.href,n=je(this.options.basePresetClass)+je(this.options.preset).id;return["a",{href:e,target:t.target,class:`${n} zw-style`},0]}}),jm=dd.create({name:Vd.SUPERSCRIPT,addCommands(){return{applySuperscript:Th((({commands:t})=>{t.setMark(this.name)})),removeSuperscript:Th((({commands:t})=>{t.unsetMark(this.name)})),toggleSuperscript:Th((({commands:t})=>{je(t.isSuperscript())?t.removeSuperscript():t.applySuperscript()})),isSuperscript:Th((({commands:t})=>{const e=t.getMark(this.name);return He((()=>!!je(e)))}))}},parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML:()=>["sup",{class:"zw-superscript"},0]}),zm=Fp.create({name:Vd.MARGIN,addGlobalAttributes:()=>[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{[Vd.MARGIN]:{isRequired:!1,parseHTML(t){const{margin:e,marginTop:n,marginRight:r,marginBottom:o,marginLeft:i}=t.style;if(![e,n,r,o,i].some((t=>!!t)))return null;if(e)return{value:e};return{value:[n||0,r||0,o||0,i||0].join(" ")}},renderHTML:t=>t.margin?Mh({margin:t.margin.value}):null}}}]}),Fm=Fp.create({name:"ai_component",addCommands(){return{getAiSettings:Th((()=>this.options.aiComponent.settings)),generateText:Th((async({commands:t},{prompt:e,context:n,instructions:r})=>{const o=this.options.aiComponent,i=await o.generateText({prompt:e,context:n,instructions:r});return i.content=i.content.replace(/\n/g,""),i}))}}});function Hm(t){const e=e=>t.presetsRef.value.find((t=>t.id===e)),n=function(t){return Me(t,!1),t}({default:null,link:null});return Je(t.presetsRef,(()=>{n.default=e(t.defaultPresetId),n.link=e(t.linkPresetId)}),{immediate:!0}),[fm,mm,vm,md,Rd,um,pm,dm,ym].concat([bm.configure({presets:t.presetsRef,defaultId:t.defaultPresetId,styleRenderer:new Ym({baseClass:t.basePresetClass,makeVariable:t.makePresetVariable,linkPresetId:t.linkPresetId})}),Fm.configure({aiComponent:t.aiComponent}),Dm.configure({baseClass:t.baseListClass,presetClass:t.basePresetClass+t.defaultPresetId}),Em.configure({device:t.deviceRef}),km.configure({minSize:t.minFontSize,maxSize:t.maxFontSize,wrapperRef:t.wrapperRef}),_m.configure({fonts:t.fonts,defaultPreset:Fe(n,"default")}),wm,xm,Sm,Om,Cm,Am,jm,Tm,Im.configure({wrapperRef:t.wrapperRef}),Pm.configure({preset:Fe(n,"link"),basePresetClass:t.basePresetClass,pageBlocks:t.pageBlocksRef}),zm])}class Vm{_domParser=new DOMParser;types=window;parse(t){return this._domParser.parseFromString(t,"text/html")}}class Bm{content;constructor({content:t}){this.content=t}normalize(){throw new Error("Implement abstract method")}}class Wm extends Bm{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=Wm.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:t,parser:e}){super({content:t}),this._parser=e,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,(t=>"BR"===t.tagName)),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,(t=>"LI"===t.tagName)),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const t=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(t,(t=>t.remove()))}_normalizeRootTags(){const t=Array.from(this.dom.body.childNodes),e=this.dom.createDocumentFragment();let n;for(const r of t)this._isRootNode(r)?(e.append(r),n=null):(n||(n=this.dom.createElement("p"),e.append(n)),n.append(r));this.dom.body.innerHTML="",this.dom.body.append(e)}_createNodeIterator(t,e){return this.dom.createNodeIterator(this.dom.body,t,e)}_iterateNodes(t,e=(()=>!0)){const n=t=>"BODY"!==t.tagName&&e.call(this,t),r=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:t=>n(t)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(r,t)}_runIterator(t,e){let n=t.nextNode();for(;n;)e.call(this,n),n=t.nextNode()}_removeEmptyNodes(t){t.innerHTML.trim()||t.remove()}_normalizeListItems(t){const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes);let r,o;const i=n=>{this._assignElementProperties(n,t,Wm.BLOCK_STYLES),e.append(n)};this._assignElementProperties(t,t.parentElement,Wm.BLOCK_STYLES);for(const t of n)if(this._isBlockNode(t))i(t),r=null,o=t;else if("BR"===t.tagName&&o&&"BR"!==o?.tagName)t.remove(),o=t;else if("BR"!==t.tagName)r||(r=this.dom.createElement("p"),i(r)),r.append(t),o=t;else{const e=this.dom.createElement("p");e.append(t),i(e),r=null,o=t}t.append(e),this._removeStyleProperties(t,Wm.BLOCK_STYLES)}_isBlockNode(t){return Wm.BLOCK_NODE_NAMES.includes(t.tagName)}_isRootNode(t){return Wm.ROOT_NODE_NAMES.includes(t.tagName)}_assignElementProperties(t,e,n){for(const r of n){const n=e.style.getPropertyValue(r);n&&!t.style.getPropertyValue(r)&&t.style.setProperty(r,n)}}_removeStyleProperties(t,e){for(const n of e)t.style.removeProperty(n);0===t.style.length&&t.removeAttribute("style")}_normalizeBreakLines({parentElement:t}){if(!this._isBlockNode(t))return;if(!t.textContent)return;const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes),r=t.cloneNode(!0);r.innerHTML="";let o=r.cloneNode();const i=n=>{this._assignElementProperties(n,t,Wm.BLOCK_STYLES),e.append(n)};for(const t of n)"BR"!==t.tagName?o.append(t):(i(o),o=r.cloneNode());e.append(o),t.replaceWith(e)}_normalizeBlockTextDecoration(){const t=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveTextDecorationToChildren(e)}_moveTextDecorationToChildren(t){const e=this._parseTextDecoration(t);if(t.style.removeProperty("text-decoration-line"),t.style.removeProperty("text-decoration"),t.style.cssText||t.removeAttribute("style"),!e.none)for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=this._parseTextDecoration(r),i={underline:o.underline||e.underline,line_through:o.line_through||e.line_through};r.style.removeProperty("text-decoration-line"),r.style.removeProperty("text-decoration"),r.style.textDecoration=Object.entries(i).filter((([,t])=>t)).map((([t])=>t.replace("_","-"))).join(" ")}}_parseTextDecoration(t){const{textDecoration:e,textDecorationLine:n}=t.style,r=e||n||"";return{none:r.includes("none"),underline:r.includes("underline"),line_through:r.includes("line-through")}}_normalizeBlockBackgroundColor(){const t=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveBackgroundColorToChildren(e)}_moveBackgroundColorToChildren(t){const e=t.style.backgroundColor;t.style.removeProperty("background-color"),t.style.cssText||t.removeAttribute("style");for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=r.style.backgroundColor||e;r.style.backgroundColor=o}}_wrapTextNode(t,e){if(e.nodeType!==this._Node.TEXT_NODE)return e;const n=this.dom.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}}class Um extends Bm{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(t){this._iterateChildNodes(this.content,t)}_iterateChildNodes(t,e){for(const n of t.content)n.content&&this._iterateChildNodes(n,e),e.call(this,n)}_bubbleMarks(t){if(t.content&&t.type!==Fd.LIST)for(const e of t.content)if(!this._isLink(e)&&e.marks)for(const n of e.marks.slice())this._includesMark(t,n)?this._removeMark(e,n):this._canBubbleMark(t,n)&&(this._removeMark(e,n),this._addMark(t,n))}_canBubbleMark(t,e){if(Vd.inlineMarks.includes(e.type))return!1;if(this._includesMarkType(t,e.type))return!1;for(const n of t.content)if(n.content||t.type!==Fd.LIST_ITEM){if(!n.marks)return!1;if(!this._includesMark(n,e))return!1}return!0}_includesMark(t,e){return t.marks?.some((t=>lm.isEqual(t,e)))??!1}_includesMarkType(t,e){return t.marks?.some((t=>t.type===e))??!1}_isLink(t){return t.type===Fd.TEXT&&this._includesMarkType(t,Vd.LINK)}_removeMark(t,e){if(!t.marks)return;const n=this._findMarkIndexByType(t,e.type);n>=0&&t.marks.splice(n,1),t.marks.length||delete t.marks}_addMark(t,e){this._removeMark(t,e),t.marks??=[],t.marks.push(e)}_findMarkIndexByType(t,e){return t.marks?.findIndex((t=>t.type===e))??null}}class qm{static build(t,e={}){return"string"==typeof t?this._buildHtml(t,e):this._buildJson(t)}static _buildHtml(t,e){return new Wm({content:t,parser:e.parser||new Vm})}static _buildJson(t){return new Um({content:t})}static normalize(t,e={}){return qm.build(t,e).normalize()}}class Km{static window=globalThis.window;static use(t){this.window=t}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(t){return this.window.getComputedStyle(t)}}class Jm{static build({config:t,nodeDomParser:e}){const n=function(t,e){return Cp(Pp.resolve(t),e)}(Hm({fonts:t.fonts,minFontSize:0,maxFontSize:0,presetsRef:Pe(t.presets),defaultPresetId:t.defaultPresetId,linkPresetId:t.linkPresetId,makePresetVariable:()=>"",basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:Pe(Pd.DESKTOP),pageBlocksRef:Pe([]),wrapperRef:Km.document.createElement("p")}));return new Jm({schema:n,domParser:Fa.fromSchema(n),nodeDomParser:e})}_schema;_domParser;_nodeDomParser;constructor({schema:t,domParser:e,nodeDomParser:n}){this._schema=t,this._domParser=e,this._nodeDomParser=n}toJSON(t){const e=qm.build(t,{parser:this._nodeDomParser});return e.normalizeHTML(),this._domParser.parse(e.dom.body).toJSON()}}class Gm{static doc(t){return{type:Fd.DOCUMENT,content:t}}static list(t,e){return{type:Fd.LIST,attrs:{bullet:{type:t}},content:e.map((t=>t.type===Fd.LIST_ITEM?t:this.listItem([].concat(t))))}}static listItem(...t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{type:Fd.LIST_ITEM,...e?{attrs:e}:{},...r?{marks:r}:{},content:[].concat(n).map((t=>"string"==typeof t?this.paragraph(t):t))}}static heading(t,...e){const n=this._textBlock(e,this.text);return n.attrs??={},n.attrs.level=t,{type:Fd.HEADING,...n}}static paragraph(...t){return{type:Fd.PARAGRAPH,...this._textBlock(t,this.text)}}static _textBlock(t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{content:"string"==typeof n?[this.text(n)]:n,...e?{attrs:e}:{},...r?{marks:r}:{}}}static _normalizeTextBlockArgs(t){return 1===t.length?{attrs:null,marks:null,content:t[0]}:2===t.length?{attrs:t[0],marks:null,content:t[1]}:{attrs:t[0],marks:t[1],content:t[2]}}static text(t,e){return{type:Fd.TEXT,...e?{marks:e}:{},text:t}}static link(t,e,n=[]){return this.text(t,[this.mark(Vd.LINK,e),...n])}static mark(t,e){return{type:t,attrs:e}}static populateAllDevices(t){return{mobile:t,tablet:t,desktop:t}}}class Ym{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:t,makeVariable:e,linkPresetId:n}){this._baseClass=t,this._makeVariable=e,this._linkPresetId=n}inject(t,e){let n=t.querySelector("[data-zw-styles]");n||(n=Km.document.createElement("style"),n.dataset.zwStyles="",n.innerHTML=this.render(e),t.append(n))}render(t){let e="";for(const n of t){const t=n.id===this._linkPresetId;e+=` ${this.makePresetCssClass(n)} {`;for(const r of Pd.values)for(const o of Object.keys(n[r])){const i=this._makeVariable({device:r,preset:n,property:o}),s=this._makeInternalVariableName(o,r);if(e+=`${s}: var(${i}, inherit);`,t&&!Vd.attributes.includes(o)){e+=`${s.replace("preset-","")}: var(${s});`}}e+="}"}return e}_makeInternalVariableName(t,e){return`--zw-preset-${"color"===t?"font-color":t.replace(/_/i,"-")}${e===Pd.COMMON?"":`-${e}`}`}makePresetHtmlClass(t){return this._baseClass+t.id}makePresetCssClass(t){return this.makePresetHtmlClass(t).split(" ").map((t=>`.${t}`)).join("")}}class Xm{static _instance;static get instance(){return this._instance??=new Xm,this._instance}static query(t,e){return this.instance.query(t,e)}query(t,e){let n=null;return t.descendants((t=>!n&&(this.matchNode(t,e)?(n=t,!1):void 0))),n?e.getMark?this.getMark(n,e.getMark):n:null}matchNode(t,e){return(!e.typeName||e.typeName===t.type.name)&&!(e.mark&&!this.getMark(t,e.mark))}getMark(t,e){return t.marks.find((t=>this.matchMark(t,e)))||null}matchMark(t,e){return t.type.name===e.typeName}}class Zm{static createWindow(){return(new i.JSDOM).window}types;parse(t){const{window:e}=new i.JSDOM(t);return this.types=e,e.document}}class Qm{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(t){if(!this.name)throw new Error('Command "name" is required');let e=t.command(this.name);if(this.description&&(e=e.description(this.description)),this.argument&&(e=e.argument(this.argument)),this.options.length)for(const t of this.options)e=e.option(t.flags,t.description,t.default);e.action(this.doCommand.bind(this))}output(t){console.log(t)}}const tg=new W,eg=[class extends Qm{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:n.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(t,{config:e,format:r}){Km.use(Zm.createWindow());const o=n.resolve(process.cwd(),e),i=Jm.build({config:require(o).editor,nodeDomParser:new Zm}),s=t.map((t=>i.toJSON(this._formatInputHtml(t)))),a=1===s.length?s[0]:s,l=this._stringifyContent(a);this.output("rb"===r?this._formatOutputRb(l):l)}_formatInputHtml(t){return t.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,((t,e)=>t.replace(e,parseFloat(e)/100)))}_stringifyContent(t){return JSON.stringify(t,((t,e)=>null===e?void 0:e),2)}_formatOutputRb(t){return t.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,(t=>t.replace(/"/g,""))).replace(/: "(.+)"([,\n])/g,": '$1'$2")}},class extends Qm{name="version";description="display cli version";doCommand(){this.output("3.5.4-ai-prototype")}}];for(const t of eg)(new t).install(tg);tg.parse();
15
+ sm={get exports(){return lm},set exports(t){lm=t}},am=lm,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",o=16,i=32,a=64,l=128,c=256,u=1/0,p=9007199254740991,d=NaN,f=4294967295,h=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",i],["partialRight",a],["rearg",c]],m="[object Arguments]",g="[object Array]",v="[object Boolean]",y="[object Date]",_="[object Error]",b="[object Function]",w="[object GeneratorFunction]",k="[object Map]",x="[object Number]",S="[object Object]",E="[object Promise]",O="[object RegExp]",C="[object Set]",A="[object String]",N="[object Symbol]",T="[object WeakMap]",M="[object ArrayBuffer]",I="[object DataView]",$="[object Float32Array]",D="[object Float64Array]",L="[object Int8Array]",R="[object Int16Array]",P="[object Int32Array]",j="[object Uint8Array]",z="[object Uint8ClampedArray]",F="[object Uint16Array]",H="[object Uint32Array]",V=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,K=RegExp(U.source),J=RegExp(q.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ut=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,ft=/^[-+]0x[0-9a-f]+$/i,ht=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_t=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Ot="\\ufe0e\\ufe0f",Ct="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",At="['’]",Nt="["+wt+"]",Tt="["+Ct+"]",Mt="["+kt+"]",It="\\d+",$t="["+xt+"]",Dt="["+St+"]",Lt="[^"+wt+Ct+It+xt+St+Et+"]",Rt="\\ud83c[\\udffb-\\udfff]",Pt="[^"+wt+"]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",zt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Et+"]",Ht="\\u200d",Vt="(?:"+Dt+"|"+Lt+")",Bt="(?:"+Ft+"|"+Lt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",qt="(?:"+Mt+"|"+Rt+")?",Kt="["+Ot+"]?",Jt=Kt+qt+"(?:"+Ht+"(?:"+[Pt,jt,zt].join("|")+")"+Kt+qt+")*",Gt="(?:"+[$t,jt,zt].join("|")+")"+Jt,Yt="(?:"+[Pt+Mt+"?",Mt,jt,zt,Nt].join("|")+")",Xt=RegExp(At,"g"),Zt=RegExp(Mt,"g"),Qt=RegExp(Rt+"(?="+Rt+")|"+Yt+Jt,"g"),te=RegExp([Ft+"?"+Dt+"+"+Wt+"(?="+[Tt,Ft,"$"].join("|")+")",Bt+"+"+Ut+"(?="+[Tt,Ft+Vt,"$"].join("|")+")",Ft+"?"+Vt+"+"+Wt,Ft+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It,Gt].join("|"),"g"),ee=RegExp("["+Ht+wt+kt+Ot+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ie={};ie[$]=ie[D]=ie[L]=ie[R]=ie[P]=ie[j]=ie[z]=ie[F]=ie[H]=!0,ie[m]=ie[g]=ie[M]=ie[v]=ie[I]=ie[y]=ie[_]=ie[b]=ie[k]=ie[x]=ie[S]=ie[O]=ie[C]=ie[A]=ie[T]=!1;var se={};se[m]=se[g]=se[M]=se[I]=se[v]=se[y]=se[$]=se[D]=se[L]=se[R]=se[P]=se[k]=se[x]=se[S]=se[O]=se[C]=se[A]=se[N]=se[j]=se[z]=se[F]=se[H]=!0,se[_]=se[b]=se[T]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,ue="object"==typeof s&&s&&s.Object===Object&&s,pe="object"==typeof self&&self&&self.Object===Object&&self,de=ue||pe||Function("return this")(),fe=am&&!am.nodeType&&am,he=fe&&sm&&!sm.nodeType&&sm,me=he&&he.exports===fe,ge=me&&ue.process,ve=function(){try{var t=he&&he.require&&he.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=ve&&ve.isArrayBuffer,_e=ve&&ve.isDate,be=ve&&ve.isMap,we=ve&&ve.isRegExp,ke=ve&&ve.isSet,xe=ve&&ve.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(r,s,n(s),t)}return r}function Oe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ce(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ne(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function Te(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function Me(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Ie(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function $e(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function De(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function Le(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function Re(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Pe=We("length");function je(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function ze(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Fe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):ze(t,Ve,n)}function He(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Ve(t){return t!=t}function Be(t,e){var n=null==t?0:t.length;return n?Ke(t,e)/n:d}function We(e){return function(n){return null==n?t:n[e]}}function Ue(e){return function(n){return null==e?t:e[n]}}function qe(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Ke(e,n){for(var r,o=-1,i=e.length;++o<i;){var s=n(e[o]);s!==t&&(r=r===t?s:r+s)}return r}function Je(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ge(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function Ye(t){return function(e){return t(e)}}function Xe(t,e){return Ie(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function Qe(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var nn=Ue({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rn=Ue({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(t){return"\\"+ae[t]}function sn(t){return ee.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function ln(t,e){return function(n){return t(e(n))}}function cn(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==r||(t[n]=r,s[i++]=n)}return s}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function pn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function dn(t){return sn(t)?function(t){for(var e=Qt.lastIndex=0;Qt.test(t);)++e;return e}(t):Pe(t)}function fn(t){return sn(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var mn=Ue({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),gn=function s(ot){var wt=(ot=null==ot?de:gn.defaults(de.Object(),ot,gn.pick(de,re))).Array,kt=ot.Date,xt=ot.Error,St=ot.Function,Et=ot.Math,Ot=ot.Object,Ct=ot.RegExp,At=ot.String,Nt=ot.TypeError,Tt=wt.prototype,Mt=St.prototype,It=Ot.prototype,$t=ot["__core-js_shared__"],Dt=Mt.toString,Lt=It.hasOwnProperty,Rt=0,Pt=function(){var t=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),jt=It.toString,zt=Dt.call(Ot),Ft=de._,Ht=Ct("^"+Dt.call(Lt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=me?ot.Buffer:t,Bt=ot.Symbol,Wt=ot.Uint8Array,Ut=Vt?Vt.allocUnsafe:t,qt=ln(Ot.getPrototypeOf,Ot),Kt=Ot.create,Jt=It.propertyIsEnumerable,Gt=Tt.splice,Yt=Bt?Bt.isConcatSpreadable:t,Qt=Bt?Bt.iterator:t,ee=Bt?Bt.toStringTag:t,ae=function(){try{var t=fi(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=ot.clearTimeout!==de.clearTimeout&&ot.clearTimeout,pe=kt&&kt.now!==de.Date.now&&kt.now,fe=ot.setTimeout!==de.setTimeout&&ot.setTimeout,he=Et.ceil,ge=Et.floor,ve=Ot.getOwnPropertySymbols,Pe=Vt?Vt.isBuffer:t,Ue=ot.isFinite,vn=Tt.join,yn=ln(Ot.keys,Ot),_n=Et.max,bn=Et.min,wn=kt.now,kn=ot.parseInt,xn=Et.random,Sn=Tt.reverse,En=fi(ot,"DataView"),On=fi(ot,"Map"),Cn=fi(ot,"Promise"),An=fi(ot,"Set"),Nn=fi(ot,"WeakMap"),Tn=fi(Ot,"create"),Mn=Nn&&new Nn,In={},$n=Fi(En),Dn=Fi(On),Ln=Fi(Cn),Rn=Fi(An),Pn=Fi(Nn),jn=Bt?Bt.prototype:t,zn=jn?jn.valueOf:t,Fn=jn?jn.toString:t;function Hn(t){if(ra(t)&&!qs(t)&&!(t instanceof Un)){if(t instanceof Wn)return t;if(Lt.call(t,"__wrapped__"))return Hi(t)}return new Wn(t)}var Vn=function(){function e(){}return function(n){if(!na(n))return{};if(Kt)return Kt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Bn(){}function Wn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Yn(t){var e=this.__data__=new Kn(t);this.size=e.size}function Xn(t,e){var n=qs(t),r=!n&&Us(t),o=!n&&!r&&Ys(t),i=!n&&!r&&!o&&pa(t),s=n||r||o||i,a=s?Je(t.length,At):[],l=a.length;for(var c in t)!e&&!Lt.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||bi(c,l))||a.push(c);return a}function Zn(e){var n=e.length;return n?e[Gr(0,n-1)]:t}function Qn(t,e){return Pi(Mo(t),lr(e,0,t.length))}function tr(t){return Pi(Mo(t))}function er(e,n,r){(r!==t&&!Vs(e[n],r)||r===t&&!(n in e))&&sr(e,n,r)}function nr(e,n,r){var o=e[n];Lt.call(e,n)&&Vs(o,r)&&(r!==t||n in e)||sr(e,n,r)}function rr(t,e){for(var n=t.length;n--;)if(Vs(t[n][0],e))return n;return-1}function or(t,e,n,r){return fr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function ir(t,e){return t&&Io(e,$a(e),t)}function sr(t,e,n){"__proto__"==e&&ae?ae(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(e,n){for(var r=-1,o=n.length,i=wt(o),s=null==e;++r<o;)i[r]=s?t:Aa(e,n[r]);return i}function lr(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function cr(e,n,r,o,i,s){var a,l=1&n,c=2&n,u=4&n;if(r&&(a=i?r(e,o,i,s):r(e)),a!==t)return a;if(!na(e))return e;var p=qs(e);if(p){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return Mo(e,a)}else{var d=gi(e),f=d==b||d==w;if(Ys(e))return Eo(e,l);if(d==S||d==m||f&&!i){if(a=c||f?{}:yi(e),!l)return c?function(t,e){return Io(t,mi(t),e)}(e,function(t,e){return t&&Io(e,Da(e),t)}(a,e)):function(t,e){return Io(t,hi(t),e)}(e,ir(a,e))}else{if(!se[d])return i?e:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case M:return Oo(t);case v:case y:return new o(+t);case I:return function(t,e){var n=e?Oo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case $:case D:case L:case R:case P:case j:case z:case F:case H:return Co(t,n);case k:return new o;case x:case A:return new o(t);case O:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new o;case N:return r=t,zn?Ot(zn.call(r)):{}}}(e,d,l)}}s||(s=new Yn);var h=s.get(e);if(h)return h;s.set(e,a),la(e)?e.forEach((function(t){a.add(cr(t,n,r,t,e,s))})):oa(e)&&e.forEach((function(t,o){a.set(o,cr(t,n,r,o,e,s))}));var g=p?t:(u?c?si:ii:c?Da:$a)(e);return Oe(g||e,(function(t,o){g&&(t=e[o=t]),nr(a,o,cr(t,n,r,o,e,s))})),a}function ur(e,n,r){var o=r.length;if(null==e)return!o;for(e=Ot(e);o--;){var i=r[o],s=n[i],a=e[i];if(a===t&&!(i in e)||!s(a))return!1}return!0}function pr(n,r,o){if("function"!=typeof n)throw new Nt(e);return $i((function(){n.apply(t,o)}),r)}function dr(t,e,n,r){var o=-1,i=Te,s=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=Ie(e,Ye(n))),r?(i=Me,s=!1):e.length>=200&&(i=Ze,s=!1,e=new Gn(e));t:for(;++o<a;){var u=t[o],p=null==n?u:n(u);if(u=r||0!==u?u:0,s&&p==p){for(var d=c;d--;)if(e[d]===p)continue t;l.push(u)}else i(e,p,r)||l.push(u)}return l}Hn.templateSettings={escape:G,evaluate:Y,interpolate:X,variable:"",imports:{_:Hn}},Hn.prototype=Bn.prototype,Hn.prototype.constructor=Hn,Wn.prototype=Vn(Bn.prototype),Wn.prototype.constructor=Wn,Un.prototype=Vn(Bn.prototype),Un.prototype.constructor=Un,qn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(e){var r=this.__data__;if(Tn){var o=r[e];return o===n?t:o}return Lt.call(r,e)?r[e]:t},qn.prototype.has=function(e){var n=this.__data__;return Tn?n[e]!==t:Lt.call(n,e)},qn.prototype.set=function(e,r){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Tn&&r===t?n:r,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0||(n==e.length-1?e.pop():Gt.call(e,n,1),--this.size,0))},Kn.prototype.get=function(e){var n=this.__data__,r=rr(n,e);return r<0?t:n[r][1]},Kn.prototype.has=function(t){return rr(this.__data__,t)>-1},Kn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(On||Kn),string:new qn}},Jn.prototype.delete=function(t){var e=pi(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return pi(this,t).get(t)},Jn.prototype.has=function(t){return pi(this,t).has(t)},Jn.prototype.set=function(t,e){var n=pi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(t){return this.__data__.set(t,n),this},Gn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Kn){var r=n.__data__;if(!On||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var fr=Lo(wr),hr=Lo(kr,!0);function mr(t,e){var n=!0;return fr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function gr(e,n,r){for(var o=-1,i=e.length;++o<i;){var s=e[o],a=n(s);if(null!=a&&(l===t?a==a&&!ua(a):r(a,l)))var l=a,c=s}return c}function vr(t,e){var n=[];return fr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function yr(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=_i),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?yr(a,e-1,n,r,o):$e(o,a):r||(o[o.length]=a)}return o}var _r=Ro(),br=Ro(!0);function wr(t,e){return t&&_r(t,e,$a)}function kr(t,e){return t&&br(t,e,$a)}function xr(t,e){return Ne(e,(function(e){return Qs(t[e])}))}function Sr(e,n){for(var r=0,o=(n=wo(n,e)).length;null!=e&&r<o;)e=e[zi(n[r++])];return r&&r==o?e:t}function Er(t,e,n){var r=e(t);return qs(t)?r:$e(r,n(t))}function Or(e){return null==e?e===t?"[object Undefined]":"[object Null]":ee&&ee in Ot(e)?function(e){var n=Lt.call(e,ee),r=e[ee];try{e[ee]=t;var o=!0}catch(t){}var i=jt.call(e);return o&&(n?e[ee]=r:delete e[ee]),i}(e):function(t){return jt.call(t)}(e)}function Cr(t,e){return t>e}function Ar(t,e){return null!=t&&Lt.call(t,e)}function Nr(t,e){return null!=t&&e in Ot(t)}function Tr(e,n,r){for(var o=r?Me:Te,i=e[0].length,s=e.length,a=s,l=wt(s),c=1/0,u=[];a--;){var p=e[a];a&&n&&(p=Ie(p,Ye(n))),c=bn(p.length,c),l[a]=!r&&(n||i>=120&&p.length>=120)?new Gn(a&&p):t}p=e[0];var d=-1,f=l[0];t:for(;++d<i&&u.length<c;){var h=p[d],m=n?n(h):h;if(h=r||0!==h?h:0,!(f?Ze(f,m):o(u,m,r))){for(a=s;--a;){var g=l[a];if(!(g?Ze(g,m):o(e[a],m,r)))continue t}f&&f.push(m),u.push(h)}}return u}function Mr(e,n,r){var o=null==(e=Ni(e,n=wo(n,e)))?e:e[zi(Zi(n))];return null==o?t:Se(o,e,r)}function Ir(t){return ra(t)&&Or(t)==m}function $r(e,n,r,o,i){return e===n||(null==e||null==n||!ra(e)&&!ra(n)?e!=e&&n!=n:function(e,n,r,o,i,s){var a=qs(e),l=qs(n),c=a?g:gi(e),u=l?g:gi(n),p=(c=c==m?S:c)==S,d=(u=u==m?S:u)==S,f=c==u;if(f&&Ys(e)){if(!Ys(n))return!1;a=!0,p=!1}if(f&&!p)return s||(s=new Yn),a||pa(e)?ri(e,n,r,o,i,s):function(t,e,n,r,o,i,s){switch(n){case I:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case M:return!(t.byteLength!=e.byteLength||!i(new Wt(t),new Wt(e)));case v:case y:case x:return Vs(+t,+e);case _:return t.name==e.name&&t.message==e.message;case O:case A:return t==e+"";case k:var a=an;case C:var l=1&r;if(a||(a=un),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=2,s.set(t,e);var u=ri(a(t),a(e),r,o,i,s);return s.delete(t),u;case N:if(zn)return zn.call(t)==zn.call(e)}return!1}(e,n,c,r,o,i,s);if(!(1&r)){var h=p&&Lt.call(e,"__wrapped__"),b=d&&Lt.call(n,"__wrapped__");if(h||b){var w=h?e.value():e,E=b?n.value():n;return s||(s=new Yn),i(w,E,r,o,s)}}return!!f&&(s||(s=new Yn),function(e,n,r,o,i,s){var a=1&r,l=ii(e),c=l.length,u=ii(n),p=u.length;if(c!=p&&!a)return!1;for(var d=c;d--;){var f=l[d];if(!(a?f in n:Lt.call(n,f)))return!1}var h=s.get(e),m=s.get(n);if(h&&m)return h==n&&m==e;var g=!0;s.set(e,n),s.set(n,e);for(var v=a;++d<c;){var y=e[f=l[d]],_=n[f];if(o)var b=a?o(_,y,f,n,e,s):o(y,_,f,e,n,s);if(!(b===t?y===_||i(y,_,r,o,s):b)){g=!1;break}v||(v="constructor"==f)}if(g&&!v){var w=e.constructor,k=n.constructor;w==k||!("constructor"in e)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof k&&k instanceof k||(g=!1)}return s.delete(e),s.delete(n),g}(e,n,r,o,i,s))}(e,n,r,o,$r,i))}function Dr(e,n,r,o){var i=r.length,s=i,a=!o;if(null==e)return!s;for(e=Ot(e);i--;){var l=r[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){var c=(l=r[i])[0],u=e[c],p=l[1];if(a&&l[2]){if(u===t&&!(c in e))return!1}else{var d=new Yn;if(o)var f=o(u,p,c,e,n,d);if(!(f===t?$r(p,u,3,o,d):f))return!1}}return!0}function Lr(t){return!(!na(t)||(e=t,Pt&&Pt in e))&&(Qs(t)?Ht:mt).test(Fi(t));var e}function Rr(t){return"function"==typeof t?t:null==t?il:"object"==typeof t?qs(t)?Vr(t[0],t[1]):Hr(t):hl(t)}function Pr(t){if(!Ei(t))return yn(t);var e=[];for(var n in Ot(t))Lt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function jr(t){if(!na(t))return function(t){var e=[];if(null!=t)for(var n in Ot(t))e.push(n);return e}(t);var e=Ei(t),n=[];for(var r in t)("constructor"!=r||!e&&Lt.call(t,r))&&n.push(r);return n}function zr(t,e){return t<e}function Fr(t,e){var n=-1,r=Js(t)?wt(t.length):[];return fr(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function Hr(t){var e=di(t);return 1==e.length&&e[0][2]?Ci(e[0][0],e[0][1]):function(n){return n===t||Dr(n,t,e)}}function Vr(e,n){return ki(e)&&Oi(n)?Ci(zi(e),n):function(r){var o=Aa(r,e);return o===t&&o===n?Na(r,e):$r(n,o,3)}}function Br(e,n,r,o,i){e!==n&&_r(n,(function(s,a){if(i||(i=new Yn),na(s))!function(e,n,r,o,i,s,a){var l=Mi(e,r),c=Mi(n,r),u=a.get(c);if(u)er(e,r,u);else{var p=s?s(l,c,r+"",e,n,a):t,d=p===t;if(d){var f=qs(c),h=!f&&Ys(c),m=!f&&!h&&pa(c);p=c,f||h||m?qs(l)?p=l:Gs(l)?p=Mo(l):h?(d=!1,p=Eo(c,!0)):m?(d=!1,p=Co(c,!0)):p=[]:sa(c)||Us(c)?(p=l,Us(l)?p=_a(l):na(l)&&!Qs(l)||(p=yi(c))):d=!1}d&&(a.set(c,p),i(p,c,o,s,a),a.delete(c)),er(e,r,p)}}(e,n,a,r,Br,o,i);else{var l=o?o(Mi(e,a),s,a+"",e,n,i):t;l===t&&(l=s),er(e,a,l)}}),Da)}function Wr(e,n){var r=e.length;if(r)return bi(n+=n<0?r:0,r)?e[n]:t}function Ur(t,e,n){e=e.length?Ie(e,(function(t){return qs(t)?function(e){return Sr(e,1===t.length?t[0]:t)}:t})):[il];var r=-1;e=Ie(e,Ye(ui()));var o=Fr(t,(function(t,n,o){var i=Ie(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,s=o.length,a=n.length;++r<s;){var l=Ao(o[r],i[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Sr(t,s);n(a,s)&&to(i,wo(s,t),a)}return i}function Kr(t,e,n,r){var o=r?He:Fe,i=-1,s=e.length,a=t;for(t===e&&(e=Mo(e)),n&&(a=Ie(t,Ye(n)));++i<s;)for(var l=0,c=e[i],u=n?n(c):c;(l=o(a,u,l,r))>-1;)a!==t&&Gt.call(a,l,1),Gt.call(t,l,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;bi(o)?Gt.call(t,o,1):fo(t,o)}}return t}function Gr(t,e){return t+ge(xn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>p)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Di(Ai(t,e,il),t+"")}function Zr(t){return Zn(Va(t))}function Qr(t,e){var n=Va(t);return Pi(n,lr(e,0,n.length))}function to(e,n,r,o){if(!na(e))return e;for(var i=-1,s=(n=wo(n,e)).length,a=s-1,l=e;null!=l&&++i<s;){var c=zi(n[i]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var p=l[c];(u=o?o(p,c,l):t)===t&&(u=na(p)?p:bi(n[i+1])?[]:{})}nr(l,c,u),l=l[c]}return e}var eo=Mn?function(t,e){return Mn.set(t,e),t}:il,no=ae?function(t,e){return ae(t,"toString",{configurable:!0,enumerable:!1,value:nl(e),writable:!0})}:il;function ro(t){return Pi(Va(t))}function oo(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=wt(o);++r<o;)i[r]=t[r+e];return i}function io(t,e){var n;return fr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function so(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,s=t[i];null!==s&&!ua(s)&&(n?s<=e:s<e)?r=i+1:o=i}return o}return ao(t,e,il,n)}function ao(e,n,r,o){var i=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(n=r(n))!=n,l=null===n,c=ua(n),u=n===t;i<s;){var p=ge((i+s)/2),d=r(e[p]),f=d!==t,h=null===d,m=d==d,g=ua(d);if(a)var v=o||m;else v=u?m&&(o||f):l?m&&f&&(o||!h):c?m&&f&&!h&&(o||!g):!h&&!g&&(o?d<=n:d<n);v?i=p+1:s=p}return bn(s,4294967294)}function lo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Vs(a,l)){var l=a;i[o++]=0===s?0:s}}return i}function co(t){return"number"==typeof t?t:ua(t)?d:+t}function uo(t){if("string"==typeof t)return t;if(qs(t))return Ie(t,uo)+"";if(ua(t))return Fn?Fn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function po(t,e,n){var r=-1,o=Te,i=t.length,s=!0,a=[],l=a;if(n)s=!1,o=Me;else if(i>=200){var c=e?null:Xo(t);if(c)return un(c);s=!1,o=Ze,l=new Gn}else l=e?[]:a;t:for(;++r<i;){var u=t[r],p=e?e(u):u;if(u=n||0!==u?u:0,s&&p==p){for(var d=l.length;d--;)if(l[d]===p)continue t;e&&l.push(p),a.push(u)}else o(l,p,n)||(l!==a&&l.push(p),a.push(u))}return a}function fo(t,e){return null==(t=Ni(t,e=wo(e,t)))||delete t[zi(Zi(e))]}function ho(t,e,n,r){return to(t,e,n(Sr(t,e)),r)}function mo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?oo(t,r?0:i,r?i+1:o):oo(t,r?i+1:0,r?o:i)}function go(t,e){var n=t;return n instanceof Un&&(n=n.value()),De(e,(function(t,e){return e.func.apply(e.thisArg,$e([t],e.args))}),n)}function vo(t,e,n){var r=t.length;if(r<2)return r?po(t[0]):[];for(var o=-1,i=wt(r);++o<r;)for(var s=t[o],a=-1;++a<r;)a!=o&&(i[o]=dr(i[o]||s,t[a],e,n));return po(yr(i,1),e,n)}function yo(e,n,r){for(var o=-1,i=e.length,s=n.length,a={};++o<i;){var l=o<s?n[o]:t;r(a,e[o],l)}return a}function _o(t){return Gs(t)?t:[]}function bo(t){return"function"==typeof t?t:il}function wo(t,e){return qs(t)?t:ki(t,e)?[t]:ji(ba(t))}var ko=Xr;function xo(e,n,r){var o=e.length;return r=r===t?o:r,!n&&r>=o?e:oo(e,n,r)}var So=ue||function(t){return de.clearTimeout(t)};function Eo(t,e){if(e)return t.slice();var n=t.length,r=Ut?Ut(n):new t.constructor(n);return t.copy(r),r}function Oo(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Co(t,e){var n=e?Oo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ao(e,n){if(e!==n){var r=e!==t,o=null===e,i=e==e,s=ua(e),a=n!==t,l=null===n,c=n==n,u=ua(n);if(!l&&!u&&!s&&e>n||s&&a&&c&&!l&&!u||o&&a&&c||!r&&c||!i)return 1;if(!o&&!s&&!u&&e<n||u&&r&&i&&!o&&!s||l&&r&&i||!a&&i||!c)return-1}return 0}function No(t,e,n,r){for(var o=-1,i=t.length,s=n.length,a=-1,l=e.length,c=_n(i-s,0),u=wt(l+c),p=!r;++a<l;)u[a]=e[a];for(;++o<s;)(p||o<i)&&(u[n[o]]=t[o]);for(;c--;)u[a++]=t[o++];return u}function To(t,e,n,r){for(var o=-1,i=t.length,s=-1,a=n.length,l=-1,c=e.length,u=_n(i-a,0),p=wt(u+c),d=!r;++o<u;)p[o]=t[o];for(var f=o;++l<c;)p[f+l]=e[l];for(;++s<a;)(d||o<i)&&(p[f+n[s]]=t[o++]);return p}function Mo(t,e){var n=-1,r=t.length;for(e||(e=wt(r));++n<r;)e[n]=t[n];return e}function Io(e,n,r,o){var i=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var l=n[s],c=o?o(r[l],e[l],l,r,e):t;c===t&&(c=e[l]),i?sr(r,l,c):nr(r,l,c)}return r}function $o(t,e){return function(n,r){var o=qs(n)?Ee:or,i=e?e():{};return o(n,t,ui(r,2),i)}}function Do(e){return Xr((function(n,r){var o=-1,i=r.length,s=i>1?r[i-1]:t,a=i>2?r[2]:t;for(s=e.length>3&&"function"==typeof s?(i--,s):t,a&&wi(r[0],r[1],a)&&(s=i<3?t:s,i=1),n=Ot(n);++o<i;){var l=r[o];l&&e(n,l,o,s)}return n}))}function Lo(t,e){return function(n,r){if(null==n)return n;if(!Js(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=Ot(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}function Ro(t){return function(e,n,r){for(var o=-1,i=Ot(e),s=r(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===n(i[l],l,i))break}return e}}function Po(e){return function(n){var r=sn(n=ba(n))?fn(n):t,o=r?r[0]:n.charAt(0),i=r?xo(r,1).join(""):n.slice(1);return o[e]()+i}}function jo(t){return function(e){return De(Qa(Ua(e).replace(Xt,"")),t,"")}}function zo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Vn(t.prototype),r=t.apply(n,e);return na(r)?r:n}}function Fo(e){return function(n,r,o){var i=Ot(n);if(!Js(n)){var s=ui(r,3);n=$a(n),r=function(t){return s(i[t],t,i)}}var a=e(n,r,o);return a>-1?i[s?n[a]:a]:t}}function Ho(n){return oi((function(r){var o=r.length,i=o,s=Wn.prototype.thru;for(n&&r.reverse();i--;){var a=r[i];if("function"!=typeof a)throw new Nt(e);if(s&&!l&&"wrapper"==li(a))var l=new Wn([],!0)}for(i=l?i:o;++i<o;){var c=li(a=r[i]),u="wrapper"==c?ai(a):t;l=u&&xi(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[li(u[0])].apply(l,u[3]):1==a.length&&xi(a)?l[c]():l.thru(a)}return function(){var t=arguments,e=t[0];if(l&&1==t.length&&qs(e))return l.plant(e).value();for(var n=0,i=o?r[n].apply(this,t):e;++n<o;)i=r[n].call(this,i);return i}}))}function Vo(e,n,r,o,i,s,a,c,u,p){var d=n&l,f=1&n,h=2&n,m=24&n,g=512&n,v=h?t:zo(e);return function t(){for(var l=arguments.length,y=wt(l),_=l;_--;)y[_]=arguments[_];if(m)var b=ci(t),w=en(y,b);if(o&&(y=No(y,o,i,m)),s&&(y=To(y,s,a,m)),l-=w,m&&l<p){var k=cn(y,b);return Go(e,n,Vo,t.placeholder,r,y,k,c,u,p-l)}var x=f?r:this,S=h?x[e]:e;return l=y.length,c?y=Ti(y,c):g&&l>1&&y.reverse(),d&&u<l&&(y.length=u),this&&this!==de&&this instanceof t&&(S=v||zo(S)),S.apply(x,y)}}function Bo(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function Wo(e,n){return function(r,o){var i;if(r===t&&o===t)return n;if(r!==t&&(i=r),o!==t){if(i===t)return o;"string"==typeof r||"string"==typeof o?(r=uo(r),o=uo(o)):(r=co(r),o=co(o)),i=e(r,o)}return i}}function Uo(t){return oi((function(e){return e=Ie(e,Ye(ui())),Xr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function qo(e,n){var r=(n=n===t?" ":uo(n)).length;if(r<2)return r?Yr(n,e):n;var o=Yr(n,he(e/dn(n)));return sn(n)?xo(fn(o),0,e).join(""):o.slice(0,e)}function Ko(e){return function(n,r,o){return o&&"number"!=typeof o&&wi(n,r,o)&&(r=o=t),n=ma(n),r===t?(r=n,n=0):r=ma(r),function(t,e,n,r){for(var o=-1,i=_n(he((e-t)/(n||1)),0),s=wt(i);i--;)s[r?i:++o]=t,t+=n;return s}(n,r,o=o===t?n<r?1:-1:ma(o),e)}}function Jo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ya(e),n=ya(n)),t(e,n)}}function Go(e,n,r,o,s,l,c,u,p,d){var f=8&n;n|=f?i:a,4&(n&=~(f?a:i))||(n&=-4);var h=[e,n,s,f?l:t,f?c:t,f?t:l,f?t:c,u,p,d],m=r.apply(t,h);return xi(e)&&Ii(m,h),m.placeholder=o,Li(m,e,n)}function Yo(t){var e=Et[t];return function(t,n){if(t=ya(t),(n=null==n?0:bn(ga(n),292))&&Ue(t)){var r=(ba(t)+"e").split("e");return+((r=(ba(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Xo=An&&1/un(new An([,-0]))[1]==u?function(t){return new An(t)}:ul;function Zo(t){return function(e){var n=gi(e);return n==k?an(e):n==C?pn(e):function(t,e){return Ie(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Qo(n,s,u,p,d,f,h,m){var g=2&s;if(!g&&"function"!=typeof n)throw new Nt(e);var v=p?p.length:0;if(v||(s&=-97,p=d=t),h=h===t?h:_n(ga(h),0),m=m===t?m:ga(m),v-=d?d.length:0,s&a){var y=p,_=d;p=d=t}var b=g?t:ai(n),w=[n,s,u,p,d,y,_,f,h,m];if(b&&function(t,e){var n=t[1],o=e[1],i=n|o,s=i<131,a=o==l&&8==n||o==l&&n==c&&t[7].length<=e[8]||384==o&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&o&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var p=t[3];t[3]=p?No(p,u,e[4]):u,t[4]=p?cn(t[3],r):e[4]}(u=e[5])&&(p=t[5],t[5]=p?To(p,u,e[6]):u,t[6]=p?cn(t[5],r):e[6]),(u=e[7])&&(t[7]=u),o&l&&(t[8]=null==t[8]?e[8]:bn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(w,b),n=w[0],s=w[1],u=w[2],p=w[3],d=w[4],!(m=w[9]=w[9]===t?g?0:n.length:_n(w[9]-v,0))&&24&s&&(s&=-25),s&&1!=s)k=8==s||s==o?function(e,n,r){var o=zo(e);return function i(){for(var s=arguments.length,a=wt(s),l=s,c=ci(i);l--;)a[l]=arguments[l];var u=s<3&&a[0]!==c&&a[s-1]!==c?[]:cn(a,c);return(s-=u.length)<r?Go(e,n,Vo,i.placeholder,t,a,u,t,t,r-s):Se(this&&this!==de&&this instanceof i?o:e,this,a)}}(n,s,m):s!=i&&33!=s||d.length?Vo.apply(t,w):function(t,e,n,r){var o=1&e,i=zo(t);return function e(){for(var s=-1,a=arguments.length,l=-1,c=r.length,u=wt(c+a),p=this&&this!==de&&this instanceof e?i:t;++l<c;)u[l]=r[l];for(;a--;)u[l++]=arguments[++s];return Se(p,o?n:this,u)}}(n,s,u,p);else var k=function(t,e,n){var r=1&e,o=zo(t);return function e(){return(this&&this!==de&&this instanceof e?o:t).apply(r?n:this,arguments)}}(n,s,u);return Li((b?eo:Ii)(k,w),n,s)}function ti(e,n,r,o){return e===t||Vs(e,It[r])&&!Lt.call(o,r)?n:e}function ei(e,n,r,o,i,s){return na(e)&&na(n)&&(s.set(n,e),Br(e,n,t,ei,s),s.delete(n)),e}function ni(e){return sa(e)?t:e}function ri(e,n,r,o,i,s){var a=1&r,l=e.length,c=n.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e),p=s.get(n);if(u&&p)return u==n&&p==e;var d=-1,f=!0,h=2&r?new Gn:t;for(s.set(e,n),s.set(n,e);++d<l;){var m=e[d],g=n[d];if(o)var v=a?o(g,m,d,n,e,s):o(m,g,d,e,n,s);if(v!==t){if(v)continue;f=!1;break}if(h){if(!Re(n,(function(t,e){if(!Ze(h,e)&&(m===t||i(m,t,r,o,s)))return h.push(e)}))){f=!1;break}}else if(m!==g&&!i(m,g,r,o,s)){f=!1;break}}return s.delete(e),s.delete(n),f}function oi(e){return Di(Ai(e,t,Ki),e+"")}function ii(t){return Er(t,$a,hi)}function si(t){return Er(t,Da,mi)}var ai=Mn?function(t){return Mn.get(t)}:ul;function li(t){for(var e=t.name+"",n=In[e],r=Lt.call(In,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ci(t){return(Lt.call(Hn,"placeholder")?Hn:t).placeholder}function ui(){var t=Hn.iteratee||sl;return t=t===sl?Rr:t,arguments.length?t(arguments[0],arguments[1]):t}function pi(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function di(t){for(var e=$a(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Oi(o)]}return e}function fi(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Lr(r)?r:t}var hi=ve?function(t){return null==t?[]:(t=Ot(t),Ne(ve(t),(function(e){return Jt.call(t,e)})))}:vl,mi=ve?function(t){for(var e=[];t;)$e(e,hi(t)),t=qt(t);return e}:vl,gi=Or;function vi(t,e,n){for(var r=-1,o=(e=wo(e,t)).length,i=!1;++r<o;){var s=zi(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ea(o)&&bi(s,o)&&(qs(t)||Us(t))}function yi(t){return"function"!=typeof t.constructor||Ei(t)?{}:Vn(qt(t))}function _i(t){return qs(t)||Us(t)||!!(Yt&&t&&t[Yt])}function bi(t,e){var n=typeof t;return!!(e=null==e?p:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function wi(t,e,n){if(!na(n))return!1;var r=typeof e;return!!("number"==r?Js(n)&&bi(e,n.length):"string"==r&&e in n)&&Vs(n[e],t)}function ki(t,e){if(qs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ua(t))||Q.test(t)||!Z.test(t)||null!=e&&t in Ot(e)}function xi(t){var e=li(t),n=Hn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=ai(n);return!!r&&t===r[0]}(En&&gi(new En(new ArrayBuffer(1)))!=I||On&&gi(new On)!=k||Cn&&gi(Cn.resolve())!=E||An&&gi(new An)!=C||Nn&&gi(new Nn)!=T)&&(gi=function(e){var n=Or(e),r=n==S?e.constructor:t,o=r?Fi(r):"";if(o)switch(o){case $n:return I;case Dn:return k;case Ln:return E;case Rn:return C;case Pn:return T}return n});var Si=$t?Qs:yl;function Ei(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function Oi(t){return t==t&&!na(t)}function Ci(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in Ot(r))}}function Ai(e,n,r){return n=_n(n===t?e.length-1:n,0),function(){for(var t=arguments,o=-1,i=_n(t.length-n,0),s=wt(i);++o<i;)s[o]=t[n+o];o=-1;for(var a=wt(n+1);++o<n;)a[o]=t[o];return a[n]=r(s),Se(e,this,a)}}function Ni(t,e){return e.length<2?t:Sr(t,oo(e,0,-1))}function Ti(e,n){for(var r=e.length,o=bn(n.length,r),i=Mo(e);o--;){var s=n[o];e[o]=bi(s,r)?i[s]:t}return e}function Mi(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ii=Ri(eo),$i=fe||function(t,e){return de.setTimeout(t,e)},Di=Ri(no);function Li(t,e,n){var r=e+"";return Di(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Oe(h,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function Ri(e){var n=0,r=0;return function(){var o=wn(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Pi(e,n){var r=-1,o=e.length,i=o-1;for(n=n===t?o:n;++r<n;){var s=Gr(r,i),a=e[s];e[s]=e[r],e[r]=a}return e.length=n,e}var ji=function(t){var e=Rs(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,o){e.push(r?o.replace(ut,"$1"):n||t)})),e}));function zi(t){if("string"==typeof t||ua(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Fi(t){if(null!=t){try{return Dt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Hi(t){if(t instanceof Un)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=Mo(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Vi=Xr((function(t,e){return Gs(t)?dr(t,yr(e,1,Gs,!0)):[]})),Bi=Xr((function(e,n){var r=Zi(n);return Gs(r)&&(r=t),Gs(e)?dr(e,yr(n,1,Gs,!0),ui(r,2)):[]})),Wi=Xr((function(e,n){var r=Zi(n);return Gs(r)&&(r=t),Gs(e)?dr(e,yr(n,1,Gs,!0),t,r):[]}));function Ui(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=_n(r+o,0)),ze(t,ui(e,3),o)}function qi(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o-1;return r!==t&&(i=ga(r),i=r<0?_n(o+i,0):bn(i,o-1)),ze(e,ui(n,3),i,!0)}function Ki(t){return null!=t&&t.length?yr(t,1):[]}function Ji(e){return e&&e.length?e[0]:t}var Gi=Xr((function(t){var e=Ie(t,_o);return e.length&&e[0]===t[0]?Tr(e):[]})),Yi=Xr((function(e){var n=Zi(e),r=Ie(e,_o);return n===Zi(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Tr(r,ui(n,2)):[]})),Xi=Xr((function(e){var n=Zi(e),r=Ie(e,_o);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Tr(r,t,n):[]}));function Zi(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Qi=Xr(ts);function ts(t,e){return t&&t.length&&e&&e.length?Kr(t,e):t}var es=oi((function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Jr(t,Ie(e,(function(t){return bi(t,n)?+t:t})).sort(Ao)),r}));function ns(t){return null==t?t:Sn.call(t)}var rs=Xr((function(t){return po(yr(t,1,Gs,!0))})),os=Xr((function(e){var n=Zi(e);return Gs(n)&&(n=t),po(yr(e,1,Gs,!0),ui(n,2))})),is=Xr((function(e){var n=Zi(e);return n="function"==typeof n?n:t,po(yr(e,1,Gs,!0),t,n)}));function ss(t){if(!t||!t.length)return[];var e=0;return t=Ne(t,(function(t){if(Gs(t))return e=_n(t.length,e),!0})),Je(e,(function(e){return Ie(t,We(e))}))}function as(e,n){if(!e||!e.length)return[];var r=ss(e);return null==n?r:Ie(r,(function(e){return Se(n,t,e)}))}var ls=Xr((function(t,e){return Gs(t)?dr(t,e):[]})),cs=Xr((function(t){return vo(Ne(t,Gs))})),us=Xr((function(e){var n=Zi(e);return Gs(n)&&(n=t),vo(Ne(e,Gs),ui(n,2))})),ps=Xr((function(e){var n=Zi(e);return n="function"==typeof n?n:t,vo(Ne(e,Gs),t,n)})),ds=Xr(ss),fs=Xr((function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,as(e,r)}));function hs(t){var e=Hn(t);return e.__chain__=!0,e}function ms(t,e){return e(t)}var gs=oi((function(e){var n=e.length,r=n?e[0]:0,o=this.__wrapped__,i=function(t){return ar(t,e)};return!(n>1||this.__actions__.length)&&o instanceof Un&&bi(r)?((o=o.slice(r,+r+(n?1:0))).__actions__.push({func:ms,args:[i],thisArg:t}),new Wn(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(i)})),vs=$o((function(t,e,n){Lt.call(t,n)?++t[n]:sr(t,n,1)})),ys=Fo(Ui),_s=Fo(qi);function bs(t,e){return(qs(t)?Oe:fr)(t,ui(e,3))}function ws(t,e){return(qs(t)?Ce:hr)(t,ui(e,3))}var ks=$o((function(t,e,n){Lt.call(t,n)?t[n].push(e):sr(t,n,[e])})),xs=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Js(t)?wt(t.length):[];return fr(t,(function(t){i[++r]=o?Se(e,t,n):Mr(t,e,n)})),i})),Ss=$o((function(t,e,n){sr(t,n,e)}));function Es(t,e){return(qs(t)?Ie:Fr)(t,ui(e,3))}var Os=$o((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Cs=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wi(t,e[0],e[1])?e=[]:n>2&&wi(e[0],e[1],e[2])&&(e=[e[0]]),Ur(t,yr(e,1),[])})),As=pe||function(){return de.Date.now()};function Ns(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Qo(e,l,t,t,t,t,n)}function Ts(n,r){var o;if("function"!=typeof r)throw new Nt(e);return n=ga(n),function(){return--n>0&&(o=r.apply(this,arguments)),n<=1&&(r=t),o}}var Ms=Xr((function(t,e,n){var r=1;if(n.length){var o=cn(n,ci(Ms));r|=i}return Qo(t,r,e,n,o)})),Is=Xr((function(t,e,n){var r=3;if(n.length){var o=cn(n,ci(Is));r|=i}return Qo(e,r,t,n,o)}));function $s(n,r,o){var i,s,a,l,c,u,p=0,d=!1,f=!1,h=!0;if("function"!=typeof n)throw new Nt(e);function m(e){var r=i,o=s;return i=s=t,p=e,l=n.apply(o,r)}function g(t){return p=t,c=$i(y,r),d?m(t):l}function v(e){var n=e-u;return u===t||n>=r||n<0||f&&e-p>=a}function y(){var t=As();if(v(t))return _(t);c=$i(y,function(t){var e=r-(t-u);return f?bn(e,a-(t-p)):e}(t))}function _(e){return c=t,h&&i?m(e):(i=s=t,l)}function b(){var e=As(),n=v(e);if(i=arguments,s=this,u=e,n){if(c===t)return g(u);if(f)return So(c),c=$i(y,r),m(u)}return c===t&&(c=$i(y,r)),l}return r=ya(r)||0,na(o)&&(d=!!o.leading,a=(f="maxWait"in o)?_n(ya(o.maxWait)||0,r):a,h="trailing"in o?!!o.trailing:h),b.cancel=function(){c!==t&&So(c),p=0,i=u=s=c=t},b.flush=function(){return c===t?l:_(As())},b}var Ds=Xr((function(t,e){return pr(t,1,e)})),Ls=Xr((function(t,e,n){return pr(t,ya(e)||0,n)}));function Rs(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Nt(e);var r=function(){var e=arguments,o=n?n.apply(this,e):e[0],i=r.cache;if(i.has(o))return i.get(o);var s=t.apply(this,e);return r.cache=i.set(o,s)||i,s};return r.cache=new(Rs.Cache||Jn),r}function Ps(t){if("function"!=typeof t)throw new Nt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Rs.Cache=Jn;var js=ko((function(t,e){var n=(e=1==e.length&&qs(e[0])?Ie(e[0],Ye(ui())):Ie(yr(e,1),Ye(ui()))).length;return Xr((function(r){for(var o=-1,i=bn(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Se(t,this,r)}))})),zs=Xr((function(e,n){var r=cn(n,ci(zs));return Qo(e,i,t,n,r)})),Fs=Xr((function(e,n){var r=cn(n,ci(Fs));return Qo(e,a,t,n,r)})),Hs=oi((function(e,n){return Qo(e,c,t,t,t,n)}));function Vs(t,e){return t===e||t!=t&&e!=e}var Bs=Jo(Cr),Ws=Jo((function(t,e){return t>=e})),Us=Ir(function(){return arguments}())?Ir:function(t){return ra(t)&&Lt.call(t,"callee")&&!Jt.call(t,"callee")},qs=wt.isArray,Ks=ye?Ye(ye):function(t){return ra(t)&&Or(t)==M};function Js(t){return null!=t&&ea(t.length)&&!Qs(t)}function Gs(t){return ra(t)&&Js(t)}var Ys=Pe||yl,Xs=_e?Ye(_e):function(t){return ra(t)&&Or(t)==y};function Zs(t){if(!ra(t))return!1;var e=Or(t);return e==_||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qs(t){if(!na(t))return!1;var e=Or(t);return e==b||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ta(t){return"number"==typeof t&&t==ga(t)}function ea(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=p}function na(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var oa=be?Ye(be):function(t){return ra(t)&&gi(t)==k};function ia(t){return"number"==typeof t||ra(t)&&Or(t)==x}function sa(t){if(!ra(t)||Or(t)!=S)return!1;var e=qt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Dt.call(n)==zt}var aa=we?Ye(we):function(t){return ra(t)&&Or(t)==O},la=ke?Ye(ke):function(t){return ra(t)&&gi(t)==C};function ca(t){return"string"==typeof t||!qs(t)&&ra(t)&&Or(t)==A}function ua(t){return"symbol"==typeof t||ra(t)&&Or(t)==N}var pa=xe?Ye(xe):function(t){return ra(t)&&ea(t.length)&&!!ie[Or(t)]},da=Jo(zr),fa=Jo((function(t,e){return t<=e}));function ha(t){if(!t)return[];if(Js(t))return ca(t)?fn(t):Mo(t);if(Qt&&t[Qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Qt]());var e=gi(t);return(e==k?an:e==C?un:Va)(t)}function ma(t){return t?(t=ya(t))===u||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=ma(t),n=e%1;return e==e?n?e-n:e:0}function va(t){return t?lr(ga(t),0,f):0}function ya(t){if("number"==typeof t)return t;if(ua(t))return d;if(na(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=na(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ge(t);var n=ht.test(t);return n||gt.test(t)?ce(t.slice(2),n?2:8):ft.test(t)?d:+t}function _a(t){return Io(t,Da(t))}function ba(t){return null==t?"":uo(t)}var wa=Do((function(t,e){if(Ei(e)||Js(e))Io(e,$a(e),t);else for(var n in e)Lt.call(e,n)&&nr(t,n,e[n])})),ka=Do((function(t,e){Io(e,Da(e),t)})),xa=Do((function(t,e,n,r){Io(e,Da(e),t,r)})),Sa=Do((function(t,e,n,r){Io(e,$a(e),t,r)})),Ea=oi(ar),Oa=Xr((function(e,n){e=Ot(e);var r=-1,o=n.length,i=o>2?n[2]:t;for(i&&wi(n[0],n[1],i)&&(o=1);++r<o;)for(var s=n[r],a=Da(s),l=-1,c=a.length;++l<c;){var u=a[l],p=e[u];(p===t||Vs(p,It[u])&&!Lt.call(e,u))&&(e[u]=s[u])}return e})),Ca=Xr((function(e){return e.push(t,ei),Se(Ra,t,e)}));function Aa(e,n,r){var o=null==e?t:Sr(e,n);return o===t?r:o}function Na(t,e){return null!=t&&vi(t,e,Nr)}var Ta=Bo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),t[e]=n}),nl(il)),Ma=Bo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=jt.call(e)),Lt.call(t,e)?t[e].push(n):t[e]=[n]}),ui),Ia=Xr(Mr);function $a(t){return Js(t)?Xn(t):Pr(t)}function Da(t){return Js(t)?Xn(t,!0):jr(t)}var La=Do((function(t,e,n){Br(t,e,n)})),Ra=Do((function(t,e,n,r){Br(t,e,n,r)})),Pa=oi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Ie(e,(function(e){return e=wo(e,t),r||(r=e.length>1),e})),Io(t,si(t),n),r&&(n=cr(n,7,ni));for(var o=e.length;o--;)fo(n,e[o]);return n})),ja=oi((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Na(t,n)}))}(t,e)}));function za(t,e){if(null==t)return{};var n=Ie(si(t),(function(t){return[t]}));return e=ui(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var Fa=Zo($a),Ha=Zo(Da);function Va(t){return null==t?[]:Xe(t,$a(t))}var Ba=jo((function(t,e,n){return e=e.toLowerCase(),t+(n?Wa(e):e)}));function Wa(t){return Za(ba(t).toLowerCase())}function Ua(t){return(t=ba(t))&&t.replace(yt,nn).replace(Zt,"")}var qa=jo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ka=jo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ja=Po("toLowerCase"),Ga=jo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ya=jo((function(t,e,n){return t+(n?" ":"")+Za(e)})),Xa=jo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Za=Po("toUpperCase");function Qa(e,n,r){return e=ba(e),(n=r?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(lt)||[]}(e):e.match(n)||[]}var tl=Xr((function(e,n){try{return Se(e,t,n)}catch(t){return Zs(t)?t:new xt(t)}})),el=oi((function(t,e){return Oe(e,(function(e){e=zi(e),sr(t,e,Ms(t[e],t))})),t}));function nl(t){return function(){return t}}var rl=Ho(),ol=Ho(!0);function il(t){return t}function sl(t){return Rr("function"==typeof t?t:cr(t,1))}var al=Xr((function(t,e){return function(n){return Mr(n,t,e)}})),ll=Xr((function(t,e){return function(n){return Mr(t,n,e)}}));function cl(t,e,n){var r=$a(e),o=xr(e,r);null!=n||na(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=xr(e,$a(e)));var i=!(na(n)&&"chain"in n&&!n.chain),s=Qs(t);return Oe(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__),o=n.__actions__=Mo(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,$e([this.value()],arguments))})})),t}function ul(){}var pl=Uo(Ie),dl=Uo(Ae),fl=Uo(Re);function hl(t){return ki(t)?We(zi(t)):function(t){return function(e){return Sr(e,t)}}(t)}var ml=Ko(),gl=Ko(!0);function vl(){return[]}function yl(){return!1}var _l,bl=Wo((function(t,e){return t+e}),0),wl=Yo("ceil"),kl=Wo((function(t,e){return t/e}),1),xl=Yo("floor"),Sl=Wo((function(t,e){return t*e}),1),El=Yo("round"),Ol=Wo((function(t,e){return t-e}),0);return Hn.after=function(t,n){if("function"!=typeof n)throw new Nt(e);return t=ga(t),function(){if(--t<1)return n.apply(this,arguments)}},Hn.ary=Ns,Hn.assign=wa,Hn.assignIn=ka,Hn.assignInWith=xa,Hn.assignWith=Sa,Hn.at=Ea,Hn.before=Ts,Hn.bind=Ms,Hn.bindAll=el,Hn.bindKey=Is,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qs(t)?t:[t]},Hn.chain=hs,Hn.chunk=function(e,n,r){n=(r?wi(e,n,r):n===t)?1:_n(ga(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var i=0,s=0,a=wt(he(o/n));i<o;)a[s++]=oo(e,i,i+=n);return a},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=wt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return $e(qs(n)?Mo(n):[n],yr(e,1))},Hn.cond=function(t){var n=null==t?0:t.length,r=ui();return t=n?Ie(t,(function(t){if("function"!=typeof t[1])throw new Nt(e);return[r(t[0]),t[1]]})):[],Xr((function(e){for(var r=-1;++r<n;){var o=t[r];if(Se(o[0],this,e))return Se(o[1],this,e)}}))},Hn.conforms=function(t){return function(t){var e=$a(t);return function(n){return ur(n,t,e)}}(cr(t,1))},Hn.constant=nl,Hn.countBy=vs,Hn.create=function(t,e){var n=Vn(t);return null==e?n:ir(n,e)},Hn.curry=function e(n,r,o){var i=Qo(n,8,t,t,t,t,t,r=o?t:r);return i.placeholder=e.placeholder,i},Hn.curryRight=function e(n,r,i){var s=Qo(n,o,t,t,t,t,t,r=i?t:r);return s.placeholder=e.placeholder,s},Hn.debounce=$s,Hn.defaults=Oa,Hn.defaultsDeep=Ca,Hn.defer=Ds,Hn.delay=Ls,Hn.difference=Vi,Hn.differenceBy=Bi,Hn.differenceWith=Wi,Hn.drop=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=r||n===t?1:ga(n))<0?0:n,o):[]},Hn.dropRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,0,(n=o-(n=r||n===t?1:ga(n)))<0?0:n):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!0):[]},Hn.fill=function(e,n,r,o){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&wi(e,n,r)&&(r=0,o=i),function(e,n,r,o){var i=e.length;for((r=ga(r))<0&&(r=-r>i?0:i+r),(o=o===t||o>i?i:ga(o))<0&&(o+=i),o=r>o?0:va(o);r<o;)e[r++]=n;return e}(e,n,r,o)):[]},Hn.filter=function(t,e){return(qs(t)?Ne:vr)(t,ui(e,3))},Hn.flatMap=function(t,e){return yr(Es(t,e),1)},Hn.flatMapDeep=function(t,e){return yr(Es(t,e),u)},Hn.flatMapDepth=function(e,n,r){return r=r===t?1:ga(r),yr(Es(e,n),r)},Hn.flatten=Ki,Hn.flattenDeep=function(t){return null!=t&&t.length?yr(t,u):[]},Hn.flattenDepth=function(e,n){return null!=e&&e.length?yr(e,n=n===t?1:ga(n)):[]},Hn.flip=function(t){return Qo(t,512)},Hn.flow=rl,Hn.flowRight=ol,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},Hn.functions=function(t){return null==t?[]:xr(t,$a(t))},Hn.functionsIn=function(t){return null==t?[]:xr(t,Da(t))},Hn.groupBy=ks,Hn.initial=function(t){return null!=t&&t.length?oo(t,0,-1):[]},Hn.intersection=Gi,Hn.intersectionBy=Yi,Hn.intersectionWith=Xi,Hn.invert=Ta,Hn.invertBy=Ma,Hn.invokeMap=xs,Hn.iteratee=sl,Hn.keyBy=Ss,Hn.keys=$a,Hn.keysIn=Da,Hn.map=Es,Hn.mapKeys=function(t,e){var n={};return e=ui(e,3),wr(t,(function(t,r,o){sr(n,e(t,r,o),t)})),n},Hn.mapValues=function(t,e){var n={};return e=ui(e,3),wr(t,(function(t,r,o){sr(n,r,e(t,r,o))})),n},Hn.matches=function(t){return Hr(cr(t,1))},Hn.matchesProperty=function(t,e){return Vr(t,cr(e,1))},Hn.memoize=Rs,Hn.merge=La,Hn.mergeWith=Ra,Hn.method=al,Hn.methodOf=ll,Hn.mixin=cl,Hn.negate=Ps,Hn.nthArg=function(t){return t=ga(t),Xr((function(e){return Wr(e,t)}))},Hn.omit=Pa,Hn.omitBy=function(t,e){return za(t,Ps(ui(e)))},Hn.once=function(t){return Ts(2,t)},Hn.orderBy=function(e,n,r,o){return null==e?[]:(qs(n)||(n=null==n?[]:[n]),qs(r=o?t:r)||(r=null==r?[]:[r]),Ur(e,n,r))},Hn.over=pl,Hn.overArgs=js,Hn.overEvery=dl,Hn.overSome=fl,Hn.partial=zs,Hn.partialRight=Fs,Hn.partition=Os,Hn.pick=ja,Hn.pickBy=za,Hn.property=hl,Hn.propertyOf=function(e){return function(n){return null==e?t:Sr(e,n)}},Hn.pull=Qi,Hn.pullAll=ts,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Kr(t,e,ui(n,2)):t},Hn.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?Kr(e,n,t,r):e},Hn.pullAt=es,Hn.range=ml,Hn.rangeRight=gl,Hn.rearg=Hs,Hn.reject=function(t,e){return(qs(t)?Ne:vr)(t,Ps(ui(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=ui(e,3);++r<i;){var s=t[r];e(s,r,t)&&(n.push(s),o.push(r))}return Jr(t,o),n},Hn.rest=function(n,r){if("function"!=typeof n)throw new Nt(e);return Xr(n,r=r===t?r:ga(r))},Hn.reverse=ns,Hn.sampleSize=function(e,n,r){return n=(r?wi(e,n,r):n===t)?1:ga(n),(qs(e)?Qn:Qr)(e,n)},Hn.set=function(t,e,n){return null==t?t:to(t,e,n)},Hn.setWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:to(e,n,r,o)},Hn.shuffle=function(t){return(qs(t)?tr:ro)(t)},Hn.slice=function(e,n,r){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&wi(e,n,r)?(n=0,r=o):(n=null==n?0:ga(n),r=r===t?o:ga(r)),oo(e,n,r)):[]},Hn.sortBy=Cs,Hn.sortedUniq=function(t){return t&&t.length?lo(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?lo(t,ui(e,2)):[]},Hn.split=function(e,n,r){return r&&"number"!=typeof r&&wi(e,n,r)&&(n=r=t),(r=r===t?f:r>>>0)?(e=ba(e))&&("string"==typeof n||null!=n&&!aa(n))&&!(n=uo(n))&&sn(e)?xo(fn(e),0,r):e.split(n,r):[]},Hn.spread=function(t,n){if("function"!=typeof t)throw new Nt(e);return n=null==n?0:_n(ga(n),0),Xr((function(e){var r=e[n],o=xo(e,0,n);return r&&$e(o,r),Se(t,this,o)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?oo(t,1,e):[]},Hn.take=function(e,n,r){return e&&e.length?oo(e,0,(n=r||n===t?1:ga(n))<0?0:n):[]},Hn.takeRight=function(e,n,r){var o=null==e?0:e.length;return o?oo(e,(n=o-(n=r||n===t?1:ga(n)))<0?0:n,o):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?mo(t,ui(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?mo(t,ui(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new Nt(e);return na(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),$s(t,n,{leading:o,maxWait:n,trailing:i})},Hn.thru=ms,Hn.toArray=ha,Hn.toPairs=Fa,Hn.toPairsIn=Ha,Hn.toPath=function(t){return qs(t)?Ie(t,zi):ua(t)?[t]:Mo(ji(ba(t)))},Hn.toPlainObject=_a,Hn.transform=function(t,e,n){var r=qs(t),o=r||Ys(t)||pa(t);if(e=ui(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:na(t)&&Qs(i)?Vn(qt(t)):{}}return(o?Oe:wr)(t,(function(t,r,o){return e(n,t,r,o)})),n},Hn.unary=function(t){return Ns(t,1)},Hn.union=rs,Hn.unionBy=os,Hn.unionWith=is,Hn.uniq=function(t){return t&&t.length?po(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?po(t,ui(e,2)):[]},Hn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?po(e,t,n):[]},Hn.unset=function(t,e){return null==t||fo(t,e)},Hn.unzip=ss,Hn.unzipWith=as,Hn.update=function(t,e,n){return null==t?t:ho(t,e,bo(n))},Hn.updateWith=function(e,n,r,o){return o="function"==typeof o?o:t,null==e?e:ho(e,n,bo(r),o)},Hn.values=Va,Hn.valuesIn=function(t){return null==t?[]:Xe(t,Da(t))},Hn.without=ls,Hn.words=Qa,Hn.wrap=function(t,e){return zs(bo(e),t)},Hn.xor=cs,Hn.xorBy=us,Hn.xorWith=ps,Hn.zip=ds,Hn.zipObject=function(t,e){return yo(t||[],e||[],nr)},Hn.zipObjectDeep=function(t,e){return yo(t||[],e||[],to)},Hn.zipWith=fs,Hn.entries=Fa,Hn.entriesIn=Ha,Hn.extend=ka,Hn.extendWith=xa,cl(Hn,Hn),Hn.add=bl,Hn.attempt=tl,Hn.camelCase=Ba,Hn.capitalize=Wa,Hn.ceil=wl,Hn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ya(r))==r?r:0),n!==t&&(n=(n=ya(n))==n?n:0),lr(ya(e),n,r)},Hn.clone=function(t){return cr(t,4)},Hn.cloneDeep=function(t){return cr(t,5)},Hn.cloneDeepWith=function(e,n){return cr(e,5,n="function"==typeof n?n:t)},Hn.cloneWith=function(e,n){return cr(e,4,n="function"==typeof n?n:t)},Hn.conformsTo=function(t,e){return null==e||ur(t,e,$a(e))},Hn.deburr=Ua,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=kl,Hn.endsWith=function(e,n,r){e=ba(e),n=uo(n);var o=e.length,i=r=r===t?o:lr(ga(r),0,o);return(r-=n.length)>=0&&e.slice(r,i)==n},Hn.eq=Vs,Hn.escape=function(t){return(t=ba(t))&&J.test(t)?t.replace(q,rn):t},Hn.escapeRegExp=function(t){return(t=ba(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Hn.every=function(e,n,r){var o=qs(e)?Ae:mr;return r&&wi(e,n,r)&&(n=t),o(e,ui(n,3))},Hn.find=ys,Hn.findIndex=Ui,Hn.findKey=function(t,e){return je(t,ui(e,3),wr)},Hn.findLast=_s,Hn.findLastIndex=qi,Hn.findLastKey=function(t,e){return je(t,ui(e,3),kr)},Hn.floor=xl,Hn.forEach=bs,Hn.forEachRight=ws,Hn.forIn=function(t,e){return null==t?t:_r(t,ui(e,3),Da)},Hn.forInRight=function(t,e){return null==t?t:br(t,ui(e,3),Da)},Hn.forOwn=function(t,e){return t&&wr(t,ui(e,3))},Hn.forOwnRight=function(t,e){return t&&kr(t,ui(e,3))},Hn.get=Aa,Hn.gt=Bs,Hn.gte=Ws,Hn.has=function(t,e){return null!=t&&vi(t,e,Ar)},Hn.hasIn=Na,Hn.head=Ji,Hn.identity=il,Hn.includes=function(t,e,n,r){t=Js(t)?t:Va(t),n=n&&!r?ga(n):0;var o=t.length;return n<0&&(n=_n(o+n,0)),ca(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ga(n);return o<0&&(o=_n(r+o,0)),Fe(t,e,o)},Hn.inRange=function(e,n,r){return n=ma(n),r===t?(r=n,n=0):r=ma(r),function(t,e,n){return t>=bn(e,n)&&t<_n(e,n)}(e=ya(e),n,r)},Hn.invoke=Ia,Hn.isArguments=Us,Hn.isArray=qs,Hn.isArrayBuffer=Ks,Hn.isArrayLike=Js,Hn.isArrayLikeObject=Gs,Hn.isBoolean=function(t){return!0===t||!1===t||ra(t)&&Or(t)==v},Hn.isBuffer=Ys,Hn.isDate=Xs,Hn.isElement=function(t){return ra(t)&&1===t.nodeType&&!sa(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(Js(t)&&(qs(t)||"string"==typeof t||"function"==typeof t.splice||Ys(t)||pa(t)||Us(t)))return!t.length;var e=gi(t);if(e==k||e==C)return!t.size;if(Ei(t))return!Pr(t).length;for(var n in t)if(Lt.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return $r(t,e)},Hn.isEqualWith=function(e,n,r){var o=(r="function"==typeof r?r:t)?r(e,n):t;return o===t?$r(e,n,t,r):!!o},Hn.isError=Zs,Hn.isFinite=function(t){return"number"==typeof t&&Ue(t)},Hn.isFunction=Qs,Hn.isInteger=ta,Hn.isLength=ea,Hn.isMap=oa,Hn.isMatch=function(t,e){return t===e||Dr(t,e,di(e))},Hn.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Dr(e,n,di(n),r)},Hn.isNaN=function(t){return ia(t)&&t!=+t},Hn.isNative=function(t){if(Si(t))throw new xt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=ia,Hn.isObject=na,Hn.isObjectLike=ra,Hn.isPlainObject=sa,Hn.isRegExp=aa,Hn.isSafeInteger=function(t){return ta(t)&&t>=-9007199254740991&&t<=p},Hn.isSet=la,Hn.isString=ca,Hn.isSymbol=ua,Hn.isTypedArray=pa,Hn.isUndefined=function(e){return e===t},Hn.isWeakMap=function(t){return ra(t)&&gi(t)==T},Hn.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Or(t)},Hn.join=function(t,e){return null==t?"":vn.call(t,e)},Hn.kebabCase=qa,Hn.last=Zi,Hn.lastIndexOf=function(e,n,r){var o=null==e?0:e.length;if(!o)return-1;var i=o;return r!==t&&(i=(i=ga(r))<0?_n(o+i,0):bn(i,o-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,i):ze(e,Ve,i,!0)},Hn.lowerCase=Ka,Hn.lowerFirst=Ja,Hn.lt=da,Hn.lte=fa,Hn.max=function(e){return e&&e.length?gr(e,il,Cr):t},Hn.maxBy=function(e,n){return e&&e.length?gr(e,ui(n,2),Cr):t},Hn.mean=function(t){return Be(t,il)},Hn.meanBy=function(t,e){return Be(t,ui(e,2))},Hn.min=function(e){return e&&e.length?gr(e,il,zr):t},Hn.minBy=function(e,n){return e&&e.length?gr(e,ui(n,2),zr):t},Hn.stubArray=vl,Hn.stubFalse=yl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Sl,Hn.nth=function(e,n){return e&&e.length?Wr(e,ga(n)):t},Hn.noConflict=function(){return de._===this&&(de._=Ft),this},Hn.noop=ul,Hn.now=As,Hn.pad=function(t,e,n){t=ba(t);var r=(e=ga(e))?dn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return qo(ge(o),n)+t+qo(he(o),n)},Hn.padEnd=function(t,e,n){t=ba(t);var r=(e=ga(e))?dn(t):0;return e&&r<e?t+qo(e-r,n):t},Hn.padStart=function(t,e,n){t=ba(t);var r=(e=ga(e))?dn(t):0;return e&&r<e?qo(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),kn(ba(t).replace(rt,""),e||0)},Hn.random=function(e,n,r){if(r&&"boolean"!=typeof r&&wi(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=ma(e),n===t?(n=e,e=0):n=ma(n)),e>n){var o=e;e=n,n=o}if(r||e%1||n%1){var i=xn();return bn(e+i*(n-e+le("1e-"+((i+"").length-1))),n)}return Gr(e,n)},Hn.reduce=function(t,e,n){var r=qs(t)?De:qe,o=arguments.length<3;return r(t,ui(e,4),n,o,fr)},Hn.reduceRight=function(t,e,n){var r=qs(t)?Le:qe,o=arguments.length<3;return r(t,ui(e,4),n,o,hr)},Hn.repeat=function(e,n,r){return n=(r?wi(e,n,r):n===t)?1:ga(n),Yr(ba(e),n)},Hn.replace=function(){var t=arguments,e=ba(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(e,n,r){var o=-1,i=(n=wo(n,e)).length;for(i||(i=1,e=t);++o<i;){var s=null==e?t:e[zi(n[o])];s===t&&(o=i,s=r),e=Qs(s)?s.call(e):s}return e},Hn.round=El,Hn.runInContext=s,Hn.sample=function(t){return(qs(t)?Zn:Zr)(t)},Hn.size=function(t){if(null==t)return 0;if(Js(t))return ca(t)?dn(t):t.length;var e=gi(t);return e==k||e==C?t.size:Pr(t).length},Hn.snakeCase=Ga,Hn.some=function(e,n,r){var o=qs(e)?Re:io;return r&&wi(e,n,r)&&(n=t),o(e,ui(n,3))},Hn.sortedIndex=function(t,e){return so(t,e)},Hn.sortedIndexBy=function(t,e,n){return ao(t,e,ui(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=so(t,e);if(r<n&&Vs(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return so(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ao(t,e,ui(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=so(t,e,!0)-1;if(Vs(t[n],e))return n}return-1},Hn.startCase=Ya,Hn.startsWith=function(t,e,n){return t=ba(t),n=null==n?0:lr(ga(n),0,t.length),e=uo(e),t.slice(n,n+e.length)==e},Hn.subtract=Ol,Hn.sum=function(t){return t&&t.length?Ke(t,il):0},Hn.sumBy=function(t,e){return t&&t.length?Ke(t,ui(e,2)):0},Hn.template=function(e,n,r){var o=Hn.templateSettings;r&&wi(e,n,r)&&(n=t),e=ba(e),n=xa({},n,o,ti);var i,s,a=xa({},n.imports,o.imports,ti),l=$a(a),c=Xe(a,l),u=0,p=n.interpolate||_t,d="__p += '",f=Ct((n.escape||_t).source+"|"+p.source+"|"+(p===X?pt:_t).source+"|"+(n.evaluate||_t).source+"|$","g"),h="//# sourceURL="+(Lt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";e.replace(f,(function(t,n,r,o,a,l){return r||(r=o),d+=e.slice(u,l).replace(bt,on),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),d+="';\n";var m=Lt.call(n,"variable")&&n.variable;if(m){if(ct.test(m))throw new xt("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(V,""):d).replace(B,"$1").replace(W,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=tl((function(){return St(l,h+"return "+d).apply(t,c)}));if(g.source=d,Zs(g))throw g;return g},Hn.times=function(t,e){if((t=ga(t))<1||t>p)return[];var n=f,r=bn(t,f);e=ui(e),t-=f;for(var o=Je(r,e);++n<t;)e(n);return o},Hn.toFinite=ma,Hn.toInteger=ga,Hn.toLength=va,Hn.toLower=function(t){return ba(t).toLowerCase()},Hn.toNumber=ya,Hn.toSafeInteger=function(t){return t?lr(ga(t),-9007199254740991,p):0===t?t:0},Hn.toString=ba,Hn.toUpper=function(t){return ba(t).toUpperCase()},Hn.trim=function(e,n,r){if((e=ba(e))&&(r||n===t))return Ge(e);if(!e||!(n=uo(n)))return e;var o=fn(e),i=fn(n);return xo(o,Qe(o,i),tn(o,i)+1).join("")},Hn.trimEnd=function(e,n,r){if((e=ba(e))&&(r||n===t))return e.slice(0,hn(e)+1);if(!e||!(n=uo(n)))return e;var o=fn(e);return xo(o,0,tn(o,fn(n))+1).join("")},Hn.trimStart=function(e,n,r){if((e=ba(e))&&(r||n===t))return e.replace(rt,"");if(!e||!(n=uo(n)))return e;var o=fn(e);return xo(o,Qe(o,fn(n))).join("")},Hn.truncate=function(e,n){var r=30,o="...";if(na(n)){var i="separator"in n?n.separator:i;r="length"in n?ga(n.length):r,o="omission"in n?uo(n.omission):o}var s=(e=ba(e)).length;if(sn(e)){var a=fn(e);s=a.length}if(r>=s)return e;var l=r-dn(o);if(l<1)return o;var c=a?xo(a,0,l).join(""):e.slice(0,l);if(i===t)return c+o;if(a&&(l+=c.length-l),aa(i)){if(e.slice(l).search(i)){var u,p=c;for(i.global||(i=Ct(i.source,ba(dt.exec(i))+"g")),i.lastIndex=0;u=i.exec(p);)var d=u.index;c=c.slice(0,d===t?l:d)}}else if(e.indexOf(uo(i),l)!=l){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+o},Hn.unescape=function(t){return(t=ba(t))&&K.test(t)?t.replace(U,mn):t},Hn.uniqueId=function(t){var e=++Rt;return ba(t)+e},Hn.upperCase=Xa,Hn.upperFirst=Za,Hn.each=bs,Hn.eachRight=ws,Hn.first=Ji,cl(Hn,(_l={},wr(Hn,(function(t,e){Lt.call(Hn.prototype,e)||(_l[e]=t)})),_l),{chain:!1}),Hn.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),Oe(["drop","take"],(function(e,n){Un.prototype[e]=function(r){r=r===t?1:_n(ga(r),0);var o=this.__filtered__&&!n?new Un(this):this.clone();return o.__filtered__?o.__takeCount__=bn(r,o.__takeCount__):o.__views__.push({size:bn(r,f),type:e+(o.__dir__<0?"Right":"")}),o},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Oe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ui(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Oe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(il)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Mr(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Ps(ui(t)))},Un.prototype.slice=function(e,n){e=ga(e);var r=this;return r.__filtered__&&(e>0||n<0)?new Un(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=ga(n))<0?r.dropRight(-n):r.take(n-e)),r)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(f)},wr(Un.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),i=Hn[o?"take"+("last"==n?"Right":""):n],s=o||/^find/.test(n);i&&(Hn.prototype[n]=function(){var n=this.__wrapped__,a=o?[1]:arguments,l=n instanceof Un,c=a[0],u=l||qs(n),p=function(t){var e=i.apply(Hn,$e([t],a));return o&&d?e[0]:e};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,h=s&&!d,m=l&&!f;if(!s&&u){n=m?n:new Un(this);var g=e.apply(n,a);return g.__actions__.push({func:ms,args:[p],thisArg:t}),new Wn(g,d)}return h&&m?e.apply(this,a):(g=this.thru(p),h?o?g.value()[0]:g.value():g)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(qs(o)?o:[],t)}return this[n]((function(n){return e.apply(qs(n)?n:[],t)}))}})),wr(Un.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Lt.call(In,r)||(In[r]=[]),In[r].push({name:e,func:n})}})),In[Vo(t,2).name]=[{name:"wrapper",func:t}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=Mo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Mo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Mo(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qs(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=bn(e,t+s);break;case"takeRight":t=_n(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,l=a-s,c=r?a:s-1,u=this.__iteratees__,p=u.length,d=0,f=bn(l,this.__takeCount__);if(!n||!r&&o==l&&f==l)return go(t,this.__actions__);var h=[];t:for(;l--&&d<f;){for(var m=-1,g=t[c+=e];++m<p;){var v=u[m],y=v.iteratee,_=v.type,b=y(g);if(2==_)g=b;else if(!b){if(1==_)continue t;break t}}h[d++]=g}return h},Hn.prototype.at=gs,Hn.prototype.chain=function(){return hs(this)},Hn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===t&&(this.__values__=ha(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Hn.prototype.plant=function(e){for(var n,r=this;r instanceof Bn;){var o=Hi(r);o.__index__=0,o.__values__=t,n?i.__wrapped__=o:n=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,n},Hn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var n=e;return this.__actions__.length&&(n=new Un(this)),(n=n.reverse()).__actions__.push({func:ms,args:[ns],thisArg:t}),new Wn(n,this.__chain__)}return this.thru(ns)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,Qt&&(Hn.prototype[Qt]=function(){return this}),Hn}();he?((he.exports=gn)._=gn,fe._=gn):de._=gn}.call(s);const um=Fp.create({name:"node_processor",addCommands:()=>({setBlockAttributes:Th((({commands:t,state:e},n,r,o={})=>{const i=je(t.getBlockAttributes(n))??{},{doc:s,tr:a}=e,{from:l,to:c}=a.selection;s.nodesBetween(l,c,((t,e)=>{Fd.blocks.includes(t.type.name)&&a.setNodeAttribute(e,n,{...o,...i,...r})}))})),getBlockAttributes:Th((({editor:t},e,n)=>He((()=>{let r=Object.assign({},n||{});for(const n of Fd.blocks)Object.assign(r,t.getAttributes(n)?.[e]||{});return Object.keys(r).length?r:null})))),removeBlockAttributes:Th((({commands:t},e)=>{for(const n of Fd.blocks)t.resetAttributes(n,e)})),applyMark:Th((({state:t,commands:e},n,r,o={})=>{const{tr:i,doc:s,schema:a}=t,{$from:l,$to:c}=i.selection,u=Up(Vd.LINK,a),p=Up(n,a);if(!(p.spec.group||"").includes(Bd.SETTINGS))return e.setMark(n,r);if(l.pos===c.pos)return;s.nodesBetween(l.pos,c.pos,((t,s)=>{if(t.type.name===Fd.LIST)return;const a=function(t,e){const n="string"==typeof e?e:e.name;return t.find((t=>t.type.name===n))}(t.marks,n),d=p.create({...a?.attrs||{},...r}),f=rm(l,c,t,s),h=!u.isInSet(t.marks)&&function(t,e,n,r=im){const o=t.resolve(e).path.reverse();for(const t of o)if("number"!=typeof t)for(const e of t.marks)if(r(e,n))return!0;return!1}(i.doc,s,d,o.isAppliedToParent);if(h)return(t=>{if(!o.onAppliedToParent||!1===o.onAppliedToParent(t)){const{tr:n,node:r,position:o,mark:i}=t;e._removeNodeMark({tr:n,node:r,position:o,mark:i.type})}})({tr:i,node:t,position:s,mark:d});t.isText?i.addMark(f.from,f.to,d):function(t,e,n,r){const o=om(t,r),i=e.from-o<=r,s=e.to+o>=n.nodeSize+r;return i&&s}(i.doc,i.selection,t,s)&&i.addNodeMark(s,d)}))})),getMarks:Th((({editor:t},e)=>{const n=Fe(t,"state");return He((()=>{const{selection:t,doc:r}=je(n),{from:o,to:i}=je(t),s=[];return r.nodesBetween(o,i,(t=>{for(const n of t.marks)n.type.name===e&&s.unshift(n.attrs)})),s}))})),getMark:Th((({commands:t},e)=>{const n=t.getMarks(e);return He((()=>je(n)[0]??null))})),hasMark:Th((({commands:t},e)=>{const n=t.getMark(e);return He((()=>!!je(n)))})),getCommonSettingMark:Th((({commands:t},e,n)=>{const r=t.getMark(e);return He((()=>je(r)?.value??je(n)))})),getDeviceSettingMark:Th((({commands:t},e,n)=>{const r=t.getMarks(e),o=t.getDevice();return He((()=>{for(const t of je(r)){const e=t[je(o)];if(e)return e}return je(n)}))})),removeAllMarks:Th((({state:t,commands:e})=>{const{tr:n,doc:r}=t,{from:o,to:i}=n.selection;r.nodesBetween(o,i,((t,r)=>{for(const o of t.marks)e._removeNodeMark({tr:n,node:t,position:r,mark:o})}))})),removeMarks:Th((({state:t,commands:e},n)=>{const{tr:r,doc:o}=t,{from:i,to:s}=r.selection;o.nodesBetween(i,s,((t,o)=>{const i=t.marks.filter((t=>n.includes(t.type.name)));for(const n of i)e._removeNodeMark({tr:r,node:t,position:o,mark:n})}))})),_removeNodeMark:Th(((t,{tr:e,node:n,position:r,mark:o})=>n.isText?e.removeMark(r,r+n.nodeSize,o):e.removeNodeMark(r,o)))})}),pm=Fp.create({name:"text_processor",addCommands:()=>({getSelectedText:Th((({state:t})=>{const{from:e,to:n}=t.selection;return t.doc.textBetween(e,n," ")})),transformText:Th((({state:t},e)=>{const{$from:n,$to:r}=t.tr.selection;n.pos!==r.pos&&t.doc.nodesBetween(n.pos,r.pos,((o,i)=>{if(!o.isText)return;const s=rm(n,r,o,i),a=Math.max(0,n.pos-i),l=Math.max(0,r.pos-i),c=e({text:o.textContent.substring(a,l)}),u=t.schema.text(c,o.marks);t.tr.replaceWith(s.from,s.to,u)}))}))})}),dm=Fp.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:Th((({state:t})=>{this.storage.selection=t.selection})),restoreSelection:Th((({commands:t})=>{this.storage.selection&&t.setTextSelection(this.storage.selection)})),expandSelection:Th((({tr:t,commands:e},n)=>{let r=t.selection.from,o=t.selection.to;t.doc.nodesBetween(r,o,((e,i,s)=>{if(n({node:e,parent:s})){const n=e.isText?0:om(t.doc,i);r=Math.min(r,i+n),o=Math.max(o,i+e.nodeSize-n)}})),e.setTextSelection({from:r,to:o})})),expandSelectionToBlock:Th((({commands:t})=>{t.expandSelection((({parent:t})=>t.type.name===Fd.DOCUMENT))}))}}}),fm=fd.create({name:"doc",topNode:!0,content:"block+"}).extend({marks:Bd.SETTINGS,onCreate(){this.editor.view.dom.addEventListener("click",(t=>{t.target.closest("a")&&t.preventDefault()}))}}),hm=fd.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",kp(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mm=hm.extend({marks:Bd.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),gm=fd.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,kp(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>function(t){return new Mp({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Sp(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}}),vm=gm.extend({marks:Bd.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),ym=Fp.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[Kd.create(this.editor),Jd.create(this.editor)]}}),_m=dd.create({name:Vd.FONT_FAMILY,group:Bd.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e});const n=t.findFontByName(e);let r=je(t.getFontWeight());n.isWeightSupported(r)||(r=n.findClosestWeight(r),t.applyFontWeight(r)),n.isItalicSupported(r)||t.removeItalic()})),getFont:Th((({commands:t})=>{const e=je(this.options.defaultPreset),n=t.findFontByName(e.common.font_family),r=t.getFontFamily();return He((()=>t.findFontByName(je(r))||n))})),findFontByName:Th(((t,e)=>this.options.fonts.find((t=>t.name===e)))),getFontFamily:Th((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontFamily()))),getDefaultFontFamily:Th((({commands:t})=>{const e=t.getPreset();return He((()=>je(e).common.font_family))}))}},parseHTML(){const t=t=>({value:t.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:t},{style:"font-family",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({font_family:t.value?`"${t.value}"`:null})}),bm=Fp.create({name:Vd.STYLE_PRESET,addGlobalAttributes(){return[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{preset:{isRequired:!1,default:{id:this.options.defaultId},parseHTML:t=>{const e=je(this.options.presets);if("LI"===t.parentElement.tagName)return null;for(const{id:n,node:r,fallbackClass:o}of e){if(o&&t.classList.contains(o))return{id:n};const e=this.options.styleRenderer.makePresetCssClass({id:n});if(t.matches(e))return{id:n};if(t.tagName===`H${r?.level}`)return{id:n}}return"P"===t.tagName?{id:this.options.defaultId}:null},renderHTML:t=>t.preset?{class:this.options.styleRenderer.makePresetHtmlClass(t.preset)}:null}}}]},addCommands(){function t(t,e){return t.find((t=>e===t.id))}function e(t,e){const n={};for(const r of Object.keys(t)){const o=t[r],i=e[r],s=!i||"inherit"===i.toLowerCase();n[r]=s?o:i}return n}return{getPresetList:Th((()=>He((()=>this.options.presets.filter((t=>!t.hidden)))))),getPreset:Th((({commands:n})=>{const r=n.getBlockAttributes("preset",{id:this.options.defaultId}),o=n.getPresetList(),i=n.isLink(),s=n.getLinkPreset();return He((()=>{const n=t(je(o),je(r).id);if(!je(i))return n;const a=je(s);return{id:n.id,common:e(n.common,a.common),mobile:e(n.mobile,a.mobile),tablet:e(n.tablet,a.tablet),desktop:e(n.desktop,a.desktop)}}))})),applyPreset:Th((({commands:e,chain:n},r)=>{const o=t(je(e.getPresetList()),r),i=o.node?.type??Fd.PARAGRAPH,s={preset:{id:r}};o.node&&(s.level=o.node.level);for(const t of Vd.attributes)s[t]=je(e.getBlockAttributes(t));n().removeList().setNode(i,s).run()})),applyDefaultPreset:Th((({commands:t})=>{t.applyPreset(this.options.defaultId)})),removePreset:Th((({commands:t})=>{t.setNode(Fd.PARAGRAPH,{preset:null})})),getPresetCustomization:Th((({editor:t,commands:e})=>{const n=Fe(t,"state");return He((()=>{const{selection:t,doc:r}=je(n),{from:o,to:i}=t;return e._getSettingCustomization(r,o,i)}))})),isSettingCustomized:Th((({commands:t},e)=>{const n=t.getPresetCustomization(),r=Vd.presetAttributes.includes(e)?"attributes":"marks";return He((()=>je(n)[r]?.includes(e)??!1))})),getContentCustomization:Th((({editor:t,commands:e})=>{const n=Fe(t,"state");return He((()=>{const{doc:t}=je(n);return e._getSettingCustomization(t,0,t.content.size)}))})),_getSettingCustomization:Th(((t,e,n,r)=>{const o=new Set,i=new Set;return e.nodesBetween(n,r,(t=>{for(const[e,n]of Object.entries(t.attrs)){Vd.presetAttributes.includes(e)&&n&&i.add(e)}for(const{type:e}of t.marks)Vd.marks.includes(e.name)&&o.add(e.name)})),{attributes:Array.from(i),marks:Array.from(o)}})),removePresetCustomization:Th((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(Vd.marks).resetAttributes(Fd.PARAGRAPH,Vd.presetAttributes).resetAttributes(Fd.HEADING,Vd.presetAttributes).restoreSelection().run()})),removeFormat:Th((({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()}))}},onCreate(){this.options.styleRenderer.inject(qm.head,this.options.presets)}}),wm=dd.create({name:Vd.FONT_WEIGHT,group:Bd.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e});je(t.getFont()).isItalicSupported(e)||t.removeItalic()})),toggleBold:Th((({commands:t})=>{const e=je(t.getFontWeight()),n=je(t.getFont()),r=Number(e)>=600?"400":"700",o=n.findClosestWeight(r);t.applyFontWeight(o)})),getFontWeight:Th((({commands:t})=>{const e=t.getCommonSettingMark(this.name,t.getDefaultFontWeight()),n=t.getFont();return He((()=>{const t=je(e),r=je(n);return r.isWeightSupported(t)?t:r.findClosestWeight(t)}))})),getDefaultFontWeight:Th((({commands:t})=>{const e=t.getPreset();return He((()=>je(e).common.font_weight))}))}},addKeyboardShortcuts:()=>({"Mod-b":$h("toggleBold"),"Mod-B":$h("toggleBold")}),parseHTML(){const t=t=>"bold"===t?{value:"700"}:!!Number(t)&&{value:t};return[{style:"--zw-font-weight",getAttrs:t},{style:"font-weight",getAttrs:t},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML:({HTMLAttributes:t})=>Ih({font_weight:t.value})}),km=dd.create({name:Vd.FONT_SIZE,group:Bd.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes:()=>({mobile:{default:null},tablet:{default:null},desktop:{default:null}}),addCommands(){return{getFontSize:Th((({commands:t})=>t.getDeviceSettingMark(this.name,t.getDefaultFontSize()))),getDefaultFontSize:Th((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return He((()=>je(n)[je(e)].font_size.replace("px","")))})),applyFontSize:Th((({commands:t},e)=>{const n=je(t.getDevice());t.applyMark(this.name,{[n]:e},{isAppliedToParent:(t,e)=>t.type.name===e.type.name&&t.attrs[n]===e.attrs[n],onAppliedToParent:({tr:t,node:e,position:r,mark:o})=>{const i={...o.attrs,[n]:null},s=!Object.values(i).some((t=>!!t));if(s)return!1;const a=o.type.create(i);e.isText?t.addMark(r,r+e.nodeSize,a):t.addNodeMark(r,a)}})})),increaseFontSize:Th((({commands:t})=>{const e=Number(je(t.getFontSize())),n=Math.min(e+1,this.options.maxSize);t.applyFontSize(String(n))})),decreaseFontSize:Th((({commands:t})=>{const e=Number(je(t.getFontSize())),n=Math.max(e-1,this.options.minSize);t.applyFontSize(String(n))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-=":$h("increaseFontSize"),"Mod-Shift--":$h("decreaseFontSize")}),parseHTML(){const t=t=>{if(!t)return null;const e=tm(t,je(this.options.wrapperRef));return String(e)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:t(e.getPropertyValue("--zw-font-size-mobile")),tablet:t(e.getPropertyValue("--zw-font-size-tablet")),desktop:t(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const n=t(e);return{desktop:n,tablet:n,mobile:null}}}]},renderHTML({HTMLAttributes:t}){const e=t=>t?`${t}px`:null;return Ih({font_size_mobile:e(t.mobile),font_size_tablet:e(t.tablet),font_size_desktop:e(t.desktop)})}}),xm=dd.create({name:Vd.FONT_COLOR,group:Bd.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:Th((({commands:t})=>t.getCommonSettingMark(this.name,t.getDefaultFontColor()))),getDefaultFontColor:Th((({commands:t})=>{const e=t.getPreset();return He((()=>je(e).common.color))})),applyFontColor:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Qh(t)});return[{style:"--zw-font-color",getAttrs:t},{style:"color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({font_color:t.value})}),Sm=dd.create({name:Vd.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:Th((({commands:t})=>t.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)"))),applyBackgroundColor:Th((({commands:t},e)=>{t.applyMark(this.name,{value:e})}))}},parseHTML(){const t=t=>({value:Qh(t)});return[{style:"--zw-background-color",getAttrs:t},{style:"background-color",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({background_color:t.value})}),Em=Fp.create({name:"device_manager",addCommands(){return{getDevice:Th((()=>Fe(this.options,"device")))}}}),Om=dd.create({name:Vd.FONT_STYLE,group:Bd.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:Th((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultFontStyle();return He((()=>je(e)?.italic??je(n).italic))})),isItalicAvailable:Th((({commands:t})=>{const e=t.getFont(),n=t.getFontWeight();return He((()=>{const t=je(e),r=je(n);return t.isItalicSupported(r)&&!t.isWeightItalicOnly(r)}))})),getDefaultFontStyle:Th((({commands:t})=>{const e=t.getPreset();return He((()=>({italic:"italic"===je(e).common.font_style})))})),toggleItalic:Th((({commands:t})=>{je(t.isItalicAvailable())&&(je(t.isItalic())?t.removeItalic():t.applyItalic())})),applyItalic:Th((({commands:t})=>{t.applyMark(this.name,{italic:!0})})),removeItalic:Th((({commands:t})=>{t.applyMark(this.name,{italic:!1})}))}},addKeyboardShortcuts:()=>({"Mod-i":$h("toggleItalic"),"Mod-I":$h("toggleItalic")}),parseHTML(){const t=t=>({italic:t.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:t},{style:"font-style",getAttrs:t}]},renderHTML:({HTMLAttributes:t})=>Ih({font_style:t.italic?"italic":"normal"})}),Cm=dd.create({name:Vd.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:Th((({commands:t})=>{const e=t.getTextDecoration();return He((()=>je(e).underline))})),isStrikeThrough:Th((({commands:t})=>{const e=t.getTextDecoration();return He((()=>je(e).strike_through))})),getTextDecoration:Th((({commands:t})=>{const e=t.getMark(this.name),n=t.getDefaultTextDecoration();return He((()=>{const t=je(e)??{},r=je(n);return{underline:t.underline||r.underline,strike_through:t.strike_through||r.strike_through}}))})),isUnderlineCustomized:Th((({commands:t})=>{const e=t.isUnderline(),n=t.getDefaultTextDecoration();return He((()=>je(e)!==je(n).underline))})),getDefaultTextDecoration:Th((({commands:t})=>{const e=t.getPreset();return He((()=>{const{text_decoration:t}=je(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}}))})),toggleUnderline:Th((({commands:t})=>{t.toggleTextDecoration("underline")})),toggleStrikeThrough:Th((({commands:t})=>{t.toggleTextDecoration("strike_through")})),toggleTextDecoration:Th((({commands:t},e,n=null)=>{const r=je(t.getTextDecoration()),o=n??!r[e];t.applyMark(this.name,{[e]:o})})),applyTextDecoration:Th((({commands:t},e)=>{t.toggleTextDecoration(e,!0)})),removeTextDecoration:Th((({commands:t},e)=>{t.toggleTextDecoration(e,!1)}))}},addKeyboardShortcuts:()=>({"Mod-u":$h("toggleUnderline"),"Mod-U":$h("toggleUnderline")}),parseHTML(){const t=t=>{const e=t.includes("underline"),n=t.includes("line-through");return!(!e&&!n)&&{underline:e,strike_through:n}};return[{style:"--zw-text-decoration",getAttrs:t},{style:"text-decoration-line",getAttrs:t},{style:"text-decoration",getAttrs:t},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:t}){const e=[];return t.underline&&e.push("underline"),t.strike_through&&e.push("line-through"),e.length||e.push("none"),Ih({text_decoration:e.join(" ")})}}),Am=Fp.create({name:"case_style",addCommands:()=>({applyCaseStyle:Th((({commands:t},e)=>{switch(e){case jd.CAPITALIZE:return t.applyCapitalize();case jd.LOWERCASE:return t.applyLowerCase();case jd.UPPERCASE:return t.applyUpperCase()}})),applyCapitalize:Th((({commands:t})=>{t.transformText((({text:t})=>function(t){return t.toLowerCase().replace(/(?:^|\s)\S/g,(t=>t.toUpperCase()))}(t)))})),applyLowerCase:Th((({commands:t})=>{t.transformText((({text:t})=>t.toLowerCase()))})),applyUpperCase:Th((({commands:t})=>{t.transformText((({text:t})=>t.toUpperCase()))}))})}),Nm={mobile:null,tablet:null,desktop:null},Tm=Fp.create({name:Vd.ALIGNMENT,addGlobalAttributes:()=>[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{[Vd.ALIGNMENT]:{isRequired:!1,parseHTML({style:t}){const e=function(t){const e=nm[t]||t;return zd.values.includes(e)?e:null}(t.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const n=t.getPropertyValue("--zw-alignment-mobile")||null,r=t.getPropertyValue("--zw-alignment-tablet")||null,o=t.getPropertyValue("--zw-alignment-desktop")||null;return n||r||o?{desktop:o,tablet:r,mobile:n}:null},renderHTML:t=>t.alignment?Mh({alignment_mobile:t.alignment.mobile,alignment_tablet:t.alignment.tablet,alignment_desktop:t.alignment.desktop}):null}}}],addCommands(){return{applyAlignment:Th((({commands:t},e)=>{const n=je(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},Nm)})),removeAlignment:Th((({commands:t})=>t.removeBlockAttributes(this.name))),getAlignment:Th((({commands:t})=>{const e=t.getBlockAttributes(this.name,Nm),n=t.getDevice(),r=t.getDefaultAlignment();return He((()=>je(e)?.[je(n)]??je(r)))})),getDefaultAlignment:Th((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return He((()=>je(n)[je(e)].alignment??zd.LEFT))}))}},addKeyboardShortcuts:()=>({"Mod-Shift-l":$h("applyAlignment",zd.LEFT),"Mod-Shift-e":$h("applyAlignment",zd.CENTER),"Mod-Shift-r":$h("applyAlignment",zd.RIGHT),"Mod-Shift-j":$h("applyAlignment",zd.JUSTIFY)})}),Mm={mobile:null,tablet:null,desktop:null},Im=Fp.create({name:Vd.LINE_HEIGHT,addGlobalAttributes(){return[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{[Vd.LINE_HEIGHT]:{isRequired:!1,parseHTML:t=>{if(t.matches('[style*="--zw-line-height"]')){return{mobile:null,tablet:t.style.getPropertyValue("--zw-line-height-tablet")||null,desktop:t.style.getPropertyValue("--zw-line-height-desktop")||null}}const e=t.style.lineHeight;if(!e)return null;const n=em(e,t,je(this.options.wrapperRef));return n?{desktop:n,tablet:n,mobile:null}:null},renderHTML:t=>t.line_height?Mh({line_height_mobile:t.line_height.mobile,line_height_tablet:t.line_height.tablet,line_height_desktop:t.line_height.desktop}):null}}}]},addCommands(){return{getLineHeight:Th((({commands:t})=>{const e=t.getBlockAttributes(this.name,Mm),n=t.getDevice(),r=t.getDefaultLineHeight();return He((()=>je(e)?.[je(n)]??je(r)))})),getDefaultLineHeight:Th((({commands:t})=>{const e=t.getDevice(),n=t.getPreset();return He((()=>je(n)[je(e)].line_height))})),applyLineHeight:Th((({commands:t},e)=>{const n=je(t.getDevice());t.setBlockAttributes(this.name,{[n]:e},Mm)}))}}}),$m=fd.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",kp(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}).extend({name:Fd.LIST_ITEM,marks:Bd.SETTINGS,addCommands(){const t=({selection:t})=>t.$cursor.before(t.$cursor.depth-1);return{listItemNewline:Th((({commands:e,tr:n})=>{const r=n.doc.nodeAt(t(n));if(!n.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const o=t(n);for(const t of r.marks)n.addNodeMark(o,cm(t));return!0}))}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:t=>{const{state:e,commands:n}=t.editor,r=e.selection.$cursor?.path.some((t=>t.type?.name===Fd.LIST));if(r)return n.listItemNewline()}})}),Dm=fd.create({name:Fd.LIST,content:`${Fd.LIST_ITEM}+`,group:"block list",marks:Bd.SETTINGS,addExtensions:()=>[$m],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:Hd.DISC}}}),parseHTML(){const t={a:Hd.ROMAN,i:Hd.LATIN,1:Hd.DECIMAL},e=e=>{for(const n of Hd.values){const r=`.${this.options.baseClass}${n}`;if(e.matches(r))return n;if(t[e.type.toLowerCase()]===n)return n}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||Hd.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||Hd.DISC}})}]},renderHTML({HTMLAttributes:t}){const e=[this.options.baseClass+t.bullet.type,this.options.presetClass];return[Hd.ordered.includes(t.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands:()=>({getListType:Th((({commands:t})=>{const e=t.getBlockAttributes("bullet",{type:null});return He((()=>je(e).type??null))})),applyList:Th((({commands:t,chain:e},n)=>{if(je(t.getListType())!==n)return e().applyDefaultPreset().toggleList(Fd.LIST,Fd.LIST_ITEM).setBlockAttributes("bullet",{type:n}).command((({commands:t,tr:e})=>t._bubbleListItemMarks(e))).run();t.removeList()})),_bubbleListItemMarks:Th(((t,e)=>{const{doc:n,selection:r}=e,o=r.$from.start(),i=r.$to.end();function s(t,e){if(Vd.inlineMarks.includes(e.type))return!1;if(e.type.isInSet(t.marks))return!1;for(const n of t.content.content)if(n.childCount){if(!n.marks)return!1;if(!e.isInSet(n.marks))return!1}return!0}n.nodesBetween(o,i,((t,n)=>{if(t.type.name===Fd.LIST)return;if(t.type.name!==Fd.LIST_ITEM)return!1;const r=[];return t.forEach((o=>{for(const i of o.marks)i.isInSet(r)?e.removeNodeMark(n+1,i):s(t,i)&&(e.removeNodeMark(n+1,i),e.addNodeMark(n,cm(i)),r.push(i))})),!1}))})),removeList:Th((({commands:t,state:e})=>{const{tr:n,doc:r,selection:o}=e,i=o.$from.start(),s=o.$to.end();r.nodesBetween(i,s,((t,e,r)=>{if([Fd.LIST,Fd.LIST_ITEM].includes(t.type.name))return;if(r.type.name!==Fd.LIST_ITEM)return!1;const o=r.marks.filter((function(e){return!e.type.isInSet(t.marks)}));for(const t of o)n.addNodeMark(e,cm(t));return!1})),t.liftListItem(Fd.LIST_ITEM)}))}),addInputRules(){const t=(t,e)=>function(t){return new Mp({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=Sp(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&yl(a,t.type,i);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){const{selection:n,storedMarks:r}=e,{splittableMarks:o}=t.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){const t=i.filter((t=>o.includes(t.type.name)));s.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(e,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&wl(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}({find:e,type:this.type,getAttributes:{bullet:{type:t}},joinPredicate:(e,{attrs:n})=>n.bullet.type===t});return[t(Hd.DISC,/^\s*([-+*])\s$/),t(Hd.DECIMAL,/^(\d+)\.\s$/),t(Hd.LATIN,/^([ivx]{1,3})\.\s$/i),t(Hd.ROMAN,/^([a-z])\.\s$/i)]}});function Lm(t){return new tc({key:new rc("autolink"),appendTransaction:(e,n,r)=>{const o=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),i=e.some((t=>t.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=r,a=function(t,e){const n=new Pl(t);return e.forEach((t=>{t.steps.forEach((t=>{n.step(t)}))})),n}(n.doc,[...e]),{mapping:l}=a,c=function(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach(((t,o)=>{const i=[];if(t.ranges.length)t.forEach(((t,e)=>{i.push({from:t,to:e})}));else{const{from:t,to:e}=n[o];if(void 0===t||void 0===e)return;i.push({from:t,to:e})}i.forEach((({from:t,to:n})=>{const i=e.slice(o).map(t,-1),s=e.slice(o).map(n),a=e.invert().map(i,-1),l=e.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),od(r)}(a);return c.forEach((({oldRange:e,newRange:o})=>{id(e.from,e.to,n.doc).filter((e=>e.mark.type===t.type)).forEach((e=>{const o=id(l.map(e.from),l.map(e.to),r.doc).filter((e=>e.mark.type===t.type));if(!o.length)return;const i=o[0],a=n.doc.textBetween(e.from,e.to,void 0," "),c=r.doc.textBetween(i.from,i.to,void 0," "),u=Ah(a),p=Ah(c);u&&!p&&s.removeMark(i.from,i.to,t.type)}));const i=function(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,((t,e)=>{n(t)&&r.push({node:t,pos:e})})),r}(r.doc,o,(t=>t.isTextblock));let a,c;if(i.length>1?(a=i[0],c=r.doc.textBetween(a.pos,a.pos+a.node.nodeSize,void 0," ")):i.length&&r.doc.textBetween(o.from,o.to," "," ").endsWith(" ")&&(a=i[0],c=r.doc.textBetween(a.pos,o.to,void 0," ")),a&&c){const e=c.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],r=a.pos+c.lastIndexOf(n);if(!n)return!1;Ch(n).filter((t=>t.isLink)).filter((e=>!t.validate||t.validate(e.value))).map((t=>({...t,from:r+t.start+1,to:r+t.end+1}))).forEach((e=>{s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length?s:void 0}})}const Rm=dd.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach((t=>{"string"!=typeof t?Sh(t.scheme,t.optionalSlashes):Sh(t)}))},onDestroy(){af.groups={},xh.scanner=null,xh.parser=null,xh.tokenQueue=[],xh.pluginQueue=[],xh.customSchemes=[],xh.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}),addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",kp(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[hd({find:t=>Ch(t).filter((t=>!this.options.validate||this.options.validate(t.value))).filter((t=>t.isLink)).map((t=>({text:t.value,index:t.start,data:t}))),type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];var e;return this.options.autolink&&t.push(Lm({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new tc({key:new rc("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i,s;if(1!==r.button)return!1;const a=rd(t.state,e.type.name),l=null===(o=r.target)||void 0===o?void 0:o.closest("a"),c=null!==(i=null==l?void 0:l.href)&&void 0!==i?i:a.href,u=null!==(s=null==l?void 0:l.target)&&void 0!==s?s:a.target;return!(!l||!c||(window.open(c,u),0))}}}))),this.options.linkOnPaste&&t.push(function(t){return new tc({key:new rc("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const l=Ch(a).find((t=>t.isLink&&t.value===a));return!(!a||!l||(t.editor.commands.setMark(t.type,{href:l.href}),0))}}})}({editor:this.editor,type:this.type})),t}}),Pm=Rm.extend({name:Vd.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:t=>{const e=t.getAttribute("href");return e.startsWith("#")?parseFloat(t.getAttribute("href").replace("#","")):e}},target:{default:Wd.SELF,parseHTML:t=>t.getAttribute("target")||Wd.SELF},destination:{default:Ud.URL,parseHTML:t=>{const e=t.getAttribute("href");if(!e.startsWith("#"))return Ud.URL;const n=e.replace("#","");return je(this.options.pageBlocks).find((t=>t.id===parseInt(n)))?Ud.BLOCK:Ud.URL}}}},addCommands(){const{unsetLink:t}=this.parent();return{removeLink:t,applyLink:Th((({commands:t,chain:e},n)=>(t.setMeta("preventAutolink",!0),t.getSelectedText()?e().applyMark(this.name,n).expandSelectionToLink().command((({tr:t})=>(n.text&&t.insertText(n.text,t.selection.from,t.selection.to),!0))).run():t.insertContent(Jm.text(n.text,[Jm.mark(Vd.LINK,n)]))))),expandSelectionToLink:Th((({commands:t})=>{t.expandSelection((({node:t})=>this.type.isInSet(t.marks)))})),isLink:Th((({commands:t})=>t.hasMark(this.name))),getLinkPreset:Th((()=>He((()=>this.options.preset))))}},addProseMirrorPlugins(){return[...this.parent(),Nh.create(this.editor)]},renderHTML({HTMLAttributes:t}){const e=t.destination===Ud.BLOCK?`#${t.href}`:t.href,n=je(this.options.basePresetClass)+je(this.options.preset).id;return["a",{href:e,target:t.target,class:`${n} zw-style`},0]}}),jm=dd.create({name:Vd.SUPERSCRIPT,addCommands(){return{applySuperscript:Th((({commands:t})=>{t.setMark(this.name)})),removeSuperscript:Th((({commands:t})=>{t.unsetMark(this.name)})),toggleSuperscript:Th((({commands:t})=>{je(t.isSuperscript())?t.removeSuperscript():t.applySuperscript()})),isSuperscript:Th((({commands:t})=>{const e=t.getMark(this.name);return He((()=>!!je(e)))}))}},parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:t=>"super"===t&&null}],renderHTML:()=>["sup",{class:"zw-superscript"},0]}),zm=Fp.create({name:Vd.MARGIN,addGlobalAttributes:()=>[{types:[Fd.PARAGRAPH,Fd.HEADING],attributes:{[Vd.MARGIN]:{isRequired:!1,parseHTML(t){const{margin:e,marginTop:n,marginRight:r,marginBottom:o,marginLeft:i}=t.style;if(![e,n,r,o,i].some((t=>!!t)))return null;if(e)return{value:e};return{value:[n||0,r||0,o||0,i||0].join(" ")}},renderHTML:t=>t.margin?Mh({margin:t.margin.value}):null}}}]});function Fm(t){const e=e=>t.presetsRef.value.find((t=>t.id===e)),n=function(t){return Me(t,!1),t}({default:null,link:null});return Je(t.presetsRef,(()=>{n.default=e(t.defaultPresetId),n.link=e(t.linkPresetId)}),{immediate:!0}),[fm,mm,vm,md,Rd,um,pm,dm,ym].concat([bm.configure({presets:t.presetsRef,defaultId:t.defaultPresetId,styleRenderer:new Gm({baseClass:t.basePresetClass,makeVariable:t.makePresetVariable,linkPresetId:t.linkPresetId})}),Dm.configure({baseClass:t.baseListClass,presetClass:t.basePresetClass+t.defaultPresetId}),Em.configure({device:t.deviceRef}),km.configure({minSize:t.minFontSize,maxSize:t.maxFontSize,wrapperRef:t.wrapperRef}),_m.configure({fonts:t.fonts,defaultPreset:Fe(n,"default")}),wm,xm,Sm,Om,Cm,Am,jm,Tm,Im.configure({wrapperRef:t.wrapperRef}),Pm.configure({preset:Fe(n,"link"),basePresetClass:t.basePresetClass,pageBlocks:t.pageBlocksRef}),zm])}class Hm{_domParser=new DOMParser;types=window;parse(t){return this._domParser.parseFromString(t,"text/html")}}class Vm{content;constructor({content:t}){this.content=t}normalize(){throw new Error("Implement abstract method")}}class Bm extends Vm{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=Bm.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:t,parser:e}){super({content:t}),this._parser=e,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,(t=>"BR"===t.tagName)),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,(t=>"LI"===t.tagName)),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const t=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(t,(t=>t.remove()))}_normalizeRootTags(){const t=Array.from(this.dom.body.childNodes),e=this.dom.createDocumentFragment();let n;for(const r of t)this._isRootNode(r)?(e.append(r),n=null):(n||(n=this.dom.createElement("p"),e.append(n)),n.append(r));this.dom.body.innerHTML="",this.dom.body.append(e)}_createNodeIterator(t,e){return this.dom.createNodeIterator(this.dom.body,t,e)}_iterateNodes(t,e=(()=>!0)){const n=t=>"BODY"!==t.tagName&&e.call(this,t),r=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:t=>n(t)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(r,t)}_runIterator(t,e){let n=t.nextNode();for(;n;)e.call(this,n),n=t.nextNode()}_removeEmptyNodes(t){t.innerHTML.trim()||t.remove()}_normalizeListItems(t){const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes);let r,o;const i=n=>{this._assignElementProperties(n,t,Bm.BLOCK_STYLES),e.append(n)};this._assignElementProperties(t,t.parentElement,Bm.BLOCK_STYLES);for(const t of n)if(this._isBlockNode(t))i(t),r=null,o=t;else if("BR"===t.tagName&&o&&"BR"!==o?.tagName)t.remove(),o=t;else if("BR"!==t.tagName)r||(r=this.dom.createElement("p"),i(r)),r.append(t),o=t;else{const e=this.dom.createElement("p");e.append(t),i(e),r=null,o=t}t.append(e),this._removeStyleProperties(t,Bm.BLOCK_STYLES)}_isBlockNode(t){return Bm.BLOCK_NODE_NAMES.includes(t.tagName)}_isRootNode(t){return Bm.ROOT_NODE_NAMES.includes(t.tagName)}_assignElementProperties(t,e,n){for(const r of n){const n=e.style.getPropertyValue(r);n&&!t.style.getPropertyValue(r)&&t.style.setProperty(r,n)}}_removeStyleProperties(t,e){for(const n of e)t.style.removeProperty(n);0===t.style.length&&t.removeAttribute("style")}_normalizeBreakLines({parentElement:t}){if(!this._isBlockNode(t))return;if(!t.textContent)return;const e=this.dom.createDocumentFragment(),n=Array.from(t.childNodes),r=t.cloneNode(!0);r.innerHTML="";let o=r.cloneNode();const i=n=>{this._assignElementProperties(n,t,Bm.BLOCK_STYLES),e.append(n)};for(const t of n)"BR"!==t.tagName?o.append(t):(i(o),o=r.cloneNode());e.append(o),t.replaceWith(e)}_normalizeBlockTextDecoration(){const t=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveTextDecorationToChildren(e)}_moveTextDecorationToChildren(t){const e=this._parseTextDecoration(t);if(t.style.removeProperty("text-decoration-line"),t.style.removeProperty("text-decoration"),t.style.cssText||t.removeAttribute("style"),!e.none)for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=this._parseTextDecoration(r),i={underline:o.underline||e.underline,line_through:o.line_through||e.line_through};r.style.removeProperty("text-decoration-line"),r.style.removeProperty("text-decoration"),r.style.textDecoration=Object.entries(i).filter((([,t])=>t)).map((([t])=>t.replace("_","-"))).join(" ")}}_parseTextDecoration(t){const{textDecoration:e,textDecorationLine:n}=t.style,r=e||n||"";return{none:r.includes("none"),underline:r.includes("underline"),line_through:r.includes("line-through")}}_normalizeBlockBackgroundColor(){const t=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const e of t)this._moveBackgroundColorToChildren(e)}_moveBackgroundColorToChildren(t){const e=t.style.backgroundColor;t.style.removeProperty("background-color"),t.style.cssText||t.removeAttribute("style");for(const n of t.childNodes){const r=this._wrapTextNode(t,n),o=r.style.backgroundColor||e;r.style.backgroundColor=o}}_wrapTextNode(t,e){if(e.nodeType!==this._Node.TEXT_NODE)return e;const n=this.dom.createElement("span");return n.append(e.cloneNode()),t.replaceChild(n,e),n}}class Wm extends Vm{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(t){this._iterateChildNodes(this.content,t)}_iterateChildNodes(t,e){for(const n of t.content)n.content&&this._iterateChildNodes(n,e),e.call(this,n)}_bubbleMarks(t){if(t.content&&t.type!==Fd.LIST)for(const e of t.content)if(!this._isLink(e)&&e.marks)for(const n of e.marks.slice())this._includesMark(t,n)?this._removeMark(e,n):this._canBubbleMark(t,n)&&(this._removeMark(e,n),this._addMark(t,n))}_canBubbleMark(t,e){if(Vd.inlineMarks.includes(e.type))return!1;if(this._includesMarkType(t,e.type))return!1;for(const n of t.content)if(n.content||t.type!==Fd.LIST_ITEM){if(!n.marks)return!1;if(!this._includesMark(n,e))return!1}return!0}_includesMark(t,e){return t.marks?.some((t=>lm.isEqual(t,e)))??!1}_includesMarkType(t,e){return t.marks?.some((t=>t.type===e))??!1}_isLink(t){return t.type===Fd.TEXT&&this._includesMarkType(t,Vd.LINK)}_removeMark(t,e){if(!t.marks)return;const n=this._findMarkIndexByType(t,e.type);n>=0&&t.marks.splice(n,1),t.marks.length||delete t.marks}_addMark(t,e){this._removeMark(t,e),t.marks??=[],t.marks.push(e)}_findMarkIndexByType(t,e){return t.marks?.findIndex((t=>t.type===e))??null}}class Um{static build(t,e={}){return"string"==typeof t?this._buildHtml(t,e):this._buildJson(t)}static _buildHtml(t,e){return new Bm({content:t,parser:e.parser||new Hm})}static _buildJson(t){return new Wm({content:t})}static normalize(t,e={}){return Um.build(t,e).normalize()}}class qm{static window=globalThis.window;static use(t){this.window=t}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(t){return this.window.getComputedStyle(t)}}class Km{static build({config:t,nodeDomParser:e}){const n=function(t,e){return Cp(Pp.resolve(t),e)}(Fm({fonts:t.fonts,minFontSize:0,maxFontSize:0,presetsRef:Pe(t.presets),defaultPresetId:t.defaultPresetId,linkPresetId:t.linkPresetId,makePresetVariable:()=>"",basePresetClass:t.basePresetClass,baseListClass:t.baseListClass,deviceRef:Pe(Pd.DESKTOP),pageBlocksRef:Pe([]),wrapperRef:qm.document.createElement("p")}));return new Km({schema:n,domParser:Fa.fromSchema(n),nodeDomParser:e})}_schema;_domParser;_nodeDomParser;constructor({schema:t,domParser:e,nodeDomParser:n}){this._schema=t,this._domParser=e,this._nodeDomParser=n}toJSON(t){const e=Um.build(t,{parser:this._nodeDomParser});return e.normalizeHTML(),this._domParser.parse(e.dom.body).toJSON()}}class Jm{static doc(t){return{type:Fd.DOCUMENT,content:t}}static list(t,e){return{type:Fd.LIST,attrs:{bullet:{type:t}},content:e.map((t=>t.type===Fd.LIST_ITEM?t:this.listItem([].concat(t))))}}static listItem(...t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{type:Fd.LIST_ITEM,...e?{attrs:e}:{},...r?{marks:r}:{},content:[].concat(n).map((t=>"string"==typeof t?this.paragraph(t):t))}}static heading(t,...e){const n=this._textBlock(e,this.text);return n.attrs??={},n.attrs.level=t,{type:Fd.HEADING,...n}}static paragraph(...t){return{type:Fd.PARAGRAPH,...this._textBlock(t,this.text)}}static _textBlock(t){const{attrs:e,content:n,marks:r}=this._normalizeTextBlockArgs(t);return{content:"string"==typeof n?[this.text(n)]:n,...e?{attrs:e}:{},...r?{marks:r}:{}}}static _normalizeTextBlockArgs(t){return 1===t.length?{attrs:null,marks:null,content:t[0]}:2===t.length?{attrs:t[0],marks:null,content:t[1]}:{attrs:t[0],marks:t[1],content:t[2]}}static text(t,e){return{type:Fd.TEXT,...e?{marks:e}:{},text:t}}static link(t,e,n=[]){return this.text(t,[this.mark(Vd.LINK,e),...n])}static mark(t,e){return{type:t,attrs:e}}static populateAllDevices(t){return{mobile:t,tablet:t,desktop:t}}}class Gm{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:t,makeVariable:e,linkPresetId:n}){this._baseClass=t,this._makeVariable=e,this._linkPresetId=n}inject(t,e){let n=t.querySelector("[data-zw-styles]");n||(n=qm.document.createElement("style"),n.dataset.zwStyles="",n.innerHTML=this.render(e),t.append(n))}render(t){let e="";for(const n of t){const t=n.id===this._linkPresetId;e+=` ${this.makePresetCssClass(n)} {`;for(const r of Pd.values)for(const o of Object.keys(n[r])){const i=this._makeVariable({device:r,preset:n,property:o}),s=this._makeInternalVariableName(o,r);if(e+=`${s}: var(${i}, inherit);`,t&&!Vd.attributes.includes(o)){e+=`${s.replace("preset-","")}: var(${s});`}}e+="}"}return e}_makeInternalVariableName(t,e){return`--zw-preset-${"color"===t?"font-color":t.replace(/_/i,"-")}${e===Pd.COMMON?"":`-${e}`}`}makePresetHtmlClass(t){return this._baseClass+t.id}makePresetCssClass(t){return this.makePresetHtmlClass(t).split(" ").map((t=>`.${t}`)).join("")}}class Ym{static _instance;static get instance(){return this._instance??=new Ym,this._instance}static query(t,e){return this.instance.query(t,e)}query(t,e){let n=null;return t.descendants((t=>!n&&(this.matchNode(t,e)?(n=t,!1):void 0))),n?e.getMark?this.getMark(n,e.getMark):n:null}matchNode(t,e){return(!e.typeName||e.typeName===t.type.name)&&!(e.mark&&!this.getMark(t,e.mark))}getMark(t,e){return t.marks.find((t=>this.matchMark(t,e)))||null}matchMark(t,e){return t.type.name===e.typeName}}class Xm{static createWindow(){return(new i.JSDOM).window}types;parse(t){const{window:e}=new i.JSDOM(t);return this.types=e,e.document}}class Zm{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(t){if(!this.name)throw new Error('Command "name" is required');let e=t.command(this.name);if(this.description&&(e=e.description(this.description)),this.argument&&(e=e.argument(this.argument)),this.options.length)for(const t of this.options)e=e.option(t.flags,t.description,t.default);e.action(this.doCommand.bind(this))}output(t){console.log(t)}}const Qm=new W,tg=[class extends Zm{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:n.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(t,{config:e,format:r}){qm.use(Xm.createWindow());const o=n.resolve(process.cwd(),e),i=Km.build({config:require(o).editor,nodeDomParser:new Xm}),s=t.map((t=>i.toJSON(this._formatInputHtml(t)))),a=1===s.length?s[0]:s,l=this._stringifyContent(a);this.output("rb"===r?this._formatOutputRb(l):l)}_formatInputHtml(t){return t.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,((t,e)=>t.replace(e,parseFloat(e)/100)))}_stringifyContent(t){return JSON.stringify(t,((t,e)=>null===e?void 0:e),2)}_formatOutputRb(t){return t.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,(t=>t.replace(/"/g,""))).replace(/: "(.+)"([,\n])/g,": '$1'$2")}},class extends Zm{name="version";description="display cli version";doCommand(){this.output("3.6.0-0")}}];for(const t of tg)(new t).install(Qm);Qm.parse();