UNPKG

balm-ui

Version:

A modular and customizable UI library based on Material Design and Vue 3

1 lines 244 kB
import{computed as t,openBlock as e,createElementBlock as n,normalizeClass as s,Fragment as r,createElementVNode as i,normalizeStyle as o,createCommentVNode as l,renderList as a,renderSlot as c,ref as u,reactive as h,toRefs as d,onMounted as f,nextTick as p,watch as m,onBeforeUnmount as g,unref as b,toDisplayString as y,createStaticVNode as v,resolveComponent as x,createBlock as E,withModifiers as N,createTextVNode as w,createSlots as A,withCtx as k,normalizeProps as _,guardReactiveProps as q,onBeforeMount as L,createVNode as S,Transition as O,useSlots as T}from"vue";var j="10.31.1",C="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};function R(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var I=function(t){return function(t){return!!t&&"object"===typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===M}(t)}(t)};var M="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function B(t,e){return!1!==e.clone&&e.isMergeableObject(t)?V((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function D(t,e,n){return t.concat(e).map((function(t){return B(t,n)}))}function U(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function P(t,e){try{return e in t}catch(n){return!1}}function $(t,e,n){var s={};return n.isMergeableObject(t)&&U(t).forEach((function(e){s[e]=B(t[e],n)})),U(e).forEach((function(r){(function(t,e){return P(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,r)||(P(t,r)&&n.isMergeableObject(e[r])?s[r]=function(t,e){if(!e.customMerge)return V;var n=e.customMerge(t);return"function"===typeof n?n:V}(r,n)(t[r],e[r],n):s[r]=B(e[r],n))})),s}function V(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||D,n.isMergeableObject=n.isMergeableObject||I,n.cloneUnlessOtherwiseSpecified=B;var s=Array.isArray(e);return s===Array.isArray(t)?s?n.arrayMerge(t,e,n):$(t,e,n):B(e,n)}V.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return V(t,n,e)}),{})};var H=R(V);const F=/(?:^\[object\s(.*?)\]$)/,z=t=>Object.prototype.toString.call(t).replace(F,"$1").toLowerCase(),K=t=>{let{componentProps:e,propName:n,props:s}=t,r=s[n];if("object"===z(r)){const t=e[n].default;e[n].default=()=>H(t,r)}else Array.isArray(r)?e[n].default=()=>r:e[n].default=r},G=t=>{let{componentMixins:e,propName:n,props:s}=t;if(e.length){let t=e.length;for(;t--;)if(e[t].props&&void 0!==e[t].props[n]){K({componentProps:e[t].props,propName:n,props:s});break}}},W=(t,e)=>{for(const n of Object.keys(e))t.props?void 0===t.props[n]?G({componentMixins:t.mixins,propName:n,props:e}):K({componentProps:t.props,propName:n,props:e}):G({componentMixins:t.mixins,propName:n,props:e})},Z=(t,e,n)=>{let{Components:s,Plugins:r,Directives:i}=n;((t,e)=>{for(const n of Object.keys(e))if(/^Ui[A-Z]{1}[A-Za-z]+$/.test(n)){const s=t[n],r=e[n];W(s,r)}})(s,e);for(const o in s){const e=s[o];t.component(e.name,e)}for(const o in r){const n=r[o];e[o]?t.use(n,e[o]):t.use(n)}for(const o in i){const e=i[o];t.directive(e.name,e)}},Q={key:0,class:"mdc-skeleton__header"},X={class:"mdc-skeleton__content"},Y={key:1,class:"mdc-skeleton-paragraph"},J={name:"UiSkeleton",customOptions:{}};var tt=Object.assign(J,{props:{loading:{type:Boolean,default:!0},active:{type:Boolean,default:!1},avatar:{type:[Boolean,Object],default:!1},title:{type:[Boolean,Object],default:!0},paragraph:{type:[Boolean,Object],default:!0}},setup(u){const h=u,d=t((()=>h.loading?{"mdc-skeleton":!0,"mdc-skeleton--with-avatar":h.avatar,"mdc-skeleton--active":h.active}:{})),f=t((()=>"object"===z(h.avatar)?h.avatar:{})),p=t((()=>({"mdc-skeleton-avatar":!0,"mdc-skeleton-avatar--circle":"square"!==f.value.shape,"mdc-skeleton-avatar--large":"large"===f.value.size,"mdc-skeleton-avatar--small":"small"===f.value.size}))),m=t((()=>{const{size:t}=f.value;return"number"===z(t)?{width:`${t}px`,height:`${t}px`,lineHeight:`${t}px`}:{}})),g=t((()=>{let t={};return!h.avatar&&h.paragraph&&(t={width:"38%"}),h.avatar&&h.paragraph&&(t={width:"50%"}),"object"===z(h.title)&&h.title.width&&(t={width:h.title.width}),t})),b=t((()=>{let t={};return h.avatar&&h.title||(t={width:"61%"}),"object"===z(h.paragraph)&&h.paragraph.width&&(t={width:h.paragraph.width}),t})),y=t((()=>{let t=0;return t=!h.avatar&&h.title?3:2,"object"===z(h.paragraph)&&h.paragraph.rows&&(t=h.paragraph.rows),t}));return(t,h)=>(e(),n("div",{class:s(d.value)},[u.loading?(e(),n(r,{key:0},[u.avatar?(e(),n("div",Q,[i("i",{class:s(p.value),style:o(m.value)},null,6)])):l("",!0),i("div",X,[u.title?(e(),n("h3",{key:0,class:"mdc-skeleton-title",style:o(g.value)},null,4)):l("",!0),y.value?(e(),n("ul",Y,[(e(!0),n(r,null,a(y.value,(t=>(e(),n("li",{key:t,style:o(t===y.value?b.value:{})},null,4)))),128))])):l("",!0)])],64)):c(t.$slots,"default",{key:1})],2))}}),et="object"==typeof global&&global&&global.Object===Object&&global,nt="object"==typeof self&&self&&self.Object===Object&&self,st=et||nt||Function("return this")(),rt=st.Symbol,it=Object.prototype,ot=it.hasOwnProperty,lt=it.toString,at=rt?rt.toStringTag:void 0;var ct=Object.prototype.toString;var ut=rt?rt.toStringTag:void 0;function ht(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ut&&ut in Object(t)?function(t){var e=ot.call(t,at),n=t[at];try{t[at]=void 0;var s=!0}catch(i){}var r=lt.call(t);return s&&(e?t[at]=n:delete t[at]),r}(t):function(t){return ct.call(t)}(t)}function dt(t){return null!=t&&"object"==typeof t}var ft=Array.isArray;function pt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function mt(t){return t}function gt(t){if(!pt(t))return!1;var e=ht(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var bt=st["__core-js_shared__"],yt=function(){var t=/[^.]+$/.exec(bt&&bt.keys&&bt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var vt=Function.prototype.toString;function xt(t){if(null!=t){try{return vt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Et=/^\[object .+?Constructor\]$/,Nt=Function.prototype,wt=Object.prototype,At=Nt.toString,kt=wt.hasOwnProperty,_t=RegExp("^"+At.call(kt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qt(t){return!(!pt(t)||(e=t,yt&&yt in e))&&(gt(t)?_t:Et).test(xt(t));var e}function Lt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return qt(n)?n:void 0}var St=Lt(st,"WeakMap"),Ot=Object.create,Tt=function(){function t(){}return function(e){if(!pt(e))return{};if(Ot)return Ot(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function jt(t,e){var n=-1,s=t.length;for(e||(e=Array(s));++n<s;)e[n]=t[n];return e}var Ct=Date.now;var Rt=function(){try{var t=Lt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),It=function(t){var e=0,n=0;return function(){var s=Ct(),r=16-(s-n);if(n=s,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Rt?function(t,e){return Rt(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:mt);var Mt=/^(?:0|[1-9]\d*)$/;function Bt(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Mt.test(t))&&t>-1&&t%1==0&&t<e}function Dt(t,e,n){"__proto__"==e&&Rt?Rt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Ut(t,e){return t===e||t!==t&&e!==e}var Pt=Object.prototype.hasOwnProperty;function $t(t,e,n){var s=t[e];Pt.call(t,e)&&Ut(s,n)&&(void 0!==n||e in t)||Dt(t,e,n)}function Vt(t,e,n,s){var r=!n;n||(n={});for(var i=-1,o=e.length;++i<o;){var l=e[i],a=void 0;void 0===a&&(a=t[l]),r?Dt(n,l,a):$t(n,l,a)}return n}var Ht=Math.max;function Ft(t,e){return It(function(t,e,n){return e=Ht(void 0===e?t.length-1:e,0),function(){for(var s=arguments,r=-1,i=Ht(s.length-e,0),o=Array(i);++r<i;)o[r]=s[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=s[r];return l[e]=n(o),function(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)}(t,this,l)}}(t,e,mt),t+"")}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Kt(t){return null!=t&&zt(t.length)&&!gt(t)}var Gt=Object.prototype;function Wt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Gt)}function Zt(t){return dt(t)&&"[object Arguments]"==ht(t)}var Qt=Object.prototype,Xt=Qt.hasOwnProperty,Yt=Qt.propertyIsEnumerable,Jt=Zt(function(){return arguments}())?Zt:function(t){return dt(t)&&Xt.call(t,"callee")&&!Yt.call(t,"callee")};var te="object"==typeof exports&&exports&&!exports.nodeType&&exports,ee=te&&"object"==typeof module&&module&&!module.nodeType&&module,ne=ee&&ee.exports===te?st.Buffer:void 0,se=(ne?ne.isBuffer:void 0)||function(){return!1},re={};function ie(t){return function(e){return t(e)}}re["[object Float32Array]"]=re["[object Float64Array]"]=re["[object Int8Array]"]=re["[object Int16Array]"]=re["[object Int32Array]"]=re["[object Uint8Array]"]=re["[object Uint8ClampedArray]"]=re["[object Uint16Array]"]=re["[object Uint32Array]"]=!0,re["[object Arguments]"]=re["[object Array]"]=re["[object ArrayBuffer]"]=re["[object Boolean]"]=re["[object DataView]"]=re["[object Date]"]=re["[object Error]"]=re["[object Function]"]=re["[object Map]"]=re["[object Number]"]=re["[object Object]"]=re["[object RegExp]"]=re["[object Set]"]=re["[object String]"]=re["[object WeakMap]"]=!1;var oe="object"==typeof exports&&exports&&!exports.nodeType&&exports,le=oe&&"object"==typeof module&&module&&!module.nodeType&&module,ae=le&&le.exports===oe&&et.process,ce=function(){try{var t=le&&le.require&&le.require("util").types;return t||ae&&ae.binding&&ae.binding("util")}catch(e){}}(),ue=ce&&ce.isTypedArray,he=ue?ie(ue):function(t){return dt(t)&&zt(t.length)&&!!re[ht(t)]},de=Object.prototype.hasOwnProperty;function fe(t,e){var n=ft(t),s=!n&&Jt(t),r=!n&&!s&&se(t),i=!n&&!s&&!r&&he(t),o=n||s||r||i,l=o?function(t,e){for(var n=-1,s=Array(t);++n<t;)s[n]=e(n);return s}(t.length,String):[],a=l.length;for(var c in t)!e&&!de.call(t,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Bt(c,a))||l.push(c);return l}function pe(t,e){return function(n){return t(e(n))}}var me=pe(Object.keys,Object),ge=Object.prototype.hasOwnProperty;function be(t){return Kt(t)?fe(t):function(t){if(!Wt(t))return me(t);var e=[];for(var n in Object(t))ge.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}var ye=Object.prototype.hasOwnProperty;function ve(t){if(!pt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Wt(t),n=[];for(var s in t)("constructor"!=s||!e&&ye.call(t,s))&&n.push(s);return n}function xe(t){return Kt(t)?fe(t,!0):ve(t)}var Ee=Lt(Object,"create");var Ne=Object.prototype.hasOwnProperty;var we=Object.prototype.hasOwnProperty;function Ae(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function ke(t,e){for(var n=t.length;n--;)if(Ut(t[n][0],e))return n;return-1}Ae.prototype.clear=function(){this.__data__=Ee?Ee(null):{},this.size=0},Ae.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Ae.prototype.get=function(t){var e=this.__data__;if(Ee){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ne.call(e,t)?e[t]:void 0},Ae.prototype.has=function(t){var e=this.__data__;return Ee?void 0!==e[t]:we.call(e,t)},Ae.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ee&&void 0===e?"__lodash_hash_undefined__":e,this};var _e=Array.prototype.splice;function qe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}qe.prototype.clear=function(){this.__data__=[],this.size=0},qe.prototype.delete=function(t){var e=this.__data__,n=ke(e,t);return!(n<0)&&(n==e.length-1?e.pop():_e.call(e,n,1),--this.size,!0)},qe.prototype.get=function(t){var e=this.__data__,n=ke(e,t);return n<0?void 0:e[n][1]},qe.prototype.has=function(t){return ke(this.__data__,t)>-1},qe.prototype.set=function(t,e){var n=this.__data__,s=ke(n,t);return s<0?(++this.size,n.push([t,e])):n[s][1]=e,this};var Le=Lt(st,"Map");function Se(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Oe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var s=t[e];this.set(s[0],s[1])}}function Te(t,e){for(var n=-1,s=e.length,r=t.length;++n<s;)t[r+n]=e[n];return t}Oe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ae,map:new(Le||qe),string:new Ae}},Oe.prototype.delete=function(t){var e=Se(this,t).delete(t);return this.size-=e?1:0,e},Oe.prototype.get=function(t){return Se(this,t).get(t)},Oe.prototype.has=function(t){return Se(this,t).has(t)},Oe.prototype.set=function(t,e){var n=Se(this,t),s=n.size;return n.set(t,e),this.size+=n.size==s?0:1,this};var je=pe(Object.getPrototypeOf,Object),Ce=Function.prototype,Re=Object.prototype,Ie=Ce.toString,Me=Re.hasOwnProperty,Be=Ie.call(Object);function De(t){var e=this.__data__=new qe(t);this.size=e.size}De.prototype.clear=function(){this.__data__=new qe,this.size=0},De.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},De.prototype.get=function(t){return this.__data__.get(t)},De.prototype.has=function(t){return this.__data__.has(t)},De.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qe){var s=n.__data__;if(!Le||s.length<199)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new Oe(s)}return n.set(t,e),this.size=n.size,this};var Ue="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pe=Ue&&"object"==typeof module&&module&&!module.nodeType&&module,$e=Pe&&Pe.exports===Ue?st.Buffer:void 0,Ve=$e?$e.allocUnsafe:void 0;function He(t,e){if(e)return t.slice();var n=t.length,s=Ve?Ve(n):new t.constructor(n);return t.copy(s),s}function Fe(){return[]}var ze=Object.prototype.propertyIsEnumerable,Ke=Object.getOwnPropertySymbols,Ge=Ke?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,s=null==t?0:t.length,r=0,i=[];++n<s;){var o=t[n];e(o,n,t)&&(i[r++]=o)}return i}(Ke(t),(function(e){return ze.call(t,e)})))}:Fe;var We=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Te(e,Ge(t)),t=je(t);return e}:Fe;function Ze(t,e,n){var s=e(t);return ft(t)?s:Te(s,n(t))}function Qe(t){return Ze(t,be,Ge)}function Xe(t){return Ze(t,xe,We)}var Ye=Lt(st,"DataView"),Je=Lt(st,"Promise"),tn=Lt(st,"Set"),en="[object Map]",nn="[object Promise]",sn="[object Set]",rn="[object WeakMap]",on="[object DataView]",ln=xt(Ye),an=xt(Le),cn=xt(Je),un=xt(tn),hn=xt(St),dn=ht;(Ye&&dn(new Ye(new ArrayBuffer(1)))!=on||Le&&dn(new Le)!=en||Je&&dn(Je.resolve())!=nn||tn&&dn(new tn)!=sn||St&&dn(new St)!=rn)&&(dn=function(t){var e=ht(t),n="[object Object]"==e?t.constructor:void 0,s=n?xt(n):"";if(s)switch(s){case ln:return on;case an:return en;case cn:return nn;case un:return sn;case hn:return rn}return e});var fn=Object.prototype.hasOwnProperty;var pn=st.Uint8Array;function mn(t){var e=new t.constructor(t.byteLength);return new pn(e).set(new pn(t)),e}var gn=/\w*$/;var bn=rt?rt.prototype:void 0,yn=bn?bn.valueOf:void 0;function vn(t,e){var n=e?mn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function xn(t,e,n){var s,r=t.constructor;switch(e){case"[object ArrayBuffer]":return mn(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return function(t,e){var n=e?mn(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return vn(t,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,gn.exec(t));return e.lastIndex=t.lastIndex,e}(t);case"[object Symbol]":return s=t,yn?Object(yn.call(s)):{}}}function En(t){return"function"!=typeof t.constructor||Wt(t)?{}:Tt(je(t))}var Nn=ce&&ce.isMap,wn=Nn?ie(Nn):function(t){return dt(t)&&"[object Map]"==dn(t)};var An=ce&&ce.isSet,kn=An?ie(An):function(t){return dt(t)&&"[object Set]"==dn(t)},_n="[object Arguments]",qn="[object Function]",Ln="[object Object]",Sn={};function On(t,e,n,s,r,i){var o,l=1&e,a=2&e,c=4&e;if(void 0!==o)return o;if(!pt(t))return t;var u=ft(t);if(u){if(o=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&fn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return jt(t,o)}else{var h=dn(t),d=h==qn||"[object GeneratorFunction]"==h;if(se(t))return He(t,l);if(h==Ln||h==_n||d&&!r){if(o=a||d?{}:En(t),!l)return a?function(t,e){return Vt(t,We(t),e)}(t,function(t,e){return t&&Vt(e,xe(e),t)}(o,t)):function(t,e){return Vt(t,Ge(t),e)}(t,function(t,e){return t&&Vt(e,be(e),t)}(o,t))}else{if(!Sn[h])return r?t:{};o=xn(t,h,l)}}i||(i=new De);var f=i.get(t);if(f)return f;i.set(t,o),kn(t)?t.forEach((function(s){o.add(On(s,e,n,s,t,i))})):wn(t)&&t.forEach((function(s,r){o.set(r,On(s,e,n,r,t,i))}));var p=u?void 0:(c?a?Xe:Qe:a?xe:be)(t);return function(t,e){for(var n=-1,s=null==t?0:t.length;++n<s&&!1!==e(t[n],n,t););}(p||t,(function(s,r){p&&(s=t[r=s]),$t(o,r,On(s,e,n,r,t,i))})),o}Sn[_n]=Sn["[object Array]"]=Sn["[object ArrayBuffer]"]=Sn["[object DataView]"]=Sn["[object Boolean]"]=Sn["[object Date]"]=Sn["[object Float32Array]"]=Sn["[object Float64Array]"]=Sn["[object Int8Array]"]=Sn["[object Int16Array]"]=Sn["[object Int32Array]"]=Sn["[object Map]"]=Sn["[object Number]"]=Sn[Ln]=Sn["[object RegExp]"]=Sn["[object Set]"]=Sn["[object String]"]=Sn["[object Symbol]"]=Sn["[object Uint8Array]"]=Sn["[object Uint8ClampedArray]"]=Sn["[object Uint16Array]"]=Sn["[object Uint32Array]"]=!0,Sn["[object Error]"]=Sn[qn]=Sn["[object WeakMap]"]=!1;function Tn(t){return On(t,5)}function jn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Oe;++e<n;)this.add(t[e])}function Cn(t,e){for(var n=-1,s=null==t?0:t.length;++n<s;)if(e(t[n],n,t))return!0;return!1}jn.prototype.add=jn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},jn.prototype.has=function(t){return this.__data__.has(t)};function Rn(t,e,n,s,r,i){var o=1&n,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var h=-1,d=!0,f=2&n?new jn:void 0;for(i.set(t,e),i.set(e,t);++h<l;){var p=t[h],m=e[h];if(s)var g=o?s(m,p,h,e,t,i):s(p,m,h,t,e,i);if(void 0!==g){if(g)continue;d=!1;break}if(f){if(!Cn(e,(function(t,e){if(o=e,!f.has(o)&&(p===t||r(p,t,n,s,i)))return f.push(e);var o}))){d=!1;break}}else if(p!==m&&!r(p,m,n,s,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function In(t){var e=-1,n=Array(t.size);return t.forEach((function(t,s){n[++e]=[s,t]})),n}function Mn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Bn=rt?rt.prototype:void 0,Dn=Bn?Bn.valueOf:void 0;var Un=Object.prototype.hasOwnProperty;var Pn="[object Arguments]",$n="[object Array]",Vn="[object Object]",Hn=Object.prototype.hasOwnProperty;function Fn(t,e,n,s,r,i){var o=ft(t),l=ft(e),a=o?$n:dn(t),c=l?$n:dn(e),u=(a=a==Pn?Vn:a)==Vn,h=(c=c==Pn?Vn:c)==Vn,d=a==c;if(d&&se(t)){if(!se(e))return!1;o=!0,u=!1}if(d&&!u)return i||(i=new De),o||he(t)?Rn(t,e,n,s,r,i):function(t,e,n,s,r,i,o){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new pn(t),new pn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ut(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var l=In;case"[object Set]":var a=1&s;if(l||(l=Mn),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;s|=2,o.set(t,e);var u=Rn(l(t),l(e),s,r,i,o);return o.delete(t),u;case"[object Symbol]":if(Dn)return Dn.call(t)==Dn.call(e)}return!1}(t,e,a,n,s,r,i);if(!(1&n)){var f=u&&Hn.call(t,"__wrapped__"),p=h&&Hn.call(e,"__wrapped__");if(f||p){var m=f?t.value():t,g=p?e.value():e;return i||(i=new De),r(m,g,n,s,i)}}return!!d&&(i||(i=new De),function(t,e,n,s,r,i){var o=1&n,l=Qe(t),a=l.length;if(a!=Qe(e).length&&!o)return!1;for(var c=a;c--;){var u=l[c];if(!(o?u in e:Un.call(e,u)))return!1}var h=i.get(t),d=i.get(e);if(h&&d)return h==e&&d==t;var f=!0;i.set(t,e),i.set(e,t);for(var p=o;++c<a;){var m=t[u=l[c]],g=e[u];if(s)var b=o?s(g,m,u,e,t,i):s(m,g,u,t,e,i);if(!(void 0===b?m===g||r(m,g,n,s,i):b)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var y=t.constructor,v=e.constructor;y==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(f=!1)}return i.delete(t),i.delete(e),f}(t,e,n,s,r,i))}function zn(t,e,n,s,r){return t===e||(null==t||null==e||!dt(t)&&!dt(e)?t!==t&&e!==e:Fn(t,e,n,s,zn,r))}var Kn=function(t,e,n){for(var s=-1,r=Object(t),i=n(t),o=i.length;o--;){var l=i[++s];if(!1===e(r[l],l,r))break}return t};function Gn(t,e,n){(void 0!==n&&!Ut(t[e],n)||void 0===n&&!(e in t))&&Dt(t,e,n)}function Wn(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}function Zn(t,e,n,s,r,i,o){var l=Wn(t,n),a=Wn(e,n),c=o.get(a);if(c)Gn(t,n,c);else{var u,h=i?i(l,a,n+"",t,e,o):void 0,d=void 0===h;if(d){var f=ft(a),p=!f&&se(a),m=!f&&!p&&he(a);h=a,f||p||m?ft(l)?h=l:dt(u=l)&&Kt(u)?h=jt(l):p?(d=!1,h=He(a,!0)):m?(d=!1,h=vn(a,!0)):h=[]:function(t){if(!dt(t)||"[object Object]"!=ht(t))return!1;var e=je(t);if(null===e)return!0;var n=Me.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ie.call(n)==Be}(a)||Jt(a)?(h=l,Jt(l)?h=function(t){return Vt(t,xe(t))}(l):pt(l)&&!gt(l)||(h=En(a))):d=!1}d&&(o.set(a,h),r(h,a,s,i,o),o.delete(a)),Gn(t,n,h)}}function Qn(t,e,n,s,r){t!==e&&Kn(e,(function(i,o){if(r||(r=new De),pt(i))Zn(t,e,o,n,Qn,s,r);else{var l=s?s(Wn(t,o),i,o+"",t,e,r):void 0;void 0===l&&(l=i),Gn(t,o,l)}}),xe)}function Xn(t,e){return zn(t,e)}var Yn,Jn=(Yn=function(t,e,n){Qn(t,e,n)},Ft((function(t,e){var n=-1,s=e.length,r=s>1?e[s-1]:void 0,i=s>2?e[2]:void 0;for(r=Yn.length>3&&"function"==typeof r?(s--,r):void 0,i&&function(t,e,n){if(!pt(n))return!1;var s=typeof e;return!!("number"==s?Kt(n)&&Bt(e,n.length):"string"==s&&e in n)&&Ut(n[e],t)}(e[0],e[1],i)&&(r=s<3?void 0:r,s=1),t=Object(t);++n<s;){var o=e[n];o&&Yn(t,o,n,r)}return t}))),ts=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(ts||{});class es{constructor(t,e,n={}){this.attrName=t,this.keyName=e;const s=ts.TYPE&ts.ATTRIBUTE;this.scope=null!=n.scope?n.scope&ts.LEVEL|s:ts.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(t){return Array.from(t.attributes).map((t=>t.name))}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}class ns extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}const ss=class t{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){if(null==t)return null;if(this.blots.has(t))return this.blots.get(t)||null;if(e){let n=null;try{n=t.parentNode}catch{return null}return this.find(n,e)}return null}create(e,n,s){const r=this.query(n);if(null==r)throw new ns(`Unable to create ${n} blot`);const i=r,o=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:i.create(s),l=new i(e,o,s);return t.blots.set(l.domNode,l),l}find(e,n=!1){return t.find(e,n)}query(t,e=ts.ANY){let n;return"string"==typeof t?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof t?t&ts.LEVEL&ts.BLOCK?n=this.types.block:t&ts.LEVEL&ts.INLINE&&(n=this.types.inline):t instanceof Element&&((t.getAttribute("class")||"").split(/\s+/).some((t=>(n=this.classes[t],!!n))),n=n||this.tags[t.tagName]),null==n?null:"scope"in n&&e&ts.LEVEL&n.scope&&e&ts.TYPE&n.scope?n:null}register(...t){return t.map((t=>{const e="blotName"in t,n="attrName"in t;if(!e&&!n)throw new ns("Invalid definition");if(e&&"abstract"===t.blotName)throw new ns("Cannot register abstract class");const s=e?t.blotName:n?t.attrName:void 0;return this.types[s]=t,n?"string"==typeof t.keyName&&(this.attributes[t.keyName]=t):e&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map((t=>t.toUpperCase())):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach((e=>{(null==this.tags[e]||null==t.className)&&(this.tags[e]=t)})))),t}))}};ss.blots=new WeakMap;let rs=ss;function is(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((t=>0===t.indexOf(`${e}-`)))}const os=class extends es{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map((t=>t.split("-").slice(0,-1).join("-")))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){is(t,this.keyName).forEach((e=>{t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(is(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function ls(t){const e=t.split("-"),n=e.slice(1).map((t=>t[0].toUpperCase()+t.slice(1))).join("");return e[0]+n}const as=class extends es{static keys(t){return(t.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(t,e){return!!this.canAdd(t,e)&&(t.style[ls(this.keyName)]=e,!0)}remove(t){t.style[ls(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[ls(this.keyName)];return this.canAdd(t,e)?e:""}};const cs=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=rs.find(this.domNode);if(null==t)return;const e=es.keys(this.domNode),n=os.keys(this.domNode),s=as.keys(this.domNode);e.concat(n).concat(s).forEach((e=>{const n=t.scroll.query(e,ts.ATTRIBUTE);n instanceof es&&(this.attributes[n.attrName]=n)}))}copy(t){Object.keys(this.attributes).forEach((e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)}))}move(t){this.copy(t),Object.keys(this.attributes).forEach((t=>{this.attributes[t].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t)),{})}},us=class{constructor(t,e){this.scroll=t,this.domNode=e,rs.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new ns("Blot definition missing tagName");let e,n;return Array.isArray(this.tagName)?("string"==typeof t?(n=t.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof t&&(n=t),e="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),rs.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,s){const r=this.isolate(t,e);if(null!=this.scroll.query(n,ts.BLOT)&&s)r.wrap(n,s);else if(null!=this.scroll.query(n,ts.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);r.wrap(t),t.format(n,s)}}insertAt(t,e,n){const s=null==n?this.scroll.create("text",e):this.scroll.create(e,n),r=this.split(t);this.parent.insertBefore(s,r||void 0)}isolate(t,e){const n=this.split(t);if(null==n)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(t=this.parent){return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new ns(`Cannot wrap ${t}`);return n.appendChild(this),n}};us.blotName="abstract";let hs=us;const ds=class extends hs{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};ds.scope=ts.INLINE_BLOT;const fs=ds;class ps{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){if(this.insertBefore(t[0],null),t.length>1){const e=t.slice(1);this.append(...e)}}at(t){const e=this.iterator();let n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),s=0;for(;n;){if(n===t)return s;s+=1,n=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,n=this.head;for(;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t,e=!1){const n=this.iterator();let s=n();for(;s;){const r=s.length();if(t<r||e&&t===r&&(null==s.next||0!==s.next.length()))return[s,t];t-=r,s=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[s,r]=this.find(t);let i=t-r;const o=this.iterator(s);let l=o();for(;l&&i<t+e;){const s=l.length();t>i?n(l,t-i,Math.min(e,i+s-t)):n(l,0,Math.min(s,t+e-i)),i+=s,l=o()}}map(t){return this.reduce(((e,n)=>(e.push(t(n)),e)),[])}reduce(t,e){const n=this.iterator();let s=n();for(;s;)e=t(e,s),s=n();return e}}function ms(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const n=e.create(ts.INLINE);return Array.from(t.childNodes).forEach((t=>{n.domNode.appendChild(t)})),t.parentNode&&t.parentNode.replaceChild(n.domNode,t),n.attach(),n}}const gs=class t extends hs{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach((t=>{t.attach()}))}attachUI(e){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=e,t.uiClass&&this.uiNode.classList.add(t.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new ps,Array.from(this.domNode.childNodes).filter((t=>t!==this.uiNode)).reverse().forEach((t=>{try{const e=ms(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(e){if(e instanceof ns)return;throw e}}))}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,((t,e,n)=>{t.deleteAt(e,n)}))}descendant(e,n=0){const[s,r]=this.children.find(n);return null==e.blotName&&e(s)||null!=e.blotName&&s instanceof e?[s,r]:s instanceof t?s.descendant(e,r):[null,-1]}descendants(e,n=0,s=Number.MAX_VALUE){let r=[],i=s;return this.children.forEachAt(n,s,((n,s,o)=>{(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&r.push(n),n instanceof t&&(r=r.concat(n.descendants(e,s,i))),i-=o})),r}detach(){this.children.forEach((t=>{t.detach()})),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach((n=>{e||this.statics.allowedChildren.some((t=>n instanceof t))||(n.statics.scope===ts.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof t?n.unwrap():n.remove())}))}formatAt(t,e,n,s){this.children.forEachAt(t,e,((t,e,r)=>{t.formatAt(e,r,n,s)}))}insertAt(t,e,n){const[s,r]=this.children.find(t);if(s)s.insertAt(r,e,n);else{const t=null==n?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),t.parent=this,null!=e&&(n=e.domNode),(this.domNode.parentNode!==t.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(t.domNode,n),t.attach()}length(){return this.children.reduce(((t,e)=>t+e.length()),0)}moveChildren(t,e){this.children.forEach((n=>{t.insertBefore(n,e)}))}optimize(t){if(super.optimize(t),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,n=!1){const[s,r]=this.children.find(e,n),i=[[this,e]];return s instanceof t?i.concat(s.path(r,n)):(null!=s&&i.push([s,r]),i)}removeChild(t){this.children.remove(t)}replaceWith(e,n){const s="string"==typeof e?this.scroll.create(e,n):e;return s instanceof t&&this.moveChildren(s),super.replaceWith(s)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),((t,s,r)=>{const i=t.split(s,e);null!=i&&n.appendChild(i)})),n}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const n=[],s=[];t.forEach((t=>{t.target===this.domNode&&"childList"===t.type&&(n.push(...t.addedNodes),s.push(...t.removedNodes))})),s.forEach((t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null==e.domNode.parentNode||e.domNode.parentNode===this.domNode)&&e.detach()})),n.filter((t=>t.parentNode===this.domNode&&t!==this.uiNode)).sort(((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const n=ms(t,this.scroll);(n.next!==e||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,e||void 0))})),this.enforceAllowedChildren()}};gs.uiClass="";const bs=gs;const ys=class t extends bs{static create(t){return super.create(t)}static formats(e,n){const s=n.query(t.blotName);if(null==s||e.tagName!==s.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new cs(this.domNode)}format(e,n){if(e!==this.statics.blotName||n){const t=this.scroll.query(e,ts.INLINE);if(null==t)return;t instanceof es?this.attributes.attribute(t,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}else this.children.forEach((e=>{e instanceof t||(e=e.wrap(t.blotName,!0)),this.attributes.copy(e)})),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){null!=this.formats()[n]||this.scroll.query(n,ts.ATTRIBUTE)?this.isolate(t,e).format(n,s):super.formatAt(t,e,n,s)}optimize(e){super.optimize(e);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const s=this.next;s instanceof t&&s.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}(n,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some((t=>t.target===this.domNode&&"attributes"===t.type))&&this.attributes.build()}wrap(e,n){const s=super.wrap(e,n);return s instanceof t&&this.attributes.move(s),s}};ys.allowedChildren=[ys,fs],ys.blotName="inline",ys.scope=ts.INLINE_BLOT,ys.tagName="SPAN";const vs=ys,xs=class t extends bs{static create(t){return super.create(t)}static formats(e,n){const s=n.query(t.blotName);if(null==s||e.tagName!==s.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(t,e){super(t,e),this.attributes=new cs(this.domNode)}format(e,n){const s=this.scroll.query(e,ts.BLOCK);null!=s&&(s instanceof es?this.attributes.attribute(s,n):e!==this.statics.blotName||n?n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n):this.replaceWith(t.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,s){null!=this.scroll.query(n,ts.BLOCK)?this.format(n,s):super.formatAt(t,e,n,s)}insertAt(t,e,n){if(null==n||null!=this.scroll.query(e,ts.INLINE))super.insertAt(t,e,n);else{const s=this.split(t);if(null==s)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,n);s.parent.insertBefore(t,s)}}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some((t=>t.target===this.domNode&&"attributes"===t.type))&&this.attributes.build()}};xs.blotName="block",xs.scope=ts.BLOCK_BLOT,xs.tagName="P",xs.allowedChildren=[vs,xs,fs];const Es=xs,Ns=class extends bs{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,s){super.formatAt(t,e,n,s),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ns.blotName="container",Ns.scope=ts.BLOCK_BLOT;const ws=Ns;const As=class extends fs{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,s){0===t&&e===this.length()?this.format(n,s):super.formatAt(t,e,n,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}},ks={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},_s=class extends bs{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver((t=>{this.update(t)})),this.observer.observe(this.domNode,ks),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){const n=this.registry.find(t,e);return n?n.scroll===this?n:e?this.find(n.scroll.domNode.parentNode,!0):null:null}query(t,e=ts.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach((t=>{t.remove()})):super.deleteAt(t,e)}formatAt(t,e,n,s){this.update(),super.formatAt(t,e,n,s)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(t=[],e={}){super.optimize(e);const n=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)t.push(s.pop());const r=(t,e=!0)=>{null==t||t===this||null!=t.domNode.parentNode&&(n.has(t.domNode)||n.set(t.domNode,[]),e&&r(t.parent))},i=t=>{n.has(t.domNode)&&(t instanceof bs&&t.children.forEach(i),n.delete(t.domNode),t.optimize(e))};let o=t;for(let l=0;o.length>0;l+=1){if(l>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach((t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(r(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach((t=>{const e=this.find(t,!1);r(e,!1),e instanceof bs&&e.children.forEach((t=>{r(t,!1)}))}))):"attributes"===t.type&&r(e.prev)),r(e))})),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)t.push(s.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const n=new WeakMap;t.map((t=>{const e=this.find(t.target,!0);return null==e?null:n.has(e.domNode)?(n.get(e.domNode).push(t),null):(n.set(e.domNode,[t]),e)})).forEach((t=>{null!=t&&t!==this&&n.has(t.domNode)&&t.update(n.get(t.domNode)||[],e)})),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}};_s.blotName="scroll",_s.defaultChild=Es,_s.allowedChildren=[Es,ws],_s.scope=ts.BLOCK_BLOT,_s.tagName="DIV";const qs=_s,Ls=class t extends fs{static create(t){return document.createTextNode(t)}static value(t){return t.data}constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,n){null==n?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,n)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(t,e){t.some((t=>"characterData"===t.type&&t.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ls.blotName="text",Ls.scope=ts.INLINE_BLOT;const Ss=Ls;var Os=Object.freeze({__proto__:null,Attributor:es,AttributorStore:cs,BlockBlot:Es,ClassAttributor:os,ContainerBlot:ws,EmbedBlot:As,InlineBlot:vs,LeafBlot:fs,ParentBlot:bs,Registry:rs,Scope:ts,ScrollBlot:qs,StyleAttributor:as,TextBlot:Ss}),Ts={exports:{}},js=-1;function Cs(t,e,n,s,r){if(t===e)return t?[[0,t]]:[];if(null!=n){var i=function(t,e,n){var s="number"===typeof n?{index:n,length:0}:n.oldRange,r="number"===typeof n?null:n.newRange,i=t.length,o=e.length;if(0===s.length&&(null===r||0===r.length)){var l=s.index,a=t.slice(0,l),c=t.slice(l),u=r?r.index:null,h=l+o-i;if((null===u||u===h)&&!(h<0||h>o)){var d=e.slice(0,h);if((m=e.slice(h))===c){var f=Math.min(l,h);if((b=a.slice(0,f))===(v=d.slice(0,f)))return Ws(b,a.slice(f),d.slice(f),c)}}if(null===u||u===l){var p=l,m=(d=e.slice(0,p),e.slice(p));if(d===a){var g=Math.min(i-p,o-p);if((y=c.slice(c.length-g))===(x=m.slice(m.length-g)))return Ws(a,c.slice(0,c.length-g),m.slice(0,m.length-g),y)}}}if(s.length>0&&r&&0===r.length){var b=t.slice(0,s.index),y=t.slice(s.index+s.length);if(!(o<(f=b.length)+(g=y.length))){var v=e.slice(0,f),x=e.slice(o-g);if(b===v&&y===x)return Ws(b,t.slice(f,i-g),e.slice(f,o-g),y)}}return null}(t,e,n);if(i)return i}var o=Is(t,e),l=t.substring(0,o);o=Bs(t=t.substring(o),e=e.substring(o));var a=t.substring(t.length-o),c=function(t,e){var n;if(!t)return[[1,e]];if(!e)return[[js,t]];var s=t.length>e.length?t:e,r=t.length>e.length?e:t,i=s.indexOf(r);if(-1!==i)return n=[[1,s.substring(0,i)],[0,r],[1,s.substring(i+r.length)]],t.length>e.length&&(n[0][0]=n[2][0]=js),n;if(1===r.length)return[[js,t],[1,e]];var o=function(t,e){var n=t.length>e.length?t:e,s=t.length>e.length?e:t;if(n.length<4||2*s.length<n.length)return null;function r(t,e,n){for(var s,r,i,o,l=t.substring(n,n+Math.floor(t.length/4)),a=-1,c="";-1!==(a=e.indexOf(l,a+1));){var u=Is(t.substring(n),e.substring(a)),h=Bs(t.substring(0,n),e.substring(0,a));c.length<h+u&&(c=e.substring(a-h,a)+e.substring(a,a+u),s=t.substring(0,n-h),r=t.substring(n+u),i=e.substring(0,a-h),o=e.substring(a+u))}return 2*c.length>=t.length?[s,r,i,o,c]:null}var i,o,l,a,c,u=r(n,s,Math.ceil(n.length/4)),h=r(n,s,Math.ceil(n.length/2));if(!u&&!h)return null;i=h?u&&u[4].length>h[4].length?u:h:u;t.length>e.length?(o=i[0],l=i[1],a=i[2],c=i[3]):(a=i[0],c=i[1],o=i[2],l=i[3]);var d=i[4];return[o,l,a,c,d]}(t,e);if(o){var l=o[0],a=o[1],c=o[2],u=o[3],h=o[4],d=Cs(l,c),f=Cs(a,u);return d.concat([[0,h]],f)}return function(t,e){for(var n=t.length,s=e.length,r=Math.ceil((n+s)/2),i=r,o=2*r,l=new Array(o),a=new Array(o),c=0;c<o;c++)l[c]=-1,a[c]=-1;l[i+1]=0,a[i+1]=0;for(var u=n-s,h=u%2!==0,d=0,f=0,p=0,m=0,g=0;g<r;g++){for(var b=-g+d;b<=g-f;b+=2){for(var y=i+b,v=(A=b===-g||b!==g&&l[y-1]<l[y+1]?l[y+1]:l[y-1]+1)-b;A<n&&v<s&&t.charAt(A)===e.charAt(v);)A++,v++;if(l[y]=A,A>n)f+=2;else if(v>s)d+=2;else if(h){if((N=i+u-b)>=0&&N<o&&-1!==a[N])if(A>=(E=n-a[N]))return Rs(t,e,A,v)}}for(var x=-g+p;x<=g-m;x+=2){for(var E,N=i+x,w=(E=x===-g||x!==g&&a[N-1]<a[N+1]?a[N+1]:a[N-1]+1)-x;E<n&&w<s&&t.charAt(n-E-1)===e.charAt(s-w-1);)E++,w++;if(a[N]=E,E>n)m+=2;else if(w>s)p+=2;else if(!h){if((y=i+u-x)>=0&&y<o&&-1!==l[y]){var A;v=i+(A=l[y])-y;if(A>=(E=n-E))return Rs(t,e,A,v)}}}}return[[js,t],[1,e]]}(t,e)}(t=t.substring(0,t.length-o),e=e.substring(0,e.length-o));return l&&c.unshift([0,l]),a&&c.push([0,a]),Hs(c,r),s&&function(t){var e=!1,n=[],s=0,r=null,i=0,o=0,l=0,a=0,c=0;for(;i<t.length;)0==t[i][0]?(n[s++]=i,o=a,l=c,a=0,c=0,r=t[i][1]):(1==t[i][0]?a+=t[i][1].length:c+=t[i][1].length,r&&r.length<=Math.max(o,l)&&r.length<=Math.max(a,c)&&(t.splice(n[s-1],0,[js,r]),t[n[s-1]+1][0]=1,s--,i=--s>0?n[s-1]:-1,o=0,l=0,a=0,c=0,r=null,e=!0)),i++;e&&Hs(t);(function(t){function e(t,e){if(!t||!e)return 6;var n=t.charAt(t.length-1),s=e.charAt(0),r=n.match(Ds),i=s.match(Ds),o=r&&n.match(Us),l=i&&s.match(Us),a=o&&n.match(Ps),c=l&&s.match(Ps),u=a&&t.match($s),h=c&&e.match(Vs);return u||h?5:a||c?4:r&&!o&&l?3:o||l?2:r||i?1:0}var n=1;for(;n<t.length-1;){if(0==t[n-1][0]&&0==t[n+1][0]){var s=t[n-1][1],r=t[n][1],i=t[n+1][1],o=Bs(s,r);if(o){var l=r.substring(r.length-o);s=s.substring(0,s.length-o),r=l+r.substring(0,r.length-o),i=l+i}for(var a=s,c=r,u=i,h=e(s,r)+e(r,i);r.charAt(0)===i.charAt(0);){s+=r.charAt(0),r=r.substring(1)+i.charAt(0),i=i.substring(1);var d=e(s,r)+e(r,i);d>=h&&(h=d,a=s,c=r,u=i)}t[n-1][1]!=a&&(a?t[n-1][1]=a:(t.splice(n-1,1),n--),t[n][1]=c,u?t[n+1][1]=u:(t.splice(n+1,1),n--))}n++}})(t),i=1;for(;i<t.length;){if(t[i-1][0]==js&&1==t[i][0]){var u=t[i-1][1],h=t[i][1],d=Ms(u,h),f=Ms(h,u);d>=f?(d>=u.length/2||d>=h.length/2)&&(t.splice(i,0,[0,h.substring(0,d)]),t[i-1][1]=u.substring(0,u.length-d),t[i+1][1]=h.substring(d),i++):(f>=u.length/2||f>=h.length/2)&&(t.splice(i,0,[0,u.substring(0,f)]),t[i-1][0]=1,t[i-1][1]=h.substring(0,h.length-f),t[i+1][0]=js,t[i+1][1]=u.substring(f),i++),i++}i++}}(c),c}function Rs(t,e,n,s){var r=t.substring(0,n),i=e.substring(0,s),o=t.substring(n),l=e.substring(s),a=Cs(r,i),c=Cs(o,l);return a.concat(c)}function Is(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,s=Math.min(t.length,e.length),r=s,i=0;n<r;)t.substring(i,r)==e.substring(i,r)?i=n=r:s=r,r=Math.floor((s-n)/2+n);return Fs(t.charCodeAt(r-1))&&r--,r}function Ms(t,e){var n=t.length,s=e.length;if(0==n||0==s)return 0;n>s?t=t.substring(n-s):n<s&&(e=e.substring(0,n));var r=Math.min(n,s);if(t==e)return r;for(var i=0,o=1;;){var l=t.substring(r-o),a=e.indexOf(l);if(-1==a)return i;o+=a,0!=a&&t.substring(r-o)!=e.substring(0,o)||(i=o,o++)}}function Bs(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,s=Math.min(t.length,e.length),r=s,i=0;n<r;)t.substring(t.length-r,t.length-i)==e.substring(e.length-r,e.length-i)?i=n=r:s=r,r=Math.floor((s-n)/2+n);return zs(t.charCodeAt(t.length-r))&&r--,r}var Ds=/[^a-zA-Z0-9]/,Us=/\s/,Ps=/[\r\n]/,$s=/\n\r?\n$/,Vs=/^\r?\n\r?\n/;function Hs(t,e){t.push([0,""]);for(var n,s=0,r=0,i=0,o="",l="";s<t.length;)if(s<t.length-1&&!t[s][1])t.splice(s,1);else switch(t[s][0]){case 1:i++,l+=t[s][1],s++;break;case js:r++,o+=t[s][1],s++;break;case 0:var a=s-i-r-1;if(e){if(a>=0&&Gs(t[a][1])){var c=t[a][1].slice(-1);if(t[a][1]=t[a][1].slice(0,-1),o=c+o,l=c+l,!t[a][1]){t.splice(a,1),s--;var u=a-1;t[u]&&1===t[u][0]&&(i++,l=t[u][1]+l,u--),t[u]&&t[u][0]===js&&(r++,o=t[u][1]+o,u--),a=u}}if(Ks(t[s][1])){c=t[s][1].charAt(0);t[s][1]=t[s][1].slice(1),o+=c,l+=c}}if(s<t.length-1&&!t[s][1]){t.splice(s,1);break}if(o.length>0||l.length>0){o.length>0&&l.length>0&&(0!==(n=Is(l,o))&&(a>=0?t[a][1]+=l.substring(0,n):(t.splice(0,0,[0,l.substring(0,n)]),s++),l=l.substring(n),o=o.substring(n)),0!==(n=Bs(l,o))&&(t[s][1]=l.substring(l.length-n)+t[s][1],l=l.substring(0,l.length-n),o=o.substring(0,o.length-n)));var h=i+r;0===o.length&&0===l