Files
lucent-laravel/front/dist/assets/main.4387b1b7.js
T
2023-10-13 21:06:23 +03:00

172 lines
2.1 MiB
Plaintext

var nP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T0e(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Hu={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(s,e){(function(){var t,r="4.17.21",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",h="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",y=500,C="__lodash_placeholder__",A=1,O=2,N=4,L=1,j=2,z=1,q=2,ee=4,F=8,ne=16,oe=32,re=64,J=128,we=256,ye=512,De=30,_e="...",be=800,tt=16,Qe=1,ft=2,V=3,mt=1/0,nt=9007199254740991,Ot=17976931348623157e292,Tt=0/0,He=4294967295,ct=He-1,dn=He>>>1,kt=[["ary",J],["bind",z],["bindKey",q],["curry",F],["curryRight",ne],["flip",ye],["partial",oe],["partialRight",re],["rearg",we]],xn="[object Arguments]",We="[object Array]",xt="[object AsyncFunction]",he="[object Boolean]",es="[object Date]",ho="[object DOMException]",ao="[object Error]",xo="[object Function]",Yo="[object GeneratorFunction]",Ct="[object Map]",Jt="[object Number]",Et="[object Null]",Pe="[object Object]",Ut="[object Promise]",gn="[object Proxy]",yt="[object RegExp]",Yt="[object Set]",bn="[object String]",rs="[object Symbol]",Jn="[object Undefined]",ds="[object WeakMap]",Or="[object WeakSet]",Ns="[object ArrayBuffer]",Js="[object DataView]",Zs="[object Float32Array]",ba="[object Float64Array]",ar="[object Int8Array]",Ps="[object Int16Array]",Zr="[object Int32Array]",No="[object Uint8Array]",Mo="[object Uint8ClampedArray]",Mr="[object Uint16Array]",Ls="[object Uint32Array]",na=/\b__p \+= '';/g,gs=/\b(__p \+=) '' \+/g,va=/(__e\(.*?\)|\b__t\)) \+\n'';/g,an=/&(?:amp|lt|gt|quot|#39);/g,ps=/[&<>"']/g,Ii=RegExp(an.source),$e=RegExp(ps.source),Je=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,Wn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lo=/^\w*$/,go=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cn=/[\\^$.*+?()[\]{}|]/g,ts=RegExp(cn.source),wo=/^\s+/,cs=/\s/,_r=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ir=/\{\n\/\* \[wrapped with (.+)\] \*/,Vs=/,? & /,Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Bi=/[()=,{}\[\]\/\s]/,Ba=/\\(\\)?/g,hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,qe=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,jt=/^\[object .+?Constructor\]$/,co=/^0o[0-7]+$/i,Bo=/^(?:0|[1-9]\d*)$/,qo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yr=/($^)/,it=/['\n\r\u2028\u2029\\]/g,Wo="\\ud800-\\udfff",Di="\\u0300-\\u036f",oa="\\ufe20-\\ufe2f",ua="\\u20d0-\\u20ff",ur=Di+oa+ua,Dc="\\u2700-\\u27bf",gc="a-z\\xdf-\\xf6\\xf8-\\xff",Xa="\\xac\\xb1\\xd7\\xf7",fa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qs="\\u2000-\\u206f",xr=" \\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",Ki="A-Z\\xc0-\\xd6\\xd8-\\xde",fl="\\ufe0e\\ufe0f",pc=Xa+fa+Qs+xr,Zc="['\u2019]",gu="["+Wo+"]",gr="["+pc+"]",Ja="["+ur+"]",pu="\\d+",qc="["+Dc+"]",Vl="["+gc+"]",xa="[^"+Wo+pc+pu+Dc+gc+Ki+"]",Ar="\\ud83c[\\udffb-\\udfff]",Rm="(?:"+Ja+"|"+Ar+")",pf="[^"+Wo+"]",Cr="(?:\\ud83c[\\udde6-\\uddff]){2}",La="[\\ud800-\\udbff][\\udc00-\\udfff]",sa="["+Ki+"]",Yi="\\u200d",bu="(?:"+Vl+"|"+xa+")",Oc="(?:"+sa+"|"+xa+")",Fa="(?:"+Zc+"(?:d|ll|m|re|s|t|ve))?",Mc="(?:"+Zc+"(?:D|LL|M|RE|S|T|VE))?",bc=Rm+"?",gd="["+fl+"]?",Lf="(?:"+Yi+"(?:"+[pf,Cr,La].join("|")+")"+gd+bc+")*",vu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ul="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rc=gd+bc+Lf,bf="(?:"+[qc,Cr,La].join("|")+")"+Rc,Gc="(?:"+[pf+Ja+"?",Ja,Cr,La,gu].join("|")+")",pd=RegExp(Zc,"g"),Ae=RegExp(Ja,"g"),et=RegExp(Ar+"(?="+Ar+")|"+Gc+Rc,"g"),gt=RegExp([sa+"?"+Vl+"+"+Fa+"(?="+[gr,sa,"$"].join("|")+")",Oc+"+"+Mc+"(?="+[gr,sa+bu,"$"].join("|")+")",sa+"?"+bu+"+"+Fa,sa+"+"+Mc,Ul,vu,pu,bf].join("|"),"g"),Pt=RegExp("["+Yi+Wo+ur+fl+"]"),vn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ro=["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"],Rr=-1,vs={};vs[Zs]=vs[ba]=vs[ar]=vs[Ps]=vs[Zr]=vs[No]=vs[Mo]=vs[Mr]=vs[Ls]=!0,vs[xn]=vs[We]=vs[Ns]=vs[he]=vs[Js]=vs[es]=vs[ao]=vs[xo]=vs[Ct]=vs[Jt]=vs[Pe]=vs[yt]=vs[Yt]=vs[bn]=vs[ds]=!1;var is={};is[xn]=is[We]=is[Ns]=is[Js]=is[he]=is[es]=is[Zs]=is[ba]=is[ar]=is[Ps]=is[Zr]=is[Ct]=is[Jt]=is[Pe]=is[yt]=is[Yt]=is[bn]=is[rs]=is[No]=is[Mo]=is[Mr]=is[Ls]=!0,is[ao]=is[xo]=is[ds]=!1;var ki={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},qs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Li={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},yu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bd=parseFloat,Kn=parseInt,Nm=typeof nP=="object"&&nP&&nP.Object===Object&&nP,Fi=typeof self=="object"&&self&&self.Object===Object&&self,de=Nm||Fi||Function("return this")(),Me=e&&!e.nodeType&&e,je=Me&&!0&&s&&!s.nodeType&&s,Bt=je&&je.exports===Me,Ln=Bt&&Nm.process,Xo=function(){try{var pt=je&&je.require&&je.require("util").types;return pt||Ln&&Ln.binding&&Ln.binding("util")}catch{}}(),no=Xo&&Xo.isArrayBuffer,mi=Xo&&Xo.isDate,hn=Xo&&Xo.isMap,qr=Xo&&Xo.isRegExp,Nl=Xo&&Xo.isSet,Xi=Xo&&Xo.isTypedArray;function ni(pt,ln,nn){switch(nn.length){case 0:return pt.call(ln);case 1:return pt.call(ln,nn[0]);case 2:return pt.call(ln,nn[0],nn[1]);case 3:return pt.call(ln,nn[0],nn[1],nn[2])}return pt.apply(ln,nn)}function vf(pt,ln,nn,Eo){for(var er=-1,Wr=pt==null?0:pt.length;++er<Wr;){var ai=pt[er];ln(Eo,ai,nn(ai),pt)}return Eo}function Ss(pt,ln){for(var nn=-1,Eo=pt==null?0:pt.length;++nn<Eo&&ln(pt[nn],nn,pt)!==!1;);return pt}function Kc(pt,ln){for(var nn=pt==null?0:pt.length;nn--&&ln(pt[nn],nn,pt)!==!1;);return pt}function Ei(pt,ln){for(var nn=-1,Eo=pt==null?0:pt.length;++nn<Eo;)if(!ln(pt[nn],nn,pt))return!1;return!0}function sc(pt,ln){for(var nn=-1,Eo=pt==null?0:pt.length,er=0,Wr=[];++nn<Eo;){var ai=pt[nn];ln(ai,nn,pt)&&(Wr[er++]=ai)}return Wr}function Oi(pt,ln){var nn=pt==null?0:pt.length;return!!nn&&Ha(pt,ln,0)>-1}function Ff(pt,ln,nn){for(var Eo=-1,er=pt==null?0:pt.length;++Eo<er;)if(nn(ln,pt[Eo]))return!0;return!1}function da(pt,ln){for(var nn=-1,Eo=pt==null?0:pt.length,er=Array(Eo);++nn<Eo;)er[nn]=ln(pt[nn],nn,pt);return er}function Hf(pt,ln){for(var nn=-1,Eo=ln.length,er=pt.length;++nn<Eo;)pt[er+nn]=ln[nn];return pt}function fr(pt,ln,nn,Eo){var er=-1,Wr=pt==null?0:pt.length;for(Eo&&Wr&&(nn=pt[++er]);++er<Wr;)nn=ln(nn,pt[er],er,pt);return nn}function zu(pt,ln,nn,Eo){var er=pt==null?0:pt.length;for(Eo&&er&&(nn=pt[--er]);er--;)nn=ln(nn,pt[er],er,pt);return nn}function Vu(pt,ln){for(var nn=-1,Eo=pt==null?0:pt.length;++nn<Eo;)if(ln(pt[nn],nn,pt))return!0;return!1}var vc=Qa("length");function $f(pt){return pt.split("")}function jd(pt){return pt.match(Ur)||[]}function Xr(pt,ln,nn){var Eo;return nn(pt,function(er,Wr,ai){if(ln(er,Wr,ai))return Eo=Wr,!1}),Eo}function Ji(pt,ln,nn,Eo){for(var er=pt.length,Wr=nn+(Eo?1:-1);Eo?Wr--:++Wr<er;)if(ln(pt[Wr],Wr,pt))return Wr;return-1}function Ha(pt,ln,nn){return ln===ln?Bp(pt,ln,nn):Ji(pt,xi,nn)}function U0(pt,ln,nn,Eo){for(var er=nn-1,Wr=pt.length;++er<Wr;)if(Eo(pt[er],ln))return er;return-1}function xi(pt){return pt!==pt}function _l(pt,ln){var nn=pt==null?0:pt.length;return nn?yf(pt,ln)/nn:Tt}function Qa(pt){return function(ln){return ln==null?t:ln[pt]}}function Ng(pt){return function(ln){return pt==null?t:pt[ln]}}function zf(pt,ln,nn,Eo,er){return er(pt,function(Wr,ai,gi){nn=Eo?(Eo=!1,Wr):ln(nn,Wr,ai,gi)}),nn}function yc(pt,ln){var nn=pt.length;for(pt.sort(ln);nn--;)pt[nn]=pt[nn].value;return pt}function yf(pt,ln){for(var nn,Eo=-1,er=pt.length;++Eo<er;){var Wr=ln(pt[Eo]);Wr!==t&&(nn=nn===t?Wr:nn+Wr)}return nn}function Tr(pt,ln){for(var nn=-1,Eo=Array(pt);++nn<pt;)Eo[nn]=ln(nn);return Eo}function Uu(pt,ln){return da(ln,function(nn){return[nn,pt[nn]]})}function Pl(pt){return pt&&pt.slice(0,Ig(pt)+1).replace(wo,"")}function $a(pt){return function(ln){return pt(ln)}}function qi(pt,ln){return da(ln,function(nn){return pt[nn]})}function Hi(pt,ln){return pt.has(ln)}function rc(pt,ln){for(var nn=-1,Eo=pt.length;++nn<Eo&&Ha(ln,pt[nn],0)>-1;);return nn}function Vf(pt,ln){for(var nn=pt.length;nn--&&Ha(ln,pt[nn],0)>-1;);return nn}function Zd(pt,ln){for(var nn=pt.length,Eo=0;nn--;)pt[nn]===ln&&++Eo;return Eo}var Pg=Ng(ki),Pm=Ng(qs);function Il(pt){return"\\"+yu[pt]}function Im(pt,ln){return pt==null?t:pt[ln]}function el(pt){return Pt.test(pt)}function wf(pt){return vn.test(pt)}function $h(pt){for(var ln,nn=[];!(ln=pt.next()).done;)nn.push(ln.value);return nn}function Wu(pt){var ln=-1,nn=Array(pt.size);return pt.forEach(function(Eo,er){nn[++ln]=[er,Eo]}),nn}function zh(pt,ln){return function(nn){return pt(ln(nn))}}function Nc(pt,ln){for(var nn=-1,Eo=pt.length,er=0,Wr=[];++nn<Eo;){var ai=pt[nn];(ai===ln||ai===C)&&(pt[nn]=C,Wr[er++]=nn)}return Wr}function Vh(pt){var ln=-1,nn=Array(pt.size);return pt.forEach(function(Eo){nn[++ln]=Eo}),nn}function _f(pt){var ln=-1,nn=Array(pt.size);return pt.forEach(function(Eo){nn[++ln]=[Eo,Eo]}),nn}function Bp(pt,ln,nn){for(var Eo=nn-1,er=pt.length;++Eo<er;)if(pt[Eo]===ln)return Eo;return-1}function Bm(pt,ln,nn){for(var Eo=nn+1;Eo--;)if(pt[Eo]===ln)return Eo;return Eo}function Uf(pt){return el(pt)?qd(pt):vc(pt)}function Wl(pt){return el(pt)?wu(pt):$f(pt)}function Ig(pt){for(var ln=pt.length;ln--&&cs.test(pt.charAt(ln)););return ln}var Ke=Ng(Li);function qd(pt){for(var ln=et.lastIndex=0;et.test(pt);)++ln;return ln}function wu(pt){return pt.match(et)||[]}function Bg(pt){return pt.match(gt)||[]}var L1=function pt(ln){ln=ln==null?de:Uh.defaults(de.Object(),ln,Uh.pick(de,Ro));var nn=ln.Array,Eo=ln.Date,er=ln.Error,Wr=ln.Function,ai=ln.Math,gi=ln.Object,Gd=ln.RegExp,W0=ln.String,ya=ln.TypeError,vd=nn.prototype,Lg=Wr.prototype,tl=gi.prototype,Aa=ln["__core-js_shared__"],ju=Lg.toString,oi=tl.hasOwnProperty,_u=0,ic=function(){var S=/[^.]+$/.exec(Aa&&Aa.keys&&Aa.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),Wh=tl.toString,F1=ju.call(gi),Kd=de._,Fg=Gd("^"+ju.call(oi).replace(cn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yd=Bt?ln.Buffer:t,jl=ln.Symbol,jh=ln.Uint8Array,H1=Yd?Yd.allocUnsafe:t,Lm=zh(gi.getPrototypeOf,gi),Hg=gi.create,Zh=tl.propertyIsEnumerable,Xd=vd.splice,yd=jl?jl.isConcatSpreadable:t,si=jl?jl.iterator:t,li=jl?jl.toStringTag:t,Bl=function(){try{var S=Kg(gi,"defineProperty");return S({},"",{}),S}catch{}}(),Lp=ln.clearTimeout!==de.clearTimeout&&ln.clearTimeout,X=Eo&&Eo.now!==de.Date.now&&Eo.now,le=ln.setTimeout!==de.setTimeout&&ln.setTimeout,Se=ai.ceil,Ye=ai.floor,rt=gi.getOwnPropertySymbols,On=Yd?Yd.isBuffer:t,wn=ln.isFinite,Go=vd.join,ns=zh(gi.keys,gi),uo=ai.max,Sr=ai.min,Zl=Eo.now,ra=ln.parseInt,Mi=ai.random,Cu=vd.reverse,Ta=Kg(ln,"DataView"),qh=Kg(ln,"Map"),Fm=Kg(ln,"Promise"),$i=Kg(ln,"Set"),wa=Kg(ln,"WeakMap"),Yc=Kg(gi,"create"),Jd=wa&&new wa,Qi={},j0=tp(Ta),vv=tp(qh),Jr=tp(Fm),wd=tp($i),pr=tp(wa),ql=jl?jl.prototype:t,Wf=ql?ql.valueOf:t,Qd=ql?ql.toString:t;function xe(S){if(Al(S)&&!vr(S)&&!(S instanceof ci)){if(S instanceof Su)return S;if(oi.call(S,"__wrapped__"))return Dv(S)}return new Su(S)}var Cf=function(){function S(){}return function(T){if(!gl(T))return{};if(Hg)return Hg(T);S.prototype=T;var H=new S;return S.prototype=t,H}}();function $g(){}function Su(S,T){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!T,this.__index__=0,this.__values__=t}xe.templateSettings={escape:Je,evaluate:At,interpolate:Wt,variable:"",imports:{_:xe}},xe.prototype=$g.prototype,xe.prototype.constructor=xe,Su.prototype=Cf($g.prototype),Su.prototype.constructor=Su;function ci(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=He,this.__views__=[]}function yv(){var S=new ci(this.__wrapped__);return S.__actions__=nu(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=nu(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=nu(this.__views__),S}function $1(){if(this.__filtered__){var S=new ci(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function Z0(){var S=this.__wrapped__.value(),T=this.__dir__,H=vr(S),ae=T<0,ke=H?S.length:0,Ve=o3(0,ke,this.__views__),dt=Ve.start,_t=Ve.end,zt=_t-dt,pn=ae?_t:dt-1,Hn=this.__iteratees__,zn=Hn.length,Lo=0,hs=Sr(zt,this.__takeCount__);if(!H||!ae&&ke==zt&&hs==zt)return Wg(S,this.__actions__);var Is=[];e:for(;zt--&&Lo<hs;){pn+=T;for(var Hr=-1,$s=S[pn];++Hr<zn;){var fi=Hn[Hr],yi=fi.iteratee,cu=fi.type,Ou=yi($s);if(cu==ft)$s=Ou;else if(!Ou){if(cu==Qe)continue e;break e}}Is[Lo++]=$s}return Is}ci.prototype=Cf($g.prototype),ci.prototype.constructor=ci;function jf(S){var T=-1,H=S==null?0:S.length;for(this.clear();++T<H;){var ae=S[T];this.set(ae[0],ae[1])}}function Hm(){this.__data__=Yc?Yc(null):{},this.size=0}function zg(S){var T=this.has(S)&&delete this.__data__[S];return this.size-=T?1:0,T}function wv(S){var T=this.__data__;if(Yc){var H=T[S];return H===g?t:H}return oi.call(T,S)?T[S]:t}function Sf(S){var T=this.__data__;return Yc?T[S]!==t:oi.call(T,S)}function h2(S,T){var H=this.__data__;return this.size+=this.has(S)?0:1,H[S]=Yc&&T===t?g:T,this}jf.prototype.clear=Hm,jf.prototype.delete=zg,jf.prototype.get=wv,jf.prototype.has=Sf,jf.prototype.set=h2;function ku(S){var T=-1,H=S==null?0:S.length;for(this.clear();++T<H;){var ae=S[T];this.set(ae[0],ae[1])}}function Zu(){this.__data__=[],this.size=0}function q0(S){var T=this.__data__,H=Sd(T,S);if(H<0)return!1;var ae=T.length-1;return H==ae?T.pop():Xd.call(T,H,1),--this.size,!0}function G0(S){var T=this.__data__,H=Sd(T,S);return H<0?t:T[H][1]}function K0(S){return Sd(this.__data__,S)>-1}function z1(S,T){var H=this.__data__,ae=Sd(H,S);return ae<0?(++this.size,H.push([S,T])):H[ae][1]=T,this}ku.prototype.clear=Zu,ku.prototype.delete=q0,ku.prototype.get=G0,ku.prototype.has=K0,ku.prototype.set=z1;function Zf(S){var T=-1,H=S==null?0:S.length;for(this.clear();++T<H;){var ae=S[T];this.set(ae[0],ae[1])}}function Y0(){this.size=0,this.__data__={hash:new jf,map:new(qh||ku),string:new jf}}function X0(S){var T=Vp(this,S).delete(S);return this.size-=T?1:0,T}function dl(S){return Vp(this,S).get(S)}function m2(S){return Vp(this,S).has(S)}function pi(S,T){var H=Vp(this,S),ae=H.size;return H.set(S,T),this.size+=H.size==ae?0:1,this}Zf.prototype.clear=Y0,Zf.prototype.delete=X0,Zf.prototype.get=dl,Zf.prototype.has=m2,Zf.prototype.set=pi;function ro(S){var T=-1,H=S==null?0:S.length;for(this.__data__=new Zf;++T<H;)this.add(S[T])}function _d(S){return this.__data__.set(S,g),this}function Xn(S){return this.__data__.has(S)}ro.prototype.add=ro.prototype.push=_d,ro.prototype.has=Xn;function wc(S){var T=this.__data__=new ku(S);this.size=T.size}function kf(){this.__data__=new ku,this.size=0}function eh(S){var T=this.__data__,H=T.delete(S);return this.size=T.size,H}function Pc(S){return this.__data__.get(S)}function Vg(S){return this.__data__.has(S)}function Cd(S,T){var H=this.__data__;if(H instanceof ku){var ae=H.__data__;if(!qh||ae.length<a-1)return ae.push([S,T]),this.size=++H.size,this;H=this.__data__=new Zf(ae)}return H.set(S,T),this.size=H.size,this}wc.prototype.clear=kf,wc.prototype.delete=eh,wc.prototype.get=Pc,wc.prototype.has=Vg,wc.prototype.set=Cd;function hl(S,T){var H=vr(S),ae=!H&&om(S),ke=!H&&!ae&&ag(S),Ve=!H&&!ae&&!ke&&Md(S),dt=H||ae||ke||Ve,_t=dt?Tr(S.length,W0):[],zt=_t.length;for(var pn in S)(T||oi.call(S,pn))&&!(dt&&(pn=="length"||ke&&(pn=="offset"||pn=="parent")||Ve&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||Qh(pn,zt)))&&_t.push(pn);return _t}function Eu(S){var T=S.length;return T?S[Ef(0,T-1)]:t}function Fp(S,T){return Lc(nu(S),ha(T,0,S.length))}function V1(S){return Lc(nu(S))}function _n(S,T,H){(H!==t&&!Fr(S[T],H)||H===t&&!(T in S))&&ui(S,T,H)}function $m(S,T,H){var ae=S[T];(!(oi.call(S,T)&&Fr(ae,H))||H===t&&!(T in S))&&ui(S,T,H)}function Sd(S,T){for(var H=S.length;H--;)if(Fr(S[H][0],T))return H;return-1}function th(S,T,H,ae){return _a(S,function(ke,Ve,dt){T(ae,ke,H(ke),dt)}),ae}function qu(S,T){return S&&Af(T,Jl(T),S)}function U1(S,T){return S&&Af(T,rf(T),S)}function ui(S,T,H){T=="__proto__"&&Bl?Bl(S,T,{configurable:!0,enumerable:!0,value:H,writable:!0}):S[T]=H}function zi(S,T){for(var H=-1,ae=T.length,ke=nn(ae),Ve=S==null;++H<ae;)ke[H]=Ve?t:Sc(S,T[H]);return ke}function ha(S,T,H){return S===S&&(H!==t&&(S=S<=H?S:H),T!==t&&(S=S>=T?S:T)),S}function xs(S,T,H,ae,ke,Ve){var dt,_t=T&A,zt=T&O,pn=T&N;if(H&&(dt=ke?H(S,ae,ke,Ve):H(S)),dt!==t)return dt;if(!gl(S))return S;var Hn=vr(S);if(Hn){if(dt=b2(S),!_t)return nu(S,dt)}else{var zn=kl(S),Lo=zn==xo||zn==Yo;if(ag(S))return qm(S,_t);if(zn==Pe||zn==xn||Lo&&!ke){if(dt=zt||Lo?{}:oo(S),!_t)return zt?ih(S,U1(dt,S)):Ym(S,qu(dt,S))}else{if(!is[zn])return ke?S:{};dt=v2(S,zn,_t)}}Ve||(Ve=new wc);var hs=Ve.get(S);if(hs)return hs;Ve.set(S,dt),Qp(S)?S.forEach(function($s){dt.add(xs($s,T,H,$s,S,Ve))}):An(S)&&S.forEach(function($s,fi){dt.set(fi,xs($s,T,H,fi,S,Ve))});var Is=pn?zt?vi:eg:zt?rf:Jl,Hr=Hn?t:Is(S);return Ss(Hr||S,function($s,fi){Hr&&(fi=$s,$s=S[fi]),$m(dt,fi,xs($s,T,H,fi,S,Ve))}),dt}function kd(S){var T=Jl(S);return function(H){return Cl(H,S,T)}}function Cl(S,T,H){var ae=H.length;if(S==null)return!ae;for(S=gi(S);ae--;){var ke=H[ae],Ve=T[ke],dt=S[ke];if(dt===t&&!(ke in S)||!Ve(dt))return!1}return!0}function Gu(S,T,H){if(typeof S!="function")throw new ya(f);return ep(function(){S.apply(t,H)},T)}function za(S,T,H,ae){var ke=-1,Ve=Oi,dt=!0,_t=S.length,zt=[],pn=T.length;if(!_t)return zt;H&&(T=da(T,$a(H))),ae?(Ve=Ff,dt=!1):T.length>=a&&(Ve=Hi,dt=!1,T=new ro(T));e:for(;++ke<_t;){var Hn=S[ke],zn=H==null?Hn:H(Hn);if(Hn=ae||Hn!==0?Hn:0,dt&&zn===zn){for(var Lo=pn;Lo--;)if(T[Lo]===zn)continue e;zt.push(Hn)}else Ve(T,zn,ae)||zt.push(Hn)}return zt}var _a=Xm(qf),Hp=Xm(Gf,!0);function Qt(S,T){var H=!0;return _a(S,function(ae,ke,Ve){return H=!!T(ae,ke,Ve),H}),H}function Gr(S,T,H){for(var ae=-1,ke=S.length;++ae<ke;){var Ve=S[ae],dt=T(Ve);if(dt!=null&&(_t===t?dt===dt&&!nl(dt):H(dt,_t)))var _t=dt,zt=Ve}return zt}function J0(S,T,H,ae){var ke=S.length;for(H=jr(H),H<0&&(H=-H>ke?0:ke+H),ae=ae===t||ae>ke?ke:jr(ae),ae<0&&(ae+=ke),ae=H>ae?0:zv(ae);H<ae;)S[H++]=T;return S}function Ca(S,T){var H=[];return _a(S,function(ae,ke,Ve){T(ae,ke,Ve)&&H.push(ae)}),H}function Va(S,T,H,ae,ke){var Ve=-1,dt=S.length;for(H||(H=y2),ke||(ke=[]);++Ve<dt;){var _t=S[Ve];T>0&&H(_t)?T>1?Va(_t,T-1,H,ae,ke):Hf(ke,_t):ae||(ke[ke.length]=_t)}return ke}var Ug=ob(),Ic=ob(!0);function qf(S,T){return S&&Ug(S,T,Jl)}function Gf(S,T){return S&&Ic(S,T,Jl)}function $p(S,T){return sc(T,function(H){return sm(S[H])})}function Ll(S,T){T=Yh(T,S);for(var H=0,ae=T.length;S!=null&&H<ae;)S=S[Ju(T[H++])];return H&&H==ae?S:t}function kr(S,T,H){var ae=T(S);return vr(S)?ae:Hf(ae,H(S))}function Ua(S){return S==null?S===t?Jn:Et:li&&li in gi(S)?Ok(S):Tv(S)}function nh(S,T){return S>T}function Gl(S,T){return S!=null&&oi.call(S,T)}function Q0(S,T){return S!=null&&T in gi(S)}function zm(S,T,H){return S>=Sr(T,H)&&S<uo(T,H)}function W1(S,T,H){for(var ae=H?Ff:Oi,ke=S[0].length,Ve=S.length,dt=Ve,_t=nn(Ve),zt=1/0,pn=[];dt--;){var Hn=S[dt];dt&&T&&(Hn=da(Hn,$a(T))),zt=Sr(Hn.length,zt),_t[dt]=!H&&(T||ke>=120&&Hn.length>=120)?new ro(dt&&Hn):t}Hn=S[0];var zn=-1,Lo=_t[0];e:for(;++zn<ke&&pn.length<zt;){var hs=Hn[zn],Is=T?T(hs):hs;if(hs=H||hs!==0?hs:0,!(Lo?Hi(Lo,Is):ae(pn,Is,H))){for(dt=Ve;--dt;){var Hr=_t[dt];if(!(Hr?Hi(Hr,Is):ae(S[dt],Is,H)))continue e}Lo&&Lo.push(Is),pn.push(hs)}}return pn}function Wa(S,T,H,ae){return qf(S,function(ke,Ve,dt){T(ae,H(ke),Ve,dt)}),ae}function ac(S,T,H){T=Yh(T,S),S=C2(S,T);var ae=S==null?S:S[Ju(hh(T))];return ae==null?t:ni(ae,S,H)}function St(S){return Al(S)&&Ua(S)==xn}function _c(S){return Al(S)&&Ua(S)==Ns}function Xc(S){return Al(S)&&Ua(S)==es}function lc(S,T,H,ae,ke){return S===T?!0:S==null||T==null||!Al(S)&&!Al(T)?S!==S&&T!==T:xu(S,T,H,ae,lc,ke)}function xu(S,T,H,ae,ke,Ve){var dt=vr(S),_t=vr(T),zt=dt?We:kl(S),pn=_t?We:kl(T);zt=zt==xn?Pe:zt,pn=pn==xn?Pe:pn;var Hn=zt==Pe,zn=pn==Pe,Lo=zt==pn;if(Lo&&ag(S)){if(!ag(T))return!1;dt=!0,Hn=!1}if(Lo&&!Hn)return Ve||(Ve=new wc),dt||Md(S)?Qm(S,T,H,ae,ke,Ve):p2(S,T,zt,H,ae,ke,Ve);if(!(H&L)){var hs=Hn&&oi.call(S,"__wrapped__"),Is=zn&&oi.call(T,"__wrapped__");if(hs||Is){var Hr=hs?S.value():S,$s=Is?T.value():T;return Ve||(Ve=new wc),ke(Hr,$s,H,ae,Ve)}}return Lo?(Ve||(Ve=new wc),Jh(S,T,H,ae,ke,Ve)):!1}function ja(S){return Al(S)&&kl(S)==Ct}function Za(S,T,H,ae){var ke=H.length,Ve=ke,dt=!ae;if(S==null)return!Ve;for(S=gi(S);ke--;){var _t=H[ke];if(dt&&_t[2]?_t[1]!==S[_t[0]]:!(_t[0]in S))return!1}for(;++ke<Ve;){_t=H[ke];var zt=_t[0],pn=S[zt],Hn=_t[1];if(dt&&_t[2]){if(pn===t&&!(zt in S))return!1}else{var zn=new wc;if(ae)var Lo=ae(pn,Hn,zt,S,T,zn);if(!(Lo===t?lc(Hn,pn,L|j,ae,zn):Lo))return!1}}return!0}function Vm(S){if(!gl(S)||ib(S))return!1;var T=sm(S)?Fg:jt;return T.test(tp(S))}function Jc(S){return Al(S)&&Ua(S)==yt}function eb(S){return Al(S)&&kl(S)==Yt}function Ho(S){return Al(S)&&Jp(S.length)&&!!vs[Ua(S)]}function $(S){return typeof S=="function"?S:S==null?af:typeof S=="object"?vr(S)?Cn(S[0],S[1]):Ft(S):u0(S)}function G(S){if(!Jg(S))return ns(S);var T=[];for(var H in gi(S))oi.call(S,H)&&H!="constructor"&&T.push(H);return T}function ve(S){if(!gl(S))return dh(S);var T=Jg(S),H=[];for(var ae in S)ae=="constructor"&&(T||!oi.call(S,ae))||H.push(ae);return H}function Te(S,T){return S<T}function at(S,T){var H=-1,ae=au(S)?nn(S.length):[];return _a(S,function(ke,Ve,dt){ae[++H]=T(ke,Ve,dt)}),ae}function Ft(S){var T=ch(S);return T.length==1&&T[0][2]?Up(T[0][0],T[0][1]):function(H){return H===S||Za(H,S,T)}}function Cn(S,T){return uh(S)&&w2(T)?Up(Ju(S),T):function(H){var ae=Sc(H,S);return ae===t&&ae===T?ol(H,S):lc(T,ae,L|j)}}function Bn(S,T,H,ae,ke){S!==T&&Ug(T,function(Ve,dt){if(ke||(ke=new wc),gl(Ve))Uo(S,T,dt,H,Bn,ae,ke);else{var _t=ae?ae(Df(S,dt),Ve,dt+"",S,T,ke):t;_t===t&&(_t=Ve),_n(S,dt,_t)}},rf)}function Uo(S,T,H,ae,ke,Ve,dt){var _t=Df(S,H),zt=Df(T,H),pn=dt.get(zt);if(pn){_n(S,H,pn);return}var Hn=Ve?Ve(_t,zt,H+"",S,T,dt):t,zn=Hn===t;if(zn){var Lo=vr(zt),hs=!Lo&&ag(zt),Is=!Lo&&!hs&&Md(zt);Hn=zt,Lo||hs||Is?vr(_t)?Hn=_t:xl(_t)?Hn=nu(_t):hs?(zn=!1,Hn=qm(zt,!0)):Is?(zn=!1,Hn=Z1(zt,!0)):Hn=[]:n0(zt)||om(zt)?(Hn=_t,om(_t)?Hn=lC(_t):(!gl(_t)||sm(_t))&&(Hn=oo(zt))):zn=!1}zn&&(dt.set(zt,Hn),ke(Hn,zt,ae,Ve,dt),dt.delete(zt)),_n(S,H,Hn)}function Jo(S,T){var H=S.length;if(!!H)return T+=T<0?H:0,Qh(T,H)?S[T]:t}function bi(S,T,H){T.length?T=da(T,function(Ve){return vr(Ve)?function(dt){return Ll(dt,Ve.length===1?Ve[0]:Ve)}:Ve}):T=[af];var ae=-1;T=da(T,$a(Hs()));var ke=at(S,function(Ve,dt,_t){var zt=da(T,function(pn){return pn(Ve)});return{criteria:zt,index:++ae,value:Ve}});return yc(ke,function(Ve,dt){return Ma(Ve,dt,H)})}function tr(S,T){return br(S,T,function(H,ae){return ol(S,ae)})}function br(S,T,H){for(var ae=-1,ke=T.length,Ve={};++ae<ke;){var dt=T[ae],_t=Ll(S,dt);H(_t,dt)&&ea(Ve,Yh(dt,S),_t)}return Ve}function Bc(S){return function(T){return Ll(T,S)}}function Qc(S,T,H,ae){var ke=ae?U0:Ha,Ve=-1,dt=T.length,_t=S;for(S===T&&(T=nu(T)),H&&(_t=da(S,$a(H)));++Ve<dt;)for(var zt=0,pn=T[Ve],Hn=H?H(pn):pn;(zt=ke(_t,Hn,zt,ae))>-1;)_t!==S&&Xd.call(_t,zt,1),Xd.call(S,zt,1);return S}function Ku(S,T){for(var H=S?T.length:0,ae=H-1;H--;){var ke=T[H];if(H==ae||ke!==Ve){var Ve=ke;Qh(ke)?Xd.call(S,ke,1):xf(S,ke)}}return S}function Ef(S,T){return S+Ye(Mi()*(T-S+1))}function oh(S,T,H,ae){for(var ke=-1,Ve=uo(Se((T-S)/(H||1)),0),dt=nn(Ve);Ve--;)dt[ae?Ve:++ke]=S,S+=H;return dt}function sh(S,T){var H="";if(!S||T<1||T>nt)return H;do T%2&&(H+=S),T=Ye(T/2),T&&(S+=S);while(T);return H}function lr(S,T){return S2(z_(S,T,af),S+"")}function Um(S){return Eu(a0(S))}function Wm(S,T){var H=a0(S);return Lc(H,ha(T,0,H.length))}function ea(S,T,H,ae){if(!gl(S))return S;T=Yh(T,S);for(var ke=-1,Ve=T.length,dt=Ve-1,_t=S;_t!=null&&++ke<Ve;){var zt=Ju(T[ke]),pn=H;if(zt==="__proto__"||zt==="constructor"||zt==="prototype")return S;if(ke!=dt){var Hn=_t[zt];pn=ae?ae(Hn,zt,_t):t,pn===t&&(pn=gl(Hn)?Hn:Qh(T[ke+1])?[]:{})}$m(_t,zt,pn),_t=_t[zt]}return S}var eu=Jd?function(S,T){return Jd.set(S,T),S}:af,zp=Bl?function(S,T){return Bl(S,"toString",{configurable:!0,enumerable:!1,value:Qv(T),writable:!0})}:af;function jm(S){return Lc(a0(S))}function Os(S,T,H){var ae=-1,ke=S.length;T<0&&(T=-T>ke?0:ke+T),H=H>ke?ke:H,H<0&&(H+=ke),ke=T>H?0:H-T>>>0,T>>>=0;for(var Ve=nn(ke);++ae<ke;)Ve[ae]=S[ae+T];return Ve}function Br(S,T){var H;return _a(S,function(ae,ke,Ve){return H=T(ae,ke,Ve),!H}),!!H}function Da(S,T,H){var ae=0,ke=S==null?ae:S.length;if(typeof T=="number"&&T===T&&ke<=dn){for(;ae<ke;){var Ve=ae+ke>>>1,dt=S[Ve];dt!==null&&!nl(dt)&&(H?dt<=T:dt<T)?ae=Ve+1:ke=Ve}return ke}return cc(S,T,af,H)}function cc(S,T,H,ae){var ke=0,Ve=S==null?0:S.length;if(Ve===0)return 0;T=H(T);for(var dt=T!==T,_t=T===null,zt=nl(T),pn=T===t;ke<Ve;){var Hn=Ye((ke+Ve)/2),zn=H(S[Hn]),Lo=zn!==t,hs=zn===null,Is=zn===zn,Hr=nl(zn);if(dt)var $s=ae||Is;else pn?$s=Is&&(ae||Lo):_t?$s=Is&&Lo&&(ae||!hs):zt?$s=Is&&Lo&&!hs&&(ae||!Hr):hs||Hr?$s=!1:$s=ae?zn<=T:zn<T;$s?ke=Hn+1:Ve=Hn}return Sr(Ve,ct)}function j1(S,T){for(var H=-1,ae=S.length,ke=0,Ve=[];++H<ae;){var dt=S[H],_t=T?T(dt):dt;if(!H||!Fr(_t,zt)){var zt=_t;Ve[ke++]=dt===0?0:dt}}return Ve}function Sl(S){return typeof S=="number"?S:nl(S)?Tt:+S}function Gi(S){if(typeof S=="string")return S;if(vr(S))return da(S,Gi)+"";if(nl(S))return Qd?Qd.call(S):"";var T=S+"";return T=="0"&&1/S==-mt?"-0":T}function tu(S,T,H){var ae=-1,ke=Oi,Ve=S.length,dt=!0,_t=[],zt=_t;if(H)dt=!1,ke=Ff;else if(Ve>=a){var pn=T?null:g2(S);if(pn)return Vh(pn);dt=!1,ke=Hi,zt=new ro}else zt=T?[]:_t;e:for(;++ae<Ve;){var Hn=S[ae],zn=T?T(Hn):Hn;if(Hn=H||Hn!==0?Hn:0,dt&&zn===zn){for(var Lo=zt.length;Lo--;)if(zt[Lo]===zn)continue e;T&&zt.push(zn),_t.push(Hn)}else ke(zt,zn,H)||(zt!==_t&&zt.push(zn),_t.push(Hn))}return _t}function xf(S,T){return T=Yh(T,S),S=C2(S,T),S==null||delete S[Ju(hh(T))]}function F_(S,T,H,ae){return ea(S,T,H(Ll(S,T)),ae)}function Gh(S,T,H,ae){for(var ke=S.length,Ve=ae?ke:-1;(ae?Ve--:++Ve<ke)&&T(S[Ve],Ve,S););return H?Os(S,ae?0:Ve,ae?Ve+1:ke):Os(S,ae?Ve+1:0,ae?ke:Ve)}function Wg(S,T){var H=S;return H instanceof ci&&(H=H.value()),fr(T,function(ae,ke){return ke.func.apply(ke.thisArg,Hf([ae],ke.args))},H)}function Kh(S,T,H){var ae=S.length;if(ae<2)return ae?tu(S[0]):[];for(var ke=-1,Ve=nn(ae);++ke<ae;)for(var dt=S[ke],_t=-1;++_t<ae;)_t!=ke&&(Ve[ke]=za(Ve[ke]||dt,S[_t],T,H));return tu(Va(Ve,1),T,H)}function Zm(S,T,H){for(var ae=-1,ke=S.length,Ve=T.length,dt={};++ae<ke;){var _t=ae<Ve?T[ae]:t;H(dt,S[ae],_t)}return dt}function jg(S){return xl(S)?S:[]}function tb(S){return typeof S=="function"?S:af}function Yh(S,T){return vr(S)?S:uh(S,T)?[S]:lb(ia(S))}var Oa=lr;function rh(S,T,H){var ae=S.length;return H=H===t?ae:H,!T&&H>=ae?S:Os(S,T,H)}var Ed=Lp||function(S){return de.clearTimeout(S)};function qm(S,T){if(T)return S.slice();var H=S.length,ae=H1?H1(H):new S.constructor(H);return S.copy(ae),ae}function Gm(S){var T=new S.constructor(S.byteLength);return new jh(T).set(new jh(S)),T}function Xh(S,T){var H=T?Gm(S.buffer):S.buffer;return new S.constructor(H,S.byteOffset,S.byteLength)}function Yu(S){var T=new S.constructor(S.source,Ge.exec(S));return T.lastIndex=S.lastIndex,T}function nb(S){return Wf?gi(Wf.call(S)):{}}function Z1(S,T){var H=T?Gm(S.buffer):S.buffer;return new S.constructor(H,S.byteOffset,S.length)}function H_(S,T){if(S!==T){var H=S!==t,ae=S===null,ke=S===S,Ve=nl(S),dt=T!==t,_t=T===null,zt=T===T,pn=nl(T);if(!_t&&!pn&&!Ve&&S>T||Ve&&dt&&zt&&!_t&&!pn||ae&&dt&&zt||!H&&zt||!ke)return 1;if(!ae&&!Ve&&!pn&&S<T||pn&&H&&ke&&!ae&&!Ve||_t&&H&&ke||!dt&&ke||!zt)return-1}return 0}function Ma(S,T,H){for(var ae=-1,ke=S.criteria,Ve=T.criteria,dt=ke.length,_t=H.length;++ae<dt;){var zt=H_(ke[ae],Ve[ae]);if(zt){if(ae>=_t)return zt;var pn=H[ae];return zt*(pn=="desc"?-1:1)}}return S.index-T.index}function Zg(S,T,H,ae){for(var ke=-1,Ve=S.length,dt=H.length,_t=-1,zt=T.length,pn=uo(Ve-dt,0),Hn=nn(zt+pn),zn=!ae;++_t<zt;)Hn[_t]=T[_t];for(;++ke<dt;)(zn||ke<Ve)&&(Hn[H[ke]]=S[ke]);for(;pn--;)Hn[_t++]=S[ke++];return Hn}function Km(S,T,H,ae){for(var ke=-1,Ve=S.length,dt=-1,_t=H.length,zt=-1,pn=T.length,Hn=uo(Ve-_t,0),zn=nn(Hn+pn),Lo=!ae;++ke<Hn;)zn[ke]=S[ke];for(var hs=ke;++zt<pn;)zn[hs+zt]=T[zt];for(;++dt<_t;)(Lo||ke<Ve)&&(zn[hs+H[dt]]=S[ke++]);return zn}function nu(S,T){var H=-1,ae=S.length;for(T||(T=nn(ae));++H<ae;)T[H]=S[H];return T}function Af(S,T,H,ae){var ke=!H;H||(H={});for(var Ve=-1,dt=T.length;++Ve<dt;){var _t=T[Ve],zt=ae?ae(H[_t],S[_t],_t,H,S):t;zt===t&&(zt=S[_t]),ke?ui(H,_t,zt):$m(H,_t,zt)}return H}function Ym(S,T){return Af(S,rb(S),T)}function ih(S,T){return Af(S,Av(S),T)}function Au(S,T){return function(H,ae){var ke=vr(H)?vf:th,Ve=T?T():{};return ke(H,S,Hs(ae,2),Ve)}}function xd(S){return lr(function(T,H){var ae=-1,ke=H.length,Ve=ke>1?H[ke-1]:t,dt=ke>2?H[2]:t;for(Ve=S.length>3&&typeof Ve=="function"?(ke--,Ve):t,dt&&Xu(H[0],H[1],dt)&&(Ve=ke<3?t:Ve,ke=1),T=gi(T);++ae<ke;){var _t=H[ae];_t&&S(T,_t,ae,Ve)}return T})}function Xm(S,T){return function(H,ae){if(H==null)return H;if(!au(H))return S(H,ae);for(var ke=H.length,Ve=T?ke:-1,dt=gi(H);(T?Ve--:++Ve<ke)&&ae(dt[Ve],Ve,dt)!==!1;);return H}}function ob(S){return function(T,H,ae){for(var ke=-1,Ve=gi(T),dt=ae(T),_t=dt.length;_t--;){var zt=dt[S?_t:++ke];if(H(Ve[zt],zt,Ve)===!1)break}return T}}function _v(S,T,H){var ae=T&z,ke=qg(S);function Ve(){var dt=this&&this!==de&&this instanceof Ve?ke:S;return dt.apply(ae?H:this,arguments)}return Ve}function Cv(S){return function(T){T=ia(T);var H=el(T)?Wl(T):t,ae=H?H[0]:T.charAt(0),ke=H?rh(H,1).join(""):T.slice(1);return ae[S]()+ke}}function ah(S){return function(T){return fr(Jv(Eb(T).replace(pd,"")),S,"")}}function qg(S){return function(){var T=arguments;switch(T.length){case 0:return new S;case 1:return new S(T[0]);case 2:return new S(T[0],T[1]);case 3:return new S(T[0],T[1],T[2]);case 4:return new S(T[0],T[1],T[2],T[3]);case 5:return new S(T[0],T[1],T[2],T[3],T[4]);case 6:return new S(T[0],T[1],T[2],T[3],T[4],T[5]);case 7:return new S(T[0],T[1],T[2],T[3],T[4],T[5],T[6])}var H=Cf(S.prototype),ae=S.apply(H,T);return gl(ae)?ae:H}}function Sv(S,T,H){var ae=qg(S);function ke(){for(var Ve=arguments.length,dt=nn(Ve),_t=Ve,zt=ou(ke);_t--;)dt[_t]=arguments[_t];var pn=Ve<3&&dt[0]!==zt&&dt[Ve-1]!==zt?[]:Nc(dt,zt);if(Ve-=pn.length,Ve<H)return xv(S,T,nr,ke.placeholder,t,dt,pn,t,t,H-Ve);var Hn=this&&this!==de&&this instanceof ke?ae:S;return ni(Hn,this,dt)}return ke}function Jm(S){return function(T,H,ae){var ke=gi(T);if(!au(T)){var Ve=Hs(H,3);T=Jl(T),H=function(_t){return Ve(ke[_t],_t,ke)}}var dt=S(T,H,ae);return dt>-1?ke[Ve?T[dt]:dt]:t}}function kv(S){return Td(function(T){var H=T.length,ae=H,ke=Su.prototype.thru;for(S&&T.reverse();ae--;){var Ve=T[ae];if(typeof Ve!="function")throw new ya(f);if(ke&&!dt&&Od(Ve)=="wrapper")var dt=new Su([],!0)}for(ae=dt?ae:H;++ae<H;){Ve=T[ae];var _t=Od(Ve),zt=_t=="wrapper"?Dd(Ve):t;zt&&fh(zt[0])&&zt[1]==(J|F|oe|we)&&!zt[4].length&&zt[9]==1?dt=dt[Od(zt[0])].apply(dt,zt[3]):dt=Ve.length==1&&fh(Ve)?dt[_t]():dt.thru(Ve)}return function(){var pn=arguments,Hn=pn[0];if(dt&&pn.length==1&&vr(Hn))return dt.plant(Hn).value();for(var zn=0,Lo=H?T[zn].apply(this,pn):Hn;++zn<H;)Lo=T[zn].call(this,Lo);return Lo}})}function nr(S,T,H,ae,ke,Ve,dt,_t,zt,pn){var Hn=T&J,zn=T&z,Lo=T&q,hs=T&(F|ne),Is=T&ye,Hr=Lo?t:qg(S);function $s(){for(var fi=arguments.length,yi=nn(fi),cu=fi;cu--;)yi[cu]=arguments[cu];if(hs)var Ou=ou($s),Mf=Zd(yi,Ou);if(ae&&(yi=Zg(yi,ae,ke,hs)),Ve&&(yi=Km(yi,Ve,dt,hs)),fi-=Mf,hs&&fi<pn){var ka=Nc(yi,Ou);return xv(S,T,nr,$s.placeholder,H,yi,ka,_t,zt,pn-fi)}var lm=zn?H:this,td=Lo?lm[S]:S;return fi=yi.length,_t?yi=Qg(yi,_t):Is&&fi>1&&yi.reverse(),Hn&&zt<fi&&(yi.length=zt),this&&this!==de&&this instanceof $s&&(td=Hr||qg(td)),td.apply(lm,yi)}return $s}function Ao(S,T){return function(H,ae){return Wa(H,S,T(ae),{})}}function lh(S,T){return function(H,ae){var ke;if(H===t&&ae===t)return T;if(H!==t&&(ke=H),ae!==t){if(ke===t)return ae;typeof H=="string"||typeof ae=="string"?(H=Gi(H),ae=Gi(ae)):(H=Sl(H),ae=Sl(ae)),ke=S(H,ae)}return ke}}function q1(S){return Td(function(T){return T=da(T,$a(Hs())),lr(function(H){var ae=this;return S(T,function(ke){return ni(ke,ae,H)})})})}function Gg(S,T){T=T===t?" ":Gi(T);var H=T.length;if(H<2)return H?sh(T,S):T;var ae=sh(T,Se(S/Uf(T)));return el(T)?rh(Wl(ae),0,S).join(""):ae.slice(0,S)}function Tk(S,T,H,ae){var ke=T&z,Ve=qg(S);function dt(){for(var _t=-1,zt=arguments.length,pn=-1,Hn=ae.length,zn=nn(Hn+zt),Lo=this&&this!==de&&this instanceof dt?Ve:S;++pn<Hn;)zn[pn]=ae[pn];for(;zt--;)zn[pn++]=arguments[++_t];return ni(Lo,ke?H:this,zn)}return dt}function Ev(S){return function(T,H,ae){return ae&&typeof ae!="number"&&Xu(T,H,ae)&&(H=ae=t),T=bh(T),H===t?(H=T,T=0):H=bh(H),ae=ae===t?T<H?1:-1:bh(ae),oh(T,H,ae,S)}}function ri(S){return function(T,H){return typeof T=="string"&&typeof H=="string"||(T=ed(T),H=ed(H)),S(T,H)}}function xv(S,T,H,ae,ke,Ve,dt,_t,zt,pn){var Hn=T&F,zn=Hn?dt:t,Lo=Hn?t:dt,hs=Hn?Ve:t,Is=Hn?t:Ve;T|=Hn?oe:re,T&=~(Hn?re:oe),T&ee||(T&=~(z|q));var Hr=[S,T,ke,hs,zn,Is,Lo,_t,zt,pn],$s=H.apply(t,Hr);return fh(S)&&su($s,Hr),$s.placeholder=ae,V_($s,S,T)}function G1(S){var T=ai[S];return function(H,ae){if(H=ed(H),ae=ae==null?0:Sr(jr(ae),292),ae&&wn(H)){var ke=(ia(H)+"e").split("e"),Ve=T(ke[0]+"e"+(+ke[1]+ae));return ke=(ia(Ve)+"e").split("e"),+(ke[0]+"e"+(+ke[1]-ae))}return T(H)}}var g2=$i&&1/Vh(new $i([,-0]))[1]==mt?function(S){return new $i(S)}:oy;function en(S){return function(T){var H=kl(T);return H==Ct?Wu(T):H==Yt?_f(T):Uu(T,S(T))}}function Ad(S,T,H,ae,ke,Ve,dt,_t){var zt=T&q;if(!zt&&typeof S!="function")throw new ya(f);var pn=ae?ae.length:0;if(pn||(T&=~(oe|re),ae=ke=t),dt=dt===t?dt:uo(jr(dt),0),_t=_t===t?_t:jr(_t),pn-=ke?ke.length:0,T&re){var Hn=ae,zn=ke;ae=ke=t}var Lo=zt?t:Dd(S),hs=[S,T,H,ae,ke,Hn,zn,Ve,dt,_t];if(Lo&&_2(hs,Lo),S=hs[0],T=hs[1],H=hs[2],ae=hs[3],ke=hs[4],_t=hs[9]=hs[9]===t?zt?0:S.length:uo(hs[9]-pn,0),!_t&&T&(F|ne)&&(T&=~(F|ne)),!T||T==z)var Is=_v(S,T,H);else T==F||T==ne?Is=Sv(S,T,_t):(T==oe||T==(z|oe))&&!ke.length?Is=Tk(S,T,H,ae):Is=nr.apply(t,hs);var Hr=Lo?eu:su;return V_(Hr(Is,hs),S,T)}function $_(S,T,H,ae){return S===t||Fr(S,tl[H])&&!oi.call(ae,H)?T:S}function sb(S,T,H,ae,ke,Ve){return gl(S)&&gl(T)&&(Ve.set(T,S),Bn(S,T,t,sb,Ve),Ve.delete(T)),S}function Dk(S){return n0(S)?t:S}function Qm(S,T,H,ae,ke,Ve){var dt=H&L,_t=S.length,zt=T.length;if(_t!=zt&&!(dt&&zt>_t))return!1;var pn=Ve.get(S),Hn=Ve.get(T);if(pn&&Hn)return pn==T&&Hn==S;var zn=-1,Lo=!0,hs=H&j?new ro:t;for(Ve.set(S,T),Ve.set(T,S);++zn<_t;){var Is=S[zn],Hr=T[zn];if(ae)var $s=dt?ae(Hr,Is,zn,T,S,Ve):ae(Is,Hr,zn,S,T,Ve);if($s!==t){if($s)continue;Lo=!1;break}if(hs){if(!Vu(T,function(fi,yi){if(!Hi(hs,yi)&&(Is===fi||ke(Is,fi,H,ae,Ve)))return hs.push(yi)})){Lo=!1;break}}else if(!(Is===Hr||ke(Is,Hr,H,ae,Ve))){Lo=!1;break}}return Ve.delete(S),Ve.delete(T),Lo}function p2(S,T,H,ae,ke,Ve,dt){switch(H){case Js:if(S.byteLength!=T.byteLength||S.byteOffset!=T.byteOffset)return!1;S=S.buffer,T=T.buffer;case Ns:return!(S.byteLength!=T.byteLength||!Ve(new jh(S),new jh(T)));case he:case es:case Jt:return Fr(+S,+T);case ao:return S.name==T.name&&S.message==T.message;case yt:case bn:return S==T+"";case Ct:var _t=Wu;case Yt:var zt=ae&L;if(_t||(_t=Vh),S.size!=T.size&&!zt)return!1;var pn=dt.get(S);if(pn)return pn==T;ae|=j,dt.set(S,T);var Hn=Qm(_t(S),_t(T),ae,ke,Ve,dt);return dt.delete(S),Hn;case rs:if(Wf)return Wf.call(S)==Wf.call(T)}return!1}function Jh(S,T,H,ae,ke,Ve){var dt=H&L,_t=eg(S),zt=_t.length,pn=eg(T),Hn=pn.length;if(zt!=Hn&&!dt)return!1;for(var zn=zt;zn--;){var Lo=_t[zn];if(!(dt?Lo in T:oi.call(T,Lo)))return!1}var hs=Ve.get(S),Is=Ve.get(T);if(hs&&Is)return hs==T&&Is==S;var Hr=!0;Ve.set(S,T),Ve.set(T,S);for(var $s=dt;++zn<zt;){Lo=_t[zn];var fi=S[Lo],yi=T[Lo];if(ae)var cu=dt?ae(yi,fi,Lo,T,S,Ve):ae(fi,yi,Lo,S,T,Ve);if(!(cu===t?fi===yi||ke(fi,yi,H,ae,Ve):cu)){Hr=!1;break}$s||($s=Lo=="constructor")}if(Hr&&!$s){var Ou=S.constructor,Mf=T.constructor;Ou!=Mf&&"constructor"in S&&"constructor"in T&&!(typeof Ou=="function"&&Ou instanceof Ou&&typeof Mf=="function"&&Mf instanceof Mf)&&(Hr=!1)}return Ve.delete(S),Ve.delete(T),Hr}function Td(S){return S2(z_(S,t,T2),S+"")}function eg(S){return kr(S,Jl,rb)}function vi(S){return kr(S,rf,Av)}var Dd=Jd?function(S){return Jd.get(S)}:oy;function Od(S){for(var T=S.name+"",H=Qi[T],ae=oi.call(Qi,T)?H.length:0;ae--;){var ke=H[ae],Ve=ke.func;if(Ve==null||Ve==S)return ke.name}return T}function ou(S){var T=oi.call(xe,"placeholder")?xe:S;return T.placeholder}function Hs(){var S=xe.iteratee||ty;return S=S===ty?$:S,arguments.length?S(arguments[0],arguments[1]):S}function Vp(S,T){var H=S.__data__;return Xg(T)?H[typeof T=="string"?"string":"hash"]:H.map}function ch(S){for(var T=Jl(S),H=T.length;H--;){var ae=T[H],ke=S[ae];T[H]=[ae,ke,w2(ke)]}return T}function Kg(S,T){var H=Im(S,T);return Vm(H)?H:t}function Ok(S){var T=oi.call(S,li),H=S[li];try{S[li]=t;var ae=!0}catch{}var ke=Wh.call(S);return ae&&(T?S[li]=H:delete S[li]),ke}var rb=rt?function(S){return S==null?[]:(S=gi(S),sc(rt(S),function(T){return Zh.call(S,T)}))}:Db,Av=rt?function(S){for(var T=[];S;)Hf(T,rb(S)),S=Lm(S);return T}:Db,kl=Ua;(Ta&&kl(new Ta(new ArrayBuffer(1)))!=Js||qh&&kl(new qh)!=Ct||Fm&&kl(Fm.resolve())!=Ut||$i&&kl(new $i)!=Yt||wa&&kl(new wa)!=ds)&&(kl=function(S){var T=Ua(S),H=T==Pe?S.constructor:t,ae=H?tp(H):"";if(ae)switch(ae){case j0:return Js;case vv:return Ct;case Jr:return Ut;case wd:return Yt;case pr:return ds}return T});function o3(S,T,H){for(var ae=-1,ke=H.length;++ae<ke;){var Ve=H[ae],dt=Ve.size;switch(Ve.type){case"drop":S+=dt;break;case"dropRight":T-=dt;break;case"take":T=Sr(T,S+dt);break;case"takeRight":S=uo(S,T-dt);break}}return{start:S,end:T}}function Yg(S){var T=S.match(Ir);return T?T[1].split(Vs):[]}function El(S,T,H){T=Yh(T,S);for(var ae=-1,ke=T.length,Ve=!1;++ae<ke;){var dt=Ju(T[ae]);if(!(Ve=S!=null&&H(S,dt)))break;S=S[dt]}return Ve||++ae!=ke?Ve:(ke=S==null?0:S.length,!!ke&&Jp(ke)&&Qh(dt,ke)&&(vr(S)||om(S)))}function b2(S){var T=S.length,H=new S.constructor(T);return T&&typeof S[0]=="string"&&oi.call(S,"index")&&(H.index=S.index,H.input=S.input),H}function oo(S){return typeof S.constructor=="function"&&!Jg(S)?Cf(Lm(S)):{}}function v2(S,T,H){var ae=S.constructor;switch(T){case Ns:return Gm(S);case he:case es:return new ae(+S);case Js:return Xh(S,H);case Zs:case ba:case ar:case Ps:case Zr:case No:case Mo:case Mr:case Ls:return Z1(S,H);case Ct:return new ae;case Jt:case bn:return new ae(S);case yt:return Yu(S);case Yt:return new ae;case rs:return nb(S)}}function Mk(S,T){var H=T.length;if(!H)return S;var ae=H-1;return T[ae]=(H>1?"& ":"")+T[ae],T=T.join(H>2?", ":" "),S.replace(_r,`{
/* [wrapped with `+T+`] */
`)}function y2(S){return vr(S)||om(S)||!!(yd&&S&&S[yd])}function Qh(S,T){var H=typeof S;return T=T==null?nt:T,!!T&&(H=="number"||H!="symbol"&&Bo.test(S))&&S>-1&&S%1==0&&S<T}function Xu(S,T,H){if(!gl(H))return!1;var ae=typeof T;return(ae=="number"?au(H)&&Qh(T,H.length):ae=="string"&&T in H)?Fr(H[T],S):!1}function uh(S,T){if(vr(S))return!1;var H=typeof S;return H=="number"||H=="symbol"||H=="boolean"||S==null||nl(S)?!0:lo.test(S)||!Wn.test(S)||T!=null&&S in gi(T)}function Xg(S){var T=typeof S;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?S!=="__proto__":S===null}function fh(S){var T=Od(S),H=xe[T];if(typeof H!="function"||!(T in ci.prototype))return!1;if(S===H)return!0;var ae=Dd(H);return!!ae&&S===ae[0]}function ib(S){return!!ic&&ic in S}var Tf=Aa?sm:im;function Jg(S){var T=S&&S.constructor,H=typeof T=="function"&&T.prototype||tl;return S===H}function w2(S){return S===S&&!gl(S)}function Up(S,T){return function(H){return H==null?!1:H[S]===T&&(T!==t||S in gi(H))}}function Kf(S){var T=wb(S,function(ae){return H.size===y&&H.clear(),ae}),H=T.cache;return T}function _2(S,T){var H=S[1],ae=T[1],ke=H|ae,Ve=ke<(z|q|J),dt=ae==J&&H==F||ae==J&&H==we&&S[7].length<=T[8]||ae==(J|we)&&T[7].length<=T[8]&&H==F;if(!(Ve||dt))return S;ae&z&&(S[2]=T[2],ke|=H&z?0:ee);var _t=T[3];if(_t){var zt=S[3];S[3]=zt?Zg(zt,_t,T[4]):_t,S[4]=zt?Nc(S[3],C):T[4]}return _t=T[5],_t&&(zt=S[5],S[5]=zt?Km(zt,_t,T[6]):_t,S[6]=zt?Nc(S[5],C):T[6]),_t=T[7],_t&&(S[7]=_t),ae&J&&(S[8]=S[8]==null?T[8]:Sr(S[8],T[8])),S[9]==null&&(S[9]=T[9]),S[0]=T[0],S[1]=ke,S}function dh(S){var T=[];if(S!=null)for(var H in gi(S))T.push(H);return T}function Tv(S){return Wh.call(S)}function z_(S,T,H){return T=uo(T===t?S.length-1:T,0),function(){for(var ae=arguments,ke=-1,Ve=uo(ae.length-T,0),dt=nn(Ve);++ke<Ve;)dt[ke]=ae[T+ke];ke=-1;for(var _t=nn(T+1);++ke<T;)_t[ke]=ae[ke];return _t[T]=H(dt),ni(S,this,_t)}}function C2(S,T){return T.length<2?S:Ll(S,Os(T,0,-1))}function Qg(S,T){for(var H=S.length,ae=Sr(T.length,H),ke=nu(S);ae--;){var Ve=T[ae];S[ae]=Qh(Ve,H)?ke[Ve]:t}return S}function Df(S,T){if(!(T==="constructor"&&typeof S[T]=="function")&&T!="__proto__")return S[T]}var su=ab(eu),ep=le||function(S,T){return de.setTimeout(S,T)},S2=ab(zp);function V_(S,T,H){var ae=T+"";return S2(S,Mk(ae,em(Yg(ae),H)))}function ab(S){var T=0,H=0;return function(){var ae=Zl(),ke=tt-(ae-H);if(H=ae,ke>0){if(++T>=be)return arguments[0]}else T=0;return S.apply(t,arguments)}}function Lc(S,T){var H=-1,ae=S.length,ke=ae-1;for(T=T===t?ae:T;++H<T;){var Ve=Ef(H,ke),dt=S[Ve];S[Ve]=S[H],S[H]=dt}return S.length=T,S}var lb=Kf(function(S){var T=[];return S.charCodeAt(0)===46&&T.push(""),S.replace(go,function(H,ae,ke,Ve){T.push(ke?Ve.replace(Ba,"$1"):ae||H)}),T});function Ju(S){if(typeof S=="string"||nl(S))return S;var T=S+"";return T=="0"&&1/S==-mt?"-0":T}function tp(S){if(S!=null){try{return ju.call(S)}catch{}try{return S+""}catch{}}return""}function em(S,T){return Ss(kt,function(H){var ae="_."+H[0];T&H[1]&&!Oi(S,ae)&&S.push(ae)}),S.sort()}function Dv(S){if(S instanceof ci)return S.clone();var T=new Su(S.__wrapped__,S.__chain__);return T.__actions__=nu(S.__actions__),T.__index__=S.__index__,T.__values__=S.__values__,T}function U_(S,T,H){(H?Xu(S,T,H):T===t)?T=1:T=uo(jr(T),0);var ae=S==null?0:S.length;if(!ae||T<1)return[];for(var ke=0,Ve=0,dt=nn(Se(ae/T));ke<ae;)dt[Ve++]=Os(S,ke,ke+=T);return dt}function Wp(S){for(var T=-1,H=S==null?0:S.length,ae=0,ke=[];++T<H;){var Ve=S[T];Ve&&(ke[ae++]=Ve)}return ke}function k2(){var S=arguments.length;if(!S)return[];for(var T=nn(S-1),H=arguments[0],ae=S;ae--;)T[ae-1]=arguments[ae];return Hf(vr(H)?nu(H):[H],Va(T,1))}var np=lr(function(S,T){return xl(S)?za(S,Va(T,1,xl,!0)):[]}),cb=lr(function(S,T){var H=hh(T);return xl(H)&&(H=t),xl(S)?za(S,Va(T,1,xl,!0),Hs(H,2)):[]}),K1=lr(function(S,T){var H=hh(T);return xl(H)&&(H=t),xl(S)?za(S,Va(T,1,xl,!0),t,H):[]});function E2(S,T,H){var ae=S==null?0:S.length;return ae?(T=H||T===t?1:jr(T),Os(S,T<0?0:T,ae)):[]}function x2(S,T,H){var ae=S==null?0:S.length;return ae?(T=H||T===t?1:jr(T),T=ae-T,Os(S,0,T<0?0:T)):[]}function W_(S,T){return S&&S.length?Gh(S,Hs(T,3),!0,!0):[]}function Rk(S,T){return S&&S.length?Gh(S,Hs(T,3),!0):[]}function Lr(S,T,H,ae){var ke=S==null?0:S.length;return ke?(H&&typeof H!="number"&&Xu(S,T,H)&&(H=0,ae=ke),J0(S,T,H,ae)):[]}function Ov(S,T,H){var ae=S==null?0:S.length;if(!ae)return-1;var ke=H==null?0:jr(H);return ke<0&&(ke=uo(ae+ke,0)),Ji(S,Hs(T,3),ke)}function A2(S,T,H){var ae=S==null?0:S.length;if(!ae)return-1;var ke=ae-1;return H!==t&&(ke=jr(H),ke=H<0?uo(ae+ke,0):Sr(ke,ae-1)),Ji(S,Hs(T,3),ke,!0)}function T2(S){var T=S==null?0:S.length;return T?Va(S,1):[]}function ub(S){var T=S==null?0:S.length;return T?Va(S,mt):[]}function Nk(S,T){var H=S==null?0:S.length;return H?(T=T===t?1:jr(T),Va(S,T)):[]}function tm(S){for(var T=-1,H=S==null?0:S.length,ae={};++T<H;){var ke=S[T];ae[ke[0]]=ke[1]}return ae}function qa(S){return S&&S.length?S[0]:t}function fb(S,T,H){var ae=S==null?0:S.length;if(!ae)return-1;var ke=H==null?0:jr(H);return ke<0&&(ke=uo(ae+ke,0)),Ha(S,T,ke)}function Y1(S){var T=S==null?0:S.length;return T?Os(S,0,-1):[]}var j_=lr(function(S){var T=da(S,jg);return T.length&&T[0]===S[0]?W1(T):[]}),db=lr(function(S){var T=hh(S),H=da(S,jg);return T===hh(H)?T=t:H.pop(),H.length&&H[0]===S[0]?W1(H,Hs(T,2)):[]}),D2=lr(function(S){var T=hh(S),H=da(S,jg);return T=typeof T=="function"?T:t,T&&H.pop(),H.length&&H[0]===S[0]?W1(H,t,T):[]});function Ra(S,T){return S==null?"":Go.call(S,T)}function hh(S){var T=S==null?0:S.length;return T?S[T-1]:t}function ma(S,T,H){var ae=S==null?0:S.length;if(!ae)return-1;var ke=ae;return H!==t&&(ke=jr(H),ke=ke<0?uo(ae+ke,0):Sr(ke,ae-1)),T===T?Bm(S,T,ke):Ji(S,xi,ke,!0)}function Qu(S,T){return S&&S.length?Jo(S,jr(T)):t}var tg=lr(Fc);function Fc(S,T){return S&&S.length&&T&&T.length?Qc(S,T):S}function Pk(S,T,H){return S&&S.length&&T&&T.length?Qc(S,T,Hs(H,2)):S}function O2(S,T,H){return S&&S.length&&T&&T.length?Qc(S,T,t,H):S}var Yf=Td(function(S,T){var H=S==null?0:S.length,ae=zi(S,T);return Ku(S,da(T,function(ke){return Qh(ke,H)?+ke:ke}).sort(H_)),ae});function Na(S,T){var H=[];if(!(S&&S.length))return H;var ae=-1,ke=[],Ve=S.length;for(T=Hs(T,3);++ae<Ve;){var dt=S[ae];T(dt,ae,S)&&(H.push(dt),ke.push(ae))}return Ku(S,ke),H}function Sa(S){return S==null?S:Cu.call(S)}function Ik(S,T,H){var ae=S==null?0:S.length;return ae?(H&&typeof H!="number"&&Xu(S,T,H)?(T=0,H=ae):(T=T==null?0:jr(T),H=H===t?ae:jr(H)),Os(S,T,H)):[]}function mh(S,T){return Da(S,T)}function hb(S,T,H){return cc(S,T,Hs(H,2))}function Mv(S,T){var H=S==null?0:S.length;if(H){var ae=Da(S,T);if(ae<H&&Fr(S[ae],T))return ae}return-1}function Xf(S,T){return Da(S,T,!0)}function ef(S,T,H){return cc(S,T,Hs(H,2),!0)}function jp(S,T){var H=S==null?0:S.length;if(H){var ae=Da(S,T,!0)-1;if(Fr(S[ae],T))return ae}return-1}function X1(S){return S&&S.length?j1(S):[]}function mb(S,T){return S&&S.length?j1(S,Hs(T,2)):[]}function gb(S){var T=S==null?0:S.length;return T?Os(S,1,T):[]}function Z_(S,T,H){return S&&S.length?(T=H||T===t?1:jr(T),Os(S,0,T<0?0:T)):[]}function M2(S,T,H){var ae=S==null?0:S.length;return ae?(T=H||T===t?1:jr(T),T=ae-T,Os(S,T<0?0:T,ae)):[]}function Bk(S,T){return S&&S.length?Gh(S,Hs(T,3),!1,!0):[]}function q_(S,T){return S&&S.length?Gh(S,Hs(T,3)):[]}var G_=lr(function(S){return tu(Va(S,1,xl,!0))}),R2=lr(function(S){var T=hh(S);return xl(T)&&(T=t),tu(Va(S,1,xl,!0),Hs(T,2))}),K_=lr(function(S){var T=hh(S);return T=typeof T=="function"?T:t,tu(Va(S,1,xl,!0),t,T)});function s3(S){return S&&S.length?tu(S):[]}function Rv(S,T){return S&&S.length?tu(S,Hs(T,2)):[]}function Y_(S,T){return T=typeof T=="function"?T:t,S&&S.length?tu(S,t,T):[]}function Ri(S){if(!(S&&S.length))return[];var T=0;return S=sc(S,function(H){if(xl(H))return T=uo(H.length,T),!0}),Tr(T,function(H){return da(S,Qa(H))})}function Nv(S,T){if(!(S&&S.length))return[];var H=Ri(S);return T==null?H:da(H,function(ae){return ni(T,t,ae)})}var N2=lr(function(S,T){return xl(S)?za(S,T):[]}),X_=lr(function(S){return Kh(sc(S,xl))}),ng=lr(function(S){var T=hh(S);return xl(T)&&(T=t),Kh(sc(S,xl),Hs(T,2))}),uc=lr(function(S){var T=hh(S);return T=typeof T=="function"?T:t,Kh(sc(S,xl),t,T)}),ru=lr(Ri);function J_(S,T){return Zm(S||[],T||[],$m)}function P2(S,T){return Zm(S||[],T||[],ea)}var op=lr(function(S){var T=S.length,H=T>1?S[T-1]:t;return H=typeof H=="function"?(S.pop(),H):t,Nv(S,H)});function sp(S){var T=xe(S);return T.__chain__=!0,T}function Zp(S,T){return T(S),S}function qp(S,T){return T(S)}var og=Td(function(S){var T=S.length,H=T?S[0]:0,ae=this.__wrapped__,ke=function(Ve){return zi(Ve,S)};return T>1||this.__actions__.length||!(ae instanceof ci)||!Qh(H)?this.thru(ke):(ae=ae.slice(H,+H+(T?1:0)),ae.__actions__.push({func:qp,args:[ke],thisArg:t}),new Su(ae,this.__chain__).thru(function(Ve){return T&&!Ve.length&&Ve.push(t),Ve}))});function Pv(){return sp(this)}function ta(){return new Su(this.value(),this.__chain__)}function tf(){this.__values__===t&&(this.__values__=J2(this.value()));var S=this.__index__>=this.__values__.length,T=S?t:this.__values__[this.__index__++];return{done:S,value:T}}function J1(){return this}function Lk(S){for(var T,H=this;H instanceof $g;){var ae=Dv(H);ae.__index__=0,ae.__values__=t,T?ke.__wrapped__=ae:T=ae;var ke=ae;H=H.__wrapped__}return ke.__wrapped__=S,T}function I2(){var S=this.__wrapped__;if(S instanceof ci){var T=S;return this.__actions__.length&&(T=new ci(this)),T=T.reverse(),T.__actions__.push({func:qp,args:[Sa],thisArg:t}),new Su(T,this.__chain__)}return this.thru(Sa)}function Fk(){return Wg(this.__wrapped__,this.__actions__)}var Gp=Au(function(S,T,H){oi.call(S,H)?++S[H]:ui(S,H,1)});function Q1(S,T,H){var ae=vr(S)?Ei:Qt;return H&&Xu(S,T,H)&&(T=t),ae(S,Hs(T,3))}function Jf(S,T){var H=vr(S)?sc:Ca;return H(S,Hs(T,3))}var B2=Jm(Ov),Q_=Jm(A2);function eC(S,T){return Va(Yp(S,T),1)}function Hk(S,T){return Va(Yp(S,T),mt)}function tC(S,T,H){return H=H===t?1:jr(H),Va(Yp(S,T),H)}function pb(S,T){var H=vr(S)?Ss:_a;return H(S,Hs(T,3))}function bb(S,T){var H=vr(S)?Kc:Hp;return H(S,Hs(T,3))}var nC=Au(function(S,T,H){oi.call(S,H)?S[H].push(T):ui(S,H,[T])});function L2(S,T,H,ae){S=au(S)?S:a0(S),H=H&&!ae?jr(H):0;var ke=S.length;return H<0&&(H=uo(ke+H,0)),Of(S)?H<=ke&&S.indexOf(T,H)>-1:!!ke&&Ha(S,T,H)>-1}var Kp=lr(function(S,T,H){var ae=-1,ke=typeof T=="function",Ve=au(S)?nn(S.length):[];return _a(S,function(dt){Ve[++ae]=ke?ni(T,dt,H):ac(dt,T,H)}),Ve}),oC=Au(function(S,T,H){ui(S,H,T)});function Yp(S,T){var H=vr(S)?da:at;return H(S,Hs(T,3))}function sg(S,T,H,ae){return S==null?[]:(vr(T)||(T=T==null?[]:[T]),H=ae?t:H,vr(H)||(H=H==null?[]:[H]),bi(S,T,H))}var Iv=Au(function(S,T,H){S[H?0:1].push(T)},function(){return[[],[]]});function nf(S,T,H){var ae=vr(S)?fr:zf,ke=arguments.length<3;return ae(S,Hs(T,4),H,ke,_a)}function e0(S,T,H){var ae=vr(S)?zu:zf,ke=arguments.length<3;return ae(S,Hs(T,4),H,ke,Hp)}function Gs(S,T){var H=vr(S)?sc:Ca;return H(S,ph(Hs(T,3)))}function iu(S){var T=vr(S)?Eu:Um;return T(S)}function rg(S,T,H){(H?Xu(S,T,H):T===t)?T=1:T=jr(T);var ae=vr(S)?Fp:Wm;return ae(S,T)}function F2(S){var T=vr(S)?V1:jm;return T(S)}function Vi(S){if(S==null)return 0;if(au(S))return Of(S)?Uf(S):S.length;var T=kl(S);return T==Ct||T==Yt?S.size:G(S).length}function H2(S,T,H){var ae=vr(S)?Vu:Br;return H&&Xu(S,T,H)&&(T=t),ae(S,Hs(T,3))}var ig=lr(function(S,T){if(S==null)return[];var H=T.length;return H>1&&Xu(S,T[0],T[1])?T=[]:H>2&&Xu(T[0],T[1],T[2])&&(T=[T[0]]),bi(S,Va(T,1),[])}),ga=X||function(){return de.Date.now()};function nm(S,T){if(typeof T!="function")throw new ya(f);return S=jr(S),function(){if(--S<1)return T.apply(this,arguments)}}function Vt(S,T,H){return T=H?t:T,T=S&&T==null?S.length:T,Ad(S,J,t,t,t,t,T)}function vb(S,T){var H;if(typeof T!="function")throw new ya(f);return S=jr(S),function(){return--S>0&&(H=T.apply(this,arguments)),S<=1&&(T=t),H}}var $2=lr(function(S,T,H){var ae=z;if(H.length){var ke=Nc(H,ou($2));ae|=oe}return Ad(S,ae,T,H,ke)}),yb=lr(function(S,T,H){var ae=z|q;if(H.length){var ke=Nc(H,ou(yb));ae|=oe}return Ad(T,ae,S,H,ke)});function gh(S,T,H){T=H?t:T;var ae=Ad(S,F,t,t,t,t,t,T);return ae.placeholder=gh.placeholder,ae}function of(S,T,H){T=H?t:T;var ae=Ad(S,ne,t,t,t,t,t,T);return ae.placeholder=of.placeholder,ae}function t0(S,T,H){var ae,ke,Ve,dt,_t,zt,pn=0,Hn=!1,zn=!1,Lo=!0;if(typeof S!="function")throw new ya(f);T=ed(T)||0,gl(H)&&(Hn=!!H.leading,zn="maxWait"in H,Ve=zn?uo(ed(H.maxWait)||0,T):Ve,Lo="trailing"in H?!!H.trailing:Lo);function hs(ka){var lm=ae,td=ke;return ae=ke=t,pn=ka,dt=S.apply(td,lm),dt}function Is(ka){return pn=ka,_t=ep(fi,T),Hn?hs(ka):dt}function Hr(ka){var lm=ka-zt,td=ka-pn,dw=T-lm;return zn?Sr(dw,Ve-td):dw}function $s(ka){var lm=ka-zt,td=ka-pn;return zt===t||lm>=T||lm<0||zn&&td>=Ve}function fi(){var ka=ga();if($s(ka))return yi(ka);_t=ep(fi,Hr(ka))}function yi(ka){return _t=t,Lo&&ae?hs(ka):(ae=ke=t,dt)}function cu(){_t!==t&&Ed(_t),pn=0,ae=zt=ke=_t=t}function Ou(){return _t===t?dt:yi(ga())}function Mf(){var ka=ga(),lm=$s(ka);if(ae=arguments,ke=this,zt=ka,lm){if(_t===t)return Is(zt);if(zn)return Ed(_t),_t=ep(fi,T),hs(zt)}return _t===t&&(_t=ep(fi,T)),dt}return Mf.cancel=cu,Mf.flush=Ou,Mf}var Bv=lr(function(S,T){return Gu(S,1,T)}),z2=lr(function(S,T,H){return Gu(S,ed(T)||0,H)});function Lv(S){return Ad(S,ye)}function wb(S,T){if(typeof S!="function"||T!=null&&typeof T!="function")throw new ya(f);var H=function(){var ae=arguments,ke=T?T.apply(this,ae):ae[0],Ve=H.cache;if(Ve.has(ke))return Ve.get(ke);var dt=S.apply(this,ae);return H.cache=Ve.set(ke,dt)||Ve,dt};return H.cache=new(wb.Cache||Zf),H}wb.Cache=Zf;function ph(S){if(typeof S!="function")throw new ya(f);return function(){var T=arguments;switch(T.length){case 0:return!S.call(this);case 1:return!S.call(this,T[0]);case 2:return!S.call(this,T[0],T[1]);case 3:return!S.call(this,T[0],T[1],T[2])}return!S.apply(this,T)}}function Qf(S){return vb(2,S)}var Tu=Oa(function(S,T){T=T.length==1&&vr(T[0])?da(T[0],$a(Hs())):da(Va(T,1),$a(Hs()));var H=T.length;return lr(function(ae){for(var ke=-1,Ve=Sr(ae.length,H);++ke<Ve;)ae[ke]=T[ke].call(this,ae[ke]);return ni(S,this,ae)})}),Fl=lr(function(S,T){var H=Nc(T,ou(Fl));return Ad(S,oe,t,T,H)}),V2=lr(function(S,T){var H=Nc(T,ou(V2));return Ad(S,re,t,T,H)}),rp=Td(function(S,T){return Ad(S,we,t,t,t,T)});function sC(S,T){if(typeof S!="function")throw new ya(f);return T=T===t?T:jr(T),lr(S,T)}function _b(S,T){if(typeof S!="function")throw new ya(f);return T=T==null?0:uo(jr(T),0),lr(function(H){var ae=H[T],ke=rh(H,0,T);return ae&&Hf(ke,ae),ni(S,this,ke)})}function Xp(S,T,H){var ae=!0,ke=!0;if(typeof S!="function")throw new ya(f);return gl(H)&&(ae="leading"in H?!!H.leading:ae,ke="trailing"in H?!!H.trailing:ke),t0(S,T,{leading:ae,maxWait:T,trailing:ke})}function U2(S){return Vt(S,1)}function Fv(S,T){return Fl(tb(T),S)}function rC(){if(!arguments.length)return[];var S=arguments[0];return vr(S)?S:[S]}function Hv(S){return xs(S,N)}function W2(S,T){return T=typeof T=="function"?T:t,xs(S,N,T)}function ml(S){return xs(S,A|N)}function Kl(S,T){return T=typeof T=="function"?T:t,xs(S,A|N,T)}function Du(S,T){return T==null||Cl(S,T,Jl(T))}function Fr(S,T){return S===T||S!==S&&T!==T}var Yl=ri(nh),Hl=ri(function(S,T){return S>=T}),om=St(function(){return arguments}())?St:function(S){return Al(S)&&oi.call(S,"callee")&&!Zh.call(S,"callee")},vr=nn.isArray,iC=no?$a(no):_c;function au(S){return S!=null&&Jp(S.length)&&!sm(S)}function xl(S){return Al(S)&&au(S)}function j2(S){return S===!0||S===!1||Al(S)&&Ua(S)==he}var ag=On||im,fc=mi?$a(mi):Xc;function r3(S){return Al(S)&&S.nodeType===1&&!n0(S)}function lg(S){if(S==null)return!0;if(au(S)&&(vr(S)||typeof S=="string"||typeof S.splice=="function"||ag(S)||Md(S)||om(S)))return!S.length;var T=kl(S);if(T==Ct||T==Yt)return!S.size;if(Jg(S))return!G(S).length;for(var H in S)if(oi.call(S,H))return!1;return!0}function $k(S,T){return lc(S,T)}function zk(S,T,H){H=typeof H=="function"?H:t;var ae=H?H(S,T):t;return ae===t?lc(S,T,t,H):!!ae}function Z2(S){if(!Al(S))return!1;var T=Ua(S);return T==ao||T==ho||typeof S.message=="string"&&typeof S.name=="string"&&!n0(S)}function q2(S){return typeof S=="number"&&wn(S)}function sm(S){if(!gl(S))return!1;var T=Ua(S);return T==xo||T==Yo||T==xt||T==gn}function G2(S){return typeof S=="number"&&S==jr(S)}function Jp(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=nt}function gl(S){var T=typeof S;return S!=null&&(T=="object"||T=="function")}function Al(S){return S!=null&&typeof S=="object"}var An=hn?$a(hn):ja;function Vk(S,T){return S===T||Za(S,T,ch(T))}function Xl(S,T,H){return H=typeof H=="function"?H:t,Za(S,T,ch(T),H)}function Uk(S){return Y2(S)&&S!=+S}function K2(S){if(Tf(S))throw new er(u);return Vm(S)}function to(S){return S===null}function Cc(S){return S==null}function Y2(S){return typeof S=="number"||Al(S)&&Ua(S)==Jt}function n0(S){if(!Al(S)||Ua(S)!=Pe)return!1;var T=Lm(S);if(T===null)return!0;var H=oi.call(T,"constructor")&&T.constructor;return typeof H=="function"&&H instanceof H&&ju.call(H)==F1}var sf=qr?$a(qr):Jc;function $v(S){return G2(S)&&S>=-nt&&S<=nt}var Qp=Nl?$a(Nl):eb;function Of(S){return typeof S=="string"||!vr(S)&&Al(S)&&Ua(S)==bn}function nl(S){return typeof S=="symbol"||Al(S)&&Ua(S)==rs}var Md=Xi?$a(Xi):Ho;function Rd(S){return S===t}function Hc(S){return Al(S)&&kl(S)==ds}function o0(S){return Al(S)&&Ua(S)==Or}var X2=ri(Te),aC=ri(function(S,T){return S<=T});function J2(S){if(!S)return[];if(au(S))return Of(S)?Wl(S):nu(S);if(si&&S[si])return $h(S[si]());var T=kl(S),H=T==Ct?Wu:T==Yt?Vh:a0;return H(S)}function bh(S){if(!S)return S===0?S:0;if(S=ed(S),S===mt||S===-mt){var T=S<0?-1:1;return T*Ot}return S===S?S:0}function jr(S){var T=bh(S),H=T%1;return T===T?H?T-H:T:0}function zv(S){return S?ha(jr(S),0,He):0}function ed(S){if(typeof S=="number")return S;if(nl(S))return Tt;if(gl(S)){var T=typeof S.valueOf=="function"?S.valueOf():S;S=gl(T)?T+"":T}if(typeof S!="string")return S===0?S:+S;S=Pl(S);var H=It.test(S);return H||co.test(S)?Kn(S.slice(2),H?2:8):qe.test(S)?Tt:+S}function lC(S){return Af(S,rf(S))}function cC(S){return S?ha(jr(S),-nt,nt):S===0?S:0}function ia(S){return S==null?"":Gi(S)}var Wk=xd(function(S,T){if(Jg(T)||au(T)){Af(T,Jl(T),S);return}for(var H in T)oi.call(T,H)&&$m(S,H,T[H])}),Vv=xd(function(S,T){Af(T,rf(T),S)}),Uv=xd(function(S,T,H,ae){Af(T,rf(T),S,ae)}),uC=xd(function(S,T,H,ae){Af(T,Jl(T),S,ae)}),jk=Td(zi);function s0(S,T){var H=Cf(S);return T==null?H:qu(H,T)}var fC=lr(function(S,T){S=gi(S);var H=-1,ae=T.length,ke=ae>2?T[2]:t;for(ke&&Xu(T[0],T[1],ke)&&(ae=1);++H<ae;)for(var Ve=T[H],dt=rf(Ve),_t=-1,zt=dt.length;++_t<zt;){var pn=dt[_t],Hn=S[pn];(Hn===t||Fr(Hn,tl[pn])&&!oi.call(S,pn))&&(S[pn]=Ve[pn])}return S}),Zk=lr(function(S){return S.push(t,sb),ni(gC,t,S)});function dC(S,T){return Xr(S,Hs(T,3),qf)}function qk(S,T){return Xr(S,Hs(T,3),Gf)}function hC(S,T){return S==null?S:Ug(S,Hs(T,3),rf)}function Wv(S,T){return S==null?S:Ic(S,Hs(T,3),rf)}function ip(S,T){return S&&qf(S,Hs(T,3))}function r0(S,T){return S&&Gf(S,Hs(T,3))}function Ui(S){return S==null?[]:$p(S,Jl(S))}function Q2(S){return S==null?[]:$p(S,rf(S))}function Sc(S,T,H){var ae=S==null?t:Ll(S,T);return ae===t?H:ae}function i0(S,T){return S!=null&&El(S,T,Gl)}function ol(S,T){return S!=null&&El(S,T,Q0)}var mC=Ao(function(S,T,H){T!=null&&typeof T.toString!="function"&&(T=Wh.call(T)),S[T]=H},Qv(af)),rm=Ao(function(S,T,H){T!=null&&typeof T.toString!="function"&&(T=Wh.call(T)),oi.call(S,T)?S[T].push(H):S[T]=[H]},Hs),Gk=lr(ac);function Jl(S){return au(S)?hl(S):G(S)}function rf(S){return au(S)?hl(S,!0):ve(S)}function Cb(S,T){var H={};return T=Hs(T,3),qf(S,function(ae,ke,Ve){ui(H,T(ae,ke,Ve),ae)}),H}function Kk(S,T){var H={};return T=Hs(T,3),qf(S,function(ae,ke,Ve){ui(H,ke,T(ae,ke,Ve))}),H}var Yk=xd(function(S,T,H){Bn(S,T,H)}),gC=xd(function(S,T,H,ae){Bn(S,T,H,ae)}),Sb=Td(function(S,T){var H={};if(S==null)return H;var ae=!1;T=da(T,function(Ve){return Ve=Yh(Ve,S),ae||(ae=Ve.length>1),Ve}),Af(S,vi(S),H),ae&&(H=xs(H,A|O|N,Dk));for(var ke=T.length;ke--;)xf(H,T[ke]);return H});function pC(S,T){return ap(S,ph(Hs(T)))}var bC=Td(function(S,T){return S==null?{}:tr(S,T)});function ap(S,T){if(S==null)return{};var H=da(vi(S),function(ae){return[ae]});return T=Hs(T),br(S,H,function(ae,ke){return T(ae,ke[0])})}function Xk(S,T,H){T=Yh(T,S);var ae=-1,ke=T.length;for(ke||(ke=1,S=t);++ae<ke;){var Ve=S==null?t:S[Ju(T[ae])];Ve===t&&(ae=ke,Ve=H),S=sm(Ve)?Ve.call(S):Ve}return S}function Jk(S,T,H){return S==null?S:ea(S,T,H)}function Qk(S,T,H,ae){return ae=typeof ae=="function"?ae:t,S==null?S:ea(S,T,H,ae)}var ew=en(Jl),jv=en(rf);function cg(S,T,H){var ae=vr(S),ke=ae||ag(S)||Md(S);if(T=Hs(T,4),H==null){var Ve=S&&S.constructor;ke?H=ae?new Ve:[]:gl(S)?H=sm(Ve)?Cf(Lm(S)):{}:H={}}return(ke?Ss:qf)(S,function(dt,_t,zt){return T(H,dt,_t,zt)}),H}function vC(S,T){return S==null?!0:xf(S,T)}function yC(S,T,H){return S==null?S:F_(S,T,tb(H))}function Zv(S,T,H,ae){return ae=typeof ae=="function"?ae:t,S==null?S:F_(S,T,tb(H),ae)}function a0(S){return S==null?[]:qi(S,Jl(S))}function ug(S){return S==null?[]:qi(S,rf(S))}function qv(S,T,H){return H===t&&(H=T,T=t),H!==t&&(H=ed(H),H=H===H?H:0),T!==t&&(T=ed(T),T=T===T?T:0),ha(ed(S),T,H)}function Gv(S,T,H){return T=bh(T),H===t?(H=T,T=0):H=bh(H),S=ed(S),zm(S,T,H)}function kb(S,T,H){if(H&&typeof H!="boolean"&&Xu(S,T,H)&&(T=H=t),H===t&&(typeof T=="boolean"?(H=T,T=t):typeof S=="boolean"&&(H=S,S=t)),S===t&&T===t?(S=0,T=1):(S=bh(S),T===t?(T=S,S=0):T=bh(T)),S>T){var ae=S;S=T,T=ae}if(H||S%1||T%1){var ke=Mi();return Sr(S+ke*(T-S+bd("1e-"+((ke+"").length-1))),T)}return Ef(S,T)}var wC=ah(function(S,T,H){return T=T.toLowerCase(),S+(H?vh(T):T)});function vh(S){return l0(ia(S).toLowerCase())}function Eb(S){return S=ia(S),S&&S.replace(qo,Pg).replace(Ae,"")}function _C(S,T,H){S=ia(S),T=Gi(T);var ae=S.length;H=H===t?ae:ha(jr(H),0,ae);var ke=H;return H-=T.length,H>=0&&S.slice(H,ke)==T}function yh(S){return S=ia(S),S&&$e.test(S)?S.replace(ps,Pm):S}function lp(S){return S=ia(S),S&&ts.test(S)?S.replace(cn,"\\$&"):S}var tw=ah(function(S,T,H){return S+(H?"-":"")+T.toLowerCase()}),CC=ah(function(S,T,H){return S+(H?" ":"")+T.toLowerCase()}),Kv=Cv("toLowerCase");function eE(S,T,H){S=ia(S),T=jr(T);var ae=T?Uf(S):0;if(!T||ae>=T)return S;var ke=(T-ae)/2;return Gg(Ye(ke),H)+S+Gg(Se(ke),H)}function SC(S,T,H){S=ia(S),T=jr(T);var ae=T?Uf(S):0;return T&&ae<T?S+Gg(T-ae,H):S}function tE(S,T,H){S=ia(S),T=jr(T);var ae=T?Uf(S):0;return T&&ae<T?Gg(T-ae,H)+S:S}function nE(S,T,H){return H||T==null?T=0:T&&(T=+T),ra(ia(S).replace(wo,""),T||0)}function kC(S,T,H){return(H?Xu(S,T,H):T===t)?T=1:T=jr(T),sh(ia(S),T)}function EC(){var S=arguments,T=ia(S[0]);return S.length<3?T:T.replace(S[1],S[2])}var xC=ah(function(S,T,H){return S+(H?"_":"")+T.toLowerCase()});function oE(S,T,H){return H&&typeof H!="number"&&Xu(S,T,H)&&(T=H=t),H=H===t?He:H>>>0,H?(S=ia(S),S&&(typeof T=="string"||T!=null&&!sf(T))&&(T=Gi(T),!T&&el(S))?rh(Wl(S),0,H):S.split(T,H)):[]}var sE=ah(function(S,T,H){return S+(H?" ":"")+l0(T)});function rE(S,T,H){return S=ia(S),H=H==null?0:ha(jr(H),0,S.length),T=Gi(T),S.slice(H,H+T.length)==T}function AC(S,T,H){var ae=xe.templateSettings;H&&Xu(S,T,H)&&(T=t),S=ia(S),T=Uv({},T,ae,$_);var ke=Uv({},T.imports,ae.imports,$_),Ve=Jl(ke),dt=qi(ke,Ve),_t,zt,pn=0,Hn=T.interpolate||Yr,zn="__p += '",Lo=Gd((T.escape||Yr).source+"|"+Hn.source+"|"+(Hn===Wt?hi:Yr).source+"|"+(T.evaluate||Yr).source+"|$","g"),hs="//# sourceURL="+(oi.call(T,"sourceURL")?(T.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rr+"]")+`
`;S.replace(Lo,function($s,fi,yi,cu,Ou,Mf){return yi||(yi=cu),zn+=S.slice(pn,Mf).replace(it,Il),fi&&(_t=!0,zn+=`' +
__e(`+fi+`) +
'`),Ou&&(zt=!0,zn+=`';
`+Ou+`;
__p += '`),yi&&(zn+=`' +
((__t = (`+yi+`)) == null ? '' : __t) +
'`),pn=Mf+$s.length,$s}),zn+=`';
`;var Is=oi.call(T,"variable")&&T.variable;if(!Is)zn=`with (obj) {
`+zn+`
}
`;else if(Bi.test(Is))throw new er(h);zn=(zt?zn.replace(na,""):zn).replace(gs,"$1").replace(va,"$1;"),zn="function("+(Is||"obj")+`) {
`+(Is?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(_t?", __e = _.escape":"")+(zt?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+zn+`return __p
}`;var Hr=sw(function(){return Wr(Ve,hs+"return "+zn).apply(t,dt)});if(Hr.source=zn,Z2(Hr))throw Hr;return Hr}function nw(S){return ia(S).toLowerCase()}function ow(S){return ia(S).toUpperCase()}function iE(S,T,H){if(S=ia(S),S&&(H||T===t))return Pl(S);if(!S||!(T=Gi(T)))return S;var ae=Wl(S),ke=Wl(T),Ve=rc(ae,ke),dt=Vf(ae,ke)+1;return rh(ae,Ve,dt).join("")}function aE(S,T,H){if(S=ia(S),S&&(H||T===t))return S.slice(0,Ig(S)+1);if(!S||!(T=Gi(T)))return S;var ae=Wl(S),ke=Vf(ae,Wl(T))+1;return rh(ae,0,ke).join("")}function Yv(S,T,H){if(S=ia(S),S&&(H||T===t))return S.replace(wo,"");if(!S||!(T=Gi(T)))return S;var ae=Wl(S),ke=rc(ae,Wl(T));return rh(ae,ke).join("")}function TC(S,T){var H=De,ae=_e;if(gl(T)){var ke="separator"in T?T.separator:ke;H="length"in T?jr(T.length):H,ae="omission"in T?Gi(T.omission):ae}S=ia(S);var Ve=S.length;if(el(S)){var dt=Wl(S);Ve=dt.length}if(H>=Ve)return S;var _t=H-Uf(ae);if(_t<1)return ae;var zt=dt?rh(dt,0,_t).join(""):S.slice(0,_t);if(ke===t)return zt+ae;if(dt&&(_t+=zt.length-_t),sf(ke)){if(S.slice(_t).search(ke)){var pn,Hn=zt;for(ke.global||(ke=Gd(ke.source,ia(Ge.exec(ke))+"g")),ke.lastIndex=0;pn=ke.exec(Hn);)var zn=pn.index;zt=zt.slice(0,zn===t?_t:zn)}}else if(S.indexOf(Gi(ke),_t)!=_t){var Lo=zt.lastIndexOf(ke);Lo>-1&&(zt=zt.slice(0,Lo))}return zt+ae}function Xv(S){return S=ia(S),S&&Ii.test(S)?S.replace(an,Ke):S}var xb=ah(function(S,T,H){return S+(H?" ":"")+T.toUpperCase()}),l0=Cv("toUpperCase");function Jv(S,T,H){return S=ia(S),T=H?t:T,T===t?wf(S)?Bg(S):jd(S):S.match(T)||[]}var sw=lr(function(S,T){try{return ni(S,t,T)}catch(H){return Z2(H)?H:new er(H)}}),DC=Td(function(S,T){return Ss(T,function(H){H=Ju(H),ui(S,H,$2(S[H],S))}),S});function rw(S){var T=S==null?0:S.length,H=Hs();return S=T?da(S,function(ae){if(typeof ae[1]!="function")throw new ya(f);return[H(ae[0]),ae[1]]}):[],lr(function(ae){for(var ke=-1;++ke<T;){var Ve=S[ke];if(ni(Ve[0],this,ae))return ni(Ve[1],this,ae)}})}function lE(S){return kd(xs(S,A))}function Qv(S){return function(){return S}}function Ab(S,T){return S==null||S!==S?T:S}var cE=kv(),ey=kv(!0);function af(S){return S}function ty(S){return $(typeof S=="function"?S:xs(S,A))}function OC(S){return Ft(xs(S,A))}function ny(S,T){return Cn(S,xs(T,A))}var uE=lr(function(S,T){return function(H){return ac(H,S,T)}}),Tb=lr(function(S,T){return function(H){return ac(S,H,T)}});function iw(S,T,H){var ae=Jl(T),ke=$p(T,ae);H==null&&!(gl(T)&&(ke.length||!ae.length))&&(H=T,T=S,S=this,ke=$p(T,Jl(T)));var Ve=!(gl(H)&&"chain"in H)||!!H.chain,dt=sm(S);return Ss(ke,function(_t){var zt=T[_t];S[_t]=zt,dt&&(S.prototype[_t]=function(){var pn=this.__chain__;if(Ve||pn){var Hn=S(this.__wrapped__),zn=Hn.__actions__=nu(this.__actions__);return zn.push({func:zt,args:arguments,thisArg:S}),Hn.__chain__=pn,Hn}return zt.apply(S,Hf([this.value()],arguments))})}),S}function fE(){return de._===this&&(de._=Kd),this}function oy(){}function pl(S){return S=jr(S),lr(function(T){return Jo(T,S)})}var dE=q1(da),c0=q1(Ei),hE=q1(Vu);function u0(S){return uh(S)?Qa(Ju(S)):Bc(S)}function aw(S){return function(T){return S==null?t:Ll(S,T)}}var mE=Ev(),gE=Ev(!0);function Db(){return[]}function im(){return!1}function f0(){return{}}function lu(){return""}function e1(){return!0}function MC(S,T){if(S=jr(S),S<1||S>nt)return[];var H=He,ae=Sr(S,He);T=Hs(T),S-=He;for(var ke=Tr(ae,T);++H<S;)T(H);return ke}function RC(S){return vr(S)?da(S,Ju):nl(S)?[S]:nu(lb(ia(S)))}function lw(S){var T=++_u;return ia(S)+T}var cw=lh(function(S,T){return S+T},0),uw=G1("ceil"),pE=lh(function(S,T){return S/T},1),Ob=G1("floor");function sy(S){return S&&S.length?Gr(S,af,nh):t}function cp(S,T){return S&&S.length?Gr(S,Hs(T,2),nh):t}function Mb(S){return _l(S,af)}function wh(S,T){return _l(S,Hs(T,2))}function bE(S){return S&&S.length?Gr(S,af,Te):t}function am(S,T){return S&&S.length?Gr(S,Hs(T,2),Te):t}var Nd=lh(function(S,T){return S*T},1),d0=G1("round"),fw=lh(function(S,T){return S-T},0);function h0(S){return S&&S.length?yf(S,af):0}function fg(S,T){return S&&S.length?yf(S,Hs(T,2)):0}return xe.after=nm,xe.ary=Vt,xe.assign=Wk,xe.assignIn=Vv,xe.assignInWith=Uv,xe.assignWith=uC,xe.at=jk,xe.before=vb,xe.bind=$2,xe.bindAll=DC,xe.bindKey=yb,xe.castArray=rC,xe.chain=sp,xe.chunk=U_,xe.compact=Wp,xe.concat=k2,xe.cond=rw,xe.conforms=lE,xe.constant=Qv,xe.countBy=Gp,xe.create=s0,xe.curry=gh,xe.curryRight=of,xe.debounce=t0,xe.defaults=fC,xe.defaultsDeep=Zk,xe.defer=Bv,xe.delay=z2,xe.difference=np,xe.differenceBy=cb,xe.differenceWith=K1,xe.drop=E2,xe.dropRight=x2,xe.dropRightWhile=W_,xe.dropWhile=Rk,xe.fill=Lr,xe.filter=Jf,xe.flatMap=eC,xe.flatMapDeep=Hk,xe.flatMapDepth=tC,xe.flatten=T2,xe.flattenDeep=ub,xe.flattenDepth=Nk,xe.flip=Lv,xe.flow=cE,xe.flowRight=ey,xe.fromPairs=tm,xe.functions=Ui,xe.functionsIn=Q2,xe.groupBy=nC,xe.initial=Y1,xe.intersection=j_,xe.intersectionBy=db,xe.intersectionWith=D2,xe.invert=mC,xe.invertBy=rm,xe.invokeMap=Kp,xe.iteratee=ty,xe.keyBy=oC,xe.keys=Jl,xe.keysIn=rf,xe.map=Yp,xe.mapKeys=Cb,xe.mapValues=Kk,xe.matches=OC,xe.matchesProperty=ny,xe.memoize=wb,xe.merge=Yk,xe.mergeWith=gC,xe.method=uE,xe.methodOf=Tb,xe.mixin=iw,xe.negate=ph,xe.nthArg=pl,xe.omit=Sb,xe.omitBy=pC,xe.once=Qf,xe.orderBy=sg,xe.over=dE,xe.overArgs=Tu,xe.overEvery=c0,xe.overSome=hE,xe.partial=Fl,xe.partialRight=V2,xe.partition=Iv,xe.pick=bC,xe.pickBy=ap,xe.property=u0,xe.propertyOf=aw,xe.pull=tg,xe.pullAll=Fc,xe.pullAllBy=Pk,xe.pullAllWith=O2,xe.pullAt=Yf,xe.range=mE,xe.rangeRight=gE,xe.rearg=rp,xe.reject=Gs,xe.remove=Na,xe.rest=sC,xe.reverse=Sa,xe.sampleSize=rg,xe.set=Jk,xe.setWith=Qk,xe.shuffle=F2,xe.slice=Ik,xe.sortBy=ig,xe.sortedUniq=X1,xe.sortedUniqBy=mb,xe.split=oE,xe.spread=_b,xe.tail=gb,xe.take=Z_,xe.takeRight=M2,xe.takeRightWhile=Bk,xe.takeWhile=q_,xe.tap=Zp,xe.throttle=Xp,xe.thru=qp,xe.toArray=J2,xe.toPairs=ew,xe.toPairsIn=jv,xe.toPath=RC,xe.toPlainObject=lC,xe.transform=cg,xe.unary=U2,xe.union=G_,xe.unionBy=R2,xe.unionWith=K_,xe.uniq=s3,xe.uniqBy=Rv,xe.uniqWith=Y_,xe.unset=vC,xe.unzip=Ri,xe.unzipWith=Nv,xe.update=yC,xe.updateWith=Zv,xe.values=a0,xe.valuesIn=ug,xe.without=N2,xe.words=Jv,xe.wrap=Fv,xe.xor=X_,xe.xorBy=ng,xe.xorWith=uc,xe.zip=ru,xe.zipObject=J_,xe.zipObjectDeep=P2,xe.zipWith=op,xe.entries=ew,xe.entriesIn=jv,xe.extend=Vv,xe.extendWith=Uv,iw(xe,xe),xe.add=cw,xe.attempt=sw,xe.camelCase=wC,xe.capitalize=vh,xe.ceil=uw,xe.clamp=qv,xe.clone=Hv,xe.cloneDeep=ml,xe.cloneDeepWith=Kl,xe.cloneWith=W2,xe.conformsTo=Du,xe.deburr=Eb,xe.defaultTo=Ab,xe.divide=pE,xe.endsWith=_C,xe.eq=Fr,xe.escape=yh,xe.escapeRegExp=lp,xe.every=Q1,xe.find=B2,xe.findIndex=Ov,xe.findKey=dC,xe.findLast=Q_,xe.findLastIndex=A2,xe.findLastKey=qk,xe.floor=Ob,xe.forEach=pb,xe.forEachRight=bb,xe.forIn=hC,xe.forInRight=Wv,xe.forOwn=ip,xe.forOwnRight=r0,xe.get=Sc,xe.gt=Yl,xe.gte=Hl,xe.has=i0,xe.hasIn=ol,xe.head=qa,xe.identity=af,xe.includes=L2,xe.indexOf=fb,xe.inRange=Gv,xe.invoke=Gk,xe.isArguments=om,xe.isArray=vr,xe.isArrayBuffer=iC,xe.isArrayLike=au,xe.isArrayLikeObject=xl,xe.isBoolean=j2,xe.isBuffer=ag,xe.isDate=fc,xe.isElement=r3,xe.isEmpty=lg,xe.isEqual=$k,xe.isEqualWith=zk,xe.isError=Z2,xe.isFinite=q2,xe.isFunction=sm,xe.isInteger=G2,xe.isLength=Jp,xe.isMap=An,xe.isMatch=Vk,xe.isMatchWith=Xl,xe.isNaN=Uk,xe.isNative=K2,xe.isNil=Cc,xe.isNull=to,xe.isNumber=Y2,xe.isObject=gl,xe.isObjectLike=Al,xe.isPlainObject=n0,xe.isRegExp=sf,xe.isSafeInteger=$v,xe.isSet=Qp,xe.isString=Of,xe.isSymbol=nl,xe.isTypedArray=Md,xe.isUndefined=Rd,xe.isWeakMap=Hc,xe.isWeakSet=o0,xe.join=Ra,xe.kebabCase=tw,xe.last=hh,xe.lastIndexOf=ma,xe.lowerCase=CC,xe.lowerFirst=Kv,xe.lt=X2,xe.lte=aC,xe.max=sy,xe.maxBy=cp,xe.mean=Mb,xe.meanBy=wh,xe.min=bE,xe.minBy=am,xe.stubArray=Db,xe.stubFalse=im,xe.stubObject=f0,xe.stubString=lu,xe.stubTrue=e1,xe.multiply=Nd,xe.nth=Qu,xe.noConflict=fE,xe.noop=oy,xe.now=ga,xe.pad=eE,xe.padEnd=SC,xe.padStart=tE,xe.parseInt=nE,xe.random=kb,xe.reduce=nf,xe.reduceRight=e0,xe.repeat=kC,xe.replace=EC,xe.result=Xk,xe.round=d0,xe.runInContext=pt,xe.sample=iu,xe.size=Vi,xe.snakeCase=xC,xe.some=H2,xe.sortedIndex=mh,xe.sortedIndexBy=hb,xe.sortedIndexOf=Mv,xe.sortedLastIndex=Xf,xe.sortedLastIndexBy=ef,xe.sortedLastIndexOf=jp,xe.startCase=sE,xe.startsWith=rE,xe.subtract=fw,xe.sum=h0,xe.sumBy=fg,xe.template=AC,xe.times=MC,xe.toFinite=bh,xe.toInteger=jr,xe.toLength=zv,xe.toLower=nw,xe.toNumber=ed,xe.toSafeInteger=cC,xe.toString=ia,xe.toUpper=ow,xe.trim=iE,xe.trimEnd=aE,xe.trimStart=Yv,xe.truncate=TC,xe.unescape=Xv,xe.uniqueId=lw,xe.upperCase=xb,xe.upperFirst=l0,xe.each=pb,xe.eachRight=bb,xe.first=qa,iw(xe,function(){var S={};return qf(xe,function(T,H){oi.call(xe.prototype,H)||(S[H]=T)}),S}(),{chain:!1}),xe.VERSION=r,Ss(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){xe[S].placeholder=xe}),Ss(["drop","take"],function(S,T){ci.prototype[S]=function(H){H=H===t?1:uo(jr(H),0);var ae=this.__filtered__&&!T?new ci(this):this.clone();return ae.__filtered__?ae.__takeCount__=Sr(H,ae.__takeCount__):ae.__views__.push({size:Sr(H,He),type:S+(ae.__dir__<0?"Right":"")}),ae},ci.prototype[S+"Right"]=function(H){return this.reverse()[S](H).reverse()}}),Ss(["filter","map","takeWhile"],function(S,T){var H=T+1,ae=H==Qe||H==V;ci.prototype[S]=function(ke){var Ve=this.clone();return Ve.__iteratees__.push({iteratee:Hs(ke,3),type:H}),Ve.__filtered__=Ve.__filtered__||ae,Ve}}),Ss(["head","last"],function(S,T){var H="take"+(T?"Right":"");ci.prototype[S]=function(){return this[H](1).value()[0]}}),Ss(["initial","tail"],function(S,T){var H="drop"+(T?"":"Right");ci.prototype[S]=function(){return this.__filtered__?new ci(this):this[H](1)}}),ci.prototype.compact=function(){return this.filter(af)},ci.prototype.find=function(S){return this.filter(S).head()},ci.prototype.findLast=function(S){return this.reverse().find(S)},ci.prototype.invokeMap=lr(function(S,T){return typeof S=="function"?new ci(this):this.map(function(H){return ac(H,S,T)})}),ci.prototype.reject=function(S){return this.filter(ph(Hs(S)))},ci.prototype.slice=function(S,T){S=jr(S);var H=this;return H.__filtered__&&(S>0||T<0)?new ci(H):(S<0?H=H.takeRight(-S):S&&(H=H.drop(S)),T!==t&&(T=jr(T),H=T<0?H.dropRight(-T):H.take(T-S)),H)},ci.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},ci.prototype.toArray=function(){return this.take(He)},qf(ci.prototype,function(S,T){var H=/^(?:filter|find|map|reject)|While$/.test(T),ae=/^(?:head|last)$/.test(T),ke=xe[ae?"take"+(T=="last"?"Right":""):T],Ve=ae||/^find/.test(T);!ke||(xe.prototype[T]=function(){var dt=this.__wrapped__,_t=ae?[1]:arguments,zt=dt instanceof ci,pn=_t[0],Hn=zt||vr(dt),zn=function(fi){var yi=ke.apply(xe,Hf([fi],_t));return ae&&Lo?yi[0]:yi};Hn&&H&&typeof pn=="function"&&pn.length!=1&&(zt=Hn=!1);var Lo=this.__chain__,hs=!!this.__actions__.length,Is=Ve&&!Lo,Hr=zt&&!hs;if(!Ve&&Hn){dt=Hr?dt:new ci(this);var $s=S.apply(dt,_t);return $s.__actions__.push({func:qp,args:[zn],thisArg:t}),new Su($s,Lo)}return Is&&Hr?S.apply(this,_t):($s=this.thru(zn),Is?ae?$s.value()[0]:$s.value():$s)})}),Ss(["pop","push","shift","sort","splice","unshift"],function(S){var T=vd[S],H=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",ae=/^(?:pop|shift)$/.test(S);xe.prototype[S]=function(){var ke=arguments;if(ae&&!this.__chain__){var Ve=this.value();return T.apply(vr(Ve)?Ve:[],ke)}return this[H](function(dt){return T.apply(vr(dt)?dt:[],ke)})}}),qf(ci.prototype,function(S,T){var H=xe[T];if(H){var ae=H.name+"";oi.call(Qi,ae)||(Qi[ae]=[]),Qi[ae].push({name:T,func:H})}}),Qi[nr(t,q).name]=[{name:"wrapper",func:t}],ci.prototype.clone=yv,ci.prototype.reverse=$1,ci.prototype.value=Z0,xe.prototype.at=og,xe.prototype.chain=Pv,xe.prototype.commit=ta,xe.prototype.next=tf,xe.prototype.plant=Lk,xe.prototype.reverse=I2,xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=Fk,xe.prototype.first=xe.prototype.head,si&&(xe.prototype[si]=J1),xe},Uh=L1();je?((je.exports=Uh)._=Uh,Me._=Uh):de._=Uh}).call(nP)})(Hu,Hu.exports);const D0e=Hu.exports;var zde={exports:{}},Coe={exports:{}},Vde=function(e,t){return function(){for(var a=new Array(arguments.length),u=0;u<a.length;u++)a[u]=arguments[u];return e.apply(t,a)}},O0e=Vde,Ck=Object.prototype.toString;function Soe(s){return Array.isArray(s)}function fne(s){return typeof s>"u"}function M0e(s){return s!==null&&!fne(s)&&s.constructor!==null&&!fne(s.constructor)&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function Ude(s){return Ck.call(s)==="[object ArrayBuffer]"}function R0e(s){return Ck.call(s)==="[object FormData]"}function N0e(s){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&Ude(s.buffer),e}function P0e(s){return typeof s=="string"}function I0e(s){return typeof s=="number"}function Wde(s){return s!==null&&typeof s=="object"}function Sz(s){if(Ck.call(s)!=="[object Object]")return!1;var e=Object.getPrototypeOf(s);return e===null||e===Object.prototype}function B0e(s){return Ck.call(s)==="[object Date]"}function L0e(s){return Ck.call(s)==="[object File]"}function F0e(s){return Ck.call(s)==="[object Blob]"}function jde(s){return Ck.call(s)==="[object Function]"}function H0e(s){return Wde(s)&&jde(s.pipe)}function $0e(s){return Ck.call(s)==="[object URLSearchParams]"}function z0e(s){return s.trim?s.trim():s.replace(/^\s+|\s+$/g,"")}function V0e(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function koe(s,e){if(!(s===null||typeof s>"u"))if(typeof s!="object"&&(s=[s]),Soe(s))for(var t=0,r=s.length;t<r;t++)e.call(null,s[t],t,s);else for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&e.call(null,s[a],a,s)}function dne(){var s={};function e(a,u){Sz(s[u])&&Sz(a)?s[u]=dne(s[u],a):Sz(a)?s[u]=dne({},a):Soe(a)?s[u]=a.slice():s[u]=a}for(var t=0,r=arguments.length;t<r;t++)koe(arguments[t],e);return s}function U0e(s,e,t){return koe(e,function(a,u){t&&typeof a=="function"?s[u]=O0e(a,t):s[u]=a}),s}function W0e(s){return s.charCodeAt(0)===65279&&(s=s.slice(1)),s}var Pp={isArray:Soe,isArrayBuffer:Ude,isBuffer:M0e,isFormData:R0e,isArrayBufferView:N0e,isString:P0e,isNumber:I0e,isObject:Wde,isPlainObject:Sz,isUndefined:fne,isDate:B0e,isFile:L0e,isBlob:F0e,isFunction:jde,isStream:H0e,isURLSearchParams:$0e,isStandardBrowserEnv:V0e,forEach:koe,merge:dne,extend:U0e,trim:z0e,stripBOM:W0e},xD=Pp;function eie(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Zde=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else if(xD.isURLSearchParams(t))a=t.toString();else{var u=[];xD.forEach(t,function(g,y){g===null||typeof g>"u"||(xD.isArray(g)?y=y+"[]":g=[g],xD.forEach(g,function(A){xD.isDate(A)?A=A.toISOString():xD.isObject(A)&&(A=JSON.stringify(A)),u.push(eie(y)+"="+eie(A))}))}),a=u.join("&")}if(a){var f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e},j0e=Pp;function BV(){this.handlers=[]}BV.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};BV.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};BV.prototype.forEach=function(e){j0e.forEach(this.handlers,function(r){r!==null&&e(r)})};var Z0e=BV,q0e=Pp,G0e=function(e,t){q0e.forEach(e,function(a,u){u!==t&&u.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[u])})},qde=function(e,t,r,a,u){return e.config=t,r&&(e.code=r),e.request=a,e.response=u,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},$ee,tie;function Gde(){if(tie)return $ee;tie=1;var s=qde;return $ee=function(t,r,a,u,f){var h=new Error(t);return s(h,r,a,u,f)},$ee}var zee,nie;function K0e(){if(nie)return zee;nie=1;var s=Gde();return zee=function(t,r,a){var u=a.config.validateStatus;!a.status||!u||u(a.status)?t(a):r(s("Request failed with status code "+a.status,a.config,null,a.request,a))},zee}var Vee,oie;function Y0e(){if(oie)return Vee;oie=1;var s=Pp;return Vee=s.isStandardBrowserEnv()?function(){return{write:function(r,a,u,f,h,g){var y=[];y.push(r+"="+encodeURIComponent(a)),s.isNumber(u)&&y.push("expires="+new Date(u).toGMTString()),s.isString(f)&&y.push("path="+f),s.isString(h)&&y.push("domain="+h),g===!0&&y.push("secure"),document.cookie=y.join("; ")},read:function(r){var a=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Vee}var Uee,sie;function X0e(){return sie||(sie=1,Uee=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Uee}var Wee,rie;function J0e(){return rie||(rie=1,Wee=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),Wee}var jee,iie;function Q0e(){if(iie)return jee;iie=1;var s=X0e(),e=J0e();return jee=function(r,a){return r&&!s(a)?e(r,a):a},jee}var Zee,aie;function ebe(){if(aie)return Zee;aie=1;var s=Pp,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Zee=function(r){var a={},u,f,h;return r&&s.forEach(r.split(`
`),function(y){if(h=y.indexOf(":"),u=s.trim(y.substr(0,h)).toLowerCase(),f=s.trim(y.substr(h+1)),u){if(a[u]&&e.indexOf(u)>=0)return;u==="set-cookie"?a[u]=(a[u]?a[u]:[]).concat([f]):a[u]=a[u]?a[u]+", "+f:f}}),a},Zee}var qee,lie;function tbe(){if(lie)return qee;lie=1;var s=Pp;return qee=s.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),a;function u(f){var h=f;return t&&(r.setAttribute("href",h),h=r.href),r.setAttribute("href",h),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return a=u(window.location.href),function(h){var g=s.isString(h)?u(h):h;return g.protocol===a.protocol&&g.host===a.host}}():function(){return function(){return!0}}(),qee}var Gee,cie;function LV(){if(cie)return Gee;cie=1;function s(e){this.message=e}return s.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},s.prototype.__CANCEL__=!0,Gee=s,Gee}var Kee,uie;function fie(){if(uie)return Kee;uie=1;var s=Pp,e=K0e(),t=Y0e(),r=Zde,a=Q0e(),u=ebe(),f=tbe(),h=Gde(),g=FV(),y=LV();return Kee=function(A){return new Promise(function(N,L){var j=A.data,z=A.headers,q=A.responseType,ee;function F(){A.cancelToken&&A.cancelToken.unsubscribe(ee),A.signal&&A.signal.removeEventListener("abort",ee)}s.isFormData(j)&&delete z["Content-Type"];var ne=new XMLHttpRequest;if(A.auth){var oe=A.auth.username||"",re=A.auth.password?unescape(encodeURIComponent(A.auth.password)):"";z.Authorization="Basic "+btoa(oe+":"+re)}var J=a(A.baseURL,A.url);ne.open(A.method.toUpperCase(),r(J,A.params,A.paramsSerializer),!0),ne.timeout=A.timeout;function we(){if(!!ne){var De="getAllResponseHeaders"in ne?u(ne.getAllResponseHeaders()):null,_e=!q||q==="text"||q==="json"?ne.responseText:ne.response,be={data:_e,status:ne.status,statusText:ne.statusText,headers:De,config:A,request:ne};e(function(Qe){N(Qe),F()},function(Qe){L(Qe),F()},be),ne=null}}if("onloadend"in ne?ne.onloadend=we:ne.onreadystatechange=function(){!ne||ne.readyState!==4||ne.status===0&&!(ne.responseURL&&ne.responseURL.indexOf("file:")===0)||setTimeout(we)},ne.onabort=function(){!ne||(L(h("Request aborted",A,"ECONNABORTED",ne)),ne=null)},ne.onerror=function(){L(h("Network Error",A,null,ne)),ne=null},ne.ontimeout=function(){var _e=A.timeout?"timeout of "+A.timeout+"ms exceeded":"timeout exceeded",be=A.transitional||g.transitional;A.timeoutErrorMessage&&(_e=A.timeoutErrorMessage),L(h(_e,A,be.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",ne)),ne=null},s.isStandardBrowserEnv()){var ye=(A.withCredentials||f(J))&&A.xsrfCookieName?t.read(A.xsrfCookieName):void 0;ye&&(z[A.xsrfHeaderName]=ye)}"setRequestHeader"in ne&&s.forEach(z,function(_e,be){typeof j>"u"&&be.toLowerCase()==="content-type"?delete z[be]:ne.setRequestHeader(be,_e)}),s.isUndefined(A.withCredentials)||(ne.withCredentials=!!A.withCredentials),q&&q!=="json"&&(ne.responseType=A.responseType),typeof A.onDownloadProgress=="function"&&ne.addEventListener("progress",A.onDownloadProgress),typeof A.onUploadProgress=="function"&&ne.upload&&ne.upload.addEventListener("progress",A.onUploadProgress),(A.cancelToken||A.signal)&&(ee=function(De){!ne||(L(!De||De&&De.type?new y("canceled"):De),ne.abort(),ne=null)},A.cancelToken&&A.cancelToken.subscribe(ee),A.signal&&(A.signal.aborted?ee():A.signal.addEventListener("abort",ee))),j||(j=null),ne.send(j)})},Kee}var Yee,die;function FV(){if(die)return Yee;die=1;var s=Pp,e=G0e,t=qde,r={"Content-Type":"application/x-www-form-urlencoded"};function a(g,y){!s.isUndefined(g)&&s.isUndefined(g["Content-Type"])&&(g["Content-Type"]=y)}function u(){var g;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(g=fie()),g}function f(g,y,C){if(s.isString(g))try{return(y||JSON.parse)(g),s.trim(g)}catch(A){if(A.name!=="SyntaxError")throw A}return(C||JSON.stringify)(g)}var h={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:u(),transformRequest:[function(y,C){return e(C,"Accept"),e(C,"Content-Type"),s.isFormData(y)||s.isArrayBuffer(y)||s.isBuffer(y)||s.isStream(y)||s.isFile(y)||s.isBlob(y)?y:s.isArrayBufferView(y)?y.buffer:s.isURLSearchParams(y)?(a(C,"application/x-www-form-urlencoded;charset=utf-8"),y.toString()):s.isObject(y)||C&&C["Content-Type"]==="application/json"?(a(C,"application/json"),f(y)):y}],transformResponse:[function(y){var C=this.transitional||h.transitional,A=C&&C.silentJSONParsing,O=C&&C.forcedJSONParsing,N=!A&&this.responseType==="json";if(N||O&&s.isString(y)&&y.length)try{return JSON.parse(y)}catch(L){if(N)throw L.name==="SyntaxError"?t(L,this,"E_JSON_PARSE"):L}return y}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(y){return y>=200&&y<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return s.forEach(["delete","get","head"],function(y){h.headers[y]={}}),s.forEach(["post","put","patch"],function(y){h.headers[y]=s.merge(r)}),Yee=h,Yee}var nbe=Pp,obe=FV(),sbe=function(e,t,r){var a=this||obe;return nbe.forEach(r,function(f){e=f.call(a,e,t)}),e},Xee,hie;function Kde(){return hie||(hie=1,Xee=function(e){return!!(e&&e.__CANCEL__)}),Xee}var mie=Pp,Jee=sbe,rbe=Kde(),ibe=FV(),abe=LV();function Qee(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new abe("canceled")}var lbe=function(e){Qee(e),e.headers=e.headers||{},e.data=Jee.call(e,e.data,e.headers,e.transformRequest),e.headers=mie.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),mie.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]});var t=e.adapter||ibe.adapter;return t(e).then(function(a){return Qee(e),a.data=Jee.call(e,a.data,a.headers,e.transformResponse),a},function(a){return rbe(a)||(Qee(e),a&&a.response&&(a.response.data=Jee.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)})},C1=Pp,Yde=function(e,t){t=t||{};var r={};function a(C,A){return C1.isPlainObject(C)&&C1.isPlainObject(A)?C1.merge(C,A):C1.isPlainObject(A)?C1.merge({},A):C1.isArray(A)?A.slice():A}function u(C){if(C1.isUndefined(t[C])){if(!C1.isUndefined(e[C]))return a(void 0,e[C])}else return a(e[C],t[C])}function f(C){if(!C1.isUndefined(t[C]))return a(void 0,t[C])}function h(C){if(C1.isUndefined(t[C])){if(!C1.isUndefined(e[C]))return a(void 0,e[C])}else return a(void 0,t[C])}function g(C){if(C in t)return a(e[C],t[C]);if(C in e)return a(void 0,e[C])}var y={url:f,method:f,data:f,baseURL:h,transformRequest:h,transformResponse:h,paramsSerializer:h,timeout:h,timeoutMessage:h,withCredentials:h,adapter:h,responseType:h,xsrfCookieName:h,xsrfHeaderName:h,onUploadProgress:h,onDownloadProgress:h,decompress:h,maxContentLength:h,maxBodyLength:h,transport:h,httpAgent:h,httpsAgent:h,cancelToken:h,socketPath:h,responseEncoding:h,validateStatus:g};return C1.forEach(Object.keys(e).concat(Object.keys(t)),function(A){var O=y[A]||u,N=O(A);C1.isUndefined(N)&&O!==g||(r[A]=N)}),r},ete,gie;function Xde(){return gie||(gie=1,ete={version:"0.25.0"}),ete}var cbe=Xde().version,Eoe={};["object","boolean","number","function","string","symbol"].forEach(function(s,e){Eoe[s]=function(r){return typeof r===s||"a"+(e<1?"n ":" ")+s}});var pie={};Eoe.transitional=function(e,t,r){function a(u,f){return"[Axios v"+cbe+"] Transitional option '"+u+"'"+f+(r?". "+r:"")}return function(u,f,h){if(e===!1)throw new Error(a(f," has been removed"+(t?" in "+t:"")));return t&&!pie[f]&&(pie[f]=!0,console.warn(a(f," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(u,f,h):!0}};function ube(s,e,t){if(typeof s!="object")throw new TypeError("options must be an object");for(var r=Object.keys(s),a=r.length;a-- >0;){var u=r[a],f=e[u];if(f){var h=s[u],g=h===void 0||f(h,u,s);if(g!==!0)throw new TypeError("option "+u+" must be "+g);continue}if(t!==!0)throw Error("Unknown option "+u)}}var fbe={assertOptions:ube,validators:Eoe},Jde=Pp,dbe=Zde,bie=Z0e,vie=lbe,HV=Yde,Qde=fbe,AD=Qde.validators;function eI(s){this.defaults=s,this.interceptors={request:new bie,response:new bie}}eI.prototype.request=function(e,t){if(typeof e=="string"?(t=t||{},t.url=e):t=e||{},!t.url)throw new Error("Provided config url is not valid");t=HV(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&Qde.assertOptions(r,{silentJSONParsing:AD.transitional(AD.boolean),forcedJSONParsing:AD.transitional(AD.boolean),clarifyTimeoutError:AD.transitional(AD.boolean)},!1);var a=[],u=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(t)===!1||(u=u&&N.synchronous,a.unshift(N.fulfilled,N.rejected))});var f=[];this.interceptors.response.forEach(function(N){f.push(N.fulfilled,N.rejected)});var h;if(!u){var g=[vie,void 0];for(Array.prototype.unshift.apply(g,a),g=g.concat(f),h=Promise.resolve(t);g.length;)h=h.then(g.shift(),g.shift());return h}for(var y=t;a.length;){var C=a.shift(),A=a.shift();try{y=C(y)}catch(O){A(O);break}}try{h=vie(y)}catch(O){return Promise.reject(O)}for(;f.length;)h=h.then(f.shift(),f.shift());return h};eI.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=HV(this.defaults,e),dbe(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};Jde.forEach(["delete","get","head","options"],function(e){eI.prototype[e]=function(t,r){return this.request(HV(r||{},{method:e,url:t,data:(r||{}).data}))}});Jde.forEach(["post","put","patch"],function(e){eI.prototype[e]=function(t,r,a){return this.request(HV(a||{},{method:e,url:t,data:r}))}});var hbe=eI,tte,yie;function mbe(){if(yie)return tte;yie=1;var s=LV();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(f){r=f});var a=this;this.promise.then(function(u){if(!!a._listeners){var f,h=a._listeners.length;for(f=0;f<h;f++)a._listeners[f](u);a._listeners=null}}),this.promise.then=function(u){var f,h=new Promise(function(g){a.subscribe(g),f=g}).then(u);return h.cancel=function(){a.unsubscribe(f)},h},t(function(f){a.reason||(a.reason=new s(f),r(a.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]},e.prototype.unsubscribe=function(r){if(!!this._listeners){var a=this._listeners.indexOf(r);a!==-1&&this._listeners.splice(a,1)}},e.source=function(){var r,a=new e(function(f){r=f});return{token:a,cancel:r}},tte=e,tte}var nte,wie;function gbe(){return wie||(wie=1,nte=function(e){return function(r){return e.apply(null,r)}}),nte}var ote,_ie;function pbe(){if(_ie)return ote;_ie=1;var s=Pp;return ote=function(t){return s.isObject(t)&&t.isAxiosError===!0},ote}var Cie=Pp,bbe=Vde,kz=hbe,vbe=Yde,ybe=FV();function ehe(s){var e=new kz(s),t=bbe(kz.prototype.request,e);return Cie.extend(t,kz.prototype,e),Cie.extend(t,e),t.create=function(a){return ehe(vbe(s,a))},t}var u2=ehe(ybe);u2.Axios=kz;u2.Cancel=LV();u2.CancelToken=mbe();u2.isCancel=Kde();u2.VERSION=Xde().version;u2.all=function(e){return Promise.all(e)};u2.spread=gbe();u2.isAxiosError=pbe();Coe.exports=u2;Coe.exports.default=u2;(function(s){s.exports=Coe.exports})(zde);const wbe=T0e(zde.exports);window._=D0e;window.axios=wbe;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios.interceptors.request.use(function(s){let e;e=document.querySelectorAll(".btn-spinner");for(var t=0;t<e.length;++t)e[t].classList.add("spinner-on"),e[t].disabled=!0;return s},function(s){return Promise.reject(s)});window.axios.interceptors.response.use(function(s){let e;e=document.querySelectorAll(".btn-spinner");for(var t=0;t<e.length;++t)e[t].classList.remove("spinner-on"),e[t].disabled=!1;return s},function(s){let e;e=document.querySelectorAll(".btn-spinner");for(var t=0;t<e.length;++t)e[t].classList.remove("spinner-on"),e[t].disabled=!1;return Promise.reject(s)});function Sn(){}const the=s=>s;function tI(s,e){for(const t in e)s[t]=e[t];return s}function nhe(s){return s()}function Sie(){return Object.create(null)}function Zi(s){s.forEach(nhe)}function B0(s){return typeof s=="function"}function Co(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}let F$;function kie(s,e){return F$||(F$=document.createElement("a")),F$.href=e,s===F$.href}function _be(s){return Object.keys(s).length===0}function ohe(s,e,t,r){if(s){const a=she(s,e,t,r);return s[0](a)}}function she(s,e,t,r){return s[1]&&r?tI(t.ctx.slice(),s[1](r(e))):t.ctx}function rhe(s,e,t,r){if(s[2]&&r){const a=s[2](r(t));if(e.dirty===void 0)return a;if(typeof a=="object"){const u=[],f=Math.max(e.dirty.length,a.length);for(let h=0;h<f;h+=1)u[h]=e.dirty[h]|a[h];return u}return e.dirty|a}return e.dirty}function ihe(s,e,t,r,a,u){if(a){const f=she(e,t,r,u);s.p(f,a)}}function ahe(s){if(s.ctx.length>32){const e=[],t=s.ctx.length/32;for(let r=0;r<t;r++)e[r]=-1;return e}return-1}function Eie(s){const e=typeof s=="string"&&s.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[s,"px"]}const lhe=typeof window<"u";let che=lhe?()=>window.performance.now():()=>Date.now(),xoe=lhe?s=>requestAnimationFrame(s):Sn;const ZD=new Set;function uhe(s){ZD.forEach(e=>{e.c(s)||(ZD.delete(e),e.f())}),ZD.size!==0&&xoe(uhe)}function fhe(s){let e;return ZD.size===0&&xoe(uhe),{promise:new Promise(t=>{ZD.add(e={c:s,f:t})}),abort(){ZD.delete(e)}}}const Cbe=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Q(s,e){s.appendChild(e)}function dhe(s){if(!s)return document;const e=s.getRootNode?s.getRootNode():s.ownerDocument;return e&&e.host?e:s.ownerDocument}function Sbe(s){const e=ce("style");return kbe(dhe(s),e),e.sheet}function kbe(s,e){return Q(s.head||s,e),e.sheet}function Le(s,e,t){s.insertBefore(e,t||null)}function Ie(s){s.parentNode&&s.parentNode.removeChild(s)}function ul(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function ce(s){return document.createElement(s)}function hhe(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Kt(s){return document.createTextNode(s)}function Xe(){return Kt(" ")}function Rs(){return Kt("")}function Dn(s,e,t,r){return s.addEventListener(e,t,r),()=>s.removeEventListener(e,t,r)}function $u(s){return function(e){return e.preventDefault(),s.call(this,e)}}function W(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function Aoe(s){let e;return{p(...t){e=t,e.forEach(r=>s.push(r))},r(){e.forEach(t=>s.splice(s.indexOf(t),1))}}}function qz(s){return s===""?null:+s}function Ebe(s){return Array.from(s.childNodes)}function Gn(s,e){e=""+e,s.data!==e&&(s.data=e)}function wr(s,e){s.value=e==null?"":e}function os(s,e,t,r){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,r?"important":"")}function H$(s,e,t){for(let r=0;r<s.options.length;r+=1){const a=s.options[r];if(a.__value===e){a.selected=!0;return}}(!t||e!==void 0)&&(s.selectedIndex=-1)}function xie(s){const e=s.querySelector(":checked");return e&&e.__value}function _s(s,e,t){s.classList[t?"add":"remove"](e)}function mhe(s,e,{bubbles:t=!1,cancelable:r=!1}={}){const a=document.createEvent("CustomEvent");return a.initCustomEvent(s,t,r,e),a}class xbe{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,r=null){this.e||(this.is_svg?this.e=hhe(t.nodeName):this.e=ce(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(r)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)Le(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(Ie)}}function dk(s,e){return new s(e)}const Gz=new Map;let Kz=0;function Abe(s){let e=5381,t=s.length;for(;t--;)e=(e<<5)-e^s.charCodeAt(t);return e>>>0}function Tbe(s,e){const t={stylesheet:Sbe(e),rules:{}};return Gz.set(s,t),t}function hne(s,e,t,r,a,u,f,h=0){const g=16.666/r;let y=`{
`;for(let z=0;z<=1;z+=g){const q=e+(t-e)*u(z);y+=z*100+`%{${f(q,1-q)}}
`}const C=y+`100% {${f(t,1-t)}}
}`,A=`__svelte_${Abe(C)}_${h}`,O=dhe(s),{stylesheet:N,rules:L}=Gz.get(O)||Tbe(O,s);L[A]||(L[A]=!0,N.insertRule(`@keyframes ${A} ${C}`,N.cssRules.length));const j=s.style.animation||"";return s.style.animation=`${j?`${j}, `:""}${A} ${r}ms linear ${a}ms 1 both`,Kz+=1,A}function ghe(s,e){const t=(s.style.animation||"").split(", "),r=t.filter(e?u=>u.indexOf(e)<0:u=>u.indexOf("__svelte")===-1),a=t.length-r.length;a&&(s.style.animation=r.join(", "),Kz-=a,Kz||Dbe())}function Dbe(){xoe(()=>{Kz||(Gz.forEach(s=>{const{ownerNode:e}=s.stylesheet;e&&Ie(e)}),Gz.clear())})}function phe(s,e,t,r){if(!e)return Sn;const a=s.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return Sn;const{delay:u=0,duration:f=300,easing:h=the,start:g=che()+u,end:y=g+f,tick:C=Sn,css:A}=t(s,{from:e,to:a},r);let O=!0,N=!1,L;function j(){A&&(L=hne(s,0,1,f,u,h,A)),u||(N=!0)}function z(){A&&ghe(s,L),O=!1}return fhe(q=>{if(!N&&q>=g&&(N=!0),N&&q>=y&&(C(1,0),z()),!O)return!1;if(N){const ee=q-g,F=0+1*h(ee/f);C(F,1-F)}return!0}),j(),C(0,1),z}function bhe(s){const e=getComputedStyle(s);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:r}=e,a=s.getBoundingClientRect();s.style.position="absolute",s.style.width=t,s.style.height=r,Obe(s,a)}}function Obe(s,e){const t=s.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const r=getComputedStyle(s),a=r.transform==="none"?"":r.transform;s.style.transform=`${a} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let PP;function _P(s){PP=s}function bO(){if(!PP)throw new Error("Function called outside component initialization");return PP}function H0(s){bO().$$.on_mount.push(s)}function vhe(s){bO().$$.after_update.push(s)}function yhe(s){bO().$$.on_destroy.push(s)}function Ip(){const s=bO();return(e,t,{cancelable:r=!1}={})=>{const a=s.$$.callbacks[e];if(a){const u=mhe(e,t,{cancelable:r});return a.slice().forEach(f=>{f.call(s,u)}),!u.defaultPrevented}return!0}}function Yz(s,e){return bO().$$.context.set(s,e),e}function ji(s){return bO().$$.context.get(s)}function Ez(s,e){const t=s.$$.callbacks[e.type];t&&t.slice().forEach(r=>r.call(this,e))}const PD=[],ss=[];let qD=[];const mne=[],Mbe=Promise.resolve();let gne=!1;function Rbe(){gne||(gne=!0,Mbe.then(whe))}function hk(s){qD.push(s)}function Dr(s){mne.push(s)}const ste=new Set;let TD=0;function whe(){if(TD!==0)return;const s=PP;do{try{for(;TD<PD.length;){const e=PD[TD];TD++,_P(e),Nbe(e.$$)}}catch(e){throw PD.length=0,TD=0,e}for(_P(null),PD.length=0,TD=0;ss.length;)ss.pop()();for(let e=0;e<qD.length;e+=1){const t=qD[e];ste.has(t)||(ste.add(t),t())}qD.length=0}while(PD.length);for(;mne.length;)mne.pop()();gne=!1,ste.clear(),_P(s)}function Nbe(s){if(s.fragment!==null){s.update(),Zi(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(hk)}}function Pbe(s){const e=[],t=[];qD.forEach(r=>s.indexOf(r)===-1?e.push(r):t.push(r)),t.forEach(r=>r()),qD=e}let oP;function Ibe(){return oP||(oP=Promise.resolve(),oP.then(()=>{oP=null})),oP}function rte(s,e,t){s.dispatchEvent(mhe(`${e?"intro":"outro"}${t}`))}const xz=new Set;let E_;function To(){E_={r:0,c:[],p:E_}}function Do(){E_.r||Zi(E_.c),E_=E_.p}function Re(s,e){s&&s.i&&(xz.delete(s),s.i(e))}function Ue(s,e,t,r){if(s&&s.o){if(xz.has(s))return;xz.add(s),E_.c.push(()=>{xz.delete(s),r&&(t&&s.d(1),r())}),s.o(e)}else r&&r()}const Bbe={duration:0};function Xz(s,e,t,r){const a={direction:"both"};let u=e(s,t,a),f=r?0:1,h=null,g=null,y=null;function C(){y&&ghe(s,y)}function A(N,L){const j=N.b-f;return L*=Math.abs(j),{a:f,b:N.b,d:j,duration:L,start:N.start,end:N.start+L,group:N.group}}function O(N){const{delay:L=0,duration:j=300,easing:z=the,tick:q=Sn,css:ee}=u||Bbe,F={start:che()+L,b:N};N||(F.group=E_,E_.r+=1),h||g?g=F:(ee&&(C(),y=hne(s,f,N,j,L,z,ee)),N&&q(0,1),h=A(F,j),hk(()=>rte(s,N,"start")),fhe(ne=>{if(g&&ne>g.start&&(h=A(g,j),g=null,rte(s,h.b,"start"),ee&&(C(),y=hne(s,f,h.b,h.duration,0,z,u.css))),h){if(ne>=h.end)q(f=h.b,1-f),rte(s,h.b,"end"),g||(h.b?C():--h.group.r||Zi(h.group.c)),h=null;else if(ne>=h.start){const oe=ne-h.start;f=h.a+h.d*z(oe/h.duration),q(f,1-f)}}return!!(h||g)}))}return{run(N){B0(u)?Ibe().then(()=>{u=u(a),O(N)}):O(N)},end(){C(),h=g=null}}}function nI(s,e){s.d(1),e.delete(s.key)}function f2(s,e){Ue(s,1,1,()=>{e.delete(s.key)})}function _he(s,e){s.f(),f2(s,e)}function Om(s,e,t,r,a,u,f,h,g,y,C,A){let O=s.length,N=u.length,L=O;const j={};for(;L--;)j[s[L].key]=L;const z=[],q=new Map,ee=new Map,F=[];for(L=N;L--;){const J=A(a,u,L),we=t(J);let ye=f.get(we);ye?r&&F.push(()=>ye.p(J,e)):(ye=y(we,J),ye.c()),q.set(we,z[L]=ye),we in j&&ee.set(we,Math.abs(L-j[we]))}const ne=new Set,oe=new Set;function re(J){Re(J,1),J.m(h,C),f.set(J.key,J),C=J.first,N--}for(;O&&N;){const J=z[N-1],we=s[O-1],ye=J.key,De=we.key;J===we?(C=J.first,O--,N--):q.has(De)?!f.has(ye)||ne.has(ye)?re(J):oe.has(De)?O--:ee.get(ye)>ee.get(De)?(oe.add(ye),re(J)):(ne.add(De),O--):(g(we,f),O--)}for(;O--;){const J=s[O];q.has(J.key)||g(J,f)}for(;N;)re(z[N-1]);return Zi(F),z}function $V(s,e){const t={},r={},a={$$scope:1};let u=s.length;for(;u--;){const f=s[u],h=e[u];if(h){for(const g in f)g in h||(r[g]=1);for(const g in h)a[g]||(t[g]=h[g],a[g]=1);s[u]=h}else for(const g in f)a[g]=1}for(const f in r)f in t||(t[f]=void 0);return t}function zV(s){return typeof s=="object"&&s!==null?s:{}}function Er(s,e,t){const r=s.$$.props[e];r!==void 0&&(s.$$.bound[r]=t,t(s.$$.ctx[r]))}function rn(s){s&&s.c()}function on(s,e,t,r){const{fragment:a,after_update:u}=s.$$;a&&a.m(e,t),r||hk(()=>{const f=s.$$.on_mount.map(nhe).filter(B0);s.$$.on_destroy?s.$$.on_destroy.push(...f):Zi(f),s.$$.on_mount=[]}),u.forEach(hk)}function sn(s,e){const t=s.$$;t.fragment!==null&&(Pbe(t.after_update),Zi(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Lbe(s,e){s.$$.dirty[0]===-1&&(PD.push(s),Rbe(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function So(s,e,t,r,a,u,f,h=[-1]){const g=PP;_P(s);const y=s.$$={fragment:null,ctx:[],props:u,update:Sn,not_equal:a,bound:Sie(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(g?g.$$.context:[])),callbacks:Sie(),dirty:h,skip_bound:!1,root:e.target||g.$$.root};f&&f(y.root);let C=!1;if(y.ctx=t?t(s,e.props||{},(A,O,...N)=>{const L=N.length?N[0]:O;return y.ctx&&a(y.ctx[A],y.ctx[A]=L)&&(!y.skip_bound&&y.bound[A]&&y.bound[A](L),C&&Lbe(s,A)),O}):[],y.update(),C=!0,Zi(y.before_update),y.fragment=r?r(y.ctx):!1,e.target){if(e.hydrate){const A=Ebe(e.target);y.fragment&&y.fragment.l(A),A.forEach(Ie)}else y.fragment&&y.fragment.c();e.intro&&Re(s.$$.fragment),on(s,e.target,e.anchor,e.customElement),whe()}_P(g)}class ko{$destroy(){sn(this,1),this.$destroy=Sn}$on(e,t){if(!B0(t))return Sn;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(t),()=>{const a=r.indexOf(t);a!==-1&&r.splice(a,1)}}$set(e){this.$$set&&!_be(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Aie(s){let e,t;return{c(){e=ce("div"),t=Kt(s[0]),W(e,"class","alert alert-danger"),W(e,"role","alert")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&1&&Gn(t,r[0])},d(r){r&&Ie(e)}}}function Fbe(s){let e,t=s[0]&&Aie(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,[a]){r[0]?t?t.p(r,a):(t=Aie(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Sn,o:Sn,d(r){t&&t.d(r),r&&Ie(e)}}}function Hbe(s,e,t){let{message:r=""}=e;return s.$$set=a=>{"message"in a&&t(0,r=a.message)},[r]}class oI extends ko{constructor(e){super(),So(this,e,Hbe,Fbe,Co,{message:0})}}function $be(s){let e,t,r,a;return{c(){e=ce("button"),t=ce("span"),r=Xe(),a=Kt(s[0]),W(t,"class","spinner-border spinner-border-sm"),W(t,"role","status"),W(t,"aria-hidden","true"),W(e,"type","submit"),W(e,"class","btn btn-primary btn-spinner"),e.disabled=s[1]},m(u,f){Le(u,e,f),Q(e,t),Q(e,r),Q(e,a)},p(u,[f]){f&1&&Gn(a,u[0]),f&2&&(e.disabled=u[1])},i:Sn,o:Sn,d(u){u&&Ie(e)}}}function zbe(s,e,t){let{label:r=""}=e,{disabled:a=!1}=e;return s.$$set=u=>{"label"in u&&t(0,r=u.label),"disabled"in u&&t(1,a=u.disabled)},[r,a]}class sI extends ko{constructor(e){super(),So(this,e,zbe,$be,Co,{label:0,disabled:1})}}function Vbe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee,F;return t=new oI({props:{message:s[2]}}),z=new sI({props:{label:"Register"}}),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),a=ce("form"),u=ce("div"),f=ce("label"),f.textContent="Name",h=Xe(),g=ce("input"),y=Xe(),C=ce("div"),A=ce("label"),A.textContent="Email address",O=Xe(),N=ce("input"),L=Xe(),j=ce("div"),rn(z.$$.fragment),W(f,"for","name"),W(f,"class","form-label"),W(g,"type","text"),W(g,"class","form-control"),W(g,"id","name"),W(u,"class","mb-3"),W(A,"for","email"),W(A,"class","form-label"),W(N,"type","email"),W(N,"class","form-control"),W(N,"id","email"),W(C,"class","mb-3"),W(j,"class","text-center mt-5 d-block"),W(e,"class","wrapper-tiny")},m(ne,oe){Le(ne,e,oe),on(t,e,null),Q(e,r),Q(e,a),Q(a,u),Q(u,f),Q(u,h),Q(u,g),wr(g,s[1]),Q(a,y),Q(a,C),Q(C,A),Q(C,O),Q(C,N),wr(N,s[0]),Q(a,L),Q(a,j),on(z,j,null),q=!0,ee||(F=[Dn(g,"input",s[4]),Dn(N,"input",s[5]),Dn(a,"submit",s[3])],ee=!0)},p(ne,[oe]){const re={};oe&4&&(re.message=ne[2]),t.$set(re),oe&2&&g.value!==ne[1]&&wr(g,ne[1]),oe&1&&N.value!==ne[0]&&wr(N,ne[0])},i(ne){q||(Re(t.$$.fragment,ne),Re(z.$$.fragment,ne),q=!0)},o(ne){Ue(t.$$.fragment,ne),Ue(z.$$.fragment,ne),q=!1},d(ne){ne&&Ie(e),sn(t),sn(z),ee=!1,Zi(F)}}}function Ube(s,e,t){const r=ji("channel");let a="",{email:u=""}=e,f="";function h(C){C.preventDefault(),t(2,f=""),axios.post(r.lucentUrl+"/register",{name:a,email:u}).then(()=>{window.location=r.lucentUrl+"/login"}).catch(A=>{var O;t(2,f=(O=A.response)==null?void 0:O.data.error),console.log({errorMessage:f})})}function g(){a=this.value,t(1,a)}function y(){u=this.value,t(0,u)}return s.$$set=C=>{"email"in C&&t(0,u=C.email)},[u,a,f,h,g,y]}class Wbe extends ko{constructor(e){super(),So(this,e,Ube,Vbe,Co,{email:0})}}function Che(s){const e=s-1;return e*e*e+1}function She(s){return--s*s*s*s*s+1}function Jz(s,{delay:e=0,duration:t=400,easing:r=Che,x:a=0,y:u=0,opacity:f=0}={}){const h=getComputedStyle(s),g=+h.opacity,y=h.transform==="none"?"":h.transform,C=g*(1-f),[A,O]=Eie(a),[N,L]=Eie(u);return{delay:e,duration:t,easing:r,css:(j,z)=>`
transform: ${y} translate(${(1-j)*A}${O}, ${(1-j)*N}${L});
opacity: ${g-C*z}`}}function Tie(s){let e,t,r,a;return{c(){e=ce("div"),t=Kt(s[1]),W(e,"class","lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center svelte-190ow44"),W(e,"role","alert")},m(u,f){Le(u,e,f),Q(e,t),a=!0},p(u,f){(!a||f&2)&&Gn(t,u[1])},i(u){a||(hk(()=>{!a||(r||(r=Xz(e,Jz,{duration:500},!0)),r.run(1))}),a=!0)},o(u){r||(r=Xz(e,Jz,{duration:500},!1)),r.run(0),a=!1},d(u){u&&Ie(e),u&&r&&r.end()}}}function jbe(s){let e,t,r=s[0]&&Tie(s);return{c(){r&&r.c(),e=Rs()},m(a,u){r&&r.m(a,u),Le(a,e,u),t=!0},p(a,[u]){a[0]?r?(r.p(a,u),u&1&&Re(r,1)):(r=Tie(a),r.c(),Re(r,1),r.m(e.parentNode,e)):r&&(To(),Ue(r,1,1,()=>{r=null}),Do())},i(a){t||(Re(r),t=!0)},o(a){Ue(r),t=!1},d(a){r&&r.d(a),a&&Ie(e)}}}function Zbe(s,e,t){let r,a;function u(f="Saved"){t(1,r=f),t(0,a=!0),setTimeout(function(){t(0,a=!1)},2e3)}return t(1,r="Saved"),t(0,a=!1),[a,r,u]}class Toe extends ko{constructor(e){super(),So(this,e,Zbe,jbe,Co,{show:2})}get show(){return this.$$.ctx[2]}}function qbe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j={};return e=new Toe({props:j}),s[3](e),A=new sI({props:{label:"Login"}}),{c(){rn(e.$$.fragment),t=Xe(),r=ce("div"),a=ce("form"),u=ce("div"),f=ce("label"),f.textContent="Email address",h=Xe(),g=ce("input"),y=Xe(),C=ce("div"),rn(A.$$.fragment),W(f,"for","emailaddress"),W(f,"class","form-label"),W(g,"type","email"),W(g,"class","form-control"),W(g,"id","emailaddress"),W(u,"class","mb-3"),W(C,"class","text-center mt-5 d-block"),W(r,"class","wrapper-tiny")},m(z,q){on(e,z,q),Le(z,t,q),Le(z,r,q),Q(r,a),Q(a,u),Q(u,f),Q(u,h),Q(u,g),wr(g,s[0]),Q(a,y),Q(a,C),on(A,C,null),O=!0,N||(L=[Dn(g,"input",s[4]),Dn(a,"submit",s[2])],N=!0)},p(z,[q]){const ee={};e.$set(ee),q&1&&g.value!==z[0]&&wr(g,z[0])},i(z){O||(Re(e.$$.fragment,z),Re(A.$$.fragment,z),O=!0)},o(z){Ue(e.$$.fragment,z),Ue(A.$$.fragment,z),O=!1},d(z){s[3](null),sn(e,z),z&&Ie(t),z&&Ie(r),sn(A),N=!1,Zi(L)}}}function Gbe(s,e,t){const r=ji("channel");let a="",u;function f(y){y.preventDefault(),axios.post(r.lucentUrl+"/login",{email:a}).then(C=>{}).catch(C=>{})}function h(y){ss[y?"unshift":"push"](()=>{u=y,t(1,u)})}function g(){a=this.value,t(0,a)}return[a,u,f,h,g]}class Kbe extends ko{constructor(e){super(),So(this,e,Gbe,qbe,Co,{})}}function Ybe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j={};return e=new Toe({props:j}),s[4](e),A=new sI({props:{label:"Enter"}}),{c(){rn(e.$$.fragment),t=Xe(),r=ce("div"),a=ce("form"),u=ce("div"),f=ce("h3"),h=Kt("Login as "),g=Kt(s[0]),y=Xe(),C=ce("div"),rn(A.$$.fragment),W(u,"class","mb-3 text-center"),W(C,"class","text-center mt-5 d-block"),W(r,"class","wrapper-tiny")},m(z,q){on(e,z,q),Le(z,t,q),Le(z,r,q),Q(r,a),Q(a,u),Q(u,f),Q(f,h),Q(f,g),Q(a,y),Q(a,C),on(A,C,null),O=!0,N||(L=Dn(a,"submit",s[2]),N=!0)},p(z,[q]){const ee={};e.$set(ee),(!O||q&1)&&Gn(g,z[0])},i(z){O||(Re(e.$$.fragment,z),Re(A.$$.fragment,z),O=!0)},o(z){Ue(e.$$.fragment,z),Ue(A.$$.fragment,z),O=!1},d(z){s[4](null),sn(e,z),z&&Ie(t),z&&Ie(r),sn(A),N=!1,L()}}}function Xbe(s,e,t){const r=ji("channel");let{email:a}=e,{token:u}=e,f;function h(y){y.preventDefault(),axios.post(r.lucentUrl+"/verify",{email:a,token:u}).then(C=>{window.location=r.lucentUrl}).catch(C=>{})}function g(y){ss[y?"unshift":"push"](()=>{f=y,t(1,f)})}return s.$$set=y=>{"email"in y&&t(0,a=y.email),"token"in y&&t(3,u=y.token)},[a,f,h,u,g]}class Jbe extends ko{constructor(e){super(),So(this,e,Xbe,Ybe,Co,{email:0,token:3})}}function Qbe(s){let e,t,r;return{c(){e=ce("div"),t=ce("div"),r=Kt(s[2]),W(t,"class","avatar__letters"),W(e,"class","avatar"),W(e,"title",s[0]),os(e,"background-color",s[3][s[4]]),os(e,"height",s[1]+"px"),os(e,"width",s[1]+"px"),os(e,"font-size",s[1]/2+"px")},m(a,u){Le(a,e,u),Q(e,t),Q(t,r)},p(a,[u]){u&4&&Gn(r,a[2]),u&1&&W(e,"title",a[0]),u&2&&os(e,"height",a[1]+"px"),u&2&&os(e,"width",a[1]+"px"),u&2&&os(e,"font-size",a[1]/2+"px")},i:Sn,o:Sn,d(a){a&&Ie(e)}}}function eve(s,e,t){let{name:r}=e,{side:a="48"}=e;const u=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let f="";r.split(" ").length>1?f=r.split(" ")[0].charAt(0).toUpperCase()+r.split(" ")[1].charAt(0).toUpperCase():f=r.split(" ")[0].charAt(0).toUpperCase()+r.split(" ")[0].charAt(1).toUpperCase();let g=(r.charCodeAt(1)+r.length)%19;return s.$$set=y=>{"name"in y&&t(0,r=y.name),"side"in y&&t(1,a=y.side)},[r,a,f,u,g]}class r2 extends ko{constructor(e){super(),So(this,e,eve,Qbe,Co,{name:0,side:1})}}function tve(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee;return t=new oI({props:{message:s[1]}}),u=new r2({props:{name:s[2].name}}),A=new sI({props:{label:"Update"}}),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),a=ce("h3"),rn(u.$$.fragment),f=Xe(),h=ce("form"),g=ce("div"),y=ce("input"),C=Xe(),rn(A.$$.fragment),O=Xe(),N=ce("div"),L=ce("a"),j=Kt("Logout from this device"),W(a,"class","header-small mb-5"),W(y,"type","text"),W(y,"class","form-control"),W(y,"placeholder","Name"),W(g,"class","input-group mb-3"),W(L,"class","list-group-item list-group-item-action"),W(L,"href",s[3].lucentUrl+"/logout"),W(N,"class","list-group"),W(e,"class","wrapper-tiny")},m(F,ne){Le(F,e,ne),on(t,e,null),Q(e,r),Q(e,a),on(u,a,null),Q(e,f),Q(e,h),Q(h,g),Q(g,y),wr(y,s[0]),Q(g,C),on(A,g,null),Q(e,O),Q(e,N),Q(N,L),Q(L,j),z=!0,q||(ee=[Dn(y,"input",s[5]),Dn(h,"submit",s[4])],q=!0)},p(F,[ne]){const oe={};ne&2&&(oe.message=F[1]),t.$set(oe),ne&1&&y.value!==F[0]&&wr(y,F[0])},i(F){z||(Re(t.$$.fragment,F),Re(u.$$.fragment,F),Re(A.$$.fragment,F),z=!0)},o(F){Ue(t.$$.fragment,F),Ue(u.$$.fragment,F),Ue(A.$$.fragment,F),z=!1},d(F){F&&Ie(e),sn(t),sn(u),sn(A),q=!1,Zi(ee)}}}function nve(s,e,t){const r=ji("user"),a=ji("channel");let u=r.name;r.email;let f="";function h(y){y.preventDefault(),t(1,f=""),axios.post("/account/update-name",{name:u}).then(C=>{}).catch(C=>{var A;t(1,f=(A=C.response)==null?void 0:A.data.error),console.log({errorMessage:f})})}function g(){u=this.value,t(0,u)}return[u,f,r,a,h,g]}class ove extends ko{constructor(e){super(),So(this,e,nve,tve,Co,{})}}function sve(s){let e,t,r;const a=[{title:s[0]},s[2]];var u=s[3][s[1]];function f(h){let g={};for(let y=0;y<a.length;y+=1)g=tI(g,a[y]);return{props:g}}return u&&(e=dk(u,f())),{c(){e&&rn(e.$$.fragment),t=Rs()},m(h,g){e&&on(e,h,g),Le(h,t,g),r=!0},p(h,[g]){const y=g&5?$V(a,[g&1&&{title:h[0]},g&4&&zV(h[2])]):{};if(g&2&&u!==(u=h[3][h[1]])){if(e){To();const C=e;Ue(C.$$.fragment,1,0,()=>{sn(C,1)}),Do()}u?(e=dk(u,f()),rn(e.$$.fragment),Re(e.$$.fragment,1),on(e,t.parentNode,t)):e=null}else u&&e.$set(y)},i(h){r||(e&&Re(e.$$.fragment,h),r=!0)},o(h){e&&Ue(e.$$.fragment,h),r=!1},d(h){h&&Ie(t),e&&sn(e,h)}}}function rve(s,e,t){const r={register:Wbe,login:Kbe,verify:Jbe,profile:ove};let{title:a}=e,{view:u}=e,{user:f}=e,{data:h}=e,{channel:g}=e;return Yz("channel",g),Yz("user",f),s.$$set=y=>{"title"in y&&t(0,a=y.title),"view"in y&&t(1,u=y.view),"user"in y&&t(4,f=y.user),"data"in y&&t(2,h=y.data),"channel"in y&&t(5,g=y.channel)},[a,u,h,r,f,g]}class ive extends ko{constructor(e){super(),So(this,e,rve,sve,Co,{title:0,view:1,user:4,data:2,channel:5})}}function Die(s){let e,t;return{c(){e=ce("span"),t=Kt(s[4]),W(e,"class","text-muted")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&16&&Gn(t,r[4])},d(r){r&&Ie(e)}}}function ave(s){let e,t,r=!1,a,u,f,h,g,y,C,A=s[4]&&Die(s);return g=Aoe(s[7][0]),{c(){e=ce("div"),t=ce("input"),a=Xe(),u=ce("label"),f=Kt(s[1]),h=Xe(),A&&A.c(),W(t,"class","form-check-input"),W(t,"type","radio"),t.__value=s[3],t.value=t.__value,W(t,"name",s[2]),W(t,"id",s[5]),W(u,"class","form-check-label"),W(u,"for",s[5]),W(e,"class","form-check"),g.p(t)},m(O,N){Le(O,e,N),Q(e,t),t.checked=t.__value===s[0],Q(e,a),Q(e,u),Q(u,f),Q(e,h),A&&A.m(e,null),y||(C=Dn(t,"change",s[6]),y=!0)},p(O,[N]){N&8&&(t.__value=O[3],t.value=t.__value,r=!0),N&4&&W(t,"name",O[2]),(r||N&1)&&(t.checked=t.__value===O[0]),N&2&&Gn(f,O[1]),O[4]?A?A.p(O,N):(A=Die(O),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},i:Sn,o:Sn,d(O){O&&Ie(e),A&&A.d(),g.r(),y=!1,C()}}}function lve(s,e,t){let{label:r}=e,{name:a}=e,{group:u}=e,{value:f}=e,{help:h}=e,g=Hu.exports.uniqueId();const y=[[]];function C(){u=this.__value,t(0,u)}return s.$$set=A=>{"label"in A&&t(1,r=A.label),"name"in A&&t(2,a=A.name),"group"in A&&t(0,u=A.group),"value"in A&&t(3,f=A.value),"help"in A&&t(4,h=A.help)},[u,r,a,f,h,g,C,y]}class cve extends ko{constructor(e){super(),So(this,e,lve,ave,Co,{label:1,name:2,group:0,value:3,help:4})}}function Oie(s,e,t){const r=s.slice();return r[5]=e[t],r}function Mie(s){let e,t,r=s[5]+"",a,u,f,h;function g(...y){return s[3](s[5],...y)}return{c(){e=ce("button"),t=Kt("Convert to "),a=Kt(r),u=Xe(),W(e,"class","dropdown-item")},m(y,C){Le(y,e,C),Q(e,t),Q(e,a),Q(e,u),f||(h=Dn(e,"click",g),f=!0)},p(y,C){s=y,C&2&&r!==(r=s[5]+"")&&Gn(a,r)},d(y){y&&Ie(e),f=!1,h()}}}function Rie(s){let e,t=s[0].role!==s[5]&&Mie(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,a){r[0].role!==r[5]?t?t.p(r,a):(t=Mie(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(r){t&&t.d(r),r&&Ie(e)}}}function uve(s){var De;let e,t,r,a,u,f,h,g=s[0].name+"",y,C,A=s[0].email+"",O,N,L,j,z,q,ee=s[0].role+"",F,ne,oe,re,J;r=new r2({props:{name:(De=s[0].name)!=null?De:"",side:"32"}});let we=s[1],ye=[];for(let _e=0;_e<we.length;_e+=1)ye[_e]=Rie(Oie(s,we,_e));return{c(){e=ce("div"),t=ce("div"),rn(r.$$.fragment),a=Xe(),u=ce("div"),f=ce("div"),h=ce("span"),y=Kt(g),C=Xe(),O=Kt(A),L=Xe(),j=ce("div"),z=ce("div"),q=ce("button"),F=Kt(ee),ne=Xe(),oe=ce("div");for(let _e=0;_e<ye.length;_e+=1)ye[_e].c();W(h,"class","fs-5"),W(u,"class","ms-3 "),W(t,"class",N="d-flex align-items-center status-"+s[0].role+" svelte-1jo1k1d"),W(q,"class","dropdown-toggle btn btn-light"),W(q,"type","button"),W(q,"data-bs-toggle","dropdown"),W(q,"aria-expanded","false"),W(oe,"class","dropdown-menu"),W(z,"class","dropdown dropdown-center"),W(e,"class","d-flex justify-content-between align-items-center mb-3 ")},m(_e,be){Le(_e,e,be),Q(e,t),on(r,t,null),Q(t,a),Q(t,u),Q(u,f),Q(f,h),Q(h,y),Q(u,C),Q(u,O),Q(e,L),Q(e,j),Q(j,z),Q(z,q),Q(q,F),Q(z,ne),Q(z,oe);for(let tt=0;tt<ye.length;tt+=1)ye[tt]&&ye[tt].m(oe,null);J=!0},p(_e,[be]){var Qe;const tt={};if(be&1&&(tt.name=(Qe=_e[0].name)!=null?Qe:""),r.$set(tt),(!J||be&1)&&g!==(g=_e[0].name+"")&&Gn(y,g),(!J||be&1)&&A!==(A=_e[0].email+"")&&Gn(O,A),(!J||be&1&&N!==(N="d-flex align-items-center status-"+_e[0].role+" svelte-1jo1k1d"))&&W(t,"class",N),(!J||be&1)&&ee!==(ee=_e[0].role+"")&&Gn(F,ee),be&7){we=_e[1];let ft;for(ft=0;ft<we.length;ft+=1){const V=Oie(_e,we,ft);ye[ft]?ye[ft].p(V,be):(ye[ft]=Rie(V),ye[ft].c(),ye[ft].m(oe,null))}for(;ft<ye.length;ft+=1)ye[ft].d(1);ye.length=we.length}},i(_e){J||(Re(r.$$.fragment,_e),hk(()=>{!J||(re||(re=Xz(e,Jz,{duration:200},!0)),re.run(1))}),J=!0)},o(_e){Ue(r.$$.fragment,_e),re||(re=Xz(e,Jz,{duration:200},!1)),re.run(0),J=!1},d(_e){_e&&Ie(e),sn(r),ul(ye,_e),_e&&re&&re.end()}}}function fve(s,e,t){const r=Ip();let{member:a}=e,{roles:u}=e;function f(g,y){g.preventDefault(),r("update",{user:a.id,role:y})}const h=(g,y)=>f(y,g);return s.$$set=g=>{"member"in g&&t(0,a=g.member),"roles"in g&&t(1,u=g.roles)},[a,u,f,h]}class dve extends ko{constructor(e){super(),So(this,e,fve,uve,Co,{member:0,roles:1})}}function Nie(s,e,t){const r=s.slice();return r[16]=e[t],r}function Pie(s,e,t){const r=s.slice();return r[19]=e[t],r}function Iie(s){let e,t,r;function a(f){s[13](f)}let u={value:s[19],name:"role",label:s[19]};return s[4]!==void 0&&(u.group=s[4]),e=new cve({props:u}),ss.push(()=>Er(e,"group",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&2&&(g.value=f[19]),h&2&&(g.label=f[19]),!t&&h&16&&(t=!0,g.group=f[4],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function Bie(s){let e,t;return e=new dve({props:{member:s[16],roles:s[1]}}),e.$on("update",s[9]),e.$on("reinvite",s[14]),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1&&(u.member=r[16]),a&2&&(u.roles=r[1]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function hve(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee,F,ne,oe,re,J,we,ye,De,_e,be,tt,Qe;u=new oI({props:{message:s[5]}});let ft={};h=new Toe({props:ft}),s[10](h);let V=s[1].filter(Lie),mt=[];for(let ct=0;ct<V.length;ct+=1)mt[ct]=Iie(Pie(s,V,ct));const nt=ct=>Ue(mt[ct],1,1,()=>{mt[ct]=null});J=new sI({props:{label:"Invite"}});let Ot=s[0],Tt=[];for(let ct=0;ct<Ot.length;ct+=1)Tt[ct]=Bie(Nie(s,Ot,ct));const He=ct=>Ue(Tt[ct],1,1,()=>{Tt[ct]=null});return{c(){e=ce("div"),t=ce("div"),r=ce("h3"),r.textContent="Invite people",a=Xe(),rn(u.$$.fragment),f=Xe(),rn(h.$$.fragment),g=Xe(),y=ce("form"),C=ce("div"),A=ce("label"),A.textContent="Invitee Name",O=Xe(),N=ce("input"),L=Xe(),j=ce("div"),z=ce("label"),z.textContent="Invitee Email Address",q=Xe(),ee=ce("input"),F=Xe(),ne=ce("div");for(let ct=0;ct<mt.length;ct+=1)mt[ct].c();oe=Xe(),re=ce("div"),rn(J.$$.fragment),we=Xe(),ye=ce("div"),De=ce("h3"),De.textContent="Members",_e=Xe();for(let ct=0;ct<Tt.length;ct+=1)Tt[ct].c();W(r,"class","header-small mb-5"),W(A,"for","inviteeName"),W(A,"class","form-label"),W(N,"type","text"),W(N,"class","form-control"),W(N,"id","inviteeName"),W(N,"placeholder","Member name"),N.required=!0,W(C,"class","mb-3"),W(z,"for","inviteeEmail"),W(z,"class","form-label"),W(ee,"type","email"),W(ee,"class","form-control"),W(ee,"id","inviteeEmail"),W(ee,"placeholder","Member email"),ee.required=!0,W(j,"class","mb-3"),W(ne,"class","me-3"),W(re,"class","mt-5 d-block text-center"),W(t,"class","lx-card mt-5"),W(De,"class","header-small mb-5"),W(ye,"class","lx-card mt-3"),W(e,"class","wrapper-tiny transparent mb-5")},m(ct,dn){Le(ct,e,dn),Q(e,t),Q(t,r),Q(t,a),on(u,t,null),Q(t,f),on(h,t,null),Q(t,g),Q(t,y),Q(y,C),Q(C,A),Q(C,O),Q(C,N),wr(N,s[2]),Q(y,L),Q(y,j),Q(j,z),Q(j,q),Q(j,ee),wr(ee,s[3]),Q(y,F),Q(y,ne);for(let kt=0;kt<mt.length;kt+=1)mt[kt]&&mt[kt].m(ne,null);Q(y,oe),Q(y,re),on(J,re,null),Q(e,we),Q(e,ye),Q(ye,De),Q(ye,_e);for(let kt=0;kt<Tt.length;kt+=1)Tt[kt]&&Tt[kt].m(ye,null);be=!0,tt||(Qe=[Dn(N,"input",s[11]),Dn(ee,"input",s[12]),Dn(y,"submit",s[7])],tt=!0)},p(ct,[dn]){const kt={};dn&32&&(kt.message=ct[5]),u.$set(kt);const xn={};if(h.$set(xn),dn&4&&N.value!==ct[2]&&wr(N,ct[2]),dn&8&&ee.value!==ct[3]&&wr(ee,ct[3]),dn&18){V=ct[1].filter(Lie);let We;for(We=0;We<V.length;We+=1){const xt=Pie(ct,V,We);mt[We]?(mt[We].p(xt,dn),Re(mt[We],1)):(mt[We]=Iie(xt),mt[We].c(),Re(mt[We],1),mt[We].m(ne,null))}for(To(),We=V.length;We<mt.length;We+=1)nt(We);Do()}if(dn&771){Ot=ct[0];let We;for(We=0;We<Ot.length;We+=1){const xt=Nie(ct,Ot,We);Tt[We]?(Tt[We].p(xt,dn),Re(Tt[We],1)):(Tt[We]=Bie(xt),Tt[We].c(),Re(Tt[We],1),Tt[We].m(ye,null))}for(To(),We=Ot.length;We<Tt.length;We+=1)He(We);Do()}},i(ct){if(!be){Re(u.$$.fragment,ct),Re(h.$$.fragment,ct);for(let dn=0;dn<V.length;dn+=1)Re(mt[dn]);Re(J.$$.fragment,ct);for(let dn=0;dn<Ot.length;dn+=1)Re(Tt[dn]);be=!0}},o(ct){Ue(u.$$.fragment,ct),Ue(h.$$.fragment,ct),mt=mt.filter(Boolean);for(let dn=0;dn<mt.length;dn+=1)Ue(mt[dn]);Ue(J.$$.fragment,ct),Tt=Tt.filter(Boolean);for(let dn=0;dn<Tt.length;dn+=1)Ue(Tt[dn]);be=!1},d(ct){ct&&Ie(e),sn(u),s[10](null),sn(h),ul(mt,ct),sn(J),ul(Tt,ct),tt=!1,Zi(Qe)}}}const Lie=s=>s!=="removed";function mve(s,e,t){const r=ji("channel");let{users:a}=e,{roles:u}=e,f,h,g,y="",C;function A(F){F.preventDefault(),O(f,h,g)}function O(F,ne,oe){t(5,y=""),axios.post(r.lucentUrl+"/members/invite",{name:F,email:ne,role:oe}).then(re=>{C.show("User was invited"),t(0,a=[...a,re.data.user]),t(2,f=null),t(3,h=null),t(4,g=null)}).catch(re=>{var J,we,ye;t(5,y=(ye=(we=(J=re.response)==null?void 0:J.data)==null?void 0:we.error)!=null?ye:"")})}function N(F){F.preventDefault(),t(5,y=""),axios.post(r.lucentUrl+"/members/update",{id:F.detail.user,role:F.detail.role}).then(ne=>{C.show("Users updated"),t(0,a=ne.data.users)}).catch(ne=>{var oe,re,J;t(5,y=(J=(re=(oe=ne.response)==null?void 0:oe.data)==null?void 0:re.error)!=null?J:"")})}function L(F){ss[F?"unshift":"push"](()=>{C=F,t(6,C)})}function j(){f=this.value,t(2,f)}function z(){h=this.value,t(3,h)}function q(F){g=F,t(4,g)}const ee=F=>O(F.detail.email,F.detail.role);return s.$$set=F=>{"users"in F&&t(0,a=F.users),"roles"in F&&t(1,u=F.roles)},[a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee]}class gve extends ko{constructor(e){super(),So(this,e,mve,hve,Co,{users:0,roles:1})}}function pve(s){let e;return{c(){e=ce("div"),e.innerHTML='<div class="header-normal">Record Not Found</div>',W(e,"class","wrapper-normal ")},m(t,r){Le(t,e,r)},p:Sn,i:Sn,o:Sn,d(t){t&&Ie(e)}}}class bve extends ko{constructor(e){super(),So(this,e,null,pve,Co,{})}}function vve(s){let e,t=s[5].path+"";return{c(){e=hhe("svg"),W(e,"class","bi svelte-1coky4l"),W(e,"xmlns","http://www.w3.org/2000/svg"),W(e,"width",s[0]),W(e,"height",s[1]),W(e,"viewBox",s[5].viewBox),W(e,"aria-labelledby",s[2]),W(e,"role","presentation"),W(e,"stroke",s[4]),W(e,"fill",s[3])},m(r,a){Le(r,e,a),e.innerHTML=t},p(r,[a]){a&1&&W(e,"width",r[0]),a&2&&W(e,"height",r[1]),a&4&&W(e,"aria-labelledby",r[2]),a&16&&W(e,"stroke",r[4]),a&8&&W(e,"fill",r[3])},i:Sn,o:Sn,d(r){r&&Ie(e)}}}function yve(s,e,t){const r={"trash-can":{path:'<path d="M135.2 17.69C140.6 6.848 151.7 0 163.8 0H284.2C296.3 0 307.4 6.848 312.8 17.69L320 32H416C433.7 32 448 46.33 448 64C448 81.67 433.7 96 416 96H32C14.33 96 0 81.67 0 64C0 46.33 14.33 32 32 32H128L135.2 17.69zM31.1 128H416V448C416 483.3 387.3 512 352 512H95.1C60.65 512 31.1 483.3 31.1 448V128zM111.1 208V432C111.1 440.8 119.2 448 127.1 448C136.8 448 143.1 440.8 143.1 432V208C143.1 199.2 136.8 192 127.1 192C119.2 192 111.1 199.2 111.1 208zM207.1 208V432C207.1 440.8 215.2 448 223.1 448C232.8 448 240 440.8 240 432V208C240 199.2 232.8 192 223.1 192C215.2 192 207.1 199.2 207.1 208zM304 208V432C304 440.8 311.2 448 320 448C328.8 448 336 440.8 336 432V208C336 199.2 328.8 192 320 192C311.2 192 304 199.2 304 208z"/>',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 246.6l-112 112C272.4 364.9 264.2 368 256 368s-16.38-3.125-22.62-9.375l-112-112c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L256 290.8l89.38-89.38c12.5-12.5 32.75-12.5 45.25 0S403.1 234.1 390.6 246.6z"/>',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'<path d="M256 0C114.6 0 0 114.6 0 256c0 141.4 114.6 256 256 256s256-114.6 256-256C512 114.6 397.4 0 256 0zM390.6 310.6c-12.5 12.5-32.75 12.5-45.25 0L256 221.3L166.6 310.6c-12.5 12.5-32.75 12.5-45.25 0s-12.5-32.75 0-45.25l112-112C239.6 147.1 247.8 144 256 144s16.38 3.125 22.62 9.375l112 112C403.1 277.9 403.1 298.1 390.6 310.6z"/>',viewBox:"0 0 512 512"},ellipsis:{path:'<path d="M120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200C94.93 200 120 225.1 120 256zM280 256C280 286.9 254.9 312 224 312C193.1 312 168 286.9 168 256C168 225.1 193.1 200 224 200C254.9 200 280 225.1 280 256zM328 256C328 225.1 353.1 200 384 200C414.9 200 440 225.1 440 256C440 286.9 414.9 312 384 312C353.1 312 328 286.9 328 256z"/>',viewBox:"0 0 448 512"},"ellipsis-vertical":{path:'<path d="M64 360C94.93 360 120 385.1 120 416C120 446.9 94.93 472 64 472C33.07 472 8 446.9 8 416C8 385.1 33.07 360 64 360zM64 200C94.93 200 120 225.1 120 256C120 286.9 94.93 312 64 312C33.07 312 8 286.9 8 256C8 225.1 33.07 200 64 200zM64 152C33.07 152 8 126.9 8 96C8 65.07 33.07 40 64 40C94.93 40 120 65.07 120 96C120 126.9 94.93 152 64 152z"/>',viewBox:"0 0 128 512"},"angles-down":{path:'<path d="M169.4 278.6C175.6 284.9 183.8 288 192 288s16.38-3.125 22.62-9.375l160-160c12.5-12.5 12.5-32.75 0-45.25s-32.75-12.5-45.25 0L192 210.8L54.63 73.38c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25L169.4 278.6zM329.4 265.4L192 402.8L54.63 265.4c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25l160 160C175.6 476.9 183.8 480 192 480s16.38-3.125 22.62-9.375l160-160c12.5-12.5 12.5-32.75 0-45.25S341.9 252.9 329.4 265.4z"/>',viewBox:"0 0 384 512"},"angle-right":{path:'<path d="M64 448c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L178.8 256L41.38 118.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160c12.5 12.5 12.5 32.75 0 45.25l-160 160C80.38 444.9 72.19 448 64 448z"/>',viewBox:"0 0 256 512"},"photo-film":{path:'<path d="M352 432c0 8.836-7.164 16-16 16H176c-8.838 0-16-7.164-16-16L160 128H48C21.49 128 .0003 149.5 .0003 176v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48L512 384h-160L352 432zM104 439c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9V439zM104 335c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9V335zM104 231c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9v-30C56 196 60.03 192 65 192h30c4.969 0 9 4.031 9 9V231zM408 409c0-4.969 4.031-9 9-9h30c4.969 0 9 4.031 9 9v30c0 4.969-4.031 9-9 9h-30c-4.969 0-9-4.031-9-9V409zM591.1 0H239.1C213.5 0 191.1 21.49 191.1 48v256c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48v-256C640 21.49 618.5 0 591.1 0zM303.1 64c17.68 0 32 14.33 32 32s-14.32 32-32 32C286.3 128 271.1 113.7 271.1 96S286.3 64 303.1 64zM574.1 279.6C571.3 284.8 565.9 288 560 288H271.1C265.1 288 260.5 284.6 257.7 279.3C255 273.9 255.5 267.4 259.1 262.6l70-96C332.1 162.4 336.9 160 341.1 160c5.11 0 9.914 2.441 12.93 6.574l22.35 30.66l62.74-94.11C442.1 98.67 447.1 96 453.3 96c5.348 0 10.34 2.672 13.31 7.125l106.7 160C576.6 268 576.9 274.3 574.1 279.6z"/>',viewBox:"0 0 640 512"},file:{path:'<path d="M0 64C0 28.65 28.65 0 64 0H224V128C224 145.7 238.3 160 256 160H384V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V64zM256 128V0L384 128H256z"/>',viewBox:"0 0 384 512"},"circle-info":{path:'<path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 128c17.67 0 32 14.33 32 32c0 17.67-14.33 32-32 32S224 177.7 224 160C224 142.3 238.3 128 256 128zM296 384h-80C202.8 384 192 373.3 192 360s10.75-24 24-24h16v-64H224c-13.25 0-24-10.75-24-24S210.8 224 224 224h32c13.25 0 24 10.75 24 24v88h16c13.25 0 24 10.75 24 24S309.3 384 296 384z"/>',viewBox:"0 0 512 512"},"table-columns":{path:'<path d="M0 96C0 60.65 28.65 32 64 32H448C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96zM64 416H224V160H64V416zM448 160H288V416H448V160z"/>',viewBox:"0 0 512 512"},"arrow-down-a-z":{path:'<path d="M239.6 373.1c11.94-13.05 11.06-33.31-1.969-45.27c-13.55-12.42-33.76-10.52-45.22 1.973L160 366.1V64.03c0-17.7-14.33-32.03-32-32.03S96 46.33 96 64.03v302l-32.4-35.39C51.64 317.7 31.39 316.7 18.38 328.7c-13.03 11.95-13.9 32.22-1.969 45.27l87.1 96.09c12.12 13.26 35.06 13.26 47.19 0L239.6 373.1zM448 416h-50.75l73.38-73.38c9.156-9.156 11.89-22.91 6.938-34.88S460.9 288 447.1 288H319.1C302.3 288 288 302.3 288 320s14.33 32 32 32h50.75l-73.38 73.38c-9.156 9.156-11.89 22.91-6.938 34.88S307.1 480 319.1 480h127.1C465.7 480 480 465.7 480 448S465.7 416 448 416zM492.6 209.3l-79.99-160.1c-10.84-21.81-46.4-21.81-57.24 0L275.4 209.3c-7.906 15.91-1.5 35.24 14.31 43.19c15.87 7.922 35.04 1.477 42.93-14.4l7.154-14.39h88.43l7.154 14.39c6.174 12.43 23.97 23.87 42.93 14.4C494.1 244.6 500.5 225.2 492.6 209.3zM367.8 167.4L384 134.7l16.22 32.63H367.8z"/>',viewBox:"0 0 512 512"},"arrow-up-short-wide":{path:'<path d="M544 416h-223.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H544c17.67 0 32-14.33 32-32S561.7 416 544 416zM320 96h32c17.67 0 31.1-14.33 31.1-32s-14.33-32-31.1-32h-32c-17.67 0-32 14.33-32 32S302.3 96 320 96zM320 224H416c17.67 0 32-14.33 32-32s-14.33-32-32-32h-95.1c-17.67 0-32 14.33-32 32S302.3 224 320 224zM320 352H480c17.67 0 32-14.33 32-32s-14.33-32-32-32h-159.1c-17.67 0-32 14.33-32 32S302.3 352 320 352zM151.6 41.95c-12.12-13.26-35.06-13.26-47.19 0l-87.1 96.09C4.475 151.1 5.35 171.4 18.38 183.3c6.141 5.629 13.89 8.414 21.61 8.414c8.672 0 17.3-3.504 23.61-10.39L96 145.9v302C96 465.7 110.3 480 128 480s32-14.33 32-32.03V145.9L192.4 181.3C204.4 194.3 224.6 195.3 237.6 183.3c13.03-11.95 13.9-32.22 1.969-45.27L151.6 41.95z"/>',viewBox:"0 0 576 512"},"arrow-down-wide-short":{path:'<path d="M416 288h-95.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H416c17.67 0 32-14.33 32-32S433.7 288 416 288zM544 32h-223.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H544c17.67 0 32-14.33 32-32S561.7 32 544 32zM352 416h-32c-17.67 0-32 14.33-32 32s14.33 32 32 32h32c17.67 0 31.1-14.33 31.1-32S369.7 416 352 416zM480 160h-159.1c-17.67 0-32 14.33-32 32s14.33 32 32 32H480c17.67 0 32-14.33 32-32S497.7 160 480 160zM192.4 330.7L160 366.1V64.03C160 46.33 145.7 32 128 32S96 46.33 96 64.03v302L63.6 330.7c-6.312-6.883-14.94-10.38-23.61-10.38c-7.719 0-15.47 2.781-21.61 8.414c-13.03 11.95-13.9 32.22-1.969 45.27l87.1 96.09c12.12 13.26 35.06 13.26 47.19 0l87.1-96.09c11.94-13.05 11.06-33.31-1.969-45.27C224.6 316.8 204.4 317.7 192.4 330.7z"/>',viewBox:"0 0 576 512"},filter:{path:'<path d="M3.853 54.87C10.47 40.9 24.54 32 40 32H472C487.5 32 501.5 40.9 508.1 54.87C514.8 68.84 512.7 85.37 502.1 97.33L320 320.9V448C320 460.1 313.2 471.2 302.3 476.6C291.5 482 278.5 480.9 268.8 473.6L204.8 425.6C196.7 419.6 192 410.1 192 400V320.9L9.042 97.33C-.745 85.37-2.765 68.84 3.854 54.87L3.853 54.87z"/>',viewBox:"0 0 512 512"},calendar:{path:'<path d="M96 32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32zM448 464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192H448V464z"/>',viewBox:"0 0 448 512"},pencil:{path:'<path d="M421.7 220.3L188.5 453.4L154.6 419.5L158.1 416H112C103.2 416 96 408.8 96 400V353.9L92.51 357.4C87.78 362.2 84.31 368 82.42 374.4L59.44 452.6L137.6 429.6C143.1 427.7 149.8 424.2 154.6 419.5L188.5 453.4C178.1 463.8 165.2 471.5 151.1 475.6L30.77 511C22.35 513.5 13.24 511.2 7.03 504.1C.8198 498.8-1.502 489.7 .976 481.2L36.37 360.9C40.53 346.8 48.16 333.9 58.57 323.5L291.7 90.34L421.7 220.3zM492.7 58.75C517.7 83.74 517.7 124.3 492.7 149.3L444.3 197.7L314.3 67.72L362.7 19.32C387.7-5.678 428.3-5.678 453.3 19.32L492.7 58.75z"/>',viewBox:"0 0 512 512"},database:{path:'<path d="M448 80V128C448 172.2 347.7 208 224 208C100.3 208 0 172.2 0 128V80C0 35.82 100.3 0 224 0C347.7 0 448 35.82 448 80zM393.2 214.7C413.1 207.3 433.1 197.8 448 186.1V288C448 332.2 347.7 368 224 368C100.3 368 0 332.2 0 288V186.1C14.93 197.8 34.02 207.3 54.85 214.7C99.66 230.7 159.5 240 224 240C288.5 240 348.3 230.7 393.2 214.7V214.7zM54.85 374.7C99.66 390.7 159.5 400 224 400C288.5 400 348.3 390.7 393.2 374.7C413.1 367.3 433.1 357.8 448 346.1V432C448 476.2 347.7 512 224 512C100.3 512 0 476.2 0 432V346.1C14.93 357.8 34.02 367.3 54.85 374.7z"/>',viewBox:"0 0 448 512"},dice:{path:'<path d="M447.1 224c0-12.56-4.781-25.13-14.35-34.76l-174.9-174.9C249.1 4.786 236.5 0 223.1 0C211.4 0 198.9 4.786 189.2 14.35L14.35 189.2C4.783 198.9-.0011 211.4-.0011 223.1c0 12.56 4.785 25.17 14.35 34.8l174.9 174.9c9.625 9.562 22.19 14.35 34.75 14.35s25.13-4.783 34.75-14.35l174.9-174.9C443.2 249.1 447.1 236.6 447.1 224zM96 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S120 210.8 120 224S109.3 248 96 248zM224 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 376 224 376zM224 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1S248 210.8 248 224S237.3 248 224 248zM224 120c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S237.3 120 224 120zM352 248c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S365.3 248 352 248zM591.1 192l-118.7 0c4.418 10.27 6.604 21.25 6.604 32.23c0 20.7-7.865 41.38-23.63 57.14l-136.2 136.2v46.37C320 490.5 341.5 512 368 512h223.1c26.5 0 47.1-21.5 47.1-47.1V240C639.1 213.5 618.5 192 591.1 192zM479.1 376c-13.25 0-23.1-10.75-23.1-23.1s10.75-23.1 23.1-23.1s23.1 10.75 23.1 23.1S493.2 376 479.1 376z"/>',viewBox:"0 0 640 512"},"triangle-exclamation":{path:'<path d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z"/>',viewBox:"0 0 512 512"},eye:{path:'<path d="M279.6 160.4C282.4 160.1 285.2 160 288 160C341 160 384 202.1 384 256C384 309 341 352 288 352C234.1 352 192 309 192 256C192 253.2 192.1 250.4 192.4 247.6C201.7 252.1 212.5 256 224 256C259.3 256 288 227.3 288 192C288 180.5 284.1 169.7 279.6 160.4zM480.6 112.6C527.4 156 558.7 207.1 573.5 243.7C576.8 251.6 576.8 260.4 573.5 268.3C558.7 304 527.4 355.1 480.6 399.4C433.5 443.2 368.8 480 288 480C207.2 480 142.5 443.2 95.42 399.4C48.62 355.1 17.34 304 2.461 268.3C-.8205 260.4-.8205 251.6 2.461 243.7C17.34 207.1 48.62 156 95.42 112.6C142.5 68.84 207.2 32 288 32C368.8 32 433.5 68.84 480.6 112.6V112.6zM288 112C208.5 112 144 176.5 144 256C144 335.5 208.5 400 288 400C367.5 400 432 335.5 432 256C432 176.5 367.5 112 288 112z"/>',viewBox:"0 0 576 512"},"circle-plus":{path:'<path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 368C269.3 368 280 357.3 280 344V280H344C357.3 280 368 269.3 368 256C368 242.7 357.3 232 344 232H280V168C280 154.7 269.3 144 256 144C242.7 144 232 154.7 232 168V232H168C154.7 232 144 242.7 144 256C144 269.3 154.7 280 168 280H232V344C232 357.3 242.7 368 256 368z"/>',viewBox:"0 0 512 512"},"magnifying-glass":{path:'<path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/>',viewBox:"0 0 512 512"},expand:{path:'<path d="M128 32H32C14.31 32 0 46.31 0 64v96c0 17.69 14.31 32 32 32s32-14.31 32-32V96h64c17.69 0 32-14.31 32-32S145.7 32 128 32zM416 32h-96c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32V64C448 46.31 433.7 32 416 32zM128 416H64v-64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96c0 17.69 14.31 32 32 32h96c17.69 0 32-14.31 32-32S145.7 416 128 416zM416 320c-17.69 0-32 14.31-32 32v64h-64c-17.69 0-32 14.31-32 32s14.31 32 32 32h96c17.69 0 32-14.31 32-32v-96C448 334.3 433.7 320 416 320z"/>',viewBox:"0 0 448 512"},compress:{path:'<path d="M128 320H32c-17.69 0-32 14.31-32 32s14.31 32 32 32h64v64c0 17.69 14.31 32 32 32s32-14.31 32-32v-96C160 334.3 145.7 320 128 320zM416 320h-96c-17.69 0-32 14.31-32 32v96c0 17.69 14.31 32 32 32s32-14.31 32-32v-64h64c17.69 0 32-14.31 32-32S433.7 320 416 320zM320 192h96c17.69 0 32-14.31 32-32s-14.31-32-32-32h-64V64c0-17.69-14.31-32-32-32s-32 14.31-32 32v96C288 177.7 302.3 192 320 192zM128 32C110.3 32 96 46.31 96 64v64H32C14.31 128 0 142.3 0 160s14.31 32 32 32h96c17.69 0 32-14.31 32-32V64C160 46.31 145.7 32 128 32z"/>',viewBox:"0 0 448 512"},check:{path:'<path d="M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z"/>',viewBox:"0 0 448 512"}};let{width:a=16}=e,{height:u=16}=e,{icon:f=""}=e,{fill:h="currentColor"}=e,{stroke:g="currentColor"}=e,y=r[f];return s.$$set=C=>{"width"in C&&t(0,a=C.width),"height"in C&&t(1,u=C.height),"icon"in C&&t(2,f=C.icon),"fill"in C&&t(3,h=C.fill),"stroke"in C&&t(4,g=C.stroke)},[a,u,f,h,g,y]}class wl extends ko{constructor(e){super(),So(this,e,yve,vve,Co,{width:0,height:1,icon:2,fill:3,stroke:4})}}/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/var wve=Object.prototype.toString,vO=Array.isArray||function(e){return wve.call(e)==="[object Array]"};function Doe(s){return typeof s=="function"}function _ve(s){return vO(s)?"array":typeof s}function ite(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Fie(s,e){return s!=null&&typeof s=="object"&&e in s}function Cve(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var Sve=RegExp.prototype.test;function kve(s,e){return Sve.call(s,e)}var Eve=/\S/;function xve(s){return!kve(Eve,s)}var Ave={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Tve(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return Ave[t]})}var Dve=/\s*/,Ove=/\s+/,Hie=/\s*=/,Mve=/\s*\}/,Rve=/#|\^|\/|>|\{|&|=|!/;function Nve(s,e){if(!s)return[];var t=!1,r=[],a=[],u=[],f=!1,h=!1,g="",y=0;function C(){if(f&&!h)for(;u.length;)delete a[u.pop()];else u=[];f=!1,h=!1}var A,O,N;function L(we){if(typeof we=="string"&&(we=we.split(Ove,2)),!vO(we)||we.length!==2)throw new Error("Invalid tags: "+we);A=new RegExp(ite(we[0])+"\\s*"),O=new RegExp("\\s*"+ite(we[1])),N=new RegExp("\\s*"+ite("}"+we[1]))}L(e||Rp.tags);for(var j=new rI(s),z,q,ee,F,ne,oe;!j.eos();){if(z=j.pos,ee=j.scanUntil(A),ee)for(var re=0,J=ee.length;re<J;++re)F=ee.charAt(re),xve(F)?(u.push(a.length),g+=F):(h=!0,t=!0,g+=" "),a.push(["text",F,z,z+1]),z+=1,F===`
`&&(C(),g="",y=0,t=!1);if(!j.scan(A))break;if(f=!0,q=j.scan(Rve)||"name",j.scan(Dve),q==="="?(ee=j.scanUntil(Hie),j.scan(Hie),j.scanUntil(O)):q==="{"?(ee=j.scanUntil(N),j.scan(Mve),j.scanUntil(O),q="&"):ee=j.scanUntil(O),!j.scan(O))throw new Error("Unclosed tag at "+j.pos);if(q==">"?ne=[q,ee,z,j.pos,g,y,t]:ne=[q,ee,z,j.pos],y++,a.push(ne),q==="#"||q==="^")r.push(ne);else if(q==="/"){if(oe=r.pop(),!oe)throw new Error('Unopened section "'+ee+'" at '+z);if(oe[1]!==ee)throw new Error('Unclosed section "'+oe[1]+'" at '+z)}else q==="name"||q==="{"||q==="&"?h=!0:q==="="&&L(ee)}if(C(),oe=r.pop(),oe)throw new Error('Unclosed section "'+oe[1]+'" at '+j.pos);return Ive(Pve(a))}function Pve(s){for(var e=[],t,r,a=0,u=s.length;a<u;++a)t=s[a],t&&(t[0]==="text"&&r&&r[0]==="text"?(r[1]+=t[1],r[3]=t[3]):(e.push(t),r=t));return e}function Ive(s){for(var e=[],t=e,r=[],a,u,f=0,h=s.length;f<h;++f)switch(a=s[f],a[0]){case"#":case"^":t.push(a),r.push(a),t=a[4]=[];break;case"/":u=r.pop(),u[5]=a[2],t=r.length>0?r[r.length-1][4]:e;break;default:t.push(a)}return e}function rI(s){this.string=s,this.tail=s,this.pos=0}rI.prototype.eos=function(){return this.tail===""};rI.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};rI.prototype.scanUntil=function(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=r.length,r};function oO(s,e){this.view=s,this.cache={".":this.view},this.parent=e}oO.prototype.push=function(e){return new oO(e,this)};oO.prototype.lookup=function(e){var t=this.cache,r;if(t.hasOwnProperty(e))r=t[e];else{for(var a=this,u,f,h,g=!1;a;){if(e.indexOf(".")>0)for(u=a.view,f=e.split("."),h=0;u!=null&&h<f.length;)h===f.length-1&&(g=Fie(u,f[h])||Cve(u,f[h])),u=u[f[h++]];else u=a.view[e],g=Fie(a.view,e);if(g){r=u;break}a=a.parent}t[e]=r}return Doe(r)&&(r=r.call(this.view)),r};function Mg(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Mg.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Mg.prototype.parse=function(e,t){var r=this.templateCache,a=e+":"+(t||Rp.tags).join(":"),u=typeof r<"u",f=u?r.get(a):void 0;return f==null&&(f=Nve(e,t),u&&r.set(a,f)),f};Mg.prototype.render=function(e,t,r,a){var u=this.getConfigTags(a),f=this.parse(e,u),h=t instanceof oO?t:new oO(t,void 0);return this.renderTokens(f,h,r,e,a)};Mg.prototype.renderTokens=function(e,t,r,a,u){for(var f="",h,g,y,C=0,A=e.length;C<A;++C)y=void 0,h=e[C],g=h[0],g==="#"?y=this.renderSection(h,t,r,a,u):g==="^"?y=this.renderInverted(h,t,r,a,u):g===">"?y=this.renderPartial(h,t,r,u):g==="&"?y=this.unescapedValue(h,t):g==="name"?y=this.escapedValue(h,t,u):g==="text"&&(y=this.rawValue(h)),y!==void 0&&(f+=y);return f};Mg.prototype.renderSection=function(e,t,r,a,u){var f=this,h="",g=t.lookup(e[1]);function y(O){return f.render(O,t,r,u)}if(!!g){if(vO(g))for(var C=0,A=g.length;C<A;++C)h+=this.renderTokens(e[4],t.push(g[C]),r,a,u);else if(typeof g=="object"||typeof g=="string"||typeof g=="number")h+=this.renderTokens(e[4],t.push(g),r,a,u);else if(Doe(g)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");g=g.call(t.view,a.slice(e[3],e[5]),y),g!=null&&(h+=g)}else h+=this.renderTokens(e[4],t,r,a,u);return h}};Mg.prototype.renderInverted=function(e,t,r,a,u){var f=t.lookup(e[1]);if(!f||vO(f)&&f.length===0)return this.renderTokens(e[4],t,r,a,u)};Mg.prototype.indentPartial=function(e,t,r){for(var a=t.replace(/[^ \t]/g,""),u=e.split(`
`),f=0;f<u.length;f++)u[f].length&&(f>0||!r)&&(u[f]=a+u[f]);return u.join(`
`)};Mg.prototype.renderPartial=function(e,t,r,a){if(!!r){var u=this.getConfigTags(a),f=Doe(r)?r(e[1]):r[e[1]];if(f!=null){var h=e[6],g=e[5],y=e[4],C=f;g==0&&y&&(C=this.indentPartial(f,y,h));var A=this.parse(C,u);return this.renderTokens(A,t,r,C,a)}}};Mg.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};Mg.prototype.escapedValue=function(e,t,r){var a=this.getConfigEscape(r)||Rp.escape,u=t.lookup(e[1]);if(u!=null)return typeof u=="number"&&a===Rp.escape?String(u):a(u)};Mg.prototype.rawValue=function(e){return e[1]};Mg.prototype.getConfigTags=function(e){return vO(e)?e:e&&typeof e=="object"?e.tags:void 0};Mg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!vO(e))return e.escape};var Rp={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(s){IP.templateCache=s},get templateCache(){return IP.templateCache}},IP=new Mg;Rp.clearCache=function(){return IP.clearCache()};Rp.parse=function(e,t){return IP.parse(e,t)};Rp.render=function(e,t,r,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+_ve(e)+'" was given as the first argument for mustache#render(template, view, partials)');return IP.render(e,t,r,a)};Rp.escape=Tve;Rp.Scanner=rI;Rp.Context=oO;Rp.Writer=Mg;function pne(s){return pne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pne(s)}function $0(s,e){if(e.length<s)throw new TypeError(s+" argument"+(s>1?"s":"")+" required, but only "+e.length+" present")}function Hh(s){$0(1,arguments);var e=Object.prototype.toString.call(s);return s instanceof Date||pne(s)==="object"&&e==="[object Date]"?new Date(s.getTime()):typeof s=="number"||e==="[object Number]"?new Date(s):((typeof s=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}var Bve={};function Lve(){return Bve}function $ie(s){var e=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()));return e.setUTCFullYear(s.getFullYear()),s.getTime()-e.getTime()}function Az(s,e){$0(2,arguments);var t=Hh(s),r=Hh(e),a=t.getTime()-r.getTime();return a<0?-1:a>0?1:a}function Fve(s,e){$0(2,arguments);var t=Hh(s),r=Hh(e),a=t.getFullYear()-r.getFullYear(),u=t.getMonth()-r.getMonth();return a*12+u}function Hve(s,e){return $0(2,arguments),Hh(s).getTime()-Hh(e).getTime()}var zie={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},$ve="trunc";function zve(s){return s?zie[s]:zie[$ve]}function Vve(s){$0(1,arguments);var e=Hh(s);return e.setHours(23,59,59,999),e}function Uve(s){$0(1,arguments);var e=Hh(s),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function Wve(s){$0(1,arguments);var e=Hh(s);return Vve(e).getTime()===Uve(e).getTime()}function jve(s,e){$0(2,arguments);var t=Hh(s),r=Hh(e),a=Az(t,r),u=Math.abs(Fve(t,r)),f;if(u<1)f=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*u);var h=Az(t,r)===-a;Wve(Hh(s))&&u===1&&Az(s,r)===1&&(h=!1),f=a*(u-Number(h))}return f===0?0:f}function Zve(s,e,t){$0(2,arguments);var r=Hve(s,e)/1e3;return zve(t==null?void 0:t.roundingMethod)(r)}var qve={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Gve=function(e,t,r){var a,u=qve[e];return typeof u=="string"?a=u:t===1?a=u.one:a=u.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+a:a+" ago":a};const Kve=Gve;function ate(s){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):s.defaultWidth,r=s.formats[t]||s.formats[s.defaultWidth];return r}}var Yve={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Xve={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Jve={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Qve={date:ate({formats:Yve,defaultWidth:"full"}),time:ate({formats:Xve,defaultWidth:"full"}),dateTime:ate({formats:Jve,defaultWidth:"full"})};const eye=Qve;var tye={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nye=function(e,t,r,a){return tye[e]};const oye=nye;function sP(s){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",a;if(r==="formatting"&&s.formattingValues){var u=s.defaultFormattingWidth||s.defaultWidth,f=t!=null&&t.width?String(t.width):u;a=s.formattingValues[f]||s.formattingValues[u]}else{var h=s.defaultWidth,g=t!=null&&t.width?String(t.width):s.defaultWidth;a=s.values[g]||s.values[h]}var y=s.argumentCallback?s.argumentCallback(e):e;return a[y]}}var sye={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rye={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},iye={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},aye={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},lye={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},cye={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},uye=function(e,t){var r=Number(e),a=r%100;if(a>20||a<10)switch(a%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},fye={ordinalNumber:uye,era:sP({values:sye,defaultWidth:"wide"}),quarter:sP({values:rye,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:sP({values:iye,defaultWidth:"wide"}),day:sP({values:aye,defaultWidth:"wide"}),dayPeriod:sP({values:lye,defaultWidth:"wide",formattingValues:cye,defaultFormattingWidth:"wide"})};const dye=fye;function rP(s){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,a=r&&s.matchPatterns[r]||s.matchPatterns[s.defaultMatchWidth],u=e.match(a);if(!u)return null;var f=u[0],h=r&&s.parsePatterns[r]||s.parsePatterns[s.defaultParseWidth],g=Array.isArray(h)?mye(h,function(A){return A.test(f)}):hye(h,function(A){return A.test(f)}),y;y=s.valueCallback?s.valueCallback(g):g,y=t.valueCallback?t.valueCallback(y):y;var C=e.slice(f.length);return{value:y,rest:C}}}function hye(s,e){for(var t in s)if(s.hasOwnProperty(t)&&e(s[t]))return t}function mye(s,e){for(var t=0;t<s.length;t++)if(e(s[t]))return t}function gye(s){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(s.matchPattern);if(!r)return null;var a=r[0],u=e.match(s.parsePattern);if(!u)return null;var f=s.valueCallback?s.valueCallback(u[0]):u[0];f=t.valueCallback?t.valueCallback(f):f;var h=e.slice(a.length);return{value:f,rest:h}}}var pye=/^(\d+)(th|st|nd|rd)?/i,bye=/\d+/i,vye={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},yye={any:[/^b/i,/^(a|c)/i]},wye={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_ye={any:[/1/i,/2/i,/3/i,/4/i]},Cye={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Sye={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},kye={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Eye={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xye={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Aye={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Tye={ordinalNumber:gye({matchPattern:pye,parsePattern:bye,valueCallback:function(e){return parseInt(e,10)}}),era:rP({matchPatterns:vye,defaultMatchWidth:"wide",parsePatterns:yye,defaultParseWidth:"any"}),quarter:rP({matchPatterns:wye,defaultMatchWidth:"wide",parsePatterns:_ye,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:rP({matchPatterns:Cye,defaultMatchWidth:"wide",parsePatterns:Sye,defaultParseWidth:"any"}),day:rP({matchPatterns:kye,defaultMatchWidth:"wide",parsePatterns:Eye,defaultParseWidth:"any"}),dayPeriod:rP({matchPatterns:xye,defaultMatchWidth:"any",parsePatterns:Aye,defaultParseWidth:"any"})};const Dye=Tye;var Oye={code:"en-US",formatDistance:Kve,formatLong:eye,formatRelative:oye,localize:dye,match:Dye,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Mye=Oye;function khe(s,e){if(s==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(s[t]=e[t]);return s}function Rye(s){return khe({},s)}var Vie=1440,Nye=2520,lte=43200,Pye=86400;function Iye(s,e,t){var r,a;$0(2,arguments);var u=Lve(),f=(r=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:u.locale)!==null&&r!==void 0?r:Mye;if(!f.formatDistance)throw new RangeError("locale must contain formatDistance property");var h=Az(s,e);if(isNaN(h))throw new RangeError("Invalid time value");var g=khe(Rye(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:h}),y,C;h>0?(y=Hh(e),C=Hh(s)):(y=Hh(s),C=Hh(e));var A=Zve(C,y),O=($ie(C)-$ie(y))/1e3,N=Math.round((A-O)/60),L;if(N<2)return t!=null&&t.includeSeconds?A<5?f.formatDistance("lessThanXSeconds",5,g):A<10?f.formatDistance("lessThanXSeconds",10,g):A<20?f.formatDistance("lessThanXSeconds",20,g):A<40?f.formatDistance("halfAMinute",0,g):A<60?f.formatDistance("lessThanXMinutes",1,g):f.formatDistance("xMinutes",1,g):N===0?f.formatDistance("lessThanXMinutes",1,g):f.formatDistance("xMinutes",N,g);if(N<45)return f.formatDistance("xMinutes",N,g);if(N<90)return f.formatDistance("aboutXHours",1,g);if(N<Vie){var j=Math.round(N/60);return f.formatDistance("aboutXHours",j,g)}else{if(N<Nye)return f.formatDistance("xDays",1,g);if(N<lte){var z=Math.round(N/Vie);return f.formatDistance("xDays",z,g)}else if(N<Pye)return L=Math.round(N/lte),f.formatDistance("aboutXMonths",L,g)}if(L=jve(C,y),L<12){var q=Math.round(N/lte);return f.formatDistance("xMonths",q,g)}else{var ee=L%12,F=Math.floor(L/12);return ee<3?f.formatDistance("aboutXYears",F,g):ee<9?f.formatDistance("overXYears",F,g):f.formatDistance("almostXYears",F+1,g)}}function Ehe(s,e){return $0(1,arguments),Iye(s,Date.now(),e)}function xhe(s){if($0(1,arguments),typeof s=="string"){var e=s.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);return e?new Date(Date.UTC(+e[1],+e[2]-1,+e[3],+e[4]-(+e[9]||0)*(e[8]=="-"?-1:1),+e[5]-(+e[10]||0)*(e[8]=="-"?-1:1),+e[6],+((e[7]||"0")+"00").substring(0,3))):new Date(NaN)}return Hh(s)}function Jy(s){return Ehe(xhe(s),{addSuffix:!0})}function Ahe(s=""){let e=document.createElement("div");return e.innerHTML=s,e.textContent||e.innerText||""}function Bye(s=10){return Math.random().toString(36).substring(2,s+2)}function dd(s,e,t){let r=s.find(g=>g.name===(e==null?void 0:e.schema));if(!(r!=null&&r.titleTemplate))return Uie(r,e);let a=e.data,f=Rp.parse(r.titleTemplate).filter(g=>g[0]=="name").map(g=>g[1]).filter(g=>{let y=r.fields.find(C=>C.name===g);return(y==null?void 0:y.info.name)==="reference"}).reduce((g,y)=>{let C=t.edges.find(O=>O.source===e.id&&O.field===y),A=t.records.find(O=>O.id===(C==null?void 0:C.target));return g[y]=dd(s,A,t),g},{});a={...a,...f};let h=Rp.render(r.titleTemplate,a);return!h||h===""?Uie(r,e):Ahe(h.slice(0,300))}function Uie(s,e){var t;return(s==null?void 0:s.type)==="files"?e._file.path:Ahe(e==null?void 0:e.data[(t=s.fields.filter(r=>r.info.name==="text")[0])==null?void 0:t.name]).slice(0,300)}function Wie(s){let e,t,r;return{c(){e=ce("a"),t=Kt(s[1]),W(e,"href",r=s[3].lucentUrl+"/records/"+s[0].id),W(e,"class","text-decoration-none rounded py-1 px-2 d-inline-block svelte-nbbgyi"),W(e,"title",s[1]),os(e,"border","2px solid "+(s[2].color?s[2].color:"#999"),1),os(e,"white-space","nowrap")},m(a,u){Le(a,e,u),Q(e,t)},p(a,u){u&2&&Gn(t,a[1]),u&1&&r!==(r=a[3].lucentUrl+"/records/"+a[0].id)&&W(e,"href",r),u&2&&W(e,"title",a[1]),u&4&&os(e,"border","2px solid "+(a[2].color?a[2].color:"#999"),1)},d(a){a&&Ie(e)}}}function Lye(s){var r;let e,t=((r=s[0])==null?void 0:r.data)&&Wie(s);return{c(){t&&t.c(),e=Rs()},m(a,u){t&&t.m(a,u),Le(a,e,u)},p(a,[u]){var f;(f=a[0])!=null&&f.data?t?t.p(a,u):(t=Wie(a),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Sn,o:Sn,d(a){t&&t.d(a),a&&Ie(e)}}}function Fye(s,e,t){let r,a;const u=ji("channel");let{record:f}=e,{graph:h}=e;return s.$$set=g=>{"record"in g&&t(0,f=g.record),"graph"in g&&t(4,h=g.graph)},s.$$.update=()=>{s.$$.dirty&1&&t(2,r=u.schemas.find(g=>g.name===f.schema)),s.$$.dirty&17&&t(1,a=dd(u.schemas,f,h))},[f,a,r,u,h]}class iI extends ko{constructor(e){super(),So(this,e,Fye,Lye,Co,{record:0,graph:4})}}function jie(s,e,t){const r=s.slice();return r[2]=e[t],r[4]=t,r}function Zie(s){let e,t,r=s[0].reverse(),a=[];for(let f=0;f<r.length;f+=1)a[f]=qie(jie(s,r,f));const u=f=>Ue(a[f],1,1,()=>{a[f]=null});return{c(){e=ce("div");for(let f=0;f<a.length;f+=1)a[f].c();W(e,"class","record-history d-flex justify-content-center align-items-center w-100 mb-4 mt-4 svelte-eatzsz")},m(f,h){Le(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,h){if(h&3){r=f[0].reverse();let g;for(g=0;g<r.length;g+=1){const y=jie(f,r,g);a[g]?(a[g].p(y,h),Re(a[g],1)):(a[g]=qie(y),a[g].c(),Re(a[g],1),a[g].m(e,null))}for(To(),g=r.length;g<a.length;g+=1)u(g);Do()}},i(f){if(!t){for(let h=0;h<r.length;h+=1)Re(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)Ue(a[h]);t=!1},d(f){f&&Ie(e),ul(a,f)}}}function Hye(s){let e,t;return e=new wl({props:{icon:"angle-right"}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function qie(s){let e,t,r,a,u,f=s[4]!==0&&Hye();return r=new iI({props:{record:s[2],graph:s[1]}}),{c(){f&&f.c(),e=Xe(),t=ce("div"),rn(r.$$.fragment),a=Xe(),W(t,"class","mx-3 p-0 my-0")},m(h,g){f&&f.m(h,g),Le(h,e,g),Le(h,t,g),on(r,t,null),Q(t,a),u=!0},p(h,g){const y={};g&1&&(y.record=h[2]),g&2&&(y.graph=h[1]),r.$set(y)},i(h){u||(Re(f),Re(r.$$.fragment,h),u=!0)},o(h){Ue(f),Ue(r.$$.fragment,h),u=!1},d(h){f&&f.d(h),h&&Ie(e),h&&Ie(t),sn(r)}}}function $ye(s){let e,t,r=s[0].length>0&&Zie(s);return{c(){r&&r.c(),e=Rs()},m(a,u){r&&r.m(a,u),Le(a,e,u),t=!0},p(a,[u]){a[0].length>0?r?(r.p(a,u),u&1&&Re(r,1)):(r=Zie(a),r.c(),Re(r,1),r.m(e.parentNode,e)):r&&(To(),Ue(r,1,1,()=>{r=null}),Do())},i(a){t||(Re(r),t=!0)},o(a){Ue(r),t=!1},d(a){r&&r.d(a),a&&Ie(e)}}}function zye(s,e,t){let{managerRecords:r}=e,{graph:a}=e;return s.$$set=u=>{"managerRecords"in u&&t(0,r=u.managerRecords),"graph"in u&&t(1,a=u.graph)},[r,a]}class Vye extends ko{constructor(e){super(),So(this,e,zye,$ye,Co,{managerRecords:0,graph:1})}}function Uye(s){let e;return{c(){e=Kt("New Record")},m(t,r){Le(t,e,r)},p:Sn,d(t){t&&Ie(e)}}}function Wye(s){let e=dd(s[5].schemas,s[3],s[2])+"",t;return{c(){t=Kt(e)},m(r,a){Le(r,t,a)},p(r,a){a&12&&e!==(e=dd(r[5].schemas,r[3],r[2])+"")&&Gn(t,e)},d(r){r&&Ie(t)}}}function Gie(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q;r=new wl({props:{icon:"ellipsis"}});let ee=!s[4]&&Kie(s);return{c(){e=ce("div"),t=ce("button"),rn(r.$$.fragment),a=Xe(),u=ce("div"),f=ce("h6"),f.textContent="Record Actions",h=Xe(),g=ce("a"),y=Kt("Create new"),A=Xe(),ee&&ee.c(),O=Xe(),N=ce("a"),L=Kt("Revisions"),W(t,"class","btn btn-link btn-sm"),W(t,"type","button"),W(t,"data-bs-toggle","dropdown"),W(t,"aria-expanded","false"),W(f,"class","dropdown-header"),W(g,"class","dropdown-item"),W(g,"href",C=s[5].lucentUrl+"/records/new?schema="+s[1].name),W(N,"class","dropdown-item"),W(N,"href",s[5].lucentUrl),W(u,"class","dropdown-menu"),W(e,"class","dropdown d-inline-block")},m(F,ne){Le(F,e,ne),Q(e,t),on(r,t,null),Q(e,a),Q(e,u),Q(u,f),Q(u,h),Q(u,g),Q(g,y),Q(u,A),ee&&ee.m(u,null),Q(u,O),Q(u,N),Q(N,L),j=!0,z||(q=Dn(N,"click",$u(s[7])),z=!0)},p(F,ne){(!j||ne&2&&C!==(C=F[5].lucentUrl+"/records/new?schema="+F[1].name))&&W(g,"href",C),F[4]?ee&&(ee.d(1),ee=null):ee?ee.p(F,ne):(ee=Kie(F),ee.c(),ee.m(u,O))},i(F){j||(Re(r.$$.fragment,F),j=!0)},o(F){Ue(r.$$.fragment,F),j=!1},d(F){F&&Ie(e),sn(r),ee&&ee.d(),z=!1,q()}}}function Kie(s){let e,t,r,a;return{c(){e=ce("a"),t=Kt("Clone"),W(e,"class","dropdown-item"),W(e,"href",s[5].lucentUrl)},m(u,f){Le(u,e,f),Q(e,t),r||(a=Dn(e,"click",s[6]),r=!0)},p:Sn,d(u){u&&Ie(e),r=!1,a()}}}function jye(s){let e,t,r=s[1].label.toUpperCase()+"",a,u,f,h,g,y;function C(L,j){return L[4]?Uye:Wye}let A=C(s),O=A(s),N=!s[4]&&Gie(s);return{c(){e=ce("h3"),t=ce("a"),a=Kt(r),f=Xe(),h=ce("span"),O.c(),g=Xe(),N&&N.c(),W(t,"class","text-muted d-block text-decoration-none fs-6 mb-1"),W(t,"href",u=s[5].lucentUrl+"/content/"+s[1].name),W(h,"class","text-dark d-block"),W(e,"class","header-normal mt-5 mb-0")},m(L,j){Le(L,e,j),Q(e,t),Q(t,a),Q(e,f),Q(e,h),O.m(h,null),Q(e,g),N&&N.m(e,null),y=!0},p(L,[j]){(!y||j&2)&&r!==(r=L[1].label.toUpperCase()+"")&&Gn(a,r),(!y||j&2&&u!==(u=L[5].lucentUrl+"/content/"+L[1].name))&&W(t,"href",u),A===(A=C(L))&&O?O.p(L,j):(O.d(1),O=A(L),O&&(O.c(),O.m(h,null))),L[4]?N&&(To(),Ue(N,1,1,()=>{N=null}),Do()):N?(N.p(L,j),j&16&&Re(N,1)):(N=Gie(L),N.c(),Re(N,1),N.m(e,null))},i(L){y||(Re(N),y=!0)},o(L){Ue(N),y=!1},d(L){L&&Ie(e),O.d(),N&&N.d()}}}function Zye(s,e,t){const r=ji("channel");let{schema:a}=e,{graph:u}=e,{record:f}=e,{isCreateMode:h}=e,{activeContentTab:g}=e;function y(A){A.preventDefault(),axios.post(r.lucentUrl+"/records/clone/"+f.id).then(O=>{window.location=r.lucentUrl+"/records/"+O.data.id}).catch(O=>{})}const C=A=>t(0,g="_info");return s.$$set=A=>{"schema"in A&&t(1,a=A.schema),"graph"in A&&t(2,u=A.graph),"record"in A&&t(3,f=A.record),"isCreateMode"in A&&t(4,h=A.isCreateMode),"activeContentTab"in A&&t(0,g=A.activeContentTab)},[g,a,u,f,h,r,y,C]}class qye extends ko{constructor(e){super(),So(this,e,Zye,jye,Co,{schema:1,graph:2,record:3,isCreateMode:4,activeContentTab:0})}}function The(s){return Dhe()[s]}function Dhe(){return{published:{value:"published",text:"Published",bg:"success",color:"white"},trashed:{value:"trashed",text:"Trashed",bg:"danger",color:"white"},draft:{value:"draft",text:"Draft",bg:"warning",color:"dark"}}}function Gye(s){let e,t=s[0].text+"",r;return{c(){e=ce("span"),r=Kt(t),W(e,"class","badge text-bg-"+s[0].bg),os(e,"max-width","84px")},m(a,u){Le(a,e,u),Q(e,r)},p:Sn,i:Sn,o:Sn,d(a){a&&Ie(e)}}}function Kye(s,e,t){let{status:r}=e,a=The(r);return s.$$set=u=>{"status"in u&&t(1,r=u.status)},[a,r]}class VV extends ko{constructor(e){super(),So(this,e,Kye,Gye,Co,{status:1})}}function Yie(s,e,t){const r=s.slice();return r[10]=e[t],r}function Xie(s){let e,t=s[10].text+"",r,a,u,f;function h(...g){return s[9](s[10],...g)}return{c(){e=ce("button"),r=Kt(t),a=Xe(),W(e,"type","button"),W(e,"class","dropdown-item my-2 rounded w-100 bg-"+s[10].bg+" text-"+s[10].color)},m(g,y){Le(g,e,y),Q(e,r),Q(e,a),u||(f=Dn(e,"click",h),u=!0)},p(g,y){s=g},d(g){g&&Ie(e),u=!1,f()}}}function Jie(s){let e,t=s[10].value!==s[0]&&Xie(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,a){r[10].value!==r[0]?t?t.p(r,a):(t=Xie(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(r){t&&t.d(r),r&&Ie(e)}}}function Yye(s){let e,t,r;return{c(){e=ce("a"),t=Kt("Preview"),W(e,"href",r=s[5].previewTargetUrl+"?schema="+s[2].name+"&id="+s[1].id),W(e,"target","_blank"),W(e,"class","btn btn-outline-info ms-3")},m(a,u){Le(a,e,u),Q(e,t)},p(a,u){u&6&&r!==(r=a[5].previewTargetUrl+"?schema="+a[2].name+"&id="+a[1].id)&&W(e,"href",r)},d(a){a&&Ie(e)}}}function Xye(s){let e,t,r,a=s[4].text+"",u,f,h,g,y,C,A,O,N,L,j,z=s[6],q=[];for(let F=0;F<z.length;F+=1)q[F]=Jie(Yie(s,z,F));let ee=s[5].previewTarget&&Yye(s);return{c(){e=ce("div"),t=ce("div"),r=ce("button"),u=Kt(a),h=Xe(),g=ce("button"),y=ce("span"),y.textContent="Toggle Dropdown",A=Xe(),O=ce("div"),N=ce("div"),N.textContent="Change status to",L=Xe();for(let F=0;F<q.length;F+=1)q[F].c();j=Xe(),ee&&ee.c(),W(r,"type","button"),W(r,"class",f="btn btn-"+s[4].bg),W(y,"class","visually-hidden"),W(g,"type","button"),W(g,"class",C="btn btn-"+s[4].bg+" dropdown-toggle dropdown-toggle-split"),W(g,"data-bs-toggle","dropdown"),W(g,"aria-expanded","false"),W(N,"class","dropdown-header"),W(O,"class","dropdown-menu"),W(t,"class","btn-group dropup"),W(e,"class","d-flex justify-content-between")},m(F,ne){Le(F,e,ne),Q(e,t),Q(t,r),Q(r,u),Q(t,h),Q(t,g),Q(g,y),s[8](g),Q(t,A),Q(t,O),Q(O,N),Q(O,L);for(let oe=0;oe<q.length;oe+=1)q[oe]&&q[oe].m(O,null);Q(e,j),ee&&ee.m(e,null)},p(F,[ne]){if(ne&16&&a!==(a=F[4].text+"")&&Gn(u,a),ne&16&&f!==(f="btn btn-"+F[4].bg)&&W(r,"class",f),ne&16&&C!==(C="btn btn-"+F[4].bg+" dropdown-toggle dropdown-toggle-split")&&W(g,"class",C),ne&193){z=F[6];let oe;for(oe=0;oe<z.length;oe+=1){const re=Yie(F,z,oe);q[oe]?q[oe].p(re,ne):(q[oe]=Jie(re),q[oe].c(),q[oe].m(O,null))}for(;oe<q.length;oe+=1)q[oe].d(1);q.length=z.length}F[5].previewTarget&&ee.p(F,ne)},i:Sn,o:Sn,d(F){F&&Ie(e),s[8](null),ul(q,F),ee&&ee.d()}}}function Jye(s,e,t){let r;const a=ji("channel");let{status:u="draft"}=e,{record:f}=e,{schema:h}=e,g;const y=Object.values(Dhe());function C(N,L){t(0,u=L),g.click()}function A(N){ss[N?"unshift":"push"](()=>{g=N,t(3,g)})}const O=(N,L)=>C(L,N.value);return s.$$set=N=>{"status"in N&&t(0,u=N.status),"record"in N&&t(1,f=N.record),"schema"in N&&t(2,h=N.schema)},s.$$.update=()=>{s.$$.dirty&1&&t(4,r=The(u))},[u,f,h,g,r,a,y,C,A,O]}class Ohe extends ko{constructor(e){super(),So(this,e,Jye,Xye,Co,{status:0,record:1,schema:2})}}function Qie(s,e="",t="",r=""){return ji("channel").filesUrl+`/thumbs/${s._file.path}`}function eae(s){return ji("channel").filesUrl+`/${s._file.path}`}function tae(s){let e,t,r,a,u;const f=[e2e,Qye],h=[];function g(y,C){return C&1&&(e=null),e==null&&(e=!!y[0]._file.mime.startsWith("image")),e?0:1}return t=g(s,-1),r=h[t]=f[t](s),{c(){r.c(),a=Rs()},m(y,C){h[t].m(y,C),Le(y,a,C),u=!0},p(y,C){let A=t;t=g(y,C),t===A?h[t].p(y,C):(To(),Ue(h[A],1,1,()=>{h[A]=null}),Do(),r=h[t],r?r.p(y,C):(r=h[t]=f[t](y),r.c()),Re(r,1),r.m(a.parentNode,a))},i(y){u||(Re(r),u=!0)},o(y){Ue(r),u=!1},d(y){h[t].d(y),y&&Ie(a)}}}function Qye(s){let e,t,r,a,u,f=s[0]._file.path.split(".").pop()+"",h,g,y,C;return t=new wl({props:{icon:"file",width:s[3],height:s[3]}}),{c(){e=ce("a"),rn(t.$$.fragment),r=Xe(),a=ce("span"),u=Kt("."),h=Kt(f),W(a,"class","ms-2"),os(a,"font-size",s[4]+"px"),W(e,"href",g=s[5].lucentUrl+"/records/"+s[0].id),W(e,"title",y=s[0]._file.path),W(e,"class","btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center"),os(e,"width",s[2]+"px"),os(e,"height",s[2]+"px")},m(A,O){Le(A,e,O),on(t,e,null),Q(e,r),Q(e,a),Q(a,u),Q(a,h),C=!0},p(A,O){const N={};O&8&&(N.width=A[3]),O&8&&(N.height=A[3]),t.$set(N),(!C||O&1)&&f!==(f=A[0]._file.path.split(".").pop()+"")&&Gn(h,f),(!C||O&16)&&os(a,"font-size",A[4]+"px"),(!C||O&1&&g!==(g=A[5].lucentUrl+"/records/"+A[0].id))&&W(e,"href",g),(!C||O&1&&y!==(y=A[0]._file.path))&&W(e,"title",y),(!C||O&4)&&os(e,"width",A[2]+"px"),(!C||O&4)&&os(e,"height",A[2]+"px")},i(A){C||(Re(t.$$.fragment,A),C=!0)},o(A){Ue(t.$$.fragment,A),C=!1},d(A){A&&Ie(e),sn(t)}}}function e2e(s){let e,t,r,a,u,f;return{c(){e=ce("a"),t=ce("img"),W(t,"class","rounded w-100"),kie(t.src,r=Qie(s[0],s[2],s[2],"crop"))||W(t,"src",r),W(t,"alt",a=s[0]._file.path),W(e,"href",u=s[5].lucentUrl+"/records/"+s[0].id),W(e,"title",f=s[0]._file.path),W(e,"class","d-flex align-items-center justify-content-center "),os(e,"width",s[2]+"px"),os(e,"height",s[2]+"px")},m(h,g){Le(h,e,g),Q(e,t)},p(h,g){g&5&&!kie(t.src,r=Qie(h[0],h[2],h[2],"crop"))&&W(t,"src",r),g&1&&a!==(a=h[0]._file.path)&&W(t,"alt",a),g&1&&u!==(u=h[5].lucentUrl+"/records/"+h[0].id)&&W(e,"href",u),g&1&&f!==(f=h[0]._file.path)&&W(e,"title",f),g&4&&os(e,"width",h[2]+"px"),g&4&&os(e,"height",h[2]+"px")},i:Sn,o:Sn,d(h){h&&Ie(e)}}}function nae(s){let e,t=s[0]._file.path+"",r,a,u;return{c(){e=ce("a"),r=Kt(t),W(e,"href",a=s[5].lucentUrl+"/records/"+s[0].id),W(e,"title",u=s[0]._file.path),W(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(f,h){Le(f,e,h),Q(e,r)},p(f,h){h&1&&t!==(t=f[0]._file.path+"")&&Gn(r,t),h&1&&a!==(a=f[5].lucentUrl+"/records/"+f[0].id)&&W(e,"href",a),h&1&&u!==(u=f[0]._file.path)&&W(e,"title",u)},d(f){f&&Ie(e)}}}function t2e(s){let e,t,r,a=s[0]&&tae(s),u=s[1]&&nae(s);return{c(){a&&a.c(),e=Xe(),u&&u.c(),t=Rs()},m(f,h){a&&a.m(f,h),Le(f,e,h),u&&u.m(f,h),Le(f,t,h),r=!0},p(f,[h]){f[0]?a?(a.p(f,h),h&1&&Re(a,1)):(a=tae(f),a.c(),Re(a,1),a.m(e.parentNode,e)):a&&(To(),Ue(a,1,1,()=>{a=null}),Do()),f[1]?u?u.p(f,h):(u=nae(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},i(f){r||(Re(a),r=!0)},o(f){Ue(a),r=!1},d(f){a&&a.d(f),f&&Ie(e),u&&u.d(f),f&&Ie(t)}}}function n2e(s,e,t){let{record:r}=e;const a=ji("channel");let{size:u="small"}=e,{showFilename:f=!1}=e,h,g,y;return u=="large"?(h=256,g=32,y="20"):u=="medium"?(h=128,g=12,y="17"):u=="small"?(h=64,g=12,y="15"):u=="tiny"&&(h=42,g=12,y="13"),s.$$set=C=>{"record"in C&&t(0,r=C.record),"size"in C&&t(6,u=C.size),"showFilename"in C&&t(1,f=C.showFilename)},[r,f,h,g,y,a,u]}class P_ extends ko{constructor(e){super(),So(this,e,n2e,t2e,Co,{record:0,size:6,showFilename:1})}}function oae(s){let e,t,r,a,u,f,h,g,y,C,A=s[0]._file.path+"",O,N,L,j,z,q,ee=s[0]._file.originalName+"",F,ne,oe,re,J,we,ye=s[0]._file.mime+"",De,_e,be,tt,Qe,ft,V,mt=(s[0]._file.size/1024).toFixed(1)+"",nt,Ot,Tt,He,ct,dn,kt,xn=s[0]._file.checksum+"",We,xt,he,es,ho,ao,xo=s[0]._file.path+"",Yo,Ct,Jt;r=new P_({props:{record:s[0],size:"large"}});let Et=s[0]._file.width&&sae(s);return{c(){e=ce("div"),t=ce("div"),rn(r.$$.fragment),a=Xe(),u=ce("div"),f=ce("ul"),h=ce("li"),g=ce("span"),g.textContent="Filename",y=Xe(),C=ce("span"),O=Kt(A),N=Xe(),L=ce("li"),j=ce("span"),j.textContent="Original name",z=Xe(),q=ce("span"),F=Kt(ee),ne=Xe(),oe=ce("li"),re=ce("span"),re.textContent="Mime type",J=Xe(),we=ce("span"),De=Kt(ye),_e=Xe(),Et&&Et.c(),be=Xe(),tt=ce("li"),Qe=ce("span"),Qe.textContent="File size",ft=Xe(),V=ce("span"),nt=Kt(mt),Ot=Kt("kB"),Tt=Xe(),He=ce("li"),ct=ce("span"),ct.textContent="Checksum",dn=Xe(),kt=ce("span"),We=Kt(xn),xt=Xe(),he=ce("li"),es=ce("span"),es.textContent="Download",ho=Xe(),ao=ce("a"),Yo=Kt(xo),W(t,"class","col"),os(t,"max-width","276px"),W(g,"class","text-muted"),W(h,"class","list-group-item border-primary"),W(j,"class","text-muted"),W(L,"class","list-group-item border-primary"),W(re,"class","text-muted"),W(oe,"class","list-group-item border-primary"),W(Qe,"class","text-muted"),W(tt,"class","list-group-item border-primary"),W(ct,"class","text-muted"),W(He,"class","list-group-item border-primary"),W(es,"class","text-muted"),W(ao,"href",Ct=eae(s[0])),W(he,"class","list-group-item border-primary"),W(f,"class","list-group svelte-1qb90xc"),W(u,"class","col"),W(e,"class","row mb-4")},m(Pe,Ut){Le(Pe,e,Ut),Q(e,t),on(r,t,null),Q(e,a),Q(e,u),Q(u,f),Q(f,h),Q(h,g),Q(h,y),Q(h,C),Q(C,O),Q(f,N),Q(f,L),Q(L,j),Q(L,z),Q(L,q),Q(q,F),Q(f,ne),Q(f,oe),Q(oe,re),Q(oe,J),Q(oe,we),Q(we,De),Q(f,_e),Et&&Et.m(f,null),Q(f,be),Q(f,tt),Q(tt,Qe),Q(tt,ft),Q(tt,V),Q(V,nt),Q(V,Ot),Q(f,Tt),Q(f,He),Q(He,ct),Q(He,dn),Q(He,kt),Q(kt,We),Q(f,xt),Q(f,he),Q(he,es),Q(he,ho),Q(he,ao),Q(ao,Yo),Jt=!0},p(Pe,Ut){const gn={};Ut&1&&(gn.record=Pe[0]),r.$set(gn),(!Jt||Ut&1)&&A!==(A=Pe[0]._file.path+"")&&Gn(O,A),(!Jt||Ut&1)&&ee!==(ee=Pe[0]._file.originalName+"")&&Gn(F,ee),(!Jt||Ut&1)&&ye!==(ye=Pe[0]._file.mime+"")&&Gn(De,ye),Pe[0]._file.width?Et?Et.p(Pe,Ut):(Et=sae(Pe),Et.c(),Et.m(f,be)):Et&&(Et.d(1),Et=null),(!Jt||Ut&1)&&mt!==(mt=(Pe[0]._file.size/1024).toFixed(1)+"")&&Gn(nt,mt),(!Jt||Ut&1)&&xn!==(xn=Pe[0]._file.checksum+"")&&Gn(We,xn),(!Jt||Ut&1)&&xo!==(xo=Pe[0]._file.path+"")&&Gn(Yo,xo),(!Jt||Ut&1&&Ct!==(Ct=eae(Pe[0])))&&W(ao,"href",Ct)},i(Pe){Jt||(Re(r.$$.fragment,Pe),Jt=!0)},o(Pe){Ue(r.$$.fragment,Pe),Jt=!1},d(Pe){Pe&&Ie(e),sn(r),Et&&Et.d()}}}function sae(s){let e,t,r,a,u=s[0]._file.width+"",f,h,g=s[0]._file.height+"",y;return{c(){e=ce("li"),t=ce("span"),t.textContent="Dimensions",r=Xe(),a=ce("span"),f=Kt(u),h=Kt("x"),y=Kt(g),W(t,"class","text-muted"),W(e,"class","list-group-item border-primary")},m(C,A){Le(C,e,A),Q(e,t),Q(e,r),Q(e,a),Q(a,f),Q(a,h),Q(a,y)},p(C,A){A&1&&u!==(u=C[0]._file.width+"")&&Gn(f,u),A&1&&g!==(g=C[0]._file.height+"")&&Gn(y,g)},d(C){C&&Ie(e)}}}function o2e(s){let e,t,r=s[1].type==="files"&&oae(s);return{c(){r&&r.c(),e=Rs()},m(a,u){r&&r.m(a,u),Le(a,e,u),t=!0},p(a,[u]){a[1].type==="files"?r?(r.p(a,u),u&2&&Re(r,1)):(r=oae(a),r.c(),Re(r,1),r.m(e.parentNode,e)):r&&(To(),Ue(r,1,1,()=>{r=null}),Do())},i(a){t||(Re(r),t=!0)},o(a){Ue(r),t=!1},d(a){r&&r.d(a),a&&Ie(e)}}}function s2e(s,e,t){let{record:r}=e,{schema:a}=e;return s.$$set=u=>{"record"in u&&t(0,r=u.record),"schema"in u&&t(1,a=u.schema)},[r,a]}class Mhe extends ko{constructor(e){super(),So(this,e,s2e,o2e,Co,{record:0,schema:1})}}function rae(s,e,t){const r=s.slice();return r[9]=e[t],r}function iae(s){let e,t=s[1],r=[];for(let a=0;a<t.length;a+=1)r[a]=aae(rae(s,t,a));return{c(){e=ce("ul");for(let a=0;a<r.length;a+=1)r[a].c();W(e,"class","nav nav-pills mb-4 justify-content-center")},m(a,u){Le(a,e,u);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(e,null)},p(a,u){if(u&7){t=a[1];let f;for(f=0;f<t.length;f+=1){const h=rae(a,t,f);r[f]?r[f].p(h,u):(r[f]=aae(h),r[f].c(),r[f].m(e,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=t.length}},d(a){a&&Ie(e),ul(r,a)}}}function aae(s){let e,t,r=s[9].label+"",a,u,f,h;function g(...y){return s[5](s[9],...y)}return{c(){e=ce("li"),t=ce("button"),a=Kt(r),u=Xe(),W(t,"class","nav-link"),W(t,"aria-current","page"),_s(t,"active",s[0]===s[9].name),W(e,"class","nav-item")},m(y,C){Le(y,e,C),Q(e,t),Q(t,a),Q(e,u),f||(h=Dn(t,"click",g),f=!0)},p(y,C){s=y,C&2&&r!==(r=s[9].label+"")&&Gn(a,r),C&3&&_s(t,"active",s[0]===s[9].name)},d(y){y&&Ie(e),f=!1,h()}}}function r2e(s){let e,t=s[1].length>1&&iae(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,[a]){r[1].length>1?t?t.p(r,a):(t=iae(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Sn,o:Sn,d(r){t&&t.d(r),r&&Ie(e)}}}function i2e(s,e,t){var O,N;let{schema:r}=e,{isCreateMode:a}=e,{active:u=""}=e,f=(N=(O=r.groups)==null?void 0:O.map(L=>({label:L,name:L})))!=null?N:[],h={label:"Main",name:""},g={label:"Graph",name:"_graph"};a?f=[h,...f]:f=[h,...f,g];function y(L){L.preventDefault(),t(0,u="_graph")}function C(L,j){L.preventDefault(),j=="_graph"?y(L):t(0,u=j)}const A=(L,j)=>C(j,L.name);return s.$$set=L=>{"schema"in L&&t(3,r=L.schema),"isCreateMode"in L&&t(4,a=L.isCreateMode),"active"in L&&t(0,u=L.active)},[u,f,C,r,a,A]}class Rhe extends ko{constructor(e){super(),So(this,e,i2e,r2e,Co,{schema:3,isCreateMode:4,active:0})}}function lae(s,e,t){const r=s.slice();return r[11]=e[t],r}function cae(s){let e=[],t=new Map,r,a=s[3];const u=h=>h[11].id;for(let h=0;h<a.length;h+=1){let g=lae(s,a,h),y=u(g);t.set(y,e[h]=fae(y,g))}let f=null;return a.length||(f=uae(s)),{c(){for(let h=0;h<e.length;h+=1)e[h].c();r=Rs(),f&&f.c()},m(h,g){for(let y=0;y<e.length;y+=1)e[y]&&e[y].m(h,g);Le(h,r,g),f&&f.m(h,g)},p(h,g){g&63&&(a=h[3],e=Om(e,g,u,1,h,a,t,r.parentNode,nI,fae,r,lae),!a.length&&f?f.p(h,g):a.length?f&&(f.d(1),f=null):(f=uae(h),f.c(),f.m(r.parentNode,r)))},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Ie(r),f&&f.d(h)}}}function uae(s){let e;function t(u,f){return u[1]&&u[2].optionsSuggest?l2e:a2e}let r=t(s),a=r(s);return{c(){a.c(),e=Rs()},m(u,f){a.m(u,f),Le(u,e,f)},p(u,f){r===(r=t(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e.parentNode,e)))},d(u){a.d(u),u&&Ie(e)}}}function a2e(s){let e;return{c(){e=Kt("No results")},m(t,r){Le(t,e,r)},p:Sn,d(t){t&&Ie(e)}}}function l2e(s){let e,t,r,a,u,f,h,g;return{c(){e=ce("div"),t=ce("span"),r=Kt('Add "'),a=Kt(s[1]),u=Kt('"'),f=Xe(),W(t,"class","dropdown-item")},m(y,C){Le(y,e,C),Q(e,t),Q(t,r),Q(t,a),Q(t,u),Q(e,f),h||(g=[Dn(e,"click",s[9]),Dn(e,"keypress",s[10])],h=!0)},p(y,C){C&2&&Gn(a,y[1])},d(y){y&&Ie(e),h=!1,Zi(g)}}}function fae(s,e){let t,r,a=dd(e[4].schemas,e[11])+"",u,f,h,g=e[11].data[e[2].optionsField]+"",y,C,A,O;function N(...j){return e[7](e[11],...j)}function L(...j){return e[8](e[11],...j)}return{key:s,first:null,c(){t=ce("div"),r=ce("span"),u=Kt(a),f=Xe(),h=ce("small"),y=Kt(g),C=Xe(),W(h,"class","text-muted "),W(r,"class","dropdown-item"),this.first=t},m(j,z){Le(j,t,z),Q(t,r),Q(r,u),Q(r,f),Q(r,h),Q(h,y),Q(t,C),A||(O=[Dn(t,"click",N),Dn(t,"keypress",L)],A=!0)},p(j,z){e=j,z&8&&a!==(a=dd(e[4].schemas,e[11])+"")&&Gn(u,a),z&12&&g!==(g=e[11].data[e[2].optionsField]+"")&&Gn(y,g)},d(j){j&&Ie(t),A=!1,Zi(O)}}}function c2e(s){let e,t=s[2].optionsFrom&&cae(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,[a]){r[2].optionsFrom?t?t.p(r,a):(t=cae(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Sn,o:Sn,d(r){t&&t.d(r),r&&Ie(e)}}}function u2e(s,e,t){let r;const a=ji("channel");let{field:u}=e,{value:f}=e,{search:h}=e;const g=Hu.exports.debounce(L=>{axios.get("/records/suggestions",{params:{schema:u.optionsFrom,field:u.optionsField,value:h,ui:u.ui}}).then(j=>{t(3,r=j.data)}).catch(j=>{console.log(j)})},500);function y(L,j){L.preventDefault(),t(0,f=j.data[u.optionsField]),t(1,h="")}const C=(L,j)=>y(j,L),A=(L,j)=>y(j,L),O=L=>{t(0,f=h),t(1,h="")},N=L=>{t(0,f=h),t(1,h="")};return s.$$set=L=>{"field"in L&&t(2,u=L.field),"value"in L&&t(0,f=L.value),"search"in L&&t(1,h=L.search)},t(3,r=[]),[f,h,u,r,a,y,g,C,A,O,N]}class UV extends ko{constructor(e){super(),So(this,e,u2e,c2e,Co,{field:2,value:0,search:1,update:6})}get update(){return this.$$.ctx[6]}}function dae(s,e,t){const r=s.slice();return r[11]=e[t][0],r[12]=e[t][1],r}function hae(s,e,t){const r=s.slice();return r[8]=e[t],r}function mae(s){let e,t;function r(f,h){return h&1&&(e=null),e==null&&(e=!!Array.isArray(f[0].selectOptions)),e?d2e:f2e}let a=r(s,-1),u=a(s);return{c(){u.c(),t=Rs()},m(f,h){u.m(f,h),Le(f,t,h)},p(f,h){a===(a=r(f,h))&&u?u.p(f,h):(u.d(1),u=a(f),u&&(u.c(),u.m(t.parentNode,t)))},d(f){u.d(f),f&&Ie(t)}}}function f2e(s){let e=[],t=new Map,r,a=Object.entries(s[0].selectOptions);const u=f=>f[11];for(let f=0;f<a.length;f+=1){let h=dae(s,a,f),g=u(h);t.set(g,e[f]=gae(g,h))}return{c(){for(let f=0;f<e.length;f+=1)e[f].c();r=Rs()},m(f,h){for(let g=0;g<e.length;g+=1)e[g]&&e[g].m(f,h);Le(f,r,h)},p(f,h){h&3&&(a=Object.entries(f[0].selectOptions),e=Om(e,h,u,1,f,a,t,r.parentNode,nI,gae,r,dae))},d(f){for(let h=0;h<e.length;h+=1)e[h].d(f);f&&Ie(r)}}}function d2e(s){let e=[],t=new Map,r,a=s[0].selectOptions;const u=f=>f[8];for(let f=0;f<a.length;f+=1){let h=hae(s,a,f),g=u(h);t.set(g,e[f]=pae(g,h))}return{c(){for(let f=0;f<e.length;f+=1)e[f].c();r=Rs()},m(f,h){for(let g=0;g<e.length;g+=1)e[g]&&e[g].m(f,h);Le(f,r,h)},p(f,h){h&3&&(a=f[0].selectOptions,e=Om(e,h,u,1,f,a,t,r.parentNode,nI,pae,r,hae))},d(f){for(let h=0;h<e.length;h+=1)e[h].d(f);f&&Ie(r)}}}function gae(s,e){let t,r,a=e[12]+"",u,f,h,g;function y(...A){return e[6](e[11],...A)}function C(...A){return e[7](e[11],...A)}return{key:s,first:null,c(){t=ce("div"),r=ce("span"),u=Kt(a),f=Xe(),W(r,"class","dropdown-item"),this.first=t},m(A,O){Le(A,t,O),Q(t,r),Q(r,u),Q(t,f),h||(g=[Dn(t,"click",y),Dn(t,"keypress",C)],h=!0)},p(A,O){e=A,O&1&&a!==(a=e[12]+"")&&Gn(u,a)},d(A){A&&Ie(t),h=!1,Zi(g)}}}function pae(s,e){let t,r,a=e[8]+"",u,f,h,g;function y(...A){return e[4](e[8],...A)}function C(...A){return e[5](e[8],...A)}return{key:s,first:null,c(){t=ce("div"),r=ce("span"),u=Kt(a),f=Xe(),W(r,"class","dropdown-item"),this.first=t},m(A,O){Le(A,t,O),Q(t,r),Q(r,u),Q(t,f),h||(g=[Dn(t,"click",y),Dn(t,"keypress",C)],h=!0)},p(A,O){e=A,O&1&&a!==(a=e[8]+"")&&Gn(u,a)},d(A){A&&Ie(t),h=!1,Zi(g)}}}function h2e(s){let e,t=s[0].selectOptions&&mae(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,[a]){r[0].selectOptions?t?t.p(r,a):(t=mae(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Sn,o:Sn,d(r){t&&t.d(r),r&&Ie(e)}}}function m2e(s,e,t){let{field:r}=e,{value:a}=e,{search:u}=e;function f(A,O){A.preventDefault(),t(2,a=O),t(3,u="")}const h=(A,O)=>f(O,A),g=(A,O)=>f(O,A),y=(A,O)=>f(O,A),C=(A,O)=>f(O,A);return s.$$set=A=>{"field"in A&&t(0,r=A.field),"value"in A&&t(2,a=A.value),"search"in A&&t(3,u=A.search)},[r,f,a,u,h,g,y,C]}class g2e extends ko{constructor(e){super(),So(this,e,m2e,h2e,Co,{field:0,value:2,search:3})}}function Rg(s,e){return s&&s[e]?s[e].message:null}function p2e(s){let e,t,r,a;return{c(){e=ce("input"),W(e,"type","text"),W(e,"id",s[3]),W(e,"class","form-control"),W(e,"autocomplete","off"),e.readOnly=t=s[1].readonly&&!s[2],_s(e,"is-invalid",s[7])},m(u,f){Le(u,e,f),wr(e,s[0]),r||(a=Dn(e,"input",s[18]),r=!0)},p(u,f){f&8&&W(e,"id",u[3]),f&6&&t!==(t=u[1].readonly&&!u[2])&&(e.readOnly=t),f&1&&e.value!==u[0]&&wr(e,u[0]),f&128&&_s(e,"is-invalid",u[7])},i:Sn,o:Sn,d(u){u&&Ie(e),r=!1,a()}}}function b2e(s){let e,t,r,a,u,f,h,g,y,C,A,O,N;function L(ee){s[15](ee)}function j(ee){s[16](ee)}let z={field:s[1]};s[0]!==void 0&&(z.value=s[0]),s[6]!==void 0&&(z.search=s[6]),f=new g2e({props:z}),ss.push(()=>Er(f,"value",L)),ss.push(()=>Er(f,"search",j));let q=s[0]&&bae(s);return{c(){e=ce("div"),t=ce("input"),a=Xe(),u=ce("div"),rn(f.$$.fragment),y=Xe(),q&&q.c(),C=Rs(),W(t,"type","search"),W(t,"id",s[3]),W(t,"class","form-control dropdown-toggle"),W(t,"placeholder","Search for options"),W(t,"data-bs-toggle","dropdown"),W(t,"autocomplete","off"),t.readOnly=r=s[1].readonly&&!s[2],_s(t,"is-invalid",s[7]),W(u,"class","dropdown-menu w-100"),W(e,"class","dropdown")},m(ee,F){Le(ee,e,F),Q(e,t),wr(t,s[6]),Q(e,a),Q(e,u),on(f,u,null),Le(ee,y,F),q&&q.m(ee,F),Le(ee,C,F),A=!0,O||(N=Dn(t,"input",s[14]),O=!0)},p(ee,F){(!A||F&8)&&W(t,"id",ee[3]),(!A||F&6&&r!==(r=ee[1].readonly&&!ee[2]))&&(t.readOnly=r),F&64&&t.value!==ee[6]&&wr(t,ee[6]),(!A||F&128)&&_s(t,"is-invalid",ee[7]);const ne={};F&2&&(ne.field=ee[1]),!h&&F&1&&(h=!0,ne.value=ee[0],Dr(()=>h=!1)),!g&&F&64&&(g=!0,ne.search=ee[6],Dr(()=>g=!1)),f.$set(ne),ee[0]?q?q.p(ee,F):(q=bae(ee),q.c(),q.m(C.parentNode,C)):q&&(q.d(1),q=null)},i(ee){A||(Re(f.$$.fragment,ee),A=!0)},o(ee){Ue(f.$$.fragment,ee),A=!1},d(ee){ee&&Ie(e),sn(f),ee&&Ie(y),q&&q.d(ee),ee&&Ie(C),O=!1,N()}}}function v2e(s){let e,t,r,a,u,f,h,g,y,C,A=s[1].optionsFrom&&vae(s),O=s[0]&&yae(s);return{c(){e=ce("div"),t=ce("input"),a=Xe(),u=ce("div"),A&&A.c(),f=Xe(),O&&O.c(),h=Rs(),W(t,"type","search"),W(t,"id",s[3]),W(t,"class","form-control dropdown-toggle"),W(t,"placeholder","Search for options"),W(t,"data-bs-toggle","dropdown"),W(t,"autocomplete","off"),t.readOnly=r=s[1].readonly&&!s[2],_s(t,"is-invalid",s[7]),W(u,"class","dropdown-menu w-100"),W(e,"class","dropdown")},m(N,L){Le(N,e,L),Q(e,t),wr(t,s[6]),Q(e,a),Q(e,u),A&&A.m(u,null),Le(N,f,L),O&&O.m(N,L),Le(N,h,L),g=!0,y||(C=[Dn(t,"keyup",function(){B0(s[4].update)&&s[4].update.apply(this,arguments)}),Dn(t,"focus",function(){B0(s[4].update)&&s[4].update.apply(this,arguments)}),Dn(t,"input",s[9])],y=!0)},p(N,L){s=N,(!g||L&8)&&W(t,"id",s[3]),(!g||L&6&&r!==(r=s[1].readonly&&!s[2]))&&(t.readOnly=r),L&64&&t.value!==s[6]&&wr(t,s[6]),(!g||L&128)&&_s(t,"is-invalid",s[7]),s[1].optionsFrom?A?(A.p(s,L),L&2&&Re(A,1)):(A=vae(s),A.c(),Re(A,1),A.m(u,null)):A&&(To(),Ue(A,1,1,()=>{A=null}),Do()),s[0]?O?O.p(s,L):(O=yae(s),O.c(),O.m(h.parentNode,h)):O&&(O.d(1),O=null)},i(N){g||(Re(A),g=!0)},o(N){Ue(A),g=!1},d(N){N&&Ie(e),A&&A.d(),N&&Ie(f),O&&O.d(N),N&&Ie(h),y=!1,Zi(C)}}}function bae(s){let e,t,r,a,u,f,h;function g(A,O){return O&2&&(r=null),r==null&&(r=!!Array.isArray(A[1].selectOptions)),r?w2e:y2e}let y=g(s,-1),C=y(s);return{c(){e=ce("span"),t=ce("div"),C.c(),a=Xe(),u=ce("button"),W(u,"type","button"),W(u,"class","btn-close btn-sm ms-1"),os(u,"font-size","10px"),W(u,"aria-label","Close"),W(t,"class","d-flex align-items-center "),W(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(A,O){Le(A,e,O),Q(e,t),C.m(t,null),Q(t,a),Q(t,u),f||(h=Dn(u,"click",$u(s[17])),f=!0)},p(A,O){y===(y=g(A,O))&&C?C.p(A,O):(C.d(1),C=y(A),C&&(C.c(),C.m(t,a)))},d(A){A&&Ie(e),C.d(),f=!1,h()}}}function y2e(s){let e=s[1].selectOptions[s[0]]+"",t;return{c(){t=Kt(e)},m(r,a){Le(r,t,a)},p(r,a){a&3&&e!==(e=r[1].selectOptions[r[0]]+"")&&Gn(t,e)},d(r){r&&Ie(t)}}}function w2e(s){let e;return{c(){e=Kt(s[0])},m(t,r){Le(t,e,r)},p(t,r){r&1&&Gn(e,t[0])},d(t){t&&Ie(e)}}}function vae(s){let e,t,r,a;function u(g){s[11](g)}function f(g){s[12](g)}let h={field:s[1]};return s[0]!==void 0&&(h.value=s[0]),s[6]!==void 0&&(h.search=s[6]),e=new UV({props:h}),s[10](e),ss.push(()=>Er(e,"value",u)),ss.push(()=>Er(e,"search",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&2&&(C.field=g[1]),!t&&y&1&&(t=!0,C.value=g[0],Dr(()=>t=!1)),!r&&y&64&&(r=!0,C.search=g[6],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){s[10](null),sn(e,g)}}}function yae(s){let e,t,r,a,u,f,h;return{c(){e=ce("span"),t=ce("div"),r=Kt(s[0]),a=Xe(),u=ce("button"),W(u,"type","button"),W(u,"class","btn-close btn-sm ms-1"),os(u,"font-size","10px"),W(u,"aria-label","Close"),W(t,"class","d-flex align-items-center "),W(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,y){Le(g,e,y),Q(e,t),Q(t,r),Q(t,a),Q(t,u),f||(h=Dn(u,"click",$u(s[13])),f=!0)},p(g,y){y&1&&Gn(r,g[0])},d(g){g&&Ie(e),f=!1,h()}}}function wae(s){let e,t;return{c(){e=ce("div"),t=Kt(s[7]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&128&&Gn(t,r[7])},d(r){r&&Ie(e)}}}function _2e(s){let e,t,r,a,u;const f=[v2e,b2e,p2e],h=[];function g(C,A){return C[5]?0:C[1].selectOptions?1:2}t=g(s),r=h[t]=f[t](s);let y=s[7]&&wae(s);return{c(){e=ce("div"),r.c(),a=Xe(),y&&y.c(),W(e,"class","mb-0")},m(C,A){Le(C,e,A),h[t].m(e,null),Q(e,a),y&&y.m(e,null),u=!0},p(C,[A]){let O=t;t=g(C),t===O?h[t].p(C,A):(To(),Ue(h[O],1,1,()=>{h[O]=null}),Do(),r=h[t],r?r.p(C,A):(r=h[t]=f[t](C),r.c()),Re(r,1),r.m(e,a)),C[7]?y?y.p(C,A):(y=wae(C),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i(C){u||(Re(r),u=!0)},o(C){Ue(r),u=!1},d(C){C&&Ie(e),h[t].d(),y&&y.d()}}}function C2e(s,e,t){let r,a,u,{field:f}=e,{value:h}=e,{isCreateMode:g}=e,{validationErrors:y}=e,{id:C}=e,A;function O(){a=this.value,t(6,a)}function N(re){ss[re?"unshift":"push"](()=>{A=re,t(4,A)})}function L(re){h=re,t(0,h)}function j(re){a=re,t(6,a)}const z=re=>t(0,h="");function q(){a=this.value,t(6,a)}function ee(re){h=re,t(0,h)}function F(re){a=re,t(6,a)}const ne=re=>t(0,h="");function oe(){h=this.value,t(0,h)}return s.$$set=re=>{"field"in re&&t(1,f=re.field),"value"in re&&t(0,h=re.value),"isCreateMode"in re&&t(2,g=re.isCreateMode),"validationErrors"in re&&t(8,y=re.validationErrors),"id"in re&&t(3,C=re.id)},s.$$.update=()=>{s.$$.dirty&258&&t(7,r=Rg(y,f.name)),s.$$.dirty&6&&t(5,u=f.optionsFrom&&!(f.readonly&&!g))},t(6,a=""),[h,f,g,C,A,u,a,r,y,O,N,L,j,z,q,ee,F,ne,oe]}class Nhe extends ko{constructor(e){super(),So(this,e,C2e,_2e,Co,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function _ae(s){let e,t;return{c(){e=ce("div"),t=Kt(s[4]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&16&&Gn(t,r[4])},d(r){r&&Ie(e)}}}function S2e(s){let e,t,r,a,u,f,h=s[4]&&_ae(s);return{c(){e=ce("div"),t=ce("input"),a=Xe(),h&&h.c(),W(t,"type","text"),W(t,"id",s[3]),W(t,"class","form-control"),W(t,"autocomplete","off"),t.readOnly=r=s[1].readonly&&!s[2],_s(t,"is-invalid",s[4]),W(e,"class","mb-0")},m(g,y){Le(g,e,y),Q(e,t),wr(t,s[0]),Q(e,a),h&&h.m(e,null),u||(f=Dn(t,"input",s[6]),u=!0)},p(g,[y]){y&8&&W(t,"id",g[3]),y&6&&r!==(r=g[1].readonly&&!g[2])&&(t.readOnly=r),y&1&&t.value!==g[0]&&wr(t,g[0]),y&16&&_s(t,"is-invalid",g[4]),g[4]?h?h.p(g,y):(h=_ae(g),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i:Sn,o:Sn,d(g){g&&Ie(e),h&&h.d(),u=!1,f()}}}function k2e(s,e,t){let r,{field:a}=e,{value:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e,{id:g}=e;function y(){u=this.value,t(0,u)}return s.$$set=C=>{"field"in C&&t(1,a=C.field),"value"in C&&t(0,u=C.value),"isCreateMode"in C&&t(2,f=C.isCreateMode),"validationErrors"in C&&t(5,h=C.validationErrors),"id"in C&&t(3,g=C.id)},s.$$.update=()=>{s.$$.dirty&34&&t(4,r=Rg(h,a.name))},[u,a,f,g,r,h,y]}class Phe extends ko{constructor(e){super(),So(this,e,k2e,S2e,Co,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function Ooe(s,e,t,r,a=""){let u=t.map(h=>({target:h.id,source:e.id,sourceSchema:e.schema,targetSchema:h.schema,field:r,rank:""})),f=s.edges;return a==="replace"&&(f=f.filter(h=>h.field!==field.name)),s.records=Hu.exports.uniqBy([...s.records,...t],h=>h.id),s.edges=Hu.exports.uniqBy([...f,...u],h=>h.source+h.target+h.field),s}function E2e(s){let e,t,r;return t=new P_({props:{record:s[0],size:"small"}}),{c(){e=ce("div"),rn(t.$$.fragment),os(e,"max-width","94px"),os(e,"margin-right","15px")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},p(a,u){const f={};u&1&&(f.record=a[0]),t.$set(f)},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function Cae(s){let e,t;return e=new VV({props:{status:s[0].status}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1&&(u.status=r[0].status),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function Sae(s){let e,t,r,a,u,f;return r=new wl({props:{icon:"trash-can"}}),{c(){e=ce("div"),t=ce("button"),rn(r.$$.fragment),W(t,"class","trash-button text-dark btn btn-sm btn-link svelte-dof9cm"),W(e,"class","position-absolute end-0"),os(e,"top","5px")},m(h,g){Le(h,e,g),Q(e,t),on(r,t,null),a=!0,u||(f=Dn(t,"click",s[6]),u=!0)},p:Sn,i(h){a||(Re(r.$$.fragment,h),a=!0)},o(h){Ue(r.$$.fragment,h),a=!1},d(h){h&&Ie(e),sn(r),u=!1,f()}}}function x2e(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j=s[4].type==="files"&&E2e(s),z=s[0].status==="draft"&&Cae(s),q=s[2]&&Sae(s);return{c(){var ee;e=ce("div"),t=ce("div"),j&&j.c(),r=Xe(),a=ce("div"),u=ce("a"),f=Kt(s[5]),g=Xe(),y=ce("small"),y.textContent=`${s[4].label}`,C=Xe(),A=ce("small"),z&&z.c(),O=Xe(),q&&q.c(),W(u,"class","title-link m-0 fs-5 text-decoration-none text-dark d-block svelte-dof9cm"),W(u,"href",h=s[3].lucentUrl+"/records/"+s[0].id),W(u,"title",s[5]),W(y,"class","text-muted"),W(A,"class","text-muted"),W(a,"class","overflow-hidden"),W(t,"class","card-body d-flex"),W(e,"class",N="card mb-2 bg-light "+s[1]+" svelte-dof9cm"),os(e,"border-color",(ee=s[4].color)!=null?ee:"#ccc"),os(e,"border-width","1px")},m(ee,F){Le(ee,e,F),Q(e,t),j&&j.m(t,null),Q(t,r),Q(t,a),Q(a,u),Q(u,f),Q(a,g),Q(a,y),Q(a,C),Q(a,A),z&&z.m(A,null),Q(e,O),q&&q.m(e,null),L=!0},p(ee,[F]){ee[4].type==="files"&&j.p(ee,F),(!L||F&1&&h!==(h=ee[3].lucentUrl+"/records/"+ee[0].id))&&W(u,"href",h),ee[0].status==="draft"?z?(z.p(ee,F),F&1&&Re(z,1)):(z=Cae(ee),z.c(),Re(z,1),z.m(A,null)):z&&(To(),Ue(z,1,1,()=>{z=null}),Do()),ee[2]?q?(q.p(ee,F),F&4&&Re(q,1)):(q=Sae(ee),q.c(),Re(q,1),q.m(e,null)):q&&(To(),Ue(q,1,1,()=>{q=null}),Do()),(!L||F&2&&N!==(N="card mb-2 bg-light "+ee[1]+" svelte-dof9cm"))&&W(e,"class",N)},i(ee){L||(Re(j),Re(z),Re(q),L=!0)},o(ee){Ue(j),Ue(z),Ue(q),L=!1},d(ee){ee&&Ie(e),j&&j.d(),z&&z.d(),q&&q.d()}}}function A2e(s,e,t){const r=Ip(),a=ji("channel");let{graph:u}=e,{record:f}=e,{classes:h=""}=e,{hasDelete:g=!1}=e,y=a.schemas.find(O=>O.name===f.schema),C=dd(a.schemas,f,u);function A(O){O.preventDefault(),r("remove",f.id)}return s.$$set=O=>{"graph"in O&&t(7,u=O.graph),"record"in O&&t(0,f=O.record),"classes"in O&&t(1,h=O.classes),"hasDelete"in O&&t(2,g=O.hasDelete)},[f,h,g,a,y,C,A,u]}class WV extends ko{constructor(e){super(),So(this,e,A2e,x2e,Co,{graph:7,record:0,classes:1,hasDelete:2})}}function aI(s,e,t,r){var h,g;if(console.log(s),console.log(e),s===e)return t;let a=(h=t==null?void 0:t.filter(y=>y.field===r))!=null?h:[],u=(g=t==null?void 0:t.filter(y=>y.field!==r))!=null?g:[],f=a.splice(s,1)[0];return a.splice(e,0,f),[...u,...a]}function kae(s,e,t){const r=s.slice();return r[23]=e[t],r}function Eae(s){let e,t,r,a;function u(g){s[13](g)}function f(g){s[14](g)}let h={field:s[23],schema:s[2],record:s[0],validationErrors:s[4],isCreateMode:s[3]};return s[0].data!==void 0&&(h.data=s[0].data),s[1]!==void 0&&(h.graph=s[1]),e=new u1e({props:h}),ss.push(()=>Er(e,"data",u)),ss.push(()=>Er(e,"graph",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&4&&(C.schema=g[2]),y&1&&(C.record=g[0]),y&16&&(C.validationErrors=g[4]),y&8&&(C.isCreateMode=g[3]),!t&&y&1&&(t=!0,C.data=g[0].data,Dr(()=>t=!1)),!r&&y&2&&(r=!0,C.graph=g[1],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){sn(e,g)}}}function xae(s,e){let t,r,a,u=e[5]===e[23].group&&Eae(e);return{key:s,first:null,c(){t=Rs(),u&&u.c(),r=Rs(),this.first=t},m(f,h){Le(f,t,h),u&&u.m(f,h),Le(f,r,h),a=!0},p(f,h){e=f,e[5]===e[23].group?u?(u.p(e,h),h&32&&Re(u,1)):(u=Eae(e),u.c(),Re(u,1),u.m(r.parentNode,r)):u&&(To(),Ue(u,1,1,()=>{u=null}),Do())},i(f){a||(Re(u),a=!0)},o(f){Ue(u),a=!1},d(f){f&&Ie(t),u&&u.d(f),f&&Ie(r)}}}function Aae(s){let e,t,r;function a(f){s[15](f)}let u={schema:s[2]};return s[0].status!==void 0&&(u.status=s[0].status),e=new Ohe({props:u}),ss.push(()=>Er(e,"status",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&4&&(g.schema=f[2]),!t&&h&1&&(t=!0,g.status=f[0].status,Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function T2e(s){let e,t,r,a,u,f;return{c(){e=ce("button"),t=ce("span"),r=Kt(`
Save`),W(t,"class","spinner-border spinner-border-sm"),W(t,"role","status"),W(t,"aria-hidden","true"),e.disabled=a=!s[6],W(e,"class","ms-2 btn btn-primary btn-spinner")},m(h,g){Le(h,e,g),Q(e,t),Q(e,r),u||(f=Dn(e,"click",s[11]),u=!0)},p(h,g){g&64&&a!==(a=!h[6])&&(e.disabled=a)},d(h){h&&Ie(e),u=!1,f()}}}function D2e(s){let e,t,r;return{c(){e=ce("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Add`,W(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,u){Le(a,e,u),t||(r=Dn(e,"click",s[11]),t=!0)},p:Sn,d(a){a&&Ie(e),t=!1,r()}}}function O2e(s){let e,t,r,a,u,f,h,g,y,C=[],A=new Map,O,N,L,j,z,q,ee,F,ne;t=new oI({props:{message:s[7]}});function oe(tt){s[12](tt)}let re={schema:s[2],isCreateMode:s[3],record:s[0]};s[5]!==void 0&&(re.active=s[5]),u=new Rhe({props:re}),ss.push(()=>Er(u,"active",oe)),g=new Mhe({props:{record:s[0],schema:s[2]}});let J=s[8];const we=tt=>tt[23].name;for(let tt=0;tt<J.length;tt+=1){let Qe=kae(s,J,tt),ft=we(Qe);A.set(ft,C[tt]=xae(ft,Qe))}let ye=s[2].hasDrafts&&Aae(s);function De(tt,Qe){return tt[3]?D2e:T2e}let _e=De(s),be=_e(s);return{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),a=ce("div"),rn(u.$$.fragment),h=Xe(),rn(g.$$.fragment),y=Xe();for(let tt=0;tt<C.length;tt+=1)C[tt].c();O=Xe(),N=ce("div"),L=ce("div"),ye&&ye.c(),j=Xe(),be.c(),z=Xe(),q=ce("button"),q.textContent="cancel",W(a,"class","mt-1"),W(q,"class","ms-2 btn btn-link"),W(L,"class","d-flex mt-3 align-items-center justify-content-center"),W(e,"class","inline-edit my-4 svelte-sl11hx")},m(tt,Qe){Le(tt,e,Qe),on(t,e,null),Q(e,r),Q(e,a),on(u,a,null),Q(a,h),on(g,a,null),Q(a,y);for(let ft=0;ft<C.length;ft+=1)C[ft]&&C[ft].m(a,null);Q(e,O),Q(e,N),Q(N,L),ye&&ye.m(L,null),Q(L,j),be.m(L,null),Q(L,z),Q(L,q),ee=!0,F||(ne=[Dn(window,"beforeunload",s[9]),Dn(q,"click",s[10])],F=!0)},p(tt,[Qe]){const ft={};Qe&128&&(ft.message=tt[7]),t.$set(ft);const V={};Qe&4&&(V.schema=tt[2]),Qe&8&&(V.isCreateMode=tt[3]),Qe&1&&(V.record=tt[0]),!f&&Qe&32&&(f=!0,V.active=tt[5],Dr(()=>f=!1)),u.$set(V);const mt={};Qe&1&&(mt.record=tt[0]),Qe&4&&(mt.schema=tt[2]),g.$set(mt),Qe&319&&(J=tt[8],To(),C=Om(C,Qe,we,1,tt,J,A,a,f2,xae,null,kae),Do()),tt[2].hasDrafts?ye?(ye.p(tt,Qe),Qe&4&&Re(ye,1)):(ye=Aae(tt),ye.c(),Re(ye,1),ye.m(L,j)):ye&&(To(),Ue(ye,1,1,()=>{ye=null}),Do()),_e===(_e=De(tt))&&be?be.p(tt,Qe):(be.d(1),be=_e(tt),be&&(be.c(),be.m(L,z)))},i(tt){if(!ee){Re(t.$$.fragment,tt),Re(u.$$.fragment,tt),Re(g.$$.fragment,tt);for(let Qe=0;Qe<J.length;Qe+=1)Re(C[Qe]);Re(ye),ee=!0}},o(tt){Ue(t.$$.fragment,tt),Ue(u.$$.fragment,tt),Ue(g.$$.fragment,tt);for(let Qe=0;Qe<C.length;Qe+=1)Ue(C[Qe]);Ue(ye),ee=!1},d(tt){tt&&Ie(e),sn(t),sn(u),sn(g);for(let Qe=0;Qe<C.length;Qe+=1)C[Qe].d();ye&&ye.d(),be.d(),F=!1,Zi(ne)}}}function M2e(s,e,t){let r,a;const u=ji("channel"),f=Ip();let{schema:h}=e,{record:g}=e,{graph:y={records:[],edges:[]}}=e,{isCreateMode:C}=e,A,O="",N=!1,L=h.fields.filter(ye=>ye.name!=="id"),j="_default";h.fields.reduce((ye,De)=>{var _e;return De.ui==="tab"?(j=De.name,ye):(ye[j]=[...(_e=ye[j])!=null?_e:[],De.name],ye)},[]),H0(()=>{z()});function z(){A={data:JSON.parse(JSON.stringify(g.data)),schema:g.schema,status:g.status,_sys:JSON.parse(JSON.stringify(g._sys)),_file:JSON.parse(JSON.stringify(g._file)),edges:JSON.parse(JSON.stringify(y.edges))}}vhe(()=>{t(6,N=ee())});function q(ye){return N?ye.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete ye.returnValue,"...")}function ee(){return C?!1:!Hu.exports.isEqual(A,{data:g.data,schema:g.schema,status:g.status,_sys:g._sys,_file:g._file,edges:y.edges})}function F(ye){ye.preventDefault(),f("cancel")}function ne(ye){return ye.preventDefault(),console.log("SAVE: Attempt"),t(4,r=null),t(7,a=""),new Promise(function(De,_e){var be,tt;if(!N&&!C){De(null);return}if(!g){De(null);return}t(1,y.edges=(tt=(be=y.edges)==null?void 0:be.filter(Qe=>!Qe._isTrashed&&Qe.source===g.id))!=null?tt:[],y),axios.post(u.lucentUrl+"/records",{record:g,edges:y.edges,isCreateMode:C}).then(function(Qe){console.log("SAVE: SAVED INLINE"),t(0,g=Qe.data.records[0]),t(1,y=Qe.data),C||z(),f("inlinesaved",{records:[g]}),De(null)}).catch(function(Qe){Qe.response&&(typeof Qe.response.data.error=="string"?t(7,a=Qe.response.data.error):t(4,r=Qe.response.data.error)),De(null)})})}function oe(ye){O=ye,t(5,O)}function re(ye){s.$$.not_equal(g.data,ye)&&(g.data=ye,t(0,g))}function J(ye){y=ye,t(1,y)}function we(ye){s.$$.not_equal(g.status,ye)&&(g.status=ye,t(0,g))}return s.$$set=ye=>{"schema"in ye&&t(2,h=ye.schema),"record"in ye&&t(0,g=ye.record),"graph"in ye&&t(1,y=ye.graph),"isCreateMode"in ye&&t(3,C=ye.isCreateMode)},s.$$.update=()=>{s.$$.dirty&16&&t(7,a=r?`Record submission failed. ${Object.entries(r).length} error(s)`:null)},t(4,r=null),[g,y,h,C,r,O,N,a,L,q,F,ne,oe,re,J,we]}class Ihe extends ko{constructor(e){super(),So(this,e,M2e,O2e,Co,{schema:2,record:0,graph:1,isCreateMode:3})}}function Tae(s,e,t){const r=s.slice();return r[19]=e[t],r}function Dae(s,e,t){const r=s.slice();return r[22]=e[t],r}function Oae(s){let e,t=s[22].label+"",r;return{c(){e=ce("option"),r=Kt(t),e.__value=s[22],e.value=e.__value},m(a,u){Le(a,e,u),Q(e,r)},p:Sn,d(a){a&&Ie(e)}}}function Mae(s){let e,t=s[19].label+"",r,a;return{c(){e=ce("option"),r=Kt(t),e.__value=a=s[19],e.value=e.__value},m(u,f){Le(u,e,f),Q(e,r)},p(u,f){f&2&&t!==(t=u[19].label+"")&&Gn(r,t),f&2&&a!==(a=u[19])&&(e.__value=a,e.value=e.__value)},d(u){u&&Ie(e)}}}function R2e(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee,F,ne,oe,re,J,we,ye,De,_e,be,tt,Qe;a=new wl({props:{icon:"filter"}});let ft=s[5],V=[];for(let Ot=0;Ot<ft.length;Ot+=1)V[Ot]=Oae(Dae(s,ft,Ot));let mt=s[1],nt=[];for(let Ot=0;Ot<mt.length;Ot+=1)nt[Ot]=Mae(Tae(s,mt,Ot));return{c(){e=ce("div"),t=ce("div"),r=ce("button"),rn(a.$$.fragment),u=Xe(),f=ce("span"),f.textContent="Filter",h=Xe(),g=ce("div"),y=ce("div"),C=ce("select");for(let Ot=0;Ot<V.length;Ot+=1)V[Ot].c();A=Xe(),O=ce("div"),N=ce("select");for(let Ot=0;Ot<nt.length;Ot+=1)nt[Ot].c();L=Xe(),j=ce("div"),z=ce("input"),q=Xe(),ee=ce("div"),F=ce("button"),F.textContent="Add filter",ne=Xe(),oe=ce("hr"),re=Xe(),J=ce("div"),J.innerHTML='<h6 class="dropdown-header">Advanced filters</h6>',we=Xe(),ye=ce("form"),De=ce("div"),_e=ce("input"),W(f,"class","ms-1"),W(r,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),W(r,"type","button"),W(r,"data-bs-toggle","dropdown"),W(r,"data-bs-auto-close","outside"),W(r,"aria-expanded","false"),W(C,"class","form-select"),s[0]===void 0&&hk(()=>s[13].call(C)),W(y,"class","px-3 py-1 d-flex align-items-center"),W(N,"class","form-select"),s[4]===void 0&&hk(()=>s[14].call(N)),W(O,"class","px-3 py-1 d-flex align-items-center"),W(z,"type","text"),W(z,"class","form-control"),W(j,"class","px-3 py-1 d-flex align-items-center"),W(F,"class","btn btn-outline-primary"),W(F,"type","button"),W(ee,"class","px-3 py-1 d-flex align-items-center"),W(_e,"type","search"),W(_e,"class","form-control"),W(_e,"placeholder","Advanced filters"),_e.required=!0,W(De,"class","px-3 py-1 d-flex align-items-center"),W(g,"class","dropdown-menu"),os(g,"width","300px"),W(t,"class","btn-group"),W(e,"class","mx-2 d-flex align-items-center")},m(Ot,Tt){Le(Ot,e,Tt),Q(e,t),Q(t,r),on(a,r,null),Q(r,u),Q(r,f),Q(t,h),Q(t,g),Q(g,y),Q(y,C);for(let He=0;He<V.length;He+=1)V[He]&&V[He].m(C,null);H$(C,s[0],!0),Q(g,A),Q(g,O),Q(O,N);for(let He=0;He<nt.length;He+=1)nt[He]&&nt[He].m(N,null);H$(N,s[4],!0),Q(g,L),Q(g,j),Q(j,z),wr(z,s[3]),Q(g,q),Q(g,ee),Q(ee,F),Q(g,ne),Q(g,oe),Q(g,re),Q(g,J),Q(g,we),Q(g,ye),Q(ye,De),Q(De,_e),wr(_e,s[2]),be=!0,tt||(Qe=[Dn(C,"change",s[13]),Dn(N,"change",s[14]),Dn(z,"input",s[15]),Dn(F,"click",s[6]),Dn(_e,"input",s[16]),Dn(ye,"submit",s[7])],tt=!0)},p(Ot,[Tt]){if(Tt&32){ft=Ot[5];let He;for(He=0;He<ft.length;He+=1){const ct=Dae(Ot,ft,He);V[He]?V[He].p(ct,Tt):(V[He]=Oae(ct),V[He].c(),V[He].m(C,null))}for(;He<V.length;He+=1)V[He].d(1);V.length=ft.length}if(Tt&33&&H$(C,Ot[0]),Tt&2){mt=Ot[1];let He;for(He=0;He<mt.length;He+=1){const ct=Tae(Ot,mt,He);nt[He]?nt[He].p(ct,Tt):(nt[He]=Mae(ct),nt[He].c(),nt[He].m(N,null))}for(;He<nt.length;He+=1)nt[He].d(1);nt.length=mt.length}Tt&18&&H$(N,Ot[4]),Tt&8&&z.value!==Ot[3]&&wr(z,Ot[3]),Tt&4&&_e.value!==Ot[2]&&wr(_e,Ot[2])},i(Ot){be||(Re(a.$$.fragment,Ot),be=!0)},o(Ot){Ue(a.$$.fragment,Ot),be=!1},d(Ot){Ot&&Ie(e),sn(a),ul(V,Ot),ul(nt,Ot),tt=!1,Zi(Qe)}}}function N2e(s,e,t){let r,a;const u=Ip();let{schema:f}=e,{systemFields:h=[]}=e,{operators:g}=e,{inModal:y}=e,{modalUrl:C}=e,A="",O=h;f.type=="collection"&&(O=h.filter(re=>re.files===!1));let N=[...f.fields,...O].filter(re=>!["file","json","tab"].includes(re.ui)),L,j="";function z(re){re.preventDefault();let J="";f.fields.find(De=>De.name===L.name)&&(J="data.");let we=`filter[${J+L.name}_${a.name}]`;const ye=new URL(C!=null?C:window.location.href);ye.searchParams.set("skip","0"),ye.searchParams.set(we,j),y?u("refresh",ye):window.location=ye}function q(re){var _e,be;re.preventDefault();let J=(_e=A.split("=")[0])!=null?_e:"";if(!J)return;let we=`filter[${J}]`,ye=(be=A.split("=")[1])!=null?be:"";if(!ye)return;const De=new URL(C!=null?C:window.location.href);De.searchParams.set("skip","0"),De.searchParams.set(we,ye),y?u("refresh",De):window.location=De}function ee(){L=xie(this),t(0,L),t(5,N)}function F(){a=xie(this),t(4,a),t(1,r),t(10,g),t(0,L),t(1,r),t(10,g),t(0,L)}function ne(){j=this.value,t(3,j)}function oe(){A=this.value,t(2,A)}return s.$$set=re=>{"schema"in re&&t(8,f=re.schema),"systemFields"in re&&t(9,h=re.systemFields),"operators"in re&&t(10,g=re.operators),"inModal"in re&&t(11,y=re.inModal),"modalUrl"in re&&t(12,C=re.modalUrl)},s.$$.update=()=>{s.$$.dirty&1025&&t(1,r=g.filter(re=>re.uis.includes(L==null?void 0:L.ui)||re.uis[0]=="*")),s.$$.dirty&2&&t(4,a=r[0])},[L,r,A,j,a,N,z,q,f,h,g,y,C,ee,F,ne,oe]}class P2e extends ko{constructor(e){super(),So(this,e,N2e,R2e,Co,{schema:8,systemFields:9,operators:10,inModal:11,modalUrl:12})}}function I2e(s){let e,t,r,a,u,f,h,g;return{c(){e=ce("fieldset"),t=ce("label"),r=Kt(`Upload file
`),a=ce("span"),a.innerHTML='<span class="visually-hidden">Loading...</span>',u=Xe(),f=ce("input"),W(a,"class","spinner-border spinner-border-sm"),W(a,"role","status"),W(a,"aria-hidden","true"),W(f,"class","form-control"),W(f,"type","file"),W(f,"id","formFile"),f.multiple=!0,W(f,"accept",B2e),f.disabled=s[0],f.hidden=!0,W(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=s[0]},m(y,C){Le(y,e,C),Q(e,t),Q(t,r),Q(t,a),Q(t,u),Q(t,f),h||(g=Dn(f,"input",s[1]),h=!0)},p(y,[C]){C&1&&(f.disabled=y[0]),C&1&&(e.disabled=y[0])},i:Sn,o:Sn,d(y){y&&Ie(e),h=!1,g()}}}let B2e="";function L2e(s,e,t){const r=Ip(),a=ji("channel");let{schema:u}=e,f=[],h=!1;function g(y){t(0,h=!0),f=y.target.files?[...y.target.files]:[];let C=new FormData;C.append("schema",u.name),Array.from(f).forEach(function(A){C.append("files[]",A)}),r("beforeUpload",f),axios.post(a.lucentUrl+"/files/upload",C,{headers:{"Content-Type":"multipart/form-data"}}).then(A=>{A.data.error?r("uploadError",A.data.error):r("uploadComplete",A.data),t(0,h=!1)}).catch(A=>{t(0,h=!1),console.log(A.response.data)})}return s.$$set=y=>{"schema"in y&&t(2,u=y.schema)},[h,g,u]}class F2e extends ko{constructor(e){super(),So(this,e,L2e,I2e,Co,{schema:2})}}function Rae(s,e,t){const r=s.slice();return r[18]=e[t],r}function Nae(s,e,t){const r=s.slice();return r[18]=e[t],r}function H2e(s){let e,t;return e=new wl({props:{icon:"arrow-up-short-wide"}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function $2e(s){let e,t;return e=new wl({props:{icon:"arrow-down-wide-short"}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function Pae(s){let e,t,r,a,u,f,h,g,y,C,A,O=s[18].label+"",N,L,j,z,q;a=new wl({props:{icon:"arrow-up-short-wide"}});function ee(...oe){return s[10](s[18],...oe)}g=new wl({props:{icon:"arrow-down-wide-short"}});function F(...oe){return s[11](s[18],...oe)}function ne(...oe){return s[12](s[18],...oe)}return{c(){e=ce("div"),t=ce("div"),r=ce("button"),rn(a.$$.fragment),f=Xe(),h=ce("button"),rn(g.$$.fragment),C=Xe(),A=ce("button"),N=Kt(O),L=Xe(),W(r,"title","Sort Ascending"),W(r,"class",u="btn btn-sm "+(s[18].name==s[0]?"btn-primary":"btn-outline-primary")),W(h,"title","Sort Descending"),W(h,"class",y="btn btn-sm "+("-"+s[18].name==s[0]?"btn-primary":"btn-outline-primary")),W(A,"title","Sort Ascending"),W(A,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),os(A,"overflow","hidden"),W(t,"class","btn-group w-100"),W(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(oe,re){Le(oe,e,re),Q(e,t),Q(t,r),on(a,r,null),Q(t,f),Q(t,h),on(g,h,null),Q(t,C),Q(t,A),Q(A,N),Q(e,L),j=!0,z||(q=[Dn(r,"click",ee),Dn(h,"click",F),Dn(A,"click",ne)],z=!0)},p(oe,re){s=oe,(!j||re&5&&u!==(u="btn btn-sm "+(s[18].name==s[0]?"btn-primary":"btn-outline-primary")))&&W(r,"class",u),(!j||re&5&&y!==(y="btn btn-sm "+("-"+s[18].name==s[0]?"btn-primary":"btn-outline-primary")))&&W(h,"class",y),(!j||re&4)&&O!==(O=s[18].label+"")&&Gn(N,O)},i(oe){j||(Re(a.$$.fragment,oe),Re(g.$$.fragment,oe),j=!0)},o(oe){Ue(a.$$.fragment,oe),Ue(g.$$.fragment,oe),j=!1},d(oe){oe&&Ie(e),sn(a),sn(g),z=!1,Zi(q)}}}function Iae(s){let e,t,r,a,u,f,h,g,y,C,A,O=s[18].label+"",N,L,j,z,q;a=new wl({props:{icon:"arrow-up-short-wide"}});function ee(...oe){return s[13](s[18],...oe)}g=new wl({props:{icon:"arrow-down-wide-short"}});function F(...oe){return s[14](s[18],...oe)}function ne(...oe){return s[15](s[18],...oe)}return{c(){e=ce("div"),t=ce("div"),r=ce("button"),rn(a.$$.fragment),f=Xe(),h=ce("button"),rn(g.$$.fragment),C=Xe(),A=ce("button"),N=Kt(O),L=Xe(),W(r,"title","Sort Ascending"),W(r,"class",u="btn btn-sm "+(s[18].name==s[0]?"btn-primary":"btn-outline-primary")),W(h,"title","Sort Descending"),W(h,"class",y="btn btn-sm "+("-"+s[18].name==s[0]?"btn-primary":"btn-outline-primary")),W(A,"title","Sort Ascending"),W(A,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),os(A,"overflow","hidden"),W(t,"class","btn-group w-100"),W(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(oe,re){Le(oe,e,re),Q(e,t),Q(t,r),on(a,r,null),Q(t,f),Q(t,h),on(g,h,null),Q(t,C),Q(t,A),Q(A,N),Q(e,L),j=!0,z||(q=[Dn(r,"click",ee),Dn(h,"click",F),Dn(A,"click",ne)],z=!0)},p(oe,re){s=oe,(!j||re&3&&u!==(u="btn btn-sm "+(s[18].name==s[0]?"btn-primary":"btn-outline-primary")))&&W(r,"class",u),(!j||re&3&&y!==(y="btn btn-sm "+("-"+s[18].name==s[0]?"btn-primary":"btn-outline-primary")))&&W(h,"class",y),(!j||re&2)&&O!==(O=s[18].label+"")&&Gn(N,O)},i(oe){j||(Re(a.$$.fragment,oe),Re(g.$$.fragment,oe),j=!0)},o(oe){Ue(a.$$.fragment,oe),Ue(g.$$.fragment,oe),j=!1},d(oe){oe&&Ie(e),sn(a),sn(g),z=!1,Zi(q)}}}function z2e(s){let e,t,r,a,u,f,h,g=s[3].label+"",y,C,A,O,N,L,j,z,q;const ee=[$2e,H2e],F=[];function ne(_e,be){return be&1&&(r=null),r==null&&(r=!!_e[0].startsWith("-")),r?0:1}a=ne(s,-1),u=F[a]=ee[a](s);let oe=s[2],re=[];for(let _e=0;_e<oe.length;_e+=1)re[_e]=Pae(Nae(s,oe,_e));const J=_e=>Ue(re[_e],1,1,()=>{re[_e]=null});let we=s[1],ye=[];for(let _e=0;_e<we.length;_e+=1)ye[_e]=Iae(Rae(s,we,_e));const De=_e=>Ue(ye[_e],1,1,()=>{ye[_e]=null});return{c(){e=ce("div"),t=ce("button"),u.c(),f=Xe(),h=ce("span"),y=Kt(g),C=Xe(),A=ce("div"),O=ce("div");for(let _e=0;_e<re.length;_e+=1)re[_e].c();N=Xe(),L=ce("h6"),L.textContent="System",j=Xe(),z=ce("div");for(let _e=0;_e<ye.length;_e+=1)ye[_e].c();W(h,"class","ms-1"),W(t,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),W(t,"type","button"),W(t,"data-bs-toggle","dropdown"),W(t,"data-bs-auto-close","outside"),W(t,"aria-expanded","false"),W(O,"class","row"),W(L,"class","dropdown-header px-0"),W(z,"class","row"),W(A,"class","dropdown-menu"),os(A,"width","auto"),os(A,"max-width","800px"),W(e,"class","")},m(_e,be){Le(_e,e,be),Q(e,t),F[a].m(t,null),Q(t,f),Q(t,h),Q(h,y),Q(e,C),Q(e,A),Q(A,O);for(let tt=0;tt<re.length;tt+=1)re[tt]&&re[tt].m(O,null);Q(A,N),Q(A,L),Q(A,j),Q(A,z);for(let tt=0;tt<ye.length;tt+=1)ye[tt]&&ye[tt].m(z,null);q=!0},p(_e,[be]){let tt=a;if(a=ne(_e,be),a!==tt&&(To(),Ue(F[tt],1,1,()=>{F[tt]=null}),Do(),u=F[a],u||(u=F[a]=ee[a](_e),u.c()),Re(u,1),u.m(t,f)),(!q||be&8)&&g!==(g=_e[3].label+"")&&Gn(y,g),be&53){oe=_e[2];let Qe;for(Qe=0;Qe<oe.length;Qe+=1){const ft=Nae(_e,oe,Qe);re[Qe]?(re[Qe].p(ft,be),Re(re[Qe],1)):(re[Qe]=Pae(ft),re[Qe].c(),Re(re[Qe],1),re[Qe].m(O,null))}for(To(),Qe=oe.length;Qe<re.length;Qe+=1)J(Qe);Do()}if(be&51){we=_e[1];let Qe;for(Qe=0;Qe<we.length;Qe+=1){const ft=Rae(_e,we,Qe);ye[Qe]?(ye[Qe].p(ft,be),Re(ye[Qe],1)):(ye[Qe]=Iae(ft),ye[Qe].c(),Re(ye[Qe],1),ye[Qe].m(z,null))}for(To(),Qe=we.length;Qe<ye.length;Qe+=1)De(Qe);Do()}},i(_e){if(!q){Re(u);for(let be=0;be<oe.length;be+=1)Re(re[be]);for(let be=0;be<we.length;be+=1)Re(ye[be]);q=!0}},o(_e){Ue(u),re=re.filter(Boolean);for(let be=0;be<re.length;be+=1)Ue(re[be]);ye=ye.filter(Boolean);for(let be=0;be<ye.length;be+=1)Ue(ye[be]);q=!1},d(_e){_e&&Ie(e),F[a].d(),ul(re,_e),ul(ye,_e)}}}function V2e(s,e,t){let r,a,u;const f=Ip();let{schema:h}=e,{sort:g}=e,{inModal:y}=e,{modalUrl:C}=e,{systemFields:A=[]}=e;function O(oe){const re=new URL(C!=null?C:window.location.href);re.searchParams.set("sort",oe),y?f("refresh",re):window.location=re}function N(oe,re){oe.preventDefault();let J=A.includes(we=>we.name===re.name)?"":"data.";return O(J+re.name)}function L(oe,re){oe.preventDefault();let J=A.includes(we=>we.name===re.name)?"":"data.";return O("-"+J+re.name)}const j=(oe,re)=>N(re,oe),z=(oe,re)=>L(re,oe),q=(oe,re)=>N(re,oe),ee=(oe,re)=>N(re,oe),F=(oe,re)=>L(re,oe),ne=(oe,re)=>N(re,oe);return s.$$set=oe=>{"schema"in oe&&t(6,h=oe.schema),"sort"in oe&&t(0,g=oe.sort),"inModal"in oe&&t(7,y=oe.inModal),"modalUrl"in oe&&t(8,C=oe.modalUrl),"systemFields"in oe&&t(9,A=oe.systemFields)},s.$$.update=()=>{s.$$.dirty&577&&t(3,r=[...h.fields,...A].find(oe=>oe.name===g||"-"+oe.name===g||"data."+oe.name===g||"-data."+oe.name===g)),s.$$.dirty&64&&t(2,a=h.fields.filter(oe=>!["reference","file","json","id","tab"].includes(oe.ui))),s.$$.dirty&512&&t(1,u=A),s.$$.dirty&576&&h.type==="collection"&&t(1,u=A.filter(oe=>oe.files===!1))},[g,u,a,r,N,L,h,y,C,A,j,z,q,ee,F,ne]}class U2e extends ko{constructor(e){super(),So(this,e,V2e,z2e,Co,{schema:6,sort:0,inModal:7,modalUrl:8,systemFields:9})}}function W2e(s){var N,L;let e,t,r,a,u=((L=(N=s[0].find(s[9]))==null?void 0:N.symbol)!=null?L:"")+"",f,h,g,y,C,A,O;return{c(){e=ce("span"),t=ce("div"),r=Kt(s[4]),a=Xe(),f=Kt(u),h=Xe(),g=Kt(s[2]),y=Xe(),C=ce("button"),W(C,"type","button"),W(C,"class","btn-close btn-close ms-1"),W(C,"aria-label","Close"),W(t,"class","d-flex align-items-center justify-content-center"),W(e,"class","applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1 svelte-6qi3g8"),os(e,"line-height","22px ")},m(j,z){Le(j,e,z),Q(e,t),Q(t,r),Q(t,a),Q(t,f),Q(t,h),Q(t,g),Q(t,y),Q(t,C),A||(O=Dn(C,"click",s[10]),A=!0)},p(j,[z]){var q,ee;z&1&&u!==(u=((ee=(q=j[0].find(j[9]))==null?void 0:q.symbol)!=null?ee:"")+"")&&Gn(f,u),z&4&&Gn(g,j[2])},i:Sn,o:Sn,d(j){j&&Ie(e),A=!1,O()}}}function j2e(s,e,t){var ee,F;const r=Ip();let{schema:a}=e,{operators:u}=e,{key:f}=e,{value:h}=e,{inModal:g}=e,{modalUrl:y}=e,C=f.split("_"),A=(ee=C[C.length-1])!=null?ee:"eq",O=f.replace("_"+A,""),N=a.fields.find(ne=>ne.name===O),L=(F=N==null?void 0:N.label)!=null?F:O;function j(ne,oe){ne.preventDefault();let re=`filter[${oe}]`;const J=new URL(y!=null?y:window.location.href);J.searchParams.set("skip","0"),J.searchParams.delete(re),g?r("refresh",J):window.location=J}const z=ne=>ne.name===A,q=ne=>j(ne,f);return s.$$set=ne=>{"schema"in ne&&t(6,a=ne.schema),"operators"in ne&&t(0,u=ne.operators),"key"in ne&&t(1,f=ne.key),"value"in ne&&t(2,h=ne.value),"inModal"in ne&&t(7,g=ne.inModal),"modalUrl"in ne&&t(8,y=ne.modalUrl)},[u,f,h,A,L,j,a,g,y,z,q]}class Z2e extends ko{constructor(e){super(),So(this,e,j2e,W2e,Co,{schema:6,operators:0,key:1,value:2,inModal:7,modalUrl:8})}}function Bae(s,e,t){const r=s.slice();return r[18]=e[t][0],r[19]=e[t][1],r}function q2e(s){let e;return{c(){e=ce("input"),W(e,"type","search"),W(e,"name","filter[_file.originalName_regex]"),W(e,"placeholder","Search"),W(e,"class","form-control"),e.required=!0},m(t,r){Le(t,e,r)},p:Sn,d(t){t&&Ie(e)}}}function G2e(s){let e,t;return{c(){e=ce("input"),W(e,"type","search"),W(e,"name",t="filter[data."+s[0].fields[0].name+"_regex]"),W(e,"placeholder","Search"),W(e,"class","form-control"),e.required=!0},m(r,a){Le(r,e,a)},p(r,a){a&1&&t!==(t="filter[data."+r[0].fields[0].name+"_regex]")&&W(e,"name",t)},d(r){r&&Ie(e)}}}function K2e(s){let e,t,r;return t=new F2e({props:{schema:s[0]}}),t.$on("uploadComplete",s[10]),{c(){e=ce("div"),rn(t.$$.fragment),W(e,"class","d-inline-block ms-1")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},p(a,u){const f={};u&1&&(f.schema=a[0]),t.$set(f)},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function Y2e(s){let e,t=!s[4]&&Lae(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,a){r[4]?t&&(t.d(1),t=null):t?t.p(r,a):(t=Lae(r),t.c(),t.m(e.parentNode,e))},i:Sn,o:Sn,d(r){t&&t.d(r),r&&Ie(e)}}}function Lae(s){let e,t,r;return{c(){e=ce("a"),t=Kt("New Record"),W(e,"href",r=s[7].lucentUrl+"/records/new?schema="+s[0].name),W(e,"class","btn btn-sm btn-primary")},m(a,u){Le(a,e,u),Q(e,t)},p(a,u){u&1&&r!==(r=a[7].lucentUrl+"/records/new?schema="+a[0].name)&&W(e,"href",r)},d(a){a&&Ie(e)}}}function Fae(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L;return r=new wl({props:{icon:"ellipsis-vertical"}}),{c(){e=ce("div"),t=ce("button"),rn(r.$$.fragment),a=Xe(),u=ce("ul"),f=ce("li"),h=ce("a"),g=Kt("Export to CSV"),y=Xe(),C=ce("li"),A=ce("a"),O=Kt("View trashed records"),W(t,"class","btn btn-link btn-sm"),W(t,"type","button"),W(t,"data-bs-toggle","dropdown"),W(t,"aria-expanded","false"),W(h,"class","dropdown-item"),W(h,"href",s[8]),W(A,"class","dropdown-item"),W(A,"href",N=s[7].lucentUrl+"/content/"+s[0].name+"?filter[status_in]=trashed"),W(u,"class","dropdown-menu"),W(e,"class","dropdown d-inline-block")},m(j,z){Le(j,e,z),Q(e,t),on(r,t,null),Q(e,a),Q(e,u),Q(u,f),Q(f,h),Q(h,g),Q(u,y),Q(u,C),Q(C,A),Q(A,O),L=!0},p(j,z){(!L||z&1&&N!==(N=j[7].lucentUrl+"/content/"+j[0].name+"?filter[status_in]=trashed"))&&W(A,"href",N)},i(j){L||(Re(r.$$.fragment,j),L=!0)},o(j){Ue(r.$$.fragment,j),L=!1},d(j){j&&Ie(e),sn(r)}}}function Hae(s){let e,t,r=Object.entries(s[3]),a=[];for(let f=0;f<r.length;f+=1)a[f]=$ae(Bae(s,r,f));const u=f=>Ue(a[f],1,1,()=>{a[f]=null});return{c(){e=ce("div");for(let f=0;f<a.length;f+=1)a[f].c();W(e,"class","d-flex mb-3")},m(f,h){Le(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,h){if(h&125){r=Object.entries(f[3]);let g;for(g=0;g<r.length;g+=1){const y=Bae(f,r,g);a[g]?(a[g].p(y,h),Re(a[g],1)):(a[g]=$ae(y),a[g].c(),Re(a[g],1),a[g].m(e,null))}for(To(),g=r.length;g<a.length;g+=1)u(g);Do()}},i(f){if(!t){for(let h=0;h<r.length;h+=1)Re(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)Ue(a[h]);t=!1},d(f){f&&Ie(e),ul(a,f)}}}function $ae(s){let e,t;return e=new Z2e({props:{schema:s[0],operators:s[2],key:s[18],value:s[19],inModal:s[4],modalUrl:s[5],systemFields:s[6]}}),e.$on("refresh",s[15]),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1&&(u.schema=r[0]),a&4&&(u.operators=r[2]),a&8&&(u.key=r[18]),a&8&&(u.value=r[19]),a&16&&(u.inModal=r[4]),a&32&&(u.modalUrl=r[5]),a&64&&(u.systemFields=r[6]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function X2e(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j=Object.entries(s[3]).length>0,z,q,ee,F;r=new U2e({props:{schema:s[0],sort:s[1],systemFields:s[6],inModal:s[4],modalUrl:s[5]}}),r.$on("refresh",s[12]);function ne(Qe){s[13](Qe)}let oe={systemFields:s[6],operators:s[2],filter:s[3],inModal:s[4],modalUrl:s[5]};s[0]!==void 0&&(oe.schema=s[0]),u=new P2e({props:oe}),ss.push(()=>Er(u,"schema",ne)),u.$on("refresh",s[14]);function re(Qe,ft){var V;return(V=Qe[0].fields[0])!=null&&V.name?G2e:q2e}let J=re(s),we=J(s);const ye=[Y2e,K2e],De=[];function _e(Qe,ft){return Qe[0].type==="collection"?0:1}A=_e(s),O=De[A]=ye[A](s);let be=!s[4]&&Fae(s),tt=j&&Hae(s);return{c(){e=ce("div"),t=ce("div"),rn(r.$$.fragment),a=Xe(),rn(u.$$.fragment),h=Xe(),g=ce("form"),we.c(),y=Xe(),C=ce("div"),O.c(),N=Xe(),be&&be.c(),L=Xe(),tt&&tt.c(),z=Rs(),W(g,"method","GET"),W(t,"class","d-flex align-items-center"),W(C,"class","d-flex align-items-center "),W(e,"class","mb-3 d-flex align-items-center justify-content-between")},m(Qe,ft){Le(Qe,e,ft),Q(e,t),on(r,t,null),Q(t,a),on(u,t,null),Q(t,h),Q(t,g),we.m(g,null),Q(e,y),Q(e,C),De[A].m(C,null),Q(C,N),be&&be.m(C,null),Le(Qe,L,ft),tt&&tt.m(Qe,ft),Le(Qe,z,ft),q=!0,ee||(F=Dn(g,"submit",s[9]),ee=!0)},p(Qe,[ft]){const V={};ft&1&&(V.schema=Qe[0]),ft&2&&(V.sort=Qe[1]),ft&64&&(V.systemFields=Qe[6]),ft&16&&(V.inModal=Qe[4]),ft&32&&(V.modalUrl=Qe[5]),r.$set(V);const mt={};ft&64&&(mt.systemFields=Qe[6]),ft&4&&(mt.operators=Qe[2]),ft&8&&(mt.filter=Qe[3]),ft&16&&(mt.inModal=Qe[4]),ft&32&&(mt.modalUrl=Qe[5]),!f&&ft&1&&(f=!0,mt.schema=Qe[0],Dr(()=>f=!1)),u.$set(mt),J===(J=re(Qe))&&we?we.p(Qe,ft):(we.d(1),we=J(Qe),we&&(we.c(),we.m(g,null)));let nt=A;A=_e(Qe),A===nt?De[A].p(Qe,ft):(To(),Ue(De[nt],1,1,()=>{De[nt]=null}),Do(),O=De[A],O?O.p(Qe,ft):(O=De[A]=ye[A](Qe),O.c()),Re(O,1),O.m(C,N)),Qe[4]?be&&(To(),Ue(be,1,1,()=>{be=null}),Do()):be?(be.p(Qe,ft),ft&16&&Re(be,1)):(be=Fae(Qe),be.c(),Re(be,1),be.m(C,null)),ft&8&&(j=Object.entries(Qe[3]).length>0),j?tt?(tt.p(Qe,ft),ft&8&&Re(tt,1)):(tt=Hae(Qe),tt.c(),Re(tt,1),tt.m(z.parentNode,z)):tt&&(To(),Ue(tt,1,1,()=>{tt=null}),Do())},i(Qe){q||(Re(r.$$.fragment,Qe),Re(u.$$.fragment,Qe),Re(O),Re(be),Re(tt),q=!0)},o(Qe){Ue(r.$$.fragment,Qe),Ue(u.$$.fragment,Qe),Ue(O),Ue(be),Ue(tt),q=!1},d(Qe){Qe&&Ie(e),sn(r),sn(u),we.d(),De[A].d(),be&&be.d(),Qe&&Ie(L),tt&&tt.d(Qe),Qe&&Ie(z),ee=!1,F()}}}function J2e(s,e,t){const r=ji("channel"),a=Ip();let{sort:u}=e,{schema:f}=e,{operators:h}=e,{filter:g}=e,{inModal:y}=e,{modalUrl:C}=e,{records:A}=e,{systemFields:O=[]}=e,N=new URL(window.location.href),L=N.pathname+"/csv?"+N.searchParams.toString();function j(oe){oe.preventDefault();const re=new FormData(oe.target);let J=re.keys().next().value,we=re.values().next().value;const ye=new URL(C!=null?C:window.location.href);ye.searchParams.set("skip","0"),ye.searchParams.set(J,we),y?a("refresh",ye):window.location=ye}function z(oe){t(11,A=oe.detail)}function q(oe){Ez.call(this,s,oe)}function ee(oe){f=oe,t(0,f)}function F(oe){Ez.call(this,s,oe)}function ne(oe){Ez.call(this,s,oe)}return s.$$set=oe=>{"sort"in oe&&t(1,u=oe.sort),"schema"in oe&&t(0,f=oe.schema),"operators"in oe&&t(2,h=oe.operators),"filter"in oe&&t(3,g=oe.filter),"inModal"in oe&&t(4,y=oe.inModal),"modalUrl"in oe&&t(5,C=oe.modalUrl),"records"in oe&&t(11,A=oe.records),"systemFields"in oe&&t(6,O=oe.systemFields)},[f,u,h,g,y,C,O,r,L,j,z,A,q,ee,F,ne]}class Q2e extends ko{constructor(e){super(),So(this,e,J2e,X2e,Co,{sort:1,schema:0,operators:2,filter:3,inModal:4,modalUrl:5,records:11,systemFields:6})}}function zae(s,e,t){const r=s.slice();return r[9]=e[t],r}function ewe(s){let e,t=s[9]+"",r,a,u,f;function h(...g){return s[7](s[9],...g)}return{c(){e=ce("a"),r=Kt(t),W(e,"class","page-link"),W(e,"href",a=s[2](s[9]))},m(g,y){Le(g,e,y),Q(e,r),u||(f=Dn(e,"click",h),u=!0)},p(g,y){s=g,y&1&&t!==(t=s[9]+"")&&Gn(r,t),y&1&&a!==(a=s[2](s[9]))&&W(e,"href",a)},d(g){g&&Ie(e),u=!1,f()}}}function twe(s){let e,t=s[9]+"",r;return{c(){e=ce("span"),r=Kt(t),W(e,"class","page-link active")},m(a,u){Le(a,e,u),Q(e,r)},p(a,u){u&1&&t!==(t=a[9]+"")&&Gn(r,t)},d(a){a&&Ie(e)}}}function Vae(s){let e,t;function r(f,h){return f[1]==f[9]?twe:ewe}let a=r(s),u=a(s);return{c(){e=ce("li"),u.c(),t=Xe(),W(e,"class","page-item")},m(f,h){Le(f,e,h),u.m(e,null),Q(e,t)},p(f,h){a===(a=r(f))&&u?u.p(f,h):(u.d(1),u=a(f),u&&(u.c(),u.m(e,t)))},d(f){f&&Ie(e),u.d()}}}function nwe(s){let e,t=s[0],r=[];for(let a=0;a<t.length;a+=1)r[a]=Vae(zae(s,t,a));return{c(){for(let a=0;a<r.length;a+=1)r[a].c();e=Rs()},m(a,u){for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(a,u);Le(a,e,u)},p(a,[u]){if(u&15){t=a[0];let f;for(f=0;f<t.length;f+=1){const h=zae(a,t,f);r[f]?r[f].p(h,u):(r[f]=Vae(h),r[f].c(),r[f].m(e.parentNode,e))}for(;f<r.length;f+=1)r[f].d(1);r.length=t.length}},i:Sn,o:Sn,d(a){ul(r,a),a&&Ie(e)}}}function owe(s,e,t){const r=Ip();let{pages:a}=e,{limit:u}=e,{currentPage:f}=e,{inModal:h}=e,{modalUrl:g}=e;function y(O){const N=new URL(g!=null?g:window.location.href);let L=O*u-u;return N.searchParams.set("skip",L),N}function C(O,N){O.preventDefault();const L=new URL(g!=null?g:window.location.href);let j=N*u-u;L.searchParams.set("skip",j),h?r("refresh",L):window.location=L}const A=(O,N)=>C(N,O);return s.$$set=O=>{"pages"in O&&t(0,a=O.pages),"limit"in O&&t(4,u=O.limit),"currentPage"in O&&t(1,f=O.currentPage),"inModal"in O&&t(5,h=O.inModal),"modalUrl"in O&&t(6,g=O.modalUrl)},[a,f,y,C,u,h,g,A]}class swe extends ko{constructor(e){super(),So(this,e,owe,nwe,Co,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function Uae(s){let e,t,r,a,u,f,h,g,y,C;return a=new swe({props:{pages:s[7],currentPage:s[6],limit:s[2],inModal:s[0],modalUrl:s[1]}}),a.$on("refresh",s[10]),{c(){e=ce("li"),t=ce("a"),t.textContent="First",r=Xe(),rn(a.$$.fragment),u=Xe(),f=ce("li"),h=ce("a"),h.textContent="Last",W(t,"href","/"),W(t,"class","page-link"),W(e,"class","page-item disabled"),_s(e,"disabled",s[6]===1),W(h,"class","page-link"),W(h,"href","/"),_s(h,"disabled",s[6]===s[5]),W(f,"class","page-item")},m(A,O){Le(A,e,O),Q(e,t),Le(A,r,O),on(a,A,O),Le(A,u,O),Le(A,f,O),Q(f,h),g=!0,y||(C=[Dn(t,"click",s[9]),Dn(h,"click",s[8])],y=!0)},p(A,O){(!g||O&64)&&_s(e,"disabled",A[6]===1);const N={};O&128&&(N.pages=A[7]),O&64&&(N.currentPage=A[6]),O&4&&(N.limit=A[2]),O&1&&(N.inModal=A[0]),O&2&&(N.modalUrl=A[1]),a.$set(N),(!g||O&96)&&_s(h,"disabled",A[6]===A[5])},i(A){g||(Re(a.$$.fragment,A),g=!0)},o(A){Ue(a.$$.fragment,A),g=!1},d(A){A&&Ie(e),A&&Ie(r),sn(a,A),A&&Ie(u),A&&Ie(f),y=!1,Zi(C)}}}function rwe(s){let e,t,r,a,u,f,h=+s[3]+1+"",g,y,C,A=(+s[3]+s[2]>s[4]?s[4]:+s[3]+s[2])+"",O,N,L,j,z,q,ee=s[5]>1&&Uae(s);return{c(){e=ce("nav"),t=ce("ul"),ee&&ee.c(),r=Xe(),a=ce("p"),u=Kt(`Showing
`),f=ce("span"),g=Kt(h),y=Kt(`
to
`),C=ce("span"),O=Kt(A),N=Kt(`
of
`),L=ce("span"),j=Kt(s[4]),z=Kt(`
total`),W(t,"class","pagination justify-content-center"),W(f,"class","font-medium"),W(C,"class","font-medium"),W(L,"class","font-medium"),W(a,"class","text-muted text-center")},m(F,ne){Le(F,e,ne),Q(e,t),ee&&ee.m(t,null),Le(F,r,ne),Le(F,a,ne),Q(a,u),Q(a,f),Q(f,g),Q(a,y),Q(a,C),Q(C,O),Q(a,N),Q(a,L),Q(L,j),Q(a,z),q=!0},p(F,[ne]){F[5]>1?ee?(ee.p(F,ne),ne&32&&Re(ee,1)):(ee=Uae(F),ee.c(),Re(ee,1),ee.m(t,null)):ee&&(To(),Ue(ee,1,1,()=>{ee=null}),Do()),(!q||ne&8)&&h!==(h=+F[3]+1+"")&&Gn(g,h),(!q||ne&28)&&A!==(A=(+F[3]+F[2]>F[4]?F[4]:+F[3]+F[2])+"")&&Gn(O,A),(!q||ne&16)&&Gn(j,F[4])},i(F){q||(Re(ee),q=!0)},o(F){Ue(ee),q=!1},d(F){F&&Ie(e),ee&&ee.d(),F&&Ie(r),F&&Ie(a)}}}function iwe(s,e,t){let r,a,u;const f=Ip();let{inModal:h}=e,{modalUrl:g}=e,{limit:y}=e,{skip:C}=e,{total:A}=e;function O(z){z.preventDefault(),L(r)}function N(z){z.preventDefault(),L(1)}function L(z){const q=new URL(g!=null?g:window.location.href);let ee=z*y-y;q.searchParams.set("skip",ee),h?f("refresh",q):window.location=q}function j(z){Ez.call(this,s,z)}return s.$$set=z=>{"inModal"in z&&t(0,h=z.inModal),"modalUrl"in z&&t(1,g=z.modalUrl),"limit"in z&&t(2,y=z.limit),"skip"in z&&t(3,C=z.skip),"total"in z&&t(4,A=z.total)},s.$$.update=()=>{s.$$.dirty&20&&t(5,r=Math.ceil(A/y)),s.$$.dirty&12&&t(6,a=Math.ceil((C-1)/y)+1),s.$$.dirty&96&&t(7,u=Hu.exports.range(a-3,a+4).filter(z=>z>0&&z<=r))},[h,g,y,C,A,r,a,u,O,N,j]}class awe extends ko{constructor(e){super(),So(this,e,iwe,rwe,Co,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function lwe(s){let e,t,r;return{c(){e=ce("button"),e.textContent="Move to trash",W(e,"type","button"),W(e,"class","btn btn-sm btn-outline-primary")},m(a,u){Le(a,e,u),t||(r=Dn(e,"click",$u(s[9])),t=!0)},p:Sn,d(a){a&&Ie(e),t=!1,r()}}}function cwe(s){let e,t,r,a,u,f,h=s[1].hasDrafts&&Wae(s);return{c(){e=ce("button"),e.textContent="Publish",t=Xe(),h&&h.c(),r=Xe(),a=ce("button"),a.textContent="Delete forever",W(e,"type","button"),W(e,"class","btn btn-sm btn-outline-primary"),W(a,"type","button"),W(a,"class","btn btn-sm btn-outline-primary")},m(g,y){Le(g,e,y),Le(g,t,y),h&&h.m(g,y),Le(g,r,y),Le(g,a,y),u||(f=[Dn(e,"click",$u(s[7])),Dn(a,"click",$u(s[3]))],u=!0)},p(g,y){g[1].hasDrafts?h?h.p(g,y):(h=Wae(g),h.c(),h.m(r.parentNode,r)):h&&(h.d(1),h=null)},d(g){g&&Ie(e),g&&Ie(t),h&&h.d(g),g&&Ie(r),g&&Ie(a),u=!1,Zi(f)}}}function Wae(s){let e,t,r;return{c(){e=ce("button"),e.textContent="Make Draft",W(e,"type","button"),W(e,"class","btn btn-sm btn-outline-primary")},m(a,u){Le(a,e,u),t||(r=Dn(e,"click",$u(s[8])),t=!0)},p:Sn,d(a){a&&Ie(e),t=!1,r()}}}function uwe(s){let e,t,r=s[0].length+"",a,u,f,h,g,y,C,A,O,N;function L(q,ee){return q[2].status_in==="trashed"?cwe:lwe}let j=L(s),z=j(s);return{c(){e=ce("div"),t=ce("span"),a=Kt(r),u=Kt(" records selected"),f=Xe(),h=ce("div"),g=ce("button"),g.textContent="Publish",y=Xe(),C=ce("button"),C.textContent="Make Draft",A=Xe(),z.c(),W(t,"class","me-2"),W(g,"type","button"),W(g,"class","btn btn-sm btn-outline-primary"),W(C,"type","button"),W(C,"class","btn btn-sm btn-outline-primary"),W(h,"class","btn-group "),W(h,"role","group"),W(h,"aria-label","Basic example"),W(e,"class","d-flex align-items-center mb-3")},m(q,ee){Le(q,e,ee),Q(e,t),Q(t,a),Q(t,u),Q(e,f),Q(e,h),Q(h,g),Q(h,y),Q(h,C),Q(h,A),z.m(h,null),O||(N=[Dn(g,"click",$u(s[5])),Dn(C,"click",$u(s[6]))],O=!0)},p(q,[ee]){ee&1&&r!==(r=q[0].length+"")&&Gn(a,r),j===(j=L(q))&&z?z.p(q,ee):(z.d(1),z=j(q),z&&(z.c(),z.m(h,null)))},i:Sn,o:Sn,d(q){q&&Ie(e),z.d(),O=!1,Zi(N)}}}function fwe(s,e,t){const r=ji("channel");let{selected:a}=e,{schema:u}=e,{filter:f}=e;function h(L){L.preventDefault(),axios.post(r.lucentUrl+"/records/delete",{ids:a.map(j=>j.id)}).then(j=>{window.location.reload()}).catch(j=>{console.log(j)})}function g(L,j){axios.post(r.lucentUrl+"/records/status/"+j,{schemaName:u.name,records:a}).then(z=>{window.location.reload()}).catch(z=>{console.log(z)})}const y=L=>g(L,"published"),C=L=>g(L,"draft"),A=L=>g(L,"published"),O=L=>g(L,"draft"),N=L=>g(L,"trashed");return s.$$set=L=>{"selected"in L&&t(0,a=L.selected),"schema"in L&&t(1,u=L.schema),"filter"in L&&t(2,f=L.filter)},[a,u,f,h,g,y,C,A,O,N]}class dwe extends ko{constructor(e){super(),So(this,e,fwe,uwe,Co,{selected:0,schema:1,filter:2})}}function hwe(s){let e;return{c(){e=Kt(s[0])},m(t,r){Le(t,e,r)},p(t,[r]){r&1&&Gn(e,t[0])},i:Sn,o:Sn,d(t){t&&Ie(e)}}}function mwe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class gwe extends ko{constructor(e){super(),So(this,e,mwe,hwe,Co,{value:0})}}function jae(s){let e,t,r,a;return{c(){e=ce("div"),t=ce("span"),r=Xe(),a=Kt(s[0]),W(t,"class","color border border-2 svelte-78o2k4"),os(t,"background",s[0]),W(e,"class","d-inline-flex")},m(u,f){Le(u,e,f),Q(e,t),Q(e,r),Q(e,a)},p(u,f){f&1&&os(t,"background",u[0]),f&1&&Gn(a,u[0])},d(u){u&&Ie(e)}}}function pwe(s){let e,t=s[0]&&jae(s);return{c(){t&&t.c(),e=Rs()},m(r,a){t&&t.m(r,a),Le(r,e,a)},p(r,[a]){r[0]?t?t.p(r,a):(t=jae(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Sn,o:Sn,d(r){t&&t.d(r),r&&Ie(e)}}}function bwe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class vwe extends ko{constructor(e){super(),So(this,e,bwe,pwe,Co,{value:0})}}function Zae(s,e,t){const r=s.slice();return r[5]=e[t],r}function qae(s){let e,t,r,a;return t=new iI({props:{schemas:s[0],graph:s[1],record:s[5]}}),{c(){e=ce("span"),rn(t.$$.fragment),r=Xe(),W(e,"class","mr-3")},m(u,f){Le(u,e,f),on(t,e,null),Q(e,r),a=!0},p(u,f){const h={};f&1&&(h.schemas=u[0]),f&2&&(h.graph=u[1]),f&4&&(h.record=u[5]),t.$set(h)},i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function ywe(s){let e,t,r=s[2],a=[];for(let f=0;f<r.length;f+=1)a[f]=qae(Zae(s,r,f));const u=f=>Ue(a[f],1,1,()=>{a[f]=null});return{c(){e=ce("div");for(let f=0;f<a.length;f+=1)a[f].c();W(e,"class","references svelte-15ilpfz")},m(f,h){Le(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,[h]){if(h&7){r=f[2];let g;for(g=0;g<r.length;g+=1){const y=Zae(f,r,g);a[g]?(a[g].p(y,h),Re(a[g],1)):(a[g]=qae(y),a[g].c(),Re(a[g],1),a[g].m(e,null))}for(To(),g=r.length;g<a.length;g+=1)u(g);Do()}},i(f){if(!t){for(let h=0;h<r.length;h+=1)Re(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)Ue(a[h]);t=!1},d(f){f&&Ie(e),ul(a,f)}}}function wwe(s,e,t){let r,{record:a}=e,{field:u}=e,{schemas:f}=e,{graph:h}=e;return s.$$set=g=>{"record"in g&&t(3,a=g.record),"field"in g&&t(4,u=g.field),"schemas"in g&&t(0,f=g.schemas),"graph"in g&&t(1,h=g.graph)},s.$$.update=()=>{var g,y;s.$$.dirty&26&&t(2,r=(y=(g=h.edges)==null?void 0:g.filter(C=>C.field===u.name&&C.source===a.id).map(C=>h.records.find(A=>A.id===C.target)).filter(C=>!!C))!=null?y:[])},[f,h,r,a,u]}class Bhe extends ko{constructor(e){super(),So(this,e,wwe,ywe,Co,{record:3,field:4,schemas:0,graph:1})}}function _we(s){let e;return{c(){e=Kt(s[0])},m(t,r){Le(t,e,r)},p(t,[r]){r&1&&Gn(e,t[0])},i:Sn,o:Sn,d(t){t&&Ie(e)}}}function Cwe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class Swe extends ko{constructor(e){super(),So(this,e,Cwe,_we,Co,{value:0})}}function kwe(s){let e,t;return{c(){e=ce("div"),t=Kt(s[0]),W(e,"title",s[0]),W(e,"data-bs-toggle","tooltip"),W(e,"data-bs-placement","top"),W(e,"class","svelte-1ft053t")},m(r,a){Le(r,e,a),Q(e,t)},p(r,[a]){a&1&&Gn(t,r[0]),a&1&&W(e,"title",r[0])},i:Sn,o:Sn,d(r){r&&Ie(e)}}}function Ewe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class cte extends ko{constructor(e){super(),So(this,e,Ewe,kwe,Co,{value:0})}}function xwe(s){let e,t;return{c(){e=ce("a"),t=Kt(s[0]),W(e,"href",s[0]),W(e,"target","_blank")},m(r,a){Le(r,e,a),Q(e,t)},p(r,[a]){a&1&&Gn(t,r[0]),a&1&&W(e,"href",r[0])},i:Sn,o:Sn,d(r){r&&Ie(e)}}}function Awe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class Twe extends ko{constructor(e){super(),So(this,e,Awe,xwe,Co,{value:0})}}function Dwe(s){let e;return{c(){e=Kt(s[0])},m(t,r){Le(t,e,r)},p(t,[r]){r&1&&Gn(e,t[0])},i:Sn,o:Sn,d(t){t&&Ie(e)}}}function Owe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class Gae extends ko{constructor(e){super(),So(this,e,Owe,Dwe,Co,{value:0})}}function Kae(s,e,t){const r=s.slice();return r[4]=e[t],r}function Yae(s){let e,t,r,a;return t=new P_({props:{record:s[4],size:"tiny"}}),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),W(e,"class","me-1")},m(u,f){Le(u,e,f),on(t,e,null),Q(e,r),a=!0},p:Sn,i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function Mwe(s){let e,t,r=s[0],a=[];for(let f=0;f<r.length;f+=1)a[f]=Yae(Kae(s,r,f));const u=f=>Ue(a[f],1,1,()=>{a[f]=null});return{c(){e=ce("div");for(let f=0;f<a.length;f+=1)a[f].c();W(e,"class","d-flex me-1")},m(f,h){Le(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,[h]){if(h&1){r=f[0];let g;for(g=0;g<r.length;g+=1){const y=Kae(f,r,g);a[g]?(a[g].p(y,h),Re(a[g],1)):(a[g]=Yae(y),a[g].c(),Re(a[g],1),a[g].m(e,null))}for(To(),g=r.length;g<a.length;g+=1)u(g);Do()}},i(f){if(!t){for(let h=0;h<r.length;h+=1)Re(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)Ue(a[h]);t=!1},d(f){f&&Ie(e),ul(a,f)}}}function Rwe(s,e,t){var h;let{record:r}=e,{field:a}=e,{graph:u}=e,f=(h=u.edges)==null?void 0:h.filter(g=>g.field===a.name&&g.source===r.id).map(g=>u.records.find(y=>y.id===g.target));return console.log(f),s.$$set=g=>{"record"in g&&t(1,r=g.record),"field"in g&&t(2,a=g.field),"graph"in g&&t(3,u=g.graph)},[f,r,a,u]}class Lhe extends ko{constructor(e){super(),So(this,e,Rwe,Mwe,Co,{record:1,field:2,graph:3})}}function Nwe(s){let e,t;return{c(){e=ce("span"),t=Kt(s[0]),W(e,"class","badge rounded-pill bg-primary bg-opacity-75"),os(e,"max-width","64px"),os(e,"overflow","hidden"),os(e,"white-space","nowrap"),os(e,"text-overflow","ellipsis"),W(e,"title",s[0]),W(e,"data-bs-toggle","tooltip")},m(r,a){Le(r,e,a),Q(e,t)},p(r,[a]){a&1&&Gn(t,r[0]),a&1&&W(e,"title",r[0])},i:Sn,o:Sn,d(r){r&&Ie(e)}}}function Pwe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class Iwe extends ko{constructor(e){super(),So(this,e,Pwe,Nwe,Co,{value:0})}}function Bwe(s){let e,t;return{c(){e=ce("div"),t=Kt(s[0]),W(e,"class","svelte-1ft053t")},m(r,a){Le(r,e,a),Q(e,t)},p(r,[a]){a&1&&Gn(t,r[0])},i:Sn,o:Sn,d(r){r&&Ie(e)}}}function Lwe(s,e,t){let{value:r}=e;return s.$$set=a=>{"value"in a&&t(0,r=a.value)},[r]}class Fwe extends ko{constructor(e){super(),So(this,e,Lwe,Bwe,Co,{value:0})}}function Hwe(s){let e,t,r;var a=s[4][s[0].info.name];function u(f){return{props:{value:f[2].data[f[0].name],record:f[2],graph:f[3],schema:f[1],field:f[0]}}}return a&&(e=dk(a,u(s))),{c(){e&&rn(e.$$.fragment),t=Rs()},m(f,h){e&&on(e,f,h),Le(f,t,h),r=!0},p(f,[h]){const g={};if(h&5&&(g.value=f[2].data[f[0].name]),h&4&&(g.record=f[2]),h&8&&(g.graph=f[3]),h&2&&(g.schema=f[1]),h&1&&(g.field=f[0]),h&1&&a!==(a=f[4][f[0].info.name])){if(e){To();const y=e;Ue(y.$$.fragment,1,0,()=>{sn(y,1)}),Do()}a?(e=dk(a,u(f)),rn(e.$$.fragment),Re(e.$$.fragment,1),on(e,t.parentNode,t)):e=null}else a&&e.$set(g)},i(f){r||(e&&Re(e.$$.fragment,f),r=!0)},o(f){e&&Ue(e.$$.fragment,f),r=!1},d(f){f&&Ie(t),e&&sn(e,f)}}}function $we(s,e,t){const r={text:cte,slug:cte,rich:Fwe,textarea:cte,color:vwe,checkbox:gwe,reference:Bhe,number:Swe,url:Twe,date:Gae,datetime:Gae,uuid:Iwe,file:Lhe};let{field:a}=e,{schema:u}=e,{record:f}=e,{graph:h}=e;return s.$$set=g=>{"field"in g&&t(0,a=g.field),"schema"in g&&t(1,u=g.schema),"record"in g&&t(2,f=g.record),"graph"in g&&t(3,h=g.graph)},[a,u,f,h,r]}class Fhe extends ko{constructor(e){super(),So(this,e,$we,Hwe,Co,{field:0,schema:1,record:2,graph:3})}}function Dp(s,e){var t,r;return s&&(r=(t=s.find(a=>a.id===e))==null?void 0:t.name)!=null?r:e}function Xae(s,e,t){const r=s.slice();return r[6]=e[t],r[8]=t,r}function Jae(s){let e,t,r,a;return t=new Fhe({props:{record:s[3],schema:s[0],graph:s[2],field:s[6]}}),{c(){e=ce("td"),rn(t.$$.fragment),W(e,"class",r="field-ui-"+s[6].info.name),_s(e,"is-sort","-"+s[6].name==s[4]||s[6].name==s[4])},m(u,f){Le(u,e,f),on(t,e,null),a=!0},p(u,f){const h={};f&8&&(h.record=u[3]),f&1&&(h.schema=u[0]),f&4&&(h.graph=u[2]),f&32&&(h.field=u[6]),t.$set(h),(!a||f&32&&r!==(r="field-ui-"+u[6].info.name))&&W(e,"class",r),(!a||f&48)&&_s(e,"is-sort","-"+u[6].name==u[4]||u[6].name==u[4])},i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function Qae(s){let e,t,r;return t=new VV({props:{status:s[3].status}}),{c(){e=ce("td"),rn(t.$$.fragment),W(e,"class","text-center"),_s(e,"is-sort",s[4]=="-status"||s[4]=="status")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},p(a,u){const f={};u&8&&(f.status=a[3].status),t.$set(f),(!r||u&16)&&_s(e,"is-sort",a[4]=="-status"||a[4]=="status")},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function ele(s){let e,t,r;return t=new r2({props:{name:Dp(s[1],s[3]._sys.createdBy),side:24}}),{c(){e=ce("td"),rn(t.$$.fragment),W(e,"class","text-center"),_s(e,"is-sort",s[4]=="-_sys.createdBy"||s[4]=="_sys.createdBy")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},p(a,u){const f={};u&10&&(f.name=Dp(a[1],a[3]._sys.createdBy)),t.$set(f),(!r||u&16)&&_s(e,"is-sort",a[4]=="-_sys.createdBy"||a[4]=="_sys.createdBy")},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function tle(s){let e,t,r;return t=new r2({props:{name:Dp(s[1],s[3]._sys.updatedBy),side:24}}),{c(){e=ce("td"),rn(t.$$.fragment),W(e,"class","text-center"),_s(e,"is-sort",s[4]=="-_sys.updatedBy"||s[4]=="_sys.updatedBy")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},p(a,u){const f={};u&10&&(f.name=Dp(a[1],a[3]._sys.updatedBy)),t.$set(f),(!r||u&16)&&_s(e,"is-sort",a[4]=="-_sys.updatedBy"||a[4]=="_sys.updatedBy")},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function nle(s){let e,t=Jy(s[3]._sys.createdAt)+"",r;return{c(){e=ce("td"),r=Kt(t),_s(e,"is-sort",s[4]=="-_sys.createdAt"||s[4]=="_sys.createdAt")},m(a,u){Le(a,e,u),Q(e,r)},p(a,u){u&8&&t!==(t=Jy(a[3]._sys.createdAt)+"")&&Gn(r,t),u&16&&_s(e,"is-sort",a[4]=="-_sys.createdAt"||a[4]=="_sys.createdAt")},d(a){a&&Ie(e)}}}function ole(s){let e,t=Jy(s[3]._sys.updatedAt)+"",r;return{c(){e=ce("td"),r=Kt(t),_s(e,"is-sort",s[4]=="-_sys.updatedAt"||s[4]=="_sys.updatedAt")},m(a,u){Le(a,e,u),Q(e,r)},p(a,u){u&8&&t!==(t=Jy(a[3]._sys.updatedAt)+"")&&Gn(r,t),u&16&&_s(e,"is-sort",a[4]=="-_sys.updatedAt"||a[4]=="_sys.updatedAt")},d(a){a&&Ie(e)}}}function zwe(s){let e,t=s[0].visible.includes("status"),r,a=s[0].visible.includes("_sys.createdBy"),u,f=s[0].visible.includes("_sys.updatedBy"),h,g=s[0].visible.includes("_sys.createdAt"),y,C=s[0].visible.includes("_sys.updatedAt"),A,O,N=s[5],L=[];for(let oe=0;oe<N.length;oe+=1)L[oe]=Jae(Xae(s,N,oe));const j=oe=>Ue(L[oe],1,1,()=>{L[oe]=null});let z=t&&Qae(s),q=a&&ele(s),ee=f&&tle(s),F=g&&nle(s),ne=C&&ole(s);return{c(){for(let oe=0;oe<L.length;oe+=1)L[oe].c();e=Xe(),z&&z.c(),r=Xe(),q&&q.c(),u=Xe(),ee&&ee.c(),h=Xe(),F&&F.c(),y=Xe(),ne&&ne.c(),A=Rs()},m(oe,re){for(let J=0;J<L.length;J+=1)L[J]&&L[J].m(oe,re);Le(oe,e,re),z&&z.m(oe,re),Le(oe,r,re),q&&q.m(oe,re),Le(oe,u,re),ee&&ee.m(oe,re),Le(oe,h,re),F&&F.m(oe,re),Le(oe,y,re),ne&&ne.m(oe,re),Le(oe,A,re),O=!0},p(oe,[re]){if(re&61){N=oe[5];let J;for(J=0;J<N.length;J+=1){const we=Xae(oe,N,J);L[J]?(L[J].p(we,re),Re(L[J],1)):(L[J]=Jae(we),L[J].c(),Re(L[J],1),L[J].m(e.parentNode,e))}for(To(),J=N.length;J<L.length;J+=1)j(J);Do()}re&1&&(t=oe[0].visible.includes("status")),t?z?(z.p(oe,re),re&1&&Re(z,1)):(z=Qae(oe),z.c(),Re(z,1),z.m(r.parentNode,r)):z&&(To(),Ue(z,1,1,()=>{z=null}),Do()),re&1&&(a=oe[0].visible.includes("_sys.createdBy")),a?q?(q.p(oe,re),re&1&&Re(q,1)):(q=ele(oe),q.c(),Re(q,1),q.m(u.parentNode,u)):q&&(To(),Ue(q,1,1,()=>{q=null}),Do()),re&1&&(f=oe[0].visible.includes("_sys.updatedBy")),f?ee?(ee.p(oe,re),re&1&&Re(ee,1)):(ee=tle(oe),ee.c(),Re(ee,1),ee.m(h.parentNode,h)):ee&&(To(),Ue(ee,1,1,()=>{ee=null}),Do()),re&1&&(g=oe[0].visible.includes("_sys.createdAt")),g?F?F.p(oe,re):(F=nle(oe),F.c(),F.m(y.parentNode,y)):F&&(F.d(1),F=null),re&1&&(C=oe[0].visible.includes("_sys.updatedAt")),C?ne?ne.p(oe,re):(ne=ole(oe),ne.c(),ne.m(A.parentNode,A)):ne&&(ne.d(1),ne=null)},i(oe){if(!O){for(let re=0;re<N.length;re+=1)Re(L[re]);Re(z),Re(q),Re(ee),O=!0}},o(oe){L=L.filter(Boolean);for(let re=0;re<L.length;re+=1)Ue(L[re]);Ue(z),Ue(q),Ue(ee),O=!1},d(oe){ul(L,oe),oe&&Ie(e),z&&z.d(oe),oe&&Ie(r),q&&q.d(oe),oe&&Ie(u),ee&&ee.d(oe),oe&&Ie(h),F&&F.d(oe),oe&&Ie(y),ne&&ne.d(oe),oe&&Ie(A)}}}function Vwe(s,e,t){let{schema:r}=e,{users:a}=e,{graph:u}=e,{record:f}=e,{sort:h}=e,{visibleColumns:g}=e;return s.$$set=y=>{"schema"in y&&t(0,r=y.schema),"users"in y&&t(1,a=y.users),"graph"in y&&t(2,u=y.graph),"record"in y&&t(3,f=y.record),"sort"in y&&t(4,h=y.sort),"visibleColumns"in y&&t(5,g=y.visibleColumns)},[r,a,u,f,h,g]}class Uwe extends ko{constructor(e){super(),So(this,e,Vwe,zwe,Co,{schema:0,users:1,graph:2,record:3,sort:4,visibleColumns:5})}}function sle(s,e,t){const r=s.slice();return r[15]=e[t],r}function rle(s,e,t){const r=s.slice();return r[18]=e[t],r}function ile(s,e,t){const r=s.slice();return r[21]=e[t],r}function ale(s){let e,t=s[21].label+"",r,a,u;return{c(){e=ce("th"),r=Kt(t),W(e,"class",a="field-ui-"+s[21].ui),W(e,"scope","col"),W(e,"title",u=s[21].help),W(e,"data-bs-toggle","tooltip"),W(e,"data-bs-placement","top"),_s(e,"is-sort","-"+s[21].name==s[6]||s[21].name==s[6])},m(f,h){Le(f,e,h),Q(e,r)},p(f,h){h&256&&t!==(t=f[21].label+"")&&Gn(r,t),h&256&&a!==(a="field-ui-"+f[21].ui)&&W(e,"class",a),h&256&&u!==(u=f[21].help)&&W(e,"title",u),h&320&&_s(e,"is-sort","-"+f[21].name==f[6]||f[21].name==f[6])},d(f){f&&Ie(e)}}}function lle(s){let e,t=s[18].label+"",r;return{c(){e=ce("th"),r=Kt(t)},m(a,u){Le(a,e,u),Q(e,r)},p(a,u){u&34&&t!==(t=a[18].label+"")&&Gn(r,t)},d(a){a&&Ie(e)}}}function cle(s,e){let t,r,a,u,f,h,g,y,C,A,O=dd(e[9].schemas,e[15],e[4])+"",N,L,j,z,q,ee,F,ne,oe,re,J,we,ye;function De(...be){return e[13](e[15],...be)}function _e(...be){return e[14](e[15],...be)}return F=new r2({props:{name:Dp(e[2],e[15]._sys.updatedBy),side:24}}),oe=new Uwe({props:{record:e[15],graph:e[4],schema:e[1],visibleColumns:e[8],sort:e[6],systemFields:e[5],inModal:e[7],users:e[2]}}),{key:s,first:null,c(){t=ce("tr"),r=ce("td"),a=ce("div"),u=ce("div"),f=ce("div"),h=ce("input"),C=Xe(),A=ce("a"),N=Kt(O),q=Xe(),ee=ce("div"),rn(F.$$.fragment),ne=Xe(),rn(oe.$$.fragment),re=Xe(),W(h,"class","form-check-input "),W(h,"type","checkbox"),h.checked=g=e[0].find(De),h.value=y=e[15],W(f,"class","form-check"),W(A,"class","me-2 text-decoration-none text-dark fs-6"),W(A,"href",L=e[9].lucentUrl+"/records/"+e[15].id),W(A,"target",j=e[7]?"_blank":"_self"),W(A,"title",z=dd(e[9].schemas,e[15],e[4])),W(A,"data-bs-toggle","tooltip"),W(A,"data-bs-placement","left"),W(u,"class","d-flex align-items-center "),W(a,"class","title-td-contents d-inline-flex justify-content-between w-100 align-items-center"),W(r,"class","title-td"),this.first=t},m(be,tt){Le(be,t,tt),Q(t,r),Q(r,a),Q(a,u),Q(u,f),Q(f,h),Q(u,C),Q(u,A),Q(A,N),Q(a,q),Q(a,ee),on(F,ee,null),Q(t,ne),on(oe,t,null),Q(t,re),J=!0,we||(ye=Dn(h,"change",_e),we=!0)},p(be,tt){e=be,(!J||tt&9&&g!==(g=e[0].find(De)))&&(h.checked=g),(!J||tt&8&&y!==(y=e[15]))&&(h.value=y),(!J||tt&24)&&O!==(O=dd(e[9].schemas,e[15],e[4])+"")&&Gn(N,O),(!J||tt&8&&L!==(L=e[9].lucentUrl+"/records/"+e[15].id))&&W(A,"href",L),(!J||tt&128&&j!==(j=e[7]?"_blank":"_self"))&&W(A,"target",j),(!J||tt&24&&z!==(z=dd(e[9].schemas,e[15],e[4])))&&W(A,"title",z);const Qe={};tt&12&&(Qe.name=Dp(e[2],e[15]._sys.updatedBy)),F.$set(Qe);const ft={};tt&8&&(ft.record=e[15]),tt&16&&(ft.graph=e[4]),tt&2&&(ft.schema=e[1]),tt&256&&(ft.visibleColumns=e[8]),tt&64&&(ft.sort=e[6]),tt&32&&(ft.systemFields=e[5]),tt&128&&(ft.inModal=e[7]),tt&4&&(ft.users=e[2]),oe.$set(ft)},i(be){J||(Re(F.$$.fragment,be),Re(oe.$$.fragment,be),J=!0)},o(be){Ue(F.$$.fragment,be),Ue(oe.$$.fragment,be),J=!1},d(be){be&&Ie(t),sn(F),sn(oe),we=!1,ye()}}}function Wwe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N=[],L=new Map,j,z,q,ee=s[8],F=[];for(let we=0;we<ee.length;we+=1)F[we]=ale(ile(s,ee,we));let ne=s[5].filter(s[12]),oe=[];for(let we=0;we<ne.length;we+=1)oe[we]=lle(rle(s,ne,we));let re=s[3];const J=we=>we[15].id;for(let we=0;we<re.length;we+=1){let ye=sle(s,re,we),De=J(ye);L.set(De,N[we]=cle(De,ye))}return{c(){e=ce("div"),t=ce("table"),r=ce("thead"),a=ce("tr"),u=ce("th"),f=ce("input"),y=Xe();for(let we=0;we<F.length;we+=1)F[we].c();C=Xe();for(let we=0;we<oe.length;we+=1)oe[we].c();A=Xe(),O=ce("tbody");for(let we=0;we<N.length;we+=1)N[we].c();f.indeterminate=h=s[0].length>0&&s[0].length<s[3].length,f.checked=g=s[0].length==s[3].length,W(f,"class","form-check-input"),W(f,"type","checkbox"),W(r,"class","table-light"),W(t,"class",""),W(e,"class","lx-table rounded")},m(we,ye){Le(we,e,ye),Q(e,t),Q(t,r),Q(r,a),Q(a,u),Q(u,f),Q(a,y);for(let De=0;De<F.length;De+=1)F[De]&&F[De].m(a,null);Q(a,C);for(let De=0;De<oe.length;De+=1)oe[De]&&oe[De].m(a,null);Q(t,A),Q(t,O);for(let De=0;De<N.length;De+=1)N[De]&&N[De].m(O,null);j=!0,z||(q=Dn(f,"change",$u(s[10])),z=!0)},p(we,[ye]){if((!j||ye&9&&h!==(h=we[0].length>0&&we[0].length<we[3].length))&&(f.indeterminate=h),(!j||ye&9&&g!==(g=we[0].length==we[3].length))&&(f.checked=g),ye&320){ee=we[8];let De;for(De=0;De<ee.length;De+=1){const _e=ile(we,ee,De);F[De]?F[De].p(_e,ye):(F[De]=ale(_e),F[De].c(),F[De].m(a,C))}for(;De<F.length;De+=1)F[De].d(1);F.length=ee.length}if(ye&34){ne=we[5].filter(we[12]);let De;for(De=0;De<ne.length;De+=1){const _e=rle(we,ne,De);oe[De]?oe[De].p(_e,ye):(oe[De]=lle(_e),oe[De].c(),oe[De].m(a,null))}for(;De<oe.length;De+=1)oe[De].d(1);oe.length=ne.length}ye&3071&&(re=we[3],To(),N=Om(N,ye,J,1,we,re,L,O,f2,cle,null,sle),Do())},i(we){if(!j){for(let ye=0;ye<re.length;ye+=1)Re(N[ye]);j=!0}},o(we){for(let ye=0;ye<N.length;ye+=1)Ue(N[ye]);j=!1},d(we){we&&Ie(e),ul(F,we),ul(oe,we);for(let ye=0;ye<N.length;ye+=1)N[ye].d();z=!1,q()}}}function jwe(s,e,t){let r;const a=ji("channel");let{schema:u}=e,{users:f}=e,{records:h}=e,{graph:g}=e,{systemFields:y}=e,{sort:C}=e,{inModal:A}=e,{selected:O=[]}=e;function N(ee){O.length===h.length?t(0,O=[]):t(0,O=h),ee.currentTarget.checked=O.length>0}function L(ee,F){O.find(oe=>oe.id==F.id)?t(0,O=O.filter(oe=>oe.id!==F.id)):t(0,O=[...O,F])}const j=ee=>u.visible.includes(ee.name),z=(ee,F)=>F.id===ee.id,q=(ee,F)=>L(F,ee);return s.$$set=ee=>{"schema"in ee&&t(1,u=ee.schema),"users"in ee&&t(2,f=ee.users),"records"in ee&&t(3,h=ee.records),"graph"in ee&&t(4,g=ee.graph),"systemFields"in ee&&t(5,y=ee.systemFields),"sort"in ee&&t(6,C=ee.sort),"inModal"in ee&&t(7,A=ee.inModal),"selected"in ee&&t(0,O=ee.selected)},s.$$.update=()=>{s.$$.dirty&2&&t(8,r=u.fields.filter(ee=>u.visible.includes(ee.name)))},[O,u,f,h,g,y,C,A,r,a,N,L,j,z,q]}class Zwe extends ko{constructor(e){super(),So(this,e,jwe,Wwe,Co,{schema:1,users:2,records:3,graph:4,systemFields:5,sort:6,inModal:7,selected:0})}}function ule(s,e,t){const r=s.slice();return r[22]=e[t],r}function qwe(s){let e,t,r,a;function u(g){s[17](g)}function f(g){s[18](g)}let h={systemFields:s[12],sort:s[2],operators:s[3],filter:s[4],inModal:s[13],modalUrl:s[8]};return s[0]!==void 0&&(h.schema=s[0]),s[1]!==void 0&&(h.records=s[1]),e=new Q2e({props:h}),ss.push(()=>Er(e,"schema",u)),ss.push(()=>Er(e,"records",f)),e.$on("refresh",s[16]),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&4096&&(C.systemFields=g[12]),y&4&&(C.sort=g[2]),y&8&&(C.operators=g[3]),y&16&&(C.filter=g[4]),y&8192&&(C.inModal=g[13]),y&256&&(C.modalUrl=g[8]),!t&&y&1&&(t=!0,C.schema=g[0],Dr(()=>t=!1)),!r&&y&2&&(r=!0,C.records=g[1],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){sn(e,g)}}}function Gwe(s){let e,t;return e=new dwe({props:{schema:s[0],selected:s[9],inModal:s[13],filter:s[4]}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1&&(u.schema=r[0]),a&512&&(u.selected=r[9]),a&8192&&(u.inModal=r[13]),a&16&&(u.filter=r[4]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function Kwe(s){let e,t=[],r=new Map,a,u=s[1];const f=h=>h[22].id;for(let h=0;h<u.length;h+=1){let g=ule(s,u,h),y=f(g);r.set(y,t[h]=fle(y,g))}return{c(){e=ce("div");for(let h=0;h<t.length;h+=1)t[h].c();W(e,"class","row"),os(e,"max-width","1000px")},m(h,g){Le(h,e,g);for(let y=0;y<t.length;y+=1)t[y]&&t[y].m(e,null);a=!0},p(h,g){g&49666&&(u=h[1],To(),t=Om(t,g,f,1,h,u,r,e,f2,fle,null,ule),Do())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Re(t[g]);a=!0}},o(h){for(let g=0;g<t.length;g+=1)Ue(t[g]);a=!1},d(h){h&&Ie(e);for(let g=0;g<t.length;g+=1)t[g].d()}}}function Ywe(s){let e,t,r;function a(f){s[19](f)}let u={records:s[1],graph:s[11],schema:s[0],sort:s[2],systemFields:s[12],inModal:s[13],users:s[10]};return s[9]!==void 0&&(u.selected=s[9]),e=new Zwe({props:u}),ss.push(()=>Er(e,"selected",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&2&&(g.records=f[1]),h&2048&&(g.graph=f[11]),h&1&&(g.schema=f[0]),h&4&&(g.sort=f[2]),h&4096&&(g.systemFields=f[12]),h&8192&&(g.inModal=f[13]),h&1024&&(g.users=f[10]),!t&&h&512&&(t=!0,g.selected=f[9],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function fle(s,e){let t,r,a,u,f,h,g,y,C,A,O,N=e[22]._file.path+"",L,j,z,q,ee,F=e[22]._file.mime+"",ne,oe,re,J,we;function ye(..._e){return e[20](e[22],..._e)}function De(..._e){return e[21](e[22],..._e)}return C=new P_({props:{record:e[22],size:"medium"}}),{key:s,first:null,c(){t=ce("div"),r=ce("div"),a=ce("div"),u=ce("input"),g=Xe(),y=ce("div"),rn(C.$$.fragment),A=Xe(),O=ce("a"),L=Kt(N),q=Xe(),ee=ce("span"),ne=Kt(F),oe=Xe(),W(u,"class","form-check-input "),W(u,"type","checkbox"),u.checked=f=e[9].find(ye),u.value=h=e[22],W(a,"class","form-check svelte-1xyvs2b"),W(y,"class","d-flex justify-content-center"),W(O,"href",j=e[14].lucentUrl+"/records/"+e[22].id),W(O,"title",z=e[22]._file.path),W(O,"class","d-block text-center overflow-hidden text-nowrap my-2 "),os(O,"text-overflow","ellipsis"),os(O,"font-size","13px"),os(O,"color","#333"),W(ee,"class","lx-small-text text-muted d-block text-center"),W(r,"class","file-wrapper rounded p-2 mb-4 bg-light"),_s(r,"selected",e[9].includes(e[22])),W(t,"class","col-6 col-md-4"),this.first=t},m(_e,be){Le(_e,t,be),Q(t,r),Q(r,a),Q(a,u),Q(r,g),Q(r,y),on(C,y,null),Q(r,A),Q(r,O),Q(O,L),Q(r,q),Q(r,ee),Q(ee,ne),Q(t,oe),re=!0,J||(we=Dn(u,"change",De),J=!0)},p(_e,be){e=_e,(!re||be&514&&f!==(f=e[9].find(ye)))&&(u.checked=f),(!re||be&2&&h!==(h=e[22]))&&(u.value=h);const tt={};be&2&&(tt.record=e[22]),C.$set(tt),(!re||be&2)&&N!==(N=e[22]._file.path+"")&&Gn(L,N),(!re||be&2&&j!==(j=e[14].lucentUrl+"/records/"+e[22].id))&&W(O,"href",j),(!re||be&2&&z!==(z=e[22]._file.path))&&W(O,"title",z),(!re||be&2)&&F!==(F=e[22]._file.mime+"")&&Gn(ne,F),(!re||be&514)&&_s(r,"selected",e[9].includes(e[22]))},i(_e){re||(Re(C.$$.fragment,_e),re=!0)},o(_e){Ue(C.$$.fragment,_e),re=!1},d(_e){_e&&Ie(t),sn(C),J=!1,we()}}}function Xwe(s){let e,t,r,a=s[0].label+"",u,f,h,g,y,C,A,O,N,L,j;const z=[Gwe,qwe],q=[];function ee(re,J){return re[9].length>0&&!re[13]?0:1}h=ee(s),g=q[h]=z[h](s);const F=[Ywe,Kwe],ne=[];function oe(re,J){return re[0].type==="collection"?0:1}return C=oe(s),A=ne[C]=F[C](s),L=new awe({props:{limit:s[5],skip:s[6],total:s[7],inModal:s[13],modalUrl:s[8]}}),L.$on("refresh",s[16]),{c(){e=ce("div"),t=ce("div"),r=ce("h3"),u=Kt(a),f=Xe(),g.c(),y=Xe(),A.c(),N=Xe(),rn(L.$$.fragment),W(r,"class","header-normal mb-5 "),W(t,"class",O="lx-card mb-4 "+(s[13]?"mt-0":"mt-5")),W(e,"class","wrapper-large transparent ")},m(re,J){Le(re,e,J),Q(e,t),Q(t,r),Q(r,u),Q(t,f),q[h].m(t,null),Q(t,y),ne[C].m(t,null),Q(e,N),on(L,e,null),j=!0},p(re,[J]){(!j||J&1)&&a!==(a=re[0].label+"")&&Gn(u,a);let we=h;h=ee(re),h===we?q[h].p(re,J):(To(),Ue(q[we],1,1,()=>{q[we]=null}),Do(),g=q[h],g?g.p(re,J):(g=q[h]=z[h](re),g.c()),Re(g,1),g.m(t,y));let ye=C;C=oe(re),C===ye?ne[C].p(re,J):(To(),Ue(ne[ye],1,1,()=>{ne[ye]=null}),Do(),A=ne[C],A?A.p(re,J):(A=ne[C]=F[C](re),A.c()),Re(A,1),A.m(t,null)),(!j||J&8192&&O!==(O="lx-card mb-4 "+(re[13]?"mt-0":"mt-5")))&&W(t,"class",O);const De={};J&32&&(De.limit=re[5]),J&64&&(De.skip=re[6]),J&128&&(De.total=re[7]),J&8192&&(De.inModal=re[13]),J&256&&(De.modalUrl=re[8]),L.$set(De)},i(re){j||(Re(g),Re(A),Re(L.$$.fragment,re),j=!0)},o(re){Ue(g),Ue(A),Ue(L.$$.fragment,re),j=!1},d(re){re&&Ie(e),q[h].d(),ne[C].d(),sn(L)}}}function Jwe(s,e,t){const r=ji("channel");let{schema:a}=e,{users:u}=e,{records:f}=e,{graph:h}=e,{systemFields:g}=e,{sort:y}=e,{operators:C}=e,{filter:A}=e,{limit:O}=e,{skip:N}=e,{total:L}=e,{inModal:j}=e,{modalUrl:z}=e,{selected:q=[]}=e;function ee(ye,De){q.find(be=>be.id===De.id)?t(9,q=q.filter(be=>be.id!==De.id)):t(9,q=[...q,De])}function F(ye){const De=ye.detail;axios.get(De).then(_e=>{t(1,f=_e.data.records),t(2,y=_e.data.sort),t(3,C=_e.data.operators),t(4,A=_e.data.filter),t(6,N=_e.data.skip),t(5,O=_e.data.limit),t(7,L=_e.data.total),t(8,z=_e.data.modalUrl)}).catch(_e=>{console.log(_e)})}function ne(ye){a=ye,t(0,a)}function oe(ye){f=ye,t(1,f)}function re(ye){q=ye,t(9,q)}const J=(ye,De)=>De.id===ye.id,we=(ye,De)=>ee(De,ye);return s.$$set=ye=>{"schema"in ye&&t(0,a=ye.schema),"users"in ye&&t(10,u=ye.users),"records"in ye&&t(1,f=ye.records),"graph"in ye&&t(11,h=ye.graph),"systemFields"in ye&&t(12,g=ye.systemFields),"sort"in ye&&t(2,y=ye.sort),"operators"in ye&&t(3,C=ye.operators),"filter"in ye&&t(4,A=ye.filter),"limit"in ye&&t(5,O=ye.limit),"skip"in ye&&t(6,N=ye.skip),"total"in ye&&t(7,L=ye.total),"inModal"in ye&&t(13,j=ye.inModal),"modalUrl"in ye&&t(8,z=ye.modalUrl),"selected"in ye&&t(9,q=ye.selected)},[a,f,y,C,A,O,N,L,z,q,u,h,g,j,r,ee,F,ne,oe,re,J,we]}class Hhe extends ko{constructor(e){super(),So(this,e,Jwe,Xwe,Co,{schema:0,users:10,records:1,graph:11,systemFields:12,sort:2,operators:3,filter:4,limit:5,skip:6,total:7,inModal:13,modalUrl:8,selected:9})}}function dle(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee,F,ne,oe,re,J=s[1].length>0&&hle(s);const we=[s[2]];function ye(_e){s[8](_e)}let De={};for(let _e=0;_e<we.length;_e+=1)De=tI(De,we[_e]);return s[1]!==void 0&&(De.selected=s[1]),ee=new Hhe({props:De}),ss.push(()=>Er(ee,"selected",ye)),{c(){e=ce("div"),t=ce("div"),r=ce("div"),a=ce("div"),u=ce("div"),f=ce("button"),h=Kt("Insert"),y=Xe(),C=ce("button"),A=Kt("Replace"),N=Xe(),J&&J.c(),L=Xe(),j=ce("button"),z=Xe(),q=ce("div"),rn(ee.$$.fragment),W(f,"type","button"),W(f,"class","btn btn-primary me-1"),f.disabled=g=s[1].length===0,W(C,"type","button"),W(C,"class","btn btn-outline-primary me-3"),C.disabled=O=s[1].length===0,W(u,"class","d-flex align-items-center"),W(j,"type","button"),W(j,"class","btn-close"),W(j,"data-bs-dismiss","modal"),W(j,"aria-label","Close"),W(a,"class","modal-header"),W(q,"class","modal-body"),W(r,"class","modal-content svelte-1mf5922"),W(t,"class","modal-dialog modal-dialog-centered modal-dialog-scrollable svelte-1mf5922"),W(e,"class","modal fade show"),W(e,"tabindex","-1"),W(e,"aria-modal","true"),W(e,"role","dialog"),os(e,"background","rgba(100,100,100,.6)"),_s(e,"d-block",s[0])},m(_e,be){Le(_e,e,be),Q(e,t),Q(t,r),Q(r,a),Q(a,u),Q(u,f),Q(f,h),Q(u,y),Q(u,C),Q(C,A),Q(u,N),J&&J.m(u,null),Q(a,L),Q(a,j),Q(r,z),Q(r,q),on(ee,q,null),ne=!0,oe||(re=[Dn(f,"click",s[3]),Dn(C,"click",s[4]),Dn(j,"click",$u(s[7]))],oe=!0)},p(_e,be){(!ne||be&2&&g!==(g=_e[1].length===0))&&(f.disabled=g),(!ne||be&2&&O!==(O=_e[1].length===0))&&(C.disabled=O),_e[1].length>0?J?J.p(_e,be):(J=hle(_e),J.c(),J.m(u,null)):J&&(J.d(1),J=null);const tt=be&4?$V(we,[zV(_e[2])]):{};!F&&be&2&&(F=!0,tt.selected=_e[1],Dr(()=>F=!1)),ee.$set(tt),(!ne||be&1)&&_s(e,"d-block",_e[0])},i(_e){ne||(Re(ee.$$.fragment,_e),ne=!0)},o(_e){Ue(ee.$$.fragment,_e),ne=!1},d(_e){_e&&Ie(e),J&&J.d(),sn(ee),oe=!1,Zi(re)}}}function hle(s){let e,t=s[1].length+"",r,a;return{c(){e=ce("span"),r=Kt(t),a=Kt(" records selected"),W(e,"class","")},m(u,f){Le(u,e,f),Q(e,r),Q(e,a)},p(u,f){f&2&&t!==(t=u[1].length+"")&&Gn(r,t)},d(u){u&&Ie(e)}}}function Qwe(s){let e,t,r=s[2].schema&&dle(s);return{c(){r&&r.c(),e=Rs()},m(a,u){r&&r.m(a,u),Le(a,e,u),t=!0},p(a,[u]){a[2].schema?r?(r.p(a,u),u&4&&Re(r,1)):(r=dle(a),r.c(),Re(r,1),r.m(e.parentNode,e)):r&&(To(),Ue(r,1,1,()=>{r=null}),Do())},i(a){t||(Re(r),t=!0)},o(a){Ue(r),t=!1},d(a){r&&r.d(a),a&&Ie(e)}}}function e_e(s,e,t){let r;const a=Ip(),u=ji("channel");let f=!1,h=[];function g(j){t(0,f=!0),C(j)}function y(){t(0,f=!1),t(1,h=[])}function C(j){axios.get(u.lucentUrl+"/content/"+j).then(z=>{t(2,r=z.data)}).catch(z=>console.log(z))}function A(j){j.preventDefault(),a("insert",{records:h,action:"insert"})}function O(j){j.preventDefault(),a("insert",{records:h,action:"replace"})}const N=j=>t(0,f=!1);function L(j){h=j,t(1,h)}return t(2,r={}),[f,h,r,A,O,g,y,N,L]}class $he extends ko{constructor(e){super(),So(this,e,e_e,Qwe,Co,{open:5,close:6})}get open(){return this.$$.ctx[5]}get close(){return this.$$.ctx[6]}}function mle(s,e,t){const r=s.slice();return r[18]=e[t],r}function t_e(s){let e,t,r,a,u,f,h,g,y;return f=new wl({props:{icon:"magnifying-glass"}}),{c(){e=ce("div"),t=ce("div"),r=ce("button"),r.textContent="New",a=Xe(),u=ce("button"),rn(f.$$.fragment),W(r,"class","btn btn-sm btn-primary"),W(u,"class","btn btn-sm btn-outline-primary"),W(t,"class","mb-2"),W(e,"class","pb-2 text-start")},m(C,A){Le(C,e,A),Q(e,t),Q(t,r),Q(t,a),Q(t,u),on(f,u,null),h=!0,g||(y=[Dn(r,"click",s[12]),Dn(u,"click",s[13])],g=!0)},p:Sn,i(C){h||(Re(f.$$.fragment,C),h=!0)},o(C){Ue(f.$$.fragment,C),h=!1},d(C){C&&Ie(e),sn(f),g=!1,Zi(y)}}}function n_e(s){let e,t,r,a,u,f,h;t=new wl({props:{width:24,height:24,icon:"circle-plus"}});let g=s[4]&&gle(s);return{c(){e=ce("button"),rn(t.$$.fragment),r=Xe(),g&&g.c(),a=Rs(),W(e,"type","button"),W(e,"class","btn btn-lg btn-link text-decoration-none inline-card-button svelte-1lp73xk"),_s(e,"is-first",!s[1])},m(y,C){Le(y,e,C),on(t,e,null),Le(y,r,C),g&&g.m(y,C),Le(y,a,C),u=!0,f||(h=Dn(e,"click",$u(s[9])),f=!0)},p(y,C){(!u||C&2)&&_s(e,"is-first",!y[1]),y[4]?g?(g.p(y,C),C&16&&Re(g,1)):(g=gle(y),g.c(),Re(g,1),g.m(a.parentNode,a)):g&&(To(),Ue(g,1,1,()=>{g=null}),Do())},i(y){u||(Re(t.$$.fragment,y),Re(g),u=!0)},o(y){Ue(t.$$.fragment,y),Ue(g),u=!1},d(y){y&&Ie(e),sn(t),y&&Ie(r),g&&g.d(y),y&&Ie(a),f=!1,h()}}}function gle(s){let e,t,r=s[0],a=[];for(let f=0;f<r.length;f+=1)a[f]=ple(mle(s,r,f));const u=f=>Ue(a[f],1,1,()=>{a[f]=null});return{c(){e=ce("div");for(let f=0;f<a.length;f+=1)a[f].c();W(e,"class","bg-light lx-card d-flex")},m(f,h){Le(f,e,h);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(e,null);t=!0},p(f,h){if(h&289){r=f[0];let g;for(g=0;g<r.length;g+=1){const y=mle(f,r,g);a[g]?(a[g].p(y,h),Re(a[g],1)):(a[g]=ple(y),a[g].c(),Re(a[g],1),a[g].m(e,null))}for(To(),g=r.length;g<a.length;g+=1)u(g);Do()}},i(f){if(!t){for(let h=0;h<r.length;h+=1)Re(a[h]);t=!0}},o(f){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)Ue(a[h]);t=!1},d(f){f&&Ie(e),ul(a,f)}}}function ple(s){let e,t,r=s[18].label+"",a,u,f,h,g,y,C,A,O,N,L;function j(...q){return s[10](s[18],...q)}C=new wl({props:{icon:"magnifying-glass"}});function z(...q){return s[11](s[18],...q)}return{c(){e=ce("div"),t=ce("p"),a=Kt(r),u=Xe(),f=ce("div"),h=ce("button"),h.textContent="New",g=Xe(),y=ce("button"),rn(C.$$.fragment),A=Xe(),W(h,"class","btn btn-sm btn-primary"),W(y,"class","btn btn-sm btn-outline-primary"),W(f,"class","mb-2"),W(e,"class","lx-card p-4 text-center me-4"),os(e,"max-width","250px")},m(q,ee){Le(q,e,ee),Q(e,t),Q(t,a),Q(e,u),Q(e,f),Q(f,h),Q(f,g),Q(f,y),on(C,y,null),Q(e,A),O=!0,N||(L=[Dn(h,"click",j),Dn(y,"click",z)],N=!0)},p(q,ee){s=q,(!O||ee&1)&&r!==(r=s[18].label+"")&&Gn(a,r)},i(q){O||(Re(C.$$.fragment,q),O=!0)},o(q){Ue(C.$$.fragment,q),O=!1},d(q){q&&Ie(e),sn(C),N=!1,Zi(L)}}}function ble(s){let e,t;const r=[s[3]];let a={};for(let u=0;u<r.length;u+=1)a=tI(a,r[u]);return e=new Ihe({props:a}),e.$on("cancel",s[14]),e.$on("inlinesaved",s[6]),{c(){rn(e.$$.fragment)},m(u,f){on(e,u,f),t=!0},p(u,f){const h=f&8?$V(r,[zV(u[3])]):{};e.$set(h)},i(u){t||(Re(e.$$.fragment,u),t=!0)},o(u){Ue(e.$$.fragment,u),t=!1},d(u){sn(e,u)}}}function o_e(s){let e,t,r,a,u,f;const h=[n_e,t_e],g=[];function y(O,N){return O[0].length>1?0:1}e=y(s),t=g[e]=h[e](s);let C=s[3]&&ble(s),A={};return u=new $he({props:A}),s[15](u),u.$on("insert",s[7]),{c(){t.c(),r=Xe(),C&&C.c(),a=Xe(),rn(u.$$.fragment)},m(O,N){g[e].m(O,N),Le(O,r,N),C&&C.m(O,N),Le(O,a,N),on(u,O,N),f=!0},p(O,[N]){let L=e;e=y(O),e===L?g[e].p(O,N):(To(),Ue(g[L],1,1,()=>{g[L]=null}),Do(),t=g[e],t?t.p(O,N):(t=g[e]=h[e](O),t.c()),Re(t,1),t.m(r.parentNode,r)),O[3]?C?(C.p(O,N),N&8&&Re(C,1)):(C=ble(O),C.c(),Re(C,1),C.m(a.parentNode,a)):C&&(To(),Ue(C,1,1,()=>{C=null}),Do());const j={};u.$set(j)},i(O){f||(Re(t),Re(C),Re(u.$$.fragment,O),f=!0)},o(O){Ue(t),Ue(C),Ue(u.$$.fragment,O),f=!1},d(O){g[e].d(O),O&&Ie(r),C&&C.d(O),O&&Ie(a),s[15](null),sn(u,O)}}}function s_e(s,e,t){let r;const a=Ip(),u=ji("channel");let{schemas:f}=e,{recordId:h}=e,g,y;function C(oe,re){oe.preventDefault(),g.open(re)}function A(oe){oe.preventDefault(),console.log("Save inline"),t(3,y=null),a("save",{records:oe.detail.records,after:h})}function O(oe){oe.preventDefault(),g.close(),t(4,r=!1),a("insert",{records:oe.detail.records,after:h})}function N(oe,re){oe.preventDefault(),axios.get(u.lucentUrl+"/records/newInline?schema="+re).then(J=>{t(3,y=J.data),t(4,r=!1)}).catch(J=>{console.log(J)})}const L=oe=>t(4,r=!r),j=(oe,re)=>N(re,oe.name),z=(oe,re)=>C(re,oe.name),q=oe=>N(oe,f[0].name),ee=oe=>C(oe,f[0].name),F=oe=>t(3,y=null);function ne(oe){ss[oe?"unshift":"push"](()=>{g=oe,t(2,g)})}return s.$$set=oe=>{"schemas"in oe&&t(0,f=oe.schemas),"recordId"in oe&&t(1,h=oe.recordId)},t(4,r=!1),[f,h,g,y,r,C,A,O,N,L,j,z,q,ee,F,ne]}class lI extends ko{constructor(e){super(),So(this,e,s_e,o_e,Co,{schemas:0,recordId:1})}}/**!
* Sortable 1.15.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/function vle(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(s,a).enumerable})),t.push.apply(t,r)}return t}function i2(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?vle(Object(t),!0).forEach(function(r){r_e(s,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):vle(Object(t)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(t,r))})}return s}function Tz(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Tz=function(e){return typeof e}:Tz=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tz(s)}function r_e(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function D_(){return D_=Object.assign||function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(s[r]=t[r])}return s},D_.apply(this,arguments)}function i_e(s,e){if(s==null)return{};var t={},r=Object.keys(s),a,u;for(u=0;u<r.length;u++)a=r[u],!(e.indexOf(a)>=0)&&(t[a]=s[a]);return t}function a_e(s,e){if(s==null)return{};var t=i_e(s,e),r,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);for(a=0;a<u.length;a++)r=u[a],!(e.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(s,r)||(t[r]=s[r]))}return t}var l_e="1.15.0";function x_(s){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(s)}var I_=x_(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),cI=x_(/Edge/i),yle=x_(/firefox/i),CP=x_(/safari/i)&&!x_(/chrome/i)&&!x_(/android/i),zhe=x_(/iP(ad|od|hone)/i),Vhe=x_(/chrome/i)&&x_(/android/i),Uhe={capture:!1,passive:!1};function ll(s,e,t){s.addEventListener(e,t,!I_&&Uhe)}function Ia(s,e,t){s.removeEventListener(e,t,!I_&&Uhe)}function Qz(s,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),s)try{if(s.matches)return s.matches(e);if(s.msMatchesSelector)return s.msMatchesSelector(e);if(s.webkitMatchesSelector)return s.webkitMatchesSelector(e)}catch{return!1}return!1}}function c_e(s){return s.host&&s!==document&&s.host.nodeType?s.host:s.parentNode}function Gy(s,e,t,r){if(s){t=t||document;do{if(e!=null&&(e[0]===">"?s.parentNode===t&&Qz(s,e):Qz(s,e))||r&&s===t)return s;if(s===t)break}while(s=c_e(s))}return null}var wle=/\s+/g;function x1(s,e,t){if(s&&e)if(s.classList)s.classList[t?"add":"remove"](e);else{var r=(" "+s.className+" ").replace(wle," ").replace(" "+e+" "," ");s.className=(r+(t?" "+e:"")).replace(wle," ")}}function zr(s,e,t){var r=s&&s.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(s,""):s.currentStyle&&(t=s.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function GD(s,e){var t="";if(typeof s=="string")t=s;else do{var r=zr(s,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(s=s.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function Whe(s,e,t){if(s){var r=s.getElementsByTagName(e),a=0,u=r.length;if(t)for(;a<u;a++)t(r[a],a);return r}return[]}function t2(){var s=document.scrollingElement;return s||document.documentElement}function ud(s,e,t,r,a){if(!(!s.getBoundingClientRect&&s!==window)){var u,f,h,g,y,C,A;if(s!==window&&s.parentNode&&s!==t2()?(u=s.getBoundingClientRect(),f=u.top,h=u.left,g=u.bottom,y=u.right,C=u.height,A=u.width):(f=0,h=0,g=window.innerHeight,y=window.innerWidth,C=window.innerHeight,A=window.innerWidth),(e||t)&&s!==window&&(a=a||s.parentNode,!I_))do if(a&&a.getBoundingClientRect&&(zr(a,"transform")!=="none"||t&&zr(a,"position")!=="static")){var O=a.getBoundingClientRect();f-=O.top+parseInt(zr(a,"border-top-width")),h-=O.left+parseInt(zr(a,"border-left-width")),g=f+u.height,y=h+u.width;break}while(a=a.parentNode);if(r&&s!==window){var N=GD(a||s),L=N&&N.a,j=N&&N.d;N&&(f/=j,h/=L,A/=L,C/=j,g=f+C,y=h+A)}return{top:f,left:h,bottom:g,right:y,width:A,height:C}}}function _le(s,e,t){for(var r=rk(s,!0),a=ud(s)[e];r;){var u=ud(r)[t],f=void 0;if(t==="top"||t==="left"?f=a>=u:f=a<=u,!f)return r;if(r===t2())break;r=rk(r,!1)}return!1}function sO(s,e,t,r){for(var a=0,u=0,f=s.children;u<f.length;){if(f[u].style.display!=="none"&&f[u]!==Vr.ghost&&(r||f[u]!==Vr.dragged)&&Gy(f[u],t.draggable,s,!1)){if(a===e)return f[u];a++}u++}return null}function Moe(s,e){for(var t=s.lastElementChild;t&&(t===Vr.ghost||zr(t,"display")==="none"||e&&!Qz(t,e));)t=t.previousElementSibling;return t||null}function D0(s,e){var t=0;if(!s||!s.parentNode)return-1;for(;s=s.previousElementSibling;)s.nodeName.toUpperCase()!=="TEMPLATE"&&s!==Vr.clone&&(!e||Qz(s,e))&&t++;return t}function Cle(s){var e=0,t=0,r=t2();if(s)do{var a=GD(s),u=a.a,f=a.d;e+=s.scrollLeft*u,t+=s.scrollTop*f}while(s!==r&&(s=s.parentNode));return[e,t]}function u_e(s,e){for(var t in s)if(!!s.hasOwnProperty(t)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===s[t][r])return Number(t)}return-1}function rk(s,e){if(!s||!s.getBoundingClientRect)return t2();var t=s,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var a=zr(t);if(t.clientWidth<t.scrollWidth&&(a.overflowX=="auto"||a.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(a.overflowY=="auto"||a.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return t2();if(r||e)return t;r=!0}}while(t=t.parentNode);return t2()}function f_e(s,e){if(s&&e)for(var t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);return s}function ute(s,e){return Math.round(s.top)===Math.round(e.top)&&Math.round(s.left)===Math.round(e.left)&&Math.round(s.height)===Math.round(e.height)&&Math.round(s.width)===Math.round(e.width)}var SP;function jhe(s,e){return function(){if(!SP){var t=arguments,r=this;t.length===1?s.call(r,t[0]):s.apply(r,t),SP=setTimeout(function(){SP=void 0},e)}}}function d_e(){clearTimeout(SP),SP=void 0}function Zhe(s,e,t){s.scrollLeft+=e,s.scrollTop+=t}function qhe(s){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(s).cloneNode(!0):t?t(s).clone(!0)[0]:s.cloneNode(!0)}var M1="Sortable"+new Date().getTime();function h_e(){var s=[],e;return{captureAnimationState:function(){if(s=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(a){if(!(zr(a,"display")==="none"||a===Vr.ghost)){s.push({target:a,rect:ud(a)});var u=i2({},s[s.length-1].rect);if(a.thisAnimationDuration){var f=GD(a,!0);f&&(u.top-=f.f,u.left-=f.e)}a.fromRect=u}})}},addAnimationState:function(r){s.push(r)},removeAnimationState:function(r){s.splice(u_e(s,{target:r}),1)},animateAll:function(r){var a=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var u=!1,f=0;s.forEach(function(h){var g=0,y=h.target,C=y.fromRect,A=ud(y),O=y.prevFromRect,N=y.prevToRect,L=h.rect,j=GD(y,!0);j&&(A.top-=j.f,A.left-=j.e),y.toRect=A,y.thisAnimationDuration&&ute(O,A)&&!ute(C,A)&&(L.top-A.top)/(L.left-A.left)===(C.top-A.top)/(C.left-A.left)&&(g=g_e(L,O,N,a.options)),ute(A,C)||(y.prevFromRect=C,y.prevToRect=A,g||(g=a.options.animation),a.animate(y,L,A,g)),g&&(u=!0,f=Math.max(f,g),clearTimeout(y.animationResetTimer),y.animationResetTimer=setTimeout(function(){y.animationTime=0,y.prevFromRect=null,y.fromRect=null,y.prevToRect=null,y.thisAnimationDuration=null},g),y.thisAnimationDuration=g)}),clearTimeout(e),u?e=setTimeout(function(){typeof r=="function"&&r()},f):typeof r=="function"&&r(),s=[]},animate:function(r,a,u,f){if(f){zr(r,"transition",""),zr(r,"transform","");var h=GD(this.el),g=h&&h.a,y=h&&h.d,C=(a.left-u.left)/(g||1),A=(a.top-u.top)/(y||1);r.animatingX=!!C,r.animatingY=!!A,zr(r,"transform","translate3d("+C+"px,"+A+"px,0)"),this.forRepaintDummy=m_e(r),zr(r,"transition","transform "+f+"ms"+(this.options.easing?" "+this.options.easing:"")),zr(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){zr(r,"transition",""),zr(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},f)}}}}function m_e(s){return s.offsetWidth}function g_e(s,e,t,r){return Math.sqrt(Math.pow(e.top-s.top,2)+Math.pow(e.left-s.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*r.animation}var DD=[],fte={initializeByDefault:!0},uI={mount:function(e){for(var t in fte)fte.hasOwnProperty(t)&&!(t in e)&&(e[t]=fte[t]);DD.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),DD.push(e)},pluginEvent:function(e,t,r){var a=this;this.eventCanceled=!1,r.cancel=function(){a.eventCanceled=!0};var u=e+"Global";DD.forEach(function(f){!t[f.pluginName]||(t[f.pluginName][u]&&t[f.pluginName][u](i2({sortable:t},r)),t.options[f.pluginName]&&t[f.pluginName][e]&&t[f.pluginName][e](i2({sortable:t},r)))})},initializePlugins:function(e,t,r,a){DD.forEach(function(h){var g=h.pluginName;if(!(!e.options[g]&&!h.initializeByDefault)){var y=new h(e,t,e.options);y.sortable=e,y.options=e.options,e[g]=y,D_(r,y.defaults)}});for(var u in e.options)if(!!e.options.hasOwnProperty(u)){var f=this.modifyOption(e,u,e.options[u]);typeof f<"u"&&(e.options[u]=f)}},getEventProperties:function(e,t){var r={};return DD.forEach(function(a){typeof a.eventProperties=="function"&&D_(r,a.eventProperties.call(t[a.pluginName],e))}),r},modifyOption:function(e,t,r){var a;return DD.forEach(function(u){!e[u.pluginName]||u.optionListeners&&typeof u.optionListeners[t]=="function"&&(a=u.optionListeners[t].call(e[u.pluginName],r))}),a}};function p_e(s){var e=s.sortable,t=s.rootEl,r=s.name,a=s.targetEl,u=s.cloneEl,f=s.toEl,h=s.fromEl,g=s.oldIndex,y=s.newIndex,C=s.oldDraggableIndex,A=s.newDraggableIndex,O=s.originalEvent,N=s.putSortable,L=s.extraEventProperties;if(e=e||t&&t[M1],!!e){var j,z=e.options,q="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!I_&&!cI?j=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(j=document.createEvent("Event"),j.initEvent(r,!0,!0)),j.to=f||t,j.from=h||t,j.item=a||t,j.clone=u,j.oldIndex=g,j.newIndex=y,j.oldDraggableIndex=C,j.newDraggableIndex=A,j.originalEvent=O,j.pullMode=N?N.lastPutMode:void 0;var ee=i2(i2({},L),uI.getEventProperties(r,e));for(var F in ee)j[F]=ee[F];t&&t.dispatchEvent(j),z[q]&&z[q].call(e,j)}}var b_e=["evt"],Ep=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=r.evt,u=a_e(r,b_e);uI.pluginEvent.bind(Vr)(e,t,i2({dragEl:$o,parentEl:Fu,ghostEl:Si,rootEl:Wc,nextEl:BA,lastDownEl:Dz,cloneEl:hu,cloneHidden:ok,dragStarted:hP,putSortable:Ih,activeSortable:Vr.active,originalEvent:a,oldIndex:zD,oldDraggableIndex:kP,newIndex:T1,newDraggableIndex:ek,hideGhostForTarget:Xhe,unhideGhostForTarget:Jhe,cloneNowHidden:function(){ok=!0},cloneNowShown:function(){ok=!1},dispatchSortableEvent:function(h){Eg({sortable:t,name:h,originalEvent:a})}},u))};function Eg(s){p_e(i2({putSortable:Ih,cloneEl:hu,targetEl:$o,rootEl:Wc,oldIndex:zD,oldDraggableIndex:kP,newIndex:T1,newDraggableIndex:ek},s))}var $o,Fu,Si,Wc,BA,Dz,hu,ok,zD,T1,kP,ek,$$,Ih,ID=!1,eV=!1,tV=[],NA,dv,dte,hte,Sle,kle,hP,OD,EP,xP=!1,z$=!1,Oz,km,mte=[],bne=!1,nV=[],jV=typeof document<"u",V$=zhe,Ele=cI||I_?"cssFloat":"float",v_e=jV&&!Vhe&&!zhe&&"draggable"in document.createElement("div"),Ghe=function(){if(!!jV){if(I_)return!1;var s=document.createElement("x");return s.style.cssText="pointer-events:auto",s.style.pointerEvents==="auto"}}(),Khe=function(e,t){var r=zr(e),a=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),u=sO(e,0,t),f=sO(e,1,t),h=u&&zr(u),g=f&&zr(f),y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+ud(u).width,C=g&&parseInt(g.marginLeft)+parseInt(g.marginRight)+ud(f).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(u&&h.float&&h.float!=="none"){var A=h.float==="left"?"left":"right";return f&&(g.clear==="both"||g.clear===A)?"vertical":"horizontal"}return u&&(h.display==="block"||h.display==="flex"||h.display==="table"||h.display==="grid"||y>=a&&r[Ele]==="none"||f&&r[Ele]==="none"&&y+C>a)?"vertical":"horizontal"},y_e=function(e,t,r){var a=r?e.left:e.top,u=r?e.right:e.bottom,f=r?e.width:e.height,h=r?t.left:t.top,g=r?t.right:t.bottom,y=r?t.width:t.height;return a===h||u===g||a+f/2===h+y/2},w_e=function(e,t){var r;return tV.some(function(a){var u=a[M1].options.emptyInsertThreshold;if(!(!u||Moe(a))){var f=ud(a),h=e>=f.left-u&&e<=f.right+u,g=t>=f.top-u&&t<=f.bottom+u;if(h&&g)return r=a}}),r},Yhe=function(e){function t(u,f){return function(h,g,y,C){var A=h.options.group.name&&g.options.group.name&&h.options.group.name===g.options.group.name;if(u==null&&(f||A))return!0;if(u==null||u===!1)return!1;if(f&&u==="clone")return u;if(typeof u=="function")return t(u(h,g,y,C),f)(h,g,y,C);var O=(f?h:g).options.group.name;return u===!0||typeof u=="string"&&u===O||u.join&&u.indexOf(O)>-1}}var r={},a=e.group;(!a||Tz(a)!="object")&&(a={name:a}),r.name=a.name,r.checkPull=t(a.pull,!0),r.checkPut=t(a.put),r.revertClone=a.revertClone,e.group=r},Xhe=function(){!Ghe&&Si&&zr(Si,"display","none")},Jhe=function(){!Ghe&&Si&&zr(Si,"display","")};jV&&!Vhe&&document.addEventListener("click",function(s){if(eV)return s.preventDefault(),s.stopPropagation&&s.stopPropagation(),s.stopImmediatePropagation&&s.stopImmediatePropagation(),eV=!1,!1},!0);var PA=function(e){if($o){e=e.touches?e.touches[0]:e;var t=w_e(e.clientX,e.clientY);if(t){var r={};for(var a in e)e.hasOwnProperty(a)&&(r[a]=e[a]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[M1]._onDragOver(r)}}},__e=function(e){$o&&$o.parentNode[M1]._isOutsideThisEl(e.target)};function Vr(s,e){if(!(s&&s.nodeType&&s.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(s));this.el=s,this.options=e=D_({},e),s[M1]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(s.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Khe(s,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(f,h){f.setData("Text",h.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Vr.supportPointer!==!1&&"PointerEvent"in window&&!CP,emptyInsertThreshold:5};uI.initializePlugins(this,s,t);for(var r in t)!(r in e)&&(e[r]=t[r]);Yhe(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:v_e,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?ll(s,"pointerdown",this._onTapStart):(ll(s,"mousedown",this._onTapStart),ll(s,"touchstart",this._onTapStart)),this.nativeDraggable&&(ll(s,"dragover",this),ll(s,"dragenter",this)),tV.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),D_(this,h_e())}Vr.prototype={constructor:Vr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(OD=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,$o):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,r=this.el,a=this.options,u=a.preventOnFilter,f=e.type,h=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,g=(h||e).target,y=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||g,C=a.filter;if(D_e(r),!$o&&!(/mousedown|pointerdown/.test(f)&&e.button!==0||a.disabled)&&!y.isContentEditable&&!(!this.nativeDraggable&&CP&&g&&g.tagName.toUpperCase()==="SELECT")&&(g=Gy(g,a.draggable,r,!1),!(g&&g.animated)&&Dz!==g)){if(zD=D0(g),kP=D0(g,a.draggable),typeof C=="function"){if(C.call(this,e,g,this)){Eg({sortable:t,rootEl:y,name:"filter",targetEl:g,toEl:r,fromEl:r}),Ep("filter",t,{evt:e}),u&&e.cancelable&&e.preventDefault();return}}else if(C&&(C=C.split(",").some(function(A){if(A=Gy(y,A.trim(),r,!1),A)return Eg({sortable:t,rootEl:A,name:"filter",targetEl:g,fromEl:r,toEl:r}),Ep("filter",t,{evt:e}),!0}),C)){u&&e.cancelable&&e.preventDefault();return}a.handle&&!Gy(y,a.handle,r,!1)||this._prepareDragStart(e,h,g)}}},_prepareDragStart:function(e,t,r){var a=this,u=a.el,f=a.options,h=u.ownerDocument,g;if(r&&!$o&&r.parentNode===u){var y=ud(r);if(Wc=u,$o=r,Fu=$o.parentNode,BA=$o.nextSibling,Dz=r,$$=f.group,Vr.dragged=$o,NA={target:$o,clientX:(t||e).clientX,clientY:(t||e).clientY},Sle=NA.clientX-y.left,kle=NA.clientY-y.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,$o.style["will-change"]="all",g=function(){if(Ep("delayEnded",a,{evt:e}),Vr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!yle&&a.nativeDraggable&&($o.draggable=!0),a._triggerDragStart(e,t),Eg({sortable:a,name:"choose",originalEvent:e}),x1($o,f.chosenClass,!0)},f.ignore.split(",").forEach(function(C){Whe($o,C.trim(),gte)}),ll(h,"dragover",PA),ll(h,"mousemove",PA),ll(h,"touchmove",PA),ll(h,"mouseup",a._onDrop),ll(h,"touchend",a._onDrop),ll(h,"touchcancel",a._onDrop),yle&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$o.draggable=!0),Ep("delayStart",this,{evt:e}),f.delay&&(!f.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(cI||I_))){if(Vr.eventCanceled){this._onDrop();return}ll(h,"mouseup",a._disableDelayedDrag),ll(h,"touchend",a._disableDelayedDrag),ll(h,"touchcancel",a._disableDelayedDrag),ll(h,"mousemove",a._delayedDragTouchMoveHandler),ll(h,"touchmove",a._delayedDragTouchMoveHandler),f.supportPointer&&ll(h,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(g,f.delay)}else g()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$o&&gte($o),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ia(e,"mouseup",this._disableDelayedDrag),Ia(e,"touchend",this._disableDelayedDrag),Ia(e,"touchcancel",this._disableDelayedDrag),Ia(e,"mousemove",this._delayedDragTouchMoveHandler),Ia(e,"touchmove",this._delayedDragTouchMoveHandler),Ia(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?ll(document,"pointermove",this._onTouchMove):t?ll(document,"touchmove",this._onTouchMove):ll(document,"mousemove",this._onTouchMove):(ll($o,"dragend",this),ll(Wc,"dragstart",this._onDragStart));try{document.selection?Mz(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ID=!1,Wc&&$o){Ep("dragStarted",this,{evt:t}),this.nativeDraggable&&ll(document,"dragover",__e);var r=this.options;!e&&x1($o,r.dragClass,!1),x1($o,r.ghostClass,!0),Vr.active=this,e&&this._appendGhost(),Eg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(dv){this._lastX=dv.clientX,this._lastY=dv.clientY,Xhe();for(var e=document.elementFromPoint(dv.clientX,dv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(dv.clientX,dv.clientY),e!==t);)t=e;if($o.parentNode[M1]._isOutsideThisEl(e),t)do{if(t[M1]){var r=void 0;if(r=t[M1]._onDragOver({clientX:dv.clientX,clientY:dv.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Jhe()}},_onTouchMove:function(e){if(NA){var t=this.options,r=t.fallbackTolerance,a=t.fallbackOffset,u=e.touches?e.touches[0]:e,f=Si&&GD(Si,!0),h=Si&&f&&f.a,g=Si&&f&&f.d,y=V$&&km&&Cle(km),C=(u.clientX-NA.clientX+a.x)/(h||1)+(y?y[0]-mte[0]:0)/(h||1),A=(u.clientY-NA.clientY+a.y)/(g||1)+(y?y[1]-mte[1]:0)/(g||1);if(!Vr.active&&!ID){if(r&&Math.max(Math.abs(u.clientX-this._lastX),Math.abs(u.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(Si){f?(f.e+=C-(dte||0),f.f+=A-(hte||0)):f={a:1,b:0,c:0,d:1,e:C,f:A};var O="matrix(".concat(f.a,",").concat(f.b,",").concat(f.c,",").concat(f.d,",").concat(f.e,",").concat(f.f,")");zr(Si,"webkitTransform",O),zr(Si,"mozTransform",O),zr(Si,"msTransform",O),zr(Si,"transform",O),dte=C,hte=A,dv=u}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Si){var e=this.options.fallbackOnBody?document.body:Wc,t=ud($o,!0,V$,!0,e),r=this.options;if(V$){for(km=e;zr(km,"position")==="static"&&zr(km,"transform")==="none"&&km!==document;)km=km.parentNode;km!==document.body&&km!==document.documentElement?(km===document&&(km=t2()),t.top+=km.scrollTop,t.left+=km.scrollLeft):km=t2(),mte=Cle(km)}Si=$o.cloneNode(!0),x1(Si,r.ghostClass,!1),x1(Si,r.fallbackClass,!0),x1(Si,r.dragClass,!0),zr(Si,"transition",""),zr(Si,"transform",""),zr(Si,"box-sizing","border-box"),zr(Si,"margin",0),zr(Si,"top",t.top),zr(Si,"left",t.left),zr(Si,"width",t.width),zr(Si,"height",t.height),zr(Si,"opacity","0.8"),zr(Si,"position",V$?"absolute":"fixed"),zr(Si,"zIndex","100000"),zr(Si,"pointerEvents","none"),Vr.ghost=Si,e.appendChild(Si),zr(Si,"transform-origin",Sle/parseInt(Si.style.width)*100+"% "+kle/parseInt(Si.style.height)*100+"%")}},_onDragStart:function(e,t){var r=this,a=e.dataTransfer,u=r.options;if(Ep("dragStart",this,{evt:e}),Vr.eventCanceled){this._onDrop();return}Ep("setupClone",this),Vr.eventCanceled||(hu=qhe($o),hu.removeAttribute("id"),hu.draggable=!1,hu.style["will-change"]="",this._hideClone(),x1(hu,this.options.chosenClass,!1),Vr.clone=hu),r.cloneId=Mz(function(){Ep("clone",r),!Vr.eventCanceled&&(r.options.removeCloneOnHide||Wc.insertBefore(hu,$o),r._hideClone(),Eg({sortable:r,name:"clone"}))}),!t&&x1($o,u.dragClass,!0),t?(eV=!0,r._loopId=setInterval(r._emulateDragOver,50)):(Ia(document,"mouseup",r._onDrop),Ia(document,"touchend",r._onDrop),Ia(document,"touchcancel",r._onDrop),a&&(a.effectAllowed="move",u.setData&&u.setData.call(r,a,$o)),ll(document,"drop",r),zr($o,"transform","translateZ(0)")),ID=!0,r._dragStartId=Mz(r._dragStarted.bind(r,t,e)),ll(document,"selectstart",r),hP=!0,CP&&zr(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,r=e.target,a,u,f,h=this.options,g=h.group,y=Vr.active,C=$$===g,A=h.sort,O=Ih||y,N,L=this,j=!1;if(bne)return;function z(nt,Ot){Ep(nt,L,i2({evt:e,isOwner:C,axis:N?"vertical":"horizontal",revert:f,dragRect:a,targetRect:u,canSort:A,fromSortable:O,target:r,completed:ee,onMove:function(He,ct){return U$(Wc,t,$o,a,He,ud(He),e,ct)},changed:F},Ot))}function q(){z("dragOverAnimationCapture"),L.captureAnimationState(),L!==O&&O.captureAnimationState()}function ee(nt){return z("dragOverCompleted",{insertion:nt}),nt&&(C?y._hideClone():y._showClone(L),L!==O&&(x1($o,Ih?Ih.options.ghostClass:y.options.ghostClass,!1),x1($o,h.ghostClass,!0)),Ih!==L&&L!==Vr.active?Ih=L:L===Vr.active&&Ih&&(Ih=null),O===L&&(L._ignoreWhileAnimating=r),L.animateAll(function(){z("dragOverAnimationComplete"),L._ignoreWhileAnimating=null}),L!==O&&(O.animateAll(),O._ignoreWhileAnimating=null)),(r===$o&&!$o.animated||r===t&&!r.animated)&&(OD=null),!h.dragoverBubble&&!e.rootEl&&r!==document&&($o.parentNode[M1]._isOutsideThisEl(e.target),!nt&&PA(e)),!h.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),j=!0}function F(){T1=D0($o),ek=D0($o,h.draggable),Eg({sortable:L,name:"change",toEl:t,newIndex:T1,newDraggableIndex:ek,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=Gy(r,h.draggable,t,!0),z("dragOver"),Vr.eventCanceled)return j;if($o.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||L._ignoreWhileAnimating===r)return ee(!1);if(eV=!1,y&&!h.disabled&&(C?A||(f=Fu!==Wc):Ih===this||(this.lastPutMode=$$.checkPull(this,y,$o,e))&&g.checkPut(this,y,$o,e))){if(N=this._getDirection(e,r)==="vertical",a=ud($o),z("dragOverValid"),Vr.eventCanceled)return j;if(f)return Fu=Wc,q(),this._hideClone(),z("revert"),Vr.eventCanceled||(BA?Wc.insertBefore($o,BA):Wc.appendChild($o)),ee(!0);var ne=Moe(t,h.draggable);if(!ne||E_e(e,N,this)&&!ne.animated){if(ne===$o)return ee(!1);if(ne&&t===e.target&&(r=ne),r&&(u=ud(r)),U$(Wc,t,$o,a,r,u,e,!!r)!==!1)return q(),ne&&ne.nextSibling?t.insertBefore($o,ne.nextSibling):t.appendChild($o),Fu=t,F(),ee(!0)}else if(ne&&k_e(e,N,this)){var oe=sO(t,0,h,!0);if(oe===$o)return ee(!1);if(r=oe,u=ud(r),U$(Wc,t,$o,a,r,u,e,!1)!==!1)return q(),t.insertBefore($o,oe),Fu=t,F(),ee(!0)}else if(r.parentNode===t){u=ud(r);var re=0,J,we=$o.parentNode!==t,ye=!y_e($o.animated&&$o.toRect||a,r.animated&&r.toRect||u,N),De=N?"top":"left",_e=_le(r,"top","top")||_le($o,"top","top"),be=_e?_e.scrollTop:void 0;OD!==r&&(J=u[De],xP=!1,z$=!ye&&h.invertSwap||we),re=x_e(e,r,u,N,ye?1:h.swapThreshold,h.invertedSwapThreshold==null?h.swapThreshold:h.invertedSwapThreshold,z$,OD===r);var tt;if(re!==0){var Qe=D0($o);do Qe-=re,tt=Fu.children[Qe];while(tt&&(zr(tt,"display")==="none"||tt===Si))}if(re===0||tt===r)return ee(!1);OD=r,EP=re;var ft=r.nextElementSibling,V=!1;V=re===1;var mt=U$(Wc,t,$o,a,r,u,e,V);if(mt!==!1)return(mt===1||mt===-1)&&(V=mt===1),bne=!0,setTimeout(S_e,30),q(),V&&!ft?t.appendChild($o):r.parentNode.insertBefore($o,V?ft:r),_e&&Zhe(_e,0,be-_e.scrollTop),Fu=$o.parentNode,J!==void 0&&!z$&&(Oz=Math.abs(J-ud(r)[De])),F(),ee(!0)}if(t.contains($o))return ee(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ia(document,"mousemove",this._onTouchMove),Ia(document,"touchmove",this._onTouchMove),Ia(document,"pointermove",this._onTouchMove),Ia(document,"dragover",PA),Ia(document,"mousemove",PA),Ia(document,"touchmove",PA)},_offUpEvents:function(){var e=this.el.ownerDocument;Ia(e,"mouseup",this._onDrop),Ia(e,"touchend",this._onDrop),Ia(e,"pointerup",this._onDrop),Ia(e,"touchcancel",this._onDrop),Ia(document,"selectstart",this)},_onDrop:function(e){var t=this.el,r=this.options;if(T1=D0($o),ek=D0($o,r.draggable),Ep("drop",this,{evt:e}),Fu=$o&&$o.parentNode,T1=D0($o),ek=D0($o,r.draggable),Vr.eventCanceled){this._nulling();return}ID=!1,z$=!1,xP=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),vne(this.cloneId),vne(this._dragStartId),this.nativeDraggable&&(Ia(document,"drop",this),Ia(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),CP&&zr(document.body,"user-select",""),zr($o,"transform",""),e&&(hP&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),Si&&Si.parentNode&&Si.parentNode.removeChild(Si),(Wc===Fu||Ih&&Ih.lastPutMode!=="clone")&&hu&&hu.parentNode&&hu.parentNode.removeChild(hu),$o&&(this.nativeDraggable&&Ia($o,"dragend",this),gte($o),$o.style["will-change"]="",hP&&!ID&&x1($o,Ih?Ih.options.ghostClass:this.options.ghostClass,!1),x1($o,this.options.chosenClass,!1),Eg({sortable:this,name:"unchoose",toEl:Fu,newIndex:null,newDraggableIndex:null,originalEvent:e}),Wc!==Fu?(T1>=0&&(Eg({rootEl:Fu,name:"add",toEl:Fu,fromEl:Wc,originalEvent:e}),Eg({sortable:this,name:"remove",toEl:Fu,originalEvent:e}),Eg({rootEl:Fu,name:"sort",toEl:Fu,fromEl:Wc,originalEvent:e}),Eg({sortable:this,name:"sort",toEl:Fu,originalEvent:e})),Ih&&Ih.save()):T1!==zD&&T1>=0&&(Eg({sortable:this,name:"update",toEl:Fu,originalEvent:e}),Eg({sortable:this,name:"sort",toEl:Fu,originalEvent:e})),Vr.active&&((T1==null||T1===-1)&&(T1=zD,ek=kP),Eg({sortable:this,name:"end",toEl:Fu,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ep("nulling",this),Wc=$o=Fu=Si=BA=hu=Dz=ok=NA=dv=hP=T1=ek=zD=kP=OD=EP=Ih=$$=Vr.dragged=Vr.ghost=Vr.clone=Vr.active=null,nV.forEach(function(e){e.checked=!0}),nV.length=dte=hte=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":$o&&(this._onDragOver(e),C_e(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,a=0,u=r.length,f=this.options;a<u;a++)t=r[a],Gy(t,f.draggable,this.el,!1)&&e.push(t.getAttribute(f.dataIdAttr)||T_e(t));return e},sort:function(e,t){var r={},a=this.el;this.toArray().forEach(function(u,f){var h=a.children[f];Gy(h,this.options.draggable,a,!1)&&(r[u]=h)},this),t&&this.captureAnimationState(),e.forEach(function(u){r[u]&&(a.removeChild(r[u]),a.appendChild(r[u]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Gy(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var r=this.options;if(t===void 0)return r[e];var a=uI.modifyOption(this,e,t);typeof a<"u"?r[e]=a:r[e]=t,e==="group"&&Yhe(r)},destroy:function(){Ep("destroy",this);var e=this.el;e[M1]=null,Ia(e,"mousedown",this._onTapStart),Ia(e,"touchstart",this._onTapStart),Ia(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ia(e,"dragover",this),Ia(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),tV.splice(tV.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!ok){if(Ep("hideClone",this),Vr.eventCanceled)return;zr(hu,"display","none"),this.options.removeCloneOnHide&&hu.parentNode&&hu.parentNode.removeChild(hu),ok=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(ok){if(Ep("showClone",this),Vr.eventCanceled)return;$o.parentNode==Wc&&!this.options.group.revertClone?Wc.insertBefore(hu,$o):BA?Wc.insertBefore(hu,BA):Wc.appendChild(hu),this.options.group.revertClone&&this.animate($o,hu),zr(hu,"display",""),ok=!1}}};function C_e(s){s.dataTransfer&&(s.dataTransfer.dropEffect="move"),s.cancelable&&s.preventDefault()}function U$(s,e,t,r,a,u,f,h){var g,y=s[M1],C=y.options.onMove,A;return window.CustomEvent&&!I_&&!cI?g=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent("move",!0,!0)),g.to=e,g.from=s,g.dragged=t,g.draggedRect=r,g.related=a||e,g.relatedRect=u||ud(e),g.willInsertAfter=h,g.originalEvent=f,s.dispatchEvent(g),C&&(A=C.call(y,g,f)),A}function gte(s){s.draggable=!1}function S_e(){bne=!1}function k_e(s,e,t){var r=ud(sO(t.el,0,t.options,!0)),a=10;return e?s.clientX<r.left-a||s.clientY<r.top&&s.clientX<r.right:s.clientY<r.top-a||s.clientY<r.bottom&&s.clientX<r.left}function E_e(s,e,t){var r=ud(Moe(t.el,t.options.draggable)),a=10;return e?s.clientX>r.right+a||s.clientX<=r.right&&s.clientY>r.bottom&&s.clientX>=r.left:s.clientX>r.right&&s.clientY>r.top||s.clientX<=r.right&&s.clientY>r.bottom+a}function x_e(s,e,t,r,a,u,f,h){var g=r?s.clientY:s.clientX,y=r?t.height:t.width,C=r?t.top:t.left,A=r?t.bottom:t.right,O=!1;if(!f){if(h&&Oz<y*a){if(!xP&&(EP===1?g>C+y*u/2:g<A-y*u/2)&&(xP=!0),xP)O=!0;else if(EP===1?g<C+Oz:g>A-Oz)return-EP}else if(g>C+y*(1-a)/2&&g<A-y*(1-a)/2)return A_e(e)}return O=O||f,O&&(g<C+y*u/2||g>A-y*u/2)?g>C+y/2?1:-1:0}function A_e(s){return D0($o)<D0(s)?1:-1}function T_e(s){for(var e=s.tagName+s.className+s.src+s.href+s.textContent,t=e.length,r=0;t--;)r+=e.charCodeAt(t);return r.toString(36)}function D_e(s){nV.length=0;for(var e=s.getElementsByTagName("input"),t=e.length;t--;){var r=e[t];r.checked&&nV.push(r)}}function Mz(s){return setTimeout(s,0)}function vne(s){return clearTimeout(s)}jV&&ll(document,"touchmove",function(s){(Vr.active||ID)&&s.cancelable&&s.preventDefault()});Vr.utils={on:ll,off:Ia,css:zr,find:Whe,is:function(e,t){return!!Gy(e,t,e,!1)},extend:f_e,throttle:jhe,closest:Gy,toggleClass:x1,clone:qhe,index:D0,nextTick:Mz,cancelNextTick:vne,detectDirection:Khe,getChild:sO};Vr.get=function(s){return s[M1]};Vr.mount=function(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Vr.utils=i2(i2({},Vr.utils),r.utils)),uI.mount(r)})};Vr.create=function(s,e){return new Vr(s,e)};Vr.version=l_e;var If=[],mP,yne,wne=!1,pte,bte,oV,gP;function O_e(){function s(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return s.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?ll(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ll(document,"pointermove",this._handleFallbackAutoScroll):r.touches?ll(document,"touchmove",this._handleFallbackAutoScroll):ll(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?Ia(document,"dragover",this._handleAutoScroll):(Ia(document,"pointermove",this._handleFallbackAutoScroll),Ia(document,"touchmove",this._handleFallbackAutoScroll),Ia(document,"mousemove",this._handleFallbackAutoScroll)),xle(),Rz(),d_e()},nulling:function(){oV=yne=mP=wne=gP=pte=bte=null,If.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var a=this,u=(t.touches?t.touches[0]:t).clientX,f=(t.touches?t.touches[0]:t).clientY,h=document.elementFromPoint(u,f);if(oV=t,r||this.options.forceAutoScrollFallback||cI||I_||CP){vte(t,this.options,h,r);var g=rk(h,!0);wne&&(!gP||u!==pte||f!==bte)&&(gP&&xle(),gP=setInterval(function(){var y=rk(document.elementFromPoint(u,f),!0);y!==g&&(g=y,Rz()),vte(t,a.options,y,r)},10),pte=u,bte=f)}else{if(!this.options.bubbleScroll||rk(h,!0)===t2()){Rz();return}vte(t,this.options,rk(h,!1),!1)}}},D_(s,{pluginName:"scroll",initializeByDefault:!0})}function Rz(){If.forEach(function(s){clearInterval(s.pid)}),If=[]}function xle(){clearInterval(gP)}var vte=jhe(function(s,e,t,r){if(!!e.scroll){var a=(s.touches?s.touches[0]:s).clientX,u=(s.touches?s.touches[0]:s).clientY,f=e.scrollSensitivity,h=e.scrollSpeed,g=t2(),y=!1,C;yne!==t&&(yne=t,Rz(),mP=e.scroll,C=e.scrollFn,mP===!0&&(mP=rk(t,!0)));var A=0,O=mP;do{var N=O,L=ud(N),j=L.top,z=L.bottom,q=L.left,ee=L.right,F=L.width,ne=L.height,oe=void 0,re=void 0,J=N.scrollWidth,we=N.scrollHeight,ye=zr(N),De=N.scrollLeft,_e=N.scrollTop;N===g?(oe=F<J&&(ye.overflowX==="auto"||ye.overflowX==="scroll"||ye.overflowX==="visible"),re=ne<we&&(ye.overflowY==="auto"||ye.overflowY==="scroll"||ye.overflowY==="visible")):(oe=F<J&&(ye.overflowX==="auto"||ye.overflowX==="scroll"),re=ne<we&&(ye.overflowY==="auto"||ye.overflowY==="scroll"));var be=oe&&(Math.abs(ee-a)<=f&&De+F<J)-(Math.abs(q-a)<=f&&!!De),tt=re&&(Math.abs(z-u)<=f&&_e+ne<we)-(Math.abs(j-u)<=f&&!!_e);if(!If[A])for(var Qe=0;Qe<=A;Qe++)If[Qe]||(If[Qe]={});(If[A].vx!=be||If[A].vy!=tt||If[A].el!==N)&&(If[A].el=N,If[A].vx=be,If[A].vy=tt,clearInterval(If[A].pid),(be!=0||tt!=0)&&(y=!0,If[A].pid=setInterval(function(){r&&this.layer===0&&Vr.active._onTouchMove(oV);var ft=If[this.layer].vy?If[this.layer].vy*h:0,V=If[this.layer].vx?If[this.layer].vx*h:0;typeof C=="function"&&C.call(Vr.dragged.parentNode[M1],V,ft,s,oV,If[this.layer].el)!=="continue"||Zhe(If[this.layer].el,V,ft)}.bind({layer:A}),24))),A++}while(e.bubbleScroll&&O!==g&&(O=rk(O,!1)));wne=y}},30),Qhe=function(e){var t=e.originalEvent,r=e.putSortable,a=e.dragEl,u=e.activeSortable,f=e.dispatchSortableEvent,h=e.hideGhostForTarget,g=e.unhideGhostForTarget;if(!!t){var y=r||u;h();var C=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,A=document.elementFromPoint(C.clientX,C.clientY);g(),y&&!y.el.contains(A)&&(f("spill"),this.onSpill({dragEl:a,putSortable:r}))}};function Roe(){}Roe.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var a=sO(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(t,a):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:Qhe};D_(Roe,{pluginName:"revertOnSpill"});function Noe(){}Noe.prototype={onSpill:function(e){var t=e.dragEl,r=e.putSortable,a=r||this.sortable;a.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),a.animateAll()},drop:Qhe};D_(Noe,{pluginName:"removeOnSpill"});Vr.mount(new O_e);Vr.mount(Noe,Roe);function M_e(s){let e,t,r;const a=s[5].default,u=ohe(a,s,s[4],null);return{c(){e=ce("div"),u&&u.c(),W(e,"class",t="sortable-container "+s[0])},m(f,h){Le(f,e,h),u&&u.m(e,null),s[7](e),r=!0},p(f,h){u&&u.p&&(!r||h&16)&&ihe(u,a,f,f[4],r?rhe(a,f[4],h,null):ahe(f[4]),null),(!r||h&1&&t!==(t="sortable-container "+f[0]))&&W(e,"class",t)},i(f){r||(Re(u,f),r=!0)},o(f){Ue(u,f),r=!1},d(f){f&&Ie(e),u&&u.d(f),s[7](null)}}}function R_e(s){let e,t,r;const a=s[5].default,u=ohe(a,s,s[4],null);return{c(){e=ce("tbody"),u&&u.c(),W(e,"class",t="sortable-container "+s[0])},m(f,h){Le(f,e,h),u&&u.m(e,null),s[6](e),r=!0},p(f,h){u&&u.p&&(!r||h&16)&&ihe(u,a,f,f[4],r?rhe(a,f[4],h,null):ahe(f[4]),null),(!r||h&1&&t!==(t="sortable-container "+f[0]))&&W(e,"class",t)},i(f){r||(Re(u,f),r=!0)},o(f){Ue(u,f),r=!1},d(f){f&&Ie(e),u&&u.d(f),s[6](null)}}}function N_e(s){let e,t,r,a;const u=[R_e,M_e],f=[];function h(g,y){return g[1]?0:1}return e=h(s),t=f[e]=u[e](s),{c(){t.c(),r=Rs()},m(g,y){f[e].m(g,y),Le(g,r,y),a=!0},p(g,[y]){let C=e;e=h(g),e===C?f[e].p(g,y):(To(),Ue(f[C],1,1,()=>{f[C]=null}),Do(),t=f[e],t?t.p(g,y):(t=f[e]=u[e](g),t.c()),Re(t,1),t.m(r.parentNode,r))},i(g){a||(Re(t),a=!0)},o(g){Ue(t),a=!1},d(g){f[e].d(g),g&&Ie(r)}}}function P_e(s,e,t){let{$$slots:r={},$$scope:a}=e,{sortableClass:u}=e,{isTable:f=!1}=e,{sortableInstance:h}=e;const g=Ip();let y;H0(()=>{let O={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onUpdate(N){g("update",{source:N.oldIndex,target:N.newIndex})},onMove(N){}};t(3,h=Vr.create(y,O))});function C(O){ss[O?"unshift":"push"](()=>{y=O,t(2,y)})}function A(O){ss[O?"unshift":"push"](()=>{y=O,t(2,y)})}return s.$$set=O=>{"sortableClass"in O&&t(0,u=O.sortableClass),"isTable"in O&&t(1,f=O.isTable),"sortableInstance"in O&&t(3,h=O.sortableInstance),"$$scope"in O&&t(4,a=O.$$scope)},[u,f,y,h,a,r,C,A]}class ZV extends ko{constructor(e){super(),So(this,e,P_e,N_e,Co,{sortableClass:0,isTable:1,sortableInstance:3})}}function Ale(s,e,t){const r=s.slice();return r[11]=e[t],r}function Tle(s){let e,t;return{c(){e=ce("div"),t=Kt(s[1]),W(e,"class","invalid-feedback d-block mb-3")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&2&&Gn(t,r[1])},d(r){r&&Ie(e)}}}function Dle(s){let e,t;return e=new ZV({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[I_e]},$$scope:{ctx:s}}}),e.$on("update",s[4]),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&16385&&(u.$$scope={dirty:a,ctx:r}),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function Ole(s,e){let t,r,a,u;return r=new WV({props:{classes:"h-100",record:e[11],hasDelete:!0}}),r.$on("remove",e[3]),{key:s,first:null,c(){t=ce("div"),rn(r.$$.fragment),a=Xe(),W(t,"class","col mb-3"),this.first=t},m(f,h){Le(f,t,h),on(r,t,null),Q(t,a),u=!0},p(f,h){e=f;const g={};h&1&&(g.record=e[11]),r.$set(g)},i(f){u||(Re(r.$$.fragment,f),u=!0)},o(f){Ue(r.$$.fragment,f),u=!1},d(f){f&&Ie(t),sn(r)}}}function I_e(s){let e=[],t=new Map,r,a,u=s[0];const f=h=>h[11].id;for(let h=0;h<u.length;h+=1){let g=Ale(s,u,h),y=f(g);t.set(y,e[h]=Ole(y,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();r=Rs()},m(h,g){for(let y=0;y<e.length;y+=1)e[y]&&e[y].m(h,g);Le(h,r,g),a=!0},p(h,g){g&9&&(u=h[0],To(),e=Om(e,g,f,1,h,u,t,r.parentNode,f2,Ole,r,Ale),Do())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Re(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)Ue(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Ie(r)}}}function B_e(s){let e,t,r,a,u,f,h=s[1]&&Tle(s);r=new lI({props:{buttonClass:"mt-2",recordId:null,schemas:s[2]}}),r.$on("insert",s[5]),r.$on("save",s[5]);let g=s[0].length>0&&Dle(s);return{c(){h&&h.c(),e=Xe(),t=ce("div"),rn(r.$$.fragment),a=Xe(),g&&g.c(),u=Rs(),W(t,"class","inline-card-wrapper")},m(y,C){h&&h.m(y,C),Le(y,e,C),Le(y,t,C),on(r,t,null),Le(y,a,C),g&&g.m(y,C),Le(y,u,C),f=!0},p(y,[C]){y[1]?h?h.p(y,C):(h=Tle(y),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null),y[0].length>0?g?(g.p(y,C),C&1&&Re(g,1)):(g=Dle(y),g.c(),Re(g,1),g.m(u.parentNode,u)):g&&(To(),Ue(g,1,1,()=>{g=null}),Do())},i(y){f||(Re(r.$$.fragment,y),Re(g),f=!0)},o(y){Ue(r.$$.fragment,y),Ue(g),f=!1},d(y){h&&h.d(y),y&&Ie(e),y&&Ie(t),sn(r),y&&Ie(a),g&&g.d(y),y&&Ie(u)}}}function L_e(s,e,t){let r,a;const u=ji("channel");let{record:f}=e,{field:h}=e,{graph:g}=e,{validationErrors:y}=e,C=u.schemas.filter(L=>h.collections.includes(L.name));function A(L){L.preventDefault(),t(6,g.edges=g.edges.filter(j=>!(j.target===L.detail&&j.field===h.name)),g)}function O(L){t(6,g.edges=aI(L.detail.source,L.detail.target,g.edges,h.name),g)}function N(L){L.preventDefault(),t(6,g=Ooe(g,f,L.detail.records,h.name,L.detail.action))}return s.$$set=L=>{"record"in L&&t(7,f=L.record),"field"in L&&t(8,h=L.field),"graph"in L&&t(6,g=L.graph),"validationErrors"in L&&t(9,y=L.validationErrors)},s.$$.update=()=>{var L;s.$$.dirty&768&&t(1,r=Rg(y,h.name)),s.$$.dirty&448&&t(0,a=(L=g.edges.filter(j=>j.field===h.name).map(j=>g.records.find(z=>z.id==j.target&&f.id==j.source)).filter(j=>!!(j!=null&&j.id)))!=null?L:[])},[a,r,C,A,O,N,g,f,h,y]}class F_e extends ko{constructor(e){super(),So(this,e,L_e,B_e,Co,{record:7,field:8,graph:6,validationErrors:9})}}function Mle(s,e,t){const r=s.slice();return r[21]=e[t],r}function H_e(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee,F,ne,oe,re,J,we,ye,De,_e,be,tt,Qe;f=new wl({props:{icon:"pencil",width:12,height:12}});const ft=[U_e,V_e],V=[];function mt(kt,xn){return kt[7]?0:1}y=mt(s),C=V[y]=ft[y](s),L=new wl({props:{icon:"ellipsis"}});let nt=!s[1]&&Rle(s),Ot=!s[2]&&Nle(s),Tt=s[8].type==="files"&&W_e(s),He=s[8].fields.filter(Ile),ct=[];for(let kt=0;kt<He.length;kt+=1)ct[kt]=Ple(Mle(s,He,kt));const dn=kt=>Ue(ct[kt],1,1,()=>{ct[kt]=null});return{c(){e=ce("div"),t=ce("div"),r=ce("small"),r.textContent=`${s[8].label}`,a=Xe(),u=ce("button"),rn(f.$$.fragment),h=Xe(),g=ce("button"),C.c(),A=Xe(),O=ce("div"),N=ce("button"),rn(L.$$.fragment),j=Xe(),z=ce("div"),q=ce("a"),ee=Kt("Edit in new tab"),ne=Xe(),oe=ce("button"),oe.textContent="Remove",re=Xe(),J=ce("div"),nt&&nt.c(),we=Xe(),Ot&&Ot.c(),ye=Xe(),De=ce("div"),Tt&&Tt.c(),_e=Xe();for(let kt=0;kt<ct.length;kt+=1)ct[kt].c();W(r,"class","text-muted"),W(u,"class","btn btn-sm btn-link"),W(g,"class","btn btn-sm btn-link"),W(N,"class","btn btn-link btn-sm"),W(N,"type","button"),W(N,"data-bs-toggle","dropdown"),W(N,"aria-expanded","false"),W(q,"class","dropdown-item"),W(q,"href",F="/records/"+s[0].id),W(q,"target","_blank"),W(oe,"class","dropdown-item"),W(J,"class","text-center mt-3"),W(z,"class","dropdown-menu"),W(O,"class","dropdown d-inline-block"),W(t,"class","actions svelte-4ewolk"),W(De,"class","inline-preview svelte-4ewolk"),_s(De,"expanded",s[7]),W(e,"class","lx-card mt-4 bg-primary bg-opacity-10 svelte-4ewolk")},m(kt,xn){Le(kt,e,xn),Q(e,t),Q(t,r),Q(t,a),Q(t,u),on(f,u,null),Q(t,h),Q(t,g),V[y].m(g,null),Q(t,A),Q(t,O),Q(O,N),on(L,N,null),Q(O,j),Q(O,z),Q(z,q),Q(q,ee),Q(z,ne),Q(z,oe),Q(z,re),Q(z,J),nt&&nt.m(J,null),Q(J,we),Ot&&Ot.m(J,null),Q(e,ye),Q(e,De),Tt&&Tt.m(De,null),Q(De,_e);for(let We=0;We<ct.length;We+=1)ct[We]&&ct[We].m(De,null);be=!0,tt||(Qe=[Dn(u,"click",$u(s[9])),Dn(g,"click",s[18]),Dn(oe,"click",s[14])],tt=!0)},p(kt,xn){let We=y;if(y=mt(kt),y!==We&&(To(),Ue(V[We],1,1,()=>{V[We]=null}),Do(),C=V[y],C||(C=V[y]=ft[y](kt),C.c()),Re(C,1),C.m(g,null)),(!be||xn&1&&F!==(F="/records/"+kt[0].id))&&W(q,"href",F),kt[1]?nt&&(To(),Ue(nt,1,1,()=>{nt=null}),Do()):nt?(nt.p(kt,xn),xn&2&&Re(nt,1)):(nt=Rle(kt),nt.c(),Re(nt,1),nt.m(J,we)),kt[2]?Ot&&(To(),Ue(Ot,1,1,()=>{Ot=null}),Do()):Ot?(Ot.p(kt,xn),xn&4&&Re(Ot,1)):(Ot=Nle(kt),Ot.c(),Re(Ot,1),Ot.m(J,null)),kt[8].type==="files"&&Tt.p(kt,xn),xn&257){He=kt[8].fields.filter(Ile);let xt;for(xt=0;xt<He.length;xt+=1){const he=Mle(kt,He,xt);ct[xt]?(ct[xt].p(he,xn),Re(ct[xt],1)):(ct[xt]=Ple(he),ct[xt].c(),Re(ct[xt],1),ct[xt].m(De,null))}for(To(),xt=He.length;xt<ct.length;xt+=1)dn(xt);Do()}(!be||xn&128)&&_s(De,"expanded",kt[7])},i(kt){if(!be){Re(f.$$.fragment,kt),Re(C),Re(L.$$.fragment,kt),Re(nt),Re(Ot),Re(Tt);for(let xn=0;xn<He.length;xn+=1)Re(ct[xn]);be=!0}},o(kt){Ue(f.$$.fragment,kt),Ue(C),Ue(L.$$.fragment,kt),Ue(nt),Ue(Ot),Ue(Tt),ct=ct.filter(Boolean);for(let xn=0;xn<ct.length;xn+=1)Ue(ct[xn]);be=!1},d(kt){kt&&Ie(e),sn(f),V[y].d(),sn(L),nt&&nt.d(),Ot&&Ot.d(),Tt&&Tt.d(),ul(ct,kt),tt=!1,Zi(Qe)}}}function $_e(s){let e,t;return e=new Ihe({props:{schema:s[8],record:s[4],graph:s[5],isCreateMode:!1}}),e.$on("cancel",s[16]),e.$on("inlinesaved",s[12]),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&16&&(u.record=r[4]),a&32&&(u.graph=r[5]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function z_e(s){let e,t,r,a,u,f,h,g,y,C,A;return{c(){e=ce("div"),t=ce("p"),t.textContent="Item was removed from the current record.",r=Xe(),a=ce("p"),u=ce("button"),u.textContent="Undo",f=Xe(),h=ce("button"),h.textContent="Delete completely from channel",g=Xe(),y=ce("button"),y.textContent="Dismiss Message",W(u,"class","btn btn-sm btn-outline border border-1 border-dark"),W(h,"class","btn btn-sm btn-danger "),W(y,"class","btn btn-sm btn-link"),W(e,"class","lx-card bg-danger bg-opacity-10 text-center svelte-4ewolk")},m(O,N){Le(O,e,N),Q(e,t),Q(e,r),Q(e,a),Q(a,u),Q(a,f),Q(a,h),Q(e,g),Q(e,y),C||(A=[Dn(u,"click",s[15]),Dn(h,"click",s[17]),Dn(y,"click",s[13])],C=!0)},p:Sn,i:Sn,o:Sn,d(O){O&&Ie(e),C=!1,Zi(A)}}}function V_e(s){let e,t;return e=new wl({props:{icon:"expand",width:12,height:12}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function U_e(s){let e,t;return e=new wl({props:{icon:"compress",width:12,height:12}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function Rle(s){let e,t,r,a,u;return t=new wl({props:{icon:"circle-chevron-up"}}),{c(){e=ce("button"),rn(t.$$.fragment),W(e,"class","btn btn-sm btn-outline-primary border-0")},m(f,h){Le(f,e,h),on(t,e,null),r=!0,a||(u=Dn(e,"click",$u(s[10])),a=!0)},p:Sn,i(f){r||(Re(t.$$.fragment,f),r=!0)},o(f){Ue(t.$$.fragment,f),r=!1},d(f){f&&Ie(e),sn(t),a=!1,u()}}}function Nle(s){let e,t,r,a,u;return t=new wl({props:{icon:"circle-chevron-down"}}),{c(){e=ce("button"),rn(t.$$.fragment),W(e,"class","btn btn-sm btn-outline-primary border-0")},m(f,h){Le(f,e,h),on(t,e,null),r=!0,a||(u=Dn(e,"click",$u(s[11])),a=!0)},p:Sn,i(f){r||(Re(t.$$.fragment,f),r=!0)},o(f){Ue(t.$$.fragment,f),r=!1},d(f){f&&Ie(e),sn(t),a=!1,u()}}}function W_e(s){let e,t;return e=new P_({props:{record:s[0],size:"small"}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1&&(u.record=r[0]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function j_e(s){let e,t=s[0].data[s[21].name]+"",r;return{c(){e=new xbe(!1),r=Rs(),e.a=r},m(a,u){e.m(t,a,u),Le(a,r,u)},p(a,u){u&1&&t!==(t=a[0].data[a[21].name]+"")&&e.p(t)},i:Sn,o:Sn,d(a){a&&Ie(r),a&&e.d()}}}function Z_e(s){let e,t;return e=new Lhe({props:{record:s[0],field:s[21]}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1&&(u.record=r[0]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function q_e(s){let e,t;return e=new Bhe({props:{record:s[0],field:s[21]}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1&&(u.record=r[0]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function Ple(s){let e,t=s[21].label+"",r,a,u,f,h,g;const y=[q_e,Z_e,j_e],C=[];function A(O,N){return O[21].ui==="reference"?0:O[21].ui==="file"?1:2}return u=A(s),f=C[u]=y[u](s),{c(){e=ce("span"),r=Kt(t),a=Xe(),f.c(),h=Rs(),W(e,"class","text-muted d-block mt-2"),os(e,"font-size","13px")},m(O,N){Le(O,e,N),Q(e,r),Le(O,a,N),C[u].m(O,N),Le(O,h,N),g=!0},p(O,N){f.p(O,N)},i(O){g||(Re(f),g=!0)},o(O){Ue(f),g=!1},d(O){O&&Ie(e),O&&Ie(a),C[u].d(O),O&&Ie(h)}}}function G_e(s){let e,t,r,a;const u=[z_e,$_e,H_e],f=[];function h(g,y){return g[3]?0:g[6]===!0?1:2}return t=h(s),r=f[t]=u[t](s),{c(){e=ce("div"),r.c()},m(g,y){Le(g,e,y),f[t].m(e,null),a=!0},p(g,[y]){let C=t;t=h(g),t===C?f[t].p(g,y):(To(),Ue(f[C],1,1,()=>{f[C]=null}),Do(),r=f[t],r?r.p(g,y):(r=f[t]=u[t](g),r.c()),Re(r,1),r.m(e,null))},i(g){a||(Re(r),a=!0)},o(g){Ue(r),a=!1},d(g){g&&Ie(e),f[t].d()}}}const Ile=s=>!(s.trashed||["tab"].includes(s.ui)||["id"].includes(s.name));function K_e(s,e,t){let r,a;const u=ji("channel"),f=Ip();let{isFirst:h}=e,{isLast:g}=e,{toDelete:y=!1}=e,{record:C}=e,A,O,N=u.schemas.find(we=>we.name===C.schema);function L(we){we.preventDefault(),axios.get(u.lucentUrl+"/records/editInline/"+C.id).then(ye=>{t(0,C=ye.data),t(4,A=ye.data.record),t(5,O=ye.data.graph),t(6,r=!0)}).catch(ye=>{console.log(ye)})}function j(we){we.preventDefault(),f("moveup")}function z(we){we.preventDefault(),f("movedn")}function q(we){we.preventDefault(),f("inlinesaved",we.detail),t(6,r=!1)}function ee(we){we.preventDefault(),f("remove",C.id)}function F(we){we.preventDefault(),f("trash",C.id)}function ne(we){we.preventDefault(),f("undoremove",C.id)}function oe(we){we.preventDefault(),t(6,r=!1)}H0(()=>{t(6,r=!1)});function re(we){we.preventDefault(),axios.post(u.lucentUrl+"/records/status/trashed",[C]).then(ye=>{f("remove",C.id)}).catch(ye=>{console.log(ye)})}const J=we=>t(7,a=!a);return s.$$set=we=>{"isFirst"in we&&t(1,h=we.isFirst),"isLast"in we&&t(2,g=we.isLast),"toDelete"in we&&t(3,y=we.toDelete),"record"in we&&t(0,C=we.record)},t(6,r=!1),t(7,a=!1),[C,h,g,y,A,O,r,a,N,L,j,z,q,ee,F,ne,oe,re,J]}class Y_e extends ko{constructor(e){super(),So(this,e,K_e,G_e,Co,{isFirst:1,isLast:2,toDelete:3,record:0})}}function eme(s,{from:e,to:t},r={}){const a=getComputedStyle(s),u=a.transform==="none"?"":a.transform,[f,h]=a.transformOrigin.split(" ").map(parseFloat),g=e.left+e.width*f/t.width-(t.left+f),y=e.top+e.height*h/t.height-(t.top+h),{delay:C=0,duration:A=N=>Math.sqrt(N)*120,easing:O=Che}=r;return{delay:C,duration:B0(A)?A(Math.sqrt(g*g+y*y)):A,easing:O,css:(N,L)=>{const j=L*g,z=L*y,q=N+L*e.width/t.width,ee=N+L*e.height/t.height;return`transform: ${u} translate(${j}px, ${z}px) scale(${q}, ${ee});`}}}function Ble(s,e,t){const r=s.slice();return r[18]=e[t],r[19]=e,r[20]=t,r}function Lle(s){let e,t;return{c(){e=ce("div"),t=Kt(s[3]),W(e,"class","invalid-feedback d-block mb-3")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&8&&Gn(t,r[3])},d(r){r&&Ie(e)}}}function Fle(s){let e=[],t=new Map,r,a,u=s[2];const f=h=>h[18].id;for(let h=0;h<u.length;h+=1){let g=Ble(s,u,h),y=f(g);t.set(y,e[h]=Hle(y,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();r=Rs()},m(h,g){for(let y=0;y<e.length;y+=1)e[y]&&e[y].m(h,g);Le(h,r,g),a=!0},p(h,g){if(g&2039){u=h[2],To();for(let y=0;y<e.length;y+=1)e[y].r();e=Om(e,g,f,1,h,u,t,r.parentNode,_he,Hle,r,Ble);for(let y=0;y<e.length;y+=1)e[y].a();Do()}},i(h){if(!a){for(let g=0;g<u.length;g+=1)Re(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)Ue(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Ie(r)}}}function Hle(s,e){let t,r,a,u,f,h,g,y=Sn,C;function A(...z){return e[13](e[18],...z)}function O(z){e[14](z,e[18],e[19],e[20])}function N(...z){return e[15](e[20],...z)}function L(...z){return e[16](e[20],...z)}let j={isFirst:e[20]===0,isLast:e[20]+1===e[2].length,toDelete:e[0].edges.find(A)._isTrashed};return e[18]!==void 0&&(j.record=e[18]),r=new Y_e({props:j}),ss.push(()=>Er(r,"record",O)),r.$on("inlinesaved",e[5]),r.$on("moveup",N),r.$on("movedn",L),r.$on("remove",e[6]),r.$on("undoremove",e[8]),r.$on("trash",e[7]),f=new lI({props:{field:e[1],recordId:e[18].id,schemas:e[4]}}),f.$on("insert",e[9]),f.$on("save",e[9]),{key:s,first:null,c(){t=ce("div"),rn(r.$$.fragment),u=Xe(),rn(f.$$.fragment),h=Xe(),W(t,"class","inline-card-wrapper"),this.first=t},m(z,q){Le(z,t,q),on(r,t,null),Q(t,u),on(f,t,null),Q(t,h),C=!0},p(z,q){e=z;const ee={};q&4&&(ee.isFirst=e[20]===0),q&4&&(ee.isLast=e[20]+1===e[2].length),q&7&&(ee.toDelete=e[0].edges.find(A)._isTrashed),!a&&q&4&&(a=!0,ee.record=e[18],Dr(()=>a=!1)),r.$set(ee);const F={};q&2&&(F.field=e[1]),q&4&&(F.recordId=e[18].id),f.$set(F)},r(){g=t.getBoundingClientRect()},f(){bhe(t),y()},a(){y(),y=phe(t,g,eme,{delay:250,duration:250,easing:She})},i(z){C||(Re(r.$$.fragment,z),Re(f.$$.fragment,z),C=!0)},o(z){Ue(r.$$.fragment,z),Ue(f.$$.fragment,z),C=!1},d(z){z&&Ie(t),sn(r),sn(f)}}}function X_e(s){let e,t,r,a,u,f,h=s[3]&&Lle(s);r=new lI({props:{field:s[1],recordId:null,schemas:s[4]}}),r.$on("insert",s[9]),r.$on("save",s[9]);let g=s[2].length>0&&Fle(s);return{c(){h&&h.c(),e=Xe(),t=ce("div"),rn(r.$$.fragment),a=Xe(),g&&g.c(),u=Rs(),W(t,"class","inline-card-wrapper")},m(y,C){h&&h.m(y,C),Le(y,e,C),Le(y,t,C),on(r,t,null),Le(y,a,C),g&&g.m(y,C),Le(y,u,C),f=!0},p(y,[C]){y[3]?h?h.p(y,C):(h=Lle(y),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null);const A={};C&2&&(A.field=y[1]),r.$set(A),y[2].length>0?g?(g.p(y,C),C&4&&Re(g,1)):(g=Fle(y),g.c(),Re(g,1),g.m(u.parentNode,u)):g&&(To(),Ue(g,1,1,()=>{g=null}),Do())},i(y){f||(Re(r.$$.fragment,y),Re(g),f=!0)},o(y){Ue(r.$$.fragment,y),Ue(g),f=!1},d(y){h&&h.d(y),y&&Ie(e),y&&Ie(t),sn(r),y&&Ie(a),g&&g.d(y),y&&Ie(u)}}}function J_e(s,e,t){let r,a;const u=ji("channel");let{field:f}=e,{record:h}=e,{graph:g}=e,{validationErrors:y}=e,C=u.schemas.filter(oe=>f.collections.includes(oe.name));function A(oe){const re=oe.detail.records[0];t(0,g.edges=g.edges.map(J=>J.source===re.id?re:J),g)}function O(oe){oe.preventDefault(),t(0,g.edges=g.edges.filter(re=>!(re.target===oe.detail&&re.field===f.name)),g)}function N(oe){oe.preventDefault(),t(0,g.edges=g.edges.map(re=>(re.target===oe.detail&&re.field===f.name&&(re._isTrashed=!0),re)),g)}function L(oe){oe.preventDefault(),t(0,g.edges=g.edges.map(re=>(re.target===oe.detail&&re.field===f.name&&delete re._isTrashed,re)),g)}function j(oe){var _e;oe.preventDefault();const re=oe.detail.records,J=(_e=oe.detail.after)!=null?_e:null,we=oe.detail.action;let ye=re.map(be=>({target:be.id,source:h.id,sourceSchema:h.schema,targetSchema:be.schema,field:f.name,rank:""})),De=g.edges;if(we==="replace"&&(De=De.filter(be=>be.field!==f.name)),t(0,g.records=Hu.exports.uniqBy([...g.records,...re],be=>be.id),g),t(0,g.edges=Hu.exports.uniqBy([...De,...ye],be=>be.target+be.field),g),!J)t(0,g.edges=Hu.exports.uniqBy([...ye,...De],be=>be.target+be.field),g);else{let be=!1,tt=De.reduce((Qe,ft)=>(be?Qe.after.push(ft):Qe.before.push(ft),be===!1&&ft.target===J&&(be=!0),Qe),{before:[],after:[]});t(0,g.edges=Hu.exports.uniqBy([...tt.before,...ye,...tt.after],Qe=>Qe.target+Qe.field),g)}}function z(oe,re,J){t(0,g.edges=aI(re,J,g.edges,f.name),g)}const q=(oe,re)=>re.field===f.name&&re.target===oe.id;function ee(oe,re,J,we){J[we]=oe,t(2,a),t(0,g),t(1,f),t(11,h)}const F=(oe,re)=>z(re,oe,oe-1),ne=(oe,re)=>z(re,oe,oe+1);return s.$$set=oe=>{"field"in oe&&t(1,f=oe.field),"record"in oe&&t(11,h=oe.record),"graph"in oe&&t(0,g=oe.graph),"validationErrors"in oe&&t(12,y=oe.validationErrors)},s.$$.update=()=>{var oe;s.$$.dirty&4098&&t(3,r=Rg(y,f.name)),s.$$.dirty&2051&&t(2,a=(oe=g.edges.filter(re=>re.field===f.name).map(re=>g.records.find(J=>J.id==re.target&&h.id==re.source)).filter(re=>!!(re!=null&&re.id)))!=null?oe:[])},[g,f,a,r,C,A,O,N,L,j,z,h,y,q,ee,F,ne]}class Q_e extends ko{constructor(e){super(),So(this,e,J_e,X_e,Co,{field:1,record:11,graph:0,validationErrors:12})}}function $le(s,e,t){const r=s.slice();return r[7]=e[t],r}function zle(s){let e,t=s[2],r=[];for(let a=0;a<t.length;a+=1)r[a]=Vle($le(s,t,a));return{c(){e=ce("div");for(let a=0;a<r.length;a+=1)r[a].c();W(e,"class","bg-light lx-card d-flex")},m(a,u){Le(a,e,u);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(e,null)},p(a,u){if(u&12){t=a[2];let f;for(f=0;f<t.length;f+=1){const h=$le(a,t,f);r[f]?r[f].p(h,u):(r[f]=Vle(h),r[f].c(),r[f].m(e,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=t.length}},d(a){a&&Ie(e),ul(r,a)}}}function Vle(s){let e,t,r=s[7]+"",a,u,f,h;function g(...y){return s[6](s[7],...y)}return{c(){e=ce("div"),t=ce("button"),a=Kt(r),u=Xe(),W(t,"class","btn btn-sm btn-primary"),W(e,"class","me-2")},m(y,C){Le(y,e,C),Q(e,t),Q(t,a),Q(e,u),f||(h=Dn(t,"click",g),f=!0)},p(y,C){s=y},d(y){y&&Ie(e),f=!1,h()}}}function eCe(s){let e,t,r,a,u,f,h;t=new wl({props:{width:24,height:24,icon:"circle-plus"}});let g=s[1]&&zle(s);return{c(){e=ce("button"),rn(t.$$.fragment),r=Xe(),g&&g.c(),a=Rs(),W(e,"type","button"),W(e,"class","btn btn-lg btn-link text-decoration-none block-buttons svelte-1cuqmc3"),_s(e,"is-first",!s[0])},m(y,C){Le(y,e,C),on(t,e,null),Le(y,r,C),g&&g.m(y,C),Le(y,a,C),u=!0,f||(h=Dn(e,"click",$u(s[5])),f=!0)},p(y,[C]){(!u||C&1)&&_s(e,"is-first",!y[0]),y[1]?g?g.p(y,C):(g=zle(y),g.c(),g.m(a.parentNode,a)):g&&(g.d(1),g=null)},i(y){u||(Re(t.$$.fragment,y),u=!0)},o(y){Ue(t.$$.fragment,y),u=!1},d(y){y&&Ie(e),sn(t),y&&Ie(r),g&&g.d(y),y&&Ie(a),f=!1,h()}}}function tCe(s,e,t){let r,{blockId:a}=e,{blockData:u}=e,f=["text","textarea","rich","reference"];function h(C,A){C.preventDefault(),t(4,u=[...u,{ui:A,id:Bye(),key:"",value:null}]),t(1,r=!1)}const g=C=>t(1,r=!r),y=(C,A)=>h(A,C);return s.$$set=C=>{"blockId"in C&&t(0,a=C.blockId),"blockData"in C&&t(4,u=C.blockData)},t(1,r=!1),[a,r,f,h,u,g,y]}class tme extends ko{constructor(e){super(),So(this,e,tCe,eCe,Co,{blockId:0,blockData:4})}}function nCe(s){let e,t,r,a,u;return{c(){e=ce("div"),t=ce("input"),W(t,"type","text"),W(t,"id",r=s[0].id),W(t,"class","form-control"),W(t,"autocomplete","off"),W(e,"class","mb-0")},m(f,h){Le(f,e,h),Q(e,t),wr(t,s[0].value),a||(u=Dn(t,"input",s[1]),a=!0)},p(f,[h]){h&1&&r!==(r=f[0].id)&&W(t,"id",r),h&1&&t.value!==f[0].value&&wr(t,f[0].value)},i:Sn,o:Sn,d(f){f&&Ie(e),a=!1,u()}}}function oCe(s,e,t){let{block:r}=e;function a(){r.value=this.value,t(0,r)}return s.$$set=u=>{"block"in u&&t(0,r=u.block)},[r,a]}class sCe extends ko{constructor(e){super(),So(this,e,oCe,nCe,Co,{block:0})}}function rCe(s){let e,t,r,a,u;return{c(){e=ce("div"),t=ce("textarea"),W(t,"id",r=s[0].id),W(t,"class","form-control svelte-1er4ovm"),W(t,"autocomplete","off"),W(e,"class","mb-0")},m(f,h){Le(f,e,h),Q(e,t),wr(t,s[0].value),s[3](t),a||(u=[Dn(t,"input",s[2]),Dn(t,"input",nme)],a=!0)},p(f,[h]){h&1&&r!==(r=f[0].id)&&W(t,"id",r),h&1&&wr(t,f[0].value)},i:Sn,o:Sn,d(f){f&&Ie(e),s[3](null),a=!1,Zi(u)}}}function nme(s){let e;s.target?e=s.target:e=s,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function iCe(s,e,t){let{block:r}=e,a;H0(()=>{nme(a)});function u(){r.value=this.value,t(0,r)}function f(h){ss[h?"unshift":"push"](()=>{a=h,t(1,a)})}return s.$$set=h=>{"block"in h&&t(0,r=h.block)},[r,a,u,f]}class aCe extends ko{constructor(e){super(),So(this,e,iCe,rCe,Co,{block:0})}}var ome={exports:{}};(function(s){(function(){var e=function(n){if(n===null)return"null";if(n===void 0)return"undefined";var i=typeof n;return i==="object"&&(Array.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="Array")?"array":i==="object"&&(String.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="String")?"string":i},t=function(n){return["undefined","boolean","number","string","function","xml","null"].indexOf(n)!==-1},r=function(n,i){var l=Array.prototype.slice.call(n);return l.sort(i)},a=function(n,i){return u(function(l,d){return n.eq(i(l),i(d))})},u=function(n){return{eq:n}},f=u(function(n,i){return n===i}),h=f,g=function(n){return u(function(i,l){if(i.length!==l.length)return!1;for(var d=i.length,p=0;p<d;p++)if(!n.eq(i[p],l[p]))return!1;return!0})},y=function(n,i){return a(g(n),function(l){return r(l,i)})},C=function(n){return u(function(i,l){var d=Object.keys(i),p=Object.keys(l);if(!y(h).eq(d,p))return!1;for(var w=d.length,E=0;E<w;E++){var R=d[E];if(!n.eq(i[R],l[R]))return!1}return!0})},A=u(function(n,i){if(n===i)return!0;var l=e(n),d=e(i);return l!==d?!1:t(l)?n===i:l==="array"?g(A).eq(n,i):l==="object"?C(A).eq(n,i):!1});const O=Object.getPrototypeOf,N=(n,i,l)=>{var d;return l(n,i.prototype)?!0:((d=n.constructor)===null||d===void 0?void 0:d.name)===i.name},L=n=>{const i=typeof n;return n===null?"null":i==="object"&&Array.isArray(n)?"array":i==="object"&&N(n,String,(l,d)=>d.isPrototypeOf(l))?"string":i},j=n=>i=>L(i)===n,z=n=>i=>typeof i===n,q=n=>i=>n===i,ee=(n,i)=>ne(n)&&N(n,i,(l,d)=>O(l)===d),F=j("string"),ne=j("object"),oe=n=>ee(n,Object),re=j("array"),J=q(null),we=z("boolean"),ye=q(void 0),De=n=>n==null,_e=n=>!De(n),be=z("function"),tt=z("number"),Qe=(n,i)=>{if(re(n)){for(let l=0,d=n.length;l<d;++l)if(!i(n[l]))return!1;return!0}return!1},ft=()=>{},V=(n,i)=>(...l)=>n(i.apply(null,l)),mt=(n,i)=>l=>n(i(l)),nt=n=>()=>n,Ot=n=>n,Tt=(n,i)=>n===i;function He(n,...i){return(...l)=>{const d=i.concat(l);return n.apply(null,d)}}const ct=n=>i=>!n(i),dn=n=>()=>{throw new Error(n)},kt=n=>n(),xn=n=>{n()},We=nt(!1),xt=nt(!0);class he{constructor(i,l){this.tag=i,this.value=l}static some(i){return new he(!0,i)}static none(){return he.singletonNone}fold(i,l){return this.tag?l(this.value):i()}isSome(){return this.tag}isNone(){return!this.tag}map(i){return this.tag?he.some(i(this.value)):he.none()}bind(i){return this.tag?i(this.value):he.none()}exists(i){return this.tag&&i(this.value)}forall(i){return!this.tag||i(this.value)}filter(i){return!this.tag||i(this.value)?this:he.none()}getOr(i){return this.tag?this.value:i}or(i){return this.tag?this:i}getOrThunk(i){return this.tag?this.value:i()}orThunk(i){return this.tag?this:i()}getOrDie(i){if(this.tag)return this.value;throw new Error(i!=null?i:"Called getOrDie on None")}static from(i){return _e(i)?he.some(i):he.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(i){this.tag&&i(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}he.singletonNone=new he(!1);const es=Array.prototype.slice,ho=Array.prototype.indexOf,ao=Array.prototype.push,xo=(n,i)=>ho.call(n,i),Yo=(n,i)=>{const l=xo(n,i);return l===-1?he.none():he.some(l)},Ct=(n,i)=>xo(n,i)>-1,Jt=(n,i)=>{for(let l=0,d=n.length;l<d;l++){const p=n[l];if(i(p,l))return!0}return!1},Et=(n,i)=>{const l=n.length,d=new Array(l);for(let p=0;p<l;p++){const w=n[p];d[p]=i(w,p)}return d},Pe=(n,i)=>{for(let l=0,d=n.length;l<d;l++){const p=n[l];i(p,l)}},Ut=(n,i)=>{for(let l=n.length-1;l>=0;l--){const d=n[l];i(d,l)}},gn=(n,i)=>{const l=[],d=[];for(let p=0,w=n.length;p<w;p++){const E=n[p];(i(E,p)?l:d).push(E)}return{pass:l,fail:d}},yt=(n,i)=>{const l=[];for(let d=0,p=n.length;d<p;d++){const w=n[d];i(w,d)&&l.push(w)}return l},Yt=(n,i,l)=>(Ut(n,(d,p)=>{l=i(l,d,p)}),l),bn=(n,i,l)=>(Pe(n,(d,p)=>{l=i(l,d,p)}),l),rs=(n,i,l)=>{for(let d=0,p=n.length;d<p;d++){const w=n[d];if(i(w,d))return he.some(w);if(l(w,d))break}return he.none()},Jn=(n,i)=>rs(n,i,We),ds=(n,i)=>{for(let l=0,d=n.length;l<d;l++){const p=n[l];if(i(p,l))return he.some(l)}return he.none()},Or=n=>{const i=[];for(let l=0,d=n.length;l<d;++l){if(!re(n[l]))throw new Error("Arr.flatten item "+l+" was not an array, input: "+n);ao.apply(i,n[l])}return i},Ns=(n,i)=>Or(Et(n,i)),Js=(n,i)=>{for(let l=0,d=n.length;l<d;++l){const p=n[l];if(i(p,l)!==!0)return!1}return!0},Zs=n=>{const i=es.call(n,0);return i.reverse(),i},ba=(n,i)=>yt(n,l=>!Ct(i,l)),ar=(n,i)=>{const l={};for(let d=0,p=n.length;d<p;d++){const w=n[d];l[String(w)]=i(w,d)}return l},Ps=(n,i)=>{const l=es.call(n,0);return l.sort(i),l},Zr=(n,i)=>i>=0&&i<n.length?he.some(n[i]):he.none(),No=n=>Zr(n,0),Mo=n=>Zr(n,n.length-1),Mr=be(Array.from)?Array.from:n=>es.call(n),Ls=(n,i)=>{for(let l=0;l<n.length;l++){const d=i(n[l],l);if(d.isSome())return d}return he.none()},na=(n,i)=>{const l=[],d=be(i)?p=>Jt(l,w=>i(w,p)):p=>Ct(l,p);for(let p=0,w=n.length;p<w;p++){const E=n[p];d(E)||l.push(E)}return l},gs=Object.keys,va=Object.hasOwnProperty,an=(n,i)=>{const l=gs(n);for(let d=0,p=l.length;d<p;d++){const w=l[d],E=n[w];i(E,w)}},ps=(n,i)=>Ii(n,(l,d)=>({k:d,v:i(l,d)})),Ii=(n,i)=>{const l={};return an(n,(d,p)=>{const w=i(d,p);l[w.k]=w.v}),l},$e=n=>(i,l)=>{n[l]=i},Je=(n,i,l,d)=>{an(n,(p,w)=>{(i(p,w)?l:d)(p,w)})},At=(n,i)=>{const l={},d={};return Je(n,i,$e(l),$e(d)),{t:l,f:d}},Wt=(n,i)=>{const l={};return Je(n,i,$e(l),ft),l},Wn=(n,i)=>{const l=[];return an(n,(d,p)=>{l.push(i(d,p))}),l},lo=n=>Wn(n,Ot),go=(n,i)=>cn(n,i)?he.from(n[i]):he.none(),cn=(n,i)=>va.call(n,i),ts=(n,i)=>cn(n,i)&&n[i]!==void 0&&n[i]!==null,wo=(n,i,l=A)=>C(l).eq(n,i),cs=n=>{const i={};return Pe(n,l=>{i[l]={}}),gs(i)},_r=n=>n.length!==void 0,Ir=Array.isArray,Vs=n=>{if(Ir(n))return n;{const i=[];for(let l=0,d=n.length;l<d;l++)i[l]=n[l];return i}},Ur=(n,i,l)=>{if(!n)return!1;if(l=l||n,_r(n)){for(let d=0,p=n.length;d<p;d++)if(i.call(l,n[d],d,n)===!1)return!1}else for(const d in n)if(cn(n,d)&&i.call(l,n[d],d,n)===!1)return!1;return!0},Bi=(n,i)=>{const l=[];return Ur(n,(d,p)=>{l.push(i(d,p,n))}),l},Ba=(n,i)=>{const l=[];return Ur(n,(d,p)=>{(!i||i(d,p,n))&&l.push(d)}),l},hi=(n,i)=>{if(n){for(let l=0,d=n.length;l<d;l++)if(n[l]===i)return l}return-1},Ge=(n,i,l,d)=>{let p=ye(l)?n[0]:l;for(let w=0;w<n.length;w++)p=i.call(d,p,n[w],w);return p},qe=(n,i,l)=>{for(let d=0,p=n.length;d<p;d++)if(i.call(l,n[d],d,n))return d;return-1},It=n=>n[n.length-1],jt=n=>{let i=!1,l;return(...d)=>(i||(i=!0,l=n.apply(null,d)),l)},co=(n,i,l,d)=>{const p=n.isiOS()&&/ipad/i.test(l)===!0,w=n.isiOS()&&!p,E=n.isiOS()||n.isAndroid(),R=E||d("(pointer:coarse)"),B=p||!w&&E&&d("(min-device-width:768px)"),K=w||E&&!B,ie=i.isSafari()&&n.isiOS()&&/safari/i.test(l)===!1,ue=!K&&!B&&!ie;return{isiPad:nt(p),isiPhone:nt(w),isTablet:nt(B),isPhone:nt(K),isTouch:nt(R),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:nt(ie),isDesktop:nt(ue)}},Bo=(n,i)=>{for(let l=0;l<n.length;l++){const d=n[l];if(d.test(i))return d}},qo=(n,i)=>{const l=Bo(n,i);if(!l)return{major:0,minor:0};const d=p=>Number(i.replace(l,"$"+p));return Wo(d(1),d(2))},Yr=(n,i)=>{const l=String(i).toLowerCase();return n.length===0?it():qo(n,l)},it=()=>Wo(0,0),Wo=(n,i)=>({major:n,minor:i}),Di={nu:Wo,detect:Yr,unknown:it},oa=(n,i)=>Ls(i.brands,l=>{const d=l.brand.toLowerCase();return Jn(n,p=>{var w;return d===((w=p.brand)===null||w===void 0?void 0:w.toLowerCase())}).map(p=>({current:p.name,version:Di.nu(parseInt(l.version,10),0)}))}),ua=(n,i)=>{const l=String(i).toLowerCase();return Jn(n,d=>d.search(l))},ur=(n,i)=>ua(n,i).map(l=>{const d=Di.detect(l.versionRegexes,i);return{current:l.name,version:d}}),Dc=(n,i)=>ua(n,i).map(l=>{const d=Di.detect(l.versionRegexes,i);return{current:l.name,version:d}}),gc=(n,i)=>n.substring(i),Xa=(n,i,l)=>i===""||n.length>=i.length&&n.substr(l,l+i.length)===i,fa=(n,i)=>xr(n,i)?gc(n,i.length):n,Qs=(n,i,l=0,d)=>{const p=n.indexOf(i,l);return p!==-1?ye(d)?!0:p+i.length<=d:!1},xr=(n,i)=>Xa(n,i,0),Ki=(n,i)=>Xa(n,i,n.length-i.length),fl=n=>i=>i.replace(n,""),pc=fl(/^\s+|\s+$/g),Zc=fl(/^\s+/g),gu=fl(/\s+$/g),gr=n=>n.length>0,Ja=n=>!gr(n),pu=(n,i)=>i<=0?"":new Array(i+1).join(n),qc=(n,i=10)=>{const l=parseInt(n,i);return isNaN(l)?he.none():he.some(l)},Vl=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,xa=n=>i=>Qs(i,n),Ar=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:n=>Qs(n,"edge/")&&Qs(n,"chrome")&&Qs(n,"safari")&&Qs(n,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Vl],search:n=>Qs(n,"chrome")&&!Qs(n,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:n=>Qs(n,"msie")||Qs(n,"trident")},{name:"Opera",versionRegexes:[Vl,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:xa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:xa("firefox")},{name:"Safari",versionRegexes:[Vl,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(Qs(n,"safari")||Qs(n,"mobile/"))&&Qs(n,"applewebkit")}],Rm=[{name:"Windows",search:xa("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:n=>Qs(n,"iphone")||Qs(n,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:xa("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:xa("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:xa("linux"),versionRegexes:[]},{name:"Solaris",search:xa("sunos"),versionRegexes:[]},{name:"FreeBSD",search:xa("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:xa("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],pf={browsers:nt(Ar),oses:nt(Rm)},Cr="Edge",La="Chromium",sa="IE",Yi="Opera",bu="Firefox",Oc="Safari",Fa=()=>Mc({current:void 0,version:Di.unknown()}),Mc=n=>{const i=n.current,l=n.version,d=p=>()=>i===p;return{current:i,version:l,isEdge:d(Cr),isChromium:d(La),isIE:d(sa),isOpera:d(Yi),isFirefox:d(bu),isSafari:d(Oc)}},bc={unknown:Fa,nu:Mc,edge:nt(Cr),chromium:nt(La),ie:nt(sa),opera:nt(Yi),firefox:nt(bu),safari:nt(Oc)},gd="Windows",Lf="iOS",vu="Android",Ul="Linux",Rc="macOS",bf="Solaris",Gc="FreeBSD",pd="ChromeOS",Ae=()=>et({current:void 0,version:Di.unknown()}),et=n=>{const i=n.current,l=n.version,d=p=>()=>i===p;return{current:i,version:l,isWindows:d(gd),isiOS:d(Lf),isAndroid:d(vu),isMacOS:d(Rc),isLinux:d(Ul),isSolaris:d(bf),isFreeBSD:d(Gc),isChromeOS:d(pd)}},gt={unknown:Ae,nu:et,windows:nt(gd),ios:nt(Lf),android:nt(vu),linux:nt(Ul),macos:nt(Rc),solaris:nt(bf),freebsd:nt(Gc),chromeos:nt(pd)},vn={detect:(n,i,l)=>{const d=pf.browsers(),p=pf.oses(),w=i.bind(B=>oa(d,B)).orThunk(()=>ur(d,n)).fold(bc.unknown,bc.nu),E=Dc(p,n).fold(gt.unknown,gt.nu),R=co(E,w,n,l);return{browser:w,os:E,deviceType:R}}},Ro=n=>window.matchMedia(n).matches;let Rr=jt(()=>vn.detect(navigator.userAgent,he.from(navigator.userAgentData),Ro));const vs=()=>Rr(),is=navigator.userAgent,ki=vs(),qs=ki.browser,Li=ki.os,yu=ki.deviceType,bd=is.indexOf("Windows Phone")!==-1,Kn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:qs.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!qs.isIE(),windowsPhone:bd,browser:{current:qs.current,version:qs.version,isChromium:qs.isChromium,isEdge:qs.isEdge,isFirefox:qs.isFirefox,isIE:qs.isIE,isOpera:qs.isOpera,isSafari:qs.isSafari},os:{current:Li.current,version:Li.version,isAndroid:Li.isAndroid,isChromeOS:Li.isChromeOS,isFreeBSD:Li.isFreeBSD,isiOS:Li.isiOS,isLinux:Li.isLinux,isMacOS:Li.isMacOS,isSolaris:Li.isSolaris,isWindows:Li.isWindows},deviceType:{isDesktop:yu.isDesktop,isiPad:yu.isiPad,isiPhone:yu.isiPhone,isPhone:yu.isPhone,isTablet:yu.isTablet,isTouch:yu.isTouch,isWebView:yu.isWebView}},Nm=/^\s*|\s*$/g,Fi=n=>De(n)?"":(""+n).replace(Nm,""),de=(n,i)=>i?i==="array"&&Ir(n)?!0:typeof n===i:n!==void 0,Me=(n,i,l={})=>{const d=F(n)?n.split(i||","):n||[];let p=d.length;for(;p--;)l[d[p]]={};return l},je=cn,Bt=(n,...i)=>{for(let l=0;l<i.length;l++){const d=i[l];for(const p in d)if(cn(d,p)){const w=d[p];w!==void 0&&(n[p]=w)}}return n},Ln=function(n,i,l,d){d=d||this,n&&(l&&(n=n[l]),Ur(n,(p,w)=>i.call(d,p,w,l)===!1?!1:(Ln(p,i,l,d),!0)))},hn={trim:Fi,isArray:Ir,is:de,toArray:Vs,makeMap:Me,each:Ur,map:Bi,grep:Ba,inArray:hi,hasOwn:je,extend:Bt,walk:Ln,resolve:(n,i=window)=>{const l=n.split(".");for(let d=0,p=l.length;d<p&&(i=i[l[d]],!!i);d++);return i},explode:(n,i)=>re(n)?n:n===""?[]:Bi(n.split(i||","),Fi),_addCacheSuffix:n=>{const i=Kn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},qr=(n,i,l=Tt)=>n.exists(d=>l(d,i)),Nl=(n,i,l=Tt)=>ni(n,i,l).getOr(n.isNone()&&i.isNone()),Xi=n=>{const i=[],l=d=>{i.push(d)};for(let d=0;d<n.length;d++)n[d].each(l);return i},ni=(n,i,l)=>n.isSome()&&i.isSome()?he.some(l(n.getOrDie(),i.getOrDie())):he.none(),vf=(n,i,l,d)=>n.isSome()&&i.isSome()&&l.isSome()?he.some(d(n.getOrDie(),i.getOrDie(),l.getOrDie())):he.none(),Ss=(n,i)=>n?he.some(i):he.none(),Kc=typeof window<"u"?window:Function("return this;")(),Ei=(n,i)=>{let l=i!=null?i:Kc;for(let d=0;d<n.length&&l!==void 0&&l!==null;++d)l=l[n[d]];return l},sc=(n,i)=>{const l=n.split(".");return Ei(l,i)},Oi=(n,i)=>sc(n,i),Ff=(n,i)=>{const l=Oi(n,i);if(l==null)throw new Error(n+" not available on this browser");return l},da=Object.getPrototypeOf,Hf=n=>Ff("HTMLElement",n),fr=n=>{const i=sc("ownerDocument.defaultView",n);return ne(n)&&(Hf(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(da(n).constructor.name))},zu=8,Vu=9,vc=11,$f=1,jd=3,Xr=n=>n.dom.nodeName.toLowerCase(),Ji=n=>n.dom.nodeType,Ha=n=>i=>Ji(i)===n,U0=n=>Ji(n)===zu||Xr(n)==="#comment",xi=n=>_l(n)&&fr(n.dom),_l=Ha($f),Qa=Ha(jd),Ng=Ha(Vu),zf=Ha(vc),yc=n=>i=>_l(i)&&Xr(i)===n,yf=(n,i,l)=>{if(F(l)||we(l)||tt(l))n.setAttribute(i,l+"");else throw console.error("Invalid call to Attribute.set. Key ",i,":: Value ",l,":: Element ",n),new Error("Attribute value was not simple")},Tr=(n,i,l)=>{yf(n.dom,i,l)},Uu=(n,i)=>{const l=n.dom;an(i,(d,p)=>{yf(l,p,d)})},Pl=(n,i)=>{const l=n.dom.getAttribute(i);return l===null?void 0:l},$a=(n,i)=>he.from(Pl(n,i)),qi=(n,i)=>{const l=n.dom;return l&&l.hasAttribute?l.hasAttribute(i):!1},Hi=(n,i)=>{n.dom.removeAttribute(i)},rc=n=>{const i=n.dom.attributes;return i==null||i.length===0},Vf=n=>bn(n.dom.attributes,(i,l)=>(i[l.name]=l.value,i),{}),Zd=(n,i)=>{const l=Pl(n,i);return l===void 0||l===""?[]:l.split(" ")},Pg=(n,i,l)=>{const p=Zd(n,i).concat([l]);return Tr(n,i,p.join(" ")),!0},Pm=(n,i,l)=>{const d=yt(Zd(n,i),p=>p!==l);return d.length>0?Tr(n,i,d.join(" ")):Hi(n,i),!1},Il=n=>n.dom.classList!==void 0,Im=n=>Zd(n,"class"),el=(n,i)=>Pg(n,"class",i),wf=(n,i)=>Pm(n,"class",i),$h=(n,i)=>Ct(Im(n),i)?wf(n,i):el(n,i),Wu=(n,i)=>{Il(n)?n.dom.classList.add(i):el(n,i)},zh=n=>{(Il(n)?n.dom.classList:Im(n)).length===0&&Hi(n,"class")},Nc=(n,i)=>{Il(n)?n.dom.classList.remove(i):wf(n,i),zh(n)},Vh=(n,i)=>{const l=Il(n)?n.dom.classList.toggle(i):$h(n,i);return zh(n),l},_f=(n,i)=>Il(n)&&n.dom.classList.contains(i),Bp=(n,i)=>{const d=(i||document).createElement("div");if(d.innerHTML=n,!d.hasChildNodes()||d.childNodes.length>1){const p="HTML does not have a single root node";throw console.error(p,n),new Error(p)}return Wl(d.childNodes[0])},Bm=(n,i)=>{const d=(i||document).createElement(n);return Wl(d)},Uf=(n,i)=>{const d=(i||document).createTextNode(n);return Wl(d)},Wl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ke={fromHtml:Bp,fromTag:Bm,fromText:Uf,fromDom:Wl,fromPoint:(n,i,l)=>he.from(n.dom.elementFromPoint(i,l)).map(Wl)},qd=(n,i)=>{const l=[],d=w=>(l.push(w),i(w));let p=i(n);do p=p.bind(d);while(p.isSome());return l},wu=(n,i)=>{const l=n.dom;if(l.nodeType!==$f)return!1;{const d=l;if(d.matches!==void 0)return d.matches(i);if(d.msMatchesSelector!==void 0)return d.msMatchesSelector(i);if(d.webkitMatchesSelector!==void 0)return d.webkitMatchesSelector(i);if(d.mozMatchesSelector!==void 0)return d.mozMatchesSelector(i);throw new Error("Browser lacks native selectors")}},Bg=n=>n.nodeType!==$f&&n.nodeType!==Vu&&n.nodeType!==vc||n.childElementCount===0,L1=(n,i)=>{const l=i===void 0?document:i.dom;return Bg(l)?[]:Et(l.querySelectorAll(n),Ke.fromDom)},Uh=(n,i)=>{const l=i===void 0?document:i.dom;return Bg(l)?he.none():he.from(l.querySelector(n)).map(Ke.fromDom)},pt=(n,i)=>n.dom===i.dom,ln=(n,i)=>{const l=n.dom,d=i.dom;return l===d?!1:l.contains(d)},nn=n=>Ke.fromDom(n.dom.ownerDocument),Eo=n=>Ng(n)?n:nn(n),er=n=>Ke.fromDom(Eo(n).dom.documentElement),Wr=n=>Ke.fromDom(Eo(n).dom.defaultView),ai=n=>he.from(n.dom.parentNode).map(Ke.fromDom),gi=n=>he.from(n.dom.parentElement).map(Ke.fromDom),Gd=(n,i)=>{const l=be(i)?i:We;let d=n.dom;const p=[];for(;d.parentNode!==null&&d.parentNode!==void 0;){const w=d.parentNode,E=Ke.fromDom(w);if(p.push(E),l(E)===!0)break;d=w}return p},W0=n=>{const i=l=>yt(l,d=>!pt(n,d));return ai(n).map(Aa).map(i).getOr([])},ya=n=>he.from(n.dom.previousSibling).map(Ke.fromDom),vd=n=>he.from(n.dom.nextSibling).map(Ke.fromDom),Lg=n=>Zs(qd(n,ya)),tl=n=>qd(n,vd),Aa=n=>Et(n.dom.childNodes,Ke.fromDom),ju=(n,i)=>{const l=n.dom.childNodes;return he.from(l[i]).map(Ke.fromDom)},oi=n=>ju(n,0),_u=n=>ju(n,n.dom.childNodes.length-1),ic=n=>n.dom.childNodes.length,Wh=n=>n.dom.hasChildNodes(),F1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ke.fromDom(i)},Kd=n=>zf(n)&&_e(n.dom.host),Fg=be(Element.prototype.attachShadow)&&be(Node.prototype.getRootNode),Yd=nt(Fg),jl=Fg?n=>Ke.fromDom(n.dom.getRootNode()):Eo,jh=n=>Kd(n)?n:F1(Eo(n)),H1=n=>Kd(n)?n:Ke.fromDom(Eo(n).dom.body),Lm=n=>{const i=jl(n);return Kd(i)?he.some(i):he.none()},Hg=n=>Ke.fromDom(n.dom.host),Zh=n=>{if(Yd()&&_e(n.target)){const i=Ke.fromDom(n.target);if(_l(i)&&Xd(i)&&n.composed&&n.composedPath){const l=n.composedPath();if(l)return No(l)}}return he.from(n.target)},Xd=n=>_e(n.dom.shadowRoot),yd=n=>{const i=Qa(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const l=i.ownerDocument;return Lm(Ke.fromDom(i)).fold(()=>l.body.contains(i),mt(yd,Hg))};var si=(n,i,l,d,p)=>n(l,d)?he.some(l):be(p)&&p(l)?he.none():i(l,d,p);const li=(n,i,l)=>{let d=n.dom;const p=be(l)?l:We;for(;d.parentNode;){d=d.parentNode;const w=Ke.fromDom(d);if(i(w))return he.some(w);if(p(w))break}return he.none()},Bl=(n,i,l)=>si((p,w)=>w(p),li,n,i,l),Lp=(n,i)=>{const l=n.dom;return l.parentNode?X(Ke.fromDom(l.parentNode),d=>!pt(n,d)&&i(d)):he.none()},X=(n,i)=>{const l=p=>i(Ke.fromDom(p));return Jn(n.dom.childNodes,l).map(Ke.fromDom)},le=(n,i)=>{const l=d=>{for(let p=0;p<d.childNodes.length;p++){const w=Ke.fromDom(d.childNodes[p]);if(i(w))return he.some(w);const E=l(d.childNodes[p]);if(E.isSome())return E}return he.none()};return l(n.dom)},Se=(n,i,l)=>li(n,d=>wu(d,i),l),Ye=(n,i)=>Uh(i,n),rt=(n,i,l)=>si((p,w)=>wu(p,w),Se,n,i,l),On=n=>rt(n,"[contenteditable]"),wn=(n,i=!1)=>yd(n)?n.dom.isContentEditable:On(n).fold(nt(i),l=>Go(l)==="true"),Go=n=>n.dom.contentEditable,ns=n=>n.style!==void 0&&be(n.style.getPropertyValue),uo=(n,i,l)=>{if(!F(l))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",l,":: Element ",n),new Error("CSS value must be a string: "+l);ns(n)&&n.style.setProperty(i,l)},Sr=(n,i)=>{ns(n)&&n.style.removeProperty(i)},Zl=(n,i,l)=>{const d=n.dom;uo(d,i,l)},ra=(n,i)=>{const l=n.dom;an(i,(d,p)=>{uo(l,p,d)})},Mi=(n,i)=>{const l=n.dom,p=window.getComputedStyle(l).getPropertyValue(i);return p===""&&!yd(n)?Cu(l,i):p},Cu=(n,i)=>ns(n)?n.style.getPropertyValue(i):"",Ta=(n,i)=>{const l=n.dom,d=Cu(l,i);return he.from(d).filter(p=>p.length>0)},qh=n=>{const i={},l=n.dom;if(ns(l))for(let d=0;d<l.style.length;d++){const p=l.style.item(d);i[p]=l.style[p]}return i},Fm=(n,i)=>{const l=n.dom;Sr(l,i),qr($a(n,"style").map(pc),"")&&Hi(n,"style")},$i=n=>n.dom.offsetWidth,wa=(n,i)=>{ai(n).each(d=>{d.dom.insertBefore(i.dom,n.dom)})},Yc=(n,i)=>{vd(n).fold(()=>{ai(n).each(p=>{Qi(p,i)})},d=>{wa(d,i)})},Jd=(n,i)=>{oi(n).fold(()=>{Qi(n,i)},d=>{n.dom.insertBefore(i.dom,d.dom)})},Qi=(n,i)=>{n.dom.appendChild(i.dom)},j0=(n,i)=>{wa(n,i),Qi(i,n)},vv=(n,i)=>{Pe(i,(l,d)=>{const p=d===0?n:i[d-1];Yc(p,l)})},Jr=(n,i)=>{Pe(i,l=>{Qi(n,l)})},wd=n=>{n.dom.textContent="",Pe(Aa(n),i=>{pr(i)})},pr=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},ql=n=>{const i=Aa(n);i.length>0&&vv(n,i),pr(n)},Wf=(n,i)=>{const d=(i||document).createElement("div");return d.innerHTML=n,Aa(Ke.fromDom(d))},Qd=n=>Et(n,Ke.fromDom),xe=n=>n.dom.innerHTML,Cf=(n,i)=>{const d=nn(n).dom,p=Ke.fromDom(d.createDocumentFragment()),w=Wf(i,d);Jr(p,w),wd(n),Qi(n,p)},$g=n=>{const i=Ke.fromTag("div"),l=Ke.fromDom(n.dom.cloneNode(!0));return Qi(i,l),xe(i)},Su=(n,i,l,d,p,w,E)=>({target:n,x:i,y:l,stop:d,prevent:p,kill:w,raw:E}),ci=n=>{const i=Ke.fromDom(Zh(n).getOr(n.target)),l=()=>n.stopPropagation(),d=()=>n.preventDefault(),p=V(d,l);return Su(i,n.clientX,n.clientY,l,d,p,n)},yv=(n,i)=>l=>{n(l)&&i(ci(l))},$1=(n,i,l,d,p)=>{const w=yv(l,d);return n.dom.addEventListener(i,w,p),{unbind:He(jf,n,i,w,p)}},Z0=(n,i,l,d)=>$1(n,i,l,d,!1),jf=(n,i,l,d)=>{n.dom.removeEventListener(i,l,d)},Hm=(n,i)=>({left:n,top:i,translate:(d,p)=>Hm(n+d,i+p)}),zg=Hm,wv=n=>{const i=n.getBoundingClientRect();return zg(i.left,i.top)},Sf=(n,i)=>n!==void 0?n:i!==void 0?i:0,h2=n=>{const i=n.dom.ownerDocument,l=i.body,d=i.defaultView,p=i.documentElement;if(l===n.dom)return zg(l.offsetLeft,l.offsetTop);const w=Sf(d==null?void 0:d.pageYOffset,p.scrollTop),E=Sf(d==null?void 0:d.pageXOffset,p.scrollLeft),R=Sf(p.clientTop,l.clientTop),B=Sf(p.clientLeft,l.clientLeft);return ku(n).translate(E-B,w-R)},ku=n=>{const i=n.dom,d=i.ownerDocument.body;return d===i?zg(d.offsetLeft,d.offsetTop):yd(n)?wv(i):zg(0,0)},Zu=n=>{const i=n!==void 0?n.dom:document,l=i.body.scrollLeft||i.documentElement.scrollLeft,d=i.body.scrollTop||i.documentElement.scrollTop;return zg(l,d)},q0=(n,i,l)=>{const p=(l!==void 0?l.dom:document).defaultView;p&&p.scrollTo(n,i)},G0=(n,i)=>{vs().browser.isSafari()&&be(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},K0=n=>{const i=n===void 0?window:n;return vs().browser.isFirefox()?he.none():he.from(i.visualViewport)},z1=(n,i,l,d)=>({x:n,y:i,width:l,height:d,right:n+l,bottom:i+d}),Zf=n=>{const i=n===void 0?window:n,l=i.document,d=Zu(Ke.fromDom(l));return K0(i).fold(()=>{const p=i.document.documentElement,w=p.clientWidth,E=p.clientHeight;return z1(d.left,d.top,w,E)},p=>z1(Math.max(p.pageLeft,d.left),Math.max(p.pageTop,d.top),p.width,p.height))},Y0=(n,i)=>yt(Aa(n),i),X0=(n,i)=>{let l=[];return Pe(Aa(n),d=>{i(d)&&(l=l.concat([d])),l=l.concat(X0(d,i))}),l},dl=(n,i)=>L1(i,n),m2=(n,i,l)=>Se(n,i,l).isSome();class pi{constructor(i,l){this.node=i,this.rootNode=l,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(i){return this.node=this.findSibling(this.node,"firstChild","nextSibling",i),this.node}prev(i){return this.node=this.findSibling(this.node,"lastChild","previousSibling",i),this.node}prev2(i){return this.node=this.findPreviousNode(this.node,i),this.node}findSibling(i,l,d,p){if(i){if(!p&&i[l])return i[l];if(i!==this.rootNode){let w=i[d];if(w)return w;for(let E=i.parentNode;E&&E!==this.rootNode;E=E.parentNode)if(w=E[d],w)return w}}}findPreviousNode(i,l){if(i){const d=i.previousSibling;if(this.rootNode&&d===this.rootNode)return;if(d){if(!l){for(let w=d.lastChild;w;w=w.lastChild)if(!w.lastChild)return w}return d}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const ro=n=>i=>!!i&&i.nodeType===n,_d=n=>!!n&&!Object.getPrototypeOf(n),Xn=ro(1),wc=n=>{const i=n.toLowerCase();return l=>_e(l)&&l.nodeName.toLowerCase()===i},kf=n=>{const i=n.map(l=>l.toLowerCase());return l=>{if(l&&l.nodeName){const d=l.nodeName.toLowerCase();return Ct(i,d)}return!1}},eh=(n,i)=>{const l=i.toLowerCase().split(" ");return d=>{if(Xn(d)){const p=d.ownerDocument.defaultView;if(p)for(let w=0;w<l.length;w++){const E=p.getComputedStyle(d,null);if((E?E.getPropertyValue(n):null)===l[w])return!0}}return!1}},Pc=n=>i=>Xn(i)&&i.hasAttribute(n),Vg=(n,i)=>l=>Xn(l)&&l.getAttribute(n)===i,Cd=n=>Xn(n)&&n.hasAttribute("data-mce-bogus"),hl=n=>Xn(n)&&n.getAttribute("data-mce-bogus")==="all",Eu=n=>Xn(n)&&n.tagName==="TABLE",Fp=n=>i=>!!(Xn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),V1=kf(["textarea","input"]),_n=ro(3),$m=ro(4),Sd=ro(7),th=ro(8),qu=ro(9),U1=ro(11),ui=wc("br"),zi=wc("img"),ha=Fp("true"),xs=Fp("false"),kd=kf(["td","th"]),Cl=kf(["td","th","caption"]),Gu=kf(["video","audio","object","embed"]),za=wc("li"),_a=wc("details"),Hp=wc("summary"),Qt="\uFEFF",Gr="\xA0",J0=n=>n===Qt,Ca=n=>n.replace(/\uFEFF/g,""),Ug=((n,i)=>{const l=w=>{if(!n(w))throw new Error("Can only get "+i+" value of a "+i+" node");return d(w).getOr("")},d=w=>n(w)?he.from(w.dom.nodeValue):he.none();return{get:l,getOption:d,set:(w,E)=>{if(!n(w))throw new Error("Can only set raw "+i+" value of a "+i+" node");w.dom.nodeValue=E}}})(Qa,"text"),Ic=n=>Ug.get(n),qf=n=>Ug.getOption(n),Gf=(n,i)=>Ug.set(n,i),$p=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],Ll=["td","th"],kr=["thead","tbody","tfoot"],Ua=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],nh=["h1","h2","h3","h4","h5","h6"],Gl=["li","dd","dt"],Q0=["ul","ol","dl"],zm=["pre","script","textarea","style"],W1=["pre"].concat(nh),Wa=n=>{let i;return l=>(i=i||ar(n,xt),cn(i,Xr(l)))},ac=Wa($p),St=n=>Xr(n)==="table",_c=n=>_l(n)&&!ac(n),Xc=n=>_l(n)&&Xr(n)==="br",lc=Wa(Ua),xu=Wa(Q0),ja=Wa(Gl),Za=Wa(kr),Vm=Wa(Ll),Jc=Wa(zm),eb=Wa(W1),Ho=n=>eb(n)||_c(n),$=n=>{const i=[];let l=n.dom;for(;l;)i.push(Ke.fromDom(l)),l=l.lastChild;return i},G=n=>{const i=dl(n,"br"),l=yt($(n).slice(-1),Xc);i.length===l.length&&Pe(l,pr)},ve=()=>{const n=Ke.fromTag("br");return Tr(n,"data-mce-bogus","1"),n},Te=n=>{wd(n),Qi(n,ve())},at=n=>{_u(n).each(i=>{ya(i).each(l=>{ac(n)&&Xc(i)&&ac(l)&&pr(i)})})},Ft=Qt,Cn=J0,Bn=Ca,Uo=Xn,Jo=_n,bi=n=>(Jo(n)&&(n=n.parentNode),Uo(n)&&n.hasAttribute("data-mce-caret")),tr=n=>Jo(n)&&Cn(n.data),br=n=>bi(n)||tr(n),Bc=n=>n.firstChild!==n.lastChild||!ui(n.firstChild),Qc=(n,i)=>{var l;const p=((l=n.ownerDocument)!==null&&l!==void 0?l:document).createTextNode(Ft),w=n.parentNode;if(i){const E=n.previousSibling;if(Jo(E)){if(br(E))return E;if(lr(E))return E.splitText(E.data.length-1)}w==null||w.insertBefore(p,n)}else{const E=n.nextSibling;if(Jo(E)){if(br(E))return E;if(sh(E))return E.splitText(1),E}n.nextSibling?w==null||w.insertBefore(p,n.nextSibling):w==null||w.appendChild(p)}return p},Ku=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&tr(i.previousSibling):!1},Ef=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&tr(i.nextSibling):!1},oh=(n,i,l)=>{var d;const w=((d=i.ownerDocument)!==null&&d!==void 0?d:document).createElement(n);w.setAttribute("data-mce-caret",l?"before":"after"),w.setAttribute("data-mce-bogus","all"),w.appendChild(ve().dom);const E=i.parentNode;return l?E==null||E.insertBefore(w,i):i.nextSibling?E==null||E.insertBefore(w,i.nextSibling):E==null||E.appendChild(w),w},sh=n=>Jo(n)&&n.data[0]===Ft,lr=n=>Jo(n)&&n.data[n.data.length-1]===Ft,Um=n=>{var i;const l=n.getElementsByTagName("br"),d=l[l.length-1];Cd(d)&&((i=d.parentNode)===null||i===void 0||i.removeChild(d))},Wm=n=>n&&n.hasAttribute("data-mce-caret")?(Um(n),n.removeAttribute("data-mce-caret"),n.removeAttribute("data-mce-bogus"),n.removeAttribute("style"),n.removeAttribute("data-mce-style"),n.removeAttribute("_moz_abspos"),n):null,ea=n=>bi(n.startContainer),eu=ha,zp=xs,jm=ui,Os=_n,Br=kf(["script","style","textarea"]),Da=kf(["img","input","textarea","hr","iframe","video","audio","object","embed"]),cc=kf(["table"]),j1=br,Sl=n=>j1(n)?!1:Os(n)?!Br(n.parentNode):Da(n)||jm(n)||cc(n)||tu(n),Gi=n=>Xn(n)&&n.getAttribute("unselectable")==="true",tu=n=>!Gi(n)&&zp(n),xf=(n,i)=>{for(let l=n.parentNode;l&&l!==i;l=l.parentNode){if(tu(l))return!1;if(eu(l))return!0}return!0},F_=n=>tu(n)?!bn(Mr(n.getElementsByTagName("*")),(i,l)=>i||eu(l),!1):!1,Gh=n=>Da(n)||F_(n),Wg=(n,i)=>Sl(n)&&xf(n,i),Kh=/^[ \t\r\n]*$/,Zm=n=>Kh.test(n),jg=n=>{for(const i of n)if(!J0(i))return!1;return!0},tb=n=>" \f \v".indexOf(n)!==-1,Yh=n=>n===`
`||n==="\r",Oa=(n,i)=>i<n.length&&i>=0?Yh(n[i]):!1,rh=(n,i=4,l=!0,d=!0)=>{const p=pu(" ",i),w=n.replace(/\t/g,p);return bn(w,(R,B)=>tb(B)||B===Gr?R.pcIsSpace||R.str===""&&l||R.str.length===w.length-1&&d||Oa(w,R.str.length+1)?{pcIsSpace:!1,str:R.str+Gr}:{pcIsSpace:!0,str:R.str+" "}:{pcIsSpace:Yh(B),str:R.str+B},{pcIsSpace:!1,str:""}).str},Ed=(n,i)=>{const l=Ke.fromDom(i),d=Ke.fromDom(n);return m2(d,"pre,code",He(pt,l))},qm=(n,i)=>_n(n)&&Zm(n.data)&&!Ed(n,i),Gm=n=>Xn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),Xh=(n,i)=>Sl(n)&&!qm(n,i)||Gm(n)||Yu(n),Yu=Pc("data-mce-bookmark"),nb=Pc("data-mce-bogus"),Z1=Vg("data-mce-bogus","all"),H_=(n,i)=>{let l=0;if(Xh(n,n))return!1;{let d=n.firstChild;if(!d)return!0;const p=new pi(d,n);do{if(i){if(Z1(d)){d=p.next(!0);continue}if(nb(d)){d=p.next();continue}}if(ui(d)){l++,d=p.next();continue}if(Xh(d,n))return!1;d=p.next()}while(d);return l<=1}},Ma=(n,i=!0)=>H_(n.dom,i),Zg="data-mce-block",Km=n=>yt(gs(n),i=>!/[A-Z]/.test(i)),nu=n=>Km(n).join(","),Af=(n,i)=>_e(i.querySelector(n))?(i.setAttribute(Zg,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(Zg),!1),Ym=(n,i)=>{const l=nu(n.getTransparentElements()),d=nu(n.getBlockElements());return yt(i.querySelectorAll(l),p=>Af(d,p))},ih=(n,i)=>{var l;const d=i?"lastChild":"firstChild";for(let p=n[d];p;p=p[d])if(Ma(Ke.fromDom(p))){(l=p.parentNode)===null||l===void 0||l.removeChild(p);return}},Au=(n,i)=>{const l=document.createRange(),d=n.parentNode;if(d){l.setStartBefore(n),l.setEndBefore(i);const p=l.extractContents();ih(p,!0),l.setStartAfter(i),l.setEndAfter(n);const w=l.extractContents();ih(w,!1),Ma(Ke.fromDom(p))||d.insertBefore(p,n),Ma(Ke.fromDom(i))||d.insertBefore(i,n),Ma(Ke.fromDom(w))||d.insertBefore(w,n),d.removeChild(n)}},xd=(n,i,l)=>{const d=n.getBlockElements(),p=Ke.fromDom(i),w=R=>Xr(R)in d,E=R=>pt(R,p);Pe(Qd(l),R=>{li(R,w,E).each(B=>{const K=Y0(R,ie=>w(ie)&&!n.isValidChild(Xr(B),Xr(ie)));if(K.length>0){const ie=gi(B);Pe(K,ue=>{li(ue,w,E).each(pe=>{Au(pe.dom,ue.dom)})}),ie.each(ue=>Ym(n,ue.dom))}})})},Xm=(n,i,l)=>{Pe([...l,...Jm(n,i)?[i]:[]],d=>Pe(dl(Ke.fromDom(d),d.nodeName.toLowerCase()),p=>{kv(n,p.dom)&&ql(p)}))},ob=(n,i)=>{const l=Ym(n,i);xd(n,i,l),Xm(n,i,l)},_v=(n,i)=>{if(Sv(n,i)){const l=nu(n.getBlockElements());Af(l,i)}},Cv=(n,i,l)=>{const d=w=>pt(w,Ke.fromDom(i)),p=Gd(Ke.fromDom(l),d);Zr(p,p.length-2).filter(_l).fold(()=>ob(n,i),w=>ob(n,w.dom))},ah=n=>n.hasAttribute(Zg),qg=(n,i)=>cn(n.getTransparentElements(),i),Sv=(n,i)=>Xn(i)&&qg(n,i.nodeName),Jm=(n,i)=>Sv(n,i)&&ah(i),kv=(n,i)=>Sv(n,i)&&!ah(i),nr=(n,i)=>i.type===1&&qg(n,i.name)&&F(i.attr(Zg)),Ao=vs().browser,lh=n=>Jn(n,_l),q1=n=>Ao.isFirefox()&&Xr(n)==="table"?lh(Aa(n)).filter(i=>Xr(i)==="caption").bind(i=>lh(tl(i)).map(l=>{const d=l.dom.offsetTop,p=i.dom.offsetTop,w=i.dom.offsetHeight;return d<=p?-w:0})).getOr(0):0,Gg=(n,i)=>n.children&&Ct(n.children,i),Tk=(n,i,l)=>{let d=0,p=0;const w=n.ownerDocument;if(l=l||n,i){if(l===n&&i.getBoundingClientRect&&Mi(Ke.fromDom(n),"position")==="static"){const R=i.getBoundingClientRect();return d=R.left+(w.documentElement.scrollLeft||n.scrollLeft)-w.documentElement.clientLeft,p=R.top+(w.documentElement.scrollTop||n.scrollTop)-w.documentElement.clientTop,{x:d,y:p}}let E=i;for(;E&&E!==l&&E.nodeType&&!Gg(E,l);){const R=E;d+=R.offsetLeft||0,p+=R.offsetTop||0,E=R.offsetParent}for(E=i.parentNode;E&&E!==l&&E.nodeType&&!Gg(E,l);)d-=E.scrollLeft||0,p-=E.scrollTop||0,E=E.parentNode;p+=q1(Ke.fromDom(i))}return{x:d,y:p}},Ev=(n,i={})=>{let l=0;const d={},p=Ke.fromDom(n),w=Eo(p),E=Oe=>{i.referrerPolicy=Oe},R=Oe=>{i.contentCssCors=Oe},B=Oe=>{Qi(jh(p),Oe)},K=Oe=>{const ze=jh(p);Ye(ze,"#"+Oe).each(pr)},ie=Oe=>go(d,Oe).getOrThunk(()=>({id:"mce-u"+l++,passed:[],failed:[],count:0})),ue=Oe=>new Promise((ze,ht)=>{let bt;const vt=hn._addCacheSuffix(Oe),Mt=ie(vt);d[vt]=Mt,Mt.count++;const fn=($t,yn)=>{Pe($t,xn),Mt.status=yn,Mt.passed=[],Mt.failed=[],bt&&(bt.onload=null,bt.onerror=null,bt=null)},$n=()=>fn(Mt.passed,2),Pn=()=>fn(Mt.failed,3);if(ze&&Mt.passed.push(ze),ht&&Mt.failed.push(ht),Mt.status===1)return;if(Mt.status===2){$n();return}if(Mt.status===3){Pn();return}Mt.status=1;const Lt=Ke.fromTag("link",w.dom);Uu(Lt,{rel:"stylesheet",type:"text/css",id:Mt.id}),i.contentCssCors&&Tr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Tr(Lt,"referrerpolicy",i.referrerPolicy),bt=Lt.dom,bt.onload=$n,bt.onerror=Pn,B(Lt),Tr(Lt,"href",vt)}),pe=Oe=>Promise.allSettled(Et(Oe,ht=>ue(ht).then(nt(ht)))).then(ht=>{const bt=gn(ht,vt=>vt.status==="fulfilled");return bt.fail.length>0?Promise.reject(Et(bt.fail,vt=>vt.reason)):Et(bt.pass,vt=>vt.value)}),Be=Oe=>{const ze=hn._addCacheSuffix(Oe);go(d,ze).each(ht=>{--ht.count===0&&(delete d[ze],K(ht.id))})};return{load:ue,loadAll:pe,unload:Be,unloadAll:Oe=>{Pe(Oe,ze=>{Be(ze)})},_setReferrerPolicy:E,_setContentCssCors:R}},xv=(()=>{const n=new WeakMap;return{forElement:(l,d)=>{const w=jl(l).dom;return he.from(n.get(w)).getOrThunk(()=>{const E=Ev(w,d);return n.set(w,E),E})}}})(),G1=n=>n.nodeName.toLowerCase()==="span",g2=(n,i)=>_e(n)&&(Xh(n,i)||_c(Ke.fromDom(n))),en=(n,i)=>{const l=new pi(n,i).prev(!1),d=new pi(n,i).next(!1),p=ye(l)||g2(l,i),w=ye(d)||g2(d,i);return p&&w},Ad=n=>G1(n)&&n.getAttribute("data-mce-type")==="bookmark",$_=(n,i)=>_n(n)&&n.data.length>0&&en(n,i),sb=n=>Xn(n)?n.childNodes.length>0:!1,Dk=n=>U1(n)||qu(n),Qm=(n,i,l)=>{var d;const p=l||i;if(Xn(i)&&Ad(i))return i;const w=i.childNodes;for(let E=w.length-1;E>=0;E--)Qm(n,w[E],p);if(Xn(i)){const E=i.childNodes;E.length===1&&Ad(E[0])&&((d=i.parentNode)===null||d===void 0||d.insertBefore(E[0],i))}return!Dk(i)&&!Xh(i,p)&&!sb(i)&&!$_(i,p)&&n.remove(i),i},p2=hn.makeMap,Jh=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Td=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,eg=/[<>&\"\']/g,vi=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Dd={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},Od={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},ou={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Hs=n=>{const i=Ke.fromTag("div").dom;return i.innerHTML=n,i.textContent||i.innerText||n},Vp=(n,i)=>{const l={};if(n){const d=n.split(",");i=i||10;for(let p=0;p<d.length;p+=2){const w=String.fromCharCode(parseInt(d[p],i));if(!Od[w]){const E="&"+d[p+1]+";";l[w]=E,l[E]=w}}return l}else return},ch=Vp("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),Kg=(n,i)=>n.replace(i?Jh:Td,l=>Od[l]||l),Ok=n=>(""+n).replace(eg,i=>Od[i]||i),rb=(n,i)=>n.replace(i?Jh:Td,l=>l.length>1?"&#"+((l.charCodeAt(0)-55296)*1024+(l.charCodeAt(1)-56320)+65536)+";":Od[l]||"&#"+l.charCodeAt(0)+";"),Av=(n,i,l)=>{const d=l||ch;return n.replace(i?Jh:Td,p=>Od[p]||d[p]||p)},Yg={encodeRaw:Kg,encodeAllRaw:Ok,encodeNumeric:rb,encodeNamed:Av,getEncodeFunc:(n,i)=>{const l=Vp(i)||ch,d=(E,R)=>E.replace(R?Jh:Td,B=>Od[B]!==void 0?Od[B]:l[B]!==void 0?l[B]:B.length>1?"&#"+((B.charCodeAt(0)-55296)*1024+(B.charCodeAt(1)-56320)+65536)+";":"&#"+B.charCodeAt(0)+";"),p=(E,R)=>Av(E,R,l),w=p2(n.replace(/\+/g,","));return w.named&&w.numeric?d:w.named?i?p:Av:w.numeric?rb:Kg},decode:n=>n.replace(vi,(i,l)=>l?(l.charAt(0).toLowerCase()==="x"?l=parseInt(l.substr(1),16):l=parseInt(l,10),l>65535?(l-=65536,String.fromCharCode(55296+(l>>10),56320+(l&1023))):Dd[l]||String.fromCharCode(l)):ou[i]||ch[i]||Hs(i))},El=(n,i)=>(n=hn.trim(n),n?n.split(i||" "):[]),b2=n=>new RegExp("^"+n.replace(/([?+*])/g,".$1")+"$"),oo=n=>{const i=/^(~)?(.+)$/;return Ns(El(n,","),l=>{const d=i.exec(l);if(d){const p=d[1]==="~",w=p?"span":"div",E=d[2];return[{inline:p,cloneName:w,name:E}]}else return[]})},v2=n=>{let i,l,d,p;if(i="id accesskey class dir lang style tabindex title role",l="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",d="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment",n!=="html4"){const w="a ins del canvas map";i+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",l+=" article aside details dialog figure main header footer hgroup section nav "+w,d+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"}return n!=="html5-strict"&&(i+=" xml:lang",d=[d,"acronym applet basefont big font strike tt"].join(" "),l=[l,"center dir isindex noframes"].join(" "),p=[l,d].join(" ")),p=p||[l,d].join(" "),{globalAttributes:i,blockContent:l,phrasingContent:d,flowContent:p}},Mk=n=>{const{globalAttributes:i,phrasingContent:l,flowContent:d}=v2(n),p={},w=(R,B="",K="")=>{const ie=El(K),ue=El(R);let pe=ue.length;for(;pe--;){const Be=El([i,B].join(" "));p[ue[pe]]={attributes:ar(Be,nt({})),attributesOrder:Be,children:ar(ie,nt({}))}}},E=(R,B)=>{const K=El(R),ie=El(B);let ue=K.length;for(;ue--;){const pe=p[K[ue]];for(let Be=0,Ze=ie.length;Be<Ze;Be++)pe.attributes[ie[Be]]={},pe.attributesOrder.push(ie[Be])}};return n!=="html5-strict"&&(Pe(El("acronym applet basefont big font strike tt"),K=>{w(K,"",l)}),Pe(El("center dir isindex noframes"),K=>{w(K,"",d)})),w("html","manifest","head body"),w("head","","base command link meta noscript script style title"),w("title hr noscript br"),w("base","href target"),w("link","href rel media hreflang type sizes hreflang"),w("meta","name http-equiv content charset"),w("style","media type scoped"),w("script","src async defer type charset"),w("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",d),w("dd div","",d),w("address dt caption","",n==="html4"?l:d),w("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",l),w("blockquote","cite",d),w("ol","reversed start type","li"),w("ul","","li"),w("li","value",d),w("dl","","dt dd"),w("a","href target rel media hreflang type",n==="html4"?l:d),w("q","cite",l),w("ins del","cite datetime",d),w("img","src sizes srcset alt usemap ismap width height"),w("iframe","src name width height",d),w("embed","src type width height"),w("object","data type typemustmatch name usemap form width height",[d,"param"].join(" ")),w("param","name value"),w("map","name",[d,"area"].join(" ")),w("area","alt coords shape href target rel media hreflang type"),w("table","border","caption colgroup thead tfoot tbody tr"+(n==="html4"?" col":"")),w("colgroup","span","col"),w("col","span"),w("tbody thead tfoot","","tr"),w("tr","","td th"),w("td","colspan rowspan headers",d),w("th","colspan rowspan headers scope abbr",d),w("form","accept-charset action autocomplete enctype method name novalidate target",d),w("fieldset","disabled form name",[d,"legend"].join(" ")),w("label","form for",l),w("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),w("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",n==="html4"?d:l),w("select","disabled form multiple name required size","option optgroup"),w("optgroup","disabled label","option"),w("option","disabled label selected value"),w("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),w("menu","type label",[d,"li"].join(" ")),w("noscript","",d),n!=="html4"&&(w("wbr"),w("ruby","",[l,"rt rp"].join(" ")),w("figcaption","",d),w("mark rt rp summary bdi","",l),w("canvas","width height",d),w("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[d,"track source"].join(" ")),w("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[d,"track source"].join(" ")),w("picture","","img source"),w("source","src srcset type media sizes"),w("track","kind src srclang label default"),w("datalist","",[l,"option"].join(" ")),w("article section nav aside main header footer","",d),w("hgroup","","h1 h2 h3 h4 h5 h6"),w("figure","",[d,"figcaption"].join(" ")),w("time","datetime",l),w("dialog","open",d),w("command","type label icon disabled checked radiogroup command"),w("output","for form name",l),w("progress","value max",l),w("meter","value min max low high optimum",l),w("details","open",[d,"summary"].join(" ")),w("keygen","autofocus challenge disabled form keytype name")),n!=="html5-strict"&&(E("script","language xml:space"),E("style","xml:space"),E("object","declare classid code codebase codetype archive standby align border hspace vspace"),E("embed","align name hspace vspace"),E("param","valuetype type"),E("a","charset name rev shape coords"),E("br","clear"),E("applet","codebase archive code object alt name width height align hspace vspace"),E("img","name longdesc align border hspace vspace"),E("iframe","longdesc frameborder marginwidth marginheight scrolling align"),E("font basefont","size color face"),E("input","usemap align"),E("select"),E("textarea"),E("h1 h2 h3 h4 h5 h6 div p legend caption","align"),E("ul","type compact"),E("li","type"),E("ol dl menu dir","compact"),E("pre","width xml:space"),E("hr","align noshade size width"),E("isindex","prompt"),E("table","summary width frame rules cellspacing cellpadding align bgcolor"),E("col","width align char charoff valign"),E("colgroup","width align char charoff valign"),E("thead","align char charoff valign"),E("tr","align char charoff valign bgcolor"),E("th","axis align char charoff valign nowrap bgcolor width height"),E("form","accept"),E("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),E("tfoot","align char charoff valign"),E("tbody","align char charoff valign"),E("area","nohref"),E("body","background bgcolor text link vlink alink")),n!=="html4"&&(E("input button select textarea","autofocus"),E("input textarea","placeholder"),E("a","download"),E("link script img","crossorigin"),E("img","loading"),E("iframe","sandbox seamless allow allowfullscreen loading")),n!=="html4"&&Pe([p.video,p.audio],R=>{delete R.children.audio,delete R.children.video}),Pe(El("a form meter progress dfn"),R=>{p[R]&&delete p[R].children[R]}),delete p.caption.children.table,delete p.script,p},y2=n=>n==="-"?"remove":"add",Qh=n=>{const i=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return Ns(El(n,","),l=>{const d=i.exec(l);if(d){const p=d[1],w=p?y2(p):"replace",E=d[2],R=El(d[3],"|");return[{operation:w,name:E,validChildren:R}]}else return[]})},Xu=(n,i)=>{const l=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,d=/[*?+]/,{attributes:p,attributesOrder:w}=i;return Pe(El(n,"|"),E=>{const R=l.exec(E);if(R){const B={},K=R[1],ie=R[2].replace(/[\\:]:/g,":"),ue=R[3],pe=R[4];if(K==="!"&&(i.attributesRequired=i.attributesRequired||[],i.attributesRequired.push(ie),B.required=!0),K==="-"){delete p[ie],w.splice(hn.inArray(w,ie),1);return}if(ue&&(ue==="="?(i.attributesDefault=i.attributesDefault||[],i.attributesDefault.push({name:ie,value:pe}),B.defaultValue=pe):ue==="~"?(i.attributesForced=i.attributesForced||[],i.attributesForced.push({name:ie,value:pe}),B.forcedValue=pe):ue==="<"&&(B.validValues=hn.makeMap(pe,"?"))),d.test(ie)){const Be=B;i.attributePatterns=i.attributePatterns||[],Be.pattern=b2(ie),i.attributePatterns.push(Be)}else p[ie]||w.push(ie),p[ie]=B}})},uh=(n,i)=>{an(n.attributes,(l,d)=>{i.attributes[d]=l}),i.attributesOrder.push(...n.attributesOrder)},Xg=(n,i)=>{const l=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return Ns(El(i,","),d=>{const p=l.exec(d);if(p){const w=p[1],E=p[2],R=p[3],B=p[4],K=p[5],ie={attributes:{},attributesOrder:[]};if(n.each(ue=>uh(ue,ie)),w==="#"?ie.paddEmpty=!0:w==="-"&&(ie.removeEmpty=!0),B==="!"&&(ie.removeEmptyAttrs=!0),K&&Xu(K,ie),R&&(ie.outputName=E),E==="@")if(n.isNone())n=he.some(ie);else return[];return[R?{name:E,element:ie,aliasName:R}:{name:E,element:ie}]}else return[]})},fh={},ib=hn.makeMap,Tf=hn.each,Jg=hn.extend,w2=hn.explode,Up=(n,i={})=>{const l=ib(n," ",ib(n.toUpperCase()," "));return Jg(l,i)},Kf=n=>Up("td th li dt dd figcaption caption details summary",n.getTextBlockElements()),_2=(n,i)=>{if(n){const l={};return F(n)&&(n={"*":n}),Tf(n,(d,p)=>{l[p]=l[p.toUpperCase()]=i==="map"?ib(d,/[, ]/):w2(d,/[, ]/)}),l}else return},dh=(n={})=>{var i;const l={},d={};let p=[];const w={},E={},R=(io,Ws,ii)=>{const Ka=n[io];if(Ka)return ib(Ka,/[, ]/,ib(Ka.toUpperCase(),/[, ]/));{let Ci=fh[io];return Ci||(Ci=Up(Ws,ii),fh[io]=Ci),Ci}},B=(i=n.schema)!==null&&i!==void 0?i:"html5",K=Mk(B);n.verify_html===!1&&(n.valid_elements="*[*]");const ie=_2(n.valid_styles),ue=_2(n.invalid_styles,"map"),pe=_2(n.valid_classes,"map"),Be=R("whitespace_elements","pre script noscript style textarea video audio iframe object code"),Ze=R("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),Oe=R("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),ze=R("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),ht="td th iframe video audio object script code",bt=R("non_empty_elements",ht+" pre",Oe),vt=R("move_caret_before_on_enter_elements",ht+" table",Oe),Mt=R("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),fn=R("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",Mt),$n=R("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),Pn=R("transparent_elements","a ins del canvas map");Tf("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),io=>{E[io]=new RegExp("</"+io+"[^>]*>","gi")});const Lt=io=>{const Ws=he.from(l["@"]),ii=/[*?+]/;Pe(Xg(Ws,io!=null?io:""),({name:Ka,element:Ci,aliasName:Ec})=>{if(Ec&&(l[Ec]=Ci),ii.test(Ka)){const Mh=Ci;Mh.pattern=b2(Ka),p.push(Mh)}else l[Ka]=Ci})},$t=io=>{p=[],Pe(gs(l),Ws=>{delete l[Ws]}),Lt(io)},yn=io=>{delete fh.text_block_elements,delete fh.block_elements,Pe(oo(io!=null?io:""),({inline:Ws,name:ii,cloneName:Ka})=>{if(d[ii]=d[Ka],w[ii]=Ka,bt[ii.toUpperCase()]={},bt[ii]={},Ws||(fn[ii.toUpperCase()]={},fn[ii]={}),!l[ii]){let Ci=l[Ka];Ci=Jg({},Ci),delete Ci.removeEmptyAttrs,delete Ci.removeEmpty,l[ii]=Ci}an(d,(Ci,Ec)=>{Ci[Ka]&&(d[Ec]=Ci=Jg({},d[Ec]),Ci[ii]=Ci[Ka])})})},mo=io=>{Pe(Qh(io!=null?io:""),({operation:Ws,name:ii,validChildren:Ka})=>{const Ci=Ws==="replace"?{"#comment":{}}:d[ii];Pe(Ka,Ec=>{Ws==="remove"?delete Ci[Ec]:Ci[Ec]={}}),d[ii]=Ci})},Oo=io=>{const Ws=l[io];if(Ws)return Ws;let ii=p.length;for(;ii--;){const Ka=p[ii];if(Ka.pattern.test(io))return Ka}};n.valid_elements?($t(n.valid_elements),Tf(K,(io,Ws)=>{d[Ws]=io.children})):(Tf(K,(io,Ws)=>{l[Ws]={attributes:io.attributes,attributesOrder:io.attributesOrder},d[Ws]=io.children}),Tf(El("strong/b em/i"),io=>{const Ws=El(io,"/");l[Ws[1]].outputName=Ws[0]}),Tf($n,(io,Ws)=>{l[Ws]&&(n.padd_empty_block_inline_children&&(l[Ws].paddInEmptyBlock=!0),l[Ws].removeEmpty=!0)}),Tf(El("ol ul blockquote a table tbody"),io=>{l[io]&&(l[io].removeEmpty=!0)}),Tf(El("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),io=>{l[io]&&(l[io].paddEmpty=!0)}),Tf(El("span"),io=>{l[io].removeEmptyAttrs=!0})),yn(n.custom_elements),mo(n.valid_children),Lt(n.extended_valid_elements),mo("+ol[ul|ol],+ul[ul|ol]"),Tf({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(io,Ws)=>{l[Ws]&&(l[Ws].parentsRequired=El(io))}),n.invalid_elements&&Tf(w2(n.invalid_elements),io=>{l[io]&&delete l[io]}),Oo("span")||Lt("span[!data-mce-type|*]");const Cs=nt(ie),Us=nt(ue),Pr=nt(pe),di=nt(ze),il=nt(fn),Rl=nt(Mt),hc=nt($n),Mn=nt(Object.seal(Oe)),Qn=nt(Ze),yr=nt(bt),Bs=nt(vt),vo=nt(Be),Rn=nt(Pn),Tn=nt(Object.seal(E)),jo=(io,Ws)=>{const ii=d[io.toLowerCase()];return!!(ii&&ii[Ws.toLowerCase()])},Ys=(io,Ws)=>{const ii=Oo(io);if(ii)if(Ws){if(ii.attributes[Ws])return!0;const Ka=ii.attributePatterns;if(Ka){let Ci=Ka.length;for(;Ci--;)if(Ka[Ci].pattern.test(Ws))return!0}}else return!0;return!1},Kr=nt(w);return{type:B,children:d,elements:l,getValidStyles:Cs,getValidClasses:Pr,getBlockElements:il,getInvalidStyles:Us,getVoidElements:Mn,getTextBlockElements:Rl,getTextInlineElements:hc,getBoolAttrs:di,getElementRule:Oo,getSelfClosingElements:Qn,getNonEmptyElements:yr,getMoveCaretBeforeOnEnterElements:Bs,getWhitespaceElements:vo,getTransparentElements:Rn,getSpecialElements:Tn,isValidChild:jo,isValid:Ys,getCustomElements:Kr,addValidElements:Lt,setValidElements:$t,addCustomElements:yn,addValidChildren:mo}},Tv=(n={},i)=>{const l=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,d=/\s*([^:]+):\s*([^;]+);?/g,p=/\s+$/,w={};let E,R;const B=Qt;i&&(E=i.getValidStyles(),R=i.getInvalidStyles());const K=(`\\" \\' \\; \\: ; : `+B).split(" ");for(let ue=0;ue<K.length;ue++)w[K[ue]]=B+ue,w[B+ue]=K[ue];const ie={parse:ue=>{const pe={};let Be=!1;const Ze=n.url_converter,Oe=n.url_converter_scope||ie,ze=(Lt,$t,yn)=>{const mo=pe[Lt+"-top"+$t];if(!mo)return;const Oo=pe[Lt+"-right"+$t];if(!Oo)return;const Cs=pe[Lt+"-bottom"+$t];if(!Cs)return;const Us=pe[Lt+"-left"+$t];if(!Us)return;const Pr=[mo,Oo,Cs,Us];let di=Pr.length-1;for(;di--&&Pr[di]===Pr[di+1];);di>-1&&yn||(pe[Lt+$t]=di===-1?Pr[0]:Pr.join(" "),delete pe[Lt+"-top"+$t],delete pe[Lt+"-right"+$t],delete pe[Lt+"-bottom"+$t],delete pe[Lt+"-left"+$t])},ht=Lt=>{const $t=pe[Lt];if(!$t)return;const yn=$t.indexOf(",")>-1?[$t]:$t.split(" ");let mo=yn.length;for(;mo--;)if(yn[mo]!==yn[0])return!1;return pe[Lt]=yn[0],!0},bt=(Lt,$t,yn,mo)=>{!ht($t)||!ht(yn)||!ht(mo)||(pe[Lt]=pe[$t]+" "+pe[yn]+" "+pe[mo],delete pe[$t],delete pe[yn],delete pe[mo])},vt=Lt=>(Be=!0,w[Lt]),Mt=(Lt,$t)=>(Be&&(Lt=Lt.replace(/\uFEFF[0-9]/g,yn=>w[yn])),$t||(Lt=Lt.replace(/\\([\'\";:])/g,"$1")),Lt),fn=Lt=>String.fromCharCode(parseInt(Lt.slice(1),16)),$n=Lt=>Lt.replace(/\\[0-9a-f]+/gi,fn),Pn=(Lt,$t,yn,mo,Oo,Cs)=>{if(Oo=Oo||Cs,Oo)return Oo=Mt(Oo),"'"+Oo.replace(/\'/g,"\\'")+"'";if($t=Mt($t||yn||mo||""),!n.allow_script_urls){const Us=$t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(Us)||!n.allow_svg_data_urls&&/^data:image\/svg/i.test(Us))return""}return Ze&&($t=Ze.call(Oe,$t,"style")),"url('"+$t.replace(/\'/g,"\\'")+"')"};if(ue){ue=ue.replace(/[\u0000-\u001F]/g,""),ue=ue.replace(/\\[\"\';:\uFEFF]/g,vt).replace(/\"[^\"]+\"|\'[^\']+\'/g,$t=>$t.replace(/[;:]/g,vt));let Lt;for(;Lt=d.exec(ue);){d.lastIndex=Lt.index+Lt[0].length;let $t=Lt[1].replace(p,"").toLowerCase(),yn=Lt[2].replace(p,"");if($t&&yn){if($t=$n($t),yn=$n(yn),$t.indexOf(B)!==-1||$t.indexOf('"')!==-1||!n.allow_script_urls&&($t==="behavior"||/expression\s*\(|\/\*|\*\//.test(yn)))continue;$t==="font-weight"&&yn==="700"?yn="bold":($t==="color"||$t==="background-color")&&(yn=yn.toLowerCase()),yn=yn.replace(l,Pn),pe[$t]=Be?Mt(yn,!0):yn}}ze("border","",!0),ze("border","-width"),ze("border","-color"),ze("border","-style"),ze("padding",""),ze("margin",""),bt("border","border-width","border-style","border-color"),pe.border==="medium none"&&delete pe.border,pe["border-image"]==="none"&&delete pe["border-image"]}return pe},serialize:(ue,pe)=>{let Be="";const Ze=(ze,ht)=>{const bt=ht[ze];if(bt)for(let vt=0,Mt=bt.length;vt<Mt;vt++){const fn=bt[vt],$n=ue[fn];$n&&(Be+=(Be.length>0?" ":"")+fn+": "+$n+";")}},Oe=(ze,ht)=>{if(!R||!ht)return!0;let bt=R["*"];return bt&&bt[ze]?!1:(bt=R[ht],!(bt&&bt[ze]))};return pe&&E?(Ze("*",E),Ze(pe,E)):an(ue,(ze,ht)=>{ze&&Oe(ht,pe)&&(Be+=(Be.length>0?" ":"")+ht+": "+ze+";")}),Be}};return ie},z_={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},C2=n=>n instanceof Event||be(n.initEvent),Qg=n=>n.isDefaultPrevented===xt||n.isDefaultPrevented===We,Df=n=>De(n.preventDefault)||C2(n),su=(n,i)=>{const l=i!=null?i:{};for(const d in n)cn(z_,d)||(l[d]=n[d]);return _e(n.composedPath)&&(l.composedPath=()=>n.composedPath()),l},ep=(n,i,l,d)=>{var p;const w=su(i,d);return w.type=n,De(w.target)&&(w.target=(p=w.srcElement)!==null&&p!==void 0?p:l),Df(i)&&(w.preventDefault=()=>{w.defaultPrevented=!0,w.isDefaultPrevented=xt,be(i.preventDefault)&&i.preventDefault()},w.stopPropagation=()=>{w.cancelBubble=!0,w.isPropagationStopped=xt,be(i.stopPropagation)&&i.stopPropagation()},w.stopImmediatePropagation=()=>{w.isImmediatePropagationStopped=xt,w.stopPropagation()},Qg(w)||(w.isDefaultPrevented=w.defaultPrevented===!0?xt:We,w.isPropagationStopped=w.cancelBubble===!0?xt:We,w.isImmediatePropagationStopped=We)),w},S2="mce-data-",V_=/^(?:mouse|contextmenu)|click/,ab=(n,i,l,d)=>{n.addEventListener(i,l,d||!1)},Lc=(n,i,l,d)=>{n.removeEventListener(i,l,d||!1)},lb=n=>_e(n)&&V_.test(n.type),Ju=(n,i)=>{const l=ep(n.type,n,document,i);if(lb(n)&&ye(n.pageX)&&!ye(n.clientX)){const d=l.target.ownerDocument||document,p=d.documentElement,w=d.body,E=l;E.pageX=n.clientX+(p&&p.scrollLeft||w&&w.scrollLeft||0)-(p&&p.clientLeft||w&&w.clientLeft||0),E.pageY=n.clientY+(p&&p.scrollTop||w&&w.scrollTop||0)-(p&&p.clientTop||w&&w.clientTop||0)}return l},tp=(n,i,l)=>{const d=n.document,p={type:"ready"};if(l.domLoaded){i(p);return}const w=()=>d.readyState==="complete"||d.readyState==="interactive"&&d.body,E=()=>{Lc(n,"DOMContentLoaded",E),Lc(n,"load",E),l.domLoaded||(l.domLoaded=!0,i(p)),n=null};w()?E():ab(n,"DOMContentLoaded",E),l.domLoaded||ab(n,"load",E)};class em{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=S2+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(i,l,d,p){const w=this;let E;const R=window,B=pe=>{w.executeHandlers(Ju(pe||R.event),K)};if(!i||_n(i)||th(i))return d;let K;i[w.expando]?K=i[w.expando]:(K=w.count++,i[w.expando]=K,w.events[K]={}),p=p||i;const ie=l.split(" ");let ue=ie.length;for(;ue--;){let pe=ie[ue],Be=B,Ze=!1,Oe=!1;if(pe==="DOMContentLoaded"&&(pe="ready"),w.domLoaded&&pe==="ready"&&i.readyState==="complete"){d.call(p,Ju({type:pe}));continue}!w.hasFocusIn&&(pe==="focusin"||pe==="focusout")&&(Ze=!0,Oe=pe==="focusin"?"focus":"blur",Be=ze=>{const ht=Ju(ze||R.event);ht.type=ht.type==="focus"?"focusin":"focusout",w.executeHandlers(ht,K)}),E=w.events[K][pe],E?pe==="ready"&&w.domLoaded?d(Ju({type:pe})):E.push({func:d,scope:p}):(w.events[K][pe]=E=[{func:d,scope:p}],E.fakeName=Oe,E.capture=Ze,E.nativeHandler=Be,pe==="ready"?tp(i,Be,w):ab(i,Oe||pe,Be,Ze))}return i=E=null,d}unbind(i,l,d){if(!i||_n(i)||th(i))return this;const p=i[this.expando];if(p){let w=this.events[p];if(l){const E=l.split(" ");let R=E.length;for(;R--;){const B=E[R],K=w[B];if(K){if(d){let ie=K.length;for(;ie--;)if(K[ie].func===d){const ue=K.nativeHandler,pe=K.fakeName,Be=K.capture,Ze=K.slice(0,ie).concat(K.slice(ie+1));Ze.nativeHandler=ue,Ze.fakeName=pe,Ze.capture=Be,w[B]=Ze}}(!d||K.length===0)&&(delete w[B],Lc(i,K.fakeName||B,K.nativeHandler,K.capture))}}}else an(w,(E,R)=>{Lc(i,E.fakeName||R,E.nativeHandler,E.capture)}),w={};for(const E in w)if(cn(w,E))return this;delete this.events[p];try{delete i[this.expando]}catch{i[this.expando]=null}}return this}fire(i,l,d){return this.dispatch(i,l,d)}dispatch(i,l,d){if(!i||_n(i)||th(i))return this;const p=Ju({type:l,target:i},d);do{const w=i[this.expando];w&&this.executeHandlers(p,w),i=i.parentNode||i.ownerDocument||i.defaultView||i.parentWindow}while(i&&!p.isPropagationStopped());return this}clean(i){if(!i||_n(i)||th(i))return this;if(i[this.expando]&&this.unbind(i),i.getElementsByTagName||(i=i.document),i&&i.getElementsByTagName){this.unbind(i);const l=i.getElementsByTagName("*");let d=l.length;for(;d--;)i=l[d],i[this.expando]&&this.unbind(i)}return this}destroy(){this.events={}}cancel(i){return i&&(i.preventDefault(),i.stopImmediatePropagation()),!1}executeHandlers(i,l){const d=this.events[l],p=d&&d[i.type];if(p)for(let w=0,E=p.length;w<E;w++){const R=p[w];if(R&&R.func.call(R.scope,i)===!1&&i.preventDefault(),i.isImmediatePropagationStopped())return}}}em.Event=new em;const Dv=hn.each,U_=hn.grep,Wp="data-mce-style",k2=hn.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," "),np=(n,i,l)=>{De(l)||l===""?Hi(n,i):Tr(n,i,l)},cb=n=>n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),K1=(n,i)=>{let l=0;if(n)for(let d=n.nodeType,p=n.previousSibling;p;p=p.previousSibling){const w=p.nodeType;i&&_n(p)&&(w===d||!p.data.length)||(l++,d=w)}return l},E2=(n,i)=>{const l=Pl(i,"style"),d=n.serialize(n.parse(l),Xr(i));np(i,Wp,d)},x2=(n,i)=>tt(n)?cn(k2,i)?n+"":n+"px":n,W_=(n,i,l)=>{const d=cb(i);De(l)||l===""?Fm(n,d):Zl(n,d,x2(l,d))},Rk=(n,i,l)=>{const d=i.keep_values,p={set:(E,R,B)=>{const K=Ke.fromDom(E);be(i.url_converter)&&_e(R)&&(R=i.url_converter.call(i.url_converter_scope||l(),String(R),B,E));const ie="data-mce-"+B;np(K,ie,R),np(K,B,R)},get:(E,R)=>{const B=Ke.fromDom(E);return Pl(B,"data-mce-"+R)||Pl(B,R)}},w={style:{set:(E,R)=>{const B=Ke.fromDom(E);d&&np(B,Wp,R),Hi(B,"style"),F(R)&&ra(B,n.parse(R))},get:E=>{const R=Ke.fromDom(E),B=Pl(R,Wp)||Pl(R,"style");return n.serialize(n.parse(B),Xr(R))}}};return d&&(w.href=w.src=p),w},Lr=(n,i={})=>{const l={},d=window,p={};let w=0;const E=!0,R=!0,B=xv.forElement(Ke.fromDom(n),{contentCssCors:i.contentCssCors,referrerPolicy:i.referrerPolicy}),K=[],ie=i.schema?i.schema:dh({}),ue=Tv({url_converter:i.url_converter,url_converter_scope:i.url_converter_scope},i.schema),pe=i.ownEvents?new em:em.Event,Be=ie.getBlockElements(),Ze=Rt=>F(Rt)?cn(Be,Rt):Xn(Rt)&&(cn(Be,Rt.nodeName)||Jm(ie,Rt)),Oe=Rt=>Rt&&n&&F(Rt)?n.getElementById(Rt):Rt,ze=Rt=>{const Nt=Oe(Rt);return _e(Nt)?Ke.fromDom(Nt):null},ht=(Rt,Nt,Nn="")=>{let En;const Io=ze(Rt);if(_e(Io)&&_l(Io)){const dr=w_[Nt];dr&&dr.get?En=dr.get(Io.dom,Nt):En=Pl(Io,Nt)}return _e(En)?En:Nn},bt=Rt=>{const Nt=Oe(Rt);return De(Nt)?[]:Nt.attributes},vt=(Rt,Nt,Nn)=>{Qn(Rt,En=>{if(Xn(En)){const Io=Ke.fromDom(En),dr=Nn===""?null:Nn,la=Pl(Io,Nt),xc=w_[Nt];xc&&xc.set?xc.set(Io.dom,dr,Nt):np(Io,Nt,dr),la!==dr&&i.onSetAttrib&&i.onSetAttrib({attrElm:Io.dom,attrName:Nt,attrValue:dr})}})},Mt=(Rt,Nt)=>Rt.cloneNode(Nt),fn=()=>i.root_element||n.body,$n=Rt=>{const Nt=Zf(Rt);return{x:Nt.x,y:Nt.y,w:Nt.width,h:Nt.height}},Pn=(Rt,Nt)=>Tk(n.body,Oe(Rt),Nt),Lt=(Rt,Nt,Nn)=>{Qn(Rt,En=>{const Io=Ke.fromDom(En);W_(Io,Nt,Nn),i.update_styles&&E2(ue,Io)})},$t=(Rt,Nt)=>{Qn(Rt,Nn=>{const En=Ke.fromDom(Nn);an(Nt,(Io,dr)=>{W_(En,dr,Io)}),i.update_styles&&E2(ue,En)})},yn=(Rt,Nt,Nn)=>{const En=Oe(Rt);if(!(De(En)||!Xn(En)))return Nn?Mi(Ke.fromDom(En),cb(Nt)):(Nt=Nt.replace(/-(\D)/g,(Io,dr)=>dr.toUpperCase()),Nt==="float"&&(Nt="cssFloat"),En.style?En.style[Nt]:void 0)},mo=Rt=>{const Nt=Oe(Rt);if(!Nt)return{w:0,h:0};let Nn=yn(Nt,"width"),En=yn(Nt,"height");return(!Nn||Nn.indexOf("px")===-1)&&(Nn="0"),(!En||En.indexOf("px")===-1)&&(En="0"),{w:parseInt(Nn,10)||Nt.offsetWidth||Nt.clientWidth,h:parseInt(En,10)||Nt.offsetHeight||Nt.clientHeight}},Oo=Rt=>{const Nt=Oe(Rt),Nn=Pn(Nt),En=mo(Nt);return{x:Nn.x,y:Nn.y,w:En.w,h:En.h}},Cs=(Rt,Nt)=>{if(!Rt)return!1;const Nn=re(Rt)?Rt:[Rt];return Jt(Nn,En=>wu(Ke.fromDom(En),Nt))},Us=(Rt,Nt,Nn,En)=>{const Io=[];let dr=Oe(Rt);En=En===void 0;const la=Nn||(fn().nodeName!=="BODY"?fn().parentNode:null);if(F(Nt))if(Nt==="*")Nt=Xn;else{const xc=Nt;Nt=du=>Cs(du,xc)}for(;dr&&!(dr===la||De(dr.nodeType)||qu(dr)||U1(dr));){if(!Nt||Nt(dr))if(En)Io.push(dr);else return[dr];dr=dr.parentNode}return En?Io:null},Pr=(Rt,Nt,Nn)=>{const En=Us(Rt,Nt,Nn,!1);return En&&En.length>0?En[0]:null},di=(Rt,Nt,Nn)=>{let En=Nt;if(Rt){F(Nt)&&(En=Io=>Cs(Io,Nt));for(let Io=Rt[Nn];Io;Io=Io[Nn])if(be(En)&&En(Io))return Io}return null},il=(Rt,Nt)=>di(Rt,Nt,"nextSibling"),Rl=(Rt,Nt)=>di(Rt,Nt,"previousSibling"),hc=Rt=>be(Rt.querySelectorAll),Mn=(Rt,Nt)=>{var Nn,En;const Io=(En=(Nn=Oe(Nt))!==null&&Nn!==void 0?Nn:i.root_element)!==null&&En!==void 0?En:n;return hc(Io)?Mr(Io.querySelectorAll(Rt)):[]},Qn=function(Rt,Nt,Nn){const En=Nn!=null?Nn:this;if(re(Rt)){const Io=[];return Dv(Rt,(dr,la)=>{const xc=Oe(dr);xc&&Io.push(Nt.call(En,xc,la))}),Io}else{const Io=Oe(Rt);return Io?Nt.call(En,Io):!1}},yr=(Rt,Nt)=>{Qn(Rt,Nn=>{an(Nt,(En,Io)=>{vt(Nn,Io,En)})})},Bs=(Rt,Nt)=>{Qn(Rt,Nn=>{const En=Ke.fromDom(Nn);Cf(En,Nt)})},vo=(Rt,Nt,Nn,En,Io)=>Qn(Rt,dr=>{const la=F(Nt)?n.createElement(Nt):Nt;return _e(Nn)&&yr(la,Nn),En&&(!F(En)&&En.nodeType?la.appendChild(En):F(En)&&Bs(la,En)),Io?la:dr.appendChild(la)}),Rn=(Rt,Nt,Nn)=>vo(n.createElement(Rt),Rt,Nt,Nn,!0),Tn=Yg.decode,jo=Yg.encodeAllRaw,Ys=(Rt,Nt,Nn="")=>{let En="<"+Rt;for(const Io in Nt)ts(Nt,Io)&&(En+=" "+Io+'="'+jo(Nt[Io])+'"');return Ja(Nn)&&cn(ie.getVoidElements(),Rt)?En+" />":En+">"+Nn+"</"+Rt+">"},Kr=Rt=>{const Nt=n.createElement("div"),Nn=n.createDocumentFragment();Nn.appendChild(Nt),Rt&&(Nt.innerHTML=Rt);let En;for(;En=Nt.firstChild;)Nn.appendChild(En);return Nn.removeChild(Nt),Nn},io=(Rt,Nt)=>Qn(Rt,Nn=>{const En=Ke.fromDom(Nn);return Nt&&Pe(Aa(En),Io=>{Qa(Io)&&Io.dom.length===0?pr(Io):wa(En,Io)}),pr(En),En.dom}),Ws=Rt=>Qn(Rt,Nt=>{const Nn=Nt.attributes;for(let En=Nn.length-1;En>=0;En--)Nt.removeAttributeNode(Nn.item(En))}),ii=Rt=>ue.parse(Rt),Ka=(Rt,Nt)=>ue.serialize(Rt,Nt),Ci=Rt=>{if(_1!==Lr.DOM&&n===document){if(l[Rt])return;l[Rt]=!0}let Nt=n.getElementById("mceDefaultStyles");if(!Nt){Nt=n.createElement("style"),Nt.id="mceDefaultStyles",Nt.type="text/css";const Nn=n.head;Nn.firstChild?Nn.insertBefore(Nt,Nn.firstChild):Nn.appendChild(Nt)}Nt.styleSheet?Nt.styleSheet.cssText+=Rt:Nt.appendChild(n.createTextNode(Rt))},Ec=Rt=>{Rt||(Rt=""),Pe(Rt.split(","),Nt=>{p[Nt]=!0,B.load(Nt).catch(ft)})},Mh=(Rt,Nt,Nn)=>{Qn(Rt,En=>{if(Xn(En)){const Io=Ke.fromDom(En),dr=Nt.split(" ");Pe(dr,la=>{_e(Nn)?(Nn?Wu:Nc)(Io,la):Vh(Io,la)})}})},zd=(Rt,Nt)=>{Mh(Rt,Nt,!0)},_m=(Rt,Nt)=>{Mh(Rt,Nt,!1)},Fy=(Rt,Nt)=>{const Nn=ze(Rt),En=Nt.split(" ");return _e(Nn)&&Js(En,Io=>_f(Nn,Io))},v_=Rt=>{Qn(Rt,Nt=>Fm(Ke.fromDom(Nt),"display"))},Hy=Rt=>{Qn(Rt,Nt=>Zl(Ke.fromDom(Nt),"display","none"))},$y=Rt=>{const Nt=ze(Rt);return _e(Nt)&&qr(Ta(Nt,"display"),"none")},bD=Rt=>(Rt||"mce_")+w++,vD=Rt=>{const Nt=ze(Rt);return _e(Nt)?Xn(Nt.dom)?Nt.dom.outerHTML:$g(Nt):""},yD=(Rt,Nt)=>{Qn(Rt,Nn=>{Xn(Nn)&&(Nn.outerHTML=Nt)})},CA=(Rt,Nt)=>{const Nn=Oe(Nt);return Qn(Rt,En=>{const Io=Nn==null?void 0:Nn.parentNode,dr=Nn==null?void 0:Nn.nextSibling;return Io&&(dr?Io.insertBefore(En,dr):Io.appendChild(En)),En})},SA=(Rt,Nt,Nn)=>Qn(Nt,En=>{var Io;const dr=re(Nt)?Rt.cloneNode(!0):Rt;return Nn&&Dv(U_(En.childNodes),la=>{dr.appendChild(la)}),(Io=En.parentNode)===null||Io===void 0||Io.replaceChild(dr,En),En}),kA=(Rt,Nt)=>{if(Rt.nodeName!==Nt.toUpperCase()){const Nn=Rn(Nt);return Dv(bt(Rt),En=>{vt(Nn,En.nodeName,ht(Rt,En.nodeName))}),SA(Nn,Rt,!0),Nn}else return Rt},GS=(Rt,Nt)=>{let Nn=Rt;for(;Nn;){let En=Nt;for(;En&&Nn!==En;)En=En.parentNode;if(Nn===En)break;Nn=Nn.parentNode}return!Nn&&Rt.ownerDocument?Rt.ownerDocument.documentElement:Nn},w1=Rt=>{if(Xn(Rt)){const Nt=Rt.nodeName.toLowerCase()==="a"&&!ht(Rt,"href")&&ht(Rt,"id");if(ht(Rt,"name")||ht(Rt,"data-mce-bookmark")||Nt)return!0}return!1},KS=(Rt,Nt,Nn)=>{let En=0;if(w1(Rt))return!1;const Io=Rt.firstChild;if(Io){const dr=new pi(Io,Rt),la=ie?ie.getWhitespaceElements():{},xc=Nt||(ie?ie.getNonEmptyElements():null);let du=Io;do{if(Xn(du)){const OA=du.getAttribute("data-mce-bogus");if(OA){du=dr.next(OA==="all");continue}const MA=du.nodeName.toLowerCase();if(xc&&xc[MA]){if(MA==="br"){En++,du=dr.next();continue}return!1}if(w1(du))return!1}if(th(du)||_n(du)&&!Zm(du.data)&&(!(Nn!=null&&Nn.includeZwsp)||!jg(du.data))||_n(du)&&du.parentNode&&la[du.parentNode.nodeName]&&Zm(du.data))return!1;du=dr.next()}while(du)}return En<=1},y_=()=>n.createRange(),cv=(Rt,Nt,Nn)=>{let En=y_(),Io,dr;if(Rt&&Nt&&Rt.parentNode&&Nt.parentNode){const la=Rt.parentNode;return En.setStart(la,K1(Rt)),En.setEnd(Nt.parentNode,K1(Nt)),Io=En.extractContents(),En=y_(),En.setStart(Nt.parentNode,K1(Nt)+1),En.setEnd(la,K1(Rt)+1),dr=En.extractContents(),la.insertBefore(Qm(_1,Io),Rt),Nn?la.insertBefore(Nn,Rt):la.insertBefore(Nt,Rt),la.insertBefore(Qm(_1,dr),Rt),io(Rt),Nn||Nt}else return},EA=(Rt,Nt,Nn,En)=>{if(re(Rt)){let Io=Rt.length;const dr=[];for(;Io--;)dr[Io]=EA(Rt[Io],Nt,Nn,En);return dr}else return i.collect&&(Rt===n||Rt===d)&&K.push([Rt,Nt,Nn,En]),pe.bind(Rt,Nt,Nn,En||_1)},xA=(Rt,Nt,Nn)=>{if(re(Rt)){let En=Rt.length;const Io=[];for(;En--;)Io[En]=xA(Rt[En],Nt,Nn);return Io}else{if(K.length>0&&(Rt===n||Rt===d)){let En=K.length;for(;En--;){const[Io,dr,la]=K[En];Rt===Io&&(!Nt||Nt===dr)&&(!Nn||Nn===la)&&pe.unbind(Io,dr,la)}}return pe.unbind(Rt,Nt,Nn)}},A0=(Rt,Nt,Nn)=>pe.dispatch(Rt,Nt,Nn),uv=(Rt,Nt,Nn)=>pe.dispatch(Rt,Nt,Nn),AA=Rt=>{if(Rt&&Xn(Rt)){const Nt=Rt.getAttribute("data-mce-contenteditable");return Nt&&Nt!=="inherit"?Nt:Rt.contentEditable!=="inherit"?Rt.contentEditable:null}else return null},_1={doc:n,settings:i,win:d,files:p,stdMode:E,boxModel:R,styleSheetLoader:B,boundEvents:K,styles:ue,schema:ie,events:pe,isBlock:Ze,root:null,clone:Mt,getRoot:fn,getViewPort:$n,getRect:Oo,getSize:mo,getParent:Pr,getParents:Us,get:Oe,getNext:il,getPrev:Rl,select:Mn,is:Cs,add:vo,create:Rn,createHTML:Ys,createFragment:Kr,remove:io,setStyle:Lt,getStyle:yn,setStyles:$t,removeAllAttribs:Ws,setAttrib:vt,setAttribs:yr,getAttrib:ht,getPos:Pn,parseStyle:ii,serializeStyle:Ka,addStyle:Ci,loadCSS:Ec,addClass:zd,removeClass:_m,hasClass:Fy,toggleClass:Mh,show:v_,hide:Hy,isHidden:$y,uniqueId:bD,setHTML:Bs,getOuterHTML:vD,setOuterHTML:yD,decode:Tn,encode:jo,insertAfter:CA,replace:SA,rename:kA,findCommonAncestor:GS,run:Qn,getAttribs:bt,isEmpty:KS,createRng:y_,nodeIndex:K1,split:cv,bind:EA,unbind:xA,fire:uv,dispatch:A0,getContentEditable:AA,getContentEditableParent:Rt=>{const Nt=fn();let Nn=null;for(let En=Rt;En&&En!==Nt&&(Nn=AA(En),Nn===null);En=En.parentNode);return Nn},isEditable:Rt=>{if(_e(Rt)){const Nt=Xn(Rt)?Rt:Rt.parentElement;return _e(Nt)&&wn(Ke.fromDom(Nt))}else return!1},destroy:()=>{if(K.length>0){let Rt=K.length;for(;Rt--;){const[Nt,Nn,En]=K[Rt];pe.unbind(Nt,Nn,En)}}an(p,(Rt,Nt)=>{B.unload(Nt),delete p[Nt]})},isChildOf:(Rt,Nt)=>Rt===Nt||Nt.contains(Rt),dumpRng:Rt=>"startContainer: "+Rt.startContainer.nodeName+", startOffset: "+Rt.startOffset+", endContainer: "+Rt.endContainer.nodeName+", endOffset: "+Rt.endOffset},w_=Rk(ue,i,nt(_1));return _1};Lr.DOM=Lr(document),Lr.nodeIndex=K1;const Ov=Lr.DOM,A2=0,T2=1,ub=2,Nk=3;class tm{constructor(i={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=i}_setReferrerPolicy(i){this.settings.referrerPolicy=i}loadScript(i){return new Promise((l,d)=>{const p=Ov;let w;const E=()=>{p.remove(K),w&&(w.onerror=w.onload=w=null)},R=()=>{E(),l()},B=()=>{E(),d("Failed to load script: "+i)},K=p.uniqueId();w=document.createElement("script"),w.id=K,w.type="text/javascript",w.src=hn._addCacheSuffix(i),this.settings.referrerPolicy&&p.setAttrib(w,"referrerpolicy",this.settings.referrerPolicy),w.onload=R,w.onerror=B,(document.getElementsByTagName("head")[0]||document.body).appendChild(w)})}isDone(i){return this.states[i]===ub}markDone(i){this.states[i]=ub}add(i){const l=this;return l.queue.push(i),l.states[i]===void 0&&(l.states[i]=A2),new Promise((p,w)=>{l.scriptLoadedCallbacks[i]||(l.scriptLoadedCallbacks[i]=[]),l.scriptLoadedCallbacks[i].push({resolve:p,reject:w})})}load(i){return this.add(i)}remove(i){delete this.states[i],delete this.scriptLoadedCallbacks[i]}loadQueue(){const i=this.queue;return this.queue=[],this.loadScripts(i)}loadScripts(i){const l=this,d=(B,K)=>{go(l.scriptLoadedCallbacks,K).each(ie=>{Pe(ie,ue=>ue[B](K))}),delete l.scriptLoadedCallbacks[K]},p=B=>{const K=yt(B,ie=>ie.status==="rejected");return K.length>0?Promise.reject(Ns(K,({reason:ie})=>re(ie)?ie:[ie])):Promise.resolve()},w=B=>Promise.allSettled(Et(B,K=>l.states[K]===ub?(d("resolve",K),Promise.resolve()):l.states[K]===Nk?(d("reject",K),Promise.reject(K)):(l.states[K]=T2,l.loadScript(K).then(()=>{l.states[K]=ub,d("resolve",K);const ie=l.queue;return ie.length>0?(l.queue=[],w(ie).then(p)):Promise.resolve()},()=>(l.states[K]=Nk,d("reject",K),Promise.reject(K)))))),E=B=>(l.loading=!0,w(B).then(K=>{l.loading=!1;const ie=l.queueLoadedCallbacks.shift();return he.from(ie).each(xn),p(K)})),R=cs(i);return l.loading?new Promise((B,K)=>{l.queueLoadedCallbacks.push(()=>{E(R).then(B,K)})}):E(R)}}tm.ScriptLoader=new tm;const qa=n=>{let i=n;return{get:()=>i,set:p=>{i=p}}},fb=(n,i)=>{const l=n.indexOf(i);return l!==-1&&n.indexOf(i,l+1)>l},Y1=n=>ne(n)&&cn(n,"raw"),j_=n=>re(n)&&n.length>1,db={},D2=qa("en"),Ra=()=>go(db,D2.get()),Yf={getData:()=>ps(db,n=>({...n})),setCode:n=>{n&&D2.set(n)},getCode:()=>D2.get(),add:(n,i)=>{let l=db[n];l||(db[n]=l={});const d=Et(gs(i),p=>p.toLowerCase());an(i,(p,w)=>{const E=w.toLowerCase();E!==w&&fb(d,E)?(cn(i,E)||(l[E]=p),l[w]=p):l[E]=p})},translate:n=>{const i=Ra().getOr({}),l=E=>be(E)?Object.prototype.toString.call(E):d(E)?"":""+E,d=E=>E===""||E===null||E===void 0,p=E=>{const R=l(E);return cn(i,R)?l(i[R]):go(i,R.toLowerCase()).map(l).getOr(R)},w=E=>E.replace(/{context:\w+}$/,"");if(d(n))return"";if(Y1(n))return l(n.raw);if(j_(n)){const E=n.slice(1),R=p(n[0]).replace(/\{([0-9]+)\}/g,(B,K)=>cn(E,K)?l(E[K]):B);return w(R)}return w(p(n))},isRtl:()=>Ra().bind(n=>go(n,"_dir")).exists(n=>n==="rtl"),hasCode:n=>cn(db,n)},Na=()=>{const n=[],i={},l={},d=[],p=(Oe,ze)=>{const ht=yt(d,bt=>bt.name===Oe&&bt.state===ze);Pe(ht,bt=>bt.resolve())},w=Oe=>cn(i,Oe),E=Oe=>cn(l,Oe),R=Oe=>{if(l[Oe])return l[Oe].instance},B=(Oe,ze)=>{const ht=Yf.getCode(),bt=","+(ze||"")+",";!ht||ze&&bt.indexOf(","+ht+",")===-1||tm.ScriptLoader.add(i[Oe]+"/langs/"+ht+".js")},K=(Oe,ze)=>{Na.languageLoad!==!1&&(w(Oe)?B(Oe,ze):Ze(Oe,"loaded").then(()=>B(Oe,ze)))},ie=(Oe,ze)=>(n.push(ze),l[Oe]={instance:ze},p(Oe,"added"),ze),ue=Oe=>{delete i[Oe],delete l[Oe]},pe=(Oe,ze)=>F(ze)?F(Oe)?{prefix:"",resource:ze,suffix:""}:{prefix:Oe.prefix,resource:ze,suffix:Oe.suffix}:ze,Be=(Oe,ze)=>{if(i[Oe])return Promise.resolve();let ht=F(ze)?ze:ze.prefix+ze.resource+ze.suffix;ht.indexOf("/")!==0&&ht.indexOf("://")===-1&&(ht=Na.baseURL+"/"+ht),i[Oe]=ht.substring(0,ht.lastIndexOf("/"));const bt=()=>(p(Oe,"loaded"),Promise.resolve());return l[Oe]?bt():tm.ScriptLoader.add(ht).then(bt)},Ze=(Oe,ze="added")=>ze==="added"&&E(Oe)||ze==="loaded"&&w(Oe)?Promise.resolve():new Promise(ht=>{d.push({name:Oe,state:ze,resolve:ht})});return{items:n,urls:i,lookup:l,get:R,requireLangPack:K,add:ie,remove:ue,createUrl:pe,load:Be,waitFor:Ze}};Na.languageLoad=!0,Na.baseURL="",Na.PluginManager=Na(),Na.ThemeManager=Na(),Na.ModelManager=Na();const Sa=n=>{const i=qa(he.none()),l=()=>i.get().each(n);return{clear:()=>{l(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:R=>{l(),i.set(he.some(R))}}},Ik=n=>{const i=qa(he.none()),l=()=>i.get().each(R=>clearInterval(R));return{clear:()=>{l(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:R=>{l(),i.set(he.some(setInterval(R,n)))}}},mh=()=>{const n=Sa(ft);return{...n,on:l=>n.get().each(l)}},hb=(n,i)=>{let l=null;return{cancel:()=>{J(l)||(clearTimeout(l),l=null)},throttle:(...w)=>{J(l)&&(l=setTimeout(()=>{l=null,n.apply(null,w)},i))}}},Mv=(n,i)=>{let l=null;const d=()=>{J(l)||(clearTimeout(l),l=null)};return{cancel:d,throttle:(...w)=>{d(),l=setTimeout(()=>{l=null,n.apply(null,w)},i)}}},Xf=nt("mce-annotation"),ef=nt("data-mce-annotation"),jp=nt("data-mce-annotation-uid"),X1=nt("data-mce-annotation-active"),mb=nt("data-mce-annotation-classes"),gb=nt("data-mce-annotation-attrs"),Z_=n=>i=>pt(i,n),M2=(n,i)=>{const l=n.selection.getRng(),d=Ke.fromDom(l.startContainer),p=Ke.fromDom(n.getBody()),w=i.fold(()=>"."+Xf(),B=>`[${ef()}="${B}"]`),E=ju(d,l.startOffset).getOr(d);return rt(E,w,Z_(p)).bind(B=>$a(B,`${jp()}`).bind(K=>$a(B,`${ef()}`).map(ie=>{const ue=G_(n,K);return{uid:K,name:ie,elements:ue}})))},Bk=n=>_l(n)&&_f(n,Xf()),q_=(n,i)=>qi(n,"data-mce-bogus")||m2(n,'[data-mce-bogus="all"]',Z_(i)),G_=(n,i)=>{const l=Ke.fromDom(n.getBody()),d=dl(l,`[${jp()}="${i}"]`);return yt(d,p=>!q_(p,l))},R2=(n,i)=>{const l=Ke.fromDom(n.getBody()),d=dl(l,`[${ef()}="${i}"]`),p={};return Pe(d,w=>{if(!q_(w,l)){const E=Pl(w,jp()),R=go(p,E).getOr([]);p[E]=R.concat([w])}}),p},K_=(n,i)=>{const l=qa({}),d=()=>({listeners:[],previous:mh()}),p=(ue,pe)=>{w(ue,Be=>(pe(Be),Be))},w=(ue,pe)=>{const Be=l.get(),Ze=go(Be,ue).getOrThunk(d),Oe=pe(Ze);Be[ue]=Oe,l.set(Be)},E=(ue,pe,Be)=>{p(ue,Ze=>{Pe(Ze.listeners,Oe=>Oe(!0,ue,{uid:pe,nodes:Et(Be,ze=>ze.dom)}))})},R=ue=>{p(ue,pe=>{Pe(pe.listeners,Be=>Be(!1,ue))})},B=(ue,pe)=>{Pe(G_(n,ue),Be=>{pe?Tr(Be,X1(),"true"):Hi(Be,X1())})},K=Mv(()=>{const ue=Ps(i.getNames());Pe(ue,pe=>{w(pe,Be=>{const Ze=Be.previous.get();return M2(n,he.some(pe)).fold(()=>{Ze.each(Oe=>{R(pe),Be.previous.clear(),B(Oe,!1)})},({uid:Oe,name:ze,elements:ht})=>{qr(Ze,Oe)||(Ze.each(bt=>B(bt,!1)),E(ze,Oe,ht),Be.previous.set(Oe),B(Oe,!0))}),{previous:Be.previous,listeners:Be.listeners}})})},30);return n.on("remove",()=>{K.cancel()}),n.on("NodeChange",()=>{K.throttle()}),{addListener:(ue,pe)=>{w(ue,Be=>({previous:Be.previous,listeners:Be.listeners.concat([pe])}))}}},s3=(n,i)=>{const l=ef(),d=w=>he.from(w.attr(l)).bind(i.lookup),p=w=>{var E,R;w.attr(jp(),null),w.attr(ef(),null),w.attr(X1(),null);const B=he.from(w.attr(gb())).map(pe=>pe.split(",")).getOr([]),K=he.from(w.attr(mb())).map(pe=>pe.split(",")).getOr([]);Pe(B,pe=>w.attr(pe,null));const ie=(R=(E=w.attr("class"))===null||E===void 0?void 0:E.split(" "))!==null&&R!==void 0?R:[],ue=ba(ie,[Xf()].concat(K));w.attr("class",ue.length>0?ue.join(" "):null),w.attr(mb(),null),w.attr(gb(),null)};n.serializer.addTempAttr(X1()),n.serializer.addAttributeFilter(l,w=>{for(const E of w)d(E).each(R=>{R.persistent===!1&&(E.name==="span"?E.unwrap():p(E))})})},Rv=()=>{const n={};return{register:(p,w)=>{n[p]={name:p,settings:w}},lookup:p=>go(n,p).map(w=>w.settings),getNames:()=>gs(n)}};let Y_=0;const Ri=n=>{const l=new Date().getTime(),d=Math.floor(Math.random()*1e9);return Y_++,n+"_"+d+Y_+String(l)},Nv=(n,i)=>{Pe(i,l=>{Wu(n,l)})},N2=(n,i)=>{Pe(i,l=>{Nc(n,l)})},X_=(n,i)=>Ke.fromDom(n.dom.cloneNode(i)),ng=n=>X_(n,!1),uc=n=>X_(n,!0),ru=(n,i)=>{const l=Ke.fromTag(i),d=Vf(n);return Uu(l,d),l},J_=(n,i)=>{const l=ru(n,i);Yc(n,l);const d=Aa(n);return Jr(l,d),pr(n),l},P2=(n,i,l=We)=>{const d=new pi(n,i),p=w=>{let E;do E=d[w]();while(E&&!_n(E)&&!l(E));return he.from(E).filter(_n)};return{current:()=>he.from(d.current()).filter(_n),next:()=>p("next"),prev:()=>p("prev"),prev2:()=>p("prev2")}},op=(n,i)=>{const l=i||(E=>n.isBlock(E)||ui(E)||xs(E)),d=(E,R,B,K)=>{if(_n(E)){const ie=K(E,R,E.data);if(ie!==-1)return he.some({container:E,offset:ie})}return B().bind(ie=>d(ie.container,ie.offset,B,K))};return{backwards:(E,R,B,K)=>{const ie=P2(E,K!=null?K:n.getRoot(),l);return d(E,R,()=>ie.prev().map(ue=>({container:ue,offset:ue.length})),B).getOrNull()},forwards:(E,R,B,K)=>{const ie=P2(E,K!=null?K:n.getRoot(),l);return d(E,R,()=>ie.next().map(ue=>({container:ue,offset:0})),B).getOrNull()}}},sp=Math.round,Zp=n=>n?{left:sp(n.left),top:sp(n.top),bottom:sp(n.bottom),right:sp(n.right),width:sp(n.width),height:sp(n.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},qp=(n,i)=>(n=Zp(n),i||(n.left=n.left+n.width),n.right=n.left,n.width=0,n),og=(n,i)=>n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right,Pv=(n,i,l)=>n>=0&&n<=Math.min(i.height,l.height)/2,ta=(n,i)=>{const l=Math.min(i.height/2,n.height/2);return n.bottom-l<i.top?!0:n.top>i.bottom?!1:Pv(i.top-n.bottom,n,i)},tf=(n,i)=>n.top>i.bottom?!0:n.bottom<i.top?!1:Pv(i.bottom-n.top,n,i),J1=(n,i,l)=>i>=n.left&&i<=n.right&&l>=n.top&&l<=n.bottom,Lk=n=>bn(n,(i,l)=>i.fold(()=>he.some(l),d=>{const p=Math.min(l.left,d.left),w=Math.min(l.top,d.top),E=Math.max(l.right,d.right),R=Math.max(l.bottom,d.bottom);return he.some({top:w,right:E,bottom:R,left:p,width:E-p,height:R-w})}),he.none()),I2=(n,i,l)=>{const d=Math.max(Math.min(i,n.left+n.width),n.left),p=Math.max(Math.min(l,n.top+n.height),n.top);return Math.sqrt((i-d)*(i-d)+(l-p)*(l-p))},Fk=(n,i)=>Math.max(0,Math.min(n.bottom,i.bottom)-Math.max(n.top,i.top)),Gp=(n,i,l)=>Math.min(Math.max(n,i),l),Q1=n=>{const i=n.startContainer,l=n.startOffset;return i===n.endContainer&&i.hasChildNodes()&&n.endOffset===l+1?i.childNodes[l]:null},Jf=(n,i)=>{if(Xn(n)&&n.hasChildNodes()){const l=n.childNodes,d=Gp(i,0,l.length-1);return l[d]}else return n},B2=(n,i)=>{if(!(i<0&&Xn(n)&&n.hasChildNodes()))return Jf(n,i)},Q_=new RegExp("[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2-\u09E3\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B57\u0B62-\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC-\u0CCD\u0CD5-\u0CD6\u0CE2-\u0CE3\u0D01\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62-\u0D63\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u200C-\u200D\u20D0-\u20DC\u20DD-\u20E0\u20E1\u20E2-\u20E4\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u302E-\u302F\u3099-\u309A\uA66F\uA670-\uA672\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E-\uFF9F]"),eC=n=>F(n)&&n.charCodeAt(0)>=768&&Q_.test(n),Hk=(...n)=>i=>{for(let l=0;l<n.length;l++)if(n[l](i))return!0;return!1},tC=(...n)=>i=>{for(let l=0;l<n.length;l++)if(!n[l](i))return!1;return!0},pb=Xn,bb=Sl,nC=eh("display","block table"),L2=eh("float","left right"),Kp=tC(pb,bb,ct(L2)),oC=ct(eh("white-space","pre pre-line pre-wrap")),Yp=_n,sg=ui,Iv=Lr.nodeIndex,nf=B2,e0=n=>n?n.createRange():Lr.DOM.createRng(),Gs=n=>F(n)&&/[\r\n\t ]/.test(n),iu=n=>!!n.setStart&&!!n.setEnd,rg=n=>{const i=n.startContainer,l=n.startOffset;if(Gs(n.toString())&&oC(i.parentNode)&&_n(i)){const d=i.data;if(Gs(d[l-1])||Gs(d[l+1]))return!0}return!1},F2=n=>{const i=n.ownerDocument,l=e0(i),d=i.createTextNode(Gr),p=n.parentNode;p.insertBefore(d,n),l.setStart(d,0),l.setEnd(d,1);const w=Zp(l.getBoundingClientRect());return p.removeChild(d),w},Vi=n=>{const i=n.startContainer,l=n.endContainer,d=n.startOffset,p=n.endOffset;if(i===l&&_n(l)&&d===0&&p===1){const w=n.cloneRange();return w.setEndAfter(l),ig(w)}else return null},H2=n=>n.left===0&&n.right===0&&n.top===0&&n.bottom===0,ig=n=>{var i;let l;const d=n.getClientRects();return d.length>0?l=Zp(d[0]):l=Zp(n.getBoundingClientRect()),!iu(n)&&sg(n)&&H2(l)?F2(n):H2(l)&&iu(n)&&(i=Vi(n))!==null&&i!==void 0?i:l},ga=(n,i)=>{const l=qp(n,i);return l.width=1,l.right=l.left+1,l},nm=n=>{const i=[],l=E=>{E.height!==0&&(i.length>0&&og(E,i[i.length-1])||i.push(E))},d=(E,R)=>{const B=e0(E.ownerDocument);if(R<E.data.length){if(eC(E.data[R]))return;if(eC(E.data[R-1])&&(B.setStart(E,R),B.setEnd(E,R+1),!rg(B))){l(ga(ig(B),!1));return}}R>0&&(B.setStart(E,R-1),B.setEnd(E,R),rg(B)||l(ga(ig(B),!1))),R<E.data.length&&(B.setStart(E,R),B.setEnd(E,R+1),rg(B)||l(ga(ig(B),!0)))},p=n.container(),w=n.offset();if(Yp(p))return d(p,w),i;if(pb(p))if(n.isAtEnd()){const E=nf(p,w);Yp(E)&&d(E,E.data.length),Kp(E)&&!sg(E)&&l(ga(ig(E),!1))}else{const E=nf(p,w);if(Yp(E)&&d(E,0),Kp(E)&&n.isAtEnd())return l(ga(ig(E),!1)),i;const R=nf(n.container(),n.offset()-1);Kp(R)&&!sg(R)&&(nC(R)||nC(E)||!Kp(E))&&l(ga(ig(R),!1)),Kp(E)&&l(ga(ig(E),!0))}return i},Vt=(n,i,l)=>{const d=()=>(Yp(n),i===0),p=()=>Yp(n)?i>=n.data.length:i>=n.childNodes.length,w=()=>{const ie=e0(n.ownerDocument);return ie.setStart(n,i),ie.setEnd(n,i),ie},E=()=>(l||(l=nm(Vt(n,i))),l),R=()=>E().length>0,B=ie=>ie&&n===ie.container()&&i===ie.offset(),K=ie=>nf(n,ie?i-1:i);return{container:nt(n),offset:nt(i),toRange:w,getClientRects:E,isVisible:R,isAtStart:d,isAtEnd:p,isEqual:B,getNode:K}};Vt.fromRangeStart=n=>Vt(n.startContainer,n.startOffset),Vt.fromRangeEnd=n=>Vt(n.endContainer,n.endOffset),Vt.after=n=>Vt(n.parentNode,Iv(n)+1),Vt.before=n=>Vt(n.parentNode,Iv(n)),Vt.isAbove=(n,i)=>ni(No(i.getClientRects()),Mo(n.getClientRects()),ta).getOr(!1),Vt.isBelow=(n,i)=>ni(Mo(i.getClientRects()),No(n.getClientRects()),tf).getOr(!1),Vt.isAtStart=n=>n?n.isAtStart():!1,Vt.isAtEnd=n=>n?n.isAtEnd():!1,Vt.isTextPosition=n=>n?_n(n.container()):!1,Vt.isElementPosition=n=>!Vt.isTextPosition(n);const vb=(n,i)=>{_n(i)&&i.data.length===0&&n.remove(i)},$2=(n,i,l)=>{i.insertNode(l),vb(n,l.previousSibling),vb(n,l.nextSibling)},yb=(n,i,l)=>{const d=he.from(l.firstChild),p=he.from(l.lastChild);i.insertNode(l),d.each(w=>vb(n,w.previousSibling)),p.each(w=>vb(n,w.nextSibling))},gh=(n,i,l)=>{U1(l)?yb(n,i,l):$2(n,i,l)},of=_n,t0=Cd,Bv=Lr.nodeIndex,z2=n=>{const i=n.parentNode;return t0(i)?z2(i):i},Lv=n=>n?Ge(n.childNodes,(i,l)=>(t0(l)&&l.nodeName!=="BR"?i=i.concat(Lv(l)):i.push(l),i),[]):[],wb=(n,i)=>{let l=n;for(;(l=l.previousSibling)&&of(l);)i+=l.data.length;return i},ph=n=>i=>n===i,Qf=n=>{let i,l;i=Lv(z2(n)),l=qe(i,ph(n),n),i=i.slice(0,l+1);const d=Ge(i,(p,w,E)=>(of(w)&&of(i[E-1])&&p++,p),0);return i=Ba(i,kf([n.nodeName])),l=qe(i,ph(n),n),l-d},Tu=n=>(of(n)?"text()":n.nodeName.toLowerCase())+"["+Qf(n)+"]",Fl=(n,i,l)=>{const d=[];for(let p=i.parentNode;p&&p!==n&&!(l&&l(p));p=p.parentNode)d.push(p);return d},V2=(n,i)=>{let l=[],d=i.container(),p=i.offset(),w;if(of(d))w=wb(d,p);else{const R=d.childNodes;p>=R.length?(w="after",p=R.length-1):w="before",d=R[p]}l.push(Tu(d));let E=Fl(n,d);return E=Ba(E,ct(Cd)),l=l.concat(Bi(E,R=>Tu(R))),l.reverse().join("/")+","+w},rp=(n,i,l)=>{let d=Lv(n);return d=Ba(d,(p,w)=>!of(p)||!of(d[w-1])),d=Ba(d,kf([i])),d[l]},sC=(n,i)=>{let l=n,d=0;for(;of(l);){const p=l.data.length;if(i>=d&&i<=d+p){n=l,i=i-d;break}if(!of(l.nextSibling)){n=l,i=p;break}d+=p,l=l.nextSibling}return of(n)&&i>n.data.length&&(i=n.data.length),Vt(n,i)},_b=(n,i)=>{if(!i)return null;const l=i.split(","),d=l[0].split("/"),p=l.length>1?l[1]:"before",w=Ge(d,(E,R)=>{const B=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(R);return B?(B[1]==="text()"&&(B[1]="#text"),rp(E,B[1],parseInt(B[2],10))):null},n);if(!w)return null;if(!of(w)&&w.parentNode){let E;return p==="after"?E=Bv(w)+1:E=Bv(w),Vt(w.parentNode,E)}return sC(w,parseInt(p,10))},Xp=xs,U2=(n,i,l)=>{let d=n(i.data.slice(0,l)).length;for(let p=i.previousSibling;p&&_n(p);p=p.previousSibling)d+=n(p.data).length;return d},Fv=(n,i,l,d,p)=>{const w=p?d.startContainer:d.endContainer;let E=p?d.startOffset:d.endOffset;const R=[],B=n.getRoot();if(_n(w))R.push(l?U2(i,w,E):E);else{let K=0;const ie=w.childNodes;E>=ie.length&&ie.length&&(K=1,E=Math.max(0,ie.length-1)),R.push(n.nodeIndex(ie[E],l)+K)}for(let K=w;K&&K!==B;K=K.parentNode)R.push(n.nodeIndex(K,l));return R},rC=(n,i,l,d)=>{const p=i.dom,w=Fv(p,n,l,d,!0),E=i.isForward(),R=ea(d)?{isFakeCaret:!0}:{};if(i.isCollapsed())return{start:w,forward:E,...R};{const B=Fv(p,n,l,d,!1);return{start:w,end:B,forward:E,...R}}},Hv=(n,i,l)=>{let d=0;return hn.each(n.select(i),p=>{if(p.getAttribute("data-mce-bogus")!=="all"){if(p===l)return!1;d++;return}}),d},W2=(n,i)=>{let l=i?n.startContainer:n.endContainer,d=i?n.startOffset:n.endOffset;if(Xn(l)&&l.nodeName==="TR"){const p=l.childNodes;l=p[Math.min(i?d:d-1,p.length-1)],l&&(d=i?0:l.childNodes.length,i?n.setStart(l,d):n.setEnd(l,d))}},ml=n=>(W2(n,!0),W2(n,!1),n),Kl=(n,i)=>{if(Xn(n)&&(n=Jf(n,i),Xp(n)))return n;if(br(n)){_n(n)&&bi(n)&&(n=n.parentNode);let l=n.previousSibling;if(Xp(l)||(l=n.nextSibling,Xp(l)))return l}},Du=n=>Kl(n.startContainer,n.startOffset)||Kl(n.endContainer,n.endOffset),Fr=(n,i,l)=>{const d=l.getNode(),p=l.getRng();if(d.nodeName==="IMG"||Xp(d)){const E=d.nodeName;return{name:E,index:Hv(l.dom,E,d)}}const w=Du(p);if(w){const E=w.tagName;return{name:E,index:Hv(l.dom,E,w)}}return rC(n,l,i,p)},Yl=n=>{const i=n.getRng();return{start:V2(n.dom.getRoot(),Vt.fromRangeStart(i)),end:V2(n.dom.getRoot(),Vt.fromRangeEnd(i)),forward:n.isForward()}},Hl=n=>({rng:n.getRng(),forward:n.isForward()}),om=(n,i,l)=>{const d={"data-mce-type":"bookmark",id:i,style:"overflow:hidden;line-height:0px"};return l?n.create("span",d,"&#xFEFF;"):n.create("span",d)},vr=(n,i)=>{const l=n.dom;let d=n.getRng();const p=l.uniqueId(),w=n.isCollapsed(),E=n.getNode(),R=E.nodeName,B=n.isForward();if(R==="IMG")return{name:R,index:Hv(l,R,E)};const K=ml(d.cloneRange());if(!w){K.collapse(!1);const ue=om(l,p+"_end",i);gh(l,K,ue)}d=ml(d),d.collapse(!0);const ie=om(l,p+"_start",i);return gh(l,d,ie),n.moveToBookmark({id:p,keep:!0,forward:B}),{id:p,forward:B}},iC=(n,i,l=!1)=>i===2?Fr(Bn,l,n):i===3?Yl(n):i?Hl(n):vr(n,!1),au=He(Fr,Ot,!0),xl=n=>{const i=w=>w(n),l=nt(n),d=()=>p,p={tag:!0,inner:n,fold:(w,E)=>E(n),isValue:xt,isError:We,map:w=>fc.value(w(n)),mapError:d,bind:i,exists:i,forall:i,getOr:l,or:d,getOrThunk:l,orThunk:d,getOrDie:l,each:w=>{w(n)},toOptional:()=>he.some(n)};return p},j2=n=>{const i=()=>l,l={tag:!1,inner:n,fold:(d,p)=>d(n),isValue:We,isError:xt,map:i,mapError:d=>fc.error(d(n)),bind:i,exists:We,forall:xt,getOr:Ot,or:Ot,getOrThunk:kt,orThunk:kt,getOrDie:dn(String(n)),each:ft,toOptional:he.none};return l},fc={value:xl,error:j2,fromOption:(n,i)=>n.fold(()=>j2(i),xl)},lg={generate:n=>{if(!re(n))throw new Error("cases must be an array");if(n.length===0)throw new Error("there must be at least one case");const i=[],l={};return Pe(n,(d,p)=>{const w=gs(d);if(w.length!==1)throw new Error("one and only one name per case");const E=w[0],R=d[E];if(l[E]!==void 0)throw new Error("duplicate key detected:"+E);if(E==="cata")throw new Error("cannot have a case named cata (sorry)");if(!re(R))throw new Error("case arguments must be an array");i.push(E),l[E]=(...B)=>{const K=B.length;if(K!==R.length)throw new Error("Wrong number of arguments to case "+E+". Expected "+R.length+" ("+R+"), got "+K);return{fold:(...ue)=>{if(ue.length!==n.length)throw new Error("Wrong number of arguments to fold. Expected "+n.length+", got "+ue.length);return ue[p].apply(null,B)},match:ue=>{const pe=gs(ue);if(i.length!==pe.length)throw new Error("Wrong number of arguments to match. Expected: "+i.join(",")+`
Actual: `+pe.join(","));if(!Js(i,Ze=>Ct(pe,Ze)))throw new Error("Not all branches were specified when using match. Specified: "+pe.join(", ")+`
Required: `+i.join(", "));return ue[E].apply(null,B)},log:ue=>{console.log(ue,{constructors:i,constructor:E,params:B})}}}}),l}};lg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const $k=n=>{const i=[],l=[];return Pe(n,d=>{d.fold(p=>{i.push(p)},p=>{l.push(p)})}),{errors:i,values:l}},zk=n=>n.type==="inline-command"||n.type==="inline-format",Z2=n=>n.type==="block-command"||n.type==="block-format",q2=n=>{const i=d=>fc.error({message:d,pattern:n}),l=(d,p,w)=>{if(n.format!==void 0){let E;if(re(n.format)){if(!Js(n.format,F))return i(d+" pattern has non-string items in the `format` array");E=n.format}else if(F(n.format))E=[n.format];else return i(d+" pattern has non-string `format` parameter");return fc.value(p(E))}else return n.cmd!==void 0?F(n.cmd)?fc.value(w(n.cmd,n.value)):i(d+" pattern has non-string `cmd` parameter"):i(d+" pattern is missing both `format` and `cmd` parameters")};if(!ne(n))return i("Raw pattern is not an object");if(!F(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!F(n.end))return i("Inline pattern has non-string `end` parameter");if(n.start.length===0&&n.end.length===0)return i("Inline pattern has empty `start` and `end` parameters");let d=n.start,p=n.end;return p.length===0&&(p=d,d=""),l("Inline",w=>({type:"inline-format",start:d,end:p,format:w}),(w,E)=>({type:"inline-command",start:d,end:p,cmd:w,value:E}))}else return n.replacement!==void 0?F(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):fc.value({type:"inline-command",start:"",end:n.start,cmd:"mceInsertContent",value:n.replacement}):i("Replacement pattern has non-string `replacement` parameter"):n.start.length===0?i("Block pattern has empty `start` parameter"):l("Block",d=>({type:"block-format",start:n.start,format:d[0]}),(d,p)=>({type:"block-command",start:n.start,cmd:d,value:p}))},sm=n=>yt(n,Z2),G2=n=>yt(n,zk),Jp=(n,i)=>({inlinePatterns:G2(n),blockPatterns:sm(n),dynamicPatternsLookup:i}),gl=n=>{const i=$k(Et(n,q2));return Pe(i.errors,l=>console.error(l.message,l.pattern)),i.values},Al=n=>i=>{const l=n(i);return gl(l)},An=vs().deviceType,Vk=An.isTouch(),Xl=Lr.DOM,Uk=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return bn(i,(l,d)=>{const p=d.split("="),w=p[0],E=p.length>1?p[1]:w;return l[pc(w)]=pc(E),l},{})},K2=n=>ee(n,RegExp),to=n=>i=>i.options.get(n),Cc=n=>F(n)||ne(n),Y2=(n,i="")=>l=>{const d=F(l);if(d)if(l.indexOf("=")!==-1){const p=Uk(l);return{value:go(p,n.id).getOr(i),valid:d}}else return{value:l,valid:d};else return{valid:!1,message:"Must be a string."}},n0=n=>{const i=n.options.register;i("id",{processor:"string",default:n.id}),i("selector",{processor:"string"}),i("target",{processor:"object"}),i("suffix",{processor:"string"}),i("cache_suffix",{processor:"string"}),i("base_url",{processor:"string"}),i("referrer_policy",{processor:"string",default:""}),i("language_load",{processor:"boolean",default:!0}),i("inline",{processor:"boolean",default:!1}),i("iframe_attrs",{processor:"object",default:{}}),i("doctype",{processor:"string",default:"<!DOCTYPE html>"}),i("document_base_url",{processor:"string",default:n.documentBaseUrl}),i("body_id",{processor:Y2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:Y2(n),default:""}),i("content_security_policy",{processor:"string",default:""}),i("br_in_pre",{processor:"boolean",default:!0}),i("forced_root_block",{processor:l=>{const d=F(l)&&gr(l);return d?{value:l,valid:d}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),i("forced_root_block_attrs",{processor:"object",default:{}}),i("newline_behavior",{processor:l=>{const d=Ct(["block","linebreak","invert","default"],l);return d?{value:l,valid:d}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),i("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),i("no_newline_selector",{processor:"string",default:""}),i("keep_styles",{processor:"boolean",default:!0}),i("end_container_on_empty_block",{processor:l=>we(l)?{valid:!0,value:l}:F(l)?{valid:!0,value:l}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),i("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),i("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),i("font_size_classes",{processor:"string",default:""}),i("automatic_uploads",{processor:"boolean",default:!0}),i("images_reuse_filename",{processor:"boolean",default:!1}),i("images_replace_blob_uris",{processor:"boolean",default:!0}),i("icons",{processor:"string",default:""}),i("icons_url",{processor:"string",default:""}),i("images_upload_url",{processor:"string",default:""}),i("images_upload_base_path",{processor:"string",default:""}),i("images_upload_credentials",{processor:"boolean",default:!1}),i("images_upload_handler",{processor:"function"}),i("language",{processor:"string",default:"en"}),i("language_url",{processor:"string",default:""}),i("entity_encoding",{processor:"string",default:"named"}),i("indent",{processor:"boolean",default:!0}),i("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_use_margin",{processor:"boolean",default:!1}),i("indentation",{processor:"string",default:"40px"}),i("content_css",{processor:l=>{const d=l===!1||F(l)||Qe(l,F);return d?F(l)?{value:Et(l.split(","),pc),valid:d}:re(l)?{value:l,valid:d}:l===!1?{value:[],valid:d}:{value:l,valid:d}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:bC(n)?[]:["default"]}),i("content_style",{processor:"string"}),i("content_css_cors",{processor:"boolean",default:!1}),i("font_css",{processor:l=>{const d=F(l)||Qe(l,F);return d?{value:re(l)?l:Et(l.split(","),pc),valid:d}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),i("inline_boundaries",{processor:"boolean",default:!0}),i("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),i("object_resizing",{processor:l=>{const d=we(l)||F(l);return d?l===!1||An.isiPhone()||An.isiPad()?{value:"",valid:d}:{value:l===!0?"table,img,figure.image,div,video,iframe":l,valid:d}:{valid:!1,message:"Must be boolean or a string"}},default:!Vk}),i("resize_img_proportional",{processor:"boolean",default:!0}),i("event_root",{processor:"object"}),i("service_message",{processor:"string"}),i("theme",{processor:l=>l===!1||F(l)||be(l),default:"silver"}),i("theme_url",{processor:"string"}),i("formats",{processor:"object"}),i("format_empty_lines",{processor:"boolean",default:!1}),i("format_noneditable_selector",{processor:"string",default:""}),i("preview_styles",{processor:l=>{const d=l===!1||F(l);return d?{value:l===!1?"":l,valid:d}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),i("custom_ui_selector",{processor:"string",default:""}),i("hidden_input",{processor:"boolean",default:!0}),i("submit_patch",{processor:"boolean",default:!0}),i("encoding",{processor:"string"}),i("add_form_submit_trigger",{processor:"boolean",default:!0}),i("add_unload_trigger",{processor:"boolean",default:!0}),i("custom_undo_redo_levels",{processor:"number",default:0}),i("disable_nodechange",{processor:"boolean",default:!1}),i("readonly",{processor:"boolean",default:!1}),i("editable_root",{processor:"boolean",default:!0}),i("plugins",{processor:"string[]",default:[]}),i("external_plugins",{processor:"object"}),i("forced_plugins",{processor:"string[]"}),i("model",{processor:"string",default:n.hasPlugin("rtc")?"plugin":"dom"}),i("model_url",{processor:"string"}),i("block_unsupported_drop",{processor:"boolean",default:!0}),i("visual",{processor:"boolean",default:!0}),i("visual_table_class",{processor:"string",default:"mce-item-table"}),i("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),i("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),i("setup",{processor:"function"}),i("init_instance_callback",{processor:"function"}),i("url_converter",{processor:"function",default:n.convertURL}),i("url_converter_scope",{processor:"object",default:n}),i("urlconverter_callback",{processor:"function"}),i("allow_conditional_comments",{processor:"boolean",default:!1}),i("allow_html_data_urls",{processor:"boolean",default:!1}),i("allow_svg_data_urls",{processor:"boolean"}),i("allow_html_in_named_anchor",{processor:"boolean",default:!1}),i("allow_script_urls",{processor:"boolean",default:!1}),i("allow_unsafe_link_target",{processor:"boolean",default:!1}),i("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),i("fix_list_elements",{processor:"boolean",default:!1}),i("preserve_cdata",{processor:"boolean",default:!1}),i("remove_trailing_brs",{processor:"boolean",default:!0}),i("pad_empty_with_br",{processor:"boolean",default:!1}),i("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),i("element_format",{processor:"string",default:"html"}),i("entities",{processor:"string"}),i("schema",{processor:"string",default:"html5"}),i("convert_urls",{processor:"boolean",default:!0}),i("relative_urls",{processor:"boolean",default:!0}),i("remove_script_host",{processor:"boolean",default:!0}),i("custom_elements",{processor:"string"}),i("extended_valid_elements",{processor:"string"}),i("invalid_elements",{processor:"string"}),i("invalid_styles",{processor:Cc}),i("valid_children",{processor:"string"}),i("valid_classes",{processor:Cc}),i("valid_elements",{processor:"string"}),i("valid_styles",{processor:Cc}),i("verify_html",{processor:"boolean",default:!0}),i("auto_focus",{processor:l=>F(l)||l===!0}),i("browser_spellcheck",{processor:"boolean",default:!1}),i("protect",{processor:"array"}),i("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),i("deprecation_warnings",{processor:"boolean",default:!0}),i("a11y_advanced_options",{processor:"boolean",default:!1}),i("api_key",{processor:"string"}),i("paste_block_drop",{processor:"boolean",default:!1}),i("paste_data_images",{processor:"boolean",default:!0}),i("paste_preprocess",{processor:"function"}),i("paste_postprocess",{processor:"function"}),i("paste_webkit_styles",{processor:"string",default:"none"}),i("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),i("paste_merge_formats",{processor:"boolean",default:!0}),i("smart_paste",{processor:"boolean",default:!0}),i("paste_as_text",{processor:"boolean",default:!1}),i("paste_tab_spaces",{processor:"number",default:4}),i("text_patterns",{processor:l=>Qe(l,ne)||l===!1?{value:gl(l===!1?[]:l),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),i("text_patterns_lookup",{processor:l=>be(l)?{value:Al(l),valid:!0}:{valid:!1,message:"Must be a single function"},default:l=>[]}),i("noneditable_class",{processor:"string",default:"mceNonEditable"}),i("editable_class",{processor:"string",default:"mceEditable"}),i("noneditable_regexp",{processor:l=>Qe(l,K2)?{value:l,valid:!0}:K2(l)?{value:[l],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),i("table_tab_navigation",{processor:"boolean",default:!0}),i("highlight_on_focus",{processor:"boolean",default:!1}),i("xss_sanitization",{processor:"boolean",default:!0}),i("details_initial_state",{processor:l=>{const d=Ct(["inherited","collapsed","expanded"],l);return d?{value:l,valid:d}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("details_serialized_state",{processor:l=>{const d=Ct(["inherited","collapsed","expanded"],l);return d?{value:l,valid:d}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("init_content_sync",{processor:"boolean",default:!1}),i("newdocument_content",{processor:"string",default:""}),n.on("ScriptsLoaded",()=>{i("directionality",{processor:"string",default:Yf.isRtl()?"rtl":void 0}),i("placeholder",{processor:"string",default:Xl.getAttrib(n.getElement(),"placeholder")})})},sf=to("iframe_attrs"),$v=to("doctype"),Qp=to("document_base_url"),Of=to("body_id"),nl=to("body_class"),Md=to("content_security_policy"),Rd=to("br_in_pre"),Hc=to("forced_root_block"),o0=to("forced_root_block_attrs"),X2=to("newline_behavior"),aC=to("br_newline_selector"),J2=to("no_newline_selector"),bh=to("keep_styles"),jr=to("end_container_on_empty_block"),zv=to("automatic_uploads"),ed=to("images_reuse_filename"),lC=to("images_replace_blob_uris"),cC=to("icons"),ia=to("icons_url"),Wk=to("images_upload_url"),Vv=to("images_upload_base_path"),Uv=to("images_upload_credentials"),uC=to("images_upload_handler"),jk=to("content_css_cors"),s0=to("referrer_policy"),fC=to("language"),Zk=to("language_url"),dC=to("indent_use_margin"),qk=to("indentation"),hC=to("content_css"),Wv=to("content_style"),ip=to("font_css"),r0=to("directionality"),Ui=to("inline_boundaries_selector"),Q2=to("object_resizing"),Sc=to("resize_img_proportional"),i0=to("placeholder"),ol=to("event_root"),mC=to("service_message"),rm=to("theme"),Gk=to("theme_url"),Jl=to("model"),rf=to("model_url"),Cb=to("inline_boundaries"),Kk=to("formats"),Yk=to("preview_styles"),gC=to("format_empty_lines"),Sb=to("format_noneditable_selector"),pC=to("custom_ui_selector"),bC=to("inline"),ap=to("hidden_input"),Xk=to("submit_patch"),Jk=to("add_form_submit_trigger"),Qk=to("add_unload_trigger"),ew=to("custom_undo_redo_levels"),jv=to("disable_nodechange"),cg=to("readonly"),vC=to("editable_root"),yC=to("content_css_cors"),Zv=to("plugins"),a0=to("external_plugins"),ug=to("block_unsupported_drop"),qv=to("visual"),Gv=to("visual_table_class"),kb=to("visual_anchor_class"),wC=to("iframe_aria_text"),vh=to("setup"),Eb=to("init_instance_callback"),_C=to("urlconverter_callback"),yh=to("auto_focus"),lp=to("browser_spellcheck"),tw=to("protect"),CC=to("paste_block_drop"),Kv=to("paste_data_images"),eE=to("paste_preprocess"),SC=to("paste_postprocess"),tE=to("newdocument_content"),nE=to("paste_webkit_styles"),kC=to("paste_remove_styles_if_webkit"),EC=to("paste_merge_formats"),xC=to("smart_paste"),oE=to("paste_as_text"),sE=to("paste_tab_spaces"),rE=to("allow_html_data_urls"),AC=to("text_patterns"),nw=to("text_patterns_lookup"),ow=to("noneditable_class"),iE=to("editable_class"),aE=to("noneditable_regexp"),Yv=to("preserve_cdata"),TC=to("highlight_on_focus"),Xv=to("xss_sanitization"),xb=to("init_content_sync"),l0=n=>n.options.isSet("text_patterns_lookup"),Jv=n=>hn.explode(n.options.get("font_size_style_values")),sw=n=>hn.explode(n.options.get("font_size_classes")),DC=n=>n.options.get("encoding")==="xml",rw=n=>hn.explode(n.options.get("images_file_types")),lE=to("table_tab_navigation"),Qv=to("details_initial_state"),Ab=to("details_serialized_state"),cE=Xn,ey=_n,af=n=>{const i=n.parentNode;i&&i.removeChild(n)},ty=n=>{const i=Bn(n);return{count:n.length-i.length,text:i}},OC=n=>{let i;for(;(i=n.data.lastIndexOf(Ft))!==-1;)n.deleteData(i,1)},ny=(n,i)=>(pl(n),i),uE=(n,i)=>{const l=ty(n.data.substr(0,i.offset())),d=ty(n.data.substr(i.offset()));return(l.text+d.text).length>0?(OC(n),Vt(n,i.offset()-l.count)):i},Tb=(n,i)=>{const l=i.container(),d=Yo(Mr(l.childNodes),n).map(p=>p<i.offset()?Vt(l,i.offset()-1):i).getOr(i);return pl(n),d},iw=(n,i)=>ey(n)&&i.container()===n?uE(n,i):ny(n,i),fE=(n,i)=>i.container()===n.parentNode?Tb(n,i):ny(n,i),oy=(n,i)=>Vt.isTextPosition(i)?iw(n,i):fE(n,i),pl=n=>{cE(n)&&br(n)&&(Bc(n)?n.removeAttribute("data-mce-caret"):af(n)),ey(n)&&(OC(n),n.data.length===0&&af(n))},dE=xs,c0=Gu,hE=kd,u0="*[contentEditable=false],video,audio,embed,object",aw=(n,i,l)=>{const d=qp(i.getBoundingClientRect(),l);let p,w;if(n.tagName==="BODY"){const R=n.ownerDocument.documentElement;p=n.scrollLeft||R.scrollLeft,w=n.scrollTop||R.scrollTop}else{const R=n.getBoundingClientRect();p=n.scrollLeft-R.left,w=n.scrollTop-R.top}d.left+=p,d.right+=p,d.top+=w,d.bottom+=w,d.width=1;let E=i.offsetWidth-i.clientWidth;return E>0&&(l&&(E*=-1),d.left+=E,d.right+=E),d},mE=n=>{var i,l;const d=dl(Ke.fromDom(n),u0);for(let p=0;p<d.length;p++){const w=d[p].dom;let E=w.previousSibling;if(lr(E)){const R=E.data;R.length===1?(i=E.parentNode)===null||i===void 0||i.removeChild(E):E.deleteData(R.length-1,1)}E=w.nextSibling,sh(E)&&(E.data.length===1?(l=E.parentNode)===null||l===void 0||l.removeChild(E):E.deleteData(0,1))}},gE=(n,i,l,d)=>{const p=mh();let w,E;const R=Hc(n),B=n.dom,K=(Oe,ze)=>{let ht;if(ie(),hE(ze))return null;if(l(ze)){const bt=oh(R,ze,Oe),vt=aw(i,ze,Oe);B.setStyle(bt,"top",vt.top),E=bt;const Mt=B.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});B.setStyles(Mt,{...vt}),B.add(i,Mt),p.set({caret:Mt,element:ze,before:Oe}),Oe&&B.addClass(Mt,"mce-visual-caret-before"),ue(),ht=ze.ownerDocument.createRange(),ht.setStart(bt,0),ht.setEnd(bt,0)}else return E=Qc(ze,Oe),ht=ze.ownerDocument.createRange(),im(E.nextSibling)?(ht.setStart(E,0),ht.setEnd(E,0)):(ht.setStart(E,1),ht.setEnd(E,1)),ht;return ht},ie=()=>{mE(i),E&&(pl(E),E=null),p.on(Oe=>{B.remove(Oe.caret),p.clear()}),w&&(clearInterval(w),w=void 0)},ue=()=>{w=setInterval(()=>{p.on(Oe=>{d()?B.toggleClass(Oe.caret,"mce-visual-caret-hidden"):B.addClass(Oe.caret,"mce-visual-caret-hidden")})},500)};return{show:K,hide:ie,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{p.on(Oe=>{const ze=aw(i,Oe.element,Oe.before);B.setStyles(Oe.caret,{...ze})})},destroy:()=>clearInterval(w)}},Db=()=>Kn.browser.isFirefox(),im=n=>dE(n)||c0(n),f0=n=>(im(n)||Eu(n)&&Db())&&gi(Ke.fromDom(n)).exists(wn),lu=ha,e1=xs,MC=Gu,RC=eh("display","block table table-cell table-caption list-item"),lw=br,cw=bi,uw=Xn,pE=_n,Ob=Sl,sy=n=>n>0,cp=n=>n<0,Mb=(n,i)=>{let l;for(;l=n(i);)if(!cw(l))return l;return null},wh=(n,i,l,d,p)=>{const w=new pi(n,d),E=e1(n)||cw(n);let R;if(cp(i)){if(E&&(R=Mb(w.prev.bind(w),!0),l(R)))return R;for(;R=Mb(w.prev.bind(w),p);)if(l(R))return R}if(sy(i)){if(E&&(R=Mb(w.next.bind(w),!0),l(R)))return R;for(;R=Mb(w.next.bind(w),p);)if(l(R))return R}return null},bE=(n,i)=>{const l=p=>lu(p.dom),d=p=>p.dom===i;return li(Ke.fromDom(n),l,d).map(p=>p.dom).getOr(i)},am=(n,i)=>{for(;n&&n!==i;){if(RC(n))return n;n=n.parentNode}return null},Nd=(n,i,l)=>am(n.container(),l)===am(i.container(),l),d0=(n,i)=>{if(!i)return he.none();const l=i.container(),d=i.offset();return uw(l)?he.from(l.childNodes[d+n]):he.none()},fw=(n,i)=>{var l;const p=((l=i.ownerDocument)!==null&&l!==void 0?l:document).createRange();return n?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)),p},h0=(n,i,l)=>am(i,n)===am(l,n),fg=(n,i,l)=>{const d=n?"previousSibling":"nextSibling";let p=l;for(;p&&p!==i;){let w=p[d];if(w&&lw(w)&&(w=w[d]),e1(w)||MC(w)){if(h0(i,w,p))return w;break}if(Ob(w))break;p=p.parentNode}return null},S=He(fw,!0),T=He(fw,!1),H=(n,i,l)=>{let d;const p=He(fg,!0,i),w=He(fg,!1,i),E=l.startContainer,R=l.startOffset;if(bi(E)){const B=pE(E)?E.parentNode:E,K=B.getAttribute("data-mce-caret");if(K==="before"&&(d=B.nextSibling,f0(d)))return S(d);if(K==="after"&&(d=B.previousSibling,f0(d)))return T(d)}if(!l.collapsed)return l;if(_n(E)){if(lw(E)){if(n===1){if(d=w(E),d)return S(d);if(d=p(E),d)return T(d)}if(n===-1){if(d=p(E),d)return T(d);if(d=w(E),d)return S(d)}return l}if(lr(E)&&R>=E.data.length-1)return n===1&&(d=w(E),d)?S(d):l;if(sh(E)&&R<=1)return n===-1&&(d=p(E),d)?T(d):l;if(R===E.data.length)return d=w(E),d?S(d):l;if(R===0)return d=p(E),d?T(d):l}return l},ae=(n,i)=>d0(n?0:-1,i).filter(e1),ke=(n,i,l)=>{const d=H(n,i,l);return n===-1?Vt.fromRangeStart(d):Vt.fromRangeEnd(d)},Ve=n=>he.from(n.getNode()).map(Ke.fromDom),dt=n=>he.from(n.getNode(!0)).map(Ke.fromDom),_t=(n,i)=>{let l=i;for(;l=n(l);)if(l.isVisible())return l;return l},zt=(n,i)=>{const l=Nd(n,i);return!l&&ui(n.getNode())?!0:l};var pn;(function(n){n[n.Backwards=-1]="Backwards",n[n.Forwards=1]="Forwards"})(pn||(pn={}));const Hn=xs,zn=_n,Lo=Xn,hs=ui,Is=Sl,Hr=Gh,$s=Wg,fi=(n,i)=>{const l=[];let d=n;for(;d&&d!==i;)l.push(d),d=d.parentNode;return l},yi=(n,i)=>n.hasChildNodes()&&i<n.childNodes.length?n.childNodes[i]:null,cu=(n,i)=>{if(sy(n)){if(Is(i.previousSibling)&&!zn(i.previousSibling))return Vt.before(i);if(zn(i))return Vt(i,0)}if(cp(n)){if(Is(i.nextSibling)&&!zn(i.nextSibling))return Vt.after(i);if(zn(i))return Vt(i,i.data.length)}return cp(n)?hs(i)?Vt.before(i):Vt.after(i):Vt.before(i)},Ou=(n,i)=>{const l=i.nextSibling;return l&&Is(l)?zn(l)?Vt(l,0):Vt.before(l):Mf(pn.Forwards,Vt.after(i),n)},Mf=(n,i,l)=>{let d,p,w,E;if(!Lo(l)||!i)return null;if(i.isEqual(Vt.after(l))&&l.lastChild){if(E=Vt.after(l.lastChild),cp(n)&&Is(l.lastChild)&&Lo(l.lastChild))return hs(l.lastChild)?Vt.before(l.lastChild):E}else E=i;const R=E.container();let B=E.offset();if(zn(R)){if(cp(n)&&B>0)return Vt(R,--B);if(sy(n)&&B<R.length)return Vt(R,++B);d=R}else{if(cp(n)&&B>0&&(p=yi(R,B-1),Is(p)))return!Hr(p)&&(w=wh(p,n,$s,p),w)?zn(w)?Vt(w,w.data.length):Vt.after(w):zn(p)?Vt(p,p.data.length):Vt.before(p);if(sy(n)&&B<R.childNodes.length&&(p=yi(R,B),Is(p)))return hs(p)?Ou(l,p):!Hr(p)&&(w=wh(p,n,$s,p),w)?zn(w)?Vt(w,0):Vt.before(w):zn(p)?Vt(p,0):Vt.after(p);d=p||E.getNode()}if(d&&(sy(n)&&E.isAtEnd()||cp(n)&&E.isAtStart())&&(d=wh(d,n,xt,l,!0),$s(d,l)))return cu(n,d);p=d&&wh(d,n,$s,l);const K=It(yt(fi(R,l),Hn));return K&&(!p||!K.contains(p))?(sy(n)?E=Vt.after(K):E=Vt.before(K),E):p?cu(n,p):null},ka=n=>({next:i=>Mf(pn.Forwards,i,n),prev:i=>Mf(pn.Backwards,i,n)}),lm=(n,i,l)=>{const d=n?Vt.before(l):Vt.after(l);return Pd(n,i,d)},td=n=>ui(n)?Vt.before(n):Vt.after(n),dw=n=>Vt.isTextPosition(n)?n.offset()===0:Sl(n.getNode()),uu=n=>{if(Vt.isTextPosition(n)){const i=n.container();return n.offset()===i.data.length}else return Sl(n.getNode(!0))},NC=(n,i)=>!Vt.isTextPosition(n)&&!Vt.isTextPosition(i)&&n.getNode()===i.getNode(!0),Rb=n=>!Vt.isTextPosition(n)&&ui(n.getNode()),Nb=(n,i,l)=>n?!NC(i,l)&&!Rb(i)&&uu(i)&&dw(l):!NC(l,i)&&dw(i)&&uu(l),Pd=(n,i,l)=>{const d=ka(i);return he.from(n?d.next(l):d.prev(l))},m0=(n,i,l)=>Pd(n,i,l).bind(d=>Nd(l,d,i)&&Nb(n,l,d)?Pd(n,i,d):he.some(d)),vE=(n,i,l,d)=>m0(n,i,l).bind(p=>d(p)?vE(n,i,p,d):he.some(p)),ry=(n,i)=>{const l=n?i.firstChild:i.lastChild;return _n(l)?he.some(Vt(l,n?0:l.data.length)):l?Sl(l)?he.some(n?Vt.before(l):td(l)):lm(n,i,l):he.none()},Rf=He(Pd,!0),Mu=He(Pd,!1),sl=He(ry,!0),Id=He(ry,!1),PC="_mce_caret",$c=n=>Xn(n)&&n.id===PC,g0=(n,i)=>{let l=i;for(;l&&l!==n;){if($c(l))return l;l=l.parentNode}return null},iy=n=>F(n.start),hw=n=>cn(n,"rng"),yE=n=>cn(n,"id"),wE=n=>cn(n,"name"),t1=n=>hn.isArray(n.start),mw=n=>!wE(n)&&we(n.forward)?n.forward:!0,dg=(n,i)=>(Xn(i)&&n.isBlock(i)&&!i.innerHTML&&(i.innerHTML='<br data-mce-bogus="1" />'),i),xO=(n,i)=>{const l=he.from(_b(n.getRoot(),i.start)),d=he.from(_b(n.getRoot(),i.end));return ni(l,d,(p,w)=>{const E=n.createRng();return E.setStart(p.container(),p.offset()),E.setEnd(w.container(),w.offset()),{range:E,forward:mw(i)}})},_E=(n,i)=>{var l;const p=((l=n.ownerDocument)!==null&&l!==void 0?l:document).createTextNode(Ft);n.appendChild(p),i.setStart(p,0),i.setEnd(p,0)},i3=n=>!n.hasChildNodes(),_I=(n,i)=>Id(n).fold(We,l=>(i.setStart(l.container(),l.offset()),i.setEnd(l.container(),l.offset()),!0)),a3=(n,i,l)=>i3(i)&&g0(n,i)?(_E(i,l),!0):!1,l3=(n,i,l,d)=>{const p=l[i?"start":"end"],w=n.getRoot();if(p){let E=w,R=p[0];for(let B=p.length-1;E&&B>=1;B--){const K=E.childNodes;if(a3(w,E,d))return!0;if(p[B]>K.length-1)return a3(w,E,d)?!0:_I(E,d);E=K[p[B]]}_n(E)&&(R=Math.min(p[0],E.data.length)),Xn(E)&&(R=Math.min(p[0],E.childNodes.length)),i?d.setStart(E,R):d.setEnd(E,R)}return!0},CE=n=>_n(n)&&n.data.length>0,SE=(n,i,l)=>{const d=n.get(l.id+"_"+i),p=d==null?void 0:d.parentNode,w=l.keep;if(d&&p){let E,R;if(i==="start"?w?d.hasChildNodes()?(E=d.firstChild,R=1):CE(d.nextSibling)?(E=d.nextSibling,R=0):CE(d.previousSibling)?(E=d.previousSibling,R=d.previousSibling.data.length):(E=p,R=n.nodeIndex(d)+1):(E=p,R=n.nodeIndex(d)):w?d.hasChildNodes()?(E=d.firstChild,R=1):CE(d.previousSibling)?(E=d.previousSibling,R=d.previousSibling.data.length):(E=p,R=n.nodeIndex(d)):(E=p,R=n.nodeIndex(d)),!w){const B=d.previousSibling,K=d.nextSibling;hn.each(hn.grep(d.childNodes),ue=>{_n(ue)&&(ue.data=ue.data.replace(/\uFEFF/g,""))});let ie;for(;ie=n.get(l.id+"_"+i);)n.remove(ie,!0);if(_n(K)&&_n(B)&&!Kn.browser.isOpera()){const ue=B.data.length;B.appendData(K.data),n.remove(K),E=B,R=ue}}return he.some(Vt(E,R))}else return he.none()},kE=(n,i)=>{const l=n.createRng();return l3(n,!0,i,l)&&l3(n,!1,i,l)?he.some({range:l,forward:mw(i)}):he.none()},c3=(n,i)=>{const l=SE(n,"start",i),d=SE(n,"end",i);return ni(l,d.or(l),(p,w)=>{const E=n.createRng();return E.setStart(dg(n,p.container()),p.offset()),E.setEnd(dg(n,w.container()),w.offset()),{range:E,forward:mw(i)}})},u3=(n,i)=>he.from(n.select(i.name)[i.index]).map(l=>{const d=n.createRng();return d.selectNode(l),{range:d,forward:!0}}),f3=(n,i)=>{const l=n.dom;if(i){if(t1(i))return kE(l,i);if(iy(i))return xO(l,i);if(yE(i))return c3(l,i);if(wE(i))return u3(l,i);if(hw(i))return he.some({range:i.rng,forward:mw(i)})}return he.none()},AO=(n,i,l)=>iC(n,i,l),TO=(n,i)=>{f3(n,i).each(({range:l,forward:d})=>{n.setRng(l,d)})},Bd=n=>Xn(n)&&n.tagName==="SPAN"&&n.getAttribute("data-mce-type")==="bookmark",Ks=(n=>i=>n===i)(Gr),_h=n=>n!==""&&` \f
\r \v`.indexOf(n)!==-1,p0=n=>!_h(n)&&!Ks(n)&&!J0(n),EE=n=>({value:d3(n)}),d3=n=>fa(n,"#").toUpperCase(),ay=n=>{const i=n.toString(16);return(i.length===1?"0"+i:i).toUpperCase()},OO=n=>{const i=ay(n.red)+ay(n.green)+ay(n.blue);return EE(i)},xE=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,IC=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,gw=(n,i,l,d)=>({red:n,green:i,blue:l,alpha:d}),MO=(n,i,l,d)=>{const p=parseInt(n,10),w=parseInt(i,10),E=parseInt(l,10),R=parseFloat(d);return gw(p,w,E,R)},AE=n=>{if(n==="transparent")return he.some(gw(0,0,0,0));const i=xE.exec(n);if(i!==null)return he.some(MO(i[1],i[2],i[3],"1"));const l=IC.exec(n);return l!==null?he.some(MO(l[1],l[2],l[3],l[4])):he.none()},BC=n=>AE(n).map(OO).map(i=>"#"+i.value).getOr(n),TE=n=>{const i=[];if(n)for(let l=0;l<n.rangeCount;l++)i.push(n.getRangeAt(l));return i},CI=n=>Ns(n,i=>{const l=Q1(i);return l?[Ke.fromDom(l)]:[]}),h3=n=>TE(n).length>1,DE=n=>yt(CI(n),Vm),ly=n=>dl(n,"td[data-mce-selected],th[data-mce-selected]"),pw=(n,i)=>{const l=ly(i);return l.length>0?l:DE(n)},b0=n=>pw(TE(n.selection.getSel()),Ke.fromDom(n.getBody())),up=(n,i)=>Se(n,"table",i),m3=n=>{const i=n.startContainer,l=n.startOffset;return _n(i)?l===0?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[l]).map(Ke.fromDom)},RO=n=>{const i=n.endContainer,l=n.endOffset;return _n(i)?l===i.data.length?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[l-1]).map(Ke.fromDom)},g3=n=>oi(n).fold(nt([n]),i=>[n].concat(g3(i))),OE=n=>_u(n).fold(nt([n]),i=>Xr(i)==="br"?ya(i).map(l=>[n].concat(OE(l))).getOr([]):[n].concat(OE(i))),cy=(n,i)=>ni(m3(i),RO(i),(l,d)=>{const p=Jn(g3(n),He(pt,l)),w=Jn(OE(n),He(pt,d));return p.isSome()&&w.isSome()}).getOr(!1),ME=(n,i,l,d)=>{const p=l,w=new pi(l,p),E=Wt(n.schema.getMoveCaretBeforeOnEnterElements(),(B,K)=>!Ct(["td","th","table"],K.toLowerCase()));let R=l;do{if(_n(R)&&hn.trim(R.data).length!==0){d?i.setStart(R,0):i.setEnd(R,R.data.length);return}if(E[R.nodeName]){d?i.setStartBefore(R):R.nodeName==="BR"?i.setEndBefore(R):i.setEndAfter(R);return}}while(R=d?w.next():w.prev());p.nodeName==="BODY"&&(d?i.setStart(p,0):i.setEnd(p,p.childNodes.length))},LC=n=>{const i=n.selection.getSel();return _e(i)&&i.rangeCount>0},RE=(n,i)=>{const l=b0(n);l.length>0?Pe(l,d=>{const p=d.dom,w=n.dom.createRng();w.setStartBefore(p),w.setEndAfter(p),i(w,!0)}):i(n.selection.getRng(),!1)},p3=(n,i,l)=>{const d=vr(n,i);l(d),n.moveToBookmark(d)},bw=n=>tt(n==null?void 0:n.nodeType),NE=n=>Xn(n)&&!Bd(n)&&!$c(n)&&!Cd(n),NO=(n,i)=>{if(NE(i)&&!/^(TD|TH)$/.test(i.nodeName)){const l=n.getAttrib(i,"data-mce-selected"),d=parseInt(l,10);return!isNaN(d)&&d>0}else return!1},cm=n=>n.isContentEditable===!0,b3=(n,i,l)=>{const{selection:d,dom:p}=n,w=d.getNode(),E=xs(w);p3(d,!0,()=>{i()}),E&&xs(w)&&p.isChildOf(w,n.getBody())?n.selection.select(w):l(d.getStart())&&PO(p,d)},PO=(n,i)=>{var l,d;const p=i.getRng(),{startContainer:w,startOffset:E}=p,R=i.getNode();if(!NO(n,R)&&Xn(w)){const B=w.childNodes,K=n.getRoot();let ie;if(E<B.length){const ue=B[E];ie=new pi(ue,(l=n.getParent(ue,n.isBlock))!==null&&l!==void 0?l:K)}else{const ue=B[B.length-1];ie=new pi(ue,(d=n.getParent(ue,n.isBlock))!==null&&d!==void 0?d:K),ie.next(!0)}for(let ue=ie.current();ue;ue=ie.next()){if(n.getContentEditable(ue)==="false")return;if(_n(ue)&&!Ql(ue)){p.setStart(ue,0),i.setRng(p);return}}}},Yn=(n,i,l)=>{if(n){const d=i?"nextSibling":"previousSibling";for(n=l?n:n[d];n;n=n[d])if(Xn(n)||!Ql(n))return n}},$l=(n,i)=>!!n.getTextBlockElements()[i.nodeName.toLowerCase()]||Jm(n,i),um=(n,i,l)=>n.schema.isValidChild(i,l),Ql=(n,i=!1)=>{if(_e(n)&&_n(n)){const l=i?n.data.replace(/ /g,"\xA0"):n.data;return Zm(l)}else return!1},fm=n=>_e(n)&&_n(n)&&n.length===0,v3=(n,i)=>{const l="[data-mce-cef-wrappable]",d=Sb(n),p=Ja(d)?l:`${l},${d}`;return wu(Ke.fromDom(i),p)},vw=(n,i)=>{const l=n.dom;return NE(i)&&l.getContentEditable(i)==="false"&&v3(n,i)&&l.select('[contenteditable="true"]',i).length===0},Ch=(n,i)=>be(n)?n(i):(_e(i)&&(n=n.replace(/%(\w+)/g,(l,d)=>i[d]||l)),n),FC=(n,i)=>(n=n||"",i=i||"",n=""+(n.nodeName||n),i=""+(i.nodeName||i),n.toLowerCase()===i.toLowerCase()),yw=(n,i)=>{if(De(n))return null;{let l=String(n);return(i==="color"||i==="backgroundColor")&&(l=BC(l)),i==="fontWeight"&&n===700&&(l="bold"),i==="fontFamily"&&(l=l.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),l}},ww=(n,i,l)=>{const d=n.getStyle(i,l);return yw(d,l)},PE=(n,i)=>{let l;return n.getParent(i,d=>Xn(d)?(l=n.getStyle(d,"text-decoration"),!!l&&l!=="none"):!1),l},_w=(n,i,l)=>n.getParents(i,l,n.getRoot()),HC=(n,i,l)=>{const d=n.formatter.get(i);return _e(d)&&Jt(d,l)},IE=(n,i)=>HC(n,i,d=>{const p=w=>be(w)||w.length>1&&w.charAt(0)==="%";return Jt(["styles","attributes"],w=>go(d,w).exists(E=>{const R=re(E)?E:lo(E);return Jt(R,p)}))}),IO=(n,i,l)=>{const d=["inline","block","selector","attributes","styles","classes"],p=w=>Wt(w,(E,R)=>Jt(d,B=>B===R));return HC(n,i,w=>{const E=p(w);return HC(n,l,R=>{const B=p(R);return wo(E,B)})})},dm=n=>ts(n,"block"),$C=n=>dm(n)&&n.wrapper===!0,Cw=n=>dm(n)&&n.wrapper!==!0,nd=n=>ts(n,"selector"),Tl=n=>ts(n,"inline"),BE=n=>nd(n)&&Tl(n)&&qr(go(n,"mixed"),!0),Sw=n=>nd(n)&&n.expand!==!1&&!Tl(n),Ld=Bd,kw=_w,LE=Ql,FE=$l,BO=n=>ui(n)&&n.getAttribute("data-mce-bogus")&&!n.nextSibling,y3=(n,i)=>{let l=i;for(;l;){if(Xn(l)&&n.getContentEditable(l))return n.getContentEditable(l)==="false"?l:i;l=l.parentNode}return i},Ew=(n,i,l,d)=>{const p=i.data;if(n){for(let w=l;w>0;w--)if(d(p.charAt(w-1)))return w}else for(let w=l;w<p.length;w++)if(d(p.charAt(w)))return w;return-1},w3=(n,i,l)=>Ew(n,i,l,d=>Ks(d)||_h(d)),LO=(n,i,l)=>Ew(n,i,l,p0),v0=(n,i,l,d,p,w)=>{let E;const R=n.getParent(l,n.isBlock)||i,B=(ie,ue,pe)=>{const Be=op(n),Ze=p?Be.backwards:Be.forwards;return he.from(Ze(ie,ue,(Oe,ze)=>Ld(Oe.parentNode)?-1:(E=Oe,pe(p,Oe,ze)),R))};return B(l,d,w3).bind(ie=>w?B(ie.container,ie.offset+(p?-1:0),LO):he.some(ie)).orThunk(()=>E?he.some({container:E,offset:p?0:E.length}):he.none())},zc=(n,i,l,d,p)=>{const w=d[p];_n(d)&&Ja(d.data)&&w&&(d=w);const E=kw(n,d);for(let R=0;R<E.length;R++)for(let B=0;B<i.length;B++){const K=i[B];if(!(_e(K.collapsed)&&K.collapsed!==l.collapsed)&&nd(K)&&n.is(E[R],K.selector))return E[R]}return d},Sh=(n,i,l,d)=>{var p;let w=l;const E=n.getRoot(),R=i[0];if(dm(R)&&(w=R.wrapper?null:n.getParent(l,R.block,E)),!w){const B=(p=n.getParent(l,"LI,TD,TH"))!==null&&p!==void 0?p:E;w=n.getParent(_n(l)?l.parentNode:l,K=>K!==E&&FE(n.schema,K),B)}if(w&&dm(R)&&R.wrapper&&(w=kw(n,w,"ul,ol").reverse()[0]||w),!w)for(w=l;w&&w[d]&&!n.isBlock(w[d])&&(w=w[d],!FC(w,"br")););return w||l},Fd=(n,i,l,d)=>{const p=l.parentNode;return _e(l[d])?!1:p===i||De(p)||n.isBlock(p)?!0:Fd(n,i,p,d)},od=(n,i,l,d,p)=>{let w=l;const E=p?"previousSibling":"nextSibling",R=n.getRoot();if(_n(l)&&!LE(l)&&(p?d>0:d<l.data.length))return l;for(;w;){if(!i[0].block_expand&&n.isBlock(w))return w;for(let B=w[E];B;B=B[E]){const K=_n(B)&&!Fd(n,R,B,E);if(!Ld(B)&&!BO(B)&&!LE(B,K))return w}if(w===R||w.parentNode===R){l=w;break}w=w.parentNode}return l},zC=n=>Ld(n.parentNode)||Ld(n),Pb=(n,i,l,d=!1)=>{let{startContainer:p,startOffset:w,endContainer:E,endOffset:R}=i;const B=l[0];return Xn(p)&&p.hasChildNodes()&&(p=Jf(p,w),_n(p)&&(w=0)),Xn(E)&&E.hasChildNodes()&&(E=Jf(E,i.collapsed?R:R-1),_n(E)&&(R=E.data.length)),p=y3(n,p),E=y3(n,E),zC(p)&&(p=Ld(p)?p:p.parentNode,i.collapsed?p=p.previousSibling||p:p=p.nextSibling||p,_n(p)&&(w=i.collapsed?p.length:0)),zC(E)&&(E=Ld(E)?E:E.parentNode,i.collapsed?E=E.nextSibling||E:E=E.previousSibling||E,_n(E)&&(R=i.collapsed?0:E.length)),i.collapsed&&(v0(n,n.getRoot(),p,w,!0,d).each(({container:ue,offset:pe})=>{p=ue,w=pe}),v0(n,n.getRoot(),E,R,!1,d).each(({container:ue,offset:pe})=>{E=ue,R=pe})),(Tl(B)||B.block_expand)&&((!Tl(B)||!_n(p)||w===0)&&(p=od(n,l,p,w,!0)),(!Tl(B)||!_n(E)||R===E.data.length)&&(E=od(n,l,E,R,!1))),Sw(B)&&(p=zc(n,l,i,p,"previousSibling"),E=zc(n,l,i,E,"nextSibling")),(dm(B)||nd(B))&&(p=Sh(n,l,p,"previousSibling"),E=Sh(n,l,E,"nextSibling"),dm(B)&&(n.isBlock(p)||(p=od(n,l,p,w,!0)),n.isBlock(E)||(E=od(n,l,E,R,!1)))),Xn(p)&&p.parentNode&&(w=n.nodeIndex(p),p=p.parentNode),Xn(E)&&E.parentNode&&(R=n.nodeIndex(E)+1,E=E.parentNode),{startContainer:p,startOffset:w,endContainer:E,endOffset:R}},n1=(n,i,l)=>{var d;const p=i.startOffset,w=Jf(i.startContainer,p),E=i.endOffset,R=Jf(i.endContainer,E-1),B=ze=>{const ht=ze[0];_n(ht)&&ht===w&&p>=ht.data.length&&ze.splice(0,1);const bt=ze[ze.length-1];return E===0&&ze.length>0&&bt===R&&_n(bt)&&ze.splice(ze.length-1,1),ze},K=(ze,ht,bt)=>{const vt=[];for(;ze&&ze!==bt;ze=ze[ht])vt.push(ze);return vt},ie=(ze,ht)=>n.getParent(ze,bt=>bt.parentNode===ht,ht),ue=(ze,ht,bt)=>{const vt=bt?"nextSibling":"previousSibling";for(let Mt=ze,fn=Mt.parentNode;Mt&&Mt!==ht;Mt=fn){fn=Mt.parentNode;const $n=K(Mt===ze?Mt:Mt[vt],vt);$n.length&&(bt||$n.reverse(),l(B($n)))}};if(w===R)return l(B([w]));const pe=(d=n.findCommonAncestor(w,R))!==null&&d!==void 0?d:n.getRoot();if(n.isChildOf(w,R))return ue(w,pe,!0);if(n.isChildOf(R,w))return ue(R,pe);const Be=ie(w,pe)||w,Ze=ie(R,pe)||R;ue(w,Be,!0);const Oe=K(Be===w?Be:Be.nextSibling,"nextSibling",Ze===R?Ze.nextSibling:Ze);Oe.length&&l(B(Oe)),ue(R,Ze)},FO=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],HE=n=>Qa(n)&&Ic(n)===Ft,HO=(n,i,l,d)=>ai(i).fold(()=>"skipping",p=>d==="br"||HE(i)?"valid":Bk(i)?"existing":$c(i.dom)?"caret":Jt(FO,w=>wu(i,w))?"valid-block":!um(n,l,d)||!um(n,Xr(p),l)?"invalid-child":"valid"),_3=(n,i)=>{const l=Pb(n.dom,i,[{inline:"span"}]);i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset),n.selection.setRng(i)},C3=(n,i,l,d,p,w)=>{const{uid:E=i,...R}=l;Wu(n,Xf()),Tr(n,`${jp()}`,E),Tr(n,`${ef()}`,d);const{attributes:B={},classes:K=[]}=p(E,R);if(Uu(n,B),Nv(n,K),w){K.length>0&&Tr(n,`${mb()}`,K.join(","));const ie=gs(B);ie.length>0&&Tr(n,`${gb()}`,ie.join(","))}},S3=n=>{Nc(n,Xf()),Hi(n,`${jp()}`),Hi(n,`${ef()}`),Hi(n,`${X1()}`);const i=$a(n,`${gb()}`).map(d=>d.split(",")).getOr([]),l=$a(n,`${mb()}`).map(d=>d.split(",")).getOr([]);Pe(i,d=>Hi(n,d)),N2(n,l),Hi(n,`${mb()}`),Hi(n,`${gb()}`)},VC=(n,i,l,d,p)=>{const w=Ke.fromTag("span",n);return C3(w,i,l,d,p,!1),w},$E=(n,i,l,d,p,w)=>{const E=[],R=VC(n.getDoc(),l,w,d,p),B=mh(),K=()=>{B.clear()},ie=()=>B.get().getOrThunk(()=>{const Ze=ng(R);return E.push(Ze),B.set(Ze),Ze}),ue=Ze=>{Pe(Ze,pe)},pe=Ze=>{switch(HO(n,Ze,"span",Xr(Ze))){case"invalid-child":{K();const ze=Aa(Ze);ue(ze),K();break}case"valid-block":{K(),C3(Ze,l,w,d,p,!0);break}case"valid":{const ze=ie();j0(Ze,ze);break}}},Be=Ze=>{const Oe=Et(Ze,Ke.fromDom);ue(Oe)};return n1(n.dom,i,Ze=>{K(),Be(Ze)}),E},Ai=(n,i,l,d)=>{n.undoManager.transact(()=>{const p=n.selection,w=p.getRng(),E=b0(n).length>0,R=Ri("mce-annotation");if(w.collapsed&&!E&&_3(n,w),p.getRng().collapsed&&!E){const B=VC(n.getDoc(),R,d,i,l.decorate);Cf(B,Gr),p.getRng().insertNode(B.dom),p.select(B.dom)}else p3(p,!1,()=>{RE(n,B=>{$E(n,B,R,i,l.decorate,d)})})})},o1=n=>{const i=Rv();s3(n,i);const l=K_(n,i),d=yc("span"),p=w=>{Pe(w,E=>{d(E)?ql(E):S3(E)})};return{register:(w,E)=>{i.register(w,E)},annotate:(w,E)=>{i.lookup(w).each(R=>{Ai(n,w,R,E)})},annotationChanged:(w,E)=>{l.addListener(w,E)},remove:w=>{M2(n,he.some(w)).each(({elements:E})=>{const R=n.selection.getBookmark();p(E),n.selection.moveToBookmark(R)})},removeAll:w=>{const E=n.selection.getBookmark();an(R2(n,w),(R,B)=>{p(R)}),n.selection.moveToBookmark(E)},getAll:w=>{const E=R2(n,w);return ps(E,R=>Et(R,B=>B.dom))}}},uy=n=>({getBookmark:He(AO,n),moveToBookmark:He(TO,n)});uy.isBookmarkNode=Bd;const zE=(n,i,l)=>l.collapsed?!1:Jt(l.getClientRects(),d=>J1(d,n,i)),k3=(n,i)=>n.dispatch("PreProcess",i),VE=(n,i)=>n.dispatch("PostProcess",i),E3=n=>{n.dispatch("remove")},UC=n=>{n.dispatch("detach")},$O=(n,i)=>{n.dispatch("SwitchMode",{mode:i})},zO=(n,i,l,d,p)=>{n.dispatch("ObjectResizeStart",{target:i,width:l,height:d,origin:p})},x3=(n,i,l,d,p)=>{n.dispatch("ObjectResized",{target:i,width:l,height:d,origin:p})},VO=n=>{n.dispatch("PreInit")},UE=n=>{n.dispatch("PostRender")},fy=n=>{n.dispatch("Init")},dy=(n,i)=>{n.dispatch("PlaceholderToggle",{state:i})},WC=(n,i,l)=>{n.dispatch(i,l)},A3=(n,i,l,d)=>{n.dispatch("FormatApply",{format:i,node:l,vars:d})},kh=(n,i,l,d)=>{n.dispatch("FormatRemove",{format:i,node:l,vars:d})},Vc=(n,i)=>n.dispatch("BeforeSetContent",i),fu=(n,i)=>n.dispatch("SetContent",i),fp=(n,i)=>n.dispatch("BeforeGetContent",i),UO=(n,i)=>n.dispatch("GetContent",i),WO=(n,i)=>{n.dispatch("AutocompleterStart",i)},jO=(n,i)=>{n.dispatch("AutocompleterUpdate",i)},sr=n=>{n.dispatch("AutocompleterEnd")},ZO=(n,i,l)=>n.dispatch("PastePreProcess",{content:i,internal:l}),T3=(n,i,l)=>n.dispatch("PastePostProcess",{node:i,internal:l}),jC=(n,i)=>n.dispatch("PastePlainTextToggle",{state:i}),qO=(n,i)=>n.dispatch("EditableRootStateChange",{state:i}),eo={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:n=>n.shiftKey||n.ctrlKey||n.altKey||eo.metaKeyPressed(n),metaKeyPressed:n=>Kn.os.isMacOS()||Kn.os.isiOS()?n.metaKey:n.ctrlKey&&!n.altKey},Ib="data-mce-selected",GO="table,img,figure.image,hr,video,span.mce-preview-object,details",D3=Math.abs,ZC=Math.round,xw={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},WE=n=>n.type==="longpress"||n.type.indexOf("touch")===0,jE=(n,i)=>{const l=i.dom,d=i.getDoc(),p=document,w=i.getBody();let E,R,B,K,ie,ue,pe,Be,Ze,Oe,ze,ht,bt,vt,Mt,fn,$n;const Pn=Tn=>_e(Tn)&&(zi(Tn)||l.is(Tn,"figure.image")),Lt=Tn=>Gu(Tn)||l.hasClass(Tn,"mce-preview-object"),$t=(Tn,jo)=>{if(WE(Tn)){const Ys=Tn.touches[0];return Pn(Tn.target)&&!zE(Ys.clientX,Ys.clientY,jo)}else return Pn(Tn.target)&&!zE(Tn.clientX,Tn.clientY,jo)},yn=Tn=>{const jo=Tn.target;$t(Tn,i.selection.getRng())&&!Tn.isDefaultPrevented()&&i.selection.select(jo)},mo=Tn=>l.hasClass(Tn,"mce-preview-object")&&_e(Tn.firstElementChild)?[Tn,Tn.firstElementChild]:l.is(Tn,"figure.image")?[Tn.querySelector("img")]:[Tn],Oo=Tn=>{const jo=Q2(i);return!jo||Tn.getAttribute("data-mce-resize")==="false"||Tn===i.getBody()?!1:l.hasClass(Tn,"mce-preview-object")&&_e(Tn.firstElementChild)?wu(Ke.fromDom(Tn.firstElementChild),jo):wu(Ke.fromDom(Tn),jo)},Cs=Tn=>Lt(Tn)?l.create("img",{src:Kn.transparentSrc}):Tn.cloneNode(!0),Us=(Tn,jo,Ys)=>{if(_e(Ys)){const Kr=mo(Tn);Pe(Kr,io=>{io.style[jo]||!i.schema.isValid(io.nodeName.toLowerCase(),jo)?l.setStyle(io,jo,Ys):l.setAttrib(io,jo,""+Ys)})}},Pr=(Tn,jo,Ys)=>{Us(Tn,"width",jo),Us(Tn,"height",Ys)},di=Tn=>{let jo,Ys,Kr,io,Ws;jo=Tn.screenX-ue,Ys=Tn.screenY-pe,vt=jo*K[2]+Oe,Mt=Ys*K[3]+ze,vt=vt<5?5:vt,Mt=Mt<5?5:Mt,(Pn(E)||Lt(E))&&Sc(i)!==!1?Kr=!eo.modifierPressed(Tn):Kr=eo.modifierPressed(Tn),Kr&&(D3(jo)>D3(Ys)?(Mt=ZC(vt*ht),vt=ZC(Mt/ht)):(vt=ZC(Mt/ht),Mt=ZC(vt*ht))),Pr(R,vt,Mt),io=K.startPos.x+jo,Ws=K.startPos.y+Ys,io=io>0?io:0,Ws=Ws>0?Ws:0,l.setStyles(B,{left:io,top:Ws,display:"block"}),B.innerHTML=vt+" &times; "+Mt,K[2]<0&&R.clientWidth<=vt&&l.setStyle(R,"left",Be+(Oe-vt)),K[3]<0&&R.clientHeight<=Mt&&l.setStyle(R,"top",Ze+(ze-Mt)),jo=w.scrollWidth-fn,Ys=w.scrollHeight-$n,jo+Ys!==0&&l.setStyles(B,{left:io-jo,top:Ws-Ys}),bt||(zO(i,E,Oe,ze,"corner-"+K.name),bt=!0)},il=()=>{const Tn=bt;bt=!1,Tn&&(Us(E,"width",vt),Us(E,"height",Mt)),l.unbind(d,"mousemove",di),l.unbind(d,"mouseup",il),p!==d&&(l.unbind(p,"mousemove",di),l.unbind(p,"mouseup",il)),l.remove(R),l.remove(B),l.remove(ie),Rl(E),Tn&&(x3(i,E,vt,Mt,"corner-"+K.name),l.setAttrib(E,"style",l.getAttrib(E,"style"))),i.nodeChanged()},Rl=Tn=>{Bs();const jo=l.getPos(Tn,w),Ys=jo.x,Kr=jo.y,io=Tn.getBoundingClientRect(),Ws=io.width||io.right-io.left,ii=io.height||io.bottom-io.top;E!==Tn&&(Mn(),E=Tn,vt=Mt=0);const Ka=i.dispatch("ObjectSelected",{target:Tn});Oo(Tn)&&!Ka.isDefaultPrevented()?an(xw,(Ci,Ec)=>{const Mh=_m=>{const Fy=mo(E)[0];ue=_m.screenX,pe=_m.screenY,Oe=Fy.clientWidth,ze=Fy.clientHeight,ht=ze/Oe,K=Ci,K.name=Ec,K.startPos={x:Ws*Ci[0]+Ys,y:ii*Ci[1]+Kr},fn=w.scrollWidth,$n=w.scrollHeight,ie=l.add(w,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),l.setStyles(ie,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),R=Cs(E),l.addClass(R,"mce-clonedresizable"),l.setAttrib(R,"data-mce-bogus","all"),R.contentEditable="false",l.setStyles(R,{left:Ys,top:Kr,margin:0}),Pr(R,Ws,ii),R.removeAttribute(Ib),w.appendChild(R),l.bind(d,"mousemove",di),l.bind(d,"mouseup",il),p!==d&&(l.bind(p,"mousemove",di),l.bind(p,"mouseup",il)),B=l.add(w,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},Oe+" &times; "+ze)};let zd=l.get("mceResizeHandle"+Ec);zd&&l.remove(zd),zd=l.add(w,"div",{id:"mceResizeHandle"+Ec,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+Ec+"-resize; margin:0; padding:0"}),l.bind(zd,"mousedown",_m=>{_m.stopImmediatePropagation(),_m.preventDefault(),Mh(_m)}),Ci.elm=zd,l.setStyles(zd,{left:Ws*Ci[0]+Ys-zd.offsetWidth/2,top:ii*Ci[1]+Kr-zd.offsetHeight/2})}):Mn(!1)},hc=hb(Rl,0),Mn=(Tn=!0)=>{hc.cancel(),Bs(),E&&Tn&&E.removeAttribute(Ib),an(xw,(jo,Ys)=>{const Kr=l.get("mceResizeHandle"+Ys);Kr&&(l.unbind(Kr),l.remove(Kr))})},Qn=(Tn,jo)=>l.isChildOf(Tn,jo),yr=Tn=>{if(bt||i.removed||i.composing)return;const jo=Tn.type==="mousedown"?Tn.target:n.getNode(),Ys=rt(Ke.fromDom(jo),GO).map(io=>io.dom).filter(io=>l.isEditable(io.parentElement)).getOrUndefined(),Kr=_e(Ys)?l.getAttrib(Ys,Ib,"1"):"1";if(Pe(l.select(`img[${Ib}],hr[${Ib}]`),io=>{io.removeAttribute(Ib)}),_e(Ys)&&Qn(Ys,w)&&i.hasFocus()){vo();const io=n.getStart(!0);if(Qn(io,Ys)&&Qn(n.getEnd(!0),Ys)){l.setAttrib(Ys,Ib,Kr),hc.throttle(Ys);return}}Mn()},Bs=()=>{an(xw,Tn=>{Tn.elm&&(l.unbind(Tn.elm),delete Tn.elm)})},vo=()=>{try{i.getDoc().execCommand("enableObjectResizing",!1,"false")}catch{}};return i.on("init",()=>{vo(),i.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",yr),i.on("keyup compositionend",Tn=>{E&&E.nodeName==="TABLE"&&yr(Tn)}),i.on("hide blur",Mn),i.on("contextmenu longpress",yn,!0)}),i.on("remove",Bs),{isResizable:Oo,showResizeRect:Rl,hideResizeRect:Mn,updateResizeRect:yr,destroy:()=>{hc.cancel(),E=R=ie=null}}},KO=(n,i)=>{i.fold(l=>{n.setStartBefore(l.dom)},(l,d)=>{n.setStart(l.dom,d)},l=>{n.setStartAfter(l.dom)})},SI=(n,i)=>{i.fold(l=>{n.setEndBefore(l.dom)},(l,d)=>{n.setEnd(l.dom,d)},l=>{n.setEndAfter(l.dom)})},O3=(n,i,l)=>{const d=n.document.createRange();return KO(d,i),SI(d,l),d},M3=(n,i,l,d,p)=>{const w=n.document.createRange();return w.setStart(i.dom,l),w.setEnd(d.dom,p),w},qC=lg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),YO=(n,i,l)=>i(Ke.fromDom(l.startContainer),l.startOffset,Ke.fromDom(l.endContainer),l.endOffset),Ko=(n,i)=>i.match({domRange:l=>({ltr:nt(l),rtl:he.none}),relative:(l,d)=>({ltr:jt(()=>O3(n,l,d)),rtl:jt(()=>he.some(O3(n,d,l)))}),exact:(l,d,p,w)=>({ltr:jt(()=>M3(n,l,d,p,w)),rtl:jt(()=>he.some(M3(n,p,w,l,d)))})}),XO=(n,i)=>{const l=i.ltr();return l.collapsed?i.rtl().filter(p=>p.collapsed===!1).map(p=>qC.rtl(Ke.fromDom(p.endContainer),p.endOffset,Ke.fromDom(p.startContainer),p.startOffset)).getOrThunk(()=>YO(n,qC.ltr,l)):YO(n,qC.ltr,l)},JO=(n,i)=>{const l=Ko(n,i);return XO(n,l)};qC.ltr,qC.rtl;const Aw={create:(n,i,l,d)=>({start:n,soffset:i,finish:l,foffset:d})},GC=(n,i,l)=>{var d,p;return he.from((p=(d=n.dom).caretPositionFromPoint)===null||p===void 0?void 0:p.call(d,i,l)).bind(w=>{if(w.offsetNode===null)return he.none();const E=n.dom.createRange();return E.setStart(w.offsetNode,w.offset),E.collapse(),he.some(E)})},QO=(n,i,l)=>{var d,p;return he.from((p=(d=n.dom).caretRangeFromPoint)===null||p===void 0?void 0:p.call(d,i,l))},eM=(()=>document.caretPositionFromPoint?GC:document.caretRangeFromPoint?QO:he.none)(),tM=(n,i,l)=>{const d=Ke.fromDom(n.document);return eM(d,i,l).map(p=>Aw.create(Ke.fromDom(p.startContainer),p.startOffset,Ke.fromDom(p.endContainer),p.endOffset))},Tw=lg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ZE=(n,i,l,d)=>n.fold(i,l,d),R3=n=>n.fold(Ot,Ot,Ot),qE=Tw.before,GE=Tw.on,N3=Tw.after,s1={before:qE,on:GE,after:N3,cata:ZE,getStart:R3},hy=lg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),KE=n=>hy.exact(n.start,n.soffset,n.finish,n.foffset),nM=n=>n.match({domRange:i=>Ke.fromDom(i.startContainer),relative:(i,l)=>s1.getStart(i),exact:(i,l,d,p)=>i}),oM=hy.domRange,Nr=hy.relative,YE=hy.exact,dp=n=>{const i=nM(n);return Wr(i)},hp=Aw.create,r1={domRange:oM,relative:Nr,exact:YE,exactFromRange:KE,getWin:dp,range:hp},Ru=(n,i)=>{const l=Xr(n);return l==="input"?s1.after(n):Ct(["br","img"],l)?i===0?s1.before(n):s1.after(n):s1.on(n,i)},KC=(n,i)=>{const l=n.fold(s1.before,Ru,s1.after),d=i.fold(s1.before,Ru,s1.after);return r1.relative(l,d)},my=(n,i,l,d)=>{const p=Ru(n,i),w=Ru(l,d);return r1.relative(p,w)},YC=n=>n.match({domRange:i=>{const l=Ke.fromDom(i.startContainer),d=Ke.fromDom(i.endContainer);return my(l,i.startOffset,d,i.endOffset)},relative:KC,exact:my}),Bb=(n,i)=>{const d=(i||document).createDocumentFragment();return Pe(n,p=>{d.appendChild(p.dom)}),Ke.fromDom(d)},sM=n=>{const i=r1.getWin(n).dom,l=(p,w,E,R)=>M3(i,p,w,E,R),d=YC(n);return JO(i,d).match({ltr:l,rtl:l})},EI=(n,i,l)=>tM(n,i,l),rM=(n,i,l)=>{const d=Wr(Ke.fromDom(l));return EI(d.dom,n,i).map(p=>{const w=l.createRange();return w.setStart(p.start.dom,p.soffset),w.setEnd(p.finish.dom,p.foffset),w}).getOrUndefined()},P3=(n,i)=>_e(n)&&_e(i)&&n.startContainer===i.startContainer&&n.startOffset===i.startOffset&&n.endContainer===i.endContainer&&n.endOffset===i.endOffset,rr=(n,i,l)=>{let d=n;for(;d&&d!==i;){if(l(d))return d;d=d.parentNode}return null},hm=(n,i,l)=>rr(n,i,l)!==null,gy=(n,i,l)=>hm(n,i,d=>d.nodeName===l),iM=(n,i)=>br(n)&&!hm(n,i,$c),Lb=(n,i,l)=>{const d=i.parentNode;if(d){const p=new pi(i,n.getParent(d,n.isBlock)||n.getRoot());let w;for(;w=p[l?"prev":"next"]();)if(ui(w))return!0}return!1},cr=(n,i)=>{var l;return((l=n.previousSibling)===null||l===void 0?void 0:l.nodeName)===i},aM=(n,i)=>{let l=i;for(;l&&l!==n;){if(xs(l))return!0;l=l.parentNode}return!1},XC=(n,i,l,d,p)=>{const w=n.getRoot(),E=n.schema.getNonEmptyElements(),R=p.parentNode;let B,K;if(!R)return he.none();const ie=n.getParent(R,n.isBlock)||w;if(d&&ui(p)&&i&&n.isEmpty(ie))return he.some(Vt(R,n.nodeIndex(p)));const ue=new pi(p,ie);for(;K=ue[d?"prev":"next"]();){if(n.getContentEditableParent(K)==="false"||iM(K,w))return he.none();if(_n(K)&&K.data.length>0)return gy(K,w,"A")?he.none():he.some(Vt(K,d?K.data.length:0));if(n.isBlock(K)||E[K.nodeName.toLowerCase()])return he.none();B=K}return th(B)?he.none():l&&B?he.some(Vt(B,0)):he.none()},JC=(n,i,l,d)=>{const p=n.getRoot();let w,E=!1,R=l?d.startContainer:d.endContainer,B=l?d.startOffset:d.endOffset;const K=Xn(R)&&B===R.childNodes.length,ie=n.schema.getNonEmptyElements();let ue=l;if(br(R))return he.none();if(Xn(R)&&B>R.childNodes.length-1&&(ue=!1),qu(R)&&(R=p,B=0),R===p){if(ue&&(w=R.childNodes[B>0?B-1:0],w&&(br(w)||ie[w.nodeName]||Eu(w))))return he.none();if(R.hasChildNodes()){if(B=Math.min(!ue&&B>0?B-1:B,R.childNodes.length-1),R=R.childNodes[B],B=_n(R)&&K?R.data.length:0,!i&&R===p.lastChild&&Eu(R)||aM(p,R)||br(R))return he.none();if(R.hasChildNodes()&&!Eu(R)){w=R;const pe=new pi(R,p);do{if(xs(w)||br(w)){E=!1;break}if(_n(w)&&w.data.length>0){B=ue?0:w.data.length,R=w,E=!0;break}if(ie[w.nodeName.toLowerCase()]&&!Cl(w)){B=n.nodeIndex(w),R=w.parentNode,ue||B++,E=!0;break}}while(w=ue?pe.next():pe.prev())}}}return i&&(_n(R)&&B===0&&XC(n,K,i,!0,R).each(pe=>{R=pe.container(),B=pe.offset(),E=!0}),Xn(R)&&(w=R.childNodes[B],w||(w=R.childNodes[B-1]),w&&ui(w)&&!cr(w,"A")&&!Lb(n,w,!1)&&!Lb(n,w,!0)&&XC(n,K,i,!0,w).each(pe=>{R=pe.container(),B=pe.offset(),E=!0}))),ue&&!i&&_n(R)&&B===R.data.length&&XC(n,K,i,!1,R).each(pe=>{R=pe.container(),B=pe.offset(),E=!0}),E&&R?he.some(Vt(R,B)):he.none()},QC=(n,i)=>{const l=i.collapsed,d=i.cloneRange(),p=Vt.fromRangeStart(i);return JC(n,l,!0,d).each(w=>{(!l||!Vt.isAbove(p,w))&&d.setStart(w.container(),w.offset())}),l||JC(n,l,!1,d).each(w=>{d.setEnd(w.container(),w.offset())}),l&&d.collapse(!0),P3(i,d)?he.none():he.some(d)},i1=(n,i)=>n.splitText(i),mp=n=>{let i=n.startContainer,l=n.startOffset,d=n.endContainer,p=n.endOffset;if(i===d&&_n(i)){if(l>0&&l<i.data.length)if(d=i1(i,l),i=d.previousSibling,p>l){p=p-l;const w=i1(d,p).previousSibling;i=d=w,p=w.data.length,l=0}else p=0}else if(_n(i)&&l>0&&l<i.data.length&&(i=i1(i,l),l=0),_n(d)&&p>0&&p<d.data.length){const w=i1(d,p).previousSibling;d=w,p=w.data.length}return{startContainer:i,startOffset:l,endContainer:d,endOffset:p}},v=n=>({walk:(w,E)=>n1(n,w,E),split:mp,expand:(w,E={type:"word"})=>{if(E.type==="word"){const R=Pb(n,w,[{inline:"span"}]),B=n.createRng();return B.setStart(R.startContainer,R.startOffset),B.setEnd(R.endContainer,R.endOffset),B}return w},normalize:w=>QC(n,w).fold(We,E=>(w.setStart(E.startContainer,E.startOffset),w.setEnd(E.endContainer,E.endOffset),!0))});v.compareRanges=P3,v.getCaretRangeFromPoint=rM,v.getSelectedNode=Q1,v.getNode=Jf;const D=((n,i)=>{const l=(R,B)=>{if(!tt(B)&&!B.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+B);const K=R.dom;ns(K)&&(K.style[n]=B+"px")},d=R=>{const B=i(R);if(B<=0||B===null){const K=Mi(R,n);return parseFloat(K)||0}return B},p=d,w=(R,B)=>bn(B,(K,ie)=>{const ue=Mi(R,ie),pe=ue===void 0?0:parseInt(ue,10);return isNaN(pe)?K:K+pe},0);return{set:l,get:d,getOuter:p,aggregate:w,max:(R,B,K)=>{const ie=w(R,K);return B>ie?B-ie:0}}})("height",n=>{const i=n.dom;return yd(n)?i.getBoundingClientRect().height:i.offsetHeight}),P=n=>D.get(n),Z=()=>Ke.fromDom(document),te=(n,i)=>n.view(i).fold(nt([]),d=>{const p=n.owner(d),w=te(n,p);return[d].concat(w)}),ge=(n,i)=>{const l=i.owner(n);return te(i,l)};var ot=Object.freeze({__proto__:null,view:n=>{var i;return(n.dom===document?he.none():he.from((i=n.dom.defaultView)===null||i===void 0?void 0:i.frameElement)).map(Ke.fromDom)},owner:n=>Eo(n)});const wt=n=>{const i=Z(),l=Zu(i),d=ge(n,ot),p=ku(n),w=Yt(d,(E,R)=>{const B=ku(R);return{left:E.left+B.left,top:E.top+B.top}},{left:0,top:0});return zg(w.left+p.left+l.left,w.top+p.top+l.top)},un=n=>Xr(n)==="textarea",jn=(n,i)=>n.dispatch("ScrollIntoView",i).isDefaultPrevented(),Vn=(n,i)=>{n.dispatch("AfterScrollIntoView",i)},tn=(n,i)=>{const l=Aa(n);if(l.length===0||un(n))return{element:n,offset:i};if(i<l.length&&!un(l[i]))return{element:l[i],offset:0};{const d=l[l.length-1];return un(d)?{element:n,offset:i}:Xr(d)==="img"?{element:d,offset:1}:Qa(d)?{element:d,offset:Ic(d).length}:{element:d,offset:Aa(d).length}}},Un=(n,i)=>{const l=h2(n),d=P(n);return{element:n,bottom:l.top+d,height:d,pos:l,cleanup:i}},Xt=(n,i)=>{const l=tn(n,i),d=Ke.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">'+Ft+"</span>");return wa(l.element,d),Un(d,()=>pr(d))},fo=n=>Un(Ke.fromDom(n),ft),as=(n,i,l,d)=>{bl(n,(p,w)=>aa(n,i,l,d),l)},Ts=(n,i,l,d,p)=>{const w={elm:d.element.dom,alignToTop:p};if(jn(n,w))return;const E=Zu(i).top;l(n,i,E,d,p),Vn(n,w)},aa=(n,i,l,d)=>{const p=Ke.fromDom(n.getBody()),w=Ke.fromDom(n.getDoc());$i(p);const E=Xt(Ke.fromDom(l.startContainer),l.startOffset);Ts(n,w,i,E,d),E.cleanup()},Dl=(n,i,l,d)=>{const p=Ke.fromDom(n.getDoc());Ts(n,p,l,fo(i),d)},bl=(n,i,l)=>{const d=l.startContainer,p=l.startOffset,w=l.endContainer,E=l.endOffset;i(Ke.fromDom(d),Ke.fromDom(w));const R=n.dom.createRng();R.setStart(d,p),R.setEnd(w,E),n.selection.setRng(l)},Nu=(n,i,l,d,p)=>{const w=i.pos;if(d)q0(w.left,w.top,p);else{const E=w.top-l+i.height;q0(-n.getBody().getBoundingClientRect().left,E,p)}},Fb=(n,i,l,d,p,w)=>{const E=d+l,R=p.pos.top,B=p.bottom,K=B-R>=d;R<l?Nu(n,p,d,w!==!1,i):R>E?Nu(n,p,d,K?w!==!1:w===!0,i):B>E&&!K&&Nu(n,p,d,w===!0,i)},Dw=(n,i,l,d,p)=>{const w=Wr(i).dom.innerHeight;Fb(n,i,l,w,d,p)},eS=(n,i,l,d,p)=>{const w=Wr(i).dom.innerHeight;Fb(n,i,l,w,d,p);const E=wt(d.element),R=Zf(window);E.top<R.y?G0(d.element,p!==!1):E.top>R.bottom&&G0(d.element,p===!0)},tS=(n,i,l)=>as(n,Dw,i,l),wi=(n,i,l)=>Dl(n,i,Dw,l),Pu=(n,i,l)=>as(n,eS,i,l),lf=(n,i,l)=>Dl(n,i,eS,l),mm=(n,i,l)=>{(n.inline?wi:lf)(n,i,l)},cf=(n,i,l)=>{(n.inline?tS:Pu)(n,i,l)},Hb=n=>n.dom.focus(),Iu=n=>{const i=jl(n).dom;return n.dom===i.activeElement},Ow=(n=Z())=>he.from(n.dom.activeElement).map(Ke.fromDom),Mw=n=>Ow(jl(n)).filter(i=>n.dom.contains(i.dom)),hg=(n,i)=>{const l=Qa(i)?Ic(i).length:Aa(i).length+1;return n>l?l:n<0?0:n},dc=n=>r1.range(n.start,hg(n.soffset,n.start),n.finish,hg(n.foffset,n.finish)),XE=(n,i)=>!_d(i.dom)&&(ln(n,i)||pt(n,i)),I3=n=>i=>XE(n,i.start)&&XE(n,i.finish),B3=n=>n.inline||Kn.browser.isFirefox(),L3=n=>r1.range(Ke.fromDom(n.startContainer),n.startOffset,Ke.fromDom(n.endContainer),n.endOffset),lM=n=>{const i=n.getSelection();return(!i||i.rangeCount===0?he.none():he.from(i.getRangeAt(0))).map(L3)},JE=n=>{const i=Wr(n);return lM(i.dom).filter(I3(n))},cM=(n,i)=>he.from(i).filter(I3(n)).map(dc),Rw=n=>{const i=document.createRange();try{return i.setStart(n.start.dom,n.soffset),i.setEnd(n.finish.dom,n.foffset),he.some(i)}catch{return he.none()}},uM=n=>{const i=B3(n)?JE(Ke.fromDom(n.getBody())):he.none();n.bookmark=i.isSome()?i:n.bookmark},F3=n=>(n.bookmark?n.bookmark:he.none()).bind(l=>cM(Ke.fromDom(n.getBody()),l)).bind(Rw),xI=n=>{F3(n).each(i=>n.selection.setRng(i))},AI={isEditorUIElement:n=>{const i=n.className.toString();return i.indexOf("tox-")!==-1||i.indexOf("mce-")!==-1}},bU=(n,i)=>(tt(i)||(i=0),setTimeout(n,i)),dM=(n,i)=>(tt(i)||(i=0),setInterval(n,i)),mg={setEditorTimeout:(n,i,l)=>bU(()=>{n.removed||i()},l),setEditorInterval:(n,i,l)=>{const d=dM(()=>{n.removed?clearInterval(d):i()},l);return d}},TI=n=>n.type==="nodechange"&&n.selectionChange,DI=(n,i)=>{const l=()=>{i.throttle()};Lr.DOM.bind(document,"mouseup",l),n.on("remove",()=>{Lr.DOM.unbind(document,"mouseup",l)})},OI=(n,i)=>{n.on("mouseup touchend",l=>{i.throttle()})},vU=(n,i)=>{OI(n,i),n.on("keyup NodeChange AfterSetSelectionRange",l=>{TI(l)||uM(n)})},yU=n=>{const i=hb(()=>{uM(n)},0);n.on("init",()=>{n.inline&&DI(n,i),vU(n,i)}),n.on("remove",()=>{i.cancel()})};let nS;const hM=Lr.DOM,H3=n=>Xn(n)&&AI.isEditorUIElement(n),$3=n=>{const i=n.classList;return i!==void 0?i.contains("tox-edit-area")||i.contains("tox-edit-area__iframe")||i.contains("mce-content-body"):!1},QE=(n,i)=>{const l=pC(n);return hM.getParent(i,p=>H3(p)||(l?n.dom.is(p,l):!1))!==null},z3=n=>{try{const i=jl(Ke.fromDom(n.getElement()));return Ow(i).fold(()=>document.body,l=>l.dom)}catch{return document.body}},MI=(n,i)=>{const l=i.editor;yU(l);const d=(p,w)=>{if(TC(p)&&p.inline!==!0){const E=Ke.fromDom(p.getContainer());w(E,"tox-edit-focus")}};l.on("focusin",()=>{const p=n.focusedEditor;$3(z3(l))&&d(l,Wu),p!==l&&(p&&p.dispatch("blur",{focusedEditor:l}),n.setActive(l),n.focusedEditor=l,l.dispatch("focus",{blurredEditor:p}),l.focus(!0))}),l.on("focusout",()=>{mg.setEditorTimeout(l,()=>{const p=n.focusedEditor;(!$3(z3(l))||p!==l)&&d(l,Nc),!QE(l,z3(l))&&p===l&&(l.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})}),nS||(nS=p=>{const w=n.activeEditor;w&&Zh(p).each(E=>{const R=E;R.ownerDocument===document&&R!==document.body&&!QE(w,R)&&n.focusedEditor===w&&(w.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})},hM.bind(document,"focusin",nS))},wU=(n,i)=>{n.focusedEditor===i.editor&&(n.focusedEditor=null),!n.activeEditor&&nS&&(hM.unbind(document,"focusin",nS),nS=null)},_U=n=>{n.on("AddEditor",He(MI,n)),n.on("RemoveEditor",He(wU,n))},CU=(n,i)=>n.dom.getParent(i,l=>n.dom.getContentEditable(l)==="true"),SU=n=>n.collapsed?he.from(Jf(n.startContainer,n.startOffset)).map(Ke.fromDom):he.none(),kU=(n,i)=>SU(i).bind(l=>Za(l)?he.some(l):ln(n,l)?he.none():he.some(n)),RI=(n,i)=>{kU(Ke.fromDom(n.getBody()),i).bind(l=>sl(l.dom)).fold(()=>{n.selection.normalize()},l=>n.selection.setRng(l.toRange()))},mM=n=>{if(n.setActive)try{n.setActive()}catch{n.focus()}else n.focus()},EU=n=>Iu(n)||Mw(n).isSome(),xU=n=>_e(n.iframeElement)&&Iu(Ke.fromDom(n.iframeElement)),AU=n=>{const i=n.getBody();return i&&EU(Ke.fromDom(i))},TU=n=>{const i=jl(Ke.fromDom(n.getElement()));return Ow(i).filter(l=>!$3(l.dom)&&QE(n,l.dom)).isSome()},Nw=n=>n.inline?AU(n):xU(n),V3=n=>Nw(n)||TU(n),NI=n=>{const i=n.selection,l=n.getBody();let d=i.getRng();n.quirks.refreshContentEditable(),_e(n.bookmark)&&!Nw(n)&&F3(n).each(w=>{n.selection.setRng(w),d=w});const p=CU(n,i.getNode());if(p&&n.dom.isChildOf(p,l)){mM(p),RI(n,d),U3(n);return}n.inline||(Kn.browser.isOpera()||mM(l),n.getWin().focus()),(Kn.browser.isFirefox()||n.inline)&&(mM(l),RI(n,d)),U3(n)},U3=n=>n.editorManager.setActive(n),DU=(n,i)=>{n.removed||(i?U3(n):NI(n))},PI=(n,i,l,d,p)=>{const w=l?i.startContainer:i.endContainer,E=l?i.startOffset:i.endOffset;return he.from(w).map(Ke.fromDom).map(R=>!d||!i.collapsed?ju(R,p(R,E)).getOr(R):R).bind(R=>_l(R)?he.some(R):ai(R).filter(_l)).map(R=>R.dom).getOr(n)},II=(n,i,l=!1)=>PI(n,i,!0,l,(d,p)=>Math.min(ic(d),p)),BI=(n,i,l=!1)=>PI(n,i,!1,l,(d,p)=>p>0?p-1:p),LI=(n,i)=>{const l=n;for(;n&&_n(n)&&n.length===0;)n=i?n.nextSibling:n.previousSibling;return n||l},OU=(n,i)=>{if(!i)return n;let l=i.startContainer,d=i.endContainer;const p=i.startOffset,w=i.endOffset;let E=i.commonAncestorContainer;i.collapsed||(l===d&&w-p<2&&l.hasChildNodes()&&(E=l.childNodes[p]),_n(l)&&_n(d)&&(l.length===p?l=LI(l.nextSibling,!0):l=l.parentNode,w===0?d=LI(d.previousSibling,!1):d=d.parentNode,l&&l===d&&(E=l)));const R=_n(E)?E.parentNode:E;return Xn(R)?R:n},FI=(n,i,l,d)=>{const p=[],w=n.getRoot(),E=n.getParent(l||II(w,i,i.collapsed),n.isBlock),R=n.getParent(d||BI(w,i,i.collapsed),n.isBlock);if(E&&E!==w&&p.push(E),E&&R&&E!==R){let B;const K=new pi(E,w);for(;(B=K.next())&&B!==R;)n.isBlock(B)&&p.push(B)}return R&&E!==R&&R!==w&&p.push(R),p},MU=(n,i,l)=>he.from(i).bind(d=>he.from(d.parentNode).map(p=>{const w=n.nodeIndex(d),E=n.createRng();return E.setStart(p,w),E.setEnd(p,w+1),l&&(ME(n,E,d,!0),ME(n,E,d,!1)),E})),W3=(n,i)=>Et(i,l=>{const d=n.dispatch("GetSelectionRange",{range:l});return d.range!==l?d.range:l}),HI=n=>Xr(n)==="img"?1:qf(n).fold(()=>Aa(n).length,i=>i.length),RU=n=>qf(n).filter(i=>i.trim().length!==0||i.indexOf(Gr)>-1).isSome(),NU=n=>xi(n)&&Pl(n,"contenteditable")==="false",PU=["img","br"],$I=n=>RU(n)||Ct(PU,Xr(n))||NU(n),IU=n=>le(n,$I),BU=n=>LU(n,$I),LU=(n,i)=>{const l=d=>{const p=Aa(d);for(let w=p.length-1;w>=0;w--){const E=p[w];if(i(E))return he.some(E);const R=l(E);if(R.isSome())return R}return he.none()};return l(n)},zI="[data-mce-autocompleter]",FU=(n,i)=>{if(VI(Ke.fromDom(n.getBody())).isNone()){const l=Ke.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',n.getDoc());Qi(l,Ke.fromDom(i.extractContents())),i.insertNode(l.dom),ai(l).each(d=>d.dom.normalize()),BU(l).map(d=>{n.selection.setCursorLocation(d.dom,HI(d))})}},HU=n=>rt(n,zI),VI=n=>Ye(n,zI),$U=(n,i)=>VI(i).each(l=>{const d=n.selection.getBookmark();ql(l),n.selection.moveToBookmark(d)}),zU={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},j3=(n,i,l)=>{const d=l?"lastChild":"firstChild",p=l?"prev":"next";if(n[d])return n[d];if(n!==i){let w=n[p];if(w)return w;for(let E=n.parent;E&&E!==i;E=E.parent)if(w=E[p],w)return w}},VU=n=>{var i;const l=(i=n.value)!==null&&i!==void 0?i:"";if(!Zm(l))return!1;const d=n.parent;return!(d&&(d.name!=="span"||d.attr("style"))&&/^[ ]+$/.test(l))},UI=n=>{const i=n.name==="a"&&!n.attr("href")&&n.attr("id");return n.attr("name")||n.attr("id")&&!n.firstChild||n.attr("data-mce-bookmark")||i};class Hd{static create(i,l){const d=new Hd(i,zU[i]||1);return l&&an(l,(p,w)=>{d.attr(w,p)}),d}constructor(i,l){this.name=i,this.type=l,l===1&&(this.attributes=[],this.attributes.map={})}replace(i){const l=this;return i.parent&&i.remove(),l.insert(i,l),l.remove(),l}attr(i,l){const d=this;if(!F(i))return _e(i)&&an(i,(w,E)=>{d.attr(E,w)}),d;const p=d.attributes;if(p){if(l!==void 0){if(l===null){if(i in p.map){delete p.map[i];let w=p.length;for(;w--;)if(p[w].name===i)return p.splice(w,1),d}return d}if(i in p.map){let w=p.length;for(;w--;)if(p[w].name===i){p[w].value=l;break}}else p.push({name:i,value:l});return p.map[i]=l,d}return p.map[i]}}clone(){const i=this,l=new Hd(i.name,i.type),d=i.attributes;if(d){const p=[];p.map={};for(let w=0,E=d.length;w<E;w++){const R=d[w];R.name!=="id"&&(p[p.length]={name:R.name,value:R.value},p.map[R.name]=R.value)}l.attributes=p}return l.value=i.value,l}wrap(i){const l=this;return l.parent&&(l.parent.insert(i,l),i.append(l)),l}unwrap(){const i=this;for(let l=i.firstChild;l;){const d=l.next;i.insert(l,i,!0),l=d}i.remove()}remove(){const i=this,l=i.parent,d=i.next,p=i.prev;return l&&(l.firstChild===i?(l.firstChild=d,d&&(d.prev=null)):p&&(p.next=d),l.lastChild===i?(l.lastChild=p,p&&(p.next=null)):d&&(d.prev=p),i.parent=i.next=i.prev=null),i}append(i){const l=this;i.parent&&i.remove();const d=l.lastChild;return d?(d.next=i,i.prev=d,l.lastChild=i):l.lastChild=l.firstChild=i,i.parent=l,i}insert(i,l,d){i.parent&&i.remove();const p=l.parent||this;return d?(l===p.firstChild?p.firstChild=i:l.prev&&(l.prev.next=i),i.prev=l.prev,i.next=l,l.prev=i):(l===p.lastChild?p.lastChild=i:l.next&&(l.next.prev=i),i.next=l.next,i.prev=l,l.next=i),i.parent=p,i}getAll(i){const l=this,d=[];for(let p=l.firstChild;p;p=j3(p,l))p.name===i&&d.push(p);return d}children(){const i=this,l=[];for(let d=i.firstChild;d;d=d.next)l.push(d);return l}empty(){const i=this;if(i.firstChild){const l=[];for(let p=i.firstChild;p;p=j3(p,i))l.push(p);let d=l.length;for(;d--;){const p=l[d];p.parent=p.firstChild=p.lastChild=p.next=p.prev=null}}return i.firstChild=i.lastChild=null,i}isEmpty(i,l={},d){var p;const w=this;let E=w.firstChild;if(UI(w))return!1;if(E)do{if(E.type===1){if(E.attr("data-mce-bogus"))continue;if(i[E.name]||UI(E))return!1}if(E.type===8||E.type===3&&!VU(E)||E.type===3&&E.parent&&l[E.parent.name]&&Zm((p=E.value)!==null&&p!==void 0?p:"")||d&&d(E))return!1}while(E=j3(E,w));return!0}walk(i){return j3(this,null,i)}}const UU=(n,i)=>/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(n.substr(i)),WI=(n,i,l=0)=>{const d=n.toLowerCase();if(d.indexOf("[if ",l)!==-1&&UU(d,l)){const p=d.indexOf("[endif]",l);return d.indexOf(">",p)}else if(i){const p=d.indexOf(">",l);return p!==-1?p:d.length}else{const p=/--!?>/g;p.lastIndex=l;const w=p.exec(n);return w?w.index+w[0].length:d.length}},Po=(n,i,l)=>{const d=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,p=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,w=n.getVoidElements();let E=1,R=l;for(;E!==0;)for(d.lastIndex=R;;){const B=d.exec(i);if(B===null)return R;if(B[1]==="!"){xr(B[2],"--")?R=WI(i,!1,B.index+3):R=WI(i,!0,B.index+1);break}else{p.lastIndex=d.lastIndex;const K=p.exec(i);if(J(K)||K.index!==d.lastIndex)continue;B[1]==="/"?E-=1:cn(w,B[2])||(E+=1),R=d.lastIndex+K[0].length;break}}return R},jI=(n,i)=>{const l=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi");return i.replace(l,"")},gM=(n,i)=>{const l=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=n.schema;let p=jI(n.getTempAttrs(),i);const w=d.getVoidElements();let E;for(;E=l.exec(p);){const R=l.lastIndex,B=E[0].length;let K;w[E[1]]?K=R:K=Po(d,p,R),p=p.substring(0,R-B)+p.substring(K),l.lastIndex=R-B}return Bn(p)},WU=gM,Z3=n=>{const i=dl(n,"[data-mce-bogus]");Pe(i,l=>{Pl(l,"data-mce-bogus")==="all"?pr(l):Xc(l)?(wa(l,Ke.fromText(Qt)),pr(l)):ql(l)})},ZI=n=>{const i=dl(n,"input");Pe(i,l=>{Hi(l,"name")})},jU=(n,i)=>{const l=Hc(n),d=new RegExp(`^(<${l}[^>]*>(&nbsp;|&#160;|\\s|\xA0|<br \\/>|)<\\/${l}>[\r
]*|<br \\/>[\r
]*)$`);return i.replace(d,"")},ZU=(n,i)=>{const l=n.getDoc(),d=jl(Ke.fromDom(n.getBody())),p=Ke.fromTag("div",l);Tr(p,"data-mce-bogus","all"),ra(p,{position:"fixed",left:"-9999999px",top:"0"}),Cf(p,i.innerHTML),Z3(p),ZI(p);const w=H1(d);Qi(w,p);const E=Bn(p.dom.innerText);return pr(p),E},qU=(n,i,l)=>{let d;return i.format==="raw"?d=hn.trim(WU(n.serializer,l.innerHTML)):i.format==="text"?d=ZU(n,l):i.format==="tree"?d=n.serializer.serialize(l,i):d=jU(n,n.serializer.serialize(l,i)),i.format!=="text"&&!Jc(Ke.fromDom(l))&&F(d)?hn.trim(d):d},GU=(n,i)=>he.from(n.getBody()).fold(nt(i.format==="tree"?new Hd("body",11):""),l=>qU(n,i,l)),ex=hn.makeMap,pM=n=>{const i=[];n=n||{};const l=n.indent,d=ex(n.indent_before||""),p=ex(n.indent_after||""),w=Yg.getEncodeFunc(n.entity_encoding||"raw",n.entities),E=n.element_format!=="xhtml";return{start:(R,B,K)=>{if(l&&d[R]&&i.length>0){const ie=i[i.length-1];ie.length>0&&ie!==`
`&&i.push(`
`)}if(i.push("<",R),B)for(let ie=0,ue=B.length;ie<ue;ie++){const pe=B[ie];i.push(" ",pe.name,'="',w(pe.value,!0),'"')}if(!K||E?i[i.length]=">":i[i.length]=" />",K&&l&&p[R]&&i.length>0){const ie=i[i.length-1];ie.length>0&&ie!==`
`&&i.push(`
`)}},end:R=>{let B;i.push("</",R,">"),l&&p[R]&&i.length>0&&(B=i[i.length-1],B.length>0&&B!==`
`&&i.push(`
`))},text:(R,B)=>{R.length>0&&(i[i.length]=B?R:w(R))},cdata:R=>{i.push("<![CDATA[",R,"]]>")},comment:R=>{i.push("<!--",R,"-->")},pi:(R,B)=>{B?i.push("<?",R," ",w(B),"?>"):i.push("<?",R,"?>"),l&&i.push(`
`)},doctype:R=>{i.push("<!DOCTYPE",R,">",l?`
`:"")},reset:()=>{i.length=0},getContent:()=>i.join("").replace(/\n$/,"")}},Pw=(n={},i=dh())=>{const l=pM(n);return n.validate="validate"in n?n.validate:!0,{serialize:p=>{const w=n.validate,E={3:B=>{var K;l.text((K=B.value)!==null&&K!==void 0?K:"",B.raw)},8:B=>{var K;l.comment((K=B.value)!==null&&K!==void 0?K:"")},7:B=>{l.pi(B.name,B.value)},10:B=>{var K;l.doctype((K=B.value)!==null&&K!==void 0?K:"")},4:B=>{var K;l.cdata((K=B.value)!==null&&K!==void 0?K:"")},11:B=>{let K=B;if(K=K.firstChild)do R(K);while(K=K.next)}};l.reset();const R=B=>{var K;const ie=E[B.type];if(ie)ie(B);else{const ue=B.name,pe=ue in i.getVoidElements();let Be=B.attributes;if(w&&Be&&Be.length>1){const Ze=[];Ze.map={};const Oe=i.getElementRule(B.name);if(Oe){for(let ze=0,ht=Oe.attributesOrder.length;ze<ht;ze++){const bt=Oe.attributesOrder[ze];if(bt in Be.map){const vt=Be.map[bt];Ze.map[bt]=vt,Ze.push({name:bt,value:vt})}}for(let ze=0,ht=Be.length;ze<ht;ze++){const bt=Be[ze].name;if(!(bt in Ze.map)){const vt=Be.map[bt];Ze.map[bt]=vt,Ze.push({name:bt,value:vt})}}Be=Ze}}if(l.start(ue,Be,pe),!pe){let Ze=B.firstChild;if(Ze){(ue==="pre"||ue==="textarea")&&Ze.type===3&&((K=Ze.value)===null||K===void 0?void 0:K[0])===`
`&&l.text(`
`,!0);do R(Ze);while(Ze=Ze.next)}l.end(ue)}}};return p.type===1&&!n.inner?R(p):p.type===3?E[3](p):E[11](p),l.getContent()}}},qI=new Set;Pe(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],i=>{qI.add(i)});const ms=["font","text-decoration","text-emphasis"],bM=(n,i)=>gs(n.parseStyle(n.getAttrib(i,"style"))),ks=n=>qI.has(n),GI=(n,i)=>Js(bM(n,i),l=>!ks(l)),Tse=n=>yt(n,i=>Jt(ms,l=>xr(i,l))),Dse=(n,i,l)=>{const d=bM(n,i),p=bM(n,l),w=E=>{var R,B;const K=(R=n.getStyle(i,E))!==null&&R!==void 0?R:"",ie=(B=n.getStyle(l,E))!==null&&B!==void 0?B:"";return gr(K)&&gr(ie)&&K!==ie};return Jt(d,E=>{const R=B=>Jt(B,K=>K===E);if(!R(p)&&R(ms)){const B=Tse(p);return Jt(B,w)}else return w(E)})},KI=(n,i,l)=>he.from(l.container()).filter(_n).exists(d=>{const p=n?0:-1;return i(d.data.charAt(l.offset()+p))}),YI=He(KI,!0,_h),XI=He(KI,!1,_h),KU=n=>{const i=n.container();return _n(i)&&(i.data.length===0||Cn(i.data)&&uy.isBookmarkNode(i.parentNode))},py=(n,i)=>l=>d0(n?0:-1,l).filter(i).isSome(),Qo=n=>zi(n)&&Mi(Ke.fromDom(n),"display")==="block",JI=n=>xs(n)&&!hl(n),YU=py(!0,Qo),XU=py(!1,Qo),$b=py(!0,Gu),oS=py(!1,Gu),QI=py(!0,Eu),eB=py(!1,Eu),by=py(!0,JI),zb=py(!1,JI),JU=n=>n.slice(0,-1),Ose=(n,i,l)=>ln(i,n)?JU(Gd(n,d=>l(d)||pt(d,i))):[],QU=(n,i)=>Ose(n,i,We),Vb=(n,i)=>[n].concat(QU(n,i)),vM=(n,i,l)=>vE(n,i,l,KU),tB=(n,i)=>Jn(Vb(Ke.fromDom(i.container()),n),ac),nB=(n,i,l)=>vM(n,i.dom,l).forall(d=>tB(i,l).fold(()=>!Nd(d,l,i.dom),p=>!Nd(d,l,i.dom)&&ln(p,Ke.fromDom(d.container())))),yM=(n,i,l)=>tB(i,l).fold(()=>vM(n,i.dom,l).forall(d=>!Nd(d,l,i.dom)),d=>vM(n,d.dom,l).isNone()),wM=He(yM,!1),Ms=He(yM,!0),oB=He(nB,!1),q3=He(nB,!0),sB=n=>Ve(n).exists(Xc),tx=(n,i,l)=>{const d=yt(Vb(Ke.fromDom(l.container()),i),ac),p=No(d).getOr(i);return Pd(n,p.dom,l).filter(sB)},G3=(n,i)=>Ve(i).exists(Xc)||tx(!0,n,i).isSome(),K3=(n,i)=>dt(i).exists(Xc)||tx(!1,n,i).isSome(),rB=He(tx,!1),eW=He(tx,!0),_M=n=>Vt.isTextPosition(n)&&!n.isAtStart()&&!n.isAtEnd(),iB=(n,i)=>{const l=yt(Vb(Ke.fromDom(i.container()),n),ac);return No(l).getOr(n)},aB=(n,i)=>_M(i)?XI(i):XI(i)||Mu(iB(n,i).dom,i).exists(XI),lB=(n,i)=>_M(i)?YI(i):YI(i)||Rf(iB(n,i).dom,i).exists(YI),tW=n=>Ct(["pre","pre-wrap"],n),CM=n=>Ve(n).bind(i=>Bl(i,_l)).exists(i=>tW(Mi(i,"white-space"))),nW=(n,i)=>Mu(n.dom,i).isNone(),oW=(n,i)=>Rf(n.dom,i).isNone(),sW=(n,i)=>nW(n,i)||oW(n,i)||wM(n,i)||Ms(n,i)||K3(n,i)||G3(n,i),SM=n=>_e(n)&&xs(n)&&RC(n),Y3=(n,i)=>l=>SM(new pi(l,n)[i]()),rW=(n,i)=>{const l=Rf(n.dom,i).getOr(i),d=Y3(n.dom,"next");return i.isAtEnd()&&(d(i.container())||d(l.container()))},iW=(n,i)=>{const l=Mu(n.dom,i).getOr(i),d=Y3(n.dom,"prev");return i.isAtStart()&&(d(i.container())||d(l.container()))},cB=(n,i)=>CM(i)?!1:sW(n,i)||aB(n,i)||lB(n,i),nx=(n,i)=>CM(i)?!1:wM(n,i)||oB(n,i)||K3(n,i)||aB(n,i)||iW(n,i),aW=n=>{const i=n.container(),l=n.offset();return _n(i)&&l<i.data.length?Vt(i,l+1):n},ox=(n,i)=>CM(i)?!1:Ms(n,i)||q3(n,i)||G3(n,i)||lB(n,i)||rW(n,i),kM=(n,i)=>nx(n,i)||ox(n,aW(i)),uB=(n,i)=>Ks(n.charAt(i)),EM=(n,i)=>_h(n.charAt(i)),lW=n=>{const i=n.container();return _n(i)&&Qs(i.data,Gr)},cW=n=>{const i=n.split("");return Et(i,(l,d)=>Ks(l)&&d>0&&d<i.length-1&&p0(i[d-1])&&p0(i[d+1])?" ":l).join("")},vy=(n,i,l)=>{const d=i.data,p=Vt(i,0);return!l&&uB(d,0)&&!kM(n,p)?(i.data=" "+d.slice(1),!0):l&&EM(d,0)&&nx(n,p)?(i.data=Gr+d.slice(1),!0):!1},uW=n=>{const i=n.data,l=cW(i);return l!==i?(n.data=l,!0):!1},xM=(n,i,l)=>{const d=i.data,p=Vt(i,d.length-1);return!l&&uB(d,d.length-1)&&!kM(n,p)?(i.data=d.slice(0,-1)+" ",!0):l&&EM(d,d.length-1)&&ox(n,p)?(i.data=d.slice(0,-1)+Gr,!0):!1},fW=(n,i)=>{const l=i.container();if(!_n(l))return he.none();if(lW(i)){const d=vy(n,l,!1)||uW(l)||xM(n,l,!1);return Ss(d,i)}else if(kM(n,i)){const d=vy(n,l,!0)||xM(n,l,!0);return Ss(d,i)}else return he.none()},dW=n=>{const i=Ke.fromDom(n.getBody());n.selection.isCollapsed()&&fW(i,Vt.fromRangeStart(n.selection.getRng())).each(l=>{n.selection.setRng(l.toRange())})},AM=(n,i,l)=>{if(l===0)return;const d=Ke.fromDom(n),p=li(d,ac).getOr(d),w=n.data.slice(i,i+l),E=i+l>=n.data.length&&ox(p,Vt(n,n.data.length)),R=i===0&&nx(p,Vt(n,0));n.replaceData(i,l,rh(w,4,R,E))},sx=(n,i)=>{const l=n.data.slice(i),d=l.length-Zc(l).length;AM(n,i,d)},X3=(n,i)=>{const l=n.data.slice(0,i),d=l.length-gu(l).length;AM(n,i-d,d)},J3=(n,i,l,d=!0)=>{const p=gu(n.data).length,w=d?n:i,E=d?i:n;return d?w.appendData(E.data):w.insertData(0,E.data),pr(Ke.fromDom(E)),l&&sx(w,p),w},sd=(n,i)=>{const l=n.container(),d=n.offset();return!Vt.isTextPosition(n)&&l===i.parentNode&&d>Vt.before(i).offset()},hW=(n,i)=>sd(i,n)?Vt(i.container(),i.offset()-1):i,mW=n=>_n(n)?Vt(n,0):Vt.before(n),gW=n=>_n(n)?Vt(n,n.data.length):Vt.after(n),fB=n=>Sl(n.previousSibling)?he.some(gW(n.previousSibling)):n.previousSibling?Id(n.previousSibling):he.none(),dB=n=>Sl(n.nextSibling)?he.some(mW(n.nextSibling)):n.nextSibling?sl(n.nextSibling):he.none(),Iw=(n,i)=>he.from(i.previousSibling?i.previousSibling:i.parentNode).bind(l=>Mu(n,Vt.before(l))).orThunk(()=>Rf(n,Vt.after(i))),pW=(n,i)=>Rf(n,Vt.after(i)).orThunk(()=>Mu(n,Vt.before(i))),bW=(n,i)=>fB(i).orThunk(()=>dB(i)).orThunk(()=>Iw(n,i)),Pa=(n,i)=>dB(i).orThunk(()=>fB(i)).orThunk(()=>pW(n,i)),Q3=(n,i,l)=>n?Pa(i,l):bW(i,l),Mse=(n,i,l)=>Q3(n,i,l).map(He(hW,l)),Uc=(n,i,l)=>{l.fold(()=>{n.focus()},d=>{n.selection.setRng(d.toRange(),i)})},Qr=n=>i=>i.dom===n,gm=(n,i)=>i&&cn(n.schema.getBlockElements(),Xr(i)),vW=n=>{if(Ma(n)){const i=Ke.fromHtml('<br data-mce-bogus="1">');return wd(n),Qi(n,i),he.some(Vt.before(i.dom))}else return he.none()},hB=(n,i,l)=>{const d=ya(n).filter(Qa),p=vd(n).filter(Qa);return pr(n),vf(d,p,i,(w,E,R)=>{const B=w.dom,K=E.dom,ie=B.data.length;return J3(B,K,l),R.container()===K?Vt(B,ie):R}).orThunk(()=>(l&&(d.each(w=>X3(w.dom,w.dom.length)),p.each(w=>sx(w.dom,0))),i))},TM=(n,i)=>cn(n.schema.getTextInlineElements(),Xr(i)),Ub=(n,i,l,d=!0)=>{const p=Mse(i,n.getBody(),l.dom),w=li(l,He(gm,n),Qr(n.getBody())),E=hB(l,p,TM(n,l));n.dom.isEmpty(n.getBody())?(n.setContent(""),n.selection.setCursorLocation()):w.bind(vW).fold(()=>{d&&Uc(n,i,E)},R=>{d&&Uc(n,i,he.some(R))})},mB=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,gB=n=>mB.test(n),Bw=(n,i)=>wu(Ke.fromDom(i),Ui(n))&&!Jm(n.schema,i)&&n.dom.isEditable(i),pB=n=>{var i;return Lr.DOM.getStyle(n,"direction",!0)==="rtl"||gB((i=n.textContent)!==null&&i!==void 0?i:"")},DM=(n,i,l)=>yt(Lr.DOM.getParents(l.container(),"*",i),n),Wb=(n,i,l)=>{const d=DM(n,i,l);return he.from(d[d.length-1])},gp=(n,i,l)=>{const d=am(i,n),p=am(l,n);return _e(d)&&d===p},yW=n=>Ku(n)||Ef(n),gg=(n,i)=>{const l=i.container(),d=i.offset();return n?tr(l)?_n(l.nextSibling)?Vt(l.nextSibling,0):Vt.after(l):Ku(i)?Vt(l,d+1):i:tr(l)?_n(l.previousSibling)?Vt(l.previousSibling,l.previousSibling.data.length):Vt.before(l):Ef(i)?Vt(l,d-1):i},wW=He(gg,!0),eT=He(gg,!1),bB=(n,i)=>{const l=d=>d.stopImmediatePropagation();n.on("beforeinput input",l,!0),n.getDoc().execCommand(i),n.off("beforeinput input",l)},rx=n=>{n.execCommand("delete")},OM=n=>bB(n,"Delete"),sS=n=>bB(n,"ForwardDelete"),pg=n=>i=>qr(ai(i),n,pt),ix=n=>lc(n)||ja(n),_i=(n,i)=>ln(n,i)?Bl(i,ix,pg(n)):he.none(),Lw=(n,i=!0)=>{n.dom.isEmpty(n.getBody())&&n.setContent("",{no_selection:!i})},MM=(n,i,l)=>ni(sl(l),Id(l),(d,p)=>{const w=gg(!0,d),E=gg(!1,p),R=gg(!1,i);return n?Rf(l,R).exists(B=>B.isEqual(E)&&i.isEqual(w)):Mu(l,R).exists(B=>B.isEqual(w)&&i.isEqual(E))}).getOr(!0),RM=n=>(U0(n)?ya(n):_u(n)).bind(RM).orThunk(()=>he.some(n)),tT=(n,i,l,d=!0)=>{var p;i.deleteContents();const w=RM(l).getOr(l),E=Ke.fromDom((p=n.dom.getParent(w.dom,n.dom.isBlock))!==null&&p!==void 0?p:l.dom);if(E.dom===n.getBody()?Lw(n,d):Ma(E)&&(Te(E),d&&n.selection.setCursorLocation(E.dom,0)),!pt(l,E)){const R=qr(ai(E),l)?[]:W0(E);Pe(R.concat(Aa(l)),B=>{!pt(B,E)&&!ln(B,E)&&Ma(B)&&pr(B)})}},NM=n=>i=>pt(n,i),ax=n=>dl(n,"td,th"),PM=(n,i)=>{const l=K=>up(Ke.fromDom(K),i),d=l(n.startContainer),p=l(n.endContainer),w=d.isSome(),E=p.isSome(),R=ni(d,p,pt).getOr(!1);return{startTable:d,endTable:p,isStartInTable:w,isEndInTable:E,isSameTable:R,isMultiTable:!R&&w&&E}},rS=(n,i)=>({start:n,end:i}),IM=(n,i,l)=>({rng:n,table:i,cells:l}),iS=lg.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),lx=(n,i)=>rt(Ke.fromDom(n),"td,th",i),BM=n=>!pt(n.start,n.end),LM=(n,i)=>up(n.start,i).bind(l=>up(n.end,i).bind(d=>Ss(pt(l,d),l))),vB=(n,i)=>!BM(n)&&LM(n,i).exists(l=>{const d=l.dom.rows;return d.length===1&&d[0].cells.length===1}),aS=(n,i)=>{const l=lx(n.startContainer,i),d=lx(n.endContainer,i);return ni(l,d,rS)},yB=n=>i=>up(i,n).bind(l=>Mo(ax(l)).map(d=>rS(i,d))),FM=n=>i=>up(i,n).bind(l=>No(ax(l)).map(d=>rS(d,i))),HM=n=>i=>LM(i,n).map(l=>IM(i,l,ax(l))),wB=(n,i,l,d)=>{if(l.collapsed||!n.forall(BM))return he.none();if(i.isSameTable){const p=n.bind(HM(d));return he.some({start:p,end:p})}else{const p=lx(l.startContainer,d),w=lx(l.endContainer,d),E=p.bind(yB(d)).bind(HM(d)),R=w.bind(FM(d)).bind(HM(d));return he.some({start:E,end:R})}},$M=(n,i)=>ds(n,l=>pt(l,i)),nT=n=>ni($M(n.cells,n.rng.start),$M(n.cells,n.rng.end),(i,l)=>n.cells.slice(i,l+1)),_B=(n,i,l)=>n.exists(d=>vB(d,l)&&cy(d.start,i)),cx=(n,i)=>{const{startTable:l,endTable:d}=i,p=n.cloneRange();return l.each(w=>p.setStartAfter(w.dom)),d.each(w=>p.setEndBefore(w.dom)),p},CB=(n,i,l,d)=>wB(n,i,l,d).bind(({start:p,end:w})=>p.or(w)).bind(p=>{const{isSameTable:w}=i,E=nT(p).getOr([]);if(w&&p.cells.length===E.length)return he.some(iS.fullTable(p.table));if(E.length>0){if(w)return he.some(iS.partialTable(E,he.none()));{const R=cx(l,i);return he.some(iS.partialTable(E,he.some({...i,rng:R})))}}else return he.none()}),SB=(n,i,l,d)=>wB(n,i,l,d).bind(({start:p,end:w})=>{const E=p.bind(nT).getOr([]),R=w.bind(nT).getOr([]);if(E.length>0&&R.length>0){const B=cx(l,i);return he.some(iS.multiTable(E,R,B))}else return he.none()}),kB=(n,i)=>{const l=NM(n),d=aS(i,l),p=PM(i,l);return _B(d,i,l)?d.map(w=>iS.singleCellTable(i,w.start)):p.isMultiTable?SB(d,p,i,l):CB(d,p,i,l)},zM=n=>Pe(n,i=>{Hi(i,"contenteditable"),Te(i)}),EB=(n,i)=>he.from(n.dom.getParent(i,n.dom.isBlock)).map(Ke.fromDom),xB=(n,i,l)=>{l.each(d=>{i?pr(d):(Te(d),n.selection.setCursorLocation(d.dom,0))})},oT=(n,i,l,d)=>{const p=l.cloneRange();d?(p.setStart(l.startContainer,l.startOffset),p.setEndAfter(i.dom.lastChild)):(p.setStartBefore(i.dom.firstChild),p.setEnd(l.endContainer,l.endOffset)),ux(n,p,i,!1).each(w=>w())},VM=n=>{const i=b0(n),l=Ke.fromDom(n.selection.getNode());kd(l.dom)&&Ma(l)?n.selection.setCursorLocation(l.dom,0):n.selection.collapse(!0),i.length>1&&Jt(i,d=>pt(d,l))&&Tr(l,"data-mce-selected","1")},UM=(n,i,l)=>he.some(()=>{const d=n.selection.getRng(),p=l.bind(({rng:w,isStartInTable:E})=>{const R=EB(n,E?w.endContainer:w.startContainer);w.deleteContents(),xB(n,E,R.filter(Ma));const B=E?i[0]:i[i.length-1];return oT(n,B,d,E),Ma(B)?he.none():he.some(E?i.slice(1):i.slice(0,-1))}).getOr(i);zM(p),VM(n)}),AB=(n,i,l,d)=>he.some(()=>{const p=n.selection.getRng(),w=i[0],E=l[l.length-1];oT(n,w,p,!0),oT(n,E,p,!1);const R=Ma(w)?i:i.slice(1),B=Ma(E)?l:l.slice(0,-1);zM(R.concat(B)),d.deleteContents(),VM(n)}),ux=(n,i,l,d=!0)=>he.some(()=>{tT(n,i,l,d)}),TB=(n,i)=>he.some(()=>Ub(n,!1,i)),DB=(n,i,l)=>kB(i,l).bind(d=>d.fold(He(ux,n),He(TB,n),He(UM,n),He(AB,n))),OB=(n,i)=>fx(n,i),MB=(n,i,l,d)=>lS(i,d).fold(()=>DB(n,i,l),p=>OB(n,p)),RB=(n,i,l)=>{const d=Ke.fromDom(n.getBody()),p=n.selection.getRng();return l.length!==0?UM(n,l,he.none()):MB(n,d,p,i)},sT=(n,i)=>Jn(Vb(i,n),Vm),lS=(n,i)=>Jn(Vb(i,n),yc("caption")),NB=(n,i,l,d,p)=>m0(l,n.getBody(),p).bind(w=>sT(i,Ke.fromDom(w.getNode())).bind(E=>pt(E,d)?he.none():he.some(ft))),fx=(n,i)=>he.some(()=>{Te(i),n.selection.setCursorLocation(i.dom,0)}),rT=(n,i,l,d)=>sl(n.dom).bind(p=>Id(n.dom).map(w=>i?l.isEqual(p)&&d.isEqual(w):l.isEqual(w)&&d.isEqual(p))).getOr(!0),WM=(n,i)=>fx(n,i),dx=(n,i,l)=>lS(n,Ke.fromDom(l.getNode())).fold(()=>he.some(ft),d=>Ss(!pt(d,i),ft)),jM=(n,i,l,d,p)=>m0(l,n.getBody(),p).fold(()=>he.some(ft),w=>rT(d,l,p,w)?WM(n,d):dx(i,d,w)),PB=(n,i,l,d)=>{const p=Vt.fromRangeStart(n.selection.getRng());return sT(l,d).bind(w=>Ma(w)?fx(n,w):NB(n,l,i,w,p))},cS=(n,i,l,d)=>{const p=Vt.fromRangeStart(n.selection.getRng());return Ma(d)?fx(n,d):jM(n,l,i,d,p)},iT=(n,i)=>n?QI(i):eB(i),ZM=(n,i)=>{const l=Vt.fromRangeStart(n.selection.getRng());return iT(i,l)||Pd(i,n.getBody(),l).exists(d=>iT(i,d))},hx=(n,i,l)=>{const d=Ke.fromDom(n.getBody());return lS(d,l).fold(()=>PB(n,i,d,l).orThunk(()=>Ss(ZM(n,i),ft)),p=>cS(n,i,d,p))},y0=(n,i)=>{const l=Ke.fromDom(n.selection.getStart(!0)),d=b0(n);return n.selection.isCollapsed()&&d.length===0?hx(n,i,l):RB(n,l,d)},yy=(n,i)=>{let l=i;for(;l&&l!==n;){if(ha(l)||xs(l))return l;l=l.parentNode}return null},_W=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],IB=hn.each,aT=n=>{const i=n.dom,l=new Set(n.serializer.getTempAttrs()),d=(w,E)=>{if(w.nodeName!==E.nodeName||w.nodeType!==E.nodeType)return!1;const R=K=>{const ie={};return IB(i.getAttribs(K),ue=>{const pe=ue.nodeName.toLowerCase();pe!=="style"&&!p(pe)&&(ie[pe]=i.getAttrib(K,pe))}),ie},B=(K,ie)=>{for(const ue in K)if(cn(K,ue)){const pe=ie[ue];if(ye(pe)||K[ue]!==pe)return!1;delete ie[ue]}for(const ue in ie)if(cn(ie,ue))return!1;return!0};return Xn(w)&&Xn(E)&&(!B(R(w),R(E))||!B(i.parseStyle(i.getAttrib(w,"style")),i.parseStyle(i.getAttrib(E,"style"))))?!1:!Bd(w)&&!Bd(E)},p=w=>Jt(_W,E=>xr(w,E))||l.has(w);return{compare:d,isAttributeInternal:p}},CW=(n,i)=>{let l=n;for(;l=l.walk();)i(l)},SW=(n,i,l,d)=>{const p=l.name;for(let w=0,E=n.length;w<E;w++){const R=n[w];if(R.name===p){const B=d.nodes[p];B?B.nodes.push(l):d.nodes[p]={filter:R,nodes:[l]}}}if(l.attributes)for(let w=0,E=i.length;w<E;w++){const R=i[w],B=R.name;if(B in l.attributes.map){const K=d.attributes[B];K?K.nodes.push(l):d.attributes[B]={filter:R,nodes:[l]}}}},kW=(n,i,l)=>{const d={nodes:{},attributes:{}};return l.firstChild&&CW(l,p=>{SW(n,i,p,d)}),d},lT=(n,i)=>{const l=(d,p)=>{an(d,w=>{const E=Mr(w.nodes);Pe(w.filter.callbacks,R=>{for(let B=E.length-1;B>=0;B--){const K=E[B];(!(p?K.attr(w.filter.name)!==void 0:K.name===w.filter.name)||De(K.parent))&&E.splice(B,1)}E.length>0&&R(E,w.filter.name,i)})})};l(n.nodes,!1),l(n.attributes,!0)},pp=(n,i,l,d={})=>{const p=kW(n,i,l);lT(p,d)},mx=(n,i,l,d)=>{if((n.pad_empty_with_br||i.insert)&&l(d)){const w=new Hd("br",1);i.insert&&w.attr("data-mce-bogus","1"),d.empty().append(w)}else d.empty().append(new Hd("#text",3)).value=Gr},cT=n=>{var i;return uT(n,"#text")&&((i=n==null?void 0:n.firstChild)===null||i===void 0?void 0:i.value)===Gr},uT=(n,i)=>{const l=n==null?void 0:n.firstChild;return _e(l)&&l===n.lastChild&&l.name===i},EW=(n,i)=>{const l=n.getElementRule(i.name);return(l==null?void 0:l.paddEmpty)===!0},uS=(n,i,l,d)=>d.isEmpty(i,l,p=>EW(n,p)),xW=(n,i)=>_e(n)&&(i(n)||n.name==="br"),BB=n=>{let i;for(let l=n;l;l=l.parent){const d=l.attr("contenteditable");if(d==="false")break;d==="true"&&(i=l)}return he.from(i)},gx=(n,i,l=n.parent)=>{if(i.getSpecialElements()[n.name])n.empty().remove();else{const d=n.children();for(const p of d)l&&!i.isValidChild(l.name,p.name)&&gx(p,i,l);n.unwrap()}},qM=(n,i,l,d=ft)=>{const p=i.getTextBlockElements(),w=i.getNonEmptyElements(),E=i.getWhitespaceElements(),R=hn.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),B=new Set,K=ie=>ie!==l&&!R[ie.name];for(let ie=0;ie<n.length;ie++){const ue=n[ie];let pe,Be,Ze;if(!ue.parent||B.has(ue))continue;if(p[ue.name]&&ue.parent.name==="li"){let ze=ue.next;for(;ze&&p[ze.name];){ze.name="li",B.add(ze),ue.parent.insert(ze,ue.parent);ze=ze.next}ue.unwrap();continue}const Oe=[ue];for(pe=ue.parent;pe&&!i.isValidChild(pe.name,ue.name)&&K(pe);pe=pe.parent)Oe.push(pe);if(pe&&Oe.length>1)if(i.isValidChild(pe.name,ue.name)){Oe.reverse(),Be=Oe[0].clone(),d(Be);let ze=Be;for(let ht=0;ht<Oe.length-1;ht++){i.isValidChild(ze.name,Oe[ht].name)&&ht>0?(Ze=Oe[ht].clone(),d(Ze),ze.append(Ze)):Ze=ze;for(let bt=Oe[ht].firstChild;bt&&bt!==Oe[ht+1];){const vt=bt.next;Ze.append(bt),bt=vt}ze=Ze}uS(i,w,E,Be)?pe.insert(ue,Oe[0],!0):(pe.insert(Be,Oe[0],!0),pe.insert(ue,Be)),pe=Oe[0],(uS(i,w,E,pe)||uT(pe,"br"))&&pe.empty().remove()}else gx(ue,i);else if(ue.parent){if(ue.name==="li"){let ze=ue.prev;if(ze&&(ze.name==="ul"||ze.name==="ol")){ze.append(ue);continue}if(ze=ue.next,ze&&(ze.name==="ul"||ze.name==="ol")&&ze.firstChild){ze.insert(ue,ze.firstChild,!0);continue}const ht=new Hd("ul",1);d(ht),ue.wrap(ht);continue}if(i.isValidChild(ue.parent.name,"div")&&i.isValidChild("div",ue.name)){const ze=new Hd("div",1);d(ze),ue.wrap(ze)}else gx(ue,i)}}},LB=(n,i)=>{let l=n;for(;l;){if(l.name===i)return!0;l=l.parent}return!1},FB=(n,i,l=i.parent)=>l&&n.children[i.name]&&!n.isValidChild(l.name,i.name)?!0:!!(l&&i.name==="a"&&LB(l,"a")),px=(n,i,l,d)=>{const p=document.createRange();return p.setStart(n,i),p.setEnd(l,d),p},HB=n=>{const i=Vt.fromRangeStart(n),l=Vt.fromRangeEnd(n),d=n.commonAncestorContainer;return Pd(!1,d,l).map(p=>!Nd(i,l,d)&&Nd(i,p,d)?px(i.container(),i.offset(),p.container(),p.offset()):n).getOr(n)},GM=n=>n.collapsed?n:HB(n),$B=n=>_e(n.firstChild)&&n.firstChild===n.lastChild,AW=n=>n.name==="br"||n.value===Gr,TW=(n,i)=>n.getBlockElements()[i.name]&&$B(i)&&AW(i.firstChild),DW=(n,i)=>{const l=n.getNonEmptyElements();return _e(i)&&(i.isEmpty(l)||TW(n,i))},OW=(n,i)=>{let l=i.firstChild,d=i.lastChild;return l&&l.name==="meta"&&(l=l.next),d&&d.attr("id")==="mce_marker"&&(d=d.prev),DW(n,d)&&(d=d==null?void 0:d.prev),!l||l!==d?!1:l.name==="ul"||l.name==="ol"},MW=n=>{var i,l;const d=n.firstChild,p=n.lastChild;return d&&d.nodeName==="META"&&((i=d.parentNode)===null||i===void 0||i.removeChild(d)),p&&p.id==="mce_marker"&&((l=p.parentNode)===null||l===void 0||l.removeChild(p)),n},zB=(n,i,l)=>{const d=i.serialize(l),p=n.createFragment(d);return MW(p)},RW=n=>{var i;return yt((i=n==null?void 0:n.childNodes)!==null&&i!==void 0?i:[],l=>l.nodeName==="LI")},KM=n=>n.data===Gr||ui(n),Fw=n=>_e(n==null?void 0:n.firstChild)&&n.firstChild===n.lastChild&&KM(n.firstChild),NW=n=>!n.firstChild||Fw(n),PW=n=>n.length>0&&NW(n[n.length-1])?n.slice(0,-1):n,fS=(n,i)=>{const l=n.getParent(i,n.isBlock);return l&&l.nodeName==="LI"?l:null},VB=(n,i)=>!!fS(n,i),UB=(n,i)=>{const l=i.cloneRange(),d=i.cloneRange();return l.setStartBefore(n),d.setEndAfter(n),[l.cloneContents(),d.cloneContents()]},IW=(n,i)=>{const l=Vt.before(n),p=ka(i).next(l);return p?p.toRange():null},YM=(n,i)=>{const l=Vt.after(n),p=ka(i).prev(l);return p?p.toRange():null},BW=(n,i,l,d)=>{const p=UB(n,d),w=n.parentNode;return w&&(w.insertBefore(p[0],n),hn.each(i,E=>{w.insertBefore(E,n)}),w.insertBefore(p[1],n),w.removeChild(n)),YM(i[i.length-1],l)},Hw=(n,i,l)=>{const d=n.parentNode;return d&&hn.each(i,p=>{d.insertBefore(p,n)}),IW(n,l)},WB=(n,i,l,d)=>(d.insertAfter(i.reverse(),n),YM(i[0],l)),jB=(n,i,l,d)=>{const p=zB(i,n,d),w=fS(i,l.startContainer),E=PW(RW(p.firstChild)),R=1,B=2,K=i.getRoot(),ie=ue=>{const pe=Vt.fromRangeStart(l),Be=ka(i.getRoot()),Ze=ue===R?Be.prev(pe):Be.next(pe),Oe=Ze==null?void 0:Ze.getNode();return Oe?fS(i,Oe)!==w:!0};return w?ie(R)?Hw(w,E,K):ie(B)?WB(w,E,K,i):BW(w,E,K,l):null},ZB=["pre"],fT=(n,i,l,d)=>{var p;const w=i.firstChild,E=i.lastChild,R=E.attr("data-mce-type")==="bookmark"?E.prev:E,B=w===R,K=Ct(ZB,w.name);if(B&&K){const ie=w.attr("contenteditable")!=="false",ue=((p=n.getParent(l,n.isBlock))===null||p===void 0?void 0:p.nodeName.toLowerCase())===w.name,pe=he.from(yy(d,l)).forall(ha);return ie&&ue&&pe}else return!1},dT=kd,LW=(n,i,l)=>{if(_e(l)){const d=n.getParent(i.endContainer,dT);return l===d&&cy(Ke.fromDom(l),i)}else return!1},qB=(n,i,l)=>{var d;if(l.getAttribute("data-mce-bogus")==="all")(d=l.parentNode)===null||d===void 0||d.insertBefore(n.dom.createFragment(i),l);else{const p=l.firstChild,w=l.lastChild;!p||p===w&&p.nodeName==="BR"?n.dom.setHTML(l,i):n.selection.setContent(i,{no_events:!0})}},FW=(n,i)=>{he.from(n.getParent(i,"td,th")).map(Ke.fromDom).each(at)},HW=(n,i)=>{const l=n.schema.getTextInlineElements(),d=n.dom;if(i){const p=n.getBody(),w=aT(n);hn.each(d.select("*[data-mce-fragment]"),E=>{if(_e(l[E.nodeName.toLowerCase()])&&GI(d,E)){for(let B=E.parentElement;_e(B)&&B!==p&&!Dse(d,E,B);B=B.parentElement)if(w.compare(B,E)){d.remove(E,!0);break}}})}},hT=n=>{let i=n;for(;i=i.walk();)i.type===1&&i.attr("data-mce-fragment","1")},GB=n=>{hn.each(n.getElementsByTagName("*"),i=>{i.removeAttribute("data-mce-fragment")})},XM=n=>!!n.getAttribute("data-mce-fragment"),$W=(n,i)=>_e(i)&&!n.schema.getVoidElements()[i.nodeName],zW=(n,i)=>{var l,d,p;let w;const E=n.dom,R=n.selection;if(!i)return;R.scrollIntoView(i);const B=yy(n.getBody(),i);if(B&&E.getContentEditable(B)==="false"){E.remove(i),R.select(B);return}let K=E.createRng();const ie=i.previousSibling;if(_n(ie)){K.setStart(ie,(d=(l=ie.nodeValue)===null||l===void 0?void 0:l.length)!==null&&d!==void 0?d:0);const Be=i.nextSibling;_n(Be)&&(ie.appendData(Be.data),(p=Be.parentNode)===null||p===void 0||p.removeChild(Be))}else K.setStartBefore(i),K.setEndBefore(i);const ue=Be=>{let Ze=Vt.fromRangeStart(Be);return Ze=ka(n.getBody()).next(Ze),Ze==null?void 0:Ze.toRange()},pe=E.getParent(i,E.isBlock);if(E.remove(i),pe&&E.isEmpty(pe)){const Be=dT(pe);wd(Ke.fromDom(pe)),K.setStart(pe,0),K.setEnd(pe,0),!Be&&!XM(pe)&&(w=ue(K))?(K=w,E.remove(pe)):E.add(pe,E.create("br",Be?{}:{"data-mce-bogus":"1"}))}R.setRng(K)},KB=n=>{const i=n.dom,l=GM(n.selection.getRng());n.selection.setRng(l);const d=i.getParent(l.startContainer,dT);LW(i,l,d)?ux(n,l,Ke.fromDom(d)):l.startContainer===l.endContainer&&l.endOffset-l.startOffset===1&&_n(l.startContainer.childNodes[l.startOffset])?l.deleteContents():n.getDoc().execCommand("Delete",!1)},JM=n=>{for(let i=n;i;i=i.walk())if(i.attr("id")==="mce_marker")return he.some(i);return he.none()},YB=(n,i,l)=>{var d,p;const w=n.selection,E=n.dom,R=n.parser,B=l.merge,K=Pw({validate:!0},n.schema),ie='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>';i.indexOf("{$caret}")===-1&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,ie);let ue=w.getRng();const pe=ue.startContainer,Be=n.getBody();pe===Be&&w.isCollapsed()&&E.isBlock(Be.firstChild)&&$W(n,Be.firstChild)&&E.isEmpty(Be.firstChild)&&(ue=E.createRng(),ue.setStart(Be.firstChild,0),ue.setEnd(Be.firstChild,0),w.setRng(ue)),w.isCollapsed()||KB(n);const Ze=w.getNode(),Oe={context:Ze.nodeName.toLowerCase(),data:l.data,insert:!0},ze=R.parse(i,Oe);if(l.paste===!0&&OW(n.schema,ze)&&VB(E,Ze))return ue=jB(K,E,w.getRng(),ze),ue&&w.setRng(ue),i;l.paste===!0&&fT(E,ze,Ze,n.getBody())&&((d=ze.firstChild)===null||d===void 0||d.unwrap()),hT(ze);let ht=ze.lastChild;if(ht&&ht.attr("id")==="mce_marker"){const bt=ht;for(ht=ht.prev;ht;ht=ht.walk(!0))if(ht.type===3||!E.isBlock(ht.name)){ht.parent&&n.schema.isValidChild(ht.parent.name,"span")&&ht.parent.insert(bt,ht,ht.name==="br");break}}if(n._selectionOverrides.showBlockCaretContainer(Ze),!Oe.invalid)i=K.serialize(ze),qB(n,i,Ze);else{n.selection.setContent(ie);let bt=w.getNode(),vt;const Mt=n.getBody();for(qu(bt)?bt=vt=Mt:vt=bt;vt&&vt!==Mt;)bt=vt,vt=vt.parentNode;i=bt===Mt?Mt.innerHTML:E.getOuterHTML(bt);const fn=R.parse(i),$n=JM(fn),Pn=$n.bind(BB).getOr(fn);$n.each(mo=>mo.replace(ze));const Lt=ze.children(),$t=(p=ze.parent)!==null&&p!==void 0?p:fn;ze.unwrap();const yn=yt(Lt,mo=>FB(n.schema,mo,$t));qM(yn,n.schema,Pn),pp(R.getNodeFilters(),R.getAttributeFilters(),fn),i=K.serialize(fn),bt===Mt?E.setHTML(Mt,i):E.setOuterHTML(bt,i)}return HW(n,B),zW(n,E.get("mce_marker")),GB(n.getBody()),FW(E,w.getStart()),Cv(n.schema,n.getBody(),w.getStart()),i},mT=n=>n instanceof Hd,VW=n=>{Nw(n)&&sl(n.getBody()).each(i=>{const l=i.getNode(),d=Eu(l)?sl(l).getOr(i):i;n.selection.setRng(d.toRange())})},QM=(n,i,l)=>{n.dom.setHTML(n.getBody(),i),l!==!0&&VW(n)},gT=(n,i,l,d)=>{if(l.length===0||/^\s+$/.test(l)){const p='<br data-mce-bogus="1">';i.nodeName==="TABLE"?l="<tr><td>"+p+"</td></tr>":/^(UL|OL)$/.test(i.nodeName)&&(l="<li>"+p+"</li>");const w=Hc(n);return n.schema.isValidChild(i.nodeName.toLowerCase(),w.toLowerCase())?(l=p,l=n.dom.createHTML(w,o0(n),l)):l||(l=p),QM(n,l,d.no_selection),{content:l,html:l}}else{d.format!=="raw"&&(l=Pw({validate:!1},n.schema).serialize(n.parser.parse(l,{isRootContent:!0,insert:!0})));const p=Jc(Ke.fromDom(i))?l:hn.trim(l);return QM(n,p,d.no_selection),{content:p,html:p}}},jb=(n,i,l,d)=>{pp(n.parser.getNodeFilters(),n.parser.getAttributeFilters(),l);const p=Pw({validate:!1},n.schema).serialize(l),w=Jc(Ke.fromDom(i))?p:hn.trim(p);return QM(n,w,d.no_selection),{content:l,html:w}},UW=(n,i,l)=>he.from(n.getBody()).map(d=>mT(i)?jb(n,d,i,l):gT(n,d,i,l)).getOr({content:i,html:mT(l.content)?"":l.content}),eR=(n,i,l)=>li(n,i,l).isSome(),Ol=(n,i)=>Lp(n,i).isSome(),pT=n=>be(n)?n:We,tR=(n,i,l)=>{let d=n.dom;const p=pT(l);for(;d.parentNode;){d=d.parentNode;const w=Ke.fromDom(d),E=i(w);if(E.isSome())return E;if(p(w))break}return he.none()},a1=(n,i,l)=>{const d=i(n),p=pT(l);return d.orThunk(()=>p(n)?he.none():tR(n,i,p))},bT=FC,nR=(n,i,l)=>{const d=n.formatter.get(l);if(d)for(let p=0;p<d.length;p++){const w=d[p];if(nd(w)&&w.inherit===!1&&n.dom.is(i,w.selector))return!0}return!1},$w=(n,i,l,d,p)=>{const w=n.dom.getRoot();if(i===w)return!1;const E=n.dom.getParent(i,R=>nR(n,R,l)?!0:R.parentNode===w||!!Eh(n,R,l,d,!0));return!!Eh(n,E,l,d,p)},vT=(n,i,l)=>Tl(l)&&bT(i,l.inline)||dm(l)&&bT(i,l.block)?!0:nd(l)?Xn(i)&&n.is(i,l.selector):!1,XB=(n,i,l,d,p,w)=>{const E=l[d],R=d==="attributes";if(be(l.onmatch))return l.onmatch(i,l,d);if(E){if(_r(E)){for(let B=0;B<E.length;B++)if(R?n.getAttrib(i,E[B]):ww(n,i,E[B]))return!0}else for(const B in E)if(cn(E,B)){const K=R?n.getAttrib(i,B):ww(n,i,B),ie=Ch(E[B],w),ue=De(K)||Ja(K);if(ue&&De(ie))continue;if(p&&ue&&!l.exact||(!p||l.exact)&&!bT(K,yw(ie,B)))return!1}}return!0},Eh=(n,i,l,d,p)=>{const w=n.formatter.get(l),E=n.dom;if(w&&Xn(i))for(let R=0;R<w.length;R++){const B=w[R];if(vT(n.dom,i,B)&&XB(E,i,B,"attributes",p,d)&&XB(E,i,B,"styles",p,d)){const K=B.classes;if(K){for(let ie=0;ie<K.length;ie++)if(!n.dom.hasClass(i,Ch(K[ie],d)))return}return B}}},oR=(n,i,l,d,p)=>{if(d)return $w(n,d,i,l,p);if(d=n.selection.getNode(),$w(n,d,i,l,p))return!0;const w=n.selection.getStart();return!!(w!==d&&$w(n,w,i,l,p))},zw=(n,i,l)=>{const d=[],p={},w=n.selection.getStart();return n.dom.getParent(w,E=>{for(let R=0;R<i.length;R++){const B=i[R];!p[B]&&Eh(n,E,B,l)&&(p[B]=!0,d.push(B))}},n.dom.getRoot()),d},WW=(n,i)=>{const l=p=>pt(p,Ke.fromDom(n.getBody())),d=(p,w)=>Eh(n,p.dom,w)?he.some(w):he.none();return he.from(n.selection.getStart(!0)).bind(p=>a1(Ke.fromDom(p),w=>Ls(i,E=>d(w,E)),l)).getOrNull()},wy=(n,i)=>{const l=n.formatter.get(i),d=n.dom;if(l&&n.selection.isEditable()){const p=n.selection.getStart(),w=_w(d,p);for(let E=l.length-1;E>=0;E--){const R=l[E];if(!nd(R))return!0;for(let B=w.length-1;B>=0;B--)if(d.is(w[B],R.selector))return!0}}return!1},bg=(n,i,l)=>bn(l,(d,p)=>{const w=IE(n,p);return n.formatter.matchNode(i,p,{},w)?d.concat([p]):d},[]),Zb=Ft,sR=(n,i)=>n.importNode(i,!0),jW=n=>{const i=[];let l=n;for(;l;){if(_n(l)&&l.data!==Zb||l.childNodes.length>1)return[];Xn(l)&&i.push(l),l=l.firstChild}return i},JB=n=>jW(n).length>0,bx=n=>{if(n){const i=new pi(n,n);for(let l=i.current();l;l=i.next())if(_n(l))return l}return null},rR=n=>{const i=Ke.fromTag("span");return Uu(i,{id:PC,"data-mce-bogus":"1","data-mce-type":"format-caret"}),n&&Qi(i,Ke.fromText(Zb)),i},bp=n=>{const i=bx(n);return i&&i.data.charAt(0)===Zb&&i.deleteData(0,1),i},dS=(n,i,l=!0)=>{const d=n.dom,p=n.selection;if(JB(i))Ub(n,!1,Ke.fromDom(i),l);else{const w=p.getRng(),E=d.getParent(i,d.isBlock),R=w.startContainer,B=w.startOffset,K=w.endContainer,ie=w.endOffset,ue=bp(i);d.remove(i,!0),R===ue&&B>0&&w.setStart(ue,B-1),K===ue&&ie>0&&w.setEnd(ue,ie-1),E&&d.isEmpty(E)&&Te(Ke.fromDom(E)),p.setRng(w)}},yT=(n,i,l=!0)=>{const d=n.dom,p=n.selection;if(i)dS(n,i,l);else if(i=g0(n.getBody(),p.getStart()),!i)for(;i=d.get(PC);)dS(n,i,l)},iR=(n,i,l)=>{var d,p;const w=n.dom,E=w.getParent(l,He($l,n.schema));E&&w.isEmpty(E)?(d=l.parentNode)===null||d===void 0||d.replaceChild(i,l):(G(Ke.fromDom(l)),w.isEmpty(l)?(p=l.parentNode)===null||p===void 0||p.replaceChild(i,l):w.insertAfter(i,l))},wT=(n,i)=>(n.appendChild(i),i),_y=(n,i)=>{var l;const d=Yt(n,(w,E)=>wT(w,E.cloneNode(!1)),i),p=(l=d.ownerDocument)!==null&&l!==void 0?l:document;return wT(d,p.createTextNode(Zb))},aR=(n,i,l,d,p,w)=>{const E=n.formatter,R=n.dom,B=yt(gs(E.get()),ue=>ue!==d&&!Qs(ue,"removeformat")),K=bg(n,l,B);if(yt(K,ue=>!IO(n,ue,d)).length>0){const ue=l.cloneNode(!1);return R.add(i,ue),E.remove(d,p,ue,w),R.remove(ue),he.some(ue)}else return he.none()},ZW=(n,i,l)=>{let d;const p=n.selection,w=n.formatter.get(i);if(!w)return;const E=p.getRng();let R=E.startOffset;const K=E.startContainer.nodeValue;d=g0(n.getBody(),p.getStart());const ie=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(K&&R>0&&R<K.length&&ie.test(K.charAt(R))&&ie.test(K.charAt(R-1))){const ue=p.getBookmark();E.collapse(!0);let pe=Pb(n.dom,E,w);pe=mp(pe),n.formatter.apply(i,l,pe),p.moveToBookmark(ue)}else{let ue=d?bx(d):null;(!d||(ue==null?void 0:ue.data)!==Zb)&&(d=sR(n.getDoc(),rR(!0).dom),ue=d.firstChild,E.insertNode(d),R=1),n.formatter.apply(i,l,d),p.setCursorLocation(ue,R)}},QB=(n,i,l,d)=>{const p=n.dom,w=n.selection;let E=!1;const R=n.formatter.get(i);if(!R)return;const B=w.getRng(),K=B.startContainer,ie=B.startOffset;let ue=K;_n(K)&&(ie!==K.data.length&&(E=!0),ue=ue.parentNode);const pe=[];let Be;for(;ue;){if(Eh(n,ue,i,l,d)){Be=ue;break}ue.nextSibling&&(E=!0),pe.push(ue),ue=ue.parentNode}if(!!Be)if(E){const Ze=w.getBookmark();B.collapse(!0);let Oe=Pb(p,B,R,!0);Oe=mp(Oe),n.formatter.remove(i,l,Oe,d),w.moveToBookmark(Ze)}else{const Ze=g0(n.getBody(),Be),Oe=rR(!1).dom;iR(n,Oe,Ze!=null?Ze:Be);const ze=aR(n,Oe,Be,i,l,d),ht=_y(pe.concat(ze.toArray()),Oe);Ze&&dS(n,Ze,!1),w.setCursorLocation(ht,1),p.isEmpty(Be)&&p.remove(Be)}},qW=(n,i,l)=>{const d=n.selection,p=n.getBody();yT(n,null,l),(i===8||i===46)&&d.isCollapsed()&&d.getStart().innerHTML===Zb&&yT(n,g0(p,d.getStart())),(i===37||i===39)&&yT(n,g0(p,d.getStart()))},GW=n=>_n(n)&&Ki(n.data,Gr),KW=n=>{n.on("mouseup keydown",i=>{qW(n,i.keyCode,GW(n.selection.getRng().endContainer))})},e8=n=>{const i=rR(!1),l=_y(n,i.dom);return{caretContainer:i,caretPosition:Vt(l,0)}},hS=(n,i)=>{const{caretContainer:l,caretPosition:d}=e8(i);return wa(Ke.fromDom(n),l),pr(Ke.fromDom(n)),d},YW=(n,i)=>{const{caretContainer:l,caretPosition:d}=e8(i);return n.insertNode(l.dom),d},lR=(n,i)=>{const l=n.schema.getTextInlineElements();return cn(l,Xr(i))&&!$c(i.dom)&&!Cd(i.dom)},_T=n=>$c(n.dom)&&JB(n.dom),vx={},cR=kf(["pre"]),t8=(n,i)=>{vx[n]||(vx[n]=[]),vx[n].push(i)},XW=(n,i)=>{cn(vx,n)&&Pe(vx[n],l=>{l(i)})};t8("pre",n=>{const i=n.selection.getRng(),l=p=>w=>{const E=w.previousSibling;return cR(E)&&Ct(p,E)},d=(p,w)=>{const E=Ke.fromDom(w),R=Eo(E).dom;pr(E),Jr(Ke.fromDom(p),[Ke.fromTag("br",R),Ke.fromTag("br",R),...Aa(E)])};if(!i.collapsed){const p=n.selection.getSelectedBlocks(),w=yt(yt(p,cR),l(p));Pe(w,E=>{d(E.previousSibling,E)})}});const n8=["fontWeight","fontStyle","color","fontSize","fontFamily"],JW=n=>ne(n.styles)&&Jt(gs(n.styles),i=>Ct(n8,i)),QW=n=>Jn(n,i=>Tl(i)&&i.inline==="span"&&JW(i)),o8=(n,i)=>{const l=n.get(i);return re(l)?QW(l):he.none()},s8=(n,i)=>Mu(i,Vt.fromRangeStart(n)).isNone(),r8=(n,i)=>Rf(i,Vt.fromRangeEnd(n)).exists(l=>!ui(l.getNode())||Rf(i,l).isSome())===!1,i8=n=>i=>za(i)&&n.isEditable(i),ej=n=>{const i=n.getSelectedBlocks(),l=n.getRng();if(n.isCollapsed())return[];if(i.length===1)return s8(l,i[0])&&r8(l,i[0])?i:[];{const d=No(i).filter(E=>s8(l,E)).toArray(),p=Mo(i).filter(E=>r8(l,E)).toArray(),w=i.slice(1,-1);return d.concat(w).concat(p)}},tj=n=>yt(ej(n),i8(n.dom)),a8=n=>yt(n.getSelectedBlocks(),i8(n.dom)),uR=hn.each,fR=n=>Xn(n)&&!Bd(n)&&!$c(n)&&!Cd(n),dR=(n,i)=>{for(let l=n;l;l=l[i]){if(_n(l)&&gr(l.data))return n;if(Xn(l)&&!Bd(l))return l}return n},l8=(n,i,l)=>{const d=aT(n),p=Xn(i)&&cm(i),w=Xn(l)&&cm(l);if(p&&w){const E=dR(i,"previousSibling"),R=dR(l,"nextSibling");if(d.compare(E,R)){for(let B=E.nextSibling;B&&B!==R;){const K=B;B=B.nextSibling,E.appendChild(K)}return n.dom.remove(R),hn.each(hn.grep(R.childNodes),B=>{E.appendChild(B)}),E}}return l},Vw=(n,i,l,d)=>{var p;if(d&&i.merge_siblings!==!1){const w=(p=l8(n,Yn(d),d))!==null&&p!==void 0?p:d;l8(n,w,Yn(w,!0))}},nj=(n,i,l)=>{if(i.clear_child_styles){const d=i.links?"*:not(a)":"*";uR(n.select(d,l),p=>{fR(p)&&cm(p)&&uR(i.styles,(w,E)=>{n.setStyle(p,E,"")})})}},hR=(n,i,l)=>{uR(n.childNodes,d=>{fR(d)&&(i(d)&&l(d),d.hasChildNodes()&&hR(d,i,l))})},oj=(n,i)=>{i.nodeName==="SPAN"&&n.getAttribs(i).length===0&&n.remove(i,!0)},c8=(n,i)=>l=>!!(l&&ww(n,l,i)),mR=(n,i,l)=>d=>{n.setStyle(d,i,l),d.getAttribute("style")===""&&d.removeAttribute("style"),oj(n,d)},Uw=lg.generate([{keep:[]},{rename:["name"]},{removed:[]}]),sj=/^(src|href|style)$/,gR=hn.each,CT=FC,rj=n=>/^(TR|TH|TD)$/.test(n.nodeName),u8=(n,i,l)=>n.isChildOf(i,l)&&i!==l&&!n.isBlock(l),f8=(n,i,l)=>{let d=i[l?"startContainer":"endContainer"],p=i[l?"startOffset":"endOffset"];if(Xn(d)){const w=d.childNodes.length-1;!l&&p&&p--,d=d.childNodes[p>w?w:p]}return _n(d)&&l&&p>=d.data.length&&(d=new pi(d,n.getBody()).next()||d),_n(d)&&!l&&p===0&&(d=new pi(d,n.getBody()).prev()||d),d},d8=(n,i)=>{const l=i?"firstChild":"lastChild",d=n[l];return rj(n)&&d?n.nodeName==="TR"&&d[l]||d:n},pR=(n,i,l,d)=>{var p;const w=n.create(l,d);return(p=i.parentNode)===null||p===void 0||p.insertBefore(w,i),w.appendChild(i),w},h8=(n,i,l,d,p)=>{const w=Ke.fromDom(i),E=Ke.fromDom(n.create(d,p)),R=l?tl(w):Lg(w);return Jr(E,R),l?(wa(w,E),Jd(E,w)):(Yc(w,E),Qi(E,w)),E.dom},bR=(n,i)=>i.links&&n.nodeName==="A",vR=(n,i,l)=>{const d=i.parentNode;let p;const w=n.dom,E=Hc(n);dm(l)&&d===w.getRoot()&&(!l.list_block||!CT(i,l.list_block))&&Pe(Mr(i.childNodes),R=>{um(n,E,R.nodeName.toLowerCase())?p?p.appendChild(R):(p=pR(w,R,E),w.setAttribs(p,o0(n))):p=null}),!(BE(l)&&!CT(l.inline,i))&&w.remove(i,!0)},ij=(n,i,l)=>tt(n)?{name:i,value:null}:{name:n,value:Ch(i,l)},mS=(n,i)=>{n.getAttrib(i,"style")===""&&(i.removeAttribute("style"),i.removeAttribute("data-mce-style"))},yR=(n,i,l,d,p)=>{let w=!1;gR(l.styles,(E,R)=>{const{name:B,value:K}=ij(R,E,d),ie=yw(K,B);(l.remove_similar||J(K)||!Xn(p)||CT(ww(n,p,B),ie))&&n.setStyle(i,B,""),w=!0}),w&&mS(n,i)},yx=(n,i,l)=>{i==="removeformat"?Pe(a8(n.selection),d=>{Pe(n8,p=>n.dom.setStyle(d,p,"")),mS(n.dom,d)}):o8(n.formatter,i).each(d=>{Pe(a8(n.selection),p=>yR(n.dom,p,d,l,null))})},gS=(n,i,l,d,p)=>{const w=n.dom,E=aT(n),R=n.schema;if(Tl(i)&&qg(R,i.inline)&&Jm(R,d)&&d.parentElement===n.getBody())return vR(n,d,i),Uw.removed();if(!i.ceFalseOverride&&d&&w.getContentEditableParent(d)==="false"||d&&!vT(w,d,i)&&!bR(d,i))return Uw.keep();const B=d,K=i.preserve_attributes;if(Tl(i)&&i.remove==="all"&&re(K)){const ie=yt(w.getAttribs(B),ue=>Ct(K,ue.name.toLowerCase()));if(w.removeAllAttribs(B),Pe(ie,ue=>w.setAttrib(B,ue.name,ue.value)),ie.length>0)return Uw.rename("span")}if(i.remove!=="all"){yR(w,B,i,l,p),gR(i.attributes,(ue,pe)=>{const{name:Be,value:Ze}=ij(pe,ue,l);if(i.remove_similar||J(Ze)||!Xn(p)||CT(w.getAttrib(p,Be),Ze)){if(Be==="class"){const Oe=w.getAttrib(B,Be);if(Oe){let ze="";if(Pe(Oe.split(/\s+/),ht=>{/mce\-\w+/.test(ht)&&(ze+=(ze?" ":"")+ht)}),ze){w.setAttrib(B,Be,ze);return}}}if(sj.test(Be)&&B.removeAttribute("data-mce-"+Be),Be==="style"&&kf(["li"])(B)&&w.getStyle(B,"list-style-type")==="none"){B.removeAttribute(Be),w.setStyle(B,"list-style-type","none");return}Be==="class"&&B.removeAttribute("className"),B.removeAttribute(Be)}}),gR(i.classes,ue=>{ue=Ch(ue,l),(!Xn(p)||w.hasClass(p,ue))&&w.removeClass(B,ue)});const ie=w.getAttribs(B);for(let ue=0;ue<ie.length;ue++){const pe=ie[ue].nodeName;if(!E.isAttributeInternal(pe))return Uw.keep()}}return i.remove!=="none"?(vR(n,B,i),Uw.removed()):Uw.keep()},m8=(n,i,l,d,p)=>{let w;return i.parentNode&&Pe(_w(n.dom,i.parentNode).reverse(),E=>{if(!w&&Xn(E)&&E.id!=="_start"&&E.id!=="_end"){const R=Eh(n,E,l,d,p);R&&R.split!==!1&&(w=E)}}),w},Rse=(n,i,l,d)=>gS(n,i,l,d,d).fold(nt(d),p=>(n.dom.createFragment().appendChild(d),n.dom.rename(d,p)),nt(null)),aj=(n,i,l,d,p,w,E,R)=>{var B,K;let ie,ue;const pe=n.dom;if(l){const Be=l.parentNode;for(let Ze=d.parentNode;Ze&&Ze!==Be;Ze=Ze.parentNode){let Oe=pe.clone(Ze,!1);for(let ze=0;ze<i.length&&(Oe=Rse(n,i[ze],R,Oe),Oe!==null);ze++);Oe&&(ie&&Oe.appendChild(ie),ue||(ue=Oe),ie=Oe)}w&&(!E.mixed||!pe.isBlock(l))&&(d=(B=pe.split(l,d))!==null&&B!==void 0?B:d),ie&&ue&&((K=p.parentNode)===null||K===void 0||K.insertBefore(ie,p),ue.appendChild(p),Tl(E)&&Vw(n,E,R,ie))}return d},Nse=(n,i,l,d,p)=>{const w=n.formatter.get(i),E=w[0],R=n.dom,B=n.selection,K=Oe=>{const ze=m8(n,Oe,i,l,p);return aj(n,w,ze,Oe,Oe,!0,E,l)},ie=Oe=>Bd(Oe)&&Xn(Oe)&&(Oe.id==="_start"||Oe.id==="_end"),ue=Oe=>Jt(w,ze=>wx(n,ze,l,Oe,Oe)),pe=Oe=>{const ze=Mr(Oe.childNodes),bt=ue(Oe)||Jt(w,fn=>vT(R,Oe,fn)),vt=Oe.parentNode;if(!bt&&_e(vt)&&Sw(E)&&ue(vt),E.deep&&ze.length)for(let fn=0;fn<ze.length;fn++)pe(ze[fn]);Pe(["underline","line-through","overline"],fn=>{Xn(Oe)&&n.dom.getStyle(Oe,"text-decoration")===fn&&Oe.parentNode&&PE(R,Oe.parentNode)===fn&&wx(n,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:fn}},void 0,Oe)})},Be=Oe=>{const ze=R.get(Oe?"_start":"_end");if(ze){let ht=ze[Oe?"firstChild":"lastChild"];return ie(ht)&&(ht=ht[Oe?"firstChild":"lastChild"]),_n(ht)&&ht.data.length===0&&(ht=Oe?ze.previousSibling||ze.nextSibling:ze.nextSibling||ze.previousSibling),R.remove(ze,!0),ht}else return null},Ze=Oe=>{let ze,ht,bt=Pb(R,Oe,w,Oe.collapsed);if(E.split){if(bt=mp(bt),ze=f8(n,bt,!0),ht=f8(n,bt),ze!==ht){if(ze=d8(ze,!0),ht=d8(ht,!1),u8(R,ze,ht)){const Mt=he.from(ze.firstChild).getOr(ze);K(h8(R,Mt,!0,"span",{id:"_start","data-mce-type":"bookmark"})),Be(!0);return}if(u8(R,ht,ze)){const Mt=he.from(ht.lastChild).getOr(ht);K(h8(R,Mt,!1,"span",{id:"_end","data-mce-type":"bookmark"})),Be(!1);return}ze=pR(R,ze,"span",{id:"_start","data-mce-type":"bookmark"}),ht=pR(R,ht,"span",{id:"_end","data-mce-type":"bookmark"});const vt=R.createRng();vt.setStartAfter(ze),vt.setEndBefore(ht),n1(R,vt,Mt=>{Pe(Mt,fn=>{!Bd(fn)&&!Bd(fn.parentNode)&&K(fn)})}),K(ze),K(ht),ze=Be(!0),ht=Be()}else ze=ht=K(ze);bt.startContainer=ze.parentNode?ze.parentNode:ze,bt.startOffset=R.nodeIndex(ze),bt.endContainer=ht.parentNode?ht.parentNode:ht,bt.endOffset=R.nodeIndex(ht)+1}n1(R,bt,vt=>{Pe(vt,pe)})};if(d){if(bw(d)){const Oe=R.createRng();Oe.setStartBefore(d),Oe.setEndAfter(d),Ze(Oe)}else Ze(d);kh(n,i,d,l);return}!B.isCollapsed()||!Tl(E)||b0(n).length?(b3(n,()=>RE(n,Ze),Oe=>Tl(E)&&oR(n,i,l,Oe)),n.nodeChanged()):QB(n,i,l,p),yx(n,i,l),kh(n,i,d,l)},g8=(n,i,l,d,p)=>{(d||n.selection.isEditable())&&Nse(n,i,l,d,p)},wx=(n,i,l,d,p)=>gS(n,i,l,d,p).fold(We,w=>(n.dom.rename(d,w),!0),xt),lj=hn.each,cj=(n,i,l,d)=>{const p=w=>{if(Xn(w)&&Xn(w.parentNode)&&cm(w)){const E=PE(n,w.parentNode);n.getStyle(w,"color")&&E?n.setStyle(w,"text-decoration",E):n.getStyle(w,"text-decoration")===E&&n.setStyle(w,"text-decoration",null)}};i.styles&&(i.styles.color||i.styles.textDecoration)&&(hn.walk(d,p,"childNodes"),p(d))},p8=(n,i,l,d)=>{if(i.styles&&i.styles.backgroundColor){const p=c8(n,"fontSize");hR(d,w=>p(w)&&cm(w),mR(n,"backgroundColor",Ch(i.styles.backgroundColor,l)))}},uj=(n,i,l,d)=>{if(Tl(i)&&(i.inline==="sub"||i.inline==="sup")){const p=c8(n,"fontSize");hR(d,E=>p(E)&&cm(E),mR(n,"fontSize",""));const w=yt(n.select(i.inline==="sup"?"sub":"sup",d),cm);n.remove(w,!0)}},b8=(n,i,l,d)=>{lj(i,p=>{Tl(p)&&lj(n.dom.select(p.inline,d),w=>{fR(w)&&wx(n,p,l,w,p.exact?w:null)}),nj(n.dom,p,d)})},fj=(n,i,l,d,p)=>{const w=p.parentNode;Eh(n,w,l,d)&&wx(n,i,d,p)||i.merge_with_parents&&w&&n.dom.getParent(w,E=>Eh(n,E,l,d)?(wx(n,i,d,p),!0):!1)},Ww=hn.each,v8=(n,i,l,d)=>{if(gC(n)&&Tl(i)&&l.parentNode){const p=Kf(n.schema),w=Ol(Ke.fromDom(l),E=>$c(E.dom));return ts(p,d)&&Ma(Ke.fromDom(l.parentNode),!1)&&!w}else return!1},ec=(n,i,l,d)=>{if(Ww(l.styles,(p,w)=>{n.setStyle(i,w,Ch(p,d))}),l.styles){const p=n.getAttrib(i,"style");p&&n.setAttrib(i,"data-mce-style",p)}},Pse=(n,i,l,d)=>{const p=n.formatter.get(i),w=p[0],E=!d&&n.selection.isCollapsed(),R=n.dom,B=n.selection,K=(Ze,Oe=w)=>{be(Oe.onformat)&&Oe.onformat(Ze,Oe,l,d),ec(R,Ze,Oe,l),Ww(Oe.attributes,(ze,ht)=>{R.setAttrib(Ze,ht,Ch(ze,l))}),Ww(Oe.classes,ze=>{const ht=Ch(ze,l);R.hasClass(Ze,ht)||R.addClass(Ze,ht)})},ie=(Ze,Oe)=>{let ze=!1;return Ww(Ze,ht=>nd(ht)?R.getContentEditable(Oe)==="false"&&!ht.ceFalseOverride||_e(ht.collapsed)&&ht.collapsed!==E?!0:R.is(Oe,ht.selector)&&!$c(Oe)?(K(Oe,ht),ze=!0,!1):!0:!1),ze},ue=Ze=>{if(F(Ze)){const Oe=R.create(Ze);return K(Oe),Oe}else return null},pe=(Ze,Oe,ze)=>{const ht=[];let bt=!0;const vt=w.inline||w.block,Mt=ue(vt),fn=Lt=>$C(w)&&Eh(n,Lt,i,l),$n=(Lt,$t,yn)=>{const mo=Cw(w)&&$l(n.schema,Lt)&&um(n,$t,vt);return yn&&mo},Pn=(Lt,$t,yn,mo)=>{const Oo=Lt.nodeName.toLowerCase(),Cs=um(n,vt,Oo)&&um(n,$t,vt),Us=!ze&&_n(Lt)&&Cn(Lt.data),Pr=$c(Lt),di=!Tl(w)||!Ze.isBlock(Lt);return(yn||mo)&&Cs&&!Us&&!Pr&&di};n1(Ze,Oe,Lt=>{let $t;const yn=mo=>{let Oo=!1,Cs=bt,Us=!1;const Pr=mo.parentNode,di=Pr.nodeName.toLowerCase(),il=Ze.getContentEditable(mo);_e(il)&&(Cs=bt,bt=il==="true",Oo=!0,Us=vw(n,mo));const Rl=bt&&!Oo;if(ui(mo)&&!v8(n,w,mo,di)){$t=null,dm(w)&&Ze.remove(mo);return}if(fn(mo)){$t=null;return}if($n(mo,di,Rl)){const hc=Ze.rename(mo,vt);K(hc),ht.push(hc),$t=null;return}if(nd(w)){let hc=ie(p,mo);if(!hc&&_e(Pr)&&Sw(w)&&(hc=ie(p,Pr)),!Tl(w)||hc){$t=null;return}}_e(Mt)&&Pn(mo,di,Rl,Us)?($t||($t=Ze.clone(Mt,!1),Pr.insertBefore($t,mo),ht.push($t)),Us&&Oo&&(bt=Cs),$t.appendChild(mo)):($t=null,Pe(Mr(mo.childNodes),yn),Oo&&(bt=Cs),$t=null)};Pe(Lt,yn)}),w.links===!0&&Pe(ht,Lt=>{const $t=yn=>{yn.nodeName==="A"&&K(yn,w),Pe(Mr(yn.childNodes),$t)};$t(Lt)}),Pe(ht,Lt=>{const $t=Oo=>{let Cs=0;return Pe(Oo.childNodes,Us=>{!fm(Us)&&!Bd(Us)&&Cs++}),Cs},yn=Oo=>Jn(Oo.childNodes,NE).filter(Us=>Ze.getContentEditable(Us)!=="false"&&vT(Ze,Us,w)).map(Us=>{const Pr=Ze.clone(Us,!1);return K(Pr),Ze.replace(Pr,Oo,!0),Ze.remove(Us,!0),Pr}).getOr(Oo),mo=$t(Lt);if((ht.length>1||!Ze.isBlock(Lt))&&mo===0){Ze.remove(Lt,!0);return}(Tl(w)||dm(w)&&w.wrapper)&&(!w.exact&&mo===1&&(Lt=yn(Lt)),b8(n,p,l,Lt),fj(n,w,i,l,Lt),p8(Ze,w,l,Lt),cj(Ze,w,l,Lt),uj(Ze,w,l,Lt),Vw(n,w,l,Lt))})},Be=bw(d)?d:B.getNode();if(R.getContentEditable(Be)==="false"&&!vw(n,Be)){d=Be,ie(p,d),A3(n,i,d,l);return}if(w){if(d)if(bw(d)){if(!ie(p,d)){const Ze=R.createRng();Ze.setStartBefore(d),Ze.setEndAfter(d),pe(R,Pb(R,Ze,p),!0)}}else pe(R,d,!0);else!E||!Tl(w)||b0(n).length?(B.setRng(GM(B.getRng())),b3(n,()=>{RE(n,(Ze,Oe)=>{const ze=Oe?Ze:Pb(R,Ze,p);pe(R,ze,!1)})},xt),n.nodeChanged()):ZW(n,i,l),o8(n.formatter,i).each(Ze=>{Pe(tj(n.selection),Oe=>ec(R,Oe,Ze,l))});XW(i,n)}A3(n,i,d,l)},dj=(n,i,l,d)=>{(d||n.selection.isEditable())&&Pse(n,i,l,d)},hj=n=>cn(n,"vars"),Ise=(n,i)=>{n.set({}),i.on("NodeChange",l=>{Gb(i,l.element,n.get())}),i.on("FormatApply FormatRemove",l=>{const d=he.from(l.node).map(p=>bw(p)?p:p.startContainer).bind(p=>Xn(p)?he.some(p):he.from(p.parentElement)).getOrThunk(()=>vg(i));Gb(i,d,n.get())})},vg=n=>n.selection.getStart(),_x=(n,i,l,d,p)=>rs(i,R=>{const B=n.formatter.matchNode(R,l,p!=null?p:{},d);return!ye(B)},R=>nR(n,R,l)?!0:d?!1:_e(n.formatter.matchNode(R,l,p,!0))),qb=(n,i)=>{const l=i!=null?i:vg(n);return yt(_w(n.dom,l),d=>Xn(d)&&!Cd(d))},Gb=(n,i,l)=>{const d=qb(n,i);an(l,(p,w)=>{const E=R=>{const B=_x(n,d,w,R.similar,hj(R)?R.vars:void 0),K=B.isSome();if(R.state.get()!==K){R.state.set(K);const ie=B.getOr(i);hj(R)?R.callback(K,{node:ie,format:w,parents:d}):Pe(R.callbacks,ue=>ue(K,{node:ie,format:w,parents:d}))}};Pe([p.withSimilar,p.withoutSimilar],E),Pe(p.withVars,E)})},mj=(n,i,l,d,p,w)=>{const E=i.get();Pe(l.split(","),R=>{const B=go(E,R).getOrThunk(()=>{const ie={withSimilar:{state:qa(!1),similar:!0,callbacks:[]},withoutSimilar:{state:qa(!1),similar:!1,callbacks:[]},withVars:[]};return E[R]=ie,ie}),K=()=>{const ie=qb(n);return _x(n,ie,R,p,w).isSome()};if(ye(w)){const ie=p?B.withSimilar:B.withoutSimilar;ie.callbacks.push(d),ie.callbacks.length===1&&ie.state.set(K())}else B.withVars.push({state:qa(K()),similar:p,vars:w,callback:d})}),i.set(E)},gj=(n,i,l)=>{const d=n.get();Pe(i.split(","),p=>go(d,p).each(w=>{d[p]={withSimilar:{...w.withSimilar,callbacks:yt(w.withSimilar.callbacks,E=>E!==l)},withoutSimilar:{...w.withoutSimilar,callbacks:yt(w.withoutSimilar.callbacks,E=>E!==l)},withVars:yt(w.withVars,E=>E.callback!==l)}})),n.set(d)},pS=(n,i,l,d,p,w)=>(mj(n,i,l,d,p,w),{unbind:()=>gj(i,l,d)}),bS=(n,i,l,d)=>{const p=n.formatter.get(i);p&&(oR(n,i,l,d)&&(!("toggle"in p[0])||p[0].toggle)?g8(n,i,l,d):dj(n,i,l,d))},jw=hn.explode,wR=()=>{const n={};return{addFilter:(p,w)=>{Pe(jw(p),E=>{cn(n,E)||(n[E]={name:E,callbacks:[]}),n[E].callbacks.push(w)})},getFilters:()=>lo(n),removeFilter:(p,w)=>{Pe(jw(p),E=>{if(cn(n,E))if(_e(w)){const R=n[E],B=yt(R.callbacks,K=>K!==w);B.length>0?R.callbacks=B:delete n[E]}else delete n[E]})}}},_R=(n,i)=>{Pe(i,l=>{n.attr(l,null)})},y8=(n,i,l)=>{n.addNodeFilter("font",d=>{Pe(d,p=>{const w=i.parse(p.attr("style")),E=p.attr("color"),R=p.attr("face"),B=p.attr("size");E&&(w.color=E),R&&(w["font-family"]=R),B&&qc(B).each(K=>{w["font-size"]=l[K-1]}),p.name="span",p.attr("style",i.serialize(w)),_R(p,["color","face","size"])})})},w8=(n,i,l)=>{n.addNodeFilter("strike",d=>{const p=i.type!=="html4";Pe(d,w=>{if(p)w.name="s";else{const E=l.parse(w.attr("style"));E["text-decoration"]="line-through",w.name="span",w.attr("style",l.serialize(E))}})})},pj=(n,i,l)=>{var d;const p=Tv();i.convert_fonts_to_spans&&y8(n,p,hn.explode((d=i.font_size_legacy_values)!==null&&d!==void 0?d:"")),w8(n,l,p)},bj=(n,i,l)=>{i.inline_styles&&pj(n,i,l)},CR=(n,i,l)=>{i.addNodeFilter("br",(d,p,w)=>{const E=hn.extend({},l.getBlockElements()),R=l.getNonEmptyElements(),B=l.getWhitespaceElements();E.body=1;const K=ie=>ie.name in E||nr(l,ie);for(let ie=0,ue=d.length;ie<ue;ie++){let pe=d[ie],Be=pe.parent;if(Be&&K(Be)&&pe===Be.lastChild){let Ze=pe.prev;for(;Ze;){const Oe=Ze.name;if(Oe!=="span"||Ze.attr("data-mce-type")!=="bookmark"){Oe==="br"&&(pe=null);break}Ze=Ze.prev}if(pe&&(pe.remove(),uS(l,R,B,Be))){const Oe=l.getElementRule(Be.name);Oe&&(Oe.removeEmpty?Be.remove():Oe.paddEmpty&&mx(n,w,K,Be))}}else{let Ze=pe;for(;Be&&Be.firstChild===Ze&&Be.lastChild===Ze&&(Ze=Be,!E[Be.name]);)Be=Be.parent;if(Ze===Be){const Oe=new Hd("#text",3);Oe.value=Gr,pe.replace(Oe)}}}})},vj=n=>fetch(n).then(i=>i.ok?i.blob():Promise.reject()).catch(()=>Promise.reject({message:`Cannot convert ${n} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"})),yj=n=>{const i=/([a-z0-9+\/=\s]+)/i.exec(n);return i?i[1]:""},SR=n=>{const[i,...l]=n.split(","),d=l.join(","),p=/data:([^/]+\/[^;]+)(;.+)?/.exec(i);if(p){const w=p[2]===";base64",E=w?yj(d):decodeURIComponent(d);return he.some({type:p[1],data:E,base64Encoded:w})}else return he.none()},_8=(n,i,l=!0)=>{let d=i;if(l)try{d=atob(i)}catch{return he.none()}const p=new Uint8Array(d.length);for(let w=0;w<p.length;w++)p[w]=d.charCodeAt(w);return he.some(new Blob([p],{type:n}))},wj=n=>new Promise((i,l)=>{SR(n).bind(({type:d,data:p,base64Encoded:w})=>_8(d,p,w)).fold(()=>l("Invalid data URI"),i)}),C8=n=>xr(n,"blob:")?vj(n):xr(n,"data:")?wj(n):Promise.reject("Unknown URI format"),S8=n=>new Promise((i,l)=>{const d=new FileReader;d.onloadend=()=>{i(d.result)},d.onerror=()=>{var p;l((p=d.error)===null||p===void 0?void 0:p.message)},d.readAsDataURL(n)});let Cx=0;const k8=n=>(n||"blobid")+Cx++,E8=(n,i,l)=>SR(n).bind(({data:d,type:p,base64Encoded:w})=>{if(i&&!w)return he.none();{const E=w?d:btoa(d);return l(E,p)}}),kR=(n,i,l)=>{const d=n.create(k8(),i,l);return n.add(d),d},x8=(n,i,l=!1)=>E8(i,l,(d,p)=>he.from(n.getByData(d,p)).orThunk(()=>_8(p,d).map(w=>kR(n,w,d)))),A8=(n,i)=>{const l=()=>Promise.reject("Invalid data URI");if(xr(i,"blob:")){const d=n.getByUri(i);return _e(d)?Promise.resolve(d):C8(i).then(p=>S8(p).then(w=>E8(w,!1,E=>he.some(kR(n,p,E))).getOrThunk(l)))}else return xr(i,"data:")?x8(n,i).fold(l,d=>Promise.resolve(d)):Promise.reject("Unknown image data format")},_j=n=>_e(n.attr("data-mce-bogus")),Cj=n=>n.attr("src")===Kn.transparentSrc||_e(n.attr("data-mce-placeholder")),T8=(n,i)=>{const{blob_cache:l}=i;if(l){const d=p=>{const w=p.attr("src");Cj(p)||_j(p)||De(w)||x8(l,w,!0).each(E=>{p.attr("src",E.blobUri())})};n.addAttributeFilter("src",p=>Pe(p,d))}},D8=(n,i)=>{const l=n.schema;i.remove_trailing_brs&&CR(i,n,l),n.addAttributeFilter("href",p=>{let w=p.length;const E=B=>B.split(" ").filter(ie=>ie.length>0).concat(["noopener"]).sort().join(" "),R=B=>{const K=B?hn.trim(B):"";return/\b(noopener)\b/g.test(K)?K:E(K)};if(!i.allow_unsafe_link_target)for(;w--;){const B=p[w];B.name==="a"&&B.attr("target")==="_blank"&&B.attr("rel",R(B.attr("rel")))}}),i.allow_html_in_named_anchor||n.addAttributeFilter("id,name",p=>{let w=p.length,E,R,B,K;for(;w--;)if(K=p[w],K.name==="a"&&K.firstChild&&!K.attr("href"))for(B=K.parent,E=K.lastChild;E&&B;)R=E.prev,B.insert(E,K),E=R}),i.fix_list_elements&&n.addNodeFilter("ul,ol",p=>{let w=p.length,E,R;for(;w--;)if(E=p[w],R=E.parent,R&&(R.name==="ul"||R.name==="ol"))if(E.prev&&E.prev.name==="li")E.prev.append(E);else{const B=new Hd("li",1);B.attr("style","list-style-type: none"),E.wrap(B)}});const d=l.getValidClasses();i.validate&&d&&n.addAttributeFilter("class",p=>{var w;let E=p.length;for(;E--;){const R=p[E],B=(w=R.attr("class"))!==null&&w!==void 0?w:"",K=hn.explode(B," ");let ie="";for(let ue=0;ue<K.length;ue++){const pe=K[ue];let Be=!1,Ze=d["*"];Ze&&Ze[pe]&&(Be=!0),Ze=d[R.name],!Be&&Ze&&Ze[pe]&&(Be=!0),Be&&(ie&&(ie+=" "),ie+=pe)}ie.length||(ie=null),R.attr("class",ie)}}),T8(n,i)};function Cy(n){return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Cy(n)}function ST(n,i){return ST=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ST(n,i)}function O8(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sx(n,i,l){return O8()?Sx=Reflect.construct:Sx=function(p,w,E){var R=[null];R.push.apply(R,w);var B=Function.bind.apply(p,R),K=new B;return E&&ST(K,E.prototype),K},Sx.apply(null,arguments)}function l1(n){return Sj(n)||kj(n)||ER(n)||M8()}function Sj(n){if(Array.isArray(n))return Zw(n)}function kj(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ER(n,i){if(!!n){if(typeof n=="string")return Zw(n,i);var l=Object.prototype.toString.call(n).slice(8,-1);if(l==="Object"&&n.constructor&&(l=n.constructor.name),l==="Map"||l==="Set")return Array.from(n);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return Zw(n,i)}}function Zw(n,i){(i==null||i>n.length)&&(i=n.length);for(var l=0,d=new Array(i);l<i;l++)d[l]=n[l];return d}function M8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var R8=Object.hasOwnProperty,kx=Object.setPrototypeOf,Ej=Object.isFrozen,xj=Object.getPrototypeOf,Sy=Object.getOwnPropertyDescriptor,rd=Object.freeze,c1=Object.seal,Ex=Object.create,xR=typeof Reflect<"u"&&Reflect,vS=xR.apply,kT=xR.construct;vS||(vS=function(i,l,d){return i.apply(l,d)}),rd||(rd=function(i){return i}),c1||(c1=function(i){return i}),kT||(kT=function(i,l){return Sx(i,l1(l))});var N8=yg(Array.prototype.forEach),Aj=yg(Array.prototype.pop),xx=yg(Array.prototype.push),ET=yg(String.prototype.toLowerCase),AR=yg(String.prototype.match),ky=yg(String.prototype.replace),P8=yg(String.prototype.indexOf),Tj=yg(String.prototype.trim),xh=yg(RegExp.prototype.test),TR=Nf(TypeError);function yg(n){return function(i){for(var l=arguments.length,d=new Array(l>1?l-1:0),p=1;p<l;p++)d[p-1]=arguments[p];return vS(n,i,d)}}function Nf(n){return function(){for(var i=arguments.length,l=new Array(i),d=0;d<i;d++)l[d]=arguments[d];return kT(n,l)}}function Ni(n,i){kx&&kx(n,null);for(var l=i.length;l--;){var d=i[l];if(typeof d=="string"){var p=ET(d);p!==d&&(Ej(i)||(i[l]=p),d=p)}n[d]=!0}return n}function w0(n){var i=Ex(null),l;for(l in n)vS(R8,n,[l])&&(i[l]=n[l]);return i}function _0(n,i){for(;n!==null;){var l=Sy(n,i);if(l){if(l.get)return yg(l.get);if(typeof l.value=="function")return yg(l.value)}n=xj(n)}function d(p){return console.warn("fallback value for",p),null}return d}var DR=rd(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),id=rd(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Kb=rd(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I8=rd(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),OR=rd(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),B8=rd(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),L8=rd(["#text"]),MR=rd(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),qw=rd(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),xT=rd(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),AT=rd(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),F8=c1(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Dj=c1(/<%[\w\W]*|[\w\W]*%>/gm),RR=c1(/^data-[\-\w.\u00B7-\uFFFF]/),NR=c1(/^aria-[\-\w]+$/),Oj=c1(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mj=c1(/^(?:\w+script|data):/i),C0=c1(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),PR=c1(/^html$/i),Rj=function(){return typeof window>"u"?null:window},IR=function(i,l){if(Cy(i)!=="object"||typeof i.createPolicy!="function")return null;var d=null,p="data-tt-policy-suffix";l.currentScript&&l.currentScript.hasAttribute(p)&&(d=l.currentScript.getAttribute(p));var w="dompurify"+(d?"#"+d:"");try{return i.createPolicy(w,{createHTML:function(R){return R}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}};function TT(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rj(),i=function(qt){return TT(qt)};if(i.version="2.3.8",i.removed=[],!n||!n.document||n.document.nodeType!==9)return i.isSupported=!1,i;var l=n.document,d=n.document,p=n.DocumentFragment,w=n.HTMLTemplateElement,E=n.Node,R=n.Element,B=n.NodeFilter,K=n.NamedNodeMap,ie=K===void 0?n.NamedNodeMap||n.MozNamedAttrMap:K,ue=n.HTMLFormElement,pe=n.DOMParser,Be=n.trustedTypes,Ze=R.prototype,Oe=_0(Ze,"cloneNode"),ze=_0(Ze,"nextSibling"),ht=_0(Ze,"childNodes"),bt=_0(Ze,"parentNode");if(typeof w=="function"){var vt=d.createElement("template");vt.content&&vt.content.ownerDocument&&(d=vt.content.ownerDocument)}var Mt=IR(Be,l),fn=Mt?Mt.createHTML(""):"",$n=d,Pn=$n.implementation,Lt=$n.createNodeIterator,$t=$n.createDocumentFragment,yn=$n.getElementsByTagName,mo=l.importNode,Oo={};try{Oo=w0(d).documentMode?d.documentMode:{}}catch{}var Cs={};i.isSupported=typeof bt=="function"&&Pn&&typeof Pn.createHTMLDocument<"u"&&Oo!==9;var Us=F8,Pr=Dj,di=RR,il=NR,Rl=Mj,hc=C0,Mn=Oj,Qn=null,yr=Ni({},[].concat(l1(DR),l1(id),l1(Kb),l1(OR),l1(L8))),Bs=null,vo=Ni({},[].concat(l1(MR),l1(qw),l1(xT),l1(AT))),Rn=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Tn=null,jo=null,Ys=!0,Kr=!0,io=!1,Ws=!1,ii=!1,Ka=!1,Ci=!1,Ec=!1,Mh=!1,zd=!1,_m=!0,Fy=!0,v_=!1,Hy={},$y=null,bD=Ni({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),vD=null,yD=Ni({},["audio","video","img","source","image","track"]),CA=null,SA=Ni({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kA="http://www.w3.org/1998/Math/MathML",GS="http://www.w3.org/2000/svg",w1="http://www.w3.org/1999/xhtml",KS=w1,y_=!1,cv,EA=["application/xhtml+xml","text/html"],xA="text/html",A0,uv=null,AA=d.createElement("form"),TA=function(qt){return qt instanceof RegExp||qt instanceof Function},DA=function(qt){uv&&uv===qt||((!qt||Cy(qt)!=="object")&&(qt={}),qt=w0(qt),Qn="ALLOWED_TAGS"in qt?Ni({},qt.ALLOWED_TAGS):yr,Bs="ALLOWED_ATTR"in qt?Ni({},qt.ALLOWED_ATTR):vo,CA="ADD_URI_SAFE_ATTR"in qt?Ni(w0(SA),qt.ADD_URI_SAFE_ATTR):SA,vD="ADD_DATA_URI_TAGS"in qt?Ni(w0(yD),qt.ADD_DATA_URI_TAGS):yD,$y="FORBID_CONTENTS"in qt?Ni({},qt.FORBID_CONTENTS):bD,Tn="FORBID_TAGS"in qt?Ni({},qt.FORBID_TAGS):{},jo="FORBID_ATTR"in qt?Ni({},qt.FORBID_ATTR):{},Hy="USE_PROFILES"in qt?qt.USE_PROFILES:!1,Ys=qt.ALLOW_ARIA_ATTR!==!1,Kr=qt.ALLOW_DATA_ATTR!==!1,io=qt.ALLOW_UNKNOWN_PROTOCOLS||!1,Ws=qt.SAFE_FOR_TEMPLATES||!1,ii=qt.WHOLE_DOCUMENT||!1,Ec=qt.RETURN_DOM||!1,Mh=qt.RETURN_DOM_FRAGMENT||!1,zd=qt.RETURN_TRUSTED_TYPE||!1,Ci=qt.FORCE_BODY||!1,_m=qt.SANITIZE_DOM!==!1,Fy=qt.KEEP_CONTENT!==!1,v_=qt.IN_PLACE||!1,Mn=qt.ALLOWED_URI_REGEXP||Mn,KS=qt.NAMESPACE||w1,qt.CUSTOM_ELEMENT_HANDLING&&TA(qt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Rn.tagNameCheck=qt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),qt.CUSTOM_ELEMENT_HANDLING&&TA(qt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Rn.attributeNameCheck=qt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),qt.CUSTOM_ELEMENT_HANDLING&&typeof qt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Rn.allowCustomizedBuiltInElements=qt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),cv=EA.indexOf(qt.PARSER_MEDIA_TYPE)===-1?cv=xA:cv=qt.PARSER_MEDIA_TYPE,A0=cv==="application/xhtml+xml"?function(bo){return bo}:ET,Ws&&(Kr=!1),Mh&&(Ec=!0),Hy&&(Qn=Ni({},l1(L8)),Bs=[],Hy.html===!0&&(Ni(Qn,DR),Ni(Bs,MR)),Hy.svg===!0&&(Ni(Qn,id),Ni(Bs,qw),Ni(Bs,AT)),Hy.svgFilters===!0&&(Ni(Qn,Kb),Ni(Bs,qw),Ni(Bs,AT)),Hy.mathMl===!0&&(Ni(Qn,OR),Ni(Bs,xT),Ni(Bs,AT))),qt.ADD_TAGS&&(Qn===yr&&(Qn=w0(Qn)),Ni(Qn,qt.ADD_TAGS)),qt.ADD_ATTR&&(Bs===vo&&(Bs=w0(Bs)),Ni(Bs,qt.ADD_ATTR)),qt.ADD_URI_SAFE_ATTR&&Ni(CA,qt.ADD_URI_SAFE_ATTR),qt.FORBID_CONTENTS&&($y===bD&&($y=w0($y)),Ni($y,qt.FORBID_CONTENTS)),Fy&&(Qn["#text"]=!0),ii&&Ni(Qn,["html","head","body"]),Qn.table&&(Ni(Qn,["tbody"]),delete Tn.tbody),rd&&rd(qt),uv=qt)},wD=Ni({},["mi","mo","mn","ms","mtext"]),_D=Ni({},["foreignobject","desc","title","annotation-xml"]),D$=Ni({},["title","style","font","a","script"]),_1=Ni({},id);Ni(_1,Kb),Ni(_1,I8);var w_=Ni({},OR);Ni(w_,B8);var Rt=function(qt){var bo=bt(qt);(!bo||!bo.tagName)&&(bo={namespaceURI:w1,tagName:"template"});var ys=ET(qt.tagName),yl=ET(bo.tagName);return qt.namespaceURI===GS?bo.namespaceURI===w1?ys==="svg":bo.namespaceURI===kA?ys==="svg"&&(yl==="annotation-xml"||wD[yl]):Boolean(_1[ys]):qt.namespaceURI===kA?bo.namespaceURI===w1?ys==="math":bo.namespaceURI===GS?ys==="math"&&_D[yl]:Boolean(w_[ys]):qt.namespaceURI===w1?bo.namespaceURI===GS&&!_D[yl]||bo.namespaceURI===kA&&!wD[yl]?!1:!w_[ys]&&(D$[ys]||!_1[ys]):!1},Nt=function(qt){xx(i.removed,{element:qt});try{qt.parentNode.removeChild(qt)}catch{try{qt.outerHTML=fn}catch{qt.remove()}}},Nn=function(qt,bo){try{xx(i.removed,{attribute:bo.getAttributeNode(qt),from:bo})}catch{xx(i.removed,{attribute:null,from:bo})}if(bo.removeAttribute(qt),qt==="is"&&!Bs[qt])if(Ec||Mh)try{Nt(bo)}catch{}else try{bo.setAttribute(qt,"")}catch{}},En=function(qt){var bo,ys;if(Ci)qt="<remove></remove>"+qt;else{var yl=AR(qt,/^[\r\n\t ]+/);ys=yl&&yl[0]}cv==="application/xhtml+xml"&&(qt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+qt+"</body></html>");var Cm=Mt?Mt.createHTML(qt):qt;if(KS===w1)try{bo=new pe().parseFromString(Cm,cv)}catch{}if(!bo||!bo.documentElement){bo=Pn.createDocument(KS,"template",null);try{bo.documentElement.innerHTML=y_?"":Cm}catch{}}var Vd=bo.body||bo.documentElement;return qt&&ys&&Vd.insertBefore(d.createTextNode(ys),Vd.childNodes[0]||null),KS===w1?yn.call(bo,ii?"html":"body")[0]:ii?bo.documentElement:Vd},Io=function(qt){return Lt.call(qt.ownerDocument||qt,qt,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null,!1)},dr=function(qt){return qt instanceof ue&&(typeof qt.nodeName!="string"||typeof qt.textContent!="string"||typeof qt.removeChild!="function"||!(qt.attributes instanceof ie)||typeof qt.removeAttribute!="function"||typeof qt.setAttribute!="function"||typeof qt.namespaceURI!="string"||typeof qt.insertBefore!="function")},la=function(qt){return Cy(E)==="object"?qt instanceof E:qt&&Cy(qt)==="object"&&typeof qt.nodeType=="number"&&typeof qt.nodeName=="string"},xc=function(qt,bo,ys){!Cs[qt]||N8(Cs[qt],function(yl){yl.call(i,bo,ys,uv)})},du=function(qt){var bo;if(xc("beforeSanitizeElements",qt,null),dr(qt)||xh(/[\u0080-\uFFFF]/,qt.nodeName))return Nt(qt),!0;var ys=A0(qt.nodeName);if(xc("uponSanitizeElement",qt,{tagName:ys,allowedTags:Qn}),qt.hasChildNodes()&&!la(qt.firstElementChild)&&(!la(qt.content)||!la(qt.content.firstElementChild))&&xh(/<[/\w]/g,qt.innerHTML)&&xh(/<[/\w]/g,qt.textContent)||ys==="select"&&xh(/<template/i,qt.innerHTML))return Nt(qt),!0;if(!Qn[ys]||Tn[ys]){if(!Tn[ys]&&MA(ys)&&(Rn.tagNameCheck instanceof RegExp&&xh(Rn.tagNameCheck,ys)||Rn.tagNameCheck instanceof Function&&Rn.tagNameCheck(ys)))return!1;if(Fy&&!$y[ys]){var yl=bt(qt)||qt.parentNode,Cm=ht(qt)||qt.childNodes;if(Cm&&yl)for(var Vd=Cm.length,Pf=Vd-1;Pf>=0;--Pf)yl.insertBefore(Oe(Cm[Pf],!0),ze(qt))}return Nt(qt),!0}return qt instanceof R&&!Rt(qt)||(ys==="noscript"||ys==="noembed")&&xh(/<\/no(script|embed)/i,qt.innerHTML)?(Nt(qt),!0):(Ws&&qt.nodeType===3&&(bo=qt.textContent,bo=ky(bo,Us," "),bo=ky(bo,Pr," "),qt.textContent!==bo&&(xx(i.removed,{element:qt.cloneNode()}),qt.textContent=bo)),xc("afterSanitizeElements",qt,null),!1)},OA=function(qt,bo,ys){if(_m&&(bo==="id"||bo==="name")&&(ys in d||ys in AA))return!1;if(!(Kr&&!jo[bo]&&xh(di,bo))){if(!(Ys&&xh(il,bo))){if(!Bs[bo]||jo[bo]){if(!(MA(qt)&&(Rn.tagNameCheck instanceof RegExp&&xh(Rn.tagNameCheck,qt)||Rn.tagNameCheck instanceof Function&&Rn.tagNameCheck(qt))&&(Rn.attributeNameCheck instanceof RegExp&&xh(Rn.attributeNameCheck,bo)||Rn.attributeNameCheck instanceof Function&&Rn.attributeNameCheck(bo))||bo==="is"&&Rn.allowCustomizedBuiltInElements&&(Rn.tagNameCheck instanceof RegExp&&xh(Rn.tagNameCheck,ys)||Rn.tagNameCheck instanceof Function&&Rn.tagNameCheck(ys))))return!1}else if(!CA[bo]){if(!xh(Mn,ky(ys,hc,""))){if(!((bo==="src"||bo==="xlink:href"||bo==="href")&&qt!=="script"&&P8(ys,"data:")===0&&vD[qt])){if(!(io&&!xh(Rl,ky(ys,hc,"")))){if(ys)return!1}}}}}}return!0},MA=function(qt){return qt.indexOf("-")>0},X6=function(qt){var bo,ys,yl,Cm;xc("beforeSanitizeAttributes",qt,null);var Vd=qt.attributes;if(!!Vd){var Pf={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Bs};for(Cm=Vd.length;Cm--;){bo=Vd[Cm];var YS=bo,ld=YS.name,O$=YS.namespaceURI;ys=ld==="value"?bo.value:Tj(bo.value),yl=A0(ld);var M$=ys;if(Pf.attrName=yl,Pf.attrValue=ys,Pf.keepAttr=!0,Pf.forceKeepAttr=void 0,xc("uponSanitizeAttribute",qt,Pf),ys=Pf.attrValue,!Pf.forceKeepAttr){if(!Pf.keepAttr){Nn(ld,qt);continue}if(xh(/\/>/i,ys)){Nn(ld,qt);continue}Ws&&(ys=ky(ys,Us," "),ys=ky(ys,Pr," "));var Ree=A0(qt.nodeName);if(!OA(Ree,yl,ys)){Nn(ld,qt);continue}if(ys!==M$)try{O$?qt.setAttributeNS(O$,ld,ys):qt.setAttribute(ld,ys)}catch{Nn(ld,qt)}}}xc("afterSanitizeAttributes",qt,null)}},Mee=function zs(qt){var bo,ys=Io(qt);for(xc("beforeSanitizeShadowDOM",qt,null);bo=ys.nextNode();)xc("uponSanitizeShadowNode",bo,null),!du(bo)&&(bo.content instanceof p&&zs(bo.content),X6(bo));xc("afterSanitizeShadowDOM",qt,null)};return i.sanitize=function(zs,qt){var bo,ys,yl,Cm,Vd;if(y_=!zs,y_&&(zs="<!-->"),typeof zs!="string"&&!la(zs)){if(typeof zs.toString!="function")throw TR("toString is not a function");if(zs=zs.toString(),typeof zs!="string")throw TR("dirty is not a string, aborting")}if(!i.isSupported){if(Cy(n.toStaticHTML)==="object"||typeof n.toStaticHTML=="function"){if(typeof zs=="string")return n.toStaticHTML(zs);if(la(zs))return n.toStaticHTML(zs.outerHTML)}return zs}if(Ka||DA(qt),i.removed=[],typeof zs=="string"&&(v_=!1),v_){if(zs.nodeName){var Pf=A0(zs.nodeName);if(!Qn[Pf]||Tn[Pf])throw TR("root node is forbidden and cannot be sanitized in-place")}}else if(zs instanceof E)bo=En("<!---->"),ys=bo.ownerDocument.importNode(zs,!0),ys.nodeType===1&&ys.nodeName==="BODY"||ys.nodeName==="HTML"?bo=ys:bo.appendChild(ys);else{if(!Ec&&!Ws&&!ii&&zs.indexOf("<")===-1)return Mt&&zd?Mt.createHTML(zs):zs;if(bo=En(zs),!bo)return Ec?null:zd?fn:""}bo&&Ci&&Nt(bo.firstChild);for(var YS=Io(v_?zs:bo);yl=YS.nextNode();)yl.nodeType===3&&yl===Cm||du(yl)||(yl.content instanceof p&&Mee(yl.content),X6(yl),Cm=yl);if(Cm=null,v_)return zs;if(Ec){if(Mh)for(Vd=$t.call(bo.ownerDocument);bo.firstChild;)Vd.appendChild(bo.firstChild);else Vd=bo;return Bs.shadowroot&&(Vd=mo.call(l,Vd,!0)),Vd}var ld=ii?bo.outerHTML:bo.innerHTML;return ii&&Qn["!doctype"]&&bo.ownerDocument&&bo.ownerDocument.doctype&&bo.ownerDocument.doctype.name&&xh(PR,bo.ownerDocument.doctype.name)&&(ld="<!DOCTYPE "+bo.ownerDocument.doctype.name+`>
`+ld),Ws&&(ld=ky(ld,Us," "),ld=ky(ld,Pr," ")),Mt&&zd?Mt.createHTML(ld):ld},i.setConfig=function(zs){DA(zs),Ka=!0},i.clearConfig=function(){uv=null,Ka=!1},i.isValidAttribute=function(zs,qt,bo){uv||DA({});var ys=A0(zs),yl=A0(qt);return OA(ys,yl,bo)},i.addHook=function(zs,qt){typeof qt=="function"&&(Cs[zs]=Cs[zs]||[],xx(Cs[zs],qt))},i.removeHook=function(zs){if(Cs[zs])return Aj(Cs[zs])},i.removeHooks=function(zs){Cs[zs]&&(Cs[zs]=[])},i.removeAllHooks=function(){Cs={}},i}var H8=TT();const BR=hn.each,$8=hn.trim,Nj=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Pj={ftp:21,http:80,https:443,mailto:25},Ij=["img","video"],Bj=(n,i)=>_e(n)?!n:_e(i)?!Ct(Ij,i):!0,Lj=n=>{try{return decodeURIComponent(n)}catch{return unescape(n)}},LR=(n,i,l)=>{const d=Lj(i).replace(/\s/g,"");return n.allow_script_urls?!1:/((java|vb)script|mhtml):/i.test(d)?!0:n.allow_html_data_urls?!1:/^data:image\//i.test(d)?Bj(n.allow_svg_data_urls,l)&&/^data:image\/svg\+xml/i.test(d):/^data:/i.test(d)};class u1{static parseDataUri(i){let l;const d=decodeURIComponent(i).split(","),p=/data:([^;]+)/.exec(d[0]);return p&&(l=p[1]),{type:l,data:d[1]}}static isDomSafe(i,l,d={}){if(d.allow_script_urls)return!0;{const p=Yg.decode(i).replace(/[\s\u0000-\u001F]+/g,"");return!LR(d,p,l)}}static getDocumentBaseUrl(i){var l;let d;return i.protocol.indexOf("http")!==0&&i.protocol!=="file:"?d=(l=i.href)!==null&&l!==void 0?l:"":d=i.protocol+"//"+i.host+i.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(d)&&(d=d.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(d)||(d+="/")),d}constructor(i,l={}){this.path="",this.directory="",i=$8(i),this.settings=l;const d=l.base_uri,p=this;if(/^([\w\-]+):([^\/]{2})/i.test(i)||/^\s*#/.test(i)){p.source=i;return}const w=i.indexOf("//")===0;if(i.indexOf("/")===0&&!w&&(i=(d&&d.protocol||"http")+"://mce_host"+i),!/^[\w\-]*:?\/\//.test(i)){const R=d?d.path:new u1(document.location.href).directory;if((d==null?void 0:d.protocol)==="")i="//mce_host"+p.toAbsPath(R,i);else{const B=/([^#?]*)([#?]?.*)/.exec(i);B&&(i=(d&&d.protocol||"http")+"://mce_host"+p.toAbsPath(R,B[1])+B[2])}}i=i.replace(/@@/g,"(mce_at)");const E=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(i);E&&BR(Nj,(R,B)=>{let K=E[B];K&&(K=K.replace(/\(mce_at\)/g,"@@")),p[R]=K}),d&&(p.protocol||(p.protocol=d.protocol),p.userInfo||(p.userInfo=d.userInfo),!p.port&&p.host==="mce_host"&&(p.port=d.port),(!p.host||p.host==="mce_host")&&(p.host=d.host),p.source=""),w&&(p.protocol="")}setPath(i){const l=/^(.*?)\/?(\w+)?$/.exec(i);l&&(this.path=l[0],this.directory=l[1],this.file=l[2]),this.source="",this.getURI()}toRelative(i){if(i==="./")return i;const l=new u1(i,{base_uri:this});if(l.host!=="mce_host"&&this.host!==l.host&&l.host||this.port!==l.port||this.protocol!==l.protocol&&l.protocol!=="")return l.getURI();const d=this.getURI(),p=l.getURI();if(d===p||d.charAt(d.length-1)==="/"&&d.substr(0,d.length-1)===p)return d;let w=this.toRelPath(this.path,l.path);return l.query&&(w+="?"+l.query),l.anchor&&(w+="#"+l.anchor),w}toAbsolute(i,l){const d=new u1(i,{base_uri:this});return d.getURI(l&&this.isSameOrigin(d))}isSameOrigin(i){if(this.host==i.host&&this.protocol==i.protocol){if(this.port==i.port)return!0;const l=this.protocol?Pj[this.protocol]:null;if(l&&(this.port||l)==(i.port||l))return!0}return!1}toRelPath(i,l){let d=0,p="",w,E;const R=i.substring(0,i.lastIndexOf("/")).split("/"),B=l.split("/");if(R.length>=B.length){for(w=0,E=R.length;w<E;w++)if(w>=B.length||R[w]!==B[w]){d=w+1;break}}if(R.length<B.length){for(w=0,E=B.length;w<E;w++)if(w>=R.length||R[w]!==B[w]){d=w+1;break}}if(d===1)return l;for(w=0,E=R.length-(d-1);w<E;w++)p+="../";for(w=d-1,E=B.length;w<E;w++)w!==d-1?p+="/"+B[w]:p+=B[w];return p}toAbsPath(i,l){let d=0;const p=/\/$/.test(l)?"/":"",w=i.split("/"),E=l.split("/"),R=[];BR(w,ue=>{ue&&R.push(ue)});const B=[];for(let ue=E.length-1;ue>=0;ue--)if(!(E[ue].length===0||E[ue]===".")){if(E[ue]===".."){d++;continue}if(d>0){d--;continue}B.push(E[ue])}const K=R.length-d;let ie;return K<=0?ie=Zs(B).join("/"):ie=R.slice(0,K).join("/")+"/"+Zs(B).join("/"),ie.indexOf("/")!==0&&(ie="/"+ie),p&&ie.lastIndexOf("/")!==ie.length-1&&(ie+=p),ie}getURI(i=!1){let l;return(!this.source||i)&&(l="",i||(this.protocol?l+=this.protocol+"://":l+="//",this.userInfo&&(l+=this.userInfo+"@"),this.host&&(l+=this.host),this.port&&(l+=":"+this.port)),this.path&&(l+=this.path),this.query&&(l+="?"+this.query),this.anchor&&(l+="#"+this.anchor),this.source=l),this.source}}const Fj=hn.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),FR="data-mce-type";let HR=0;const DT=(n,i,l,d)=>{var p,w,E,R;const B=i.validate,K=l.getSpecialElements();n.nodeType===zu&&!i.allow_conditional_comments&&/^\[if/i.test((p=n.nodeValue)!==null&&p!==void 0?p:"")&&(n.nodeValue=" "+n.nodeValue);const ie=(w=d==null?void 0:d.tagName)!==null&&w!==void 0?w:n.nodeName.toLowerCase();if(n.nodeType!==$f||ie==="body")return;const ue=Ke.fromDom(n),pe=qi(ue,FR),Be=Pl(ue,"data-mce-bogus");if(!pe&&F(Be)){Be==="all"?pr(ue):ql(ue);return}const Ze=l.getElementRule(ie);if(B&&!Ze){cn(K,ie)?pr(ue):ql(ue);return}else _e(d)&&(d.allowedTags[ie]=!0);if(B&&Ze&&!pe){if(Pe((E=Ze.attributesForced)!==null&&E!==void 0?E:[],Oe=>{Tr(ue,Oe.name,Oe.value==="{$uid}"?`mce_${HR++}`:Oe.value)}),Pe((R=Ze.attributesDefault)!==null&&R!==void 0?R:[],Oe=>{qi(ue,Oe.name)||Tr(ue,Oe.name,Oe.value==="{$uid}"?`mce_${HR++}`:Oe.value)}),Ze.attributesRequired&&!Jt(Ze.attributesRequired,Oe=>qi(ue,Oe))){ql(ue);return}if(Ze.removeEmptyAttrs&&rc(ue)){ql(ue);return}Ze.outputName&&Ze.outputName!==ie&&J_(ue,Ze.outputName)}},$R=(n,i,l,d,p)=>!(d in Fj&&LR(n,p,l))&&(!n.validate||i.isValid(l,d)||xr(d,"data-")||xr(d,"aria-")),zR=(n,i)=>n.hasAttribute(FR)&&(i==="id"||i==="class"||i==="style"),OT=(n,i)=>n in i.getBoolAttrs(),z8=(n,i,l)=>{const{attributes:d}=n;for(let p=d.length-1;p>=0;p--){const w=d[p],E=w.name,R=w.value;!$R(i,l,n.tagName.toLowerCase(),E,R)&&!zR(n,E)?n.removeAttribute(E):OT(E,l)&&n.setAttribute(E,E)}},V8=(n,i)=>{const l=H8();return l.addHook("uponSanitizeElement",(d,p)=>{DT(d,n,i,p)}),l.addHook("uponSanitizeAttribute",(d,p)=>{const w=d.tagName.toLowerCase(),{attrName:E,attrValue:R}=p;p.keepAttr=$R(n,i,w,E,R),p.keepAttr?(p.allowedAttributes[E]=!0,OT(E,i)&&(p.attrValue=E),n.allow_svg_data_urls&&xr(R,"data:image/svg+xml")&&(p.forceKeepAttr=!0)):zR(d,E)&&(p.forceKeepAttr=!0)}),l},U8=(n,i)=>{const d={...{IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]}};return d.PARSER_MEDIA_TYPE=i,n.allow_script_urls?d.ALLOWED_URI_REGEXP=/.*/:n.allow_html_data_urls&&(d.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),d},W8=(n,i)=>{if(n.sanitize){const l=V8(n,i);return(d,p)=>{l.sanitize(d,U8(n,p)),l.removed=[]}}else return(l,d)=>{const p=document.createNodeIterator(l,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let w;for(;w=p.nextNode();)DT(w,n,i),Xn(w)&&z8(w,n,i)}},j8=hn.makeMap,MT=hn.extend,Z8=(n,i,l)=>{const d=n.name,p=d in l&&d!=="title"&&d!=="textarea",w=i.childNodes;for(let E=0,R=w.length;E<R;E++){const B=w[E],K=new Hd(B.nodeName.toLowerCase(),B.nodeType);if(Xn(B)){const ie=B.attributes;for(let ue=0,pe=ie.length;ue<pe;ue++){const Be=ie[ue];K.attr(Be.name,Be.value)}}else _n(B)?(K.value=B.data,p&&(K.raw=!0)):(th(B)||$m(B)||Sd(B))&&(K.value=B.data);Z8(K,B,l),n.append(K)}},RT=(n,i,l)=>{const d=[];for(let p=n,w=p;p;w=p,p=p.walk()){const E=p;Pe(i,R=>R(E)),De(E.parent)&&E!==n?p=w:d.push(E)}for(let p=d.length-1;p>=0;p--){const w=d[p];Pe(l,E=>E(w))}},Hj=(n,i,l,d)=>{const p=l.validate,w=i.getNonEmptyElements(),E=i.getWhitespaceElements(),R=MT(j8("script,style,head,html,body,title,meta,param"),i.getBlockElements()),B=Kf(i),K=/[ \t\r\n]+/g,ie=/^[ \t\r\n]+/,ue=/[ \t\r\n]+$/,pe=bt=>{let vt=bt.parent;for(;_e(vt);){if(vt.name in E)return!0;vt=vt.parent}return!1},Be=bt=>{let vt=bt;for(;_e(vt);){if(vt.name in B)return uS(i,w,E,vt);vt=vt.parent}return!1},Ze=bt=>bt.name in R||nr(i,bt),Oe=(bt,vt)=>{const Mt=vt?bt.prev:bt.next;return _e(Mt)||De(bt.parent)?!1:Ze(bt.parent)&&(bt.parent!==n||d.isRootContent===!0)};return[bt=>{var vt;if(bt.type===3&&!pe(bt)){let Mt=(vt=bt.value)!==null&&vt!==void 0?vt:"";Mt=Mt.replace(K," "),(xW(bt.prev,Ze)||Oe(bt,!0))&&(Mt=Mt.replace(ie,"")),Mt.length===0?bt.remove():bt.value=Mt}},bt=>{var vt;if(bt.type===1){const Mt=i.getElementRule(bt.name);if(p&&Mt){const fn=uS(i,w,E,bt);Mt.paddInEmptyBlock&&fn&&Be(bt)?mx(l,d,Ze,bt):Mt.removeEmpty&&fn?Ze(bt)?bt.remove():bt.unwrap():Mt.paddEmpty&&(fn||cT(bt))&&mx(l,d,Ze,bt)}}else if(bt.type===3&&!pe(bt)){let Mt=(vt=bt.value)!==null&&vt!==void 0?vt:"";(bt.next&&Ze(bt.next)||Oe(bt,!1))&&(Mt=Mt.replace(ue,"")),Mt.length===0?bt.remove():bt.value=Mt}}]},$j=(n,i)=>{var l;const d=(l=i.forced_root_block)!==null&&l!==void 0?l:n.forced_root_block;return d===!1?"":d===!0?"p":d},yS=(n={},i=dh())=>{const l=wR(),d=wR(),p={validate:!0,root_name:"body",sanitize:!0,...n},w=new DOMParser,E=W8(p,i),R=(vt,Mt,fn="html")=>{const $n=fn==="xhtml"?"application/xhtml+xml":"text/html",Pn=cn(i.getSpecialElements(),Mt.toLowerCase()),Lt=Pn?`<${Mt}>${vt}</${Mt}>`:vt,$t=fn==="xhtml"?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${Lt}</body></html>`:`<body>${Lt}</body>`,yn=w.parseFromString($t,$n).body;return E(yn,$n),Pn?yn.firstChild:yn},B=l.addFilter,K=l.getFilters,ie=l.removeFilter,ue=d.addFilter,pe=d.getFilters,Be=d.removeFilter,Ze=(vt,Mt)=>{FB(i,vt)&&Mt.push(vt)},Oe=(vt,Mt)=>{const fn=F(Mt.attr(FR)),$n=Mt.type===1&&!cn(vt,Mt.name)&&!nr(i,Mt);return Mt.type===3||$n&&!fn},ze=(vt,Mt)=>{const fn=MT(j8("script,style,head,html,body,title,meta,param"),i.getBlockElements()),$n=/^[ \t\r\n]+/,Pn=/[ \t\r\n]+$/;let Lt=vt.firstChild,$t=null;const yn=mo=>{var Oo,Cs;mo&&(Lt=mo.firstChild,Lt&&Lt.type===3&&(Lt.value=(Oo=Lt.value)===null||Oo===void 0?void 0:Oo.replace($n,"")),Lt=mo.lastChild,Lt&&Lt.type===3&&(Lt.value=(Cs=Lt.value)===null||Cs===void 0?void 0:Cs.replace(Pn,"")))};if(!!i.isValidChild(vt.name,Mt.toLowerCase())){for(;Lt;){const mo=Lt.next;Oe(fn,Lt)?($t||($t=new Hd(Mt,1),$t.attr(p.forced_root_block_attrs),vt.insert($t,Lt)),$t.append(Lt)):(yn($t),$t=null),Lt=mo}yn($t)}},bt={schema:i,addAttributeFilter:ue,getAttributeFilters:pe,removeAttributeFilter:Be,addNodeFilter:B,getNodeFilters:K,removeNodeFilter:ie,parse:(vt,Mt={})=>{var fn;const $n=p.validate,Pn=(fn=Mt.context)!==null&&fn!==void 0?fn:p.root_name,Lt=R(vt,Pn,Mt.format);ob(i,Lt);const $t=new Hd(Pn,11);Z8($t,Lt,i.getSpecialElements()),Lt.innerHTML="";const[yn,mo]=Hj($t,i,p,Mt),Oo=[],Cs=$n?il=>Ze(il,Oo):ft,Us={nodes:{},attributes:{}},Pr=il=>SW(K(),pe(),il,Us);if(RT($t,[yn,Pr],[mo,Cs]),Oo.reverse(),$n&&Oo.length>0)if(Mt.context){const{pass:il,fail:Rl}=gn(Oo,hc=>hc.parent===$t);qM(Rl,i,$t,Pr),Mt.invalid=il.length>0}else qM(Oo,i,$t,Pr);const di=$j(p,Mt);return di&&($t.name==="body"||Mt.isRootContent)&&ze($t,di),Mt.invalid||lT(Us,Mt),$t}};return D8(bt,p),bj(bt,p,i),bt},q8=n=>mT(n)?Pw({validate:!1}).serialize(n):n,VR=(n,i,l)=>{const d=q8(n),p=i(d);if(p.isDefaultPrevented())return p;if(mT(n))if(p.content!==d){const w=yS({validate:!1,forced_root_block:!1,sanitize:l}).parse(p.content,{context:n.name});return{...p,content:w}}else return{...p,content:n};else return p},G8=(n,i)=>{if(i.no_events)return fc.value(i);{const l=fp(n,i);return l.isDefaultPrevented()?fc.error(UO(n,{content:"",...l}).content):fc.value(l)}},K8=(n,i,l)=>l.no_events?i:VR(i,p=>UO(n,{...l,content:p}),Xv(n)).content,UR=(n,i)=>{if(i.no_events)return fc.value(i);{const l=VR(i.content,d=>Vc(n,{...i,content:d}),Xv(n));return l.isDefaultPrevented()?(fu(n,l),fc.error(void 0)):fc.value(l)}},WR=(n,i,l)=>{l.no_events||fu(n,{...l,content:i})},jR=(n,i,l)=>({element:n,width:i,rows:l}),ZR=(n,i)=>({element:n,cells:i}),Bse=(n,i)=>({x:n,y:i}),Y8=(n,i)=>$a(n,i).bind(qc).getOr(1),zj=(n,i,l,d,p)=>{const w=Y8(p,"rowspan"),E=Y8(p,"colspan"),R=n.rows;for(let B=l;B<l+w;B++){R[B]||(R[B]=ZR(uc(d),[]));for(let K=i;K<i+E;K++){const ie=R[B].cells;ie[K]=B===l&&K===i?p:ng(p)}}},Vj=(n,i,l)=>{const d=n.rows;return!!(d[l]?d[l].cells:[])[i]},Uj=(n,i,l)=>{for(;Vj(n,i,l);)i++;return i},X8=n=>bn(n,(i,l)=>l.cells.length>i?l.cells.length:i,0),J8=(n,i)=>{const l=n.rows;for(let d=0;d<l.length;d++){const p=l[d].cells;for(let w=0;w<p.length;w++)if(pt(p[w],i))return he.some(Bse(w,d))}return he.none()},Q8=(n,i,l,d,p)=>{const w=[],E=n.rows;for(let R=l;R<=p;R++){const B=E[R].cells,K=i<d?B.slice(i,d+1):B.slice(d,i+1);w.push(ZR(E[R].element,K))}return w},eL=(n,i,l)=>{const d=i.x,p=i.y,w=l.x,E=l.y,R=p<E?Q8(n,d,p,w,E):Q8(n,d,E,w,p);return jR(n.element,X8(R),R)},Wj=(n,i)=>{const l=ng(n.element),d=Ke.fromTag("tbody");return Jr(d,i),Qi(l,d),l},jj=n=>Et(n.rows,i=>{const l=Et(i.cells,p=>{const w=uc(p);return Hi(w,"colspan"),Hi(w,"rowspan"),w}),d=ng(i.element);return Jr(d,l),d}),Zj=n=>{const i=jR(ng(n),0,[]);return Pe(dl(n,"tr"),(l,d)=>{Pe(dl(l,"td,th"),(p,w)=>{zj(i,Uj(i,w,d),d,l,p)})}),jR(i.element,X8(i.rows),i.rows)},qj=n=>Wj(n,jj(n)),Gj=(n,i,l)=>J8(n,i).bind(d=>J8(n,l).map(p=>eL(n,d,p))),Lse=n=>Jn(n,i=>Xr(i)==="ul"||Xr(i)==="ol"),Fse=(n,i)=>Jn(n,l=>Xr(l)==="li"&&cy(l,i)).fold(nt([]),l=>Lse(n).map(d=>{const p=Ke.fromTag(Xr(d)),w=Wt(qh(d),(E,R)=>xr(R,"list-style"));return ra(p,w),[Ke.fromTag("li"),p]}).getOr([])),Kj=(n,i)=>{const l=bn(i,(d,p)=>(Qi(p,d),p),n);return i.length>0?Bb([l]):l},Yj=n=>ja(n)?ai(n).filter(xu).fold(nt([]),i=>[n,i]):xu(n)?[n]:[],Hse=(n,i)=>{const l=Ke.fromDom(i.commonAncestorContainer),d=Vb(l,n),p=yt(d,Ho),w=Fse(d,i),E=p.concat(w.length?w:Yj(l));return Et(E,ng)},tL=()=>Bb([]),rl=(n,i)=>Kj(Ke.fromDom(i.cloneContents()),Hse(n,i)),qR=(n,i)=>Se(i,"table",He(pt,n)),$se=(n,i)=>qR(n,i[0]).bind(l=>{const d=i[0],p=i[i.length-1],w=Zj(l);return Gj(w,d,p).map(E=>Bb([qj(E)]))}).getOrThunk(tL),Xj=(n,i)=>i.length>0&&i[0].collapsed?tL():rl(n,i[0]),Jj=(n,i)=>{const l=pw(i,n);return l.length>0?$se(n,l):Xj(n,i)},Yb=(n,i)=>i>=0&&i<n.length&&_h(n.charAt(i)),Qj=n=>Bn(n.innerText),zse=n=>n.map(i=>i.nodeName).getOr("div").toLowerCase(),Bu=n=>he.from(n.selection.getRng()).map(i=>{var l;const d=he.from(n.dom.getParent(i.commonAncestorContainer,n.dom.isBlock)),p=n.getBody(),w=zse(d),E=Ke.fromDom(i.cloneContents());Z3(E),ZI(E);const R=n.dom.add(p,w,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},E.dom),B=Qj(R),K=Bn((l=R.textContent)!==null&&l!==void 0?l:"");if(n.dom.remove(R),Yb(K,0)||Yb(K,K.length-1)){const ie=d.getOr(p),ue=Qj(ie),pe=ue.indexOf(B);if(pe===-1)return B;{const Be=Yb(ue,pe-1),Ze=Yb(ue,pe+B.length);return(Be?" ":"")+B+(Ze?" ":"")}}else return B}).getOr(""),nL=(n,i)=>{const l=n.selection.getRng(),d=n.dom.create("body"),p=n.selection.getSel(),w=W3(n,TE(p)),E=i.contextual?Jj(Ke.fromDom(n.getBody()),w).dom:l.cloneContents();return E&&d.appendChild(E),n.selection.serializer.serialize(d,i)},oL=(n,i)=>{if(i.format==="text")return Bu(n);{const l=nL(n,i);return i.format==="tree"?l:n.selection.isCollapsed()?"":l}},sL=(n,i)=>({...n,format:i,get:!0,selection:!0,getInner:!0}),eZ=(n,i,l={})=>{const d=sL(l,i);return G8(n,d).fold(Ot,p=>{const w=oL(n,p);return K8(n,w,p)})},GR=0,Ax=1,rL=2,KR=(n,i)=>{const l=n.length+i.length+2,d=new Array(l),p=new Array(l),w=(ie,ue,pe)=>({start:ie,end:ue,diag:pe}),E=(ie,ue,pe,Be,Ze)=>{const Oe=B(ie,ue,pe,Be);if(Oe===null||Oe.start===ue&&Oe.diag===ue-Be||Oe.end===ie&&Oe.diag===ie-pe){let ze=ie,ht=pe;for(;ze<ue||ht<Be;)ze<ue&&ht<Be&&n[ze]===i[ht]?(Ze.push([GR,n[ze]]),++ze,++ht):ue-ie>Be-pe?(Ze.push([rL,n[ze]]),++ze):(Ze.push([Ax,i[ht]]),++ht)}else{E(ie,Oe.start,pe,Oe.start-Oe.diag,Ze);for(let ze=Oe.start;ze<Oe.end;++ze)Ze.push([GR,n[ze]]);E(Oe.end,ue,Oe.end-Oe.diag,Be,Ze)}},R=(ie,ue,pe,Be)=>{let Ze=ie;for(;Ze-ue<Be&&Ze<pe&&n[Ze]===i[Ze-ue];)++Ze;return w(ie,Ze,ue)},B=(ie,ue,pe,Be)=>{const Ze=ue-ie,Oe=Be-pe;if(Ze===0||Oe===0)return null;const ze=Ze-Oe,ht=Oe+Ze,bt=(ht%2===0?ht:ht+1)/2;d[1+bt]=ie,p[1+bt]=ue+1;let vt,Mt,fn,$n,Pn;for(vt=0;vt<=bt;++vt){for(Mt=-vt;Mt<=vt;Mt+=2){for(fn=Mt+bt,Mt===-vt||Mt!==vt&&d[fn-1]<d[fn+1]?d[fn]=d[fn+1]:d[fn]=d[fn-1]+1,$n=d[fn],Pn=$n-ie+pe-Mt;$n<ue&&Pn<Be&&n[$n]===i[Pn];)d[fn]=++$n,++Pn;if(ze%2!==0&&ze-vt<=Mt&&Mt<=ze+vt&&p[fn-ze]<=d[fn])return R(p[fn-ze],Mt+ie-pe,ue,Be)}for(Mt=ze-vt;Mt<=ze+vt;Mt+=2){for(fn=Mt+bt-ze,Mt===ze-vt||Mt!==ze+vt&&p[fn+1]<=p[fn-1]?p[fn]=p[fn+1]-1:p[fn]=p[fn-1],$n=p[fn]-1,Pn=$n-ie+pe-Mt;$n>=ie&&Pn>=pe&&n[$n]===i[Pn];)p[fn]=$n--,Pn--;if(ze%2===0&&-vt<=Mt&&Mt<=vt&&p[fn]<=d[fn+ze])return R(p[fn],Mt+ie-pe,ue,Be)}}return null},K=[];return E(0,n.length,0,i.length,K),K},iL=n=>Xn(n)?n.outerHTML:_n(n)?Yg.encodeRaw(n.data,!1):th(n)?"<!--"+n.data+"-->":"",aL=n=>{let i;const l=document.createElement("div"),d=document.createDocumentFragment();for(n&&(l.innerHTML=n);i=l.firstChild;)d.appendChild(i);return d},lL=(n,i,l)=>{const d=aL(i);if(n.hasChildNodes()&&l<n.childNodes.length){const p=n.childNodes[l];n.insertBefore(d,p)}else n.appendChild(d)},YR=(n,i)=>{if(n.hasChildNodes()&&i<n.childNodes.length){const l=n.childNodes[i];n.removeChild(l)}},cL=(n,i)=>{let l=0;Pe(n,d=>{d[0]===GR?l++:d[0]===Ax?(lL(i,d[1],l),l++):d[0]===rL&&YR(i,l)})},XR=n=>yt(Et(Mr(n.childNodes),iL),i=>i.length>0),tZ=(n,i)=>{const l=Et(Mr(i.childNodes),iL);return cL(KR(l,n),i),i},nZ=jt(()=>document.implementation.createHTMLDocument("undo")),oZ=n=>n.indexOf("</iframe>")!==-1,wg=n=>({type:"fragmented",fragments:n,content:"",bookmark:null,beforeBookmark:null}),sZ=n=>({type:"complete",fragments:null,content:n,bookmark:null,beforeBookmark:null}),NT=n=>{const i=XR(n.getBody()),l=Ns(i,p=>{const w=gM(n.serializer,p);return w.length>0?[w]:[]}),d=l.join("");return oZ(d)?wg(l):sZ(d)},JR=(n,i,l)=>{const d=l?i.beforeBookmark:i.bookmark;i.type==="fragmented"?tZ(i.fragments,n.getBody()):n.setContent(i.content,{format:"raw",no_selection:_e(d)&&t1(d)?!d.isFakeCaret:!0}),d&&(n.selection.moveToBookmark(d),n.selection.scrollIntoView())},QR=n=>n.type==="fragmented"?n.fragments.join(""):n.content,uL=n=>{const i=Ke.fromTag("body",nZ());return Cf(i,QR(n)),Pe(dl(i,"*[data-mce-bogus]"),ql),xe(i)},fL=(n,i)=>QR(n)===QR(i),rZ=(n,i)=>uL(n)===uL(i),e5=(n,i)=>!n||!i?!1:fL(n,i)?!0:rZ(n,i),t5=n=>n.get()===0,Gw=(n,i,l)=>{t5(l)&&(n.typing=i)},dL=(n,i)=>{n.typing&&(Gw(n,!1,i),n.add())},iZ=n=>{n.typing&&(n.typing=!1,n.add())},hL=(n,i,l)=>{t5(i)&&l.set(au(n.selection))},n5=(n,i,l,d,p,w,E)=>{const R=NT(n),B=hn.extend(w||{},R);if(!t5(d)||n.removed)return null;const K=i.data[l.get()];if(n.dispatch("BeforeAddUndo",{level:B,lastLevel:K,originalEvent:E}).isDefaultPrevented()||K&&e5(K,B))return null;i.data[l.get()]&&p.get().each(pe=>{i.data[l.get()].beforeBookmark=pe});const ie=ew(n);if(ie&&i.data.length>ie){for(let pe=0;pe<i.data.length-1;pe++)i.data[pe]=i.data[pe+1];i.data.length--,l.set(i.data.length)}B.bookmark=au(n.selection),l.get()<i.data.length-1&&(i.data.length=l.get()+1),i.data.push(B),l.set(i.data.length-1);const ue={level:B,lastLevel:K,originalEvent:E};return l.get()>0?(n.setDirty(!0),n.dispatch("AddUndo",ue),n.dispatch("change",ue)):n.dispatch("AddUndo",ue),B},aZ=(n,i,l)=>{i.data=[],l.set(0),i.typing=!1,n.dispatch("ClearUndos")},lZ=(n,i,l,d,p)=>{if(i.transact(d)){const w=i.data[l.get()].bookmark,E=i.data[l.get()-1];JR(n,E,!0),i.transact(p)&&(i.data[l.get()-1].beforeBookmark=w)}},Vse=(n,i,l)=>{let d;return i.get()<l.length-1&&(i.set(i.get()+1),d=l[i.get()],JR(n,d,!1),n.setDirty(!0),n.dispatch("Redo",{level:d})),d},cZ=(n,i,l,d)=>{let p;return i.typing&&(i.add(),i.typing=!1,Gw(i,!1,l)),d.get()>0&&(d.set(d.get()-1),p=i.data[d.get()],JR(n,p,!0),n.setDirty(!0),n.dispatch("Undo",{level:p})),p},uZ=n=>{n.clear(),n.add()},mL=(n,i,l)=>l.get()>0||i.typing&&i.data[0]&&!e5(NT(n),i.data[0]),gL=(n,i)=>i.get()<n.data.length-1&&!n.typing,fZ=(n,i,l)=>(dL(n,i),n.beforeChange(),n.ignore(l),n.add()),Kw=(n,i)=>{try{n.set(n.get()+1),i()}finally{n.set(n.get()-1)}},wS=(n,i)=>{const l=n.dom,d=_e(i)?i:n.getBody();Pe(l.select("table,a",d),p=>{switch(p.nodeName){case"TABLE":const w=Gv(n),E=l.getAttrib(p,"border");(!E||E==="0")&&n.hasVisual?l.addClass(p,w):l.removeClass(p,w);break;case"A":if(!l.getAttrib(p,"href")){const R=l.getAttrib(p,"name")||p.id,B=kb(n);R&&n.hasVisual?l.addClass(p,B):l.removeClass(p,B)}break}}),n.dispatch("VisualAid",{element:i,hasVisual:n.hasVisual})},_S=n=>({init:{bindEvents:ft},undoManager:{beforeChange:(i,l)=>hL(n,i,l),add:(i,l,d,p,w,E)=>n5(n,i,l,d,p,w,E),undo:(i,l,d)=>cZ(n,i,l,d),redo:(i,l)=>Vse(n,i,l),clear:(i,l)=>aZ(n,i,l),reset:i=>uZ(i),hasUndo:(i,l)=>mL(n,i,l),hasRedo:(i,l)=>gL(i,l),transact:(i,l,d)=>fZ(i,l,d),ignore:(i,l)=>Kw(i,l),extra:(i,l,d,p)=>lZ(n,i,l,d,p)},formatter:{match:(i,l,d,p)=>oR(n,i,l,d,p),matchAll:(i,l)=>zw(n,i,l),matchNode:(i,l,d,p)=>Eh(n,i,l,d,p),canApply:i=>wy(n,i),closest:i=>WW(n,i),apply:(i,l,d)=>dj(n,i,l,d),remove:(i,l,d,p)=>g8(n,i,l,d,p),toggle:(i,l,d)=>bS(n,i,l,d),formatChanged:(i,l,d,p,w)=>pS(n,i,l,d,p,w)},editor:{getContent:i=>GU(n,i),setContent:(i,l)=>UW(n,i,l),insertContent:(i,l)=>YB(n,i,l),addVisual:i=>wS(n,i)},selection:{getContent:(i,l)=>eZ(n,i,l)},autocompleter:{addDecoration:i=>FU(n,i),removeDecoration:()=>$U(n,Ke.fromDom(n.getBody()))},raw:{getModel:()=>he.none()}}),pL=n=>{const i=K=>ne(K)?K:{},{init:l,undoManager:d,formatter:p,editor:w,selection:E,autocompleter:R,raw:B}=n;return{init:{bindEvents:l.bindEvents},undoManager:{beforeChange:d.beforeChange,add:d.add,undo:d.undo,redo:d.redo,clear:d.clear,reset:d.reset,hasUndo:d.hasUndo,hasRedo:d.hasRedo,transact:(K,ie,ue)=>d.transact(ue),ignore:(K,ie)=>d.ignore(ie),extra:(K,ie,ue,pe)=>d.extra(ue,pe)},formatter:{match:(K,ie,ue,pe)=>p.match(K,i(ie),pe),matchAll:p.matchAll,matchNode:p.matchNode,canApply:K=>p.canApply(K),closest:K=>p.closest(K),apply:(K,ie,ue)=>p.apply(K,i(ie)),remove:(K,ie,ue,pe)=>p.remove(K,i(ie)),toggle:(K,ie,ue)=>p.toggle(K,i(ie)),formatChanged:(K,ie,ue,pe,Be)=>p.formatChanged(ie,ue,pe,Be)},editor:{getContent:K=>w.getContent(K),setContent:(K,ie)=>({content:w.setContent(K,ie),html:""}),insertContent:(K,ie)=>(w.insertContent(K),""),addVisual:w.addVisual},selection:{getContent:(K,ie)=>E.getContent(ie)},autocompleter:{addDecoration:R.addDecoration,removeDecoration:R.removeDecoration},raw:{getModel:()=>he.some(B.getRawModel())}}},bL=()=>{const n=nt(null),i=nt("");return{init:{bindEvents:ft},undoManager:{beforeChange:ft,add:n,undo:n,redo:n,clear:ft,reset:ft,hasUndo:We,hasRedo:We,transact:n,ignore:ft,extra:ft},formatter:{match:We,matchAll:nt([]),matchNode:nt(void 0),canApply:We,closest:i,apply:ft,remove:ft,toggle:ft,formatChanged:nt({unbind:ft})},editor:{getContent:i,setContent:nt({content:"",html:""}),insertContent:nt(""),addVisual:ft},selection:{getContent:i},autocompleter:{addDecoration:ft,removeDecoration:ft},raw:{getModel:nt(he.none())}}},S0=n=>cn(n.plugins,"rtc"),vL=n=>go(n.plugins,"rtc").bind(i=>he.from(i.setup)),dZ=n=>{const i=n;return vL(n).fold(()=>(i.rtcInstance=_S(n),he.none()),l=>(i.rtcInstance=bL(),he.some(()=>l().then(d=>(i.rtcInstance=pL(d),d.rtc.isRemote)))))},o5=n=>n.rtcInstance?n.rtcInstance:_S(n),tc=n=>{const i=n.rtcInstance;if(i)return i;throw new Error("Failed to get RTC instance not yet initialized.")},hZ=(n,i,l)=>{tc(n).undoManager.beforeChange(i,l)},yL=(n,i,l,d,p,w,E)=>tc(n).undoManager.add(i,l,d,p,w,E),mZ=(n,i,l,d)=>tc(n).undoManager.undo(i,l,d),gZ=(n,i,l)=>tc(n).undoManager.redo(i,l),Tx=(n,i,l)=>{tc(n).undoManager.clear(i,l)},wL=(n,i)=>{tc(n).undoManager.reset(i)},_L=(n,i,l)=>tc(n).undoManager.hasUndo(i,l),pZ=(n,i,l)=>tc(n).undoManager.hasRedo(i,l),bZ=(n,i,l,d)=>tc(n).undoManager.transact(i,l,d),vZ=(n,i,l)=>{tc(n).undoManager.ignore(i,l)},CL=(n,i,l,d,p)=>{tc(n).undoManager.extra(i,l,d,p)},yZ=(n,i,l,d,p)=>tc(n).formatter.match(i,l,d,p),wZ=(n,i,l)=>tc(n).formatter.matchAll(i,l),_Z=(n,i,l,d,p)=>tc(n).formatter.matchNode(i,l,d,p),CZ=(n,i)=>tc(n).formatter.canApply(i),Use=(n,i)=>tc(n).formatter.closest(i),f1=(n,i,l,d)=>{tc(n).formatter.apply(i,l,d)},s5=(n,i,l,d,p)=>{tc(n).formatter.remove(i,l,d,p)},SZ=(n,i,l,d)=>{tc(n).formatter.toggle(i,l,d)},kZ=(n,i,l,d,p,w)=>tc(n).formatter.formatChanged(i,l,d,p,w),EZ=(n,i)=>o5(n).editor.getContent(i),xZ=(n,i,l)=>o5(n).editor.setContent(i,l),ei=(n,i,l)=>o5(n).editor.insertContent(i,l),Wse=(n,i,l)=>tc(n).selection.getContent(i,l),AZ=(n,i)=>tc(n).editor.addVisual(i),SL=n=>tc(n).init.bindEvents(),Ga=(n,i)=>tc(n).autocompleter.addDecoration(i),TZ=n=>tc(n).autocompleter.removeDecoration(),Dx=(n,i={})=>{const l=i.format?i.format:"html";return Wse(n,l,i)},kL=n=>n.dom.length===0?(pr(n),he.none()):he.some(n),DZ=(n,i)=>n.filter(l=>uy.isBookmarkNode(l.dom)).bind(i?vd:ya),OZ=(n,i,l,d)=>{const p=n.dom,w=i.dom,E=d?p.length:w.length;d?(J3(p,w,!1,!d),l.setStart(w,E)):(J3(w,p,!1,!d),l.setEnd(w,E))},EL=(n,i)=>{ai(n).each(l=>{const d=n.dom;i&&nx(l,Vt(d,0))?sx(d,0):!i&&ox(l,Vt(d,d.length))&&X3(d,d.length)})},Xb=(n,i,l,d)=>{n.bind(p=>((d?X3:sx)(p.dom,d?p.dom.length:0),i.filter(Qa).map(E=>OZ(p,E,l,d)))).orThunk(()=>DZ(i,d).or(i).filter(Qa).map(w=>EL(w,d)))},Ah=(n,i)=>{const l=he.from(i.firstChild).map(Ke.fromDom),d=he.from(i.lastChild).map(Ke.fromDom);n.deleteContents(),n.insertNode(i);const p=l.bind(ya).filter(Qa).bind(kL),w=d.bind(vd).filter(Qa).bind(kL);Xb(p,l,n,!0),Xb(w,d,n,!1),n.collapse(!1)},Ox=(n,i)=>({format:"html",...n,set:!0,selection:!0,content:i}),Ey=(n,i)=>{if(i.format!=="raw"){const l=n.selection.getRng(),d=n.dom.getParent(l.commonAncestorContainer,n.dom.isBlock),p=d?{context:d.nodeName.toLowerCase()}:{},w=n.parser.parse(i.content,{forced_root_block:!1,...p,...i});return Pw({validate:!1},n.schema).serialize(w)}else return i.content},k0=(n,i,l={})=>{const d=Ox(l,i);UR(n,d).each(p=>{const w=Ey(n,p),E=n.selection.getRng();Ah(E,E.createContextualFragment(w)),n.selection.setRng(E),cf(n,E),WR(n,w,p)})},CS=(n,i,l)=>{if(cn(n,i)){const d=yt(n[i],p=>p!==l);d.length===0?delete n[i]:n[i]=d}};var r5=(n,i)=>{let l,d;const p=(R,B)=>Jn(B,K=>n.is(K,R)),w=R=>n.getParents(R,void 0,n.getRoot()),E=()=>{l={},d={},i.on("NodeChange",R=>{const B=R.element,K=w(B),ie={};an(l,(ue,pe)=>{p(pe,K).each(Be=>{d[pe]||(Pe(ue,Ze=>{Ze(!0,{node:Be,selector:pe,parents:K})}),d[pe]=ue),ie[pe]=ue})}),an(d,(ue,pe)=>{ie[pe]||(delete d[pe],Pe(ue,Be=>{Be(!1,{node:B,selector:pe,parents:K})}))})})};return{selectorChangedWithUnbind:(R,B)=>(l||E(),l[R]||(l[R]=[]),l[R].push(B),p(R,w(i.selection.getStart())).each(()=>{d[R]=l[R]}),{unbind:()=>{CS(l,R,B),CS(d,R,B)}})}};const PT=n=>!!(n&&n.ownerDocument)&&ln(Ke.fromDom(n.ownerDocument),Ke.fromDom(n)),xL=n=>n?PT(n.startContainer)&&PT(n.endContainer):!1,i5=(n,i,l,d)=>{let p,w;const{selectorChangedWithUnbind:E}=r5(n,d),R=(Mn,Qn)=>{const yr=n.createRng();_e(Mn)&&_e(Qn)?(yr.setStart(Mn,Qn),yr.setEnd(Mn,Qn),Mt(yr),ht(!1)):(ME(n,yr,d.getBody(),!0),Mt(yr))},B=Mn=>Dx(d,Mn),K=(Mn,Qn)=>k0(d,Mn,Qn),ie=Mn=>II(d.getBody(),vt(),Mn),ue=Mn=>BI(d.getBody(),vt(),Mn),pe=(Mn,Qn)=>Rl.getBookmark(Mn,Qn),Be=Mn=>Rl.moveToBookmark(Mn),Ze=(Mn,Qn)=>(MU(n,Mn,Qn).each(Mt),Mn),Oe=()=>{const Mn=vt(),Qn=bt();return!Mn||Mn.item?!1:Mn.compareEndPoints?Mn.compareEndPoints("StartToEnd",Mn)===0:!Qn||Mn.collapsed},ze=()=>{const Mn=vt(),Qn=d.getBody().querySelectorAll('[data-mce-selected="1"]');return Qn.length>0?Js(Qn,yr=>n.isEditable(yr.parentElement)):Mn.startContainer===Mn.endContainer?n.isEditable(Mn.startContainer):n.isEditable(Mn.startContainer)&&n.isEditable(Mn.endContainer)},ht=Mn=>{const Qn=vt();Qn.collapse(!!Mn),Mt(Qn)},bt=()=>i.getSelection?i.getSelection():i.document.selection,vt=()=>{let Mn;const Qn=(Bs,vo,Rn)=>{try{return vo.compareBoundaryPoints(Bs,Rn)}catch{return-1}},yr=i.document;if(_e(d.bookmark)&&!Nw(d)){const Bs=F3(d);if(Bs.isSome())return Bs.map(vo=>W3(d,[vo])[0]).getOr(yr.createRange())}try{const Bs=bt();Bs&&!_d(Bs.anchorNode)&&(Bs.rangeCount>0?Mn=Bs.getRangeAt(0):Mn=yr.createRange(),Mn=W3(d,[Mn])[0])}catch{}if(Mn||(Mn=yr.createRange()),qu(Mn.startContainer)&&Mn.collapsed){const Bs=n.getRoot();Mn.setStart(Bs,0),Mn.setEnd(Bs,0)}return p&&w&&(Qn(Mn.START_TO_START,Mn,p)===0&&Qn(Mn.END_TO_END,Mn,p)===0?Mn=w:(p=null,w=null)),Mn},Mt=(Mn,Qn)=>{if(!xL(Mn))return;const yr=bt();if(Mn=d.dispatch("SetSelectionRange",{range:Mn,forward:Qn}).range,yr){w=Mn;try{yr.removeAllRanges(),yr.addRange(Mn)}catch{}Qn===!1&&yr.extend&&(yr.collapse(Mn.endContainer,Mn.endOffset),yr.extend(Mn.startContainer,Mn.startOffset)),p=yr.rangeCount>0?yr.getRangeAt(0):null}if(!Mn.collapsed&&Mn.startContainer===Mn.endContainer&&(yr==null?void 0:yr.setBaseAndExtent)&&Mn.endOffset-Mn.startOffset<2&&Mn.startContainer.hasChildNodes()){const vo=Mn.startContainer.childNodes[Mn.startOffset];vo&&vo.nodeName==="IMG"&&(yr.setBaseAndExtent(Mn.startContainer,Mn.startOffset,Mn.endContainer,Mn.endOffset),(yr.anchorNode!==Mn.startContainer||yr.focusNode!==Mn.endContainer)&&yr.setBaseAndExtent(vo,0,vo,1))}d.dispatch("AfterSetSelectionRange",{range:Mn,forward:Qn})},fn=Mn=>(K(n.getOuterHTML(Mn)),Mn),$n=()=>OU(d.getBody(),vt()),Pn=(Mn,Qn)=>FI(n,vt(),Mn,Qn),Lt=()=>{const Mn=bt(),Qn=Mn==null?void 0:Mn.anchorNode,yr=Mn==null?void 0:Mn.focusNode;if(!Mn||!Qn||!yr||_d(Qn)||_d(yr))return!0;const Bs=n.createRng(),vo=n.createRng();try{Bs.setStart(Qn,Mn.anchorOffset),Bs.collapse(!0),vo.setStart(yr,Mn.focusOffset),vo.collapse(!0)}catch{return!0}return Bs.compareBoundaryPoints(Bs.START_TO_START,vo)<=0},il={dom:n,win:i,serializer:l,editor:d,expand:(Mn={type:"word"})=>Mt(v(n).expand(vt(),Mn)),collapse:ht,setCursorLocation:R,getContent:B,setContent:K,getBookmark:pe,moveToBookmark:Be,select:Ze,isCollapsed:Oe,isEditable:ze,isForward:Lt,setNode:fn,getNode:$n,getSel:bt,setRng:Mt,getRng:vt,getStart:ie,getEnd:ue,getSelectedBlocks:Pn,normalize:()=>{const Mn=vt(),Qn=bt();if(!h3(Qn)&&LC(d)){const yr=QC(n,Mn);return yr.each(Bs=>{Mt(Bs,Lt())}),yr.getOr(Mn)}return Mn},selectorChanged:(Mn,Qn)=>(E(Mn,Qn),il),selectorChangedWithUnbind:E,getScrollContainer:()=>{let Mn,Qn=n.getRoot();for(;Qn&&Qn.nodeName!=="BODY";){if(Qn.scrollHeight>Qn.clientHeight){Mn=Qn;break}Qn=Qn.parentNode}return Mn},scrollIntoView:(Mn,Qn)=>{_e(Mn)?mm(d,Mn,Qn):cf(d,vt(),Qn)},placeCaretAt:(Mn,Qn)=>Mt(rM(Mn,Qn,d.getDoc())),getBoundingClientRect:()=>{const Mn=vt();return Mn.collapsed?Vt.fromRangeStart(Mn).getClientRects()[0]:Mn.getBoundingClientRect()},destroy:()=>{i=p=w=null,hc.destroy()}},Rl=uy(il),hc=jE(il,d);return il.bookmarkManager=Rl,il.controlSelection=hc,il},MZ=(n,i,l)=>{n.addAttributeFilter("data-mce-tabindex",(d,p)=>{let w=d.length;for(;w--;){const E=d[w];E.attr("tabindex",E.attr("data-mce-tabindex")),E.attr(p,null)}}),n.addAttributeFilter("src,href,style",(d,p)=>{const w="data-mce-"+p,E=i.url_converter,R=i.url_converter_scope;let B=d.length;for(;B--;){const K=d[B];let ie=K.attr(w);ie!==void 0?(K.attr(p,ie.length>0?ie:null),K.attr(w,null)):(ie=K.attr(p),p==="style"?ie=l.serializeStyle(l.parseStyle(ie),K.name):E&&(ie=E.call(R,ie,p,K.name)),K.attr(p,ie.length>0?ie:null))}}),n.addAttributeFilter("class",d=>{let p=d.length;for(;p--;){const w=d[p];let E=w.attr("class");E&&(E=E.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),w.attr("class",E.length>0?E:null))}}),n.addAttributeFilter("data-mce-type",(d,p,w)=>{let E=d.length;for(;E--;){const R=d[E];R.attr("data-mce-type")==="bookmark"&&!w.cleanup&&(he.from(R.firstChild).exists(K=>{var ie;return!Cn((ie=K.value)!==null&&ie!==void 0?ie:"")})?R.unwrap():R.remove())}}),n.addNodeFilter("noscript",d=>{var p;let w=d.length;for(;w--;){const E=d[w].firstChild;E&&(E.value=Yg.decode((p=E.value)!==null&&p!==void 0?p:""))}}),n.addNodeFilter("script,style",(d,p)=>{var w;const E=B=>B.replace(/(<!--\[CDATA\[|\]\]-->)/g,`
`).replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let R=d.length;for(;R--;){const B=d[R],K=B.firstChild,ie=(w=K==null?void 0:K.value)!==null&&w!==void 0?w:"";if(p==="script"){const ue=B.attr("type");ue&&B.attr("type",ue==="mce-no/type"?null:ue.replace(/^mce\-/,"")),i.element_format==="xhtml"&&K&&ie.length>0&&(K.value=`// <![CDATA[
`+E(ie)+`
// ]]>`)}else i.element_format==="xhtml"&&K&&ie.length>0&&(K.value=`<!--
`+E(ie)+`
-->`)}}),n.addNodeFilter("#comment",d=>{let p=d.length;for(;p--;){const w=d[p],E=w.value;i.preserve_cdata&&(E==null?void 0:E.indexOf("[CDATA["))===0?(w.name="#cdata",w.type=4,w.value=l.decode(E.replace(/^\[CDATA\[|\]\]$/g,""))):(E==null?void 0:E.indexOf("mce:protected "))===0&&(w.name="#text",w.type=3,w.raw=!0,w.value=unescape(E).substr(14))}}),n.addNodeFilter("xml:namespace,input",(d,p)=>{let w=d.length;for(;w--;){const E=d[w];E.type===7?E.remove():E.type===1&&p==="input"&&!E.attr("type")&&E.attr("type","text")}}),n.addAttributeFilter("data-mce-type",d=>{Pe(d,p=>{p.attr("data-mce-type")==="format-caret"&&(p.isEmpty(n.schema.getNonEmptyElements())?p.remove():p.unwrap())})}),n.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",(d,p)=>{let w=d.length;for(;w--;)d[w].attr(p,null)}),i.remove_trailing_brs&&CR(i,n,n.schema)},RZ=n=>{const i=d=>(d==null?void 0:d.name)==="br",l=n.lastChild;if(i(l)){const d=l.prev;i(d)&&(l.remove(),d.remove())}},AL=(n,i,l)=>{let d;const p=n.dom;let w=i.cloneNode(!0);const E=document.implementation;if(E.createHTMLDocument){const R=E.createHTMLDocument("");hn.each(w.nodeName==="BODY"?w.childNodes:[w],B=>{R.body.appendChild(R.importNode(B,!0))}),w.nodeName!=="BODY"?w=R.body.firstChild:w=R.body,d=p.doc,p.doc=R}return k3(n,{...l,node:w}),d&&(p.doc=d),w},TL=(n,i)=>_e(n)&&n.hasEventListeners("PreProcess")&&!i.no_events,DL=(n,i,l)=>TL(n,l)?AL(n,i,l):i,OL=(n,i,l)=>{hn.inArray(i,l)===-1&&(n.addAttributeFilter(l,(d,p)=>{let w=d.length;for(;w--;)d[w].attr(p,null)}),i.push(l))},a5=(n,i,l)=>!i.no_events&&n?VE(n,{...i,content:l}).content:l,jse=(n,i,l)=>{const d=Bn(l.getInner?i.innerHTML:n.getOuterHTML(i));return l.selection||Jc(Ke.fromDom(i))?d:hn.trim(d)},NZ=(n,i,l)=>{const d=l.selection?{forced_root_block:!1,...l}:l,p=n.parse(i,d);return RZ(p),p},Zse=(n,i,l)=>Pw(n,i).serialize(l),PZ=(n,i,l,d,p)=>{const w=Zse(i,l,d);return a5(n,p,w)},IZ=(n,i)=>{const l=["data-mce-selected"],d={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...n},p=i&&i.dom?i.dom:Lr.DOM,w=i&&i.schema?i.schema:dh(d),E=yS(d,w);MZ(E,d,p);const R=(B,K={})=>{const ie={format:"html",...K},ue=DL(i,B,ie),pe=jse(p,ue,ie),Be=NZ(E,pe,ie);return ie.format==="tree"?Be:PZ(i,d,w,Be,ie)};return{schema:w,addNodeFilter:E.addNodeFilter,addAttributeFilter:E.addAttributeFilter,serialize:R,addRules:w.addValidElements,setRules:w.setValidElements,addTempAttr:He(OL,E,l),getTempAttrs:nt(l),getNodeFilters:E.getNodeFilters,getAttributeFilters:E.getAttributeFilters,removeNodeFilter:E.removeNodeFilter,removeAttributeFilter:E.removeAttributeFilter}},d1=(n,i)=>{const l=IZ(n,i);return{schema:l.schema,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:l.serialize,addRules:l.addRules,setRules:l.setRules,addTempAttr:l.addTempAttr,getTempAttrs:l.getTempAttrs,getNodeFilters:l.getNodeFilters,getAttributeFilters:l.getAttributeFilters,removeNodeFilter:l.removeNodeFilter,removeAttributeFilter:l.removeAttributeFilter}},qse="html",Gse=(n,i)=>({...n,format:i,get:!0,getInner:!0}),BZ=(n,i={})=>{const l=i.format?i.format:qse,d=Gse(i,l);return G8(n,d).fold(Ot,p=>{const w=EZ(n,p);return K8(n,w,p)})},Mx="html",LZ=(n,i)=>({format:Mx,...n,set:!0,content:i}),IT=(n,i,l={})=>{const d=LZ(l,i);return UR(n,d).map(p=>{const w=xZ(n,p.content,p);return WR(n,w.html,p),w.content}).getOr(i)},ML="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),RL="template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),FZ="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),NL=[{name:"template",replacedWith:"Advanced Template"},{name:"rtc"}],Jb=(n,i)=>{const l=yt(i,d=>cn(n,d));return Ps(l)},HZ=n=>{const i=Jb(n,ML),l=n.forced_root_block;return(l===!1||l==="")&&i.push("forced_root_block (false only)"),Ps(i)},$Z=n=>Jb(n,RL),PL=(n,i)=>{const l=hn.makeMap(n.plugins," "),p=yt(i,w=>cn(l,w));return Ps(p)},zZ=n=>PL(n,FZ),VZ=n=>PL(n,NL.map(i=>i.name)),UZ=(n,i)=>{const l=HZ(n),d=zZ(i),p=d.length>0,w=l.length>0,E=i.theme==="mobile";if(p||w||E){const R=`
- `,B=E?`
Themes:${R}mobile`:"",K=p?`
Plugins:${R}${d.join(R)}`:"",ie=w?`
Options:${R}${l.join(R)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 6.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ for more information."+B+K+ie)}},WZ=n=>Jn(NL,i=>i.name===n).fold(()=>n,i=>i.replacedWith?`${n}, replaced by ${i.replacedWith}`:n),jZ=(n,i)=>{const l=$Z(n),d=VZ(i),p=d.length>0,w=l.length>0;if(p||w){const E=`
- `,R=p?`
Plugins:${E}${d.map(WZ).join(E)}`:"",B=w?`
Options:${E}${l.join(E)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+R+B)}},ZZ=(n,i)=>{UZ(n,i),jZ(n,i)},BT=Lr.DOM,qZ=n=>{BT.setStyle(n.id,"display",n.orgDisplay)},l5=n=>he.from(n).each(i=>i.destroy()),Rx=n=>{const i=n;i.contentAreaContainer=i.formElement=i.container=i.editorContainer=null,i.bodyElement=i.contentDocument=i.contentWindow=null,i.iframeElement=i.targetElm=null;const l=n.selection;if(l){const d=l.dom;i.selection=l.win=l.dom=d.doc=null}},GZ=n=>{const i=n.formElement;i&&(i._mceOldSubmit&&(i.submit=i._mceOldSubmit,delete i._mceOldSubmit),BT.unbind(i,"submit reset",n.formEventDelegate))},c5=n=>{if(!n.removed){const{_selectionOverrides:i,editorUpload:l}=n,d=n.getBody(),p=n.getElement();d&&n.save({is_removing:!0}),n.removed=!0,n.unbindAllNativeEvents(),n.hasHiddenInput&&_e(p==null?void 0:p.nextSibling)&&BT.remove(p.nextSibling),E3(n),n.editorManager.remove(n),!n.inline&&d&&qZ(n),UC(n),BT.remove(n.getContainer()),l5(i),l5(l),n.destroy()}},KZ=(n,i)=>{const{selection:l,dom:d}=n;if(!n.destroyed){if(!i&&!n.removed){n.remove();return}i||(n.editorManager.off("beforeunload",n._beforeUnload),n.theme&&n.theme.destroy&&n.theme.destroy(),l5(l),l5(d)),GZ(n),Rx(n),n.destroyed=!0}},LT=(()=>{const n={};return{add:(p,w)=>{n[p]=w},get:p=>n[p]?n[p]:{icons:{}},has:p=>cn(n,p)}})(),SS=Na.ModelManager,xy=(n,i)=>i.dom[n],Ay=(n,i)=>parseInt(Mi(i,n),10),FT=He(xy,"clientWidth"),HT=He(xy,"clientHeight"),Yw=He(Ay,"margin-top"),Xw=He(Ay,"margin-left"),$T=n=>n.dom.getBoundingClientRect(),zT=(n,i,l)=>{const d=FT(n),p=HT(n);return i>=0&&l>=0&&i<=d&&l<=p},IL=(n,i,l,d)=>{const p=$T(i),w=n?p.left+i.dom.clientLeft+Xw(i):0,E=n?p.top+i.dom.clientTop+Yw(i):0,R=l-w,B=d-E;return{x:R,y:B}},u5=(n,i,l)=>{const d=Ke.fromDom(n.getBody()),p=n.inline?d:er(d),w=IL(n.inline,p,i,l);return zT(p,w.x,w.y)},f5=n=>he.from(n).map(Ke.fromDom),BL=n=>{const i=n.inline?n.getBody():n.getContentAreaContainer();return f5(i).map(yd).getOr(!1)};var LL=()=>{const n=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:n,close:n,getArgs:n}};const Jw=n=>{const i=[],l=()=>{const pe=n.theme;return pe&&pe.getNotificationManagerImpl?pe.getNotificationManagerImpl():LL()},d=()=>he.from(i[0]),p=(pe,Be)=>pe.type===Be.type&&pe.text===Be.text&&!pe.progressBar&&!pe.timeout&&!Be.progressBar&&!Be.timeout,w=()=>{Pe(i,pe=>{pe.reposition()})},E=pe=>{i.push(pe)},R=pe=>{ds(i,Be=>Be===pe).each(Be=>{i.splice(Be,1)})},B=(pe,Be=!0)=>n.removed||!BL(n)?{}:(Be&&n.dispatch("BeforeOpenNotification",{notification:pe}),Jn(i,Ze=>p(l().getArgs(Ze),pe)).getOrThunk(()=>{n.editorManager.setActive(n);const Ze=l().open(pe,()=>{R(Ze),w(),d().fold(()=>n.focus(),Oe=>Hb(Ke.fromDom(Oe.getEl())))});return E(Ze),w(),n.dispatch("OpenNotification",{notification:{...Ze}}),Ze})),K=()=>{d().each(pe=>{l().close(pe),R(pe),w()})},ie=nt(i);return(pe=>{pe.on("SkinLoaded",()=>{const Be=mC(pe);Be&&B({text:Be,type:"warning",timeout:0},!1),w()}),pe.on("show ResizeEditor ResizeWindow NodeChange",()=>{requestAnimationFrame(w)}),pe.on("remove",()=>{Pe(i.slice(),Be=>{l().close(Be)})})})(n),{open:B,close:K,getNotifications:ie}},Qw=Na.PluginManager,Ty=Na.ThemeManager;var FL=()=>{const n=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:n,openUrl:n,alert:n,confirm:n,close:n}};const Nx=n=>{let i=[];const l=()=>{const Oe=n.theme;return Oe&&Oe.getWindowManagerImpl?Oe.getWindowManagerImpl():FL()},d=(Oe,ze)=>(...ht)=>ze?ze.apply(Oe,ht):void 0,p=Oe=>{n.dispatch("OpenWindow",{dialog:Oe})},w=Oe=>{n.dispatch("CloseWindow",{dialog:Oe})},E=Oe=>{i.push(Oe),p(Oe)},R=Oe=>{w(Oe),i=yt(i,ze=>ze!==Oe),i.length===0&&n.focus()},B=()=>he.from(i[i.length-1]),K=Oe=>{n.editorManager.setActive(n),uM(n),n.ui.show();const ze=Oe();return E(ze),ze},ie=(Oe,ze)=>K(()=>l().open(Oe,ze,R)),ue=Oe=>K(()=>l().openUrl(Oe,R)),pe=(Oe,ze,ht)=>{const bt=l();bt.alert(Oe,d(ht||bt,ze))},Be=(Oe,ze,ht)=>{const bt=l();bt.confirm(Oe,d(ht||bt,ze))},Ze=()=>{B().each(Oe=>{l().close(Oe),R(Oe)})};return n.on("remove",()=>{Pe(i,Oe=>{l().close(Oe)})}),{open:ie,openUrl:ue,alert:pe,confirm:Be,close:Ze}},d5=(n,i)=>{n.notificationManager.open({type:"error",text:i})},Px=(n,i)=>{n._skinLoaded?d5(n,i):n.on("SkinLoaded",()=>{d5(n,i)})},HL=(n,i)=>{Px(n,Yf.translate(["Failed to upload image: {0}",i]))},kS=(n,i,l)=>{WC(n,i,{message:l}),console.error(l)},_g=(n,i,l)=>l?`Failed to load ${n}: ${l} from url ${i}`:`Failed to load ${n} url: ${i}`,Dy=(n,i,l)=>{kS(n,"PluginLoadError",_g("plugin",i,l))},vp=(n,i,l)=>{kS(n,"IconsLoadError",_g("icons",i,l))},YZ=(n,i,l)=>{kS(n,"LanguageLoadError",_g("language",i,l))},XZ=(n,i,l)=>{kS(n,"ThemeLoadError",_g("theme",i,l))},JZ=(n,i,l)=>{kS(n,"ModelLoadError",_g("model",i,l))},QZ=(n,i,l)=>{const d=Yf.translate(["Failed to initialize plugin: {0}",i]);WC(n,"PluginLoadError",{message:d}),VT(d,l),Px(n,d)},VT=(n,...i)=>{const l=window.console;l&&(l.error?l.error(n,...i):l.log(n,...i))},eq=n=>/^[a-z0-9\-]+$/i.test(n),tq=n=>$L(n,hC(n)),nq=n=>$L(n,ip(n)),$L=(n,i)=>{const l=n.editorManager.baseURL+"/skins/content",p=`content${n.editorManager.suffix}.css`;return Et(i,w=>eq(w)&&!n.inline?`${l}/${w}/${p}`:n.documentBaseURI.toAbsolute(w))},oq=n=>{n.contentCSS=n.contentCSS.concat(tq(n),nq(n))},sq=n=>n?Mr(n.getElementsByTagName("img")):[],rq=(n,i)=>{const l={};return{findAll:(p,w=xt)=>{const E=yt(sq(p),B=>{const K=B.src;return B.hasAttribute("data-mce-bogus")||B.hasAttribute("data-mce-placeholder")||!K||K===Kn.transparentSrc?!1:xr(K,"blob:")?!n.isUploaded(K)&&w(B):xr(K,"data:")?w(B):!1}),R=Et(E,B=>{const K=B.src;if(cn(l,K))return l[K].then(ie=>F(ie)?ie:{image:B,blobInfo:ie.blobInfo});{const ie=A8(i,K).then(ue=>(delete l[K],{image:B,blobInfo:ue})).catch(ue=>(delete l[K],ue));return l[K]=ie,ie}});return Promise.all(R)}}},UT=()=>{let l={};const d=(pe,Be)=>({status:pe,resultUri:Be}),p=pe=>pe in l;return{hasBlobUri:p,getResultUri:pe=>{const Be=l[pe];return Be?Be.resultUri:null},isPending:pe=>p(pe)?l[pe].status===1:!1,isUploaded:pe=>p(pe)?l[pe].status===2:!1,markPending:pe=>{l[pe]=d(1,null)},markUploaded:(pe,Be)=>{l[pe]=d(2,Be)},removeFailed:pe=>{delete l[pe]},destroy:()=>{l={}}}};let h5=0;const zL=()=>{const n=()=>Math.round(Math.random()*4294967295).toString(36);return"s"+new Date().getTime().toString(36)+n()+n()+n()},iq=n=>n+h5+++zL(),aq=()=>{let n=[];const i=ue=>({"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"})[ue.toLowerCase()]||"dat",l=(ue,pe,Be,Ze,Oe)=>{if(F(ue))return d({id:ue,name:Ze,filename:Oe,blob:pe,base64:Be});if(ne(ue))return d(ue);throw new Error("Unknown input type")},d=ue=>{if(!ue.blob||!ue.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const pe=ue.id||iq("blobid"),Be=ue.name||pe,Ze=ue.blob;return{id:nt(pe),name:nt(Be),filename:nt(ue.filename||Be+"."+i(Ze.type)),blob:nt(Ze),base64:nt(ue.base64),blobUri:nt(ue.blobUri||URL.createObjectURL(Ze)),uri:nt(ue.uri)}},p=ue=>{E(ue.id())||n.push(ue)},w=ue=>Jn(n,ue).getOrUndefined(),E=ue=>w(pe=>pe.id()===ue);return{create:l,add:p,get:E,getByUri:ue=>w(pe=>pe.blobUri()===ue),getByData:(ue,pe)=>w(Be=>Be.base64()===ue&&Be.blob().type===pe),findFirst:w,removeByUri:ue=>{n=yt(n,pe=>pe.blobUri()===ue?(URL.revokeObjectURL(pe.blobUri()),!1):!0)},destroy:()=>{Pe(n,ue=>{URL.revokeObjectURL(ue.blobUri())}),n=[]}}},VL=(n,i)=>{const l={},d=(Oe,ze)=>Oe?Oe.replace(/\/$/,"")+"/"+ze.replace(/^\//,""):ze,p=(Oe,ze)=>new Promise((ht,bt)=>{const vt=new XMLHttpRequest;vt.open("POST",i.url),vt.withCredentials=i.credentials,vt.upload.onprogress=fn=>{ze(fn.loaded/fn.total*100)},vt.onerror=()=>{bt("Image upload failed due to a XHR Transport error. Code: "+vt.status)},vt.onload=()=>{if(vt.status<200||vt.status>=300){bt("HTTP Error: "+vt.status);return}const fn=JSON.parse(vt.responseText);if(!fn||!F(fn.location)){bt("Invalid JSON: "+vt.responseText);return}ht(d(i.basePath,fn.location))};const Mt=new FormData;Mt.append("file",Oe.blob(),Oe.filename()),vt.send(Mt)}),w=be(i.handler)?i.handler:p,E=()=>new Promise(Oe=>{Oe([])}),R=(Oe,ze)=>({url:ze,blobInfo:Oe,status:!0}),B=(Oe,ze)=>({url:"",blobInfo:Oe,status:!1,error:ze}),K=(Oe,ze)=>{hn.each(l[Oe],ht=>{ht(ze)}),delete l[Oe]},ie=(Oe,ze,ht)=>(n.markPending(Oe.blobUri()),new Promise(bt=>{let vt,Mt;try{const fn=()=>{vt&&(vt.close(),Mt=ft)},$n=Lt=>{fn(),n.markUploaded(Oe.blobUri(),Lt),K(Oe.blobUri(),R(Oe,Lt)),bt(R(Oe,Lt))},Pn=Lt=>{fn(),n.removeFailed(Oe.blobUri()),K(Oe.blobUri(),B(Oe,Lt)),bt(B(Oe,Lt))};Mt=Lt=>{Lt<0||Lt>100||he.from(vt).orThunk(()=>he.from(ht).map(kt)).each($t=>{vt=$t,$t.progressBar.value(Lt)})},ze(Oe,Mt).then($n,Lt=>{Pn(F(Lt)?{message:Lt}:Lt)})}catch(fn){bt(B(Oe,fn))}})),ue=Oe=>Oe===p,pe=Oe=>{const ze=Oe.blobUri();return new Promise(ht=>{l[ze]=l[ze]||[],l[ze].push(ht)})},Be=(Oe,ze)=>(Oe=hn.grep(Oe,ht=>!n.isUploaded(ht.blobUri())),Promise.all(hn.map(Oe,ht=>n.isPending(ht.blobUri())?pe(ht):ie(ht,w,ze))));return{upload:(Oe,ze)=>!i.url&&ue(w)?E():Be(Oe,ze)}},m5=n=>()=>n.notificationManager.open({text:n.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),WT=(n,i)=>VL(i,{url:Wk(n),basePath:Vv(n),credentials:Uv(n),handler:uC(n)}),UL=n=>{const i=UT(),l=WT(n,i);return{upload:(d,p=!0)=>l.upload(d,p?m5(n):void 0)}},WL=(n,i)=>n.dom.isEmpty(i.dom)&&_e(n.schema.getTextBlockElements()[Xr(i)]),g5=n=>i=>{WL(n,i)&&Qi(i,Ke.fromHtml('<br data-mce-bogus="1" />'))},lq=n=>{const i=aq();let l,d;const p=UT(),w=[],E=vt=>Mt=>n.selection?vt(Mt):[],R=vt=>vt+(vt.indexOf("?")===-1?"?":"&")+new Date().getTime(),B=(vt,Mt,fn)=>{let $n=0;do $n=vt.indexOf(Mt,$n),$n!==-1&&(vt=vt.substring(0,$n)+fn+vt.substr($n+Mt.length),$n+=fn.length-Mt.length+1);while($n!==-1);return vt},K=(vt,Mt,fn)=>{const $n=`src="${fn}"${fn===Kn.transparentSrc?' data-mce-placeholder="1"':""}`;return vt=B(vt,`src="${Mt}"`,$n),vt=B(vt,'data-mce-src="'+Mt+'"','data-mce-src="'+fn+'"'),vt},ie=(vt,Mt)=>{Pe(n.undoManager.data,fn=>{fn.type==="fragmented"?fn.fragments=Et(fn.fragments,$n=>K($n,vt,Mt)):fn.content=K(fn.content,vt,Mt)})},ue=(vt,Mt)=>{const fn=n.convertURL(Mt,"src");ie(vt.src,Mt),Uu(Ke.fromDom(vt),{src:ed(n)?R(Mt):Mt,"data-mce-src":fn})},pe=()=>(l||(l=WT(n,p)),ze().then(E(vt=>{const Mt=Et(vt,fn=>fn.blobInfo);return l.upload(Mt,m5(n)).then(E(fn=>{const $n=[];let Pn=!1;const Lt=Et(fn,($t,yn)=>{const{blobInfo:mo,image:Oo}=vt[yn];let Cs=!1;return $t.status&&lC(n)?($t.url&&!Qs(Oo.src,$t.url)&&(Pn=!0),i.removeByUri(Oo.src),S0(n)||ue(Oo,$t.url)):$t.error&&($t.error.remove&&(ie(Oo.src,Kn.transparentSrc),$n.push(Oo),Cs=!0),HL(n,$t.error.message)),{element:Oo,status:$t.status,uploadUri:$t.url,blobInfo:mo,removed:Cs}});return $n.length>0&&!S0(n)?n.undoManager.transact(()=>{Pe(Qd($n),$t=>{const yn=ai($t);pr($t),yn.each(g5(n)),i.removeByUri($t.dom.src)})}):Pn&&n.undoManager.dispatchChange(),Lt}))}))),Be=()=>zv(n)?pe():Promise.resolve([]),Ze=vt=>Js(w,Mt=>Mt(vt)),Oe=vt=>{w.push(vt)},ze=()=>(d||(d=rq(p,i)),d.findAll(n.getBody(),Ze).then(E(vt=>{const Mt=yt(vt,fn=>F(fn)?(Px(n,fn),!1):fn.uriType!=="blob");return S0(n)||Pe(Mt,fn=>{ie(fn.image.src,fn.blobInfo.blobUri()),fn.image.src=fn.blobInfo.blobUri(),fn.image.removeAttribute("data-mce-src")}),Mt}))),ht=()=>{i.destroy(),p.destroy(),d=l=null},bt=vt=>vt.replace(/src="(blob:[^"]+)"/g,(Mt,fn)=>{const $n=p.getResultUri(fn);if($n)return'src="'+$n+'"';let Pn=i.getByUri(fn);return Pn||(Pn=bn(n.editorManager.get(),(Lt,$t)=>Lt||$t.editorUpload&&$t.editorUpload.blobCache.getByUri(fn),void 0)),Pn?'src="data:'+Pn.blob().type+";base64,"+Pn.base64()+'"':Mt});return n.on("SetContent",()=>{zv(n)?Be():ze()}),n.on("RawSaveContent",vt=>{vt.content=bt(vt.content)}),n.on("GetContent",vt=>{vt.source_view||vt.format==="raw"||vt.format==="tree"||(vt.content=bt(vt.content))}),n.on("PostRender",()=>{n.parser.addNodeFilter("img",vt=>{Pe(vt,Mt=>{const fn=Mt.attr("src");if(!fn||i.getByUri(fn))return;const $n=p.getResultUri(fn);$n&&Mt.attr("src",$n)})})}),{blobCache:i,addFilter:Oe,uploadImages:pe,uploadImagesAuto:Be,scanForImages:ze,destroy:ht}},cq=n=>{const i=n.dom,l=n.schema.type,d={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:p=>{i.setStyle(p,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:p=>{i.setStyle(p,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const p={inline:"span",styles:{textDecoration:"line-through"},exact:!0},w={inline:"strike",remove:"all",preserve_attributes:["class","style"]},E={inline:"s",remove:"all",preserve_attributes:["class","style"]};return l!=="html4"?[E,p,w]:[p,E,w]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(p,w,E)=>Xn(p)&&p.hasAttribute("href"),onformat:(p,w,E)=>{hn.each(E,(R,B)=>{i.setAttrib(p,B,R)})}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":p=>{var w;return(w=p==null?void 0:p.customValue)!==null&&w!==void 0?w:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return hn.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),p=>{d[p]={block:p,remove:"all"}}),d},h1={remove_similar:!0,inherit:!1},ad={selector:"td,th",...h1},jT={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...ad},tablecellverticalalign:{styles:{"vertical-align":"%value"},...ad},tablecellbordercolor:{styles:{borderColor:"%value"},...ad},tablecellclass:{classes:["%value"],...ad},tableclass:{selector:"table",classes:["%value"],...h1},tablecellborderstyle:{styles:{borderStyle:"%value"},...ad},tablecellborderwidth:{styles:{borderWidth:"%value"},...ad}},jL=nt(jT),ZT=n=>{const i={},l=E=>_e(E)?i[E]:i,d=E=>cn(i,E),p=(E,R)=>{E&&(F(E)?(re(R)||(R=[R]),Pe(R,B=>{ye(B.deep)&&(B.deep=!nd(B)),ye(B.split)&&(B.split=!nd(B)||Tl(B)),ye(B.remove)&&nd(B)&&!Tl(B)&&(B.remove="none"),nd(B)&&Tl(B)&&(B.mixed=!0,B.block_expand=!0),F(B.classes)&&(B.classes=B.classes.split(/\s+/))}),i[E]=R):an(E,(B,K)=>{p(K,B)}))},w=E=>(E&&i[E]&&delete i[E],i);return p(cq(n)),p(jL()),p(Kk(n)),{get:l,has:d,register:p,unregister:w}},Ix=hn.each,pm=Lr.DOM,qT=n=>_e(n)&&ne(n),p5=(n,i)=>{const l=i&&i.schema||dh({}),d=(B,K)=>{K.classes.length>0&&pm.addClass(B,K.classes.join(" ")),pm.setAttribs(B,K.attrs)},p=B=>{const K=F(B)?{name:B,classes:[],attrs:{}}:B,ie=pm.create(K.name);return d(ie,K),ie},w=(B,K)=>{const ie=l.getElementRule(B.nodeName.toLowerCase()),ue=ie==null?void 0:ie.parentsRequired;return ue&&ue.length?K&&Ct(ue,K)?K:ue[0]:!1},E=(B,K,ie)=>{let ue;const pe=K[0],Be=qT(pe)?pe.name:void 0,Ze=w(B,Be);if(Ze)Be===Ze?(ue=pe,K=K.slice(1)):ue=Ze;else if(pe)ue=pe,K=K.slice(1);else if(!ie)return B;const Oe=ue?p(ue):pm.create("div");Oe.appendChild(B),ie&&hn.each(ie,ht=>{const bt=p(ht);Oe.insertBefore(bt,B)});const ze=qT(ue)?ue.siblings:void 0;return E(Oe,K,ze)},R=pm.create("div");if(n.length>0){const B=n[0],K=p(B),ie=qT(B)?B.siblings:void 0;R.appendChild(E(K,n.slice(1),ie))}return R},ZL=n=>{n=hn.trim(n);let i="div";const l={name:i,classes:[],attrs:{},selector:n};return n!=="*"&&(i=n.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(d,p,w,E,R)=>{switch(p){case"#":l.attrs.id=w;break;case".":l.classes.push(w);break;case":":hn.inArray("checked disabled enabled read-only required".split(" "),w)!==-1&&(l.attrs[w]=w);break}if(E==="["){const B=R.match(/([\w\-]+)(?:\=\"([^\"]+))?/);B&&(l.attrs[B[1]]=B[2])}return""})),l.name=i||"div",l},qL=n=>F(n)?(n=n.split(/\s*,\s*/)[0],n=n.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),hn.map(n.split(/(?:>|\s+(?![^\[\]]+\]))/),i=>{const l=hn.map(i.split(/(?:~\+|~|\+)/),ZL),d=l.pop();return l.length&&(d.siblings=l),d}).reverse()):[],GT=(n,i)=>{let l="",d=Yk(n);if(d==="")return"";const p=pe=>F(pe)?pe.replace(/%(\w+)/g,""):"",w=(pe,Be)=>pm.getStyle(Be!=null?Be:n.getBody(),pe,!0);if(F(i)){const pe=n.formatter.get(i);if(!pe)return"";i=pe[0]}if("preview"in i){const pe=i.preview;if(pe===!1)return"";d=pe||d}let E=i.block||i.inline||"span",R;const B=qL(i.selector);B.length>0?(B[0].name||(B[0].name=E),E=i.selector,R=p5(B,n)):R=p5([E],n);const K=pm.select(E,R)[0]||R.firstChild;Ix(i.styles,(pe,Be)=>{const Ze=p(pe);Ze&&pm.setStyle(K,Be,Ze)}),Ix(i.attributes,(pe,Be)=>{const Ze=p(pe);Ze&&pm.setAttrib(K,Be,Ze)}),Ix(i.classes,pe=>{const Be=p(pe);pm.hasClass(K,Be)||pm.addClass(K,Be)}),n.dispatch("PreviewFormats"),pm.setStyles(R,{position:"absolute",left:-65535}),n.getBody().appendChild(R);const ie=w("fontSize"),ue=/px$/.test(ie)?parseInt(ie,10):0;return Ix(d.split(" "),pe=>{let Be=w(pe,K);if(!(pe==="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(Be)&&(Be=w(pe),BC(Be).toLowerCase()==="#ffffff"))&&!(pe==="color"&&BC(Be).toLowerCase()==="#000000")){if(pe==="font-size"&&/em|%$/.test(Be)){if(ue===0)return;Be=parseFloat(Be)/(/%$/.test(Be)?100:1)*ue+"px"}pe==="border"&&Be&&(l+="padding:0 2px;"),l+=pe+":"+Be+";"}}),n.dispatch("AfterPreviewFormats"),pm.remove(R),l},b5=n=>{n.addShortcut("meta+b","","Bold"),n.addShortcut("meta+i","","Italic"),n.addShortcut("meta+u","","Underline");for(let i=1;i<=6;i++)n.addShortcut("access+"+i,"",["FormatBlock",!1,"h"+i]);n.addShortcut("access+7","",["FormatBlock",!1,"p"]),n.addShortcut("access+8","",["FormatBlock",!1,"div"]),n.addShortcut("access+9","",["FormatBlock",!1,"address"])},GL=n=>{const i=ZT(n),l=qa({});return b5(n),KW(n),S0(n)||Ise(l,n),{get:i.get,has:i.has,register:i.register,unregister:i.unregister,apply:(d,p,w)=>{f1(n,d,p,w)},remove:(d,p,w,E)=>{s5(n,d,p,w,E)},toggle:(d,p,w)=>{SZ(n,d,p,w)},match:(d,p,w,E)=>yZ(n,d,p,w,E),closest:d=>Use(n,d),matchAll:(d,p)=>wZ(n,d,p),matchNode:(d,p,w,E)=>_Z(n,d,p,w,E),canApply:d=>CZ(n,d),formatChanged:(d,p,w,E)=>kZ(n,l,d,p,w,E),getCssText:He(GT,n)}},KL=n=>{switch(n.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},uq=(n,i,l)=>{const d=qa(!1),p=B=>{Gw(i,!1,l),i.add({},B)};n.on("init",()=>{i.add()}),n.on("BeforeExecCommand",B=>{const K=B.command;KL(K)||(dL(i,l),i.beforeChange())}),n.on("ExecCommand",B=>{const K=B.command;KL(K)||p(B)}),n.on("ObjectResizeStart cut",()=>{i.beforeChange()}),n.on("SaveContent ObjectResized blur",p),n.on("dragend",p),n.on("keyup",B=>{const K=B.keyCode;if(B.isDefaultPrevented())return;const ie=Kn.os.isMacOS()&&B.key==="Meta";(K>=33&&K<=36||K>=37&&K<=40||K===45||B.ctrlKey||ie)&&(p(),n.nodeChanged()),(K===46||K===8)&&n.nodeChanged(),d.get()&&i.typing&&!e5(NT(n),i.data[0])&&(n.isDirty()||n.setDirty(!0),n.dispatch("TypingUndo"),d.set(!1),n.nodeChanged())}),n.on("keydown",B=>{const K=B.keyCode;if(B.isDefaultPrevented())return;if(K>=33&&K<=36||K>=37&&K<=40||K===45){i.typing&&p(B);return}const ie=B.ctrlKey&&!B.altKey||B.metaKey;if((K<16||K>20)&&K!==224&&K!==91&&!i.typing&&!ie){i.beforeChange(),Gw(i,!0,l),i.add({},B),d.set(!0);return}(Kn.os.isMacOS()?B.metaKey:B.ctrlKey&&!B.altKey)&&i.beforeChange()}),n.on("mousedown",B=>{i.typing&&p(B)});const w=B=>B.inputType==="insertReplacementText",E=B=>B.inputType==="insertText"&&B.data===null,R=B=>B.inputType==="insertFromPaste"||B.inputType==="insertFromDrop";n.on("input",B=>{B.inputType&&(w(B)||E(B)||R(B))&&p(B)}),n.on("AddUndo Undo Redo ClearUndos",B=>{B.isDefaultPrevented()||n.nodeChanged()})},fq=n=>{n.addShortcut("meta+z","","Undo"),n.addShortcut("meta+y,meta+shift+z","","Redo")},v5=n=>{const i=mh(),l=qa(0),d=qa(0),p={data:[],typing:!1,beforeChange:()=>{hZ(n,l,i)},add:(w,E)=>yL(n,p,d,l,i,w,E),dispatchChange:()=>{n.setDirty(!0);const w=NT(n);w.bookmark=au(n.selection),n.dispatch("change",{level:w,lastLevel:Zr(p.data,d.get()).getOrUndefined()})},undo:()=>mZ(n,p,l,d),redo:()=>gZ(n,d,p.data),clear:()=>{Tx(n,p,d)},reset:()=>{wL(n,p)},hasUndo:()=>_L(n,p,d),hasRedo:()=>pZ(n,p,d),transact:w=>bZ(n,p,l,w),ignore:w=>{vZ(n,l,w)},extra:(w,E)=>{CL(n,p,d,w,E)}};return S0(n)||uq(n,p,l),fq(n),p},dq=[9,27,eo.HOME,eo.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,eo.DOWN,eo.UP,eo.LEFT,eo.RIGHT].concat(Kn.browser.isFirefox()?[224]:[]),YL="data-mce-placeholder",KT=n=>n.type==="keydown"||n.type==="keyup",XL=n=>{const i=n.keyCode;return i===eo.BACKSPACE||i===eo.DELETE},hq=n=>{if(KT(n)){const i=n.keyCode;return!XL(n)&&(eo.metaKeyPressed(n)||n.altKey||i>=112&&i<=123||Ct(dq,i))}else return!1},mq=n=>KT(n)&&!(XL(n)||n.type==="keyup"&&n.keyCode===229),gq=(n,i,l)=>{if(Ma(Ke.fromDom(i),!1)){const d=i.firstElementChild;return d?n.getStyle(i.firstElementChild,"padding-left")||n.getStyle(i.firstElementChild,"padding-right")?!1:l===d.nodeName.toLowerCase():!0}else return!1},pq=n=>{var i;const l=n.dom,d=Hc(n),p=(i=i0(n))!==null&&i!==void 0?i:"",w=(E,R)=>{if(hq(E))return;const B=n.getBody(),K=mq(E)?!1:gq(l,B,d);(l.getAttrib(B,YL)!==""!==K||R)&&(l.setAttrib(B,YL,K?p:null),l.setAttrib(B,"aria-placeholder",K?p:null),dy(n,K),n.on(K?"keydown":"keyup",w),n.off(K?"keyup":"keydown",w))};gr(p)&&n.on("init",E=>{w(E,!0),n.on("change SetContent ExecCommand",w),n.on("paste",R=>mg.setEditorTimeout(n,()=>w(R)))})},bq=(n,i)=>({block:n,position:i}),vq=(n,i)=>({from:n,to:i}),ES=(n,i)=>{const l=Ke.fromDom(n),d=Ke.fromDom(i.container());return _i(l,d).map(p=>bq(p,i))},y5=n=>!pt(n.from.block,n.to.block),JL=(n,i)=>Bl(i,p=>Vm(p)||ha(p.dom),p=>pt(p,n)).filter(_l).getOr(n),yq=(n,i)=>{const l=Ke.fromDom(n);return pt(JL(l,i.from.block),JL(l,i.to.block))},wq=n=>xs(n.from.block.dom)===!1&&xs(n.to.block.dom)===!1,_q=n=>{const i=l=>lc(l)||ah(l.dom);return i(n.from.block)&&i(n.to.block)},QL=(n,i,l)=>ui(l.position.getNode())&&!Ma(l.block)?ry(!1,l.block.dom).bind(d=>d.isEqual(l.position)?Pd(i,n,d).bind(p=>ES(n,p)):he.some(l)).getOr(l):l,Cq=(n,i,l)=>{const d=ES(n,Vt.fromRangeStart(l)),p=d.bind(w=>Pd(i,n,w.position).bind(E=>ES(n,E).map(R=>QL(n,i,R))));return ni(d,p,vq).filter(w=>y5(w)&&yq(n,w)&&wq(w)&&_q(w))},Sq=(n,i,l)=>l.collapsed?Cq(n,i,l):he.none(),w5=n=>{const i=Aa(n);return ds(i,ac).fold(nt(i),l=>i.slice(0,l))},eF=n=>{const i=w5(n);return Pe(i,pr),i},tF=(n,i)=>{const l=Vb(i,n);return Jn(l.reverse(),d=>Ma(d)).each(pr)},kq=n=>yt(Lg(n),i=>!Ma(i)).length===0,Eq=(n,i,l,d)=>{if(Ma(l))return Te(l),sl(l.dom);kq(d)&&Ma(i)&&wa(d,Ke.fromTag("br"));const p=Mu(l.dom,Vt.before(d.dom));return Pe(eF(i),w=>{wa(d,w)}),tF(n,i),p},xq=(n,i,l)=>{if(Ma(l)){if(Ma(i)){const w=Yt((E=>{const R=(B,K)=>oi(B).fold(()=>K,ie=>_c(ie)?R(ie,K.concat(ng(ie))):K);return R(E,[])})(l),(E,R)=>(j0(E,R),R),ve());wd(i),Qi(i,w)}return pr(l),sl(i.dom)}const d=Id(l.dom);return Pe(eF(i),p=>{Qi(l,p)}),tF(n,i),d},Aq=(n,i)=>{const l=Vb(i,n);return he.from(l[l.length-1])},Tq=(n,i)=>ln(i,n)?Aq(i,n):he.none(),Bx=(n,i)=>{ry(n,i.dom).bind(l=>he.from(l.getNode())).map(Ke.fromDom).filter(Xc).each(pr)},Lx=(n,i,l)=>(Bx(!0,i),Bx(!1,l),Tq(i,l).fold(He(xq,n,i,l),He(Eq,n,i,l))),nF=(n,i,l,d)=>i?Lx(n,d,l):Lx(n,l,d),_5=(n,i)=>{const l=Ke.fromDom(n.getBody());return Sq(l.dom,i,n.selection.getRng()).map(p=>()=>{nF(l,i,p.from.block,p.to.block).each(w=>{n.selection.setRng(w.toRange())})})},YT=(n,i)=>{const l=i.getRng();return ni(_i(n,Ke.fromDom(l.startContainer)),_i(n,Ke.fromDom(l.endContainer)),(d,p)=>pt(d,p)?he.none():he.some(()=>{l.deleteContents(),nF(n,!0,d,p).each(w=>{i.setRng(w.toRange())})})).getOr(he.none())},oF=(n,i)=>{const l=Ke.fromDom(i),d=He(pt,n);return li(l,Vm,d).isSome()},Dq=(n,i)=>oF(n,i.startContainer)||oF(n,i.endContainer),Oq=(n,i)=>{const l=Mu(n.dom,Vt.fromRangeStart(i)).isNone(),d=Rf(n.dom,Vt.fromRangeEnd(i)).isNone();return!Dq(n,i)&&l&&d},Mq=n=>he.some(()=>{n.setContent(""),n.selection.setCursorLocation()}),Rq=n=>{const i=Ke.fromDom(n.getBody()),l=n.selection.getRng();return Oq(i,l)?Mq(n):YT(i,n.selection)},C5=(n,i)=>n.selection.isCollapsed()?he.none():Rq(n),Qb=(n,i,l,d,p)=>he.from(i._selectionOverrides.showCaret(n,l,d,p)),Nq=n=>{const i=n.ownerDocument.createRange();return i.selectNode(n),i},Fx=(n,i)=>n.dispatch("BeforeObjectSelected",{target:i}).isDefaultPrevented()?he.none():he.some(Nq(i)),Pq=(n,i,l)=>{const d=H(1,n.getBody(),i),p=Vt.fromRangeStart(d),w=p.getNode();if(im(w))return Qb(1,n,w,!p.isAtEnd(),!1);const E=p.getNode(!0);if(im(E))return Qb(1,n,E,!1,!1);const R=yy(n.dom.getRoot(),p.getNode());return im(R)?Qb(1,n,R,!1,l):he.none()},S5=(n,i,l)=>i.collapsed?Pq(n,i,l).getOr(i):i,Yse=n=>by(n)||$b(n),yp=n=>zb(n)||oS(n),k5=(n,i)=>{_n(i)&&i.data.length===0&&n.remove(i)},E5=(n,i,l,d,p,w)=>{Qb(d,n,w.getNode(!p),p,!0).each(E=>{if(i.collapsed){const R=i.cloneRange();p?R.setEnd(E.startContainer,E.startOffset):R.setStart(E.endContainer,E.endOffset),R.deleteContents()}else i.deleteContents();n.selection.setRng(E)}),k5(n.dom,l)},sF=(n,i)=>{const l=n.selection.getRng();if(!_n(l.commonAncestorContainer))return he.none();const d=i?pn.Forwards:pn.Backwards,p=ka(n.getBody()),w=He(_t,i?p.next:p.prev),E=i?Yse:yp,R=ke(d,n.getBody(),l),B=w(R),K=B&&gg(i,B);if(!K||!zt(R,K))return he.none();if(E(K))return he.some(()=>E5(n,l,R.getNode(),d,i,K));const ie=w(K);return ie&&E(ie)&&zt(K,ie)?he.some(()=>E5(n,l,R.getNode(),d,i,ie)):he.none()},x5=(n,i)=>sF(n,i),XT=(n,i)=>{const l=n.getBody();return i?sl(l).filter(by):Id(l).filter(zb)},A5=n=>{const i=n.selection.getRng();return!i.collapsed&&(XT(n,!0).exists(l=>l.isEqual(Vt.fromRangeStart(i)))||XT(n,!1).exists(l=>l.isEqual(Vt.fromRangeEnd(i))))},rF=n=>_e(n)&&(Vm(Ke.fromDom(n))||ja(Ke.fromDom(n))),bm=lg.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Iq=(n,i)=>{const l=i.getNode(!n),d=n?"after":"before";return Xn(l)&&l.getAttribute("data-mce-caret")===d},Bq=(n,i,l,d)=>{const p=w=>_c(Ke.fromDom(w))&&!Nd(l,d,n);return ae(!i,l).fold(()=>ae(i,d).fold(We,p),p)},e_=(n,i,l,d)=>{const p=d.getNode(!i);return _i(Ke.fromDom(n),Ke.fromDom(l.getNode())).map(w=>Ma(w)?bm.remove(w.dom):bm.moveToElement(p)).orThunk(()=>he.some(bm.moveToElement(p)))},T5=(n,i,l)=>Pd(i,n,l).bind(d=>rF(d.getNode())||Bq(n,i,l,d)?he.none():i&&xs(d.getNode())||!i&&xs(d.getNode(!0))?e_(n,i,l,d):i&&zb(l)||!i&&by(l)?he.some(bm.moveToPosition(d)):he.none()),iF=(n,i)=>De(i)?he.none():n&&xs(i.nextSibling)?he.some(bm.moveToElement(i.nextSibling)):!n&&xs(i.previousSibling)?he.some(bm.moveToElement(i.previousSibling)):he.none(),aF=(n,i,l)=>l.fold(d=>he.some(bm.remove(d)),d=>he.some(bm.moveToElement(d)),d=>Nd(i,d,n)?he.none():he.some(bm.moveToPosition(d))),D5=(n,i,l)=>Iq(i,l)?iF(i,l.getNode(!i)).orThunk(()=>T5(n,i,l)):T5(n,i,l).bind(d=>aF(n,l,d)),Lq=(n,i,l)=>{const d=H(i?1:-1,n,l),p=Vt.fromRangeStart(d),w=Ke.fromDom(n);return!i&&zb(p)?he.some(bm.remove(p.getNode(!0))):i&&by(p)?he.some(bm.remove(p.getNode())):!i&&by(p)&&K3(w,p)?rB(w,p).map(E=>bm.remove(E.getNode())):i&&zb(p)&&G3(w,p)?eW(w,p).map(E=>bm.remove(E.getNode())):D5(n,i,p)},Fq=(n,i)=>l=>(n._selectionOverrides.hideFakeCaret(),Ub(n,i,Ke.fromDom(l)),!0),Hq=(n,i)=>l=>{const d=i?Vt.before(l):Vt.after(l);return n.selection.setRng(d.toRange()),!0},Xse=n=>i=>(n.selection.setRng(i.toRange()),!0),$q=(n,i)=>he.from(yy(n.getBody(),i)),Jse=(n,i)=>{const l=n.selection.getNode();return $q(n,l).filter(xs).fold(()=>Lq(n.getBody(),i,n.selection.getRng()).map(d=>()=>d.fold(Fq(n,i),Hq(n,i),Xse(n))),()=>he.some(ft))},wp=n=>{Pe(dl(n,".mce-offscreen-selection"),pr)},zq=(n,i)=>{const l=n.selection.getNode();return xs(l)&&!kd(l)?$q(n,l.parentNode).filter(xs).fold(()=>he.some(()=>{wp(Ke.fromDom(n.getBody())),Ub(n,i,Ke.fromDom(n.selection.getNode())),Lw(n)}),()=>he.some(ft)):A5(n)?he.some(()=>{tT(n,n.selection.getRng(),Ke.fromDom(n.getBody()))}):he.none()},lF=n=>{const i=n.dom,l=n.selection,d=yy(n.getBody(),l.getNode());if(ha(d)&&i.isBlock(d)&&i.isEmpty(d)){const p=i.create("br",{"data-mce-bogus":"1"});i.setHTML(d,""),d.appendChild(p),l.setRng(Vt.before(p).toRange())}return!0},ev=(n,i)=>n.selection.isCollapsed()?Jse(n,i):zq(n,i),cF=(n,i)=>{const l=Vt.fromRangeStart(n.selection.getRng());return Pd(i,n.getBody(),l).filter(d=>i?YU(d):XU(d)).bind(d=>d0(i?0:-1,d)).map(d=>()=>n.selection.select(d))},O5=(n,i)=>n.selection.isCollapsed()?cF(n,i):he.none(),tv=_n,uF=n=>tv(n)&&n.data[0]===Ft,fF=n=>tv(n)&&n.data[n.data.length-1]===Ft,dF=n=>{var i;return((i=n.ownerDocument)!==null&&i!==void 0?i:document).createTextNode(Ft)},Vq=n=>{var i;if(tv(n.previousSibling))return fF(n.previousSibling)||n.previousSibling.appendData(Ft),n.previousSibling;if(tv(n))return uF(n)||n.insertData(0,Ft),n;{const l=dF(n);return(i=n.parentNode)===null||i===void 0||i.insertBefore(l,n),l}},Uq=n=>{var i,l;if(tv(n.nextSibling))return uF(n.nextSibling)||n.nextSibling.insertData(0,Ft),n.nextSibling;if(tv(n))return fF(n)||n.appendData(Ft),n;{const d=dF(n);return n.nextSibling?(i=n.parentNode)===null||i===void 0||i.insertBefore(d,n.nextSibling):(l=n.parentNode)===null||l===void 0||l.appendChild(d),d}},JT=(n,i)=>n?Vq(i):Uq(i),nv=He(JT,!0),Wq=He(JT,!1),hF=(n,i)=>_n(n.container())?JT(i,n.container()):JT(i,n.getNode()),mF=(n,i)=>{const l=i.get();return l&&n.container()===l&&tr(l)},M5=(n,i)=>i.fold(l=>{pl(n.get());const d=nv(l);return n.set(d),he.some(Vt(d,d.length-1))},l=>sl(l).map(d=>{if(mF(d,n)){const p=n.get();return Vt(p,1)}else{pl(n.get());const p=hF(d,!0);return n.set(p),Vt(p,1)}}),l=>Id(l).map(d=>{if(mF(d,n)){const p=n.get();return Vt(p,p.length-1)}else{pl(n.get());const p=hF(d,!1);return n.set(p),Vt(p,p.length-1)}}),l=>{pl(n.get());const d=Wq(l);return n.set(d),he.some(Vt(d,1))}),gF=(n,i)=>{for(let l=0;l<n.length;l++){const d=n[l].apply(null,i);if(d.isSome())return d}return he.none()},uf=lg.generate([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),QT=(n,i)=>{const l=am(i,n);return l||n},R5=(n,i,l)=>{const d=wW(l),p=QT(i,d.container());return Wb(n,p,d).fold(()=>Rf(p,d).bind(He(Wb,n,p)).map(w=>uf.before(w)),he.none)},pF=(n,i)=>g0(n,i)===null,N5=(n,i,l)=>Wb(n,i,l).filter(He(pF,i)),bF=(n,i,l)=>{const d=eT(l);return N5(n,i,d).bind(p=>Mu(p,d).isNone()?he.some(uf.start(p)):he.none())},jq=(n,i,l)=>{const d=wW(l);return N5(n,i,d).bind(p=>Rf(p,d).isNone()?he.some(uf.end(p)):he.none())},Hx=(n,i,l)=>{const d=eT(l),p=QT(i,d.container());return Wb(n,p,d).fold(()=>Mu(p,d).bind(He(Wb,n,p)).map(w=>uf.after(w)),he.none)},e4=n=>!pB(t4(n)),m1=(n,i,l)=>gF([R5,bF,jq,Hx],[n,i,l]).filter(e4),t4=n=>n.fold(Ot,Ot,Ot,Ot),P5=n=>n.fold(nt("before"),nt("start"),nt("end"),nt("after")),$x=n=>n.fold(uf.before,uf.before,uf.after,uf.after),xS=n=>n.fold(uf.start,uf.start,uf.end,uf.end),I5=(n,i)=>P5(n)===P5(i)&&t4(n)===t4(i),zx=(n,i,l,d,p,w)=>ni(Wb(i,l,d),Wb(i,l,p),(E,R)=>E!==R&&gp(l,E,R)?uf.after(n?E:R):w).getOr(w),Zq=(n,i)=>n.fold(xt,l=>!I5(l,i)),vF=(n,i,l,d,p)=>{const w=gg(n,p);return Pd(n,l,w).map(He(gg,n)).fold(()=>d.map($x),B=>m1(i,l,B).map(He(zx,n,i,l,w,B)).filter(He(Zq,d))).filter(e4)},qq=(n,i)=>n?i.fold(V(he.some,uf.start),he.none,V(he.some,uf.after),he.none):i.fold(he.none,V(he.some,uf.before),he.none,V(he.some,uf.end)),Gq=(n,i,l,d)=>{const p=gg(n,d),w=m1(i,l,p);return m1(i,l,p).bind(He(qq,n)).orThunk(()=>vF(n,i,l,w,d))},yF=n=>be(n.selection.getSel().modify),wF=(n,i,l)=>{const d=n?1:-1;return i.setRng(Vt(l.container(),l.offset()+d).toRange()),i.getSel().modify("move",n?"forward":"backward","word"),!0},_F=(n,i)=>{const l=i.selection.getRng(),d=n?Vt.fromRangeEnd(l):Vt.fromRangeStart(l);return yF(i)?n&&Ku(d)?wF(!0,i.selection,d):!n&&Ef(d)?wF(!1,i.selection,d):!1:!1};var ov;(function(n){n[n.Br=0]="Br",n[n.Block=1]="Block",n[n.Wrap=2]="Wrap",n[n.Eol=3]="Eol"})(ov||(ov={}));const n4=(n,i)=>n===pn.Backwards?Zs(i):i,Kq=(n,i,l)=>n===pn.Forwards?i.next(l):i.prev(l),Yq=(n,i,l,d)=>ui(d.getNode(i===pn.Forwards))?ov.Br:Nd(l,d)===!1?ov.Block:ov.Wrap,CF=(n,i,l,d)=>{const p=ka(l);let w=d;const E=[];for(;w;){const R=Kq(i,p,w);if(!R)break;if(ui(R.getNode(!1)))return i===pn.Forwards?{positions:n4(i,E).concat([R]),breakType:ov.Br,breakAt:he.some(R)}:{positions:n4(i,E),breakType:ov.Br,breakAt:he.some(R)};if(!R.isVisible()){w=R;continue}if(n(w,R)){const B=Yq(l,i,w,R);return{positions:n4(i,E),breakType:B,breakAt:he.some(R)}}E.push(R),w=R}return{positions:n4(i,E),breakType:ov.Eol,breakAt:he.none()}},SF=(n,i,l,d)=>i(l,d).breakAt.map(p=>{const w=i(l,p).positions;return n===pn.Backwards?w.concat(p):[p].concat(w)}).getOr([]),B5=(n,i)=>bn(n,(l,d)=>l.fold(()=>he.some(d),p=>ni(No(p.getClientRects()),No(d.getClientRects()),(w,E)=>{const R=Math.abs(i-w.left);return Math.abs(i-E.left)<=R?d:p}).or(l)),he.none()),o4=(n,i)=>No(i.getClientRects()).bind(l=>B5(n,l.left)),Vx=He(CF,Vt.isAbove,-1),AS=He(CF,Vt.isBelow,1),kF=He(SF,-1,Vx),Oy=He(SF,1,AS),L5=(n,i)=>Vx(n,i).breakAt.isNone(),s4=(n,i)=>AS(n,i).breakAt.isNone(),EF=n=>sl(n).map(i=>[i].concat(AS(n,i).positions)).getOr([]),F5=n=>Id(n).map(i=>Vx(n,i).positions.concat(i)).getOr([]),My=(n,i)=>o4(kF(n,i),i),xF=(n,i)=>o4(Oy(n,i),i),Cg=xs,Ry=(n,i)=>Math.abs(n.left-i),r4=(n,i)=>Math.abs(n.right-i),Xq=n=>ts(n,"node"),H5=(n,i)=>Ge(n,(l,d)=>{const p=Math.min(Ry(l,i),r4(l,i)),w=Math.min(Ry(d,i),r4(d,i));return w===p&&Xq(d)&&Cg(d.node)||w<p?d:l}),Jq=n=>{const i=l=>Et(l,d=>{const p=Zp(d);return p.node=n,p});if(Xn(n))return i(n.getClientRects());if(_n(n)){const l=n.ownerDocument.createRange();return l.setStart(n,0),l.setEnd(n,n.data.length),i(l.getClientRects())}else return[]},AF=n=>Ns(n,Jq);var Ux;(function(n){n[n.Up=-1]="Up",n[n.Down=1]="Down"})(Ux||(Ux={}));const Qq=(n,i,l,d)=>{let p=d;for(;p=wh(p,n,Wg,i);)if(l(p))return},TF=(n,i,l,d,p,w)=>{let E=0;const R=[],B=ue=>{let pe=AF([ue]);n===-1&&(pe=pe.reverse());for(let Be=0;Be<pe.length;Be++){const Ze=pe[Be];if(!l(Ze,K)){if(R.length>0&&i(Ze,It(R))&&E++,Ze.line=E,p(Ze))return!0;R.push(Ze)}}return!1},K=It(w.getClientRects());if(!K)return R;const ie=w.getNode();return ie&&(B(ie),Qq(n,d,B,ie)),R},DF=(n,i)=>i.line>n,eG=(n,i)=>i.line===n,tG=He(TF,Ux.Up,ta,tf),TS=He(TF,Ux.Down,tf,ta),i4=n=>It(n.getClientRects()),OF=(n,i,l,d)=>{const p=ka(i);let w,E,R,B;const K=[];let ie=0;n===1?(w=p.next,E=tf,R=ta,B=Vt.after(d)):(w=p.prev,E=ta,R=tf,B=Vt.before(d));const ue=i4(B);do{if(!B.isVisible())continue;const pe=i4(B);if(R(pe,ue))continue;K.length>0&&E(pe,It(K))&&ie++;const Be=Zp(pe);if(Be.position=B,Be.line=ie,l(Be))return K;K.push(Be)}while(B=w(B));return K},$5=n=>i=>DF(n,i),Wx=n=>i=>eG(n,i),sv=(n,i)=>{n.selection.setRng(i),cf(n,n.selection.getRng())},z5=(n,i,l)=>he.some(S5(n,i,l)),MF=(n,i,l,d,p,w)=>{const E=i===pn.Forwards,R=ka(n.getBody()),B=He(_t,E?R.next:R.prev),K=E?d:p;if(!l.collapsed){const Ze=Q1(l);if(w(Ze))return Qb(i,n,Ze,i===pn.Backwards,!1);if(A5(n)){const Oe=l.cloneRange();return Oe.collapse(i===pn.Backwards),he.from(Oe)}}const ie=ke(i,n.getBody(),l);if(K(ie))return Fx(n,ie.getNode(!E));let ue=B(ie);const pe=ea(l);if(ue)ue=gg(E,ue);else return pe?he.some(l):he.none();if(K(ue))return Qb(i,n,ue.getNode(!E),E,!1);const Be=B(ue);return Be&&K(Be)&&zt(ue,Be)?Qb(i,n,Be.getNode(!E),E,!1):pe?z5(n,ue.toRange(),!1):he.none()},RF=(n,i,l,d,p,w)=>{const E=ke(i,n.getBody(),l),R=It(E.getClientRects()),B=i===Ux.Down,K=n.getBody();if(!R)return he.none();if(A5(n)){const ze=B?Vt.fromRangeEnd(l):Vt.fromRangeStart(l);return(B?xF:My)(K,ze).orThunk(()=>he.from(ze)).map(bt=>bt.toRange())}const ue=(B?TS:tG)(K,$5(1),E),pe=yt(ue,Wx(1)),Be=R.left,Ze=H5(pe,Be);if(Ze&&w(Ze.node)){const ze=Math.abs(Be-Ze.left),ht=Math.abs(Be-Ze.right);return Qb(i,n,Ze.node,ze<ht,!1)}let Oe;if(d(E)?Oe=E.getNode():p(E)?Oe=E.getNode(!0):Oe=Q1(l),Oe){const ze=OF(i,K,$5(1),Oe);let ht=H5(yt(ze,Wx(1)),Be);if(ht||(ht=It(yt(ze,Wx(0))),ht))return z5(n,ht.position.toRange(),!1)}return pe.length===0?V5(n,B).filter(B?p:d).map(ze=>S5(n,ze.toRange(),!1)):he.none()},V5=(n,i)=>{const l=n.selection.getRng(),d=i?Vt.fromRangeEnd(l):Vt.fromRangeStart(l),p=bE(d.container(),n.getBody());if(i){const w=AS(p,d);return Mo(w.positions)}else{const w=Vx(p,d);return No(w.positions)}},NF=(n,i,l)=>V5(n,i).filter(l).exists(d=>(n.selection.setRng(d.toRange()),!0)),a4=(n,i)=>{const l=n.dom.createRng();l.setStart(i.container(),i.offset()),l.setEnd(i.container(),i.offset()),n.selection.setRng(l)},U5=(n,i)=>{n?i.setAttribute("data-mce-selected","inline-boundary"):i.removeAttribute("data-mce-selected")},PF=(n,i,l)=>M5(i,l).map(d=>(a4(n,d),l)),nG=(n,i,l)=>{const d=Vt.fromRangeStart(n);if(n.collapsed)return d;{const p=Vt.fromRangeEnd(n);return l?Mu(i,p).getOr(p):Rf(i,d).getOr(d)}},vm=(n,i,l)=>{const d=n.getBody(),p=nG(n.selection.getRng(),d,l),w=He(Bw,n);return Gq(l,w,d,p).bind(R=>PF(n,i,R))},oG=(n,i,l)=>{const d=Et(dl(Ke.fromDom(i.getRoot()),'*[data-mce-selected="inline-boundary"]'),E=>E.dom),p=yt(d,n),w=yt(l,n);Pe(ba(p,w),He(U5,!1)),Pe(ba(w,p),He(U5,!0))},W5=(n,i)=>{const l=i.get();if(n.selection.isCollapsed()&&!n.composing&&l){const d=Vt.fromRangeStart(n.selection.getRng());Vt.isTextPosition(d)&&!yW(d)&&(a4(n,oy(l,d)),i.set(null))}},IF=(n,i,l,d)=>{if(i.selection.isCollapsed()){const p=yt(d,n);Pe(p,w=>{const E=Vt.fromRangeStart(i.selection.getRng());m1(n,i.getBody(),E).bind(R=>PF(i,l,R))})}},l4=(n,i,l)=>Cb(n)?vm(n,i,l).isSome():!1,BF=(n,i,l)=>Cb(i)?_F(n,i):!1,sG=n=>{const i=qa(null),l=He(Bw,n);return n.on("NodeChange",d=>{Cb(n)&&(oG(l,n.dom,d.parents),W5(n,i),IF(l,n,i,d.parents))}),i},rG=He(BF,!0),iG=He(BF,!1),c4=(n,i,l)=>{if(Cb(n)){const d=V5(n,i).getOrThunk(()=>{const p=n.selection.getRng();return i?Vt.fromRangeEnd(p):Vt.fromRangeStart(p)});return m1(He(Bw,n),n.getBody(),d).exists(p=>{const w=$x(p);return M5(l,w).exists(E=>(a4(n,E),!0))})}else return!1},LF=(n,i)=>{const l=document.createRange();return l.setStart(n.container(),n.offset()),l.setEnd(i.container(),i.offset()),l},aG=n=>ni(sl(n),Id(n),(i,l)=>{const d=gg(!0,i),p=gg(!1,l);return Rf(n,d).forall(w=>w.isEqual(p))}).getOr(!0),FF=(n,i)=>l=>M5(i,l).map(d=>()=>a4(n,d)),DS=(n,i,l,d)=>{const p=n.getBody(),w=He(Bw,n);n.undoManager.ignore(()=>{n.selection.setRng(LF(l,d)),OM(n),m1(w,p,Vt.fromRangeStart(n.selection.getRng())).map(xS).bind(FF(n,i)).each(xn)}),n.nodeChanged()},rv=(n,i)=>{const l=am(i,n);return l||n},t_=(n,i,l,d)=>{const p=rv(n.getBody(),d.container()),w=He(Bw,n),E=m1(w,p,d);return E.bind(B=>l?B.fold(nt(he.some(xS(B))),he.none,nt(he.some($x(B))),he.none):B.fold(he.none,nt(he.some($x(B))),he.none,nt(he.some(xS(B))))).map(FF(n,i)).getOrThunk(()=>{const B=m0(l,p,d),K=B.bind(ie=>m1(w,p,ie));return ni(E,K,()=>Wb(w,p,d).bind(ie=>aG(ie)?he.some(()=>{Ub(n,l,Ke.fromDom(ie))}):he.none())).getOrThunk(()=>K.bind(()=>B.map(ie=>()=>{l?DS(n,i,d,ie):DS(n,i,ie,d)})))})},OS=(n,i,l)=>{if(n.selection.isCollapsed()&&Cb(n)){const d=Vt.fromRangeStart(n.selection.getRng());return t_(n,i,l,d)}return he.none()},j5=n=>ic(n)>1,u4=(n,i)=>{const l=Ke.fromDom(n.getBody()),d=Ke.fromDom(n.selection.getStart()),p=Vb(d,l);return ds(p,i).fold(nt(p),w=>p.slice(0,w))},HF=n=>ic(n)===1,lG=n=>u4(n,i=>ac(i)||j5(i)),$F=n=>u4(n,ac),Z5=(n,i)=>{const l=He(lR,n);return Ns(i,d=>l(d)?[d.dom]:[])},zF=n=>{const i=$F(n);return Z5(n,i)},cG=(n,i,l,d)=>{const p=Z5(i,d);if(p.length===0)Ub(i,n,l);else{const w=hS(l.dom,p);i.selection.setRng(w.toRange())}},uG=(n,i)=>{const l=yt(lG(n),HF);return Mo(l).bind(d=>{const p=Vt.fromRangeStart(n.selection.getRng());return MM(i,p,d.dom)&&!_T(d)?he.some(()=>cG(i,n,d,l)):he.none()})},fG=(n,i)=>{const l=i.parentElement;return ui(i)&&!J(l)&&n.dom.isEmpty(l)},dG=n=>_T(Ke.fromDom(n)),VF=(n,i)=>{const l=n.selection.getStart(),d=fG(n,l)||dG(l)?hS(l,i):YW(n.selection.getRng(),i);n.selection.setRng(d.toRange())},UF=(n,i)=>{const l=ba(i,zF(n));l.length>0&&VF(n,l)},q5=n=>_n(n.startContainer),Qse=n=>n.startOffset===0&&q5(n),ere=(n,i)=>{const l=i.startContainer.parentElement;return!J(l)&&lR(n,Ke.fromDom(l))},tre=n=>{const i=n.startContainer.parentNode,l=n.endContainer.parentNode;return!J(i)&&!J(l)&&i.isEqualNode(l)},hG=n=>{const i=n.endContainer;return n.endOffset===(_n(i)?i.length:i.childNodes.length)},nre=n=>tre(n)&&hG(n),ore=n=>!n.endContainer.isEqualNode(n.commonAncestorContainer),mG=n=>nre(n)||ore(n),gG=n=>{const i=n.selection.getRng();return Qse(i)&&ere(n,i)&&mG(i)},sre=n=>{if(gG(n)){const i=zF(n);return he.some(()=>{OM(n),UF(n,i)})}else return he.none()},G5=(n,i)=>n.selection.isCollapsed()?uG(n,i):sre(n),Th=n=>eR(n,i=>$c(i.dom),ac),WF=n=>Th(Ke.fromDom(n.selection.getStart())),jx=n=>{const i=n.selection.getRng();return i.collapsed&&(q5(i)||n.dom.isEmpty(i.startContainer))&&!WF(n)},Zx=n=>(jx(n)&&VF(n,[]),!0),f4=(n,i,l)=>_e(l)?he.some(()=>{n._selectionOverrides.hideFakeCaret(),Ub(n,i,Ke.fromDom(l))}):he.none(),jF=(n,i)=>{const l=i?$b:oS,d=i?pn.Forwards:pn.Backwards,p=ke(d,n.getBody(),n.selection.getRng());return l(p)?f4(n,i,p.getNode(!i)):he.from(gg(i,p)).filter(w=>l(w)&&zt(p,w)).bind(w=>f4(n,i,w.getNode(!i)))},K5=(n,i)=>{const l=n.selection.getNode();return Gu(l)?f4(n,i,l):he.none()},Y5=(n,i)=>n.selection.isCollapsed()?jF(n,i):K5(n,i),pG=n=>Bl(n,i=>ha(i.dom)||xs(i.dom)).exists(i=>ha(i.dom)),d4=n=>qc(n!=null?n:"").getOr(0),ZF=(n,i)=>{const l=n||St(i)?"margin":"padding",d=Mi(i,"direction")==="rtl"?"-right":"-left";return l+d},bG=(n,i,l,d,p,w)=>{const E=ZF(l,Ke.fromDom(w)),R=d4(n.getStyle(w,E));if(i==="outdent"){const B=Math.max(0,R-d);n.setStyle(w,E,B?B+p:"")}else{const B=R+d+p;n.setStyle(w,E,B)}},vG=(n,i)=>Js(i,l=>{const d=ZF(dC(n),l),p=Ta(l,d).map(d4).getOr(0);return n.dom.getContentEditable(l.dom)!=="false"&&p>0}),h4=n=>{const i=wG(n);return!n.mode.isReadOnly()&&(i.length>1||vG(n,i))},qF=n=>xu(n)||ja(n),yG=n=>ai(n).exists(qF),wG=n=>yt(Qd(n.selection.getSelectedBlocks()),i=>!qF(i)&&!yG(i)&&pG(i)),GF=(n,i)=>{var l,d;const{dom:p}=n,w=qk(n),E=(d=(l=/[a-z%]+$/i.exec(w))===null||l===void 0?void 0:l[0])!==null&&d!==void 0?d:"px",R=d4(w),B=dC(n);Pe(wG(n),K=>{bG(p,i,B,R,E,K.dom)})},KF=n=>GF(n,"indent"),_G=n=>GF(n,"outdent"),YF=n=>{if(n.selection.isCollapsed()&&h4(n)){const i=n.dom,l=n.selection.getRng(),d=Vt.fromRangeStart(l),p=i.getParent(l.startContainer,i.isBlock);if(p!==null&&wM(Ke.fromDom(p),d))return he.some(()=>_G(n))}return he.none()},XF=(n,i,l)=>Ls([YF,ev,x5,(d,p)=>OS(d,i,p),_5,y0,O5,Y5,C5,G5],d=>d(n,l)).filter(d=>n.selection.isEditable()),CG=(n,i)=>{XF(n,i,!1).fold(()=>{OM(n),Lw(n)},xn)},X5=(n,i)=>{XF(n,i,!0).fold(()=>sS(n),xn)},m4=(n,i)=>{n.addCommand("delete",()=>{CG(n,i)}),n.addCommand("forwardDelete",()=>{X5(n,i)})},J5=5,JF=400,QF=n=>n.touches===void 0||n.touches.length!==1?he.none():he.some(n.touches[0]),SG=(n,i)=>{const l=Math.abs(n.clientX-i.x),d=Math.abs(n.clientY-i.y);return l>J5||d>J5},Q5=n=>{const i=mh(),l=qa(!1),d=Mv(p=>{n.dispatch("longpress",{...p,type:"longpress"}),l.set(!0)},JF);n.on("touchstart",p=>{QF(p).each(w=>{d.cancel();const E={x:w.clientX,y:w.clientY,target:p.target};d.throttle(p),l.set(!1),i.set(E)})},!0),n.on("touchmove",p=>{d.cancel(),QF(p).each(w=>{i.on(E=>{SG(w,E)&&(i.clear(),l.set(!1),n.dispatch("longpresscancel"))})})},!0),n.on("touchend touchcancel",p=>{d.cancel(),p.type!=="touchcancel"&&i.get().filter(w=>w.target.isEqualNode(p.target)).each(()=>{l.get()?p.preventDefault():n.dispatch("tap",{...p,type:"tap"})})},!0)},eN=(n,i)=>cn(n,i.nodeName),kG=(n,i)=>_n(i)?!0:Xn(i)?!eN(n.getBlockElements(),i)&&!Bd(i)&&!Jm(n,i):!1,EG=(n,i,l)=>Jt(QU(Ke.fromDom(l),Ke.fromDom(i)),d=>eN(n,d.dom)),xG=(n,i)=>{if(_n(i)){if(i.data.length===0)return!0;if(/^\s+$/.test(i.data)&&(!i.nextSibling||eN(n,i.nextSibling)))return!0}return!1},Sg=n=>n.dom.create(Hc(n),o0(n)),e7=n=>{const i=n.dom,l=n.selection,d=n.schema,p=d.getBlockElements(),w=l.getStart(),E=n.getBody();let R,B,K=!1;const ie=Hc(n);if(!w||!Xn(w))return;const ue=E.nodeName.toLowerCase();if(!d.isValidChild(ue,ie.toLowerCase())||EG(p,E,w))return;const pe=l.getRng(),{startContainer:Be,startOffset:Ze,endContainer:Oe,endOffset:ze}=pe,ht=Nw(n);let bt=E.firstChild;for(;bt;)if(Xn(bt)&&_v(d,bt),kG(d,bt)){if(xG(p,bt)){B=bt,bt=bt.nextSibling,i.remove(B);continue}R||(R=Sg(n),E.insertBefore(R,bt),K=!0),B=bt,bt=bt.nextSibling,R.appendChild(B)}else R=null,bt=bt.nextSibling;K&&ht&&(pe.setStart(Be,Ze),pe.setEnd(Oe,ze),l.setRng(pe),n.nodeChanged())},tN=(n,i,l)=>{const d=Ke.fromDom(Sg(n)),p=ve();Qi(d,p),l(i,d);const w=document.createRange();return w.setStartBefore(p.dom),w.setEndBefore(p.dom),w},rre=n=>{n.on("NodeChange",He(e7,n))},AG=n=>i=>(" "+i.attr("class")+" ").indexOf(n)!==-1,ire=(n,i,l)=>function(d){const p=arguments,w=p[p.length-2],E=w>0?i.charAt(w-1):"";if(E==='"')return d;if(E===">"){const R=i.lastIndexOf("<",w);if(R!==-1&&i.substring(R,w).indexOf('contenteditable="false"')!==-1)return d}return'<span class="'+l+'" data-mce-content="'+n.dom.encode(p[0])+'">'+n.dom.encode(typeof p[1]=="string"?p[1]:p[0])+"</span>"},are=(n,i,l)=>{let d=i.length,p=l.content;if(l.format!=="raw"){for(;d--;)p=p.replace(i[d],ire(n,p,ow(n)));l.content=p}},TG=n=>{const i="contenteditable",l=" "+hn.trim(iE(n))+" ",d=" "+hn.trim(ow(n))+" ",p=AG(l),w=AG(d),E=aE(n);E.length>0&&n.on("BeforeSetContent",R=>{are(n,E,R)}),n.parser.addAttributeFilter("class",R=>{let B=R.length;for(;B--;){const K=R[B];p(K)?K.attr(i,"true"):w(K)&&K.attr(i,"false")}}),n.serializer.addAttributeFilter(i,R=>{let B=R.length;for(;B--;){const K=R[B];!p(K)&&!w(K)||(E.length>0&&K.attr("data-mce-content")?(K.name="#text",K.type=3,K.raw=!0,K.value=K.attr("data-mce-content")):K.attr(i,null))}})},g4=n=>Ye(Ke.fromDom(n.getBody()),"*[data-mce-caret]").map(i=>i.dom).getOrNull(),t7=(n,i)=>{i.hasAttribute("data-mce-caret")&&(Wm(i),n.selection.setRng(n.selection.getRng()),n.selection.scrollIntoView(i))},nN=(n,i)=>{const l=g4(n);if(!!l){if(i.type==="compositionstart"){i.preventDefault(),i.stopPropagation(),t7(n,l);return}Bc(l)&&(t7(n,l),n.undoManager.add())}},n7=n=>{n.on("keyup compositionstart",He(nN,n))},oN=xs,o7=(n,i,l)=>MF(i,n,l,by,zb,oN),DG=(n,i,l)=>RF(i,n,l,w=>by(w)||QI(w),w=>zb(w)||eB(w),oN),OG=n=>{const i=n.dom.create(Hc(n));return i.innerHTML='<br data-mce-bogus="1">',i},s7=(n,i,l)=>{const d=ka(n.getBody()),p=He(_t,i===1?d.next:d.prev);if(l.collapsed){const w=n.dom.getParent(l.startContainer,"PRE");if(!w)return;if(!p(Vt.fromRangeStart(l))){const R=Ke.fromDom(OG(n));i===1?Yc(Ke.fromDom(w),R):wa(Ke.fromDom(w),R),n.selection.select(R.dom,!0),n.selection.collapse()}}},MG=(n,i)=>{const l=i?pn.Forwards:pn.Backwards,d=n.selection.getRng();return o7(l,n,d).orThunk(()=>(s7(n,l,d),he.none()))},p4=(n,i)=>{const l=i?1:-1,d=n.selection.getRng();return DG(l,n,d).orThunk(()=>(s7(n,l,d),he.none()))},RG=(n,i)=>{const l=i?n.getEnd(!0):n.getStart(!0);return pB(l)?!i:i},r7=(n,i)=>MG(n,RG(n.selection,i)).exists(l=>(sv(n,l),!0)),i7=(n,i)=>p4(n,i).exists(l=>(sv(n,l),!0)),b4=(n,i)=>NF(n,i,i?zb:by),v4=(n,i)=>XT(n,!i).map(l=>{const d=l.toRange(),p=n.selection.getRng();return i?d.setStart(p.startContainer,p.startOffset):d.setEnd(p.endContainer,p.endOffset),d}).exists(l=>(sv(n,l),!0)),NG=n=>Ct(["figcaption"],Xr(n)),a7=(n,i)=>{const l=He(pt,i);return Bl(Ke.fromDom(n.container()),ac,l).filter(NG)},PG=(n,i,l)=>i?s4(n.dom,l):L5(n.dom,l),IG=(n,i)=>{const l=Ke.fromDom(n.getBody()),d=Vt.fromRangeStart(n.selection.getRng());return a7(d,l).exists(()=>{if(PG(l,i,d)){const w=tN(n,l,i?Qi:Jd);return n.selection.setRng(w),!0}else return!1})},l7=(n,i)=>n.selection.isCollapsed()?IG(n,i):!1,BG=(n,i,l)=>{const d=n.selection.getRng(),p=Vt.fromRangeStart(d);return n.getBody().firstChild===i&&L5(l,p)?(n.execCommand("InsertNewBlockBefore"),!0):!1},LG=(n,i)=>{const l=n.selection.getRng(),d=Vt.fromRangeStart(l);return n.getBody().lastChild===i&&s4(i,d)?(n.execCommand("InsertNewBlockAfter"),!0):!1},FG=(n,i)=>i?he.from(n.dom.getParent(n.selection.getNode(),"details")).map(l=>LG(n,l)).getOr(!1):he.from(n.dom.getParent(n.selection.getNode(),"summary")).bind(l=>he.from(n.dom.getParent(l,"details")).map(d=>BG(n,d,l))).getOr(!1),y4=(n,i)=>FG(n,i),c7={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},u7=n=>Et(n,i=>({...c7,...i})),HG=n=>Et(n,i=>({...c7,...i})),f7=(n,i)=>i.keyCode===n.keyCode&&i.shiftKey===n.shiftKey&&i.altKey===n.altKey&&i.ctrlKey===n.ctrlKey&&i.metaKey===n.metaKey,$G=(n,i)=>Ns(u7(n),l=>f7(l,i)?[l]:[]),zG=(n,i)=>Ns(HG(n),l=>f7(l,i)?[l]:[]),us=(n,...i)=>()=>n.apply(null,i),qx=(n,i)=>Jn($G(n,i),l=>l.action()),nc=(n,i)=>Ls(zG(n,i),l=>l.action()),d7=(n,i)=>{const l=i?pn.Forwards:pn.Backwards,d=n.selection.getRng();return MF(n,l,d,$b,oS,Gu).exists(p=>(sv(n,p),!0))},h7=(n,i)=>{const l=i?1:-1,d=n.selection.getRng();return RF(n,l,d,$b,oS,Gu).exists(p=>(sv(n,p),!0))},m7=(n,i)=>NF(n,i,i?oS:$b),sN=lg.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),MS={...sN,none:n=>sN.none(n)},Ny=(n,i)=>w4(n,i,xt),w4=(n,i,l)=>Ns(Aa(n),d=>wu(d,i)?l(d)?[d]:[]:w4(d,i,l)),p7=(n,i,l=We)=>{if(l(i))return he.none();if(Ct(n,Xr(i)))return he.some(i);const d=p=>wu(p,"table")||l(p);return Se(i,n.join(","),d)},rN=(n,i)=>p7(["td","th"],n,i),iN=n=>Ny(n,"th,td"),_4=(n,i)=>rt(n,"table",i),C4=(n,i,l,d,p=xt)=>{const w=d===1;if(!w&&l<=0)return MS.first(n[0]);if(w&&l>=n.length-1)return MS.last(n[n.length-1]);{const E=l+d,R=n[E];return p(R)?MS.middle(i,R):C4(n,i,E,d,p)}},Gx=(n,i)=>_4(n,i).bind(l=>{const d=iN(l);return ds(d,w=>pt(n,w)).map(w=>({index:w,all:d}))}),S4=(n,i,l)=>Gx(n,l).fold(()=>MS.none(n),p=>C4(p.all,n,p.index,1,i)),Kx=(n,i,l)=>Gx(n,l).fold(()=>MS.none(),p=>C4(p.all,n,p.index,-1,i)),Yx=(n,i)=>({left:n.left-i,top:n.top-i,right:n.right+i*2,bottom:n.bottom+i*2,width:n.width+i,height:n.height+i}),_p=(n,i)=>Ns(i,l=>{const d=Yx(Zp(l.getBoundingClientRect()),-1);return[{x:d.left,y:n(d),cell:l},{x:d.right,y:n(d),cell:l}]}),Xx=(n,i,l)=>bn(n,(d,p)=>d.fold(()=>he.some(p),w=>{const E=Math.sqrt(Math.abs(w.x-i)+Math.abs(w.y-l)),R=Math.sqrt(Math.abs(p.x-i)+Math.abs(p.y-l));return he.some(R<E?p:w)}),he.none()),aN=(n,i,l,d,p)=>{const w=dl(Ke.fromDom(l),"td,th,caption").map(R=>R.dom),E=yt(_p(n,w),R=>i(R,p));return Xx(E,d,p).map(R=>R.cell)},b7=n=>n.bottom,VG=n=>n.top,v7=(n,i)=>n.y<i,UG=(n,i)=>n.y>i,WG=He(aN,b7,v7),Jx=He(aN,VG,UG),jG=(n,i)=>No(i.getClientRects()).bind(l=>WG(n,l.left,l.top)).bind(l=>o4(F5(l),i)),ZG=(n,i)=>Mo(i.getClientRects()).bind(l=>Jx(n,l.left,l.top)).bind(l=>o4(EF(l),i)),qG=(n,i,l)=>l.breakAt.exists(d=>n(i,d).breakAt.isSome()),GG=n=>n.breakType===ov.Wrap&&n.positions.length===0,KG=n=>n.breakType===ov.Br&&n.positions.length===1,y7=(n,i,l)=>{const d=n(i,l);return GG(d)||!ui(l.getNode())&&KG(d)?!qG(n,i,d):d.breakAt.isNone()},YG=He(y7,Vx),XG=He(y7,AS),JG=(n,i,l)=>{const d=Vt.fromRangeStart(i);return ry(!n,l).exists(p=>p.isEqual(d))},QG=(n,i,l,d)=>{const p=n.selection.getRng(),w=i?1:-1;return Db()&&JG(i,p,l)?(Qb(w,n,l,!i,!1).each(E=>{sv(n,E)}),!0):!1},eK=(n,i,l)=>jG(i,l).orThunk(()=>No(l.getClientRects()).bind(d=>B5(kF(n,Vt.before(i)),d.left))).getOr(Vt.before(i)),tK=(n,i,l)=>ZG(i,l).orThunk(()=>No(l.getClientRects()).bind(d=>B5(Oy(n,Vt.after(i)),d.left))).getOr(Vt.after(i)),w7=(n,i)=>{const l=i.getNode(n);return Eu(l)?he.some(l):he.none()},nK=(n,i,l)=>{i.undoManager.transact(()=>{const d=n?Yc:wa,p=tN(i,Ke.fromDom(l),d);sv(i,p)})},lN=(n,i,l)=>{const d=w7(!!i,l),p=i===!1;d.fold(()=>sv(n,l.toRange()),w=>ry(p,n.getBody()).filter(E=>E.isEqual(l)).fold(()=>sv(n,l.toRange()),E=>nK(i,n,w)))},_7=(n,i,l,d)=>{const p=n.selection.getRng(),w=Vt.fromRangeStart(p),E=n.getBody();if(!i&&YG(d,w)){const R=eK(E,l,w);return lN(n,i,R),!0}else if(i&&XG(d,w)){const R=tK(E,l,w);return lN(n,i,R),!0}else return!1},cN=(n,i,l)=>he.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(d=>he.from(n.dom.getParent(d,"table")).map(p=>l(n,i,p,d))).getOr(!1),C7=(n,i)=>cN(n,i,QG),uN=(n,i)=>cN(n,i,_7),oK=n=>{const i=r1.exact(n,0,n,0);return sM(i)},S7=(n,i,l)=>l.fold(he.none,he.none,(d,p)=>IU(p).map(w=>oK(w)),d=>(n.execCommand("mceTableInsertRowAfter"),fN(n,i,d))),fN=(n,i,l)=>S7(n,i,S4(l,wn)),sK=(n,i,l)=>S7(n,i,Kx(l,wn)),dN=(n,i)=>{const l=["table","li","dl"],d=Ke.fromDom(n.getBody()),p=R=>{const B=Xr(R);return pt(R,d)||Ct(l,B)},w=n.selection.getRng(),E=Ke.fromDom(i?w.endContainer:w.startContainer);return rN(E,p).map(R=>(_4(R,p).each(ie=>{n.model.table.clearSelectedCells(ie.dom)}),n.selection.collapse(!i),(i?fN:sK)(n,p,R).each(ie=>{n.selection.setRng(ie)}),!0)).getOr(!1)},rK=(n,i,l)=>{const d=Kn.os.isMacOS()||Kn.os.isiOS();qx([{keyCode:eo.RIGHT,action:us(r7,n,!0)},{keyCode:eo.LEFT,action:us(r7,n,!1)},{keyCode:eo.UP,action:us(i7,n,!1)},{keyCode:eo.DOWN,action:us(i7,n,!0)},...d?[{keyCode:eo.UP,action:us(v4,n,!1),metaKey:!0,shiftKey:!0},{keyCode:eo.DOWN,action:us(v4,n,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:eo.RIGHT,action:us(C7,n,!0)},{keyCode:eo.LEFT,action:us(C7,n,!1)},{keyCode:eo.UP,action:us(uN,n,!1)},{keyCode:eo.DOWN,action:us(uN,n,!0)},{keyCode:eo.UP,action:us(uN,n,!1)},{keyCode:eo.UP,action:us(y4,n,!1)},{keyCode:eo.DOWN,action:us(y4,n,!0)},{keyCode:eo.RIGHT,action:us(d7,n,!0)},{keyCode:eo.LEFT,action:us(d7,n,!1)},{keyCode:eo.UP,action:us(h7,n,!1)},{keyCode:eo.DOWN,action:us(h7,n,!0)},{keyCode:eo.RIGHT,action:us(l4,n,i,!0)},{keyCode:eo.LEFT,action:us(l4,n,i,!1)},{keyCode:eo.RIGHT,ctrlKey:!d,altKey:d,action:us(rG,n,i)},{keyCode:eo.LEFT,ctrlKey:!d,altKey:d,action:us(iG,n,i)},{keyCode:eo.UP,action:us(l7,n,!1)},{keyCode:eo.DOWN,action:us(l7,n,!0)}],l).each(p=>{l.preventDefault()})},k7=(n,i)=>{n.on("keydown",l=>{l.isDefaultPrevented()||rK(n,i,l)})},Cp=(n,i)=>({container:n,offset:i}),k4=Lr.DOM,E4=n=>i=>n===i?-1:0,iK=n=>i=>n.isBlock(i)||Ct(["BR","IMG","HR","INPUT"],i.nodeName)||n.getContentEditable(i)==="false",x4=(n,i,l)=>{if(_n(n)&&i>=0)return he.some(Cp(n,i));{const d=op(k4);return he.from(d.backwards(n,i,E4(n),l)).map(p=>Cp(p.container,p.container.data.length))}},aK=(n,i,l)=>{if(_n(n)&&i>=n.length)return he.some(Cp(n,i));{const d=op(k4);return he.from(d.forwards(n,i,E4(n),l)).map(p=>Cp(p.container,0))}},hN=(n,i,l)=>{if(!_n(n))return he.none();const d=n.data;if(i>=0&&i<=d.length)return he.some(Cp(n,i));{const p=op(k4);return he.from(p.backwards(n,i,E4(n),l)).bind(w=>{const E=w.container.data;return hN(w.container,i+E.length,l)})}},mN=(n,i,l)=>{if(!_n(n))return he.none();const d=n.data;if(i<=d.length)return he.some(Cp(n,i));{const p=op(k4);return he.from(p.forwards(n,i,E4(n),l)).bind(w=>mN(w.container,i-d.length,l))}},gN=(n,i,l,d,p)=>{const w=op(n,iK(n));return he.from(w.backwards(i,l,d,p))},lK=n=>n.collapsed&&_n(n.startContainer),pN=n=>Bn(n.toString().replace(/\u00A0/g," ")),E7=n=>n!==""&&` \xA0\f
\r \v`.indexOf(n)!==-1,bN=(n,i)=>n.substring(i.length),cK=(n,i,l)=>{let d;const p=l.charAt(0);for(d=i-1;d>=0;d--){const w=n.charAt(d);if(E7(w))return he.none();if(p===w&&Qs(n,l,d,i))break}return he.some(d)},x7=(n,i,l,d=0)=>{if(!lK(i))return he.none();const p={text:"",offset:0},w=(R,B,K)=>(p.text=K+p.text,p.offset+=B,cK(p.text,p.offset,l).getOr(B)),E=n.getParent(i.startContainer,n.isBlock)||n.getRoot();return gN(n,i.startContainer,i.startOffset,w,E).bind(R=>{const B=i.cloneRange();if(B.setStart(R.container,R.offset),B.setEnd(i.endContainer,i.endOffset),B.collapsed)return he.none();const K=pN(B);return K.lastIndexOf(l)!==0||bN(K,l).length<d?he.none():he.some({text:bN(K,l),range:B,trigger:l})})},vN=(n,i,l,d=0)=>HU(Ke.fromDom(i.startContainer)).fold(()=>x7(n,i,l,d),p=>{const w=n.createRng();w.selectNode(p.dom);const E=pN(w);return he.some({range:w,text:bN(E,l),trigger:l})}),uK=n=>n.nodeType===jd,fK=n=>n.nodeType===$f,A7=n=>{if(uK(n))return Cp(n,n.data.length);{const i=n.childNodes;return i.length>0?A7(i[i.length-1]):Cp(n,i.length)}},T7=(n,i)=>{const l=n.childNodes;return l.length>0&&i<l.length?T7(l[i],0):l.length>0&&fK(n)&&l.length===i?A7(l[l.length-1]):Cp(n,i)},dK=(n,i)=>{var l;const d=(l=n.getParent(i.container,n.isBlock))!==null&&l!==void 0?l:n.getRoot();return gN(n,i.container,i.offset,(p,w)=>w===0?-1:w,d).filter(p=>{const w=p.container.data.charAt(p.offset-1);return!E7(w)}).isSome()},hK=n=>i=>{const l=T7(i.startContainer,i.startOffset);return!dK(n,l)},mK=(n,i,l)=>Ls(l.triggers,d=>vN(n,i,d)),gK=(n,i)=>{const l=i(),d=n.selection.getRng();return mK(n.dom,d,l).bind(p=>pK(n,i,p))},pK=(n,i,l,d={})=>{var p;const w=i(),R=(p=n.selection.getRng().startContainer.nodeValue)!==null&&p!==void 0?p:"",B=yt(w.lookupByTrigger(l.trigger),ie=>l.text.length>=ie.minChars&&ie.matches.getOrThunk(()=>hK(n.dom))(l.range,R,l.text));if(B.length===0)return he.none();const K=Promise.all(Et(B,ie=>ie.fetch(l.text,ie.maxResults,d).then(pe=>({matchText:l.text,items:pe,columns:ie.columns,onAction:ie.onAction,highlightOn:ie.highlightOn}))));return he.some({lookupData:K,context:l})};var g1;(function(n){n[n.Error=0]="Error",n[n.Value=1]="Value"})(g1||(g1={}));const RS=(n,i,l)=>n.stype===g1.Error?i(n.serror):l(n.svalue),D7=n=>{const i=[],l=[];return Pe(n,d=>{RS(d,p=>l.push(p),p=>i.push(p))}),{values:i,errors:l}},O7=(n,i)=>n.stype===g1.Error?{stype:g1.Error,serror:i(n.serror)}:n,bK=(n,i)=>n.stype===g1.Value?{stype:g1.Value,svalue:i(n.svalue)}:n,M7=(n,i)=>n.stype===g1.Value?i(n.svalue):n,R7=(n,i)=>n.stype===g1.Error?i(n.serror):n,N7=n=>({stype:g1.Value,svalue:n}),P7=n=>({stype:g1.Error,serror:n}),Lu={fromResult:n=>n.fold(P7,N7),toResult:n=>RS(n,fc.error,fc.value),svalue:N7,partition:D7,serror:P7,bind:M7,bindError:R7,map:bK,mapError:O7,fold:RS},Qx=n=>ne(n)&&gs(n).length>100?" removed due to size":JSON.stringify(n,null,2),yK=n=>{const i=n.length>10?n.slice(0,10).concat([{path:[],getErrorInfo:nt("... (only showing first ten failures)")}]):n;return Et(i,l=>"Failed path: ("+l.path.join(" > ")+`)
`+l.getErrorInfo())},A4=(n,i)=>Lu.serror([{path:n,getErrorInfo:i}]),wK=(n,i,l)=>A4(n,()=>'Could not find valid *required* value for "'+i+'" in '+Qx(l)),I7=(n,i)=>A4(n,()=>'Choice schema did not contain choice key: "'+i+'"'),_K=(n,i,l)=>A4(n,()=>'The chosen schema: "'+l+'" did not exist in branches: '+Qx(i)),CK=(n,i)=>A4(n,nt(i)),SK=(n,i,l,d)=>go(l,d).fold(()=>_K(n,l,d),w=>w.extract(n.concat(["branch: "+d]),i)),kK=(n,i)=>({extract:(p,w)=>go(w,n).fold(()=>I7(p,n),R=>SK(p,w,i,R)),toString:()=>"chooseOn("+n+"). Possible values: "+gs(i)}),EK=(n,i)=>i,kc=(n,i)=>oe(n)&&oe(i)?T4(n,i):i,p1=n=>(...i)=>{if(i.length===0)throw new Error("Can't merge zero objects");const l={};for(let d=0;d<i.length;d++){const p=i[d];for(const w in p)cn(p,w)&&(l[w]=n(l[w],p[w]))}return l},T4=p1(kc),cre=p1(EK),B7=()=>({tag:"required",process:{}}),xK=n=>({tag:"defaultedThunk",process:n}),L7=n=>xK(nt(n)),AK=()=>({tag:"option",process:{}}),F7=(n,i)=>n.length>0?Lu.svalue(T4(i,cre.apply(void 0,n))):Lu.svalue(i),n_=n=>V(Lu.serror,Or)(n),TK={consolidateObj:(n,i)=>{const l=Lu.partition(n);return l.errors.length>0?n_(l.errors):F7(l.values,i)},consolidateArr:n=>{const i=Lu.partition(n);return i.errors.length>0?n_(i.errors):Lu.svalue(i.values)}},b1=(n,i,l,d)=>({tag:"field",key:n,newKey:i,presence:l,prop:d}),DK=(n,i)=>({tag:"custom",newKey:n,instantiator:i}),H7=(n,i,l)=>{switch(n.tag){case"field":return i(n.key,n.newKey,n.presence,n.prop);case"custom":return l(n.newKey,n.instantiator)}},D4=n=>{const i=(d,p)=>Lu.bindError(n(p),w=>CK(d,w)),l=nt("val");return{extract:i,toString:l}},OK=D4(Lu.svalue),yN=(n,i,l,d)=>go(i,l).fold(()=>wK(n,l,i),d),wN=(n,i,l,d)=>{const p=go(n,i).getOrThunk(()=>l(n));return d(p)},MK=(n,i,l)=>l(go(n,i)),RK=(n,i,l,d)=>{const p=go(n,i).map(w=>w===!0?l(n):w);return d(p)},NK=(n,i,l,d,p)=>{const w=R=>p.extract(i.concat([d]),R),E=R=>R.fold(()=>Lu.svalue(he.none()),B=>{const K=p.extract(i.concat([d]),B);return Lu.map(K,he.some)});switch(n.tag){case"required":return yN(i,l,d,w);case"defaultedThunk":return wN(l,d,n.process,w);case"option":return MK(l,d,E);case"defaultedOptionThunk":return RK(l,d,n.process,E);case"mergeWithThunk":return wN(l,d,nt({}),R=>{const B=T4(n.process(l),R);return w(B)})}},$7=(n,i,l)=>{const d={},p=[];for(const w of l)H7(w,(E,R,B,K)=>{const ie=NK(B,n,i,E,K);Lu.fold(ie,ue=>{p.push(...ue)},ue=>{d[R]=ue})},(E,R)=>{d[E]=R(i)});return p.length>0?Lu.serror(p):Lu.svalue(d)},O4=n=>({extract:(d,p)=>$7(d,p,n),toString:()=>`obj{
`+Et(n,p=>H7(p,(w,E,R,B)=>w+" -> "+B.toString(),(w,E)=>"state("+w+")")).join(`
`)+"}"}),M4=n=>({extract:(d,p)=>{const w=Et(p,(E,R)=>n.extract(d.concat(["["+R+"]"]),E));return TK.consolidateArr(w)},toString:()=>"array("+n.toString()+")"}),_N=n=>D4(i=>n(i).fold(Lu.serror,Lu.svalue)),CN=(n,i,l)=>{const d=i.extract([n],l);return Lu.mapError(d,p=>({input:l,errors:p}))},PK=(n,i,l)=>Lu.toResult(CN(n,i,l)),IK=n=>`Errors:
`+yK(n.errors).join(`
`)+`
Input object: `+Qx(n.input),z7=(n,i)=>kK(n,ps(i,O4)),BK=nt(OK),NS=(n,i)=>D4(l=>{const d=typeof l;return n(l)?Lu.svalue(l):Lu.serror(`Expected type: ${i} but got: ${d}`)}),V7=NS(tt,"number"),R4=NS(F,"string"),U7=NS(we,"boolean"),SN=NS(be,"function"),o_=b1,W7=DK,LK=n=>_N(i=>Ct(n,i)?fc.value(i):fc.error(`Unsupported value: "${i}", choose one of "${n.join(", ")}".`)),j7=(n,i)=>o_(n,n,B7(),i),Z7=n=>j7(n,R4),q7=n=>j7(n,SN),G7=(n,i)=>o_(n,n,B7(),M4(i)),eA=(n,i)=>o_(n,n,AK(),i),tA=n=>eA(n,R4),K7=n=>eA(n,SN),FK=(n,i)=>o_(n,n,L7(i),BK()),PS=(n,i,l)=>o_(n,n,L7(i),l),Y7=(n,i)=>PS(n,i,V7),N4=(n,i)=>PS(n,i,R4),kN=(n,i,l)=>PS(n,i,LK(l)),P4=(n,i)=>PS(n,i,U7),EN=(n,i)=>PS(n,i,SN),HK=(n,i,l)=>PS(n,i,M4(l)),fre=Z7("type"),dre=q7("fetch"),X7=q7("onAction"),$K=EN("onSetup",()=>ft),hre=tA("text"),zK=tA("icon"),VK=tA("tooltip"),mre=tA("label"),UK=P4("active",!1),vl=P4("enabled",!0),I4=P4("primary",!1),E0=n=>FK("columns",n),IS=n=>N4("type",n),J7=O4([fre,Z7("trigger"),Y7("minChars",1),E0(1),Y7("maxResults",10),K7("matches"),dre,X7,HK("highlightOn",[],R4)]),WK=n=>PK("Autocompleter",J7,{trigger:n.ch,...n}),BS=[vl,VK,zK,hre,$K],B4=[UK].concat(BS),Q7=[EN("predicate",We),kN("scope","node",["node","editor"]),kN("position","selection",["node","selection","line"])],e9=BS.concat([IS("contextformbutton"),I4,X7,W7("original",Ot)]),jK=B4.concat([IS("contextformbutton"),I4,X7,W7("original",Ot)]),ZK=BS.concat([IS("contextformbutton")]),qK=B4.concat([IS("contextformtogglebutton")]),GK=z7("type",{contextformbutton:e9,contextformtogglebutton:jK});O4([IS("contextform"),EN("initValue",nt("")),mre,G7("commands",GK),eA("launch",z7("type",{contextformbutton:ZK,contextformtogglebutton:qK}))].concat(Q7));const KK=n=>{const i=n.ui.registry.getAll().popups,l=ps(i,E=>WK(E).fold(R=>{throw new Error(IK(R))},Ot)),d=cs(Wn(l,E=>E.trigger)),p=lo(l);return{dataset:l,triggers:d,lookupByTrigger:E=>yt(p,R=>R.trigger===E)}},t9=(n,i)=>{const l=Mv(i.load,50);n.on("keypress compositionend",d=>{d.which!==27&&l.throttle()}),n.on("keydown",d=>{const p=d.which;p===8?l.throttle():p===27&&i.cancelIfNecessary()}),n.on("remove",l.cancel)},YK=n=>{const i=mh(),l=qa(!1),d=i.isSet,p=()=>{d()&&(TZ(n),sr(n),l.set(!1),i.clear())},w=K=>{d()||(Ga(n,K.range),i.set({trigger:K.trigger,matchLength:K.text.length}))},E=jt(()=>KK(n)),R=K=>i.get().map(ie=>vN(n.dom,n.selection.getRng(),ie.trigger).bind(ue=>pK(n,E,ue,K))).getOrThunk(()=>gK(n,E)),B=K=>{R(K).fold(p,ie=>{w(ie.context),ie.lookupData.then(ue=>{i.get().map(pe=>{const Be=ie.context;pe.trigger===Be.trigger&&(Be.text.length-pe.matchLength>=10?p():(i.set({...pe,matchLength:Be.text.length}),l.get()?jO(n,{lookupData:ue}):(l.set(!0),WO(n,{lookupData:ue}))))})})})};n.addCommand("mceAutocompleterReload",(K,ie)=>{const ue=ne(ie)?ie.fetchOptions:{};B(ue)}),n.addCommand("mceAutocompleterClose",p),t9(n,{cancelIfNecessary:p,load:B})},XK=vs().browser.isSafari(),n9=n=>Te(Ke.fromDom(n)),o9=(n,i)=>{var l;return n.startOffset===0&&n.endOffset===((l=i.textContent)===null||l===void 0?void 0:l.length)},nA=(n,i)=>he.from(n.getParent(i.container(),"details")),xN=(n,i)=>nA(n,i).isSome(),JK=(n,i)=>{const l=he.from(n.getParent(i.startContainer,"details")),d=he.from(n.getParent(i.endContainer,"details"));if(l.isSome()||d.isSome()){const p=l.bind(w=>he.from(n.select("summary",w)[0]));return he.some({startSummary:p,startDetails:l,endDetails:d})}else return he.none()},QK=(n,i)=>sl(i).exists(l=>l.isEqual(n)),pre=(n,i)=>Id(i).exists(l=>ui(l.getNode())&&Mu(i,l).exists(d=>d.isEqual(n))||l.isEqual(n)),AN=(n,i)=>i.startSummary.exists(l=>QK(n,l)),eY=(n,i)=>i.startSummary.exists(l=>pre(n,l)),tY=(n,i)=>i.startDetails.exists(l=>Mu(l,n).forall(d=>i.startSummary.exists(p=>!p.contains(n.container())&&p.contains(d.container())))),nY=(n,i,l)=>l.startDetails.exists(d=>Rf(n,i).forall(p=>!d.contains(p.container()))),TN=(n,i)=>{const l=i.getNode();ye(l)||n.selection.setCursorLocation(l,i.offset())},s9=(n,i,l)=>{const d=n.dom.getParent(i.container(),"details");if(d&&!d.open){const p=n.dom.select("summary",d)[0];p&&(l?sl(p):Id(p)).each(E=>TN(n,E))}else TN(n,i)},r9=(n,i)=>{const l=B=>B.contains(n.startContainer),d=B=>B.contains(n.endContainer),p=i.startSummary.exists(l),w=i.startSummary.exists(d),E=i.startDetails.forall(B=>i.endDetails.forall(K=>B!==K));return(p||w)&&!(p&&w)||E},i9=(n,i,l)=>{const{dom:d,selection:p}=n,w=n.getBody();if(l==="character"){const E=Vt.fromRangeStart(p.getRng()),R=d.getParent(E.container(),d.isBlock),B=nA(d,E),K=R&&d.isEmpty(R),ie=J(R==null?void 0:R.previousSibling),ue=J(R==null?void 0:R.nextSibling);return K&&(i?ue:ie)&&m0(!i,w,E).exists(Ze=>xN(d,Ze)&&!Nl(B,nA(d,Ze)))?!0:m0(i,w,E).fold(We,pe=>{const Be=nA(d,pe);if(xN(d,pe)&&!Nl(B,Be)){if(i||s9(n,pe,!1),R&&K){if(i&&ie)return!0;if(!i&&ue)return!0;s9(n,pe,i),n.dom.remove(R)}return!0}else return!1})}else return!1},oY=(n,i,l,d)=>{const w=n.selection.getRng(),E=Vt.fromRangeStart(w),R=n.getBody();return d==="selection"?r9(w,i):l?eY(E,i)||nY(R,E,i):AN(E,i)||tY(E,i)},bre=(n,i,l)=>JK(n.dom,n.selection.getRng()).fold(()=>i9(n,i,l),d=>oY(n,d,i,l)||i9(n,i,l)),ff=(n,i,l)=>{const d=n.selection,p=d.getNode(),w=d.getRng(),E=Vt.fromRangeStart(w);return Hp(p)?(l==="selection"&&o9(w,p)||MM(i,E,p)?n9(p):n.undoManager.transact(()=>{const R=d.getSel();let{anchorNode:B,anchorOffset:K,focusNode:ie,focusOffset:ue}=R!=null?R:{};const pe=()=>{_e(B)&&_e(K)&&_e(ie)&&_e(ue)&&(R==null||R.setBaseAndExtent(B,K,ie,ue))},Be=()=>{B=R==null?void 0:R.anchorNode,K=R==null?void 0:R.anchorOffset,ie=R==null?void 0:R.focusNode,ue=R==null?void 0:R.focusOffset},Ze=(ze,ht)=>{Pe(ze.childNodes,bt=>{bw(bt)&&ht.appendChild(bt)})},Oe=n.dom.create("span",{"data-mce-bogus":"1"});Ze(p,Oe),p.appendChild(Oe),pe(),(l==="word"||l==="line")&&(R==null||R.modify("extend",i?"right":"left",l)),!d.isCollapsed()&&o9(d.getRng(),Oe)?n9(p):(n.execCommand(i?"ForwardDelete":"Delete"),Be(),Ze(Oe,p),pe()),n.dom.remove(Oe)}),!0):!1},s_=(n,i,l)=>bre(n,i,l)||XK&&ff(n,i,l)?he.some(ft):he.none(),a9=n=>(i,l,d={})=>{const p=i.getBody(),w={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:p,currentTarget:p,eventPhase:Event.AT_TARGET,originalTarget:p,explicitOriginalTarget:p,isTrusted:!1,srcElement:p,cancelable:!1,preventDefault:ft,inputType:l},E=su(new InputEvent(n));return i.dispatch(n,{...E,...w,...d})},oA=a9("input"),L4=a9("beforeinput"),l9=vs(),c9=l9.os,u9=c9.isMacOS()||c9.isiOS(),sY=l9.browser.isFirefox(),rY=(n,i,l)=>{const d=l.keyCode===eo.BACKSPACE?"deleteContentBackward":"deleteContentForward",p=n.selection.isCollapsed(),w=p?"character":"selection",E=R=>p?R?"word":"line":"selection";nc([{keyCode:eo.BACKSPACE,action:us(YF,n)},{keyCode:eo.BACKSPACE,action:us(ev,n,!1)},{keyCode:eo.DELETE,action:us(ev,n,!0)},{keyCode:eo.BACKSPACE,action:us(x5,n,!1)},{keyCode:eo.DELETE,action:us(x5,n,!0)},{keyCode:eo.BACKSPACE,action:us(OS,n,i,!1)},{keyCode:eo.DELETE,action:us(OS,n,i,!0)},{keyCode:eo.BACKSPACE,action:us(y0,n,!1)},{keyCode:eo.DELETE,action:us(y0,n,!0)},{keyCode:eo.BACKSPACE,action:us(s_,n,!1,w)},{keyCode:eo.DELETE,action:us(s_,n,!0,w)},...u9?[{keyCode:eo.BACKSPACE,altKey:!0,action:us(s_,n,!1,E(!0))},{keyCode:eo.DELETE,altKey:!0,action:us(s_,n,!0,E(!0))},{keyCode:eo.BACKSPACE,metaKey:!0,action:us(s_,n,!1,E(!1))}]:[{keyCode:eo.BACKSPACE,ctrlKey:!0,action:us(s_,n,!1,E(!0))},{keyCode:eo.DELETE,ctrlKey:!0,action:us(s_,n,!0,E(!0))}],{keyCode:eo.BACKSPACE,action:us(O5,n,!1)},{keyCode:eo.DELETE,action:us(O5,n,!0)},{keyCode:eo.BACKSPACE,action:us(Y5,n,!1)},{keyCode:eo.DELETE,action:us(Y5,n,!0)},{keyCode:eo.BACKSPACE,action:us(C5,n,!1)},{keyCode:eo.DELETE,action:us(C5,n,!0)},{keyCode:eo.BACKSPACE,action:us(_5,n,!1)},{keyCode:eo.DELETE,action:us(_5,n,!0)},{keyCode:eo.BACKSPACE,action:us(G5,n,!1)},{keyCode:eo.DELETE,action:us(G5,n,!0)}],l).filter(R=>n.selection.isEditable()).each(R=>{l.preventDefault(),L4(n,d).isDefaultPrevented()||(R(),oA(n,d))})},ON=(n,i,l)=>qx([{keyCode:eo.BACKSPACE,action:us(lF,n)},{keyCode:eo.DELETE,action:us(lF,n)},...u9?[{keyCode:eo.BACKSPACE,altKey:!0,action:us(Zx,n)},{keyCode:eo.DELETE,altKey:!0,action:us(Zx,n)},...l?[{keyCode:sY?224:91,action:us(Zx,n)}]:[]]:[{keyCode:eo.BACKSPACE,ctrlKey:!0,action:us(Zx,n)},{keyCode:eo.DELETE,ctrlKey:!0,action:us(Zx,n)}]],i),MN=(n,i)=>{let l=!1;n.on("keydown",d=>{l=d.keyCode===eo.BACKSPACE,d.isDefaultPrevented()||rY(n,i,d)}),n.on("keyup",d=>{d.isDefaultPrevented()||ON(n,d,l),l=!1})},iY=n=>{for(;n;){if(Xn(n)||_n(n)&&n.data&&/[\r\n\s]/.test(n.data))return n;n=n.nextSibling}return null},sA=(n,i)=>{const l=n.dom,d=n.schema.getMoveCaretBeforeOnEnterElements();if(!i)return;if(/^(LI|DT|DD)$/.test(i.nodeName)){const w=iY(i.firstChild);w&&/^(UL|OL|DL)$/.test(w.nodeName)&&i.insertBefore(l.doc.createTextNode(Gr),i.firstChild)}const p=l.createRng();if(i.normalize(),i.hasChildNodes()){const w=new pi(i,i);let E=i,R;for(;R=w.current();){if(_n(R)){p.setStart(R,0),p.setEnd(R,0);break}if(d[R.nodeName.toLowerCase()]){p.setStartBefore(R),p.setEndBefore(R);break}E=R,R=w.next()}R||(p.setStart(E,0),p.setEnd(E,0))}else ui(i)?i.nextSibling&&l.isBlock(i.nextSibling)?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)):(p.setStart(i,0),p.setEnd(i,0));n.selection.setRng(p),cf(n,p)},F4=(n,i)=>{const l=n.getRoot();let d,p=i;for(;p!==l&&p&&n.getContentEditable(p)!=="false";){if(n.getContentEditable(p)==="true"){d=p;break}p=p.parentNode}return p!==l?d:l},f9=n=>he.from(n.dom.getParent(n.selection.getStart(!0),n.dom.isBlock)),aY=n=>f9(n).fold(nt(""),i=>i.nodeName.toUpperCase()),lY=n=>f9(n).filter(i=>ja(Ke.fromDom(i))).isSome(),d9=n=>{n.innerHTML='<br data-mce-bogus="1">'},cY=(n,i,l)=>{const d=n.dom;he.from(l.style).map(d.parseStyle).each(B=>{const ie={...qh(Ke.fromDom(i)),...B};d.setStyles(i,ie)});const p=he.from(l.class).map(B=>B.split(/\s+/)),w=he.from(i.className).map(B=>yt(B.split(/\s+/),K=>K!==""));ni(p,w,(B,K)=>{const ie=yt(K,pe=>!Ct(B,pe)),ue=[...B,...ie];d.setAttrib(i,"class",ue.join(" "))});const E=["style","class"],R=Wt(l,(B,K)=>!Ct(E,K));d.setAttribs(i,R)},Dh=(n,i)=>{if(Hc(n).toLowerCase()===i.tagName.toLowerCase()){const d=o0(n);cY(n,i,d)}},h9=(n,i,l,d,p=!0,w)=>{const E=n.dom,R=n.schema,B=Hc(n),K=l?l.nodeName.toUpperCase():"";let ie=i;const ue=R.getTextInlineElements();let pe;w||K==="TABLE"||K==="HR"?pe=E.create(w||B):pe=l.cloneNode(!1);let Be=pe;if(!p)E.setAttrib(pe,"style",null),E.setAttrib(pe,"class",null);else do if(ue[ie.nodeName]){if($c(ie)||Bd(ie))continue;const Ze=ie.cloneNode(!1);E.setAttrib(Ze,"id",""),pe.hasChildNodes()?(Ze.appendChild(pe.firstChild),pe.appendChild(Ze)):(Be=Ze,pe.appendChild(Ze))}while((ie=ie.parentNode)&&ie!==d);return Dh(n,pe),d9(Be),pe},uY=(n,i)=>n.dom.getParent(i,_a),Py=(n,i,l)=>{let d=i;for(;d&&d!==n&&J(d.nextSibling);){const p=d.parentElement;if(!p||!l(p))return _a(p);d=p}return!1},fY=(n,i,l)=>!i&&l.nodeName.toLowerCase()===Hc(n)&&n.dom.isEmpty(l)&&Py(n.getBody(),l,d=>cn(n.schema.getTextBlockElements(),d.nodeName.toLowerCase())),m9=(n,i,l)=>{var d,p,w;const E=i(Hc(n)),R=uY(n,l);!R||(n.dom.insertAfter(E,R),sA(n,E),((w=(p=(d=l.parentElement)===null||d===void 0?void 0:d.childNodes)===null||p===void 0?void 0:p.length)!==null&&w!==void 0?w:0)>1&&n.dom.remove(l))},dY=(n,i)=>n.firstChild&&n.firstChild.nodeName===i,hY=n=>{var i;return((i=n.parentNode)===null||i===void 0?void 0:i.firstChild)===n},g9=(n,i)=>{const l=n==null?void 0:n.parentNode;return _e(l)&&l.nodeName===i},p9=n=>_e(n)&&/^(OL|UL|LI)$/.test(n.nodeName),mY=n=>_e(n)&&/^(LI|DT|DD)$/.test(n.nodeName),gY=n=>p9(n)&&p9(n.parentNode),H4=n=>{const i=n.parentNode;return mY(i)?i:n},LS=(n,i,l)=>{let d=n[l?"firstChild":"lastChild"];for(;d&&!Xn(d);)d=d[l?"nextSibling":"previousSibling"];return d===i},b9=(n,i,l,d,p)=>{const w=n.dom,E=n.selection.getRng(),R=l.parentNode;if(l===n.getBody()||!R)return;gY(l)&&(p="LI");let B=i(p);if(LS(l,d,!0)&&LS(l,d,!1))if(g9(l,"LI")){const K=H4(l);w.insertAfter(B,K),hY(l)?w.remove(K):w.remove(l)}else w.replace(B,l);else if(LS(l,d,!0))g9(l,"LI")?(w.insertAfter(B,H4(l)),B.appendChild(w.doc.createTextNode(" ")),B.appendChild(l)):R.insertBefore(B,l),w.remove(d);else if(LS(l,d,!1))w.insertAfter(B,H4(l)),w.remove(d);else{l=H4(l);const K=E.cloneRange();K.setStartAfter(d),K.setEndAfter(l);const ie=K.extractContents();p==="LI"&&dY(ie,"LI")?(B=ie.firstChild,w.insertAfter(ie,l)):(w.insertAfter(ie,l),w.insertAfter(B,l)),w.remove(d)}sA(n,B)},$4=n=>{Pe(X0(Ke.fromDom(n),Qa),i=>{const l=i.dom;l.nodeValue=Bn(l.data)})},pY=(n,i)=>{const l=n.dom.getParent(i,"ol,ul,dl");return l!==null&&n.dom.getContentEditableParent(l)==="false"},bY=(n,i)=>i&&i.nodeName==="A"&&n.isEmpty(i),RN=(n,i)=>n.nodeName===i||n.previousSibling&&n.previousSibling.nodeName===i,NN=(n,i)=>_e(i)&&n.isBlock(i)&&!/^(TD|TH|CAPTION|FORM)$/.test(i.nodeName)&&!/^(fixed|absolute)/i.test(i.style.position)&&n.isEditable(i.parentNode)&&n.getContentEditable(i)!=="false",vY=(n,i,l)=>{var d;const p=[];if(!l)return;let w=l;for(;w=w.firstChild;){if(n.isBlock(w))return;Xn(w)&&!i[w.nodeName.toLowerCase()]&&p.push(w)}let E=p.length;for(;E--;)w=p[E],(!w.hasChildNodes()||w.firstChild===w.lastChild&&((d=w.firstChild)===null||d===void 0?void 0:d.nodeValue)===""||bY(n,w))&&n.remove(w)},z4=(n,i,l)=>_n(i)?n?l===1&&i.data.charAt(l-1)===Ft?0:l:l===i.data.length-1&&i.data.charAt(l)===Ft?i.data.length:l:l,yY=n=>{const i=n.cloneRange();return i.setStart(n.startContainer,z4(!0,n.startContainer,n.startOffset)),i.setEnd(n.endContainer,z4(!1,n.endContainer,n.endOffset)),i},v9=n=>{let i=n;do _n(i)&&(i.data=i.data.replace(/^[\r\n]+/,"")),i=i.firstChild;while(i)},y9=(n,i,l,d,p)=>{var w,E;const R=n.dom,B=(w=F4(R,d))!==null&&w!==void 0?w:R.getRoot();let K=R.getParent(d,R.isBlock);if(!K||!NN(R,K)){if(K=K||B,!K.hasChildNodes()){const Be=R.create(i);return Dh(n,Be),K.appendChild(Be),l.setStart(Be,0),l.setEnd(Be,0),Be}let ie=d;for(;ie&&ie.parentNode!==K;)ie=ie.parentNode;let ue;for(;ie&&!R.isBlock(ie);)ue=ie,ie=ie.previousSibling;const pe=(E=ue==null?void 0:ue.parentElement)===null||E===void 0?void 0:E.nodeName;if(ue&&pe&&n.schema.isValidChild(pe,i.toLowerCase())){const Be=ue.parentNode,Ze=R.create(i);for(Dh(n,Ze),Be.insertBefore(Ze,ue),ie=ue;ie&&!R.isBlock(ie);){const Oe=ie.nextSibling;Ze.appendChild(ie),ie=Oe}l.setStart(d,p),l.setEnd(d,p)}}return d},wY=(n,i)=>{i.normalize();const l=i.lastChild;(!l||Xn(l)&&/^(left|right)$/gi.test(n.getStyle(l,"float",!0)))&&n.add(i,"br")},_Y=(n,i)=>{const l=jr(n);return De(i)?!1:F(l)?Ct(hn.explode(l),i.nodeName.toLowerCase()):l},_9={insert:(n,i)=>{let l,d,p,w,E=!1;const R=n.dom,B=n.schema,K=B.getNonEmptyElements(),ie=n.selection.getRng(),ue=Hc(n),pe=Ke.fromDom(ie.startContainer),Be=ju(pe,ie.startOffset),Ze=Be.exists(yn=>xi(yn)&&!wn(yn)),Oe=ie.collapsed&&Ze,ze=yn=>h9(n,l,$n,fn,bh(n),yn),ht=yn=>{const mo=z4(yn,l,d);if(_n(l)&&(yn?mo>0:mo<l.data.length))return!1;if(l.parentNode===$n&&E&&!yn||yn&&Xn(l)&&l===$n.firstChild)return!0;if(RN(l,"TABLE")||RN(l,"HR"))return E&&!yn||!E&&yn;const Oo=new pi(l,$n);_n(l)&&(yn&&mo===0?Oo.prev():!yn&&mo===l.data.length&&Oo.next());let Cs;for(;Cs=Oo.current();){if(Xn(Cs)){if(!Cs.getAttribute("data-mce-bogus")){const Us=Cs.nodeName.toLowerCase();if(K[Us]&&Us!=="br")return!1}}else if(_n(Cs)&&!Zm(Cs.data))return!1;yn?Oo.prev():Oo.next()}return!0},bt=()=>{let yn;return/^(H[1-6]|PRE|FIGURE)$/.test(p)&&Pn!=="HGROUP"?yn=ze(ue):yn=ze(),_Y(n,w)&&NN(R,w)&&R.isEmpty($n,void 0,{includeZwsp:!0})?yn=R.split(w,$n):R.insertAfter(yn,$n),sA(n,yn),yn};QC(R,ie).each(yn=>{ie.setStart(yn.startContainer,yn.startOffset),ie.setEnd(yn.endContainer,yn.endOffset)}),l=ie.startContainer,d=ie.startOffset;const vt=!!(i&&i.shiftKey),Mt=!!(i&&i.ctrlKey);Xn(l)&&l.hasChildNodes()&&!Oe&&(E=d>l.childNodes.length-1,l=l.childNodes[Math.min(d,l.childNodes.length-1)]||l,E&&_n(l)?d=l.data.length:d=0);const fn=F4(R,l);if(!fn||pY(n,l))return;vt||(l=y9(n,ue,ie,l,d));let $n=R.getParent(l,R.isBlock)||R.getRoot();w=_e($n==null?void 0:$n.parentNode)?R.getParent($n.parentNode,R.isBlock):null,p=$n?$n.nodeName.toUpperCase():"";const Pn=w?w.nodeName.toUpperCase():"";if(Pn==="LI"&&!Mt){const yn=w;$n=yn,w=yn.parentNode,p=Pn}if(Xn(w)&&fY(n,vt,$n))return m9(n,ze,$n);if(/^(LI|DT|DD)$/.test(p)&&Xn(w)&&R.isEmpty($n)){b9(n,ze,w,$n,ue);return}if(!Oe&&($n===n.getBody()||!NN(R,$n)))return;const Lt=$n.parentNode;let $t;if(Oe)$t=ze(ue),Be.fold(()=>{Qi(pe,Ke.fromDom($t))},yn=>{wa(yn,Ke.fromDom($t))}),n.selection.setCursorLocation($t,0);else if(bi($n))$t=Wm($n),R.isEmpty($n)&&d9($n),Dh(n,$t),sA(n,$t);else if(ht(!1))$t=bt();else if(ht(!0)&&Lt){$t=Lt.insertBefore(ze(),$n);const yn=Wh(Ke.fromDom(ie.startContainer))&&ie.collapsed;sA(n,RN($n,"HR")||yn?$t:$n)}else{const yn=yY(ie).cloneRange();yn.setEndAfter($n);const mo=yn.extractContents();$4(mo),v9(mo),$t=mo.firstChild,R.insertAfter(mo,$n),vY(R,K,$t),wY(R,$n),R.isEmpty($n)&&d9($n),$t.normalize(),R.isEmpty($t)?(R.remove($t),bt()):(Dh(n,$t),sA(n,$t))}R.setAttrib($t,"id",""),n.dispatch("NewBlock",{newBlock:$t})},fakeEventName:"insertParagraph"},V4=(n,i,l)=>{const d=new pi(i,l);let p;const w=n.getNonEmptyElements();for(;p=d.next();)if(w[p.nodeName.toLowerCase()]||_n(p)&&p.length>0)return!0;return!1},C9=(n,i,l)=>{const d=n.dom.createRng();l?(d.setStartBefore(i),d.setEndBefore(i)):(d.setStartAfter(i),d.setEndAfter(i)),n.selection.setRng(d),cf(n,d)},PN=(n,i)=>{const l=n.selection,d=n.dom,p=l.getRng();let w,E=!1;QC(d,p).each(Be=>{p.setStart(Be.startContainer,Be.startOffset),p.setEnd(Be.endContainer,Be.endOffset)});let R=p.startOffset,B=p.startContainer;if(Xn(B)&&B.hasChildNodes()){const Be=R>B.childNodes.length-1;B=B.childNodes[Math.min(R,B.childNodes.length-1)]||B,Be&&_n(B)?R=B.data.length:R=0}let K=d.getParent(B,d.isBlock);const ie=K&&K.parentNode?d.getParent(K.parentNode,d.isBlock):null,ue=ie?ie.nodeName.toUpperCase():"",pe=!!(i&&i.ctrlKey);ue==="LI"&&!pe&&(K=ie),_n(B)&&R>=B.data.length&&(V4(n.schema,B,K||d.getRoot())||(w=d.create("br"),p.insertNode(w),p.setStartAfter(w),p.setEndAfter(w),E=!0)),w=d.create("br"),gh(d,p,w),C9(n,w,E),n.undoManager.add()},IN=(n,i)=>{const l=Ke.fromTag("br");wa(Ke.fromDom(i),l),n.undoManager.add()},S9=(n,i)=>{yre(n.getBody(),i)||Yc(Ke.fromDom(i),Ke.fromTag("br"));const l=Ke.fromTag("br");Yc(Ke.fromDom(i),l),C9(n,l.dom,!1),n.undoManager.add()},CY=n=>ui(n.getNode()),yre=(n,i)=>CY(Vt.after(i))?!0:Rf(n,Vt.after(i)).map(l=>ui(l.getNode())).getOr(!1),iv=n=>n&&n.nodeName==="A"&&"href"in n,SY=n=>n.fold(We,iv,iv,We),kY=n=>{const i=He(Bw,n),l=Vt.fromRangeStart(n.selection.getRng());return m1(i,n.getBody(),l).filter(SY)},EY=(n,i)=>{i.fold(ft,He(IN,n),He(S9,n),ft)},LN={insert:(n,i)=>{const l=kY(n);l.isSome()?l.each(He(EY,n)):PN(n,i)},fakeEventName:"insertLineBreak"},k9=(n,i)=>f9(n).filter(l=>i.length>0&&wu(Ke.fromDom(l),i)).isSome(),E9=n=>k9(n,aC(n)),AY=n=>k9(n,J2(n)),ym=lg.generate([{br:[]},{block:[]},{none:[]}]),TY=(n,i)=>AY(n),FN=n=>(i,l)=>lY(i)===n,U4=(n,i)=>(l,d)=>aY(l)===n.toUpperCase()===i,DY=n=>{const i=F4(n.dom,n.selection.getStart());return De(i)},r_=n=>U4("pre",n),x9=()=>U4("summary",!0),i_=n=>(i,l)=>Rd(i)===n,A9=(n,i)=>E9(n),rA=(n,i)=>i,OY=n=>{const i=Hc(n),l=F4(n.dom,n.selection.getStart());return _e(l)&&n.schema.isValidChild(l.nodeName,i)},MY=n=>{const i=n.selection.getRng(),l=Ke.fromDom(i.startContainer),p=ju(l,i.startOffset).map(w=>xi(w)&&!wn(w));return i.collapsed&&p.getOr(!0)},$d=(n,i)=>(l,d)=>bn(n,(w,E)=>w&&E(l,d),!0)?he.some(i):he.none(),T9=(n,i)=>gF([$d([TY],ym.none()),$d([r_(!0),DY],ym.none()),$d([x9()],ym.br()),$d([r_(!0),i_(!1),rA],ym.br()),$d([r_(!0),i_(!1)],ym.block()),$d([r_(!0),i_(!0),rA],ym.block()),$d([r_(!0),i_(!0)],ym.br()),$d([FN(!0),rA],ym.br()),$d([FN(!0)],ym.block()),$d([A9],ym.br()),$d([rA],ym.br()),$d([OY],ym.block()),$d([MY],ym.block())],[n,!!(i&&i.shiftKey)]).getOr(ym.none()),W4=(n,i,l)=>{i.selection.isCollapsed()||rx(i),!(_e(l)&&L4(i,n.fakeEventName).isDefaultPrevented())&&(n.insert(i,l),_e(l)&&oA(i,n.fakeEventName))},D9=(n,i)=>{const l=()=>W4(LN,n,i),d=()=>W4(_9,n,i),p=T9(n,i);switch(X2(n)){case"linebreak":p.fold(l,l,ft);break;case"block":p.fold(d,d,ft);break;case"invert":p.fold(d,l,ft);break;default:p.fold(l,d,ft);break}},HN=vs(),RY=HN.os.isiOS()&&HN.browser.isSafari(),O9=(n,i)=>{i.isDefaultPrevented()||(i.preventDefault(),iZ(n.undoManager),n.undoManager.transact(()=>{D9(n,i)}))},NY=n=>{if(!n.collapsed)return!1;const i=n.startContainer;if(_n(i)){const l=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,d=i.data.charAt(n.startOffset-1);return l.test(d)}else return!1},PY=n=>{let i=he.none();const l=p=>{i=he.some(p.selection.getBookmark()),p.undoManager.add()},d=(p,w)=>{p.undoManager.undo(),i.fold(ft,E=>p.selection.moveToBookmark(E)),O9(p,w),i=he.none()};n.on("keydown",p=>{p.keyCode===eo.ENTER&&(RY&&NY(n.selection.getRng())?l(n):O9(n,p))}),n.on("keyup",p=>{p.keyCode===eo.ENTER&&i.each(()=>d(n,p))})},IY=(n,i,l)=>{const d=Kn.os.isMacOS()||Kn.os.isiOS();qx([{keyCode:eo.END,action:us(b4,n,!0)},{keyCode:eo.HOME,action:us(b4,n,!1)},...d?[]:[{keyCode:eo.HOME,action:us(v4,n,!1),ctrlKey:!0,shiftKey:!0},{keyCode:eo.END,action:us(v4,n,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:eo.END,action:us(m7,n,!0)},{keyCode:eo.HOME,action:us(m7,n,!1)},{keyCode:eo.END,action:us(c4,n,!0,i)},{keyCode:eo.HOME,action:us(c4,n,!1,i)}],l).each(p=>{l.preventDefault()})},M9=(n,i)=>{n.on("keydown",l=>{l.isDefaultPrevented()||IY(n,i,l)})},BY=n=>{n.on("input",i=>{i.isComposing||dW(n)})},R9=vs(),LY=(n,i,l)=>{qx([{keyCode:eo.PAGE_UP,action:us(c4,n,!1,i)},{keyCode:eo.PAGE_DOWN,action:us(c4,n,!0,i)}],l)},N9=n=>n.stopImmediatePropagation(),P9=n=>n.keyCode===eo.PAGE_UP||n.keyCode===eo.PAGE_DOWN,I9=(n,i,l)=>{l&&!n.get()?i.on("NodeChange",N9,!0):!l&&n.get()&&i.off("NodeChange",N9),n.set(l)},FY=(n,i)=>{if(R9.os.isMacOS())return;const l=qa(!1);n.on("keydown",d=>{P9(d)&&I9(l,n,!0)}),n.on("keyup",d=>{d.isDefaultPrevented()||LY(n,i,d),P9(d)&&l.get()&&(I9(l,n,!1),n.nodeChanged())})},a_=(n,i)=>{const l=i.container(),d=i.offset();return _n(l)?(l.insertData(d,n),he.some(Vt(l,d+n.length))):Ve(i).map(p=>{const w=Ke.fromText(n);return i.isAtEnd()?Yc(p,w):wa(p,w),Vt(w.dom,n.length)})},B9=He(a_,Gr),L9=He(a_," "),F9=(n,i)=>cB(n,i)?B9(i):L9(i),HY=n=>i=>i.fold(l=>Mu(n.dom,Vt.before(l)),l=>sl(l),l=>Id(l),l=>Rf(n.dom,Vt.after(l))),$Y=(n,i)=>l=>cB(n,l)?B9(i):L9(i),H9=n=>i=>{n.selection.setRng(i.toRange()),n.nodeChanged()},$9=(n,i)=>n.isEditable(n.getParent(i,"summary")),zY=n=>{const i=Vt.fromRangeStart(n.selection.getRng()),l=Ke.fromDom(n.getBody());if(n.selection.isCollapsed()){const d=He(Bw,n),p=Vt.fromRangeStart(n.selection.getRng());return m1(d,n.getBody(),p).bind(HY(l)).map(w=>()=>$Y(l,i)(w).each(H9(n)))}else return he.none()},VY=n=>{const i=()=>{const l=Ke.fromDom(n.getBody());n.selection.isCollapsed()||n.getDoc().execCommand("Delete");const d=Vt.fromRangeStart(n.selection.getRng());F9(l,d).each(H9(n))};return Ss(Kn.browser.isFirefox()&&n.selection.isEditable()&&$9(n.dom,n.selection.getRng().startContainer),i)},wre=(n,i)=>{nc([{keyCode:eo.SPACEBAR,action:us(zY,n)},{keyCode:eo.SPACEBAR,action:us(VY,n)}],i).each(l=>{i.preventDefault(),L4(n,"insertText",{data:" "}).isDefaultPrevented()||(l(),oA(n,"insertText",{data:" "}))})},j4=n=>{n.on("keydown",i=>{i.isDefaultPrevented()||wre(n,i)})},UY=n=>lE(n)?[{keyCode:eo.TAB,action:us(dN,n,!0)},{keyCode:eo.TAB,shiftKey:!0,action:us(dN,n,!1)}]:[],WY=(n,i)=>{qx([...UY(n)],i).each(l=>{i.preventDefault()})},jY=n=>{n.on("keydown",i=>{i.isDefaultPrevented()||WY(n,i)})},ZY=n=>{if(n.addShortcut("Meta+P","","mcePrint"),YK(n),S0(n))return qa(null);{const i=sG(n);return n7(n),k7(n,i),MN(n,i),PY(n),j4(n),BY(n),jY(n),M9(n,i),FY(n,i),i}};class qY{constructor(i){this.lastPath=[],this.editor=i;let l;const d=this;"onselectionchange"in i.getDoc()||i.on("NodeChange click mouseup keyup focus",p=>{const w=i.selection.getRng(),E={startContainer:w.startContainer,startOffset:w.startOffset,endContainer:w.endContainer,endOffset:w.endOffset};(p.type==="nodechange"||!P3(E,l))&&i.dispatch("SelectionChange"),l=E}),i.on("contextmenu",()=>{i.dispatch("SelectionChange")}),i.on("SelectionChange",()=>{const p=i.selection.getStart(!0);!p||LC(i)&&!d.isSameElementPath(p)&&i.dom.isChildOf(p,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("mouseup",p=>{!p.isDefaultPrevented()&&LC(i)&&(i.selection.getNode().nodeName==="IMG"?mg.setEditorTimeout(i,()=>{i.nodeChanged()}):i.nodeChanged())})}nodeChanged(i={}){const l=this.editor.selection;let d;if(this.editor.initialized&&l&&!jv(this.editor)&&!this.editor.mode.isReadOnly()){const p=this.editor.getBody();d=l.getStart(!0)||p,(d.ownerDocument!==this.editor.getDoc()||!this.editor.dom.isChildOf(d,p))&&(d=p);const w=[];this.editor.dom.getParent(d,E=>E===p?!0:(w.push(E),!1)),this.editor.dispatch("NodeChange",{...i,element:d,parents:w})}}isSameElementPath(i){let l;const d=this.editor,p=Zs(d.dom.getParents(i,xt,d.getBody()));if(p.length===this.lastPath.length){for(l=p.length;l>=0&&p[l]===this.lastPath[l];l--);if(l===-1)return this.lastPath=p,!0}return this.lastPath=p,!1}}const z9=Ri("image"),GY=n=>{const i=n;return he.from(i[z9])},KY=(n,i)=>{const l=n;l[z9]=i},$N=Ri("event"),YY=n=>{const i=n;return he.from(i[$N])},Z4=n=>i=>{const l=i;l[$N]=n},XY=(n,i)=>Z4(i)(n),V9=Z4(0),Wi=Z4(2),JY=Z4(1),eX=(n=>i=>{const l=i;return he.from(l[$N]).exists(d=>d===n)})(0),zN=()=>Object.freeze({length:0,item:n=>null}),q4=Ri("mode"),U9=n=>{const i=n;return he.from(i[q4])},G4=n=>i=>{const l=i;l[q4]=n},VN=(n,i)=>G4(i)(n),W9=G4(0),UN=G4(2),j9=G4(1),Z9=n=>i=>{const l=i;return he.from(l[q4]).exists(d=>d===n)},FS=Z9(0),q9=Z9(1),HS=(n,i)=>({...i,get length(){return i.length},add:(l,d)=>{if(FS(n))if(F(l)){if(!ye(d))return i.add(l,d)}else return i.add(l);return null},remove:l=>{FS(n)&&i.remove(l)},clear:()=>{FS(n)&&i.clear()}}),iA=["none","copy","link","move"],tX=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],WN=()=>{const n=new window.DataTransfer;let i="move",l="all";const d={get dropEffect(){return i},set dropEffect(p){Ct(iA,p)&&(i=p)},get effectAllowed(){return l},set effectAllowed(p){eX(d)&&Ct(tX,p)&&(l=p)},get items(){return HS(d,n.items)},get files(){return q9(d)?zN():n.files},get types(){return n.types},setDragImage:(p,w,E)=>{FS(d)&&(KY(d,{image:p,x:w,y:E}),n.setDragImage(p,w,E))},getData:p=>q9(d)?"":n.getData(p),setData:(p,w)=>{FS(d)&&n.setData(p,w)},clearData:p=>{FS(d)&&n.clearData(p)}};return W9(d),d},$S=n=>{const i=WN(),l=U9(n);return UN(n),V9(i),i.dropEffect=n.dropEffect,i.effectAllowed=n.effectAllowed,GY(n).each(d=>i.setDragImage(d.image,d.x,d.y)),Pe(n.types,d=>{d!=="Files"&&i.setData(d,n.getData(d))}),Pe(n.files,d=>i.items.add(d)),YY(n).each(d=>{XY(i,d)}),l.each(d=>{VN(n,d),VN(i,d)}),i},nX=n=>{const i=n.getData("text/html");return i===""?he.none():he.some(i)},K4=(n,i)=>n.setData("text/html",i),Y4="x-tinymce/html",aA=nt(Y4),jN="<!-- "+Y4+" -->",oX=n=>jN+n,G9=n=>n.replace(jN,""),ZN=n=>n.indexOf(jN)!==-1,sX=n=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(n),rX=(n,i)=>{let l="<"+n;const d=Wn(i,(p,w)=>w+'="'+Yg.encodeAllRaw(p)+'"');return d.length&&(l+=" "+d.join(" ")),l+">"},iX=(n,i,l)=>{const d=n.split(/\n\n/),p=rX(i,l),w="</"+i+">",E=Et(d,B=>B.split(/\n/).join("<br />")),R=B=>p+B+w;return E.length===1?E[0]:Et(E,R).join("")},qN="%MCEPASTEBIN%",aX=(n,i)=>{const{dom:l,selection:d}=n,p=n.getBody();i.set(d.getRng());const w=l.add(n.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},qN);Kn.browser.isFirefox()&&l.setStyle(w,"left",l.getStyle(p,"direction",!0)==="rtl"?65535:-65535),l.bind(w,"beforedeactivate focusin focusout",E=>{E.stopPropagation()}),w.focus(),d.select(w,!0)},K9=(n,i)=>{const l=n.dom;if(GN(n)){let d;const p=i.get();for(;d=GN(n);)l.remove(d),l.unbind(d);p&&n.selection.setRng(p)}i.set(null)},GN=n=>n.dom.get("mcepastebin"),lX=n=>_e(n)&&n.id==="mcepastebin",cX=n=>{const i=n.dom,l=(E,R)=>{E.appendChild(R),i.remove(R,!0)},[d,...p]=yt(n.getBody().childNodes,lX);Pe(p,E=>{l(d,E)});const w=i.select("div[id=mcepastebin]",d);for(let E=w.length-1;E>=0;E--){const R=i.create("div");d.insertBefore(R,w[E]),l(R,w[E])}return d?d.innerHTML:""},Y9=n=>n===qN,uX=n=>{const i=qa(null);return{create:()=>aX(n,i),remove:()=>K9(n,i),getEl:()=>GN(n),getHtml:()=>cX(n),getLastRng:i.get}},lA=(n,i)=>(hn.each(i,l=>{ee(l,RegExp)?n=n.replace(l,""):n=n.replace(l[0],l[1])}),n),fX=n=>{const i=dh(),l=yS({},i);let d="";const p=i.getVoidElements(),w=hn.makeMap("script noscript style textarea video audio iframe object"," "),E=i.getBlockElements(),R=B=>{const K=B.name,ie=B;if(K==="br"){d+=`
`;return}if(K!=="wbr"){if(p[K]&&(d+=" "),w[K]){d+=" ";return}if(B.type===3&&(d+=B.value),!(B.name in i.getVoidElements())){let ue=B.firstChild;if(ue)do R(ue);while(ue=ue.next)}E[K]&&ie.next&&(d+=`
`,K==="p"&&(d+=`
`))}};return n=lA(n,[/<!\[[^\]]+\]>/g]),R(l.parse(n)),d},KN=n=>(n=lA(n,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(l,d,p)=>!d&&!p?" ":Gr],/<br class="Apple-interchange-newline">/g,/<br>$/i]),n),dX=n=>{let i=0;return()=>n+i++},hX=n=>{const i=n.toLowerCase(),l={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return hn.hasOwn(l,i)?"image/"+l[i]:"image/"+i},mX=(n,i)=>{const l=yS({sanitize:Xv(n)},n.schema);l.addNodeFilter("meta",p=>{hn.each(p,w=>{w.remove()})});const d=l.parse(i,{forced_root_block:!1,isRootContent:!0});return Pw({validate:!0},n.schema).serialize(d)},X9=(n,i)=>({content:n,cancelled:i}),gX=(n,i,l)=>{const d=n.dom.create("div",{style:"display:none"},i),p=T3(n,d,l);return X9(p.node.innerHTML,p.isDefaultPrevented())},pX=(n,i,l)=>{const d=ZO(n,i,l),p=mX(n,d.content);return n.hasEventListeners("PastePostProcess")&&!d.isDefaultPrevented()?gX(n,p,l):X9(p,d.isDefaultPrevented())},J9=(n,i,l)=>pX(n,i,l),YN=(n,i)=>(n.insertContent(i,{merge:EC(n),paste:!0}),!0),XN=n=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(n),bX=(n,i)=>XN(i)&&Jt(rw(n),l=>Ki(i.toLowerCase(),`.${l.toLowerCase()}`)),vX=(n,i,l)=>(n.undoManager.extra(()=>{l(n,i)},()=>{n.insertContent('<img src="'+i+'">')}),!0),yX=(n,i,l)=>(n.undoManager.extra(()=>{l(n,i)},()=>{n.execCommand("mceInsertLink",!1,i)}),!0),wX=(n,i,l)=>!n.selection.isCollapsed()&&XN(i)?yX(n,i,l):!1,_X=(n,i,l)=>bX(n,i)?vX(n,i,l):!1,Q9=(n,i)=>{hn.each([wX,_X,YN],l=>!l(n,i,YN))},CX=(n,i,l)=>{l||!xC(n)?YN(n,i):Q9(n,i)},SX=dX("mceclip"),kX=n=>{const i=WN();return K4(i,n),UN(i),i},eH=(n,i,l,d,p)=>{const w=J9(n,i,l);if(!w.cancelled){const E=w.content,R=()=>CX(n,E,d);p?L4(n,"insertFromPaste",{dataTransfer:kX(E)}).isDefaultPrevented()||(R(),oA(n,"insertFromPaste")):R()}},X4=(n,i,l,d)=>{const p=l||ZN(i);eH(n,G9(i),p,!1,d)},JN=(n,i,l)=>{const d=n.dom.encode(i).replace(/\r\n/g,`
`),p=rh(d,sE(n)),w=iX(p,Hc(n),o0(n));eH(n,w,!1,!0,l)},tH=n=>{const i={};if(n&&n.types)for(let l=0;l<n.types.length;l++){const d=n.types[l];try{i[d]=n.getData(d)}catch{i[d]=""}}return i},v1=(n,i)=>i in n&&n[i].length>0,QN=n=>v1(n,"text/html")||v1(n,"text/plain"),EX=(n,i)=>{const l=i.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return _e(l)?n.dom.encode(l[1]):void 0},nH=(n,i,l,d)=>{const p=SX(),w=ed(n)&&_e(l.name),E=w?EX(n,l.name):p,R=w?l.name:void 0,B=i.create(p,l,d,E,R);return i.add(B),B},oH=(n,i)=>{SR(i.uri).each(({data:l,type:d,base64Encoded:p})=>{const w=p?l:btoa(l),E=i.file,R=n.editorUpload.blobCache,B=R.getByData(w,d),K=B!=null?B:nH(n,R,E,w);X4(n,`<img src="${K.blobUri()}">`,!1,!0)})},e6=n=>n.type==="paste",xX=n=>Promise.all(Et(n,i=>S8(i).then(l=>({file:i,uri:l})))),sH=n=>{const i=rw(n);return l=>xr(l.type,"image/")&&Jt(i,d=>hX(d)===l.type)},AX=(n,i)=>{const l=i.items?Ns(Mr(i.items),p=>p.kind==="file"?[p.getAsFile()]:[]):[],d=i.files?Mr(i.files):[];return yt(l.length>0?l:d,sH(n))},t6=(n,i,l)=>{const d=e6(i)?i.clipboardData:i.dataTransfer;if(Kv(n)&&d){const p=AX(n,d);if(p.length>0)return i.preventDefault(),xX(p).then(w=>{l&&n.selection.setRng(l),Pe(w,E=>{oH(n,E)})}),!0}return!1},TX=n=>{var i,l;return Kn.os.isAndroid()&&((l=(i=n.clipboardData)===null||i===void 0?void 0:i.items)===null||l===void 0?void 0:l.length)===0},rH=n=>eo.metaKeyPressed(n)&&n.keyCode===86||n.shiftKey&&n.keyCode===45,n6=(n,i,l,d,p)=>{let w=KN(l);const E=v1(i,aA())||ZN(l),R=!E&&sX(w),B=XN(w);(Y9(w)||!w.length||R&&!B)&&(d=!0),(d||B)&&(v1(i,"text/plain")&&R?w=i["text/plain"]:w=fX(w)),!Y9(w)&&(d?JN(n,w,p):X4(n,w,E,p))},DX=(n,i,l)=>{let d;const p=()=>i.getLastRng()||n.selection.getRng();n.on("keydown",w=>{rH(w)&&!w.isDefaultPrevented()&&(d=w.shiftKey&&w.keyCode===86)}),n.on("paste",w=>{if(w.isDefaultPrevented()||TX(w))return;const E=l.get()==="text"||d;d=!1;const R=tH(w.clipboardData);!QN(R)&&t6(n,w,p())||(v1(R,"text/html")?(w.preventDefault(),n6(n,R,R["text/html"],E,!0)):v1(R,"text/plain")&&v1(R,"text/uri-list")?(w.preventDefault(),n6(n,R,R["text/plain"],E,!0)):(i.create(),mg.setEditorTimeout(n,()=>{const B=i.getHtml();i.remove(),n6(n,R,B,E,!1)},0)))})},OX=n=>{const i=p=>xr(p,"webkit-fake-url"),l=p=>xr(p,"data:"),d=p=>{var w;return((w=p.data)===null||w===void 0?void 0:w.paste)===!0};n.parser.addNodeFilter("img",(p,w,E)=>{if(!Kv(n)&&d(E))for(const R of p){const B=R.attr("src");F(B)&&!R.attr("data-mce-object")&&B!==Kn.transparentSrc&&(i(B)||!rE(n)&&l(B))&&R.remove()}})},cA=(n,i,l)=>{DX(n,i,l),OX(n)},MX=(n,i)=>{i.get()==="text"?(i.set("html"),jC(n,!1)):(i.set("text"),jC(n,!0)),n.focus()},RX=(n,i)=>{n.addCommand("mceTogglePlainTextPaste",()=>{MX(n,i)}),n.addCommand("mceInsertClipboardContent",(l,d)=>{d.html&&X4(n,d.html,d.internal,!1),d.text&&JN(n,d.text,!1)})},iH=(n,i,l)=>{if(n)try{return n.clearData(),n.setData("text/html",i),n.setData("text/plain",l),n.setData(aA(),i),!0}catch{return!1}else return!1},aH=(n,i,l,d)=>{iH(n.clipboardData,i.html,i.text)?(n.preventDefault(),d()):l(i.html,d)},lH=n=>(i,l)=>{const{dom:d,selection:p}=n,w=d.create("div",{contenteditable:"false","data-mce-bogus":"all"}),E=d.create("div",{contenteditable:"true"},i);d.setStyles(w,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),w.appendChild(E),d.add(n.getBody(),w);const R=p.getRng();E.focus();const B=d.createRng();B.selectNodeContents(E),p.setRng(B),mg.setEditorTimeout(n,()=>{p.setRng(R),d.remove(w),l()},0)},cH=n=>({html:oX(n.selection.getContent({contextual:!0})),text:n.selection.getContent({format:"text"})}),NX=n=>!!n.dom.getParent(n.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",n.getBody()),uH=n=>!n.selection.isCollapsed()||NX(n),J4=n=>i=>{!i.isDefaultPrevented()&&uH(n)&&aH(i,cH(n),lH(n),()=>{if(Kn.browser.isChromium()||Kn.browser.isFirefox()){const l=n.selection.getRng();mg.setEditorTimeout(n,()=>{n.selection.setRng(l),n.execCommand("Delete")},0)}else n.execCommand("Delete")})},fH=n=>i=>{!i.isDefaultPrevented()&&uH(n)&&aH(i,cH(n),lH(n),ft)},dH=n=>{n.on("cut",J4(n)),n.on("copy",fH(n))},hH=(n,i)=>{var l,d;return v.getCaretRangeFromPoint((l=i.clientX)!==null&&l!==void 0?l:0,(d=i.clientY)!==null&&d!==void 0?d:0,n.getDoc())},PX=n=>{const i=n["text/plain"];return i?i.indexOf("file://")===0:!1},mH=(n,i)=>{n.focus(),i&&n.selection.setRng(i)},_re=n=>Jt(n.files,i=>/^image\//.test(i.type)),IX=(n,i,l,d)=>{const p=n.getParent(l,E=>Jm(i,E));if(!J(n.getParent(l,"summary")))return!0;if(p&&cn(d,"text/html")){const E=new DOMParser().parseFromString(d["text/html"],"text/html").body;return!J(E.querySelector(p.nodeName.toLowerCase()))}else return!1},o6=n=>{n.on("input",i=>{const l=d=>J(d.querySelector("summary"));if(i.inputType==="deleteByDrag"){const d=yt(n.dom.select("details"),l);Pe(d,p=>{ui(p.firstChild)&&p.firstChild.remove();const w=n.dom.create("summary");w.appendChild(ve().dom),p.prepend(w)})}})},s6=(n,i)=>{CC(n)&&n.on("dragend dragover draggesture dragdrop drop drag",l=>{l.preventDefault(),l.stopPropagation()}),Kv(n)||n.on("drop",l=>{const d=l.dataTransfer;d&&_re(d)&&l.preventDefault()}),n.on("drop",l=>{if(l.isDefaultPrevented())return;const d=hH(n,l);if(De(d))return;const p=tH(l.dataTransfer),w=v1(p,aA());if((!QN(p)||PX(p))&&t6(n,l,d))return;const E=p[aA()],R=E||p["text/html"]||p["text/plain"],B=IX(n.dom,n.schema,d.startContainer,p),K=i.get();K&&!B||R&&(l.preventDefault(),mg.setEditorTimeout(n,()=>{n.undoManager.transact(()=>{(E||K&&B)&&n.execCommand("Delete"),mH(n,d);const ie=KN(R);p["text/html"]?X4(n,ie,w,!0):JN(n,ie,!0)})}))}),n.on("dragstart",l=>{i.set(!0)}),n.on("dragover dragend",l=>{Kv(n)&&!i.get()&&(l.preventDefault(),mH(n,hH(n,l))),l.type==="dragend"&&i.set(!1)}),o6(n)},Q4=n=>{const i=p=>w=>{p(n,w)},l=eE(n);be(l)&&n.on("PastePreProcess",i(l));const d=SC(n);be(d)&&n.on("PastePostProcess",i(d))},BX=(n,i)=>{n.on("PastePreProcess",l=>{l.content=i(n,l.content,l.internal)})},LX=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,r6=n=>hn.trim(n).replace(LX,BC).toLowerCase(),FX=(n,i,l)=>{const d=nE(n);if(l||d==="all"||!kC(n))return i;const p=d?d.split(/[, ]/):[];if(p&&d!=="none"){const w=n.dom,E=n.selection.getNode();i=i.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,(R,B,K,ie)=>{const ue=w.parseStyle(w.decode(K)),pe={};for(let Ze=0;Ze<p.length;Ze++){const Oe=ue[p[Ze]];let ze=Oe,ht=w.getStyle(E,p[Ze],!0);/color/.test(p[Ze])&&(ze=r6(ze),ht=r6(ht)),ht!==ze&&(pe[p[Ze]]=Oe)}const Be=w.serializeStyle(pe,"span");return Be?B+' style="'+Be+'"'+ie:B+ie})}else i=i.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return i=i.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,(w,E,R,B)=>E+' style="'+R+'"'+B),i},i6=n=>{(Kn.browser.isChromium()||Kn.browser.isSafari())&&BX(n,FX)},gH=n=>{const i=qa(!1),l=qa(oE(n)?"text":"html"),d=uX(n);i6(n),RX(n,l),Q4(n),n.on("PreInit",()=>{dH(n),s6(n,i),cA(n,d,l)})},HX=n=>{n.on("click",i=>{n.dom.getParent(i.target,"details")&&i.preventDefault()})},$X=n=>{n.parser.addNodeFilter("details",i=>{const l=Qv(n);Pe(i,d=>{l==="expanded"?d.attr("open","open"):l==="collapsed"&&d.attr("open",null)})}),n.serializer.addNodeFilter("details",i=>{const l=Ab(n);Pe(i,d=>{l==="expanded"?d.attr("open","open"):l==="collapsed"&&d.attr("open",null)})})},pH=n=>{HX(n),$X(n)},zX=ui,VX=_n,UX=n=>xs(n.dom),WX=n=>ha(n.dom),bH=n=>i=>pt(Ke.fromDom(n),i),vH=(n,i)=>Bl(Ke.fromDom(n),l=>WX(l)||ac(l),bH(i)).getOr(Ke.fromDom(i)).dom,yH=(n,i)=>Bl(Ke.fromDom(n),UX,bH(i)),a6=(n,i,l)=>{const d=new pi(n,i),p=l?d.next.bind(d):d.prev.bind(d);let w=n;for(let E=l?n:p();E&&!zX(E);E=p())Sl(E)&&(w=E);return w},jX=(n,i)=>{const d=Vt.fromRangeStart(n).getNode(),p=vH(d,i),w=a6(d,p,!1),E=a6(d,p,!0),R=document.createRange();return yH(w,p).fold(()=>{VX(w)?R.setStart(w,0):R.setStartBefore(w)},B=>R.setStartBefore(B.dom)),yH(E,p).fold(()=>{VX(E)?R.setEnd(E,E.data.length):R.setEndAfter(E)},B=>R.setEndAfter(B.dom)),R},ZX=n=>{const i=jX(n.selection.getRng(),n.getBody());n.selection.setRng(GM(i))},qX=n=>{n.on("mousedown",i=>{i.detail>=3&&(i.preventDefault(),ZX(n))})};var zS;(function(n){n.Before="before",n.After="after"})(zS||(zS={}));const GX=(n,i)=>Math.abs(n.left-i),wH=(n,i)=>Math.abs(n.right-i),Cre=(n,i)=>n>=i.top&&n<=i.bottom,KX=(n,i)=>n.top<i.bottom&&n.bottom>i.top,_H=(n,i)=>{const l=Fk(n,i)/Math.min(n.height,i.height);return KX(n,i)&&l>.5},YX=(n,i)=>{const l=yt(n,d=>Cre(i,d));return Lk(l).fold(()=>[[],n],d=>{const{pass:p,fail:w}=gn(n,E=>_H(E,d));return[p,w]})},l6=(n,i)=>({node:n.node,position:GX(n,i)<wH(n,i)?zS.Before:zS.After}),XX=(n,i,l)=>i>n.left&&i<n.right?0:Math.min(Math.abs(n.left-i),Math.abs(n.right-i)),c6=(n,i,l)=>{const d=ie=>Sl(ie.node)?he.some(ie):Xn(ie.node)?c6(Mr(ie.node.childNodes),i,l):he.none(),p=(ie,ue)=>{if(ie.length>=2){const pe=d(ie[0]).getOr(ie[0]),Be=d(ie[1]).getOr(ie[1]);if(Math.abs(ue(pe,i,l)-ue(Be,i,l))<2){if(_n(pe.node))return he.some(pe);if(_n(Be.node))return he.some(Be)}}return he.none()},w=(ie,ue)=>{const pe=Ps(ie,(Be,Ze)=>ue(Be,i,l)-ue(Ze,i,l));return p(pe,ue).orThunk(()=>Ls(pe,d))},[E,R]=YX(AF(n),l),{pass:B,fail:K}=gn(R,ie=>ie.top<l);return w(E,XX).orThunk(()=>w(K,I2)).orThunk(()=>w(B,I2))},JX=(n,i,l,d)=>{const p=(w,E)=>{const R=K=>Xn(K)&&K.classList.contains("mce-drag-container"),B=yt(w.dom.childNodes,ct(R));return E.fold(()=>c6(B,l,d),K=>{const ie=yt(B,ue=>ue!==K.dom);return c6(ie,l,d)}).orThunk(()=>(pt(w,n)?he.none():gi(w)).bind(ie=>p(ie,he.some(w))))};return p(i,he.none())},CH=(n,i,l)=>{const d=Ke.fromDom(n),p=Eo(d),E=Ke.fromPoint(p,i,l).filter(R=>ln(d,R)).getOr(d);return JX(d,E,i,l)},uA=(n,i,l)=>CH(n,i,l).filter(d=>f0(d.node)).map(d=>l6(d,i)),u6=n=>{var i,l;const d=n.getBoundingClientRect(),p=n.ownerDocument,w=p.documentElement,E=p.defaultView;return{top:d.top+((i=E==null?void 0:E.scrollY)!==null&&i!==void 0?i:0)-w.clientTop,left:d.left+((l=E==null?void 0:E.scrollX)!==null&&l!==void 0?l:0)-w.clientLeft}},SH=n=>n.inline?u6(n.getBody()):{left:0,top:0},QX=n=>{const i=n.getBody();return n.inline?{left:i.scrollLeft,top:i.scrollTop}:{left:0,top:0}},eJ=n=>{const i=n.getBody(),l=n.getDoc().documentElement,d={left:i.scrollLeft,top:i.scrollTop},p={left:i.scrollLeft||l.scrollLeft,top:i.scrollTop||l.scrollTop};return n.inline?d:p},kH=(n,i)=>{if(i.target.ownerDocument!==n.getDoc()){const l=u6(n.getContentAreaContainer()),d=eJ(n);return{left:i.pageX-l.left+d.left,top:i.pageY-l.top+d.top}}return{left:i.pageX,top:i.pageY}},tJ=(n,i,l)=>({pageX:l.left-n.left+i.left,pageY:l.top-n.top+i.top}),nJ=(n,i)=>tJ(SH(n),QX(n),kH(n,i)),EH=n=>({target:n,srcElement:n}),f6=(n,i,l,d)=>({...i,dataTransfer:d,type:n,...EH(l)}),oJ=(n,i,l)=>{const d=dn("Function not supported on simulated event.");return{bubbles:!0,cancelBubble:!1,cancelable:!0,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!1,timeStamp:0,type:n,composedPath:d,initEvent:d,preventDefault:ft,stopImmediatePropagation:ft,stopPropagation:ft,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:!1,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:!1,metaKey:!1,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:!1,x:0,y:0,detail:0,view:null,which:0,initUIEvent:d,initMouseEvent:d,getModifierState:d,dataTransfer:l,...EH(i)}},sJ=(n,i)=>{const l=$S(n);return i==="dragstart"?(V9(l),W9(l)):i==="drop"?(Wi(l),UN(l)):(JY(l),j9(l)),l},rJ=(n,i,l,d)=>{const p=sJ(l,n);return ye(d)?oJ(n,i,p):f6(n,d,i,p)},eD=32,iJ=100,tD=8,fA=16,d6=xs,h6=Hk(d6,ha),m6=(n,i,l)=>d6(l)&&l!==i&&n.isEditable(l.parentElement),aJ=(n,i,l)=>De(i)||i===l||n.dom.isChildOf(i,l)?!1:n.dom.isEditable(i),g6=(n,i,l,d)=>{const p=n.dom,w=i.cloneNode(!0);p.setStyles(w,{width:l,height:d}),p.setAttrib(w,"data-mce-selected",null);const E=p.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return p.setStyles(E,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:l,height:d}),p.setStyles(w,{margin:0,boxSizing:"border-box"}),E.appendChild(w),E},lJ=(n,i)=>{n.parentNode!==i&&i.appendChild(n)},nD=(n,i)=>l=>()=>{const d=n==="left"?l.scrollX:l.scrollY;l.scroll({[n]:d+i,behavior:"smooth"})},p6=nD("left",-eD),xH=nD("left",eD),AH=nD("top",-eD),TH=nD("top",eD),cJ=(n,i,l,d,p,w,E,R,B,K,ie,ue)=>{let pe=0,Be=0;n.style.left=i.pageX+"px",n.style.top=i.pageY+"px",i.pageX+l>p&&(pe=i.pageX+l-p),i.pageY+d>w&&(Be=i.pageY+d-w),n.style.width=l-pe+"px",n.style.height=d-Be+"px";const Ze=B.clientHeight,Oe=B.clientWidth,ze=E+B.getBoundingClientRect().top,ht=R+B.getBoundingClientRect().left;ie.on(bt=>{bt.intervalId.clear(),bt.dragging&&ue&&(E+tD>=Ze?bt.intervalId.set(TH(K)):E-tD<=0?bt.intervalId.set(AH(K)):R+tD>=Oe?bt.intervalId.set(xH(K)):R-tD<=0?bt.intervalId.set(p6(K)):ze+fA>=window.innerHeight?bt.intervalId.set(TH(window)):ze-fA<=0?bt.intervalId.set(AH(window)):ht+fA>=window.innerWidth?bt.intervalId.set(xH(window)):ht-fA<=0&&bt.intervalId.set(p6(window)))})},DH=n=>{n&&n.parentNode&&n.parentNode.removeChild(n)},uJ=(n,i)=>{const l=n.getParent(i.parentNode,n.isBlock);DH(i),l&&l!==n.getRoot()&&n.isEmpty(l)&&Te(Ke.fromDom(l))},fJ=n=>n.button===0,OH=(n,i)=>({pageX:i.pageX-n.relX,pageY:i.pageY+5}),dJ=(n,i)=>l=>{if(fJ(l)){const d=Jn(i.dom.getParents(l.target),h6).getOr(null);if(_e(d)&&m6(i.dom,i.getBody(),d)){const p=i.dom.getPos(d),w=i.getBody(),E=i.getDoc().documentElement;n.set({element:d,dataTransfer:WN(),dragging:!1,screenX:l.screenX,screenY:l.screenY,maxX:(i.inline?w.scrollWidth:E.offsetWidth)-2,maxY:(i.inline?w.scrollHeight:E.offsetHeight)-2,relX:l.pageX-p.x,relY:l.pageY-p.y,width:d.offsetWidth,height:d.offsetHeight,ghost:g6(i,d,d.offsetWidth,d.offsetHeight),intervalId:Ik(iJ)})}}},b6=(n,i,l)=>{n._selectionOverrides.hideFakeCaret(),uA(n.getBody(),i,l).fold(()=>n.selection.placeCaretAt(i,l),d=>{const p=n._selectionOverrides.showCaret(1,d.node,d.position===zS.Before,!1);p?n.selection.setRng(p):n.selection.placeCaretAt(i,l)})},dA=(n,i,l,d,p)=>{i==="dragstart"&&K4(d,n.dom.getOuterHTML(l));const w=rJ(i,l,d,p);return n.dispatch(i,w)},hJ=(n,i)=>{const l=hb((p,w)=>b6(i,p,w),0);i.on("remove",l.cancel);const d=n;return p=>n.on(w=>{const E=Math.max(Math.abs(p.screenX-w.screenX),Math.abs(p.screenY-w.screenY));if(!w.dragging&&E>10){const R=dA(i,"dragstart",w.element,w.dataTransfer,p);if(_e(R.dataTransfer)&&(w.dataTransfer=R.dataTransfer),R.isDefaultPrevented())return;w.dragging=!0,i.focus()}if(w.dragging){const R=p.currentTarget===i.getDoc().documentElement,B=OH(w,nJ(i,p));lJ(w.ghost,i.getBody()),cJ(w.ghost,B,w.width,w.height,w.maxX,w.maxY,p.clientY,p.clientX,i.getContentAreaContainer(),i.getWin(),d,R),l.throttle(p.clientX,p.clientY)}})},mJ=n=>{const i=n.getSel();if(_e(i)){const d=i.getRangeAt(0).startContainer;return _n(d)?d.parentNode:d}else return null},gJ=(n,i)=>l=>{n.on(d=>{var p;if(d.intervalId.clear(),d.dragging){if(aJ(i,mJ(i.selection),d.element)){const w=(p=i.getDoc().elementFromPoint(l.clientX,l.clientY))!==null&&p!==void 0?p:i.getBody();dA(i,"drop",w,d.dataTransfer,l).isDefaultPrevented()||i.undoManager.transact(()=>{uJ(i.dom,d.element),nX(d.dataTransfer).each(R=>i.insertContent(R)),i._selectionOverrides.hideFakeCaret()})}dA(i,"dragend",i.getBody(),d.dataTransfer,l)}}),hA(n)},MH=(n,i,l)=>{n.on(d=>{d.intervalId.clear(),d.dragging&&l.fold(()=>dA(i,"dragend",d.element,d.dataTransfer),p=>dA(i,"dragend",d.element,d.dataTransfer,p))}),hA(n)},pJ=(n,i)=>l=>MH(n,i,he.some(l)),hA=n=>{n.on(i=>{i.intervalId.clear(),DH(i.ghost)}),n.clear()},bJ=n=>{const i=mh(),l=Lr.DOM,d=document,p=dJ(i,n),w=hJ(i,n),E=gJ(i,n),R=pJ(i,n);n.on("mousedown",p),n.on("mousemove",w),n.on("mouseup",E),l.bind(d,"mousemove",w),l.bind(d,"mouseup",R),n.on("remove",()=>{l.unbind(d,"mousemove",w),l.unbind(d,"mouseup",R)}),n.on("keydown",B=>{B.keyCode===eo.ESC&&MH(i,n,he.none())})},vJ=n=>{const i=p=>{if(!p.isDefaultPrevented()){const w=p.dataTransfer;w&&(Ct(w.types,"Files")||w.files.length>0)&&(p.preventDefault(),p.type==="drop"&&Px(n,"Dropped file type is not supported"))}},l=p=>{QE(n,p.target)&&i(p)},d=()=>{const p=Lr.DOM,w=n.dom,E=document,R=n.inline?n.getBody():n.getDoc(),B=["drop","dragover"];Pe(B,K=>{p.bind(E,K,l),w.bind(R,K,i)}),n.on("remove",()=>{Pe(B,K=>{p.unbind(E,K,l),w.unbind(R,K,i)})})};n.on("init",()=>{mg.setEditorTimeout(n,d,0)})},yJ=n=>{bJ(n),ug(n)&&vJ(n)},wJ=n=>{const i=hb(()=>{if(!n.removed&&n.getBody().contains(document.activeElement)){const l=n.selection.getRng();if(l.collapsed){const d=S5(n,l,!1);n.selection.setRng(d)}}},0);n.on("focus",()=>{i.throttle()}),n.on("blur",()=>{i.cancel()})},_J=n=>{n.on("init",()=>{n.on("focusin",i=>{const l=i.target;if(Gu(l)){const d=yy(n.getBody(),l),p=xs(d)?d:l;n.selection.getNode()!==p&&Fx(n,p).each(w=>n.selection.setRng(w))}})})},mA=xs,RH=(n,i)=>yy(n.getBody(),i),CJ=n=>{const i=n.selection,l=n.dom,d=n.getBody(),p=gE(n,d,l.isBlock,()=>Nw(n)),w="sel-"+l.uniqueId(),E="data-mce-selected";let R;const B=Pn=>_e(Pn)&&l.hasClass(Pn,"mce-offscreen-selection"),K=Pn=>Pn!==d&&(mA(Pn)||Gu(Pn))&&l.isChildOf(Pn,d)&&l.isEditable(Pn.parentNode),ie=Pn=>{Pn&&i.setRng(Pn)},ue=(Pn,Lt,$t,yn=!0)=>n.dispatch("ShowCaret",{target:Lt,direction:Pn,before:$t}).isDefaultPrevented()?null:(yn&&i.scrollIntoView(Lt,Pn===-1),p.show($t,Lt)),pe=Pn=>{Pn.hasAttribute("data-mce-caret")&&(Wm(Pn),i.scrollIntoView(Pn))},Be=()=>{n.on("click",Lt=>{l.isEditable(Lt.target)||(Lt.preventDefault(),n.focus())}),n.on("blur NewBlock",Mt),n.on("ResizeWindow FullscreenStateChanged",p.reposition),n.on("tap",Lt=>{const $t=Lt.target,yn=RH(n,$t);mA(yn)?(Lt.preventDefault(),Fx(n,yn).each(vt)):K($t)&&Fx(n,$t).each(vt)},!0),n.on("mousedown",Lt=>{const $t=Lt.target;if($t!==d&&$t.nodeName!=="HTML"&&!l.isChildOf($t,d)||!u5(n,Lt.clientX,Lt.clientY))return;Mt(),$n();const yn=RH(n,$t);mA(yn)?(Lt.preventDefault(),Fx(n,yn).each(vt)):uA(d,Lt.clientX,Lt.clientY).each(mo=>{Lt.preventDefault();const Oo=ue(1,mo.node,mo.position===zS.Before,!1);ie(Oo),Xn(yn)?yn.focus():n.getBody().focus()})}),n.on("keypress",Lt=>{eo.modifierPressed(Lt)||mA(i.getNode())&&Lt.preventDefault()}),n.on("GetSelectionRange",Lt=>{let $t=Lt.range;if(R){if(!R.parentNode){R=null;return}$t=$t.cloneRange(),$t.selectNode(R),Lt.range=$t}}),n.on("SetSelectionRange",Lt=>{Lt.range=ze(Lt.range);const $t=vt(Lt.range,Lt.forward);$t&&(Lt.range=$t)});const Pn=Lt=>Xn(Lt)&&Lt.id==="mcepastebin";n.on("AfterSetSelectionRange",Lt=>{const $t=Lt.range,yn=$t.startContainer.parentElement;!Oe($t)&&!Pn(yn)&&$n(),B(yn)||Mt()}),yJ(n),wJ(n),_J(n)},Ze=Pn=>br(Pn)||sh(Pn)||lr(Pn),Oe=Pn=>Ze(Pn.startContainer)||Ze(Pn.endContainer),ze=Pn=>{const Lt=n.schema.getVoidElements(),$t=l.createRng(),yn=Pn.startContainer,mo=Pn.startOffset,Oo=Pn.endContainer,Cs=Pn.endOffset;return cn(Lt,yn.nodeName.toLowerCase())?mo===0?$t.setStartBefore(yn):$t.setStartAfter(yn):$t.setStart(yn,mo),cn(Lt,Oo.nodeName.toLowerCase())?Cs===0?$t.setEndBefore(Oo):$t.setEndAfter(Oo):$t.setEnd(Oo,Cs),$t},ht=(Pn,Lt)=>{const $t=Ke.fromDom(n.getBody()),yn=n.getDoc(),mo=Ye($t,"#"+w).getOrThunk(()=>{const Us=Ke.fromHtml('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',yn);return Tr(Us,"id",w),Qi($t,Us),Us}),Oo=l.createRng();wd(mo),Jr(mo,[Ke.fromText(Gr,yn),Ke.fromDom(Lt),Ke.fromText(Gr,yn)]),Oo.setStart(mo.dom.firstChild,1),Oo.setEnd(mo.dom.lastChild,0),ra(mo,{top:l.getPos(Pn,n.getBody()).y+"px"}),Hb(mo);const Cs=i.getSel();return Cs&&(Cs.removeAllRanges(),Cs.addRange(Oo)),Oo},bt=Pn=>{const Lt=Pn.cloneNode(!0),$t=n.dispatch("ObjectSelected",{target:Pn,targetClone:Lt});if($t.isDefaultPrevented())return null;const yn=ht(Pn,$t.targetClone),mo=Ke.fromDom(Pn);return Pe(dl(Ke.fromDom(n.getBody()),`*[${E}]`),Oo=>{pt(mo,Oo)||Hi(Oo,E)}),l.getAttrib(Pn,E)||Pn.setAttribute(E,"1"),R=Pn,$n(),yn},vt=(Pn,Lt)=>{if(!Pn)return null;if(Pn.collapsed){if(!Oe(Pn)){const Oo=Lt?1:-1,Cs=ke(Oo,d,Pn),Us=Cs.getNode(!Lt);if(_e(Us)){if(f0(Us))return ue(Oo,Us,Lt?!Cs.isAtEnd():!1,!1);if(tr(Us)&&xs(Us.nextSibling)){const di=l.createRng();return di.setStart(Us,0),di.setEnd(Us,0),di}}const Pr=Cs.getNode(Lt);if(_e(Pr)){if(f0(Pr))return ue(Oo,Pr,Lt?!1:!Cs.isAtEnd(),!1);if(tr(Pr)&&xs(Pr.previousSibling)){const di=l.createRng();return di.setStart(Pr,1),di.setEnd(Pr,1),di}}}return null}let $t=Pn.startContainer,yn=Pn.startOffset;const mo=Pn.endOffset;if(_n($t)&&yn===0&&mA($t.parentNode)&&($t=$t.parentNode,yn=l.nodeIndex($t),$t=$t.parentNode),!Xn($t))return null;if(mo===yn+1&&$t===Pn.endContainer){const Oo=$t.childNodes[yn];if(K(Oo))return bt(Oo)}return null},Mt=()=>{R&&R.removeAttribute(E),Ye(Ke.fromDom(n.getBody()),"#"+w).each(pr),R=null},fn=()=>{p.destroy(),R=null},$n=()=>{p.hide()};return S0(n)||Be(),{showCaret:ue,showBlockCaretContainer:pe,hideFakeCaret:$n,destroy:fn}},SJ=(n,i)=>{let l=i;for(let d=n.previousSibling;_n(d);d=d.previousSibling)l+=d.data.length;return l},v6=(n,i,l,d,p)=>{if(_n(l)&&(d<0||d>l.data.length))return[];const w=p&&_n(l)?[SJ(l,d)]:[d];let E=l;for(;E!==i&&E.parentNode;)w.push(n.nodeIndex(E,p)),E=E.parentNode;return E===i?w.reverse():[]},y6=(n,i,l,d,p,w,E=!1)=>{const R=v6(n,i,l,d,E),B=v6(n,i,p,w,E);return{start:R,end:B}},w6=(n,i)=>{const l=i.slice(),d=l.pop();return tt(d)?bn(l,(w,E)=>w.bind(R=>he.from(R.childNodes[E])),he.some(n)).bind(w=>_n(w)&&(d<0||d>w.data.length)?he.none():he.some({node:w,offset:d})):he.none()},NH=(n,i)=>w6(n,i.start).bind(({node:l,offset:d})=>w6(n,i.end).map(({node:p,offset:w})=>{const E=document.createRange();return E.setStart(l,d),E.setEnd(p,w),E})),kJ=(n,i,l,d=!1)=>y6(n,i,l.startContainer,l.startOffset,l.endContainer,l.endOffset,d),l_=(n,i,l)=>{if(i&&n.isEmpty(i)&&!l(i)){const d=i.parentNode;n.remove(i,_n(i.firstChild)&&Zm(i.firstChild.data)),l_(n,d,l)}},Iy=(n,i,l,d=!0)=>{const p=i.startContainer.parentNode,w=i.endContainer.parentNode;i.deleteContents(),d&&!l(i.startContainer)&&(_n(i.startContainer)&&i.startContainer.data.length===0&&n.remove(i.startContainer),_n(i.endContainer)&&i.endContainer.data.length===0&&n.remove(i.endContainer),l_(n,p,l),p!==w&&l_(n,w,l))},_6=(n,i)=>he.from(n.dom.getParent(i.startContainer,n.dom.isBlock)),C6=(n,i,l)=>{const d=n.dynamicPatternsLookup({text:l,block:i});return{...n,blockPatterns:sm(d).concat(n.blockPatterns),inlinePatterns:G2(d).concat(n.inlinePatterns)}},PH=(n,i,l,d)=>{const p=n.createRng();return p.setStart(i,0),p.setEnd(l,d),p.toString()},EJ=n=>/^\s[^\s]/.test(n),IH=(n,i,l)=>{aK(i,0,i).each(p=>{const w=p.container;mN(w,l.start.length,i).each(B=>{const K=n.createRng();K.setStart(w,0),K.setEnd(B.container,B.offset),Iy(n,K,ie=>ie===i)});const E=Ke.fromDom(w),R=Ic(E);EJ(R)&&Gf(E,R.slice(1))})},xJ=(n,i)=>{const l=n.dom,d=i.pattern,p=NH(l.getRoot(),i.range).getOrDie("Unable to resolve path range"),w=(E,R)=>{const B=R.get(E);return re(B)&&No(B).exists(K=>cn(K,"block"))};return _6(n,p).each(E=>{d.type==="block-format"?w(d.format,n.formatter)&&n.undoManager.transact(()=>{IH(n.dom,E,d),n.formatter.apply(d.format)}):d.type==="block-command"&&n.undoManager.transact(()=>{IH(n.dom,E,d),n.execCommand(d.cmd,!1,d.value)})}),!0},BH=n=>Ps(n,(i,l)=>l.start.length-i.start.length),AJ=(n,i)=>{const l=BH(n),d=i.replace(Gr," ");return Jn(l,p=>i.indexOf(p.start)===0||d.indexOf(p.start)===0)},LH=(n,i,l,d)=>{var p;const w=n.dom,E=Hc(n);if(!w.is(i,E))return[];const R=(p=i.textContent)!==null&&p!==void 0?p:"";return AJ(l.blockPatterns,R).map(B=>hn.trim(R).length===B.start.length?[]:[{pattern:B,range:y6(w,w.getRoot(),i,0,i,0,d)}]).getOr([])},TJ=(n,i)=>{if(i.length===0)return;const l=n.selection.getBookmark();Pe(i,d=>xJ(n,d)),n.selection.moveToBookmark(l)},FH=(n,i)=>n.create("span",{"data-mce-type":"bookmark",id:i}),oD=(n,i)=>{const l=n.createRng();return l.setStartAfter(i.start),l.setEndBefore(i.end),l},HH=(n,i,l)=>{const d=NH(n.getRoot(),l).getOrDie("Unable to resolve path range"),p=d.startContainer,w=d.endContainer,E=d.endOffset===0?w:w.splitText(d.endOffset),R=d.startOffset===0?p:p.splitText(d.startOffset),B=R.parentNode,K=E.parentNode;return{prefix:i,end:K.insertBefore(FH(n,i+"-end"),E),start:B.insertBefore(FH(n,i+"-start"),R)}},$H=(n,i,l)=>{l_(n,n.get(i.prefix+"-end"),l),l_(n,n.get(i.prefix+"-start"),l)},S6=n=>n.start.length===0,DJ=n=>(i,l)=>{const p=i.data.substring(0,l),w=p.lastIndexOf(n.charAt(n.length-1)),E=p.lastIndexOf(n);return E!==-1?E+n.length:w!==-1?w+1:-1},zH=(n,i,l,d)=>{const p=i.start;return gN(n,d.container,d.offset,DJ(p),l).bind(E=>{var R,B;const K=(B=(R=l.textContent)===null||R===void 0?void 0:R.indexOf(p))!==null&&B!==void 0?B:-1;if(K!==-1&&E.offset>=K+p.length){const ue=n.createRng();return ue.setStart(E.container,E.offset-p.length),ue.setEnd(E.container,E.offset),he.some(ue)}else{const ue=E.offset-p.length;return hN(E.container,ue,l).map(pe=>{const Be=n.createRng();return Be.setStart(pe.container,pe.offset),Be.setEnd(E.container,E.offset),Be}).filter(pe=>pe.toString()===p).orThunk(()=>zH(n,i,l,Cp(E.container,0)))}})},OJ=(n,i,l,d,p,w=!1)=>{if(i.start.length===0&&!w){const E=n.createRng();return E.setStart(l,d),E.setEnd(l,d),he.some(E)}return x4(l,d,p).bind(E=>zH(n,i,p,E).bind(B=>{var K;if(w){if(B.endContainer===E.container&&B.endOffset===E.offset)return he.none();if(E.offset===0&&((K=B.endContainer.textContent)===null||K===void 0?void 0:K.length)===B.endOffset)return he.none()}return he.some(B)}))},VH=(n,i,l,d)=>{const p=n.dom,w=p.getRoot(),E=l.pattern,R=l.position.container,B=l.position.offset;return hN(R,B-l.pattern.end.length,i).bind(K=>{const ie=y6(p,w,K.container,K.offset,R,B,d);if(S6(E))return he.some({matches:[{pattern:E,startRng:ie,endRng:ie}],position:K});{const ue=VS(n,l.remainingPatterns,K.container,K.offset,i,d),pe=ue.getOr({matches:[],position:K}),Be=pe.position;return OJ(p,E,Be.container,Be.offset,i,ue.isNone()).map(Oe=>{const ze=kJ(p,w,Oe,d);return{matches:pe.matches.concat([{pattern:E,startRng:ze,endRng:ie}]),position:Cp(Oe.startContainer,Oe.startOffset)}})}})},VS=(n,i,l,d,p,w)=>{const E=n.dom;return x4(l,d,E.getRoot()).bind(R=>{const B=PH(E,p,l,d);for(let K=0;K<i.length;K++){const ie=i[K];if(!Ki(B,ie.end))continue;const ue=i.slice();ue.splice(K,1);const pe=VH(n,p,{pattern:ie,remainingPatterns:ue,position:R},w);if(pe.isNone()&&d>0)return VS(n,i,l,d-1,p,w);if(pe.isSome())return pe}return he.none()})},k6=(n,i,l)=>{n.selection.setRng(l),i.type==="inline-format"?Pe(i.format,d=>{n.formatter.apply(d)}):n.execCommand(i.cmd,!1,i.value)},UH=(n,i,l,d)=>{const p=oD(n.dom,l);Iy(n.dom,p,d),k6(n,i,p)},MJ=(n,i,l,d,p)=>{const w=n.dom,E=oD(w,d),R=oD(w,l);Iy(w,R,p),Iy(w,E,p);const B={prefix:l.prefix,start:l.end,end:d.start},K=oD(w,B);k6(n,i,K)},RJ=(n,i)=>{const l=Ri("mce_textpattern"),d=Yt(i,(p,w)=>{const E=HH(n,l+`_end${p.length}`,w.endRng);return p.concat([{...w,endMarker:E}])},[]);return Yt(d,(p,w)=>{const E=d.length-p.length-1,R=S6(w.pattern)?w.endMarker:HH(n,l+`_start${E}`,w.startRng);return p.concat([{...w,startMarker:R}])},[])},NJ=n=>Ps(n,(i,l)=>l.end.length-i.end.length),WH=(n,i)=>{const l=Js(n,d=>Jt(i,p=>d.pattern.start===p.pattern.start&&d.pattern.end===p.pattern.end));return n.length===i.length?l?n:i:n.length>i.length?n:i},E6=(n,i,l,d,p,w)=>{const E=VS(n,p.inlinePatterns,l,d,i,w).fold(()=>[],B=>B.matches),R=VS(n,NJ(p.inlinePatterns),l,d,i,w).fold(()=>[],B=>B.matches);return WH(E,R)},jH=(n,i)=>{if(i.length===0)return;const l=n.dom,d=n.selection.getBookmark(),p=RJ(l,i);Pe(p,w=>{const E=l.getParent(w.startMarker.start,l.isBlock),R=B=>B===E;S6(w.pattern)?UH(n,w.pattern,w.endMarker,R):MJ(n,w.pattern,w.startMarker,w.endMarker,R),$H(l,w.endMarker,R),$H(l,w.startMarker,R)}),n.selection.moveToBookmark(d)},PJ=(n,i)=>{const l=n.selection.getRng();return _6(n,l).map(d=>{var p;const w=Math.max(0,l.startOffset),E=C6(i,d,(p=d.textContent)!==null&&p!==void 0?p:""),R=E6(n,d,l.startContainer,w,E,!0),B=LH(n,d,E,!0);return B.length>0||R.length>0?(n.undoManager.add(),n.undoManager.extra(()=>{n.execCommand("mceInsertNewLine")},()=>{n.insertContent(Qt),jH(n,R),TJ(n,B);const K=n.selection.getRng(),ie=x4(K.startContainer,K.startOffset,n.dom.getRoot());n.execCommand("mceInsertNewLine"),ie.each(ue=>{const pe=ue.container;pe.data.charAt(ue.offset-1)===Qt&&(pe.deleteData(ue.offset-1,1),l_(n.dom,pe.parentNode,Be=>Be===n.dom.getRoot()))})}),!0):!1}).getOr(!1)},x6=(n,i)=>{const l=n.selection.getRng();_6(n,l).map(d=>{const p=Math.max(0,l.startOffset-1),w=PH(n.dom,d,l.startContainer,p),E=C6(i,d,w),R=E6(n,d,l.startContainer,p,E,!1);R.length>0&&n.undoManager.transact(()=>{jH(n,R)})})},gA=(n,i,l)=>{for(let d=0;d<n.length;d++)if(l(n[d],i))return!0;return!1},sD=(n,i)=>gA(n,i,(l,d)=>l===d.keyCode&&!eo.modifierPressed(d)),av=(n,i)=>gA(n,i,(l,d)=>l.charCodeAt(0)===d.charCode),rD=n=>{const i=[",",".",";",":","!","?"],l=[32],d=()=>Jp(AC(n),nw(n)),p=()=>l0(n);n.on("keydown",E=>{if(E.keyCode===13&&!eo.modifierPressed(E)&&n.selection.isCollapsed()){const R=d();(R.inlinePatterns.length>0||R.blockPatterns.length>0||p())&&PJ(n,R)&&E.preventDefault()}},!0);const w=()=>{if(n.selection.isCollapsed()){const E=d();(E.inlinePatterns.length>0||p())&&x6(n,E)}};n.on("keyup",E=>{sD(l,E)&&w()}),n.on("keypress",E=>{av(i,E)&&mg.setEditorTimeout(n,w)})},US=n=>{rD(n)},ZH=n=>{const i=hn.each,l=eo.BACKSPACE,d=eo.DELETE,p=n.dom,w=n.selection,E=n.parser,R=Kn.browser,B=R.isFirefox(),K=R.isChromium()||R.isSafari(),ie=Kn.deviceType.isiPhone()||Kn.deviceType.isiPad(),ue=Kn.os.isMacOS()||Kn.os.isiOS(),pe=(vo,Rn)=>{try{n.getDoc().execCommand(vo,!1,String(Rn))}catch{}},Be=vo=>vo.isDefaultPrevented(),Ze=()=>{const vo=jo=>{const Ys=p.create("body"),Kr=jo.cloneContents();return Ys.appendChild(Kr),w.serializer.serialize(Ys,{format:"html"})},Rn=jo=>{const Ys=vo(jo),Kr=p.createRng();Kr.selectNode(n.getBody());const io=vo(Kr);return Ys===io},Tn=jo=>{const Ys=Ke.fromDom(jo),Kr=io=>gi(io).exists(Ws=>!wn(Ws));return Jt(dl(Ys,'[contenteditable="true"]'),Kr)};n.on("keydown",jo=>{const Ys=jo.keyCode;if(!Be(jo)&&(Ys===d||Ys===l)&&n.selection.isEditable()){const Kr=n.selection.isCollapsed(),io=n.getBody();if(Kr&&(!p.isEmpty(io)||Tn(io))||!Kr&&!Rn(n.selection.getRng()))return;jo.preventDefault(),n.setContent(""),io.firstChild&&p.isBlock(io.firstChild)?n.selection.setCursorLocation(io.firstChild,0):n.selection.setCursorLocation(io,0),n.nodeChanged()}})},Oe=()=>{n.shortcuts.add("meta+a",null,"SelectAll")},ze=()=>{n.inline||p.bind(n.getDoc(),"mousedown mouseup",vo=>{let Rn;if(vo.target===n.getDoc().documentElement)if(Rn=w.getRng(),n.getBody().focus(),vo.type==="mousedown"){if(br(Rn.startContainer))return;w.placeCaretAt(vo.clientX,vo.clientY)}else w.setRng(Rn)})},ht=()=>{n.on("keydown",vo=>{if(!Be(vo)&&vo.keyCode===l){if(!n.getBody().getElementsByTagName("hr").length)return;if(w.isCollapsed()&&w.getRng().startOffset===0){const Rn=w.getNode(),Tn=Rn.previousSibling;if(Rn.nodeName==="HR"){p.remove(Rn),vo.preventDefault();return}Tn&&Tn.nodeName&&Tn.nodeName.toLowerCase()==="hr"&&(p.remove(Tn),vo.preventDefault())}}})},bt=()=>{Range.prototype.getClientRects||n.on("mousedown",vo=>{if(!Be(vo)&&vo.target.nodeName==="HTML"){const Rn=n.getBody();Rn.blur(),mg.setEditorTimeout(n,()=>{Rn.focus()})}})},vt=()=>{const vo=kb(n);n.on("click",Rn=>{const Tn=Rn.target;/^(IMG|HR)$/.test(Tn.nodeName)&&p.isEditable(Tn.parentNode)&&(Rn.preventDefault(),n.selection.select(Tn),n.nodeChanged()),Tn.nodeName==="A"&&p.hasClass(Tn,vo)&&Tn.childNodes.length===0&&p.isEditable(Tn.parentNode)&&(Rn.preventDefault(),w.select(Tn))})},Mt=()=>{const vo=()=>{const Tn=p.getAttribs(w.getStart().cloneNode(!1));return()=>{const jo=w.getStart();jo!==n.getBody()&&(p.setAttrib(jo,"style",null),i(Tn,Ys=>{jo.setAttributeNode(Ys.cloneNode(!0))}))}},Rn=()=>!w.isCollapsed()&&p.getParent(w.getStart(),p.isBlock)!==p.getParent(w.getEnd(),p.isBlock);n.on("keypress",Tn=>{let jo;return!Be(Tn)&&(Tn.keyCode===8||Tn.keyCode===46)&&Rn()?(jo=vo(),n.getDoc().execCommand("delete",!1),jo(),Tn.preventDefault(),!1):!0}),p.bind(n.getDoc(),"cut",Tn=>{if(!Be(Tn)&&Rn()){const jo=vo();mg.setEditorTimeout(n,()=>{jo()})}})},fn=()=>{n.on("keydown",vo=>{if(!Be(vo)&&vo.keyCode===l&&w.isCollapsed()&&w.getRng().startOffset===0){const Rn=w.getNode().previousSibling;if(Rn&&Rn.nodeName&&Rn.nodeName.toLowerCase()==="table")return vo.preventDefault(),!1}return!0})},$n=()=>{n.on("keydown",vo=>{if(Be(vo)||vo.keyCode!==eo.BACKSPACE)return;let Rn=w.getRng();const Tn=Rn.startContainer,jo=Rn.startOffset,Ys=p.getRoot();let Kr=Tn;if(!(!Rn.collapsed||jo!==0)){for(;Kr.parentNode&&Kr.parentNode.firstChild===Kr&&Kr.parentNode!==Ys;)Kr=Kr.parentNode;Kr.nodeName==="BLOCKQUOTE"&&(n.formatter.toggle("blockquote",void 0,Kr),Rn=p.createRng(),Rn.setStart(Tn,0),Rn.setEnd(Tn,0),w.setRng(Rn))}})},Pn=()=>{const vo=()=>{pe("StyleWithCSS",!1),pe("enableInlineTableEditing",!1),Q2(n)||pe("enableObjectResizing",!1)};cg(n)||n.on("BeforeExecCommand mousedown",vo)},Lt=()=>{const vo=()=>{i(p.select("a:not([data-mce-block])"),Rn=>{var Tn;let jo=Rn.parentNode;const Ys=p.getRoot();if((jo==null?void 0:jo.lastChild)===Rn){for(;jo&&!p.isBlock(jo);){if(((Tn=jo.parentNode)===null||Tn===void 0?void 0:Tn.lastChild)!==jo||jo===Ys)return;jo=jo.parentNode}p.add(jo,"br",{"data-mce-bogus":1})}})};n.on("SetContent ExecCommand",Rn=>{(Rn.type==="setcontent"||Rn.command==="mceInsertLink")&&vo()})},$t=()=>{n.on("init",()=>{pe("DefaultParagraphSeparator",Hc(n))})},yn=vo=>{const Rn=vo.getBody(),Tn=vo.selection.getRng();return Tn.startContainer===Tn.endContainer&&Tn.startContainer===Rn&&Tn.startOffset===0&&Tn.endOffset===Rn.childNodes.length},mo=()=>{n.on("keyup focusin mouseup",vo=>{!eo.modifierPressed(vo)&&!yn(n)&&w.normalize()},!0)},Oo=()=>{n.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},Cs=()=>{n.inline||n.on("keydown",()=>{document.activeElement===document.body&&n.getWin().focus()})},Us=()=>{n.inline||(n.contentStyles.push("body {min-height: 150px}"),n.on("click",vo=>{let Rn;vo.target.nodeName==="HTML"&&(Rn=n.selection.getRng(),n.getBody().focus(),n.selection.setRng(Rn),n.selection.normalize(),n.nodeChanged())}))},Pr=()=>{ue&&n.on("keydown",vo=>{eo.metaKeyPressed(vo)&&!vo.shiftKey&&(vo.keyCode===37||vo.keyCode===39)&&(vo.preventDefault(),n.selection.getSel().modify("move",vo.keyCode===37?"backward":"forward","lineboundary"))})},di=()=>{n.on("click",vo=>{let Rn=vo.target;do if(Rn.tagName==="A"){vo.preventDefault();return}while(Rn=Rn.parentNode)}),n.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},il=()=>{n.on("init",()=>{n.dom.bind(n.getBody(),"submit",vo=>{vo.preventDefault()})})},Rl=()=>{E.addNodeFilter("br",vo=>{let Rn=vo.length;for(;Rn--;)vo[Rn].attr("class")==="Apple-interchange-newline"&&vo[Rn].remove()})},hc=ft,Mn=()=>{if(!B||n.removed)return!1;const vo=n.selection.getSel();return!vo||!vo.rangeCount||vo.rangeCount===0},Qn=()=>{K&&(ze(),vt(),il(),Oe(),ie&&(Cs(),Us(),di())),B&&(bt(),Pn(),Oo(),Pr())},yr=()=>{n.on("drop",vo=>{var Rn;const Tn=(Rn=vo.dataTransfer)===null||Rn===void 0?void 0:Rn.getData("text/html");F(Tn)&&/^<img[^>]*>$/.test(Tn)&&n.dispatch("dragend",new window.DragEvent("dragend",vo))})},Bs=()=>{$n(),Ze(),Kn.windowsPhone||mo(),K&&(ze(),vt(),$t(),il(),fn(),Rl(),ie?(Cs(),Us(),di()):Oe()),B&&(ht(),bt(),Mt(),Pn(),Lt(),Oo(),Pr(),fn(),yr())};return S0(n)?Qn():Bs(),{refreshContentEditable:hc,isHidden:Mn}},A6=Lr.DOM,IJ=(n,i)=>{const l=Ke.fromDom(n.getBody()),d=jh(jl(l)),p=Ke.fromTag("style");Tr(p,"type","text/css"),Qi(p,Ke.fromText(i)),Qi(d,p),n.on("remove",()=>{pr(p)})},qH=n=>n.inline?n.getElement().nodeName.toLowerCase():void 0,T6=n=>Wt(n,i=>ye(i)===!1),iD=n=>{const i=n.options.get,l=n.editorUpload.blobCache;return T6({allow_conditional_comments:i("allow_conditional_comments"),allow_html_data_urls:i("allow_html_data_urls"),allow_svg_data_urls:i("allow_svg_data_urls"),allow_html_in_named_anchor:i("allow_html_in_named_anchor"),allow_script_urls:i("allow_script_urls"),allow_unsafe_link_target:i("allow_unsafe_link_target"),convert_fonts_to_spans:i("convert_fonts_to_spans"),fix_list_elements:i("fix_list_elements"),font_size_legacy_values:i("font_size_legacy_values"),forced_root_block:i("forced_root_block"),forced_root_block_attrs:i("forced_root_block_attrs"),preserve_cdata:i("preserve_cdata"),inline_styles:i("inline_styles"),root_name:qH(n),sanitize:i("xss_sanitization"),validate:!0,blob_cache:l,document:n.getDoc()})},pA=n=>{const i=n.options.get;return T6({custom_elements:i("custom_elements"),extended_valid_elements:i("extended_valid_elements"),invalid_elements:i("invalid_elements"),invalid_styles:i("invalid_styles"),schema:i("schema"),valid_children:i("valid_children"),valid_classes:i("valid_classes"),valid_elements:i("valid_elements"),valid_styles:i("valid_styles"),verify_html:i("verify_html"),padd_empty_block_inline_children:i("format_empty_lines")})},By=n=>{const i=n.options.get;return{...iD(n),...pA(n),...T6({remove_trailing_brs:i("remove_trailing_brs"),pad_empty_with_br:i("pad_empty_with_br"),url_converter:i("url_converter"),url_converter_scope:i("url_converter_scope"),element_format:i("element_format"),entities:i("entities"),entity_encoding:i("entity_encoding"),indent:i("indent"),indent_after:i("indent_after"),indent_before:i("indent_before")})}},c_=n=>{const i=yS(iD(n),n.schema);return i.addAttributeFilter("src,href,style,tabindex",(l,d)=>{const p=n.dom,w="data-mce-"+d;let E=l.length;for(;E--;){const R=l[E];let B=R.attr(d);if(B&&!R.attr(w)){if(B.indexOf("data:")===0||B.indexOf("blob:")===0)continue;d==="style"?(B=p.serializeStyle(p.parseStyle(B),R.name),B.length||(B=null),R.attr(w,B),R.attr(d,B)):d==="tabindex"?(R.attr(w,B),R.attr(d,null)):R.attr(w,n.convertURL(B,d,R.name))}}}),i.addNodeFilter("script",l=>{let d=l.length;for(;d--;){const p=l[d],w=p.attr("type")||"no/type";w.indexOf("mce-")!==0&&p.attr("type","mce-"+w)}}),Yv(n)&&i.addNodeFilter("#cdata",l=>{var d;let p=l.length;for(;p--;){const w=l[p];w.type=8,w.name="#comment",w.value="[CDATA["+n.dom.encode((d=w.value)!==null&&d!==void 0?d:"")+"]]"}}),i.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",l=>{let d=l.length;const p=n.schema.getNonEmptyElements();for(;d--;){const w=l[d];w.isEmpty(p)&&w.getAll("br").length===0&&w.append(new Hd("br",1))}}),i},GH=n=>{const i=yh(n);i&&mg.setEditorTimeout(n,()=>{let l;i===!0?l=n:l=n.editorManager.get(i),l&&!l.destroyed&&(l.focus(),l.selection.scrollIntoView())},100)},BJ=n=>{const i=n.dom.getRoot();!n.inline&&(!LC(n)||n.selection.getStart(!0)===i)&&sl(i).each(l=>{const d=l.getNode(),p=Eu(d)?sl(d).getOr(l):l;n.selection.setRng(p.toRange())})},LJ=n=>{n.bindPendingEventDelegates(),n.initialized=!0,fy(n),n.focus(!0),BJ(n),n.nodeChanged({initial:!0});const i=Eb(n);be(i)&&i.call(n,n),GH(n)},KH=n=>n.inline?n.ui.styleSheetLoader:n.dom.styleSheetLoader,FJ=(n,i,l)=>{const d=[KH(n).loadAll(i)];return n.inline?d:d.concat([n.ui.styleSheetLoader.loadAll(l)])},YH=n=>{const i=KH(n),l=ip(n),d=n.contentCSS,p=()=>{i.unloadAll(d),n.inline||n.ui.styleSheetLoader.unloadAll(l)},w=()=>{n.removed?p():n.on("remove",p)};if(n.contentStyles.length>0){let B="";hn.each(n.contentStyles,K=>{B+=K+`\r
`}),n.dom.addStyle(B)}const E=Promise.all(FJ(n,d,l)).then(w).catch(w),R=Wv(n);return R&&IJ(n,R),E},HJ=n=>{const i=n.getDoc(),l=n.getBody();VO(n),lp(n)||(i.body.spellcheck=!1,A6.setAttrib(l,"spellcheck","false")),n.quirks=ZH(n),UE(n);const d=r0(n);d!==void 0&&(l.dir=d);const p=tw(n);p&&n.on("BeforeSetContent",w=>{hn.each(p,E=>{w.content=w.content.replace(E,R=>"<!--mce:protected "+escape(R)+"-->")})}),n.on("SetContent",()=>{n.addVisual(n.getBody())}),n.on("compositionstart compositionend",w=>{n.composing=w.type==="compositionstart"})},XH=n=>{S0(n)||n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"})},D6=n=>{n.removed!==!0&&(XH(n),LJ(n))},$J=n=>{let i=!1;const l=setTimeout(()=>{i||n.setProgressState(!0)},500);return()=>{clearTimeout(l),i=!0,n.setProgressState(!1)}},JH=n=>{const i=n.getElement();let l=n.getDoc();n.inline&&(A6.addClass(i,"mce-content-body"),n.contentDocument=l=document,n.contentWindow=window,n.bodyElement=i,n.contentAreaContainer=i);const d=n.getBody();d.disabled=!0,n.readonly=cg(n),n._editableRoot=vC(n),!n.readonly&&n.hasEditableRoot()&&(n.inline&&A6.getStyle(d,"position",!0)==="static"&&(d.style.position="relative"),d.contentEditable="true"),d.disabled=!1,n.editorUpload=lq(n),n.schema=dh(pA(n)),n.dom=Lr(l,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,update_styles:!0,root_element:n.inline?n.getBody():null,collect:n.inline,schema:n.schema,contentCssCors:jk(n),referrerPolicy:s0(n),onSetAttrib:E=>{n.dispatch("SetAttrib",E)}}),n.parser=c_(n),n.serializer=d1(By(n),n),n.selection=i5(n.dom,n.getWin(),n.serializer,n),n.annotator=o1(n),n.formatter=GL(n),n.undoManager=v5(n),n._nodeChangeDispatcher=new qY(n),n._selectionOverrides=CJ(n),Q5(n),pH(n),TG(n),S0(n)||(qX(n),US(n));const p=ZY(n);m4(n,p),rre(n),pq(n),gH(n);const w=dZ(n);HJ(n),w.fold(()=>{const E=$J(n);YH(n).then(()=>{D6(n),E()})},E=>{n.setProgressState(!0),YH(n).then(()=>{E().then(R=>{n.setProgressState(!1),D6(n),SL(n)},R=>{n.notificationManager.open({type:"error",text:String(R)}),D6(n),SL(n)})})})},Sre=xt,zJ=(n,i,l)=>Z0(n,i,Sre,l),bA=Lr.DOM,VJ=(n,i,l,d)=>{const p=Ke.fromTag("iframe");return d.each(w=>Tr(p,"tabindex",w)),Uu(p,l),Uu(p,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:i}),Wu(p,"tox-edit-area__iframe"),p},UJ=n=>{let i=$v(n)+"<html><head>";Qp(n)!==n.documentBaseUrl&&(i+='<base href="'+n.documentBaseURI.getURI()+'" />'),i+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const l=Of(n),d=nl(n),p=n.translate(wC(n));return Md(n)&&(i+='<meta http-equiv="Content-Security-Policy" content="'+Md(n)+'" />'),i+=`</head><body id="${l}" class="mce-content-body ${d}" data-id="${n.id}" aria-label="${p}"><br></body></html>`,i},QH=(n,i)=>{const l=n.translate("Rich Text Area"),d=$a(Ke.fromDom(n.getElement()),"tabindex").bind(qc),p=VJ(n.id,l,sf(n),d).dom;p.onload=()=>{p.onload=null,n.dispatch("load")},n.contentAreaContainer=i.iframeContainer,n.iframeElement=p,n.iframeHTML=UJ(n),bA.add(i.iframeContainer,p)},WJ=n=>{const i=n.iframeElement,l=()=>{n.contentDocument=i.contentDocument,JH(n)};if(xb(n)||Kn.browser.isFirefox()){const d=n.getDoc();d.open(),d.write(n.iframeHTML),d.close(),l()}else{const d=zJ(Ke.fromDom(i),"load",()=>{d.unbind(),l()});i.srcdoc=n.iframeHTML}},e$=(n,i)=>{QH(n,i),i.editorContainer&&(i.editorContainer.style.display=n.orgDisplay,n.hidden=bA.isHidden(i.editorContainer)),n.getElement().style.display="none",bA.setAttrib(n.id,"aria-hidden","true"),n.getElement().style.visibility=n.orgVisibility,WJ(n)},t$=Lr.DOM,O6=(n,i,l)=>{const d=Qw.get(l),p=Qw.urls[l]||n.documentBaseUrl.replace(/\/$/,"");if(l=hn.trim(l),d&&hn.inArray(i,l)===-1){if(n.plugins[l])return;try{const w=d(n,p)||{};n.plugins[l]=w,be(w.init)&&(w.init(n,p),i.push(l))}catch(w){QZ(n,l,w)}}},jJ=n=>n.replace(/^\-/,""),ZJ=n=>{const i=[];Pe(Zv(n),l=>{O6(n,i,jJ(l))})},qJ=n=>{const i=hn.trim(cC(n)),l=n.ui.registry.getAll().icons,d={...LT.get("default").icons,...LT.get(i).icons};an(d,(p,w)=>{cn(l,w)||n.ui.registry.addIcon(w,p)})},GJ=n=>{const i=rm(n);if(F(i)){const l=Ty.get(i);n.theme=l(n,Ty.urls[i])||{},be(n.theme.init)&&n.theme.init(n,Ty.urls[i]||n.documentBaseUrl.replace(/\/$/,""))}else n.theme={}},n$=n=>{const i=Jl(n),l=SS.get(i);n.model=l(n,SS.urls[i])},M6=n=>{const i=n.theme.renderUI;return i?i():YJ(n)},o$=n=>{const i=n.getElement(),d=rm(n)(n,i);return d.editorContainer.nodeType&&(d.editorContainer.id=d.editorContainer.id||n.id+"_parent"),d.iframeContainer&&d.iframeContainer.nodeType&&(d.iframeContainer.id=d.iframeContainer.id||n.id+"_iframecontainer"),d.height=d.iframeHeight?d.iframeHeight:i.offsetHeight,d},aD=(n,i)=>({editorContainer:n,iframeContainer:i,api:{}}),KJ=n=>{const i=t$.create("div");return t$.insertAfter(i,n),aD(i,i)},YJ=n=>{const i=n.getElement();return n.inline?aD(null):KJ(i)},kre=n=>{const i=n.getElement();return n.orgDisplay=i.style.display,F(rm(n))?M6(n):be(rm(n))?o$(n):YJ(n)},XJ=(n,i)=>{const l={show:he.from(i.show).getOr(ft),hide:he.from(i.hide).getOr(ft),isEnabled:he.from(i.isEnabled).getOr(xt),setEnabled:d=>{n.mode.isReadOnly()||he.from(i.setEnabled).each(p=>p(d))}};n.ui={...n.ui,...l}},s$=async n=>{n.dispatch("ScriptsLoaded"),qJ(n),GJ(n),n$(n),ZJ(n);const i=await kre(n);XJ(n,he.from(i.api).getOr({})),n.editorContainer=i.editorContainer,oq(n),n.inline?JH(n):e$(n,{editorContainer:i.editorContainer,iframeContainer:i.iframeContainer})},u_=Lr.DOM,r$=n=>n.charAt(0)==="-",JJ=(n,i)=>{const l=fC(i),d=Zk(i);if(!Yf.hasCode(l)&&l!=="en"){const p=gr(d)?d:`${i.editorManager.baseURL}/langs/${l}.js`;n.add(p).catch(()=>{YZ(i,p,l)})}},Ere=(n,i)=>{const l=rm(n);if(F(l)&&!r$(l)&&!cn(Ty.urls,l)){const d=Gk(n),p=d?n.documentBaseURI.toAbsolute(d):`themes/${l}/theme${i}.js`;Ty.load(l,p).catch(()=>{XZ(n,p,l)})}},xre=(n,i)=>{const l=Jl(n);if(l!=="plugin"&&!cn(SS.urls,l)){const d=rf(n),p=F(d)?n.documentBaseURI.toAbsolute(d):`models/${l}/model${i}.js`;SS.load(l,p).catch(()=>{JZ(n,p,l)})}},i$=n=>he.from(ia(n)).filter(gr).map(i=>({url:i,name:he.none()})),R6=(n,i,l)=>he.from(i).filter(d=>gr(d)&&!LT.has(d)).map(d=>({url:`${n.editorManager.baseURL}/icons/${d}/icons${l}.js`,name:he.some(d)})),QJ=(n,i,l)=>{const d=R6(i,"default",l),p=i$(i).orThunk(()=>R6(i,cC(i),""));Pe(Xi([d,p]),w=>{n.add(w.url).catch(()=>{vp(i,w.url,w.name.getOrUndefined())})})},eQ=(n,i)=>{const l=(d,p)=>{Qw.load(d,p).catch(()=>{Dy(n,p,d)})};an(a0(n),(d,p)=>{l(p,d),n.options.set("plugins",Zv(n).concat(p))}),Pe(Zv(n),d=>{d=hn.trim(d),d&&!Qw.urls[d]&&!r$(d)&&l(d,`plugins/${d}/plugin${i}.js`)})},tQ=n=>{const i=rm(n);return!F(i)||_e(Ty.get(i))},Are=n=>{const i=Jl(n);return _e(SS.get(i))},Tre=(n,i)=>{const l=tm.ScriptLoader,d=()=>{!n.removed&&tQ(n)&&Are(n)&&s$(n)};Ere(n,i),xre(n,i),JJ(l,n),QJ(l,n,i),eQ(n,i),l.loadQueue().then(d,d)},Dre=(n,i)=>xv.forElement(n,{contentCssCors:yC(i),referrerPolicy:s0(i)}),nQ=n=>{const i=n.id;Yf.setCode(fC(n));const l=()=>{u_.unbind(window,"ready",l),n.render()};if(!em.Event.domLoaded){u_.bind(window,"ready",l);return}if(!n.getElement())return;const d=Ke.fromDom(n.getElement()),p=Vf(d);n.on("remove",()=>{Ut(d.dom.attributes,E=>Hi(d,E.name)),Uu(d,p)}),n.ui.styleSheetLoader=Dre(d,n),bC(n)?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");const w=n.getElement().form||u_.getParent(i,"form");w&&(n.formElement=w,ap(n)&&!V1(n.getElement())&&(u_.insertAfter(u_.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=E=>{n.dispatch(E.type,E)},u_.bind(w,"submit reset",n.formEventDelegate),n.on("reset",()=>{n.resetContent()}),Xk(n)&&!w.submit.nodeType&&!w.submit.length&&!w._mceOldSubmit&&(w._mceOldSubmit=w.submit,w.submit=()=>(n.editorManager.triggerSave(),n.setDirty(!1),w._mceOldSubmit(w)))),n.windowManager=Nx(n),n.notificationManager=Jw(n),DC(n)&&n.on("GetContent",E=>{E.save&&(E.content=u_.encode(E.content))}),Jk(n)&&n.on("submit",()=>{n.initialized&&n.save()}),Qk(n)&&(n._beforeUnload=()=>{n.initialized&&!n.destroyed&&!n.isHidden()&&n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),n.editorManager.add(n),Tre(n,n.suffix)},Ore=(n,i)=>{n._editableRoot!==i&&(n._editableRoot=i,n.readonly||(n.getBody().contentEditable=String(n.hasEditableRoot()),n.nodeChanged()),qO(n,i))},oQ=n=>n._editableRoot,f_=(n,i)=>({sections:nt(n),options:nt(i)}),lD=vs().deviceType,vA=lD.isPhone(),a$=lD.isTablet(),WS=n=>{if(De(n))return[];{const i=re(n)?n:n.split(/[ ,]/),l=Et(i,pc);return yt(l,gr)}},l$=(n,i)=>{const l=At(i,(d,p)=>Ct(n,p));return f_(l.t,l.f)},sQ=(n,i,l={})=>{const d=n.sections(),p=go(d,i).getOr({});return hn.extend({},l,p)},N6=(n,i)=>cn(n.sections(),i),rQ=(n,i)=>N6(n,i)?n.sections()[i]:{},iQ=(n,i)=>({...{table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:go(n,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1},...i?{menubar:!1}:{}}),Ly=(n,i)=>{var l;const d=(l=i.external_plugins)!==null&&l!==void 0?l:{};return n&&n.external_plugins?hn.extend({},n.external_plugins,d):d},aQ=(n,i)=>[...WS(n),...WS(i)],c$=(n,i,l,d)=>n&&N6(i,"mobile")?d:l,lQ=(n,i,l,d)=>{const p=WS(l.forced_plugins),w=WS(d.plugins),E=rQ(i,"mobile"),R=E.plugins?WS(E.plugins):w,B=c$(n,i,w,R),K=aQ(p,B);return hn.extend(d,{forced_plugins:p,plugins:K})},cD=(n,i)=>n&&N6(i,"mobile"),cQ=(n,i,l,d,p)=>{var w;const E=n?{mobile:iQ((w=p.mobile)!==null&&w!==void 0?w:{},i)}:{},R=l$(["mobile"],T4(E,p)),B=hn.extend(l,d,R.options(),cD(n,R)?sQ(R,"mobile"):{},{external_plugins:Ly(d,R.options())});return lQ(n,R,d,B)},uQ=(n,i)=>cQ(vA||a$,vA,i,n,i),fQ=(n,i)=>AZ(n,i),u$=n=>{const i=(d,p)=>{n.formatter.toggle(d,p),n.nodeChanged()},l=d=>()=>{Pe("left,center,right,justify".split(","),p=>{d!==p&&n.formatter.remove("align"+p)}),d!=="none"&&i("align"+d)};n.editorCommands.addCommands({JustifyLeft:l("left"),JustifyCenter:l("center"),JustifyRight:l("right"),JustifyFull:l("justify"),JustifyNone:l("none")})},dQ=n=>{const i=l=>()=>{const d=n.selection,p=d.isCollapsed()?[n.dom.getParent(d.getNode(),n.dom.isBlock)]:d.getSelectedBlocks();return Jt(p,w=>_e(n.formatter.matchNode(w,l)))};n.editorCommands.addCommands({JustifyLeft:i("alignleft"),JustifyCenter:i("aligncenter"),JustifyRight:i("alignright"),JustifyFull:i("alignjustify")},"state")},hQ=n=>{u$(n),dQ(n)},mQ=n=>{n.editorCommands.addCommands({"Cut,Copy,Paste":i=>{const l=n.getDoc();let d;try{l.execCommand(i)}catch{d=!0}if(i==="paste"&&!l.queryCommandEnabled(i)&&(d=!0),d||!l.queryCommandSupported(i)){let p=n.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(Kn.os.isMacOS()||Kn.os.isiOS())&&(p=p.replace(/Ctrl\+/g,"\u2318+")),n.notificationManager.open({text:p,type:"error"})}}})},P6=(n,i,l)=>{const d=Ke.fromDom(n.getRoot());return nx(d,Vt.fromRangeStart(i))?l=l.replace(/^ /,"&nbsp;"):l=l.replace(/^&nbsp;/," "),ox(d,Vt.fromRangeEnd(i))?l=l.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):l=l.replace(/&nbsp;(<br( \/)?>)?$/," "),l},gQ=n=>{if(typeof n!="string"){const i=hn.extend({paste:n.paste,data:{paste:n.paste}},n);return{content:n.content,details:i}}return{content:n,details:{}}},pQ=(n,i)=>{const l=n.selection,d=n.dom;return/^ | $/.test(i)?P6(d,l.getRng(),i):i},Ml=(n,i)=>{if(n.selection.isEditable()){const{content:l,details:d}=gQ(i);UR(n,{...d,content:pQ(n,l),format:"html",set:!1,selection:!0}).each(p=>{const w=ei(n,p.content,d);WR(n,w,p),n.addVisual()})}},bQ=n=>{n.editorCommands.addCommands({mceCleanup:()=>{const i=n.selection.getBookmark();n.setContent(n.getContent()),n.selection.moveToBookmark(i)},insertImage:(i,l,d)=>{Ml(n,n.dom.createHTML("img",{src:d}))},insertHorizontalRule:()=>{n.execCommand("mceInsertContent",!1,"<hr>")},insertText:(i,l,d)=>{Ml(n,n.dom.encode(d))},insertHTML:(i,l,d)=>{Ml(n,d)},mceInsertContent:(i,l,d)=>{Ml(n,d)},mceSetContent:(i,l,d)=>{n.setContent(d)},mceReplaceContent:(i,l,d)=>{n.execCommand("mceInsertContent",!1,d.replace(/\{\$selection\}/g,n.selection.getContent({format:"text"})))},mceNewDocument:()=>{n.setContent(tE(n))}})},vQ={"font-size":"size","font-family":"face"},I6=yc("font"),f$=(n,i,l)=>{const d=w=>Ta(w,n).orThunk(()=>I6(w)?go(vQ,n).bind(E=>$a(w,E)):he.none()),p=w=>pt(Ke.fromDom(i),w);return a1(Ke.fromDom(l),w=>d(w),p)},B6=n=>n.replace(/[\'\"\\]/g,"").replace(/,\s+/g,","),yQ=(n,i)=>he.from(Lr.DOM.getStyle(i,n,!0)),d$=n=>(i,l)=>he.from(l).map(Ke.fromDom).filter(_l).bind(d=>f$(n,i,d.dom).or(yQ(n,d.dom))).getOr(""),wQ=d$("font-size"),_Q=V(B6,d$("font-family")),CQ=n=>sl(n.getBody()).bind(i=>{const l=i.container();return he.from(_n(l)?l.parentNode:l)}),SQ=n=>he.from(n.selection.getRng()).bind(i=>{const l=n.getBody();return i.startContainer===l&&i.startOffset===0?he.none():he.from(n.selection.getStart(!0))}),kQ=(n,i)=>SQ(n).orThunk(He(CQ,n)).map(Ke.fromDom).filter(_l).bind(i),L6=(n,i)=>kQ(n,mt(he.some,i)),d_=(n,i)=>{if(/^[0-9.]+$/.test(i)){const l=parseInt(i,10);if(l>=1&&l<=7){const d=Jv(n),p=sw(n);return p.length>0?p[l-1]||i:d[l-1]||i}else return i}else return i},y1=n=>{const i=n.split(/\s*,\s*/);return Et(i,l=>l.indexOf(" ")!==-1&&!(xr(l,'"')||xr(l,"'"))?`'${l}'`:l).join(",")},EQ=(n,i)=>{const l=d_(n,i);n.formatter.toggle("fontname",{value:y1(l)}),n.nodeChanged()},xQ=n=>L6(n,i=>_Q(n.getBody(),i.dom)).getOr(""),AQ=(n,i)=>{n.formatter.toggle("fontsize",{value:d_(n,i)}),n.nodeChanged()},TQ=n=>L6(n,i=>wQ(n.getBody(),i.dom)).getOr(""),DQ=n=>L6(n,i=>{const l=Ke.fromDom(n.getBody()),d=a1(i,w=>Ta(w,"line-height"),He(pt,l)),p=()=>{const w=parseFloat(Mi(i,"line-height")),E=parseFloat(Mi(i,"font-size"));return String(w/E)};return d.getOrThunk(p)}).getOr(""),OQ=(n,i)=>{n.formatter.toggle("lineheight",{value:String(i)}),n.nodeChanged()},MQ=n=>{const i=(l,d)=>{n.formatter.toggle(l,d),n.nodeChanged()};n.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":l=>{i(l)},"ForeColor,HiliteColor":(l,d,p)=>{i(l,{value:p})},BackColor:(l,d,p)=>{i("hilitecolor",{value:p})},FontName:(l,d,p)=>{EQ(n,p)},FontSize:(l,d,p)=>{AQ(n,p)},LineHeight:(l,d,p)=>{OQ(n,p)},Lang:(l,d,p)=>{var w;i(l,{value:p.code,customValue:(w=p.customCode)!==null&&w!==void 0?w:null})},RemoveFormat:l=>{n.formatter.remove(l)},mceBlockQuote:()=>{i("blockquote")},FormatBlock:(l,d,p)=>{i(F(p)?p:"p")},mceToggleFormat:(l,d,p)=>{i(p)}})},RQ=n=>{const i=l=>n.formatter.match(l);n.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":l=>i(l),mceBlockQuote:()=>i("blockquote")},"state"),n.editorCommands.addQueryValueHandler("FontName",()=>xQ(n)),n.editorCommands.addQueryValueHandler("FontSize",()=>TQ(n)),n.editorCommands.addQueryValueHandler("LineHeight",()=>DQ(n))},NQ=n=>{MQ(n),RQ(n)},Mre=n=>{n.editorCommands.addCommands({mceAddUndoLevel:()=>{n.undoManager.add()},mceEndUndoLevel:()=>{n.undoManager.add()},Undo:()=>{n.undoManager.undo()},Redo:()=>{n.undoManager.redo()}})},PQ=n=>{n.editorCommands.addCommands({Indent:()=>{KF(n)},Outdent:()=>{_G(n)}}),n.editorCommands.addCommands({Outdent:()=>h4(n)},"state")},IQ=n=>{const i=(l,d,p)=>{const w=F(p)?{href:p}:p,E=n.dom.getParent(n.selection.getNode(),"a");ne(w)&&F(w.href)&&(w.href=w.href.replace(/ /g,"%20"),(!E||!w.href)&&n.formatter.remove("link"),w.href&&n.formatter.apply("link",w,E))};n.editorCommands.addCommands({unlink:()=>{if(n.selection.isEditable()){if(n.selection.isCollapsed()){const l=n.dom.getParent(n.selection.getStart(),"a");l&&n.dom.remove(l,!0);return}n.formatter.remove("link")}},mceInsertLink:i,createLink:i})},BQ=n=>{n.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":i=>{n.getDoc().execCommand(i);const l=n.dom.getParent(n.selection.getNode(),"ol,ul");if(l){const d=l.parentNode;if(d&&/^(H[1-6]|P|ADDRESS|PRE)$/.test(d.nodeName)){const p=n.selection.getBookmark();n.dom.split(d,l),n.selection.moveToBookmark(p)}}}})},LQ=n=>{n.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":i=>{const l=n.dom.getParent(n.selection.getNode(),"ul,ol");return l&&(i==="insertunorderedlist"&&l.tagName==="UL"||i==="insertorderedlist"&&l.tagName==="OL")}},"state")},FQ=n=>{BQ(n),LQ(n)},HQ=(n,i,l,d)=>{const p=n.dom,w=R=>p.isBlock(R)&&R.parentElement===l,E=w(i)?i:p.getParent(d,w,l);return he.from(E).map(Ke.fromDom)},$Q=(n,i)=>{const l=n.dom,d=n.selection.getRng(),p=i?n.selection.getStart():n.selection.getEnd(),w=i?d.startContainer:d.endContainer,E=F4(l,w);if(!E||!E.isContentEditable)return;const R=i?wa:Yc,B=Hc(n);HQ(n,p,E,w).each(K=>{const ie=h9(n,w,K.dom,E,!1,B);R(K,Ke.fromDom(ie)),n.selection.setCursorLocation(ie,0),n.dispatch("NewBlock",{newBlock:ie}),oA(n,"insertParagraph")})},zQ=n=>$Q(n,!0),VQ=n=>$Q(n,!1),UQ=n=>{n.editorCommands.addCommands({InsertNewBlockBefore:()=>{zQ(n)},InsertNewBlockAfter:()=>{VQ(n)}})},WQ=n=>{n.editorCommands.addCommands({insertParagraph:()=>{W4(_9,n)},mceInsertNewLine:(i,l,d)=>{D9(n,d)},InsertLineBreak:(i,l,d)=>{W4(LN,n)}})},jQ=n=>{n.editorCommands.addCommands({mceSelectNodeDepth:(i,l,d)=>{let p=0;n.dom.getParent(n.selection.getNode(),w=>Xn(w)&&p++===d?(n.selection.select(w),!1):!0,n.getBody())},mceSelectNode:(i,l,d)=>{n.selection.select(d)},selectAll:()=>{const i=n.dom.getParent(n.selection.getStart(),ha);if(i){const l=n.dom.createRng();l.selectNodeContents(i),n.selection.setRng(l)}}})},ZQ=n=>{n.editorCommands.addCommands({mceRemoveNode:(i,l,d)=>{const p=d!=null?d:n.selection.getNode();if(p!==n.getBody()){const w=n.selection.getBookmark();n.dom.remove(p,!0),n.selection.moveToBookmark(w)}},mcePrint:()=>{n.getWin().print()},mceFocus:(i,l,d)=>{DU(n,d===!0)},mceToggleVisualAid:()=>{n.hasVisual=!n.hasVisual,n.addVisual()}})},qQ=n=>{hQ(n),mQ(n),Mre(n),jQ(n),bQ(n),IQ(n),PQ(n),UQ(n),WQ(n),FQ(n),NQ(n),ZQ(n)},GQ=["toggleview"],h$=n=>Ct(GQ,n.toLowerCase());class m${constructor(i){this.commands={state:{},exec:{},value:{}},this.editor=i}execCommand(i,l=!1,d,p){const w=this.editor,E=i.toLowerCase(),R=p==null?void 0:p.skip_focus;if(w.removed||(E!=="mcefocus"&&(!/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(E)&&!R?w.focus():xI(w)),w.dispatch("BeforeExecCommand",{command:i,ui:l,value:d}).isDefaultPrevented()))return!1;const K=this.commands.exec[E];return be(K)?(K(E,l,d),w.dispatch("ExecCommand",{command:i,ui:l,value:d}),!0):!1}queryCommandState(i){if(!h$(i)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const l=i.toLowerCase(),d=this.commands.state[l];return be(d)?d(l):!1}queryCommandValue(i){if(!h$(i)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const l=i.toLowerCase(),d=this.commands.value[l];return be(d)?d(l):""}addCommands(i,l="exec"){const d=this.commands;an(i,(p,w)=>{Pe(w.toLowerCase().split(","),E=>{d[l][E]=p})})}addCommand(i,l,d){const p=i.toLowerCase();this.commands.exec[p]=(w,E,R)=>l.call(d!=null?d:this.editor,E,R)}queryCommandSupported(i){const l=i.toLowerCase();return!!this.commands.exec[l]}addQueryStateHandler(i,l,d){this.commands.state[i.toLowerCase()]=()=>l.call(d!=null?d:this.editor)}addQueryValueHandler(i,l,d){this.commands.value[i.toLowerCase()]=()=>l.call(d!=null?d:this.editor)}}const h_="data-mce-contenteditable",KQ=(n,i,l)=>{_f(n,i)&&!l?Nc(n,i):l&&Wu(n,i)},F6=(n,i,l)=>{try{n.getDoc().execCommand(i,!1,String(l))}catch{}},uD=(n,i)=>{n.dom.contentEditable=i?"true":"false"},YQ=n=>{Pe(dl(n,'*[contenteditable="true"]'),i=>{Tr(i,h_,"true"),uD(i,!1)})},XQ=n=>{Pe(dl(n,`*[${h_}="true"]`),i=>{Hi(i,h_),uD(i,!0)})},g$=n=>{he.from(n.selection.getNode()).each(i=>{i.removeAttribute("data-mce-selected")})},JQ=n=>{n.selection.setRng(n.selection.getRng())},QQ=(n,i)=>{const l=Ke.fromDom(n.getBody());KQ(l,"mce-content-readonly",i),i?(n.selection.controlSelection.hideResizeRect(),n._selectionOverrides.hideFakeCaret(),g$(n),n.readonly=!0,uD(l,!1),YQ(l)):(n.readonly=!1,n.hasEditableRoot()&&uD(l,!0),XQ(l),F6(n,"StyleWithCSS",!1),F6(n,"enableInlineTableEditing",!1),F6(n,"enableObjectResizing",!1),V3(n)&&n.focus(),JQ(n),n.nodeChanged())},m_=n=>n.readonly,p$=n=>{n.parser.addAttributeFilter("contenteditable",i=>{m_(n)&&Pe(i,l=>{l.attr(h_,l.attr("contenteditable")),l.attr("contenteditable","false")})}),n.serializer.addAttributeFilter(h_,i=>{m_(n)&&Pe(i,l=>{l.attr("contenteditable",l.attr(h_))})}),n.serializer.addTempAttr(h_)},eee=n=>{n.serializer?p$(n):n.on("PreInit",()=>{p$(n)})},tee=n=>n.type==="click",nee=["copy"],oee=n=>Ct(nee,n.type),b$=(n,i)=>rt(i,"a",d=>pt(d,Ke.fromDom(n.getBody()))).bind(d=>$a(d,"href")),see=(n,i)=>{if(tee(i)&&!eo.metaKeyPressed(i)){const l=Ke.fromDom(i.target);b$(n,l).each(d=>{if(i.preventDefault(),/^#/.test(d)){const p=n.dom.select(`${d},[name="${fa(d,"#")}"]`);p.length&&n.selection.scrollIntoView(p[0],!0)}else window.open(d,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})}else oee(i)&&n.dispatch(i.type,i)},ree=n=>{n.on("ShowCaret",i=>{m_(n)&&i.preventDefault()}),n.on("ObjectSelected",i=>{m_(n)&&i.preventDefault()})},iee=hn.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class H6{static isNative(i){return!!iee[i.toLowerCase()]}constructor(i){this.bindings={},this.settings=i||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||We}fire(i,l){return this.dispatch(i,l)}dispatch(i,l){const d=i.toLowerCase(),p=ep(d,l!=null?l:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(p);const w=this.bindings[d];if(w)for(let E=0,R=w.length;E<R;E++){const B=w[E];if(!B.removed){if(B.once&&this.off(d,B.func),p.isImmediatePropagationStopped())return p;if(B.func.call(this.scope,p)===!1)return p.preventDefault(),p}}return p}on(i,l,d,p){if(l===!1&&(l=We),l){const w={func:l,removed:!1};p&&hn.extend(w,p);const E=i.toLowerCase().split(" ");let R=E.length;for(;R--;){const B=E[R];let K=this.bindings[B];K||(K=[],this.toggleEvent(B,!0)),d?K=[w,...K]:K=[...K,w],this.bindings[B]=K}}return this}off(i,l){if(i){const d=i.toLowerCase().split(" ");let p=d.length;for(;p--;){const w=d[p];let E=this.bindings[w];if(!w)return an(this.bindings,(R,B)=>{this.toggleEvent(B,!1),delete this.bindings[B]}),this;if(E){if(!l)E.length=0;else{const R=gn(E,B=>B.func===l);E=R.fail,this.bindings[w]=E,Pe(R.pass,B=>{B.removed=!0})}E.length||(this.toggleEvent(i,!1),delete this.bindings[w])}}}else an(this.bindings,(d,p)=>{this.toggleEvent(p,!1)}),this.bindings={};return this}once(i,l,d){return this.on(i,l,d,{once:!0})}has(i){i=i.toLowerCase();const l=this.bindings[i];return!(!l||l.length===0)}}const yA=n=>(n._eventDispatcher||(n._eventDispatcher=new H6({scope:n,toggleEvent:(i,l)=>{H6.isNative(i)&&n.toggleNativeEvent&&n.toggleNativeEvent(i,l)}})),n._eventDispatcher),$6={fire(n,i,l){return this.dispatch(n,i,l)},dispatch(n,i,l){const d=this;if(d.removed&&n!=="remove"&&n!=="detach")return ep(n.toLowerCase(),i!=null?i:{},d);const p=yA(d).dispatch(n,i);if(l!==!1&&d.parent){let w=d.parent();for(;w&&!p.isPropagationStopped();)w.dispatch(n,p,!1),w=w.parent?w.parent():void 0}return p},on(n,i,l){return yA(this).on(n,i,l)},off(n,i){return yA(this).off(n,i)},once(n,i){return yA(this).once(n,i)},hasEventListeners(n){return yA(this).has(n)}},fD=Lr.DOM;let g_;const wA=(n,i)=>{if(i==="selectionchange")return n.getDoc();if(!n.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(i))return n.getDoc().documentElement;const l=ol(n);return l?(n.eventRoot||(n.eventRoot=fD.select(l)[0]),n.eventRoot):n.getBody()},Rre=n=>!n.hidden&&!m_(n),z6=(n,i,l)=>{Rre(n)?n.dispatch(i,l):m_(n)&&see(n,l)},v$=(n,i)=>{if(n.delegates||(n.delegates={}),n.delegates[i]||n.removed)return;const l=wA(n,i);if(ol(n)){if(g_||(g_={},n.editorManager.on("removeEditor",()=>{n.editorManager.activeEditor||g_&&(an(g_,(p,w)=>{n.dom.unbind(wA(n,w))}),g_=null)})),g_[i])return;const d=p=>{const w=p.target,E=n.editorManager.get();let R=E.length;for(;R--;){const B=E[R].getBody();(B===w||fD.isChildOf(w,B))&&z6(E[R],i,p)}};g_[i]=d,fD.bind(l,i,d)}else{const d=p=>{z6(n,i,p)};fD.bind(l,i,d),n.delegates[i]=d}},V6={...$6,bindPendingEventDelegates(){const n=this;hn.each(n._pendingNativeEvents,i=>{v$(n,i)})},toggleNativeEvent(n,i){const l=this;n==="focus"||n==="blur"||l.removed||(i?l.initialized?v$(l,n):l._pendingNativeEvents?l._pendingNativeEvents.push(n):l._pendingNativeEvents=[n]:l.initialized&&l.delegates&&(l.dom.unbind(wA(l,n),n,l.delegates[n]),delete l.delegates[n]))},unbindAllNativeEvents(){const n=this,i=n.getBody(),l=n.dom;n.delegates&&(an(n.delegates,(d,p)=>{n.dom.unbind(wA(n,p),p,d)}),delete n.delegates),!n.inline&&i&&l&&(i.onload=null,l.unbind(n.getWin()),l.unbind(n.getDoc())),l&&(l.unbind(i),l.unbind(n.getContainer()))}},aee=n=>F(n)?{value:n.split(/[ ,]/),valid:!0}:Qe(n,F)?{value:n,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},lee=n=>{const i=(()=>{switch(n){case"array":return re;case"boolean":return we;case"function":return be;case"number":return tt;case"object":return ne;case"string":return F;case"string[]":return aee;case"object[]":return l=>Qe(l,ne);case"regexp":return l=>ee(l,RegExp);default:return xt}})();return l=>U6(l,i,`The value must be a ${n}.`)},cee=n=>F(n.processor),y$=(n,i)=>{const l=Ja(i.message)?"":`. ${i.message}`;return n+l},w$=n=>n.valid,U6=(n,i,l="")=>{const d=i(n);return we(d)?d?{value:n,valid:!0}:{valid:!1,message:l}:d},W6=(n,i,l)=>{if(!ye(i)){const d=U6(i,l);if(w$(d))return d.value;console.error(y$(`Invalid default value passed for the "${n}" option`,d))}},j6=(n,i)=>{const l={},d={},p=(ue,pe,Be)=>{const Ze=U6(pe,Be);return w$(Ze)?(d[ue]=Ze.value,!0):(console.warn(y$(`Invalid value passed for the ${ue} option`,Ze)),!1)},w=(ue,pe)=>{const Be=cee(pe)?lee(pe.processor):pe.processor,Ze=W6(ue,pe.default,Be);l[ue]={...pe,default:Ze,processor:Be},go(d,ue).orThunk(()=>go(i,ue)).each(ze=>p(ue,ze,Be))},E=ue=>cn(l,ue);return{register:w,isRegistered:E,get:ue=>go(d,ue).orThunk(()=>go(l,ue).map(pe=>pe.default)).getOrUndefined(),set:(ue,pe)=>{if(E(ue)){const Be=l[ue];return Be.immutable?(console.error(`"${ue}" is an immutable option and cannot be updated`),!1):p(ue,pe,Be.processor)}else return console.warn(`"${ue}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:ue=>{const pe=E(ue);return pe&&delete d[ue],pe},isSet:ue=>cn(d,ue)}},uee=["design","readonly"],Z6=(n,i,l,d)=>{const p=l[i.get()],w=l[d];try{w.activate()}catch(E){console.error(`problem while activating editor mode ${d}:`,E);return}p.deactivate(),p.editorReadOnly!==w.editorReadOnly&&QQ(n,w.editorReadOnly),i.set(d),$O(n,d)},fee=(n,i,l,d)=>{if(d!==l.get()){if(!cn(i,d))throw new Error(`Editor mode '${d}' is invalid`);n.initialized?Z6(n,l,i,d):n.on("init",()=>Z6(n,l,i,d))}},dee=(n,i,l)=>{if(Ct(uee,i))throw new Error(`Cannot override default mode ${i}`);return{...n,[i]:{...l,deactivate:()=>{try{l.deactivate()}catch(d){console.error(`problem while deactivating editor mode ${i}:`,d)}}}}},hee=n=>{const i=qa("design"),l=qa({design:{activate:ft,deactivate:ft,editorReadOnly:!1},readonly:{activate:ft,deactivate:ft,editorReadOnly:!0}});return eee(n),ree(n),{isReadOnly:()=>m_(n),set:d=>fee(n,l.get(),i,d),get:()=>i.get(),register:(d,p)=>{l.set(dee(l.get(),d,p))}}},q6=hn.each,G6=hn.explode,mee={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},_$=hn.makeMap("alt,ctrl,shift,meta,access"),gee=n=>n in _$,pee=n=>{const i={},l=Kn.os.isMacOS()||Kn.os.isiOS();q6(G6(n.toLowerCase(),"+"),w=>{gee(w)?i[w]=!0:/^[0-9]{2,}$/.test(w)?i.keyCode=parseInt(w,10):(i.charCode=w.charCodeAt(0),i.keyCode=mee[w]||w.toUpperCase().charCodeAt(0))});const d=[i.keyCode];let p;for(p in _$)i[p]?d.push(p):i[p]=!1;return i.id=d.join(","),i.access&&(i.alt=!0,l?i.ctrl=!0:i.shift=!0),i.meta&&(l?i.meta=!0:(i.ctrl=!0,i.meta=!1)),i};class C${constructor(i){this.shortcuts={},this.pendingPatterns=[],this.editor=i;const l=this;i.on("keyup keypress keydown",d=>{(l.hasModifier(d)||l.isFunctionKey(d))&&!d.isDefaultPrevented()&&(q6(l.shortcuts,p=>{l.matchShortcut(d,p)&&(l.pendingPatterns=p.subpatterns.slice(0),d.type==="keydown"&&l.executeShortcutAction(p))}),l.matchShortcut(d,l.pendingPatterns[0])&&(l.pendingPatterns.length===1&&d.type==="keydown"&&l.executeShortcutAction(l.pendingPatterns[0]),l.pendingPatterns.shift()))})}add(i,l,d,p){const w=this,E=w.normalizeCommandFunc(d);return q6(G6(hn.trim(i)),R=>{const B=w.createShortcut(R,l,E,p);w.shortcuts[B.id]=B}),!0}remove(i){const l=this.createShortcut(i);return this.shortcuts[l.id]?(delete this.shortcuts[l.id],!0):!1}normalizeCommandFunc(i){const l=this,d=i;return typeof d=="string"?()=>{l.editor.execCommand(d,!1,null)}:hn.isArray(d)?()=>{l.editor.execCommand(d[0],d[1],d[2])}:d}createShortcut(i,l,d,p){const w=hn.map(G6(i,">"),pee);return w[w.length-1]=hn.extend(w[w.length-1],{func:d,scope:p||this.editor}),hn.extend(w[0],{desc:this.editor.translate(l),subpatterns:w.slice(1)})}hasModifier(i){return i.altKey||i.ctrlKey||i.metaKey}isFunctionKey(i){return i.type==="keydown"&&i.keyCode>=112&&i.keyCode<=123}matchShortcut(i,l){return!l||l.ctrl!==i.ctrlKey||l.meta!==i.metaKey||l.alt!==i.altKey||l.shift!==i.shiftKey?!1:i.keyCode===l.keyCode||i.charCode&&i.charCode===l.charCode?(i.preventDefault(),!0):!1}executeShortcutAction(i){return i.func?i.func.call(i.scope):null}}const K6=()=>{const n={},i={},l={},d={},p={},w={},E={},R={},B=(ie,ue)=>(pe,Be)=>{ie[pe.toLowerCase()]={...Be,type:ue}},K=(ie,ue)=>d[ie.toLowerCase()]=ue;return{addButton:B(n,"button"),addGroupToolbarButton:B(n,"grouptoolbarbutton"),addToggleButton:B(n,"togglebutton"),addMenuButton:B(n,"menubutton"),addSplitButton:B(n,"splitbutton"),addMenuItem:B(i,"menuitem"),addNestedMenuItem:B(i,"nestedmenuitem"),addToggleMenuItem:B(i,"togglemenuitem"),addAutocompleter:B(l,"autocompleter"),addContextMenu:B(p,"contextmenu"),addContextToolbar:B(w,"contexttoolbar"),addContextForm:B(w,"contextform"),addSidebar:B(E,"sidebar"),addView:B(R,"views"),addIcon:K,getAll:()=>({buttons:n,menuItems:i,icons:d,popups:l,contextMenus:p,contextToolbars:w,sidebars:E,views:R})}},bee=()=>{const n=K6();return{addAutocompleter:n.addAutocompleter,addButton:n.addButton,addContextForm:n.addContextForm,addContextMenu:n.addContextMenu,addContextToolbar:n.addContextToolbar,addIcon:n.addIcon,addMenuButton:n.addMenuButton,addMenuItem:n.addMenuItem,addNestedMenuItem:n.addNestedMenuItem,addSidebar:n.addSidebar,addSplitButton:n.addSplitButton,addToggleButton:n.addToggleButton,addGroupToolbarButton:n.addGroupToolbarButton,addToggleMenuItem:n.addToggleMenuItem,addView:n.addView,getAll:n.getAll}},p_=Lr.DOM,S$=hn.extend,vee=hn.each;class dD{constructor(i,l,d){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this._editableRoot=!0,this.editorManager=d,this.documentBaseUrl=d.documentBaseURL,S$(this,V6);const p=this;this.id=i,this.hidden=!1;const w=uQ(d.defaultOptions,l);this.options=j6(p,w),n0(p);const E=this.options.get;E("deprecation_warnings")&&ZZ(l,w);const R=E("suffix");R&&(d.suffix=R),this.suffix=d.suffix;const B=E("base_url");B&&d._setBaseUrl(B),this.baseUri=d.baseURI;const K=s0(p);K&&(tm.ScriptLoader._setReferrerPolicy(K),Lr.DOM.styleSheetLoader._setReferrerPolicy(K));const ie=yC(p);_e(ie)&&Lr.DOM.styleSheetLoader._setContentCssCors(ie),Na.languageLoad=E("language_load"),Na.baseURL=d.baseURL,this.setDirty(!1),this.documentBaseURI=new u1(Qp(p),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=bC(p),this.hasVisual=qv(p),this.shortcuts=new C$(this),this.editorCommands=new m$(this),qQ(this);const ue=E("cache_suffix");ue&&(Kn.cacheSuffix=ue.replace(/^[\?\&]+/,"")),this.ui={registry:bee(),styleSheetLoader:void 0,show:ft,hide:ft,setEnabled:ft,isEnabled:xt},this.mode=hee(p),d.dispatch("SetupEditor",{editor:this});const pe=vh(p);be(pe)&&pe.call(p,p)}render(){nQ(this)}focus(i){this.execCommand("mceFocus",!1,i)}hasFocus(){return Nw(this)}translate(i){return Yf.translate(i)}getParam(i,l,d){const p=this.options;return p.isRegistered(i)||(_e(d)?p.register(i,{processor:d,default:l}):p.register(i,{processor:xt,default:l})),!p.isSet(i)&&!ye(l)?l:p.get(i)}hasPlugin(i,l){return Ct(Zv(this),i)?l?Qw.get(i)!==void 0:!0:!1}nodeChanged(i){this._nodeChangeDispatcher.nodeChanged(i)}addCommand(i,l,d){this.editorCommands.addCommand(i,l,d)}addQueryStateHandler(i,l,d){this.editorCommands.addQueryStateHandler(i,l,d)}addQueryValueHandler(i,l,d){this.editorCommands.addQueryValueHandler(i,l,d)}addShortcut(i,l,d,p){this.shortcuts.add(i,l,d,p)}execCommand(i,l,d,p){return this.editorCommands.execCommand(i,l,d,p)}queryCommandState(i){return this.editorCommands.queryCommandState(i)}queryCommandValue(i){return this.editorCommands.queryCommandValue(i)}queryCommandSupported(i){return this.editorCommands.queryCommandSupported(i)}show(){const i=this;i.hidden&&(i.hidden=!1,i.inline?i.getBody().contentEditable="true":(p_.show(i.getContainer()),p_.hide(i.id)),i.load(),i.dispatch("show"))}hide(){const i=this;i.hidden||(i.save(),i.inline?(i.getBody().contentEditable="false",i===i.editorManager.focusedEditor&&(i.editorManager.focusedEditor=null)):(p_.hide(i.getContainer()),p_.setStyle(i.id,"display",i.orgDisplay)),i.hidden=!0,i.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(i,l){this.dispatch("ProgressState",{state:i,time:l})}load(i={}){const l=this,d=l.getElement();if(l.removed)return"";if(d){const p={...i,load:!0},w=V1(d)?d.value:d.innerHTML,E=l.setContent(w,p);return p.no_events||l.dispatch("LoadContent",{...p,element:d}),E}else return""}save(i={}){const l=this;let d=l.getElement();if(!d||!l.initialized||l.removed)return"";const p={...i,save:!0,element:d};let w=l.getContent(p);const E={...p,content:w};if(E.no_events||l.dispatch("SaveContent",E),E.format==="raw"&&l.dispatch("RawSaveContent",E),w=E.content,V1(d))d.value=w;else{(i.is_removing||!l.inline)&&(d.innerHTML=w);const R=p_.getParent(l.id,"form");R&&vee(R.elements,B=>B.name===l.id?(B.value=w,!1):!0)}return E.element=p.element=d=null,E.set_dirty!==!1&&l.setDirty(!1),w}setContent(i,l){return IT(this,i,l)}getContent(i){return BZ(this,i)}insertContent(i,l){l&&(i=S$({content:i},l)),this.execCommand("mceInsertContent",!1,i)}resetContent(i){i===void 0?IT(this,this.startContent,{format:"raw"}):IT(this,i),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(i){const l=!this.isNotDirty;this.isNotDirty=!i,i&&i!==l&&this.dispatch("dirty")}getContainer(){const i=this;return i.container||(i.container=i.editorContainer||p_.get(i.id+"_parent")),i.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=p_.get(this.id)),this.targetElm}getWin(){const i=this;if(!i.contentWindow){const l=i.iframeElement;l&&(i.contentWindow=l.contentWindow)}return i.contentWindow}getDoc(){const i=this;if(!i.contentDocument){const l=i.getWin();l&&(i.contentDocument=l.document)}return i.contentDocument}getBody(){var i,l;const d=this.getDoc();return(l=(i=this.bodyElement)!==null&&i!==void 0?i:d==null?void 0:d.body)!==null&&l!==void 0?l:null}convertURL(i,l,d){const p=this,w=p.options.get,E=_C(p);return be(E)?E.call(p,i,d,!0,l):!w("convert_urls")||d==="link"||ne(d)&&d.nodeName==="LINK"||i.indexOf("file:")===0||i.length===0?i:w("relative_urls")?p.documentBaseURI.toRelative(i):(i=p.documentBaseURI.toAbsolute(i,w("remove_script_host")),i)}addVisual(i){fQ(this,i)}setEditableRoot(i){Ore(this,i)}hasEditableRoot(){return oQ(this)}remove(){c5(this)}destroy(i){KZ(this,i)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const b_=Lr.DOM,x0=hn.each;let yee=!1,hD,Oh=[];const mD=n=>{const i=n.type;x0(lv.get(),l=>{switch(i){case"scroll":l.dispatch("ScrollWindow",n);break;case"resize":l.dispatch("ResizeWindow",n);break}})},k$=n=>{if(n!==yee){const i=Lr.DOM;n?(i.bind(window,"resize",mD),i.bind(window,"scroll",mD)):(i.unbind(window,"resize",mD),i.unbind(window,"scroll",mD)),yee=n}},wee=n=>{const i=Oh;return Oh=yt(Oh,l=>n!==l),lv.activeEditor===n&&(lv.activeEditor=Oh.length>0?Oh[0]:null),lv.focusedEditor===n&&(lv.focusedEditor=null),i.length!==Oh.length},_ee=n=>{n&&n.initialized&&!(n.getContainer()||n.getBody()).parentNode&&(wee(n),n.unbindAllNativeEvents(),n.destroy(!0),n.removed=!0)},wm=document.compatMode!=="CSS1Compat",lv={...$6,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"6",minorVersion:"7.0",releaseDate:"2023-08-30",i18n:Yf,activeEditor:null,focusedEditor:null,setup(){const n=this;let i="",l="",d=u1.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(d)&&(d=d.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(d)||(d+="/"));const p=window.tinymce||window.tinyMCEPreInit;if(p)i=p.base||p.baseURL,l=p.suffix;else{const w=document.getElementsByTagName("script");for(let E=0;E<w.length;E++){const R=w[E].src||"";if(R==="")continue;const B=R.substring(R.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(R)){B.indexOf(".min")!==-1&&(l=".min"),i=R.substring(0,R.lastIndexOf("/"));break}}if(!i&&document.currentScript){const E=document.currentScript.src;E.indexOf(".min")!==-1&&(l=".min"),i=E.substring(0,E.lastIndexOf("/"))}}n.baseURL=new u1(d).toAbsolute(i),n.documentBaseURL=d,n.baseURI=new u1(n.baseURL),n.suffix=l,_U(n)},overrideDefaults(n){const i=n.base_url;i&&this._setBaseUrl(i);const l=n.suffix;l&&(this.suffix=l),this.defaultOptions=n;const d=n.plugin_base_urls;d!==void 0&&an(d,(p,w)=>{Na.PluginManager.urls[w]=p})},init(n){const i=this;let l;const d=hn.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),p=(ie,ue)=>ie.inline&&ue.tagName.toLowerCase()in d,w=ie=>{let ue=ie.id;return ue||(ue=go(ie,"name").filter(pe=>!b_.get(pe)).getOrThunk(b_.uniqueId),ie.setAttribute("id",ue)),ue},E=ie=>{const ue=n[ie];if(!!ue)return ue.apply(i,[])},R=ie=>Kn.browser.isIE()||Kn.browser.isEdge()?(VT("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/6/support/#supportedwebbrowsers"),[]):wm?(VT("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):F(ie.selector)?b_.select(ie.selector):_e(ie.target)?[ie.target]:[];let B=ie=>{l=ie};const K=()=>{let ie=0;const ue=[];let pe;const Be=(Ze,Oe,ze)=>{const ht=new dD(Ze,Oe,i);ue.push(ht),ht.on("init",()=>{++ie===pe.length&&B(ue)}),ht.targetElm=ht.targetElm||ze,ht.render()};b_.unbind(window,"ready",K),E("onpageload"),pe=na(R(n)),hn.each(pe,Ze=>{_ee(i.get(Ze.id))}),pe=hn.grep(pe,Ze=>!i.get(Ze.id)),pe.length===0?B([]):x0(pe,Ze=>{p(n,Ze)?VT("Could not initialize inline editor on invalid inline target element",Ze):Be(w(Ze),n,Ze)})};return b_.bind(window,"ready",K),new Promise(ie=>{l?ie(l):B=ue=>{ie(ue)}})},get(n){return arguments.length===0?Oh.slice(0):F(n)?Jn(Oh,i=>i.id===n).getOr(null):tt(n)&&Oh[n]?Oh[n]:null},add(n){const i=this,l=i.get(n.id);return l===n||(l===null&&Oh.push(n),k$(!0),i.activeEditor=n,i.dispatch("AddEditor",{editor:n}),hD||(hD=d=>{const p=i.dispatch("BeforeUnload");if(p.returnValue)return d.preventDefault(),d.returnValue=p.returnValue,p.returnValue},window.addEventListener("beforeunload",hD))),n},createEditor(n,i){return this.add(new dD(n,i,this))},remove(n){const i=this;let l;if(!n){for(let d=Oh.length-1;d>=0;d--)i.remove(Oh[d]);return}if(F(n)){x0(b_.select(n),d=>{l=i.get(d.id),l&&i.remove(l)});return}return l=n,J(i.get(l.id))?null:(wee(l)&&i.dispatch("RemoveEditor",{editor:l}),Oh.length===0&&window.removeEventListener("beforeunload",hD),l.remove(),k$(Oh.length>0),l)},execCommand(n,i,l){var d;const p=this,w=ne(l)?(d=l.id)!==null&&d!==void 0?d:l.index:l;switch(n){case"mceAddEditor":{if(!p.get(w)){const E=l.options;new dD(w,E,p).render()}return!0}case"mceRemoveEditor":{const E=p.get(w);return E&&E.remove(),!0}case"mceToggleEditor":{const E=p.get(w);return E?(E.isHidden()?E.show():E.hide(),!0):(p.execCommand("mceAddEditor",!1,l),!0)}}return p.activeEditor?p.activeEditor.execCommand(n,i,l):!1},triggerSave:()=>{x0(Oh,n=>{n.save()})},addI18n:(n,i)=>{Yf.add(n,i)},translate:n=>Yf.translate(n),setActive(n){const i=this.activeEditor;this.activeEditor!==n&&(i&&i.dispatch("deactivate",{relatedTarget:n}),n.dispatch("activate",{relatedTarget:i})),this.activeEditor=n},_setBaseUrl(n){this.baseURL=new u1(this.documentBaseURL).toAbsolute(n.replace(/\/+$/,"")),this.baseURI=new u1(this.baseURL)}};lv.setup();const Cee=(()=>{const n=mh(),i=w=>({items:w,types:gs(w),getType:E=>go(w,E).getOrUndefined()}),l=w=>{n.set(w)},d=()=>n.get().getOrUndefined(),p=n.clear;return{FakeClipboardItem:i,write:l,read:d,clear:p}})(),E$=Math.min,jS=Math.max,gD=Math.round,x$=(n,i,l)=>{let d=i.x,p=i.y;const w=n.w,E=n.h,R=i.w,B=i.h,K=(l||"").split("");return K[0]==="b"&&(p+=B),K[1]==="r"&&(d+=R),K[0]==="c"&&(p+=gD(B/2)),K[1]==="c"&&(d+=gD(R/2)),K[3]==="b"&&(p-=E),K[4]==="r"&&(d-=w),K[3]==="c"&&(p-=gD(E/2)),K[4]==="c"&&(d-=gD(w/2)),ZS(d,p,w,E)},See=(n,i,l,d)=>{for(let p=0;p<d.length;p++){const w=x$(n,i,d[p]);if(w.x>=l.x&&w.x+w.w<=l.w+l.x&&w.y>=l.y&&w.y+w.h<=l.h+l.y)return d[p]}return null},A$=(n,i,l)=>ZS(n.x-i,n.y-l,n.w+i*2,n.h+l*2),kee=(n,i)=>{const l=jS(n.x,i.x),d=jS(n.y,i.y),p=E$(n.x+n.w,i.x+i.w),w=E$(n.y+n.h,i.y+i.h);return p-l<0||w-d<0?null:ZS(l,d,p-l,w-d)},Eee=(n,i,l)=>{let d=n.x,p=n.y,w=n.x+n.w,E=n.y+n.h;const R=i.x+i.w,B=i.y+i.h,K=jS(0,i.x-d),ie=jS(0,i.y-p),ue=jS(0,w-R),pe=jS(0,E-B);return d+=K,p+=ie,l&&(w+=K,E+=ie,d-=ue,p-=pe),w-=ue,E-=pe,ZS(d,p,w-d,E-p)},ZS=(n,i,l,d)=>({x:n,y:i,w:l,h:d}),xee={inflate:A$,relativePosition:x$,findBestRelativePosition:See,intersect:kee,clamp:Eee,create:ZS,fromClientRect:n=>ZS(n.left,n.top,n.width,n.height)},Aee=(n,i,l=1e3)=>{let d=!1,p=null;const w=K=>(...ie)=>{d||(d=!0,p!==null&&(clearTimeout(p),p=null),K.apply(null,ie))},E=w(n),R=w(i);return{start:(...K)=>{!d&&p===null&&(p=setTimeout(()=>R.apply(null,K),l))},resolve:E,reject:R}},qS=(()=>{const n={},i={};return{load:(w,E)=>{const R=`Script at URL "${E}" failed to load`,B=`Script at URL "${E}" did not call \`tinymce.Resource.add('${w}', data)\` within 1 second`;if(n[w]!==void 0)return n[w];{const K=new Promise((ie,ue)=>{const pe=Aee(ie,ue);i[w]=pe.resolve,tm.ScriptLoader.loadScript(E).then(()=>pe.start(B),()=>pe.reject(R))});return n[w]=K,K}},add:(w,E)=>{i[w]!==void 0&&(i[w](E),delete i[w]),n[w]=Promise.resolve(E)},unload:w=>{delete n[w]}}})(),Tee=()=>(()=>{let n={},i=[];const l={getItem:d=>{const p=n[d];return p||null},setItem:(d,p)=>{i.push(d),n[d]=String(p)},key:d=>i[d],removeItem:d=>{i=i.filter(p=>p===d),delete n[d]},clear:()=>{i=[],n={}},length:0};return Object.defineProperty(l,"length",{get:()=>i.length,configurable:!1,enumerable:!1}),l})();let _A;try{const n="__storage_test__";_A=window.localStorage,_A.setItem(n,n),_A.removeItem(n)}catch{_A=Tee()}var Dee=_A;const Oee={geom:{Rect:xee},util:{Delay:mg,Tools:hn,VK:eo,URI:u1,EventDispatcher:H6,Observable:$6,I18n:Yf,LocalStorage:Dee,ImageUploader:UL},dom:{EventUtils:em,TreeWalker:pi,TextSeeker:op,DOMUtils:Lr,ScriptLoader:tm,RangeUtils:v,Serializer:d1,StyleSheetLoader:Ev,ControlSelection:jE,BookmarkManager:uy,Selection:i5,Event:em.Event},html:{Styles:Tv,Entities:Yg,Node:Hd,Schema:dh,DomParser:yS,Writer:pM,Serializer:Pw},Env:Kn,AddOnManager:Na,Annotator:o1,Formatter:GL,UndoManager:v5,EditorCommands:m$,WindowManager:Nx,NotificationManager:Jw,EditorObservable:V6,Shortcuts:C$,Editor:dD,FocusManager:AI,EditorManager:lv,DOM:Lr.DOM,ScriptLoader:tm.ScriptLoader,PluginManager:Qw,ThemeManager:Ty,ModelManager:SS,IconManager:LT,Resource:qS,FakeClipboard:Cee,trim:hn.trim,isArray:hn.isArray,is:hn.is,toArray:hn.toArray,makeMap:hn.makeMap,each:hn.each,map:hn.map,grep:hn.grep,inArray:hn.inArray,extend:hn.extend,walk:hn.walk,resolve:hn.resolve,explode:hn.explode,_addCacheSuffix:hn._addCacheSuffix},Y6=hn.extend(lv,Oee),pD=n=>{try{s.exports=n}catch{}};(n=>{window.tinymce=n,window.tinyMCE=n})(Y6),pD(Y6)})()})(ome);const lCe=ome.exports;(function(){var s=tinymce.util.Tools.resolve("tinymce.ModelManager");const e=(v,k,D)=>{var P;return D(v,k.prototype)?!0:((P=v.constructor)===null||P===void 0?void 0:P.name)===k.name},t=v=>{const k=typeof v;return v===null?"null":k==="object"&&Array.isArray(v)?"array":k==="object"&&e(v,String,(D,P)=>P.isPrototypeOf(D))?"string":k},r=v=>k=>t(k)===v,a=v=>k=>typeof k===v,u=v=>k=>v===k,f=r("string"),h=r("object"),g=r("array"),y=u(null),C=a("boolean"),A=u(void 0),O=v=>v==null,N=v=>!O(v),L=a("function"),j=a("number"),z=()=>{},q=(v,k)=>(...D)=>v(k.apply(null,D)),ee=(v,k)=>D=>v(k(D)),F=v=>()=>v,ne=v=>v,oe=(v,k)=>v===k;function re(v,...k){return(...D)=>{const P=k.concat(D);return v.apply(null,P)}}const J=v=>k=>!v(k),we=v=>()=>{throw new Error(v)},ye=v=>v(),De=F(!1),_e=F(!0);class be{constructor(k,D){this.tag=k,this.value=D}static some(k){return new be(!0,k)}static none(){return be.singletonNone}fold(k,D){return this.tag?D(this.value):k()}isSome(){return this.tag}isNone(){return!this.tag}map(k){return this.tag?be.some(k(this.value)):be.none()}bind(k){return this.tag?k(this.value):be.none()}exists(k){return this.tag&&k(this.value)}forall(k){return!this.tag||k(this.value)}filter(k){return!this.tag||k(this.value)?this:be.none()}getOr(k){return this.tag?this.value:k}or(k){return this.tag?this:k}getOrThunk(k){return this.tag?this.value:k()}orThunk(k){return this.tag?this:k()}getOrDie(k){if(this.tag)return this.value;throw new Error(k!=null?k:"Called getOrDie on None")}static from(k){return N(k)?be.some(k):be.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(k){this.tag&&k(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}be.singletonNone=new be(!1);const tt=Array.prototype.slice,Qe=Array.prototype.indexOf,ft=Array.prototype.push,V=(v,k)=>Qe.call(v,k),mt=(v,k)=>V(v,k)>-1,nt=(v,k)=>{for(let D=0,P=v.length;D<P;D++){const Z=v[D];if(k(Z,D))return!0}return!1},Ot=(v,k)=>{const D=[];for(let P=0;P<v;P++)D.push(k(P));return D},Tt=(v,k)=>{const D=v.length,P=new Array(D);for(let Z=0;Z<D;Z++){const te=v[Z];P[Z]=k(te,Z)}return P},He=(v,k)=>{for(let D=0,P=v.length;D<P;D++){const Z=v[D];k(Z,D)}},ct=(v,k)=>{for(let D=v.length-1;D>=0;D--){const P=v[D];k(P,D)}},dn=(v,k)=>{const D=[],P=[];for(let Z=0,te=v.length;Z<te;Z++){const ge=v[Z];(k(ge,Z)?D:P).push(ge)}return{pass:D,fail:P}},kt=(v,k)=>{const D=[];for(let P=0,Z=v.length;P<Z;P++){const te=v[P];k(te,P)&&D.push(te)}return D},xn=(v,k,D)=>(ct(v,(P,Z)=>{D=k(D,P,Z)}),D),We=(v,k,D)=>(He(v,(P,Z)=>{D=k(D,P,Z)}),D),xt=(v,k,D)=>{for(let P=0,Z=v.length;P<Z;P++){const te=v[P];if(k(te,P))return be.some(te);if(D(te,P))break}return be.none()},he=(v,k)=>xt(v,k,De),es=(v,k)=>{for(let D=0,P=v.length;D<P;D++){const Z=v[D];if(k(Z,D))return be.some(D)}return be.none()},ho=v=>{const k=[];for(let D=0,P=v.length;D<P;++D){if(!g(v[D]))throw new Error("Arr.flatten item "+D+" was not an array, input: "+v);ft.apply(k,v[D])}return k},ao=(v,k)=>ho(Tt(v,k)),xo=(v,k)=>{for(let D=0,P=v.length;D<P;++D){const Z=v[D];if(k(Z,D)!==!0)return!1}return!0},Yo=v=>{const k=tt.call(v,0);return k.reverse(),k},Ct=(v,k)=>{const D={};for(let P=0,Z=v.length;P<Z;P++){const te=v[P];D[String(te)]=k(te,P)}return D},Jt=(v,k)=>{const D=tt.call(v,0);return D.sort(k),D},Et=(v,k)=>k>=0&&k<v.length?be.some(v[k]):be.none(),Pe=v=>Et(v,0),Ut=v=>Et(v,v.length-1),gn=(v,k)=>{for(let D=0;D<v.length;D++){const P=k(v[D],D);if(P.isSome())return P}return be.none()},yt=Object.keys,Yt=Object.hasOwnProperty,bn=(v,k)=>{const D=yt(v);for(let P=0,Z=D.length;P<Z;P++){const te=D[P],ge=v[te];k(ge,te)}},rs=(v,k)=>Jn(v,(D,P)=>({k:P,v:k(D,P)})),Jn=(v,k)=>{const D={};return bn(v,(P,Z)=>{const te=k(P,Z);D[te.k]=te.v}),D},ds=v=>(k,D)=>{v[D]=k},Or=(v,k,D,P)=>{bn(v,(Z,te)=>{(k(Z,te)?D:P)(Z,te)})},Ns=(v,k)=>{const D={};return Or(v,k,ds(D),z),D},Js=(v,k)=>{const D=[];return bn(v,(P,Z)=>{D.push(k(P,Z))}),D},Zs=v=>Js(v,ne),ba=(v,k)=>ar(v,k)?be.from(v[k]):be.none(),ar=(v,k)=>Yt.call(v,k),Ps=(v,k)=>ar(v,k)&&v[k]!==void 0&&v[k]!==null,Zr=v=>{for(const k in v)if(Yt.call(v,k))return!1;return!0},No=typeof window<"u"?window:Function("return this;")(),Mo=(v,k)=>{let D=k!=null?k:No;for(let P=0;P<v.length&&D!==void 0&&D!==null;++P)D=D[v[P]];return D},Mr=(v,k)=>{const D=v.split(".");return Mo(D,k)},Ls=(v,k)=>Mr(v,k),na=(v,k)=>{const D=Ls(v,k);if(D==null)throw new Error(v+" not available on this browser");return D},gs=Object.getPrototypeOf,va=v=>na("HTMLElement",v),an=v=>{const k=Mr("ownerDocument.defaultView",v);return h(v)&&(va(k).prototype.isPrototypeOf(v)||/^HTML\w*Element$/.test(gs(v).constructor.name))},ps=8,Ii=9,$e=11,Je=1,At=3,Wt=v=>v.dom.nodeName.toLowerCase(),Wn=v=>v.dom.nodeType,lo=v=>k=>Wn(k)===v,go=v=>Wn(v)===ps||Wt(v)==="#comment",cn=v=>ts(v)&&an(v.dom),ts=lo(Je),wo=lo(At),cs=lo(Ii),_r=lo($e),Ir=v=>k=>ts(k)&&Wt(k)===v,Vs=(v,k,D)=>{if(f(D)||C(D)||j(D))v.setAttribute(k,D+"");else throw console.error("Invalid call to Attribute.set. Key ",k,":: Value ",D,":: Element ",v),new Error("Attribute value was not simple")},Ur=(v,k,D)=>{Vs(v.dom,k,D)},Bi=(v,k)=>{const D=v.dom;bn(k,(P,Z)=>{Vs(D,Z,P)})},Ba=(v,k)=>{bn(k,(D,P)=>{D.fold(()=>{qe(v,P)},Z=>{Vs(v.dom,P,Z)})})},hi=(v,k)=>{const D=v.dom.getAttribute(k);return D===null?void 0:D},Ge=(v,k)=>be.from(hi(v,k)),qe=(v,k)=>{v.dom.removeAttribute(k)},It=v=>We(v.dom.attributes,(k,D)=>(k[D.name]=D.value,k),{}),jt=(v,k)=>{const P=(k||document).createElement("div");if(P.innerHTML=v,!P.hasChildNodes()||P.childNodes.length>1){const Z="HTML does not have a single root node";throw console.error(Z,v),new Error(Z)}return qo(P.childNodes[0])},co=(v,k)=>{const P=(k||document).createElement(v);return qo(P)},Bo=(v,k)=>{const P=(k||document).createTextNode(v);return qo(P)},qo=v=>{if(v==null)throw new Error("Node cannot be null or undefined");return{dom:v}},it={fromHtml:jt,fromTag:co,fromText:Bo,fromDom:qo,fromPoint:(v,k,D)=>be.from(v.dom.elementFromPoint(k,D)).map(qo)},Wo=(v,k)=>{const D=v.dom;if(D.nodeType!==Je)return!1;{const P=D;if(P.matches!==void 0)return P.matches(k);if(P.msMatchesSelector!==void 0)return P.msMatchesSelector(k);if(P.webkitMatchesSelector!==void 0)return P.webkitMatchesSelector(k);if(P.mozMatchesSelector!==void 0)return P.mozMatchesSelector(k);throw new Error("Browser lacks native selectors")}},Di=v=>v.nodeType!==Je&&v.nodeType!==Ii&&v.nodeType!==$e||v.childElementCount===0,oa=(v,k)=>{const D=k===void 0?document:k.dom;return Di(D)?[]:Tt(D.querySelectorAll(v),it.fromDom)},ua=(v,k)=>{const D=k===void 0?document:k.dom;return Di(D)?be.none():be.from(D.querySelector(v)).map(it.fromDom)},ur=(v,k)=>v.dom===k.dom,Dc=(v,k)=>{const D=v.dom,P=k.dom;return D===P?!1:D.contains(P)},gc=Wo,Xa=v=>it.fromDom(v.dom.ownerDocument),fa=v=>cs(v)?v:Xa(v),Qs=v=>it.fromDom(fa(v).dom.documentElement),xr=v=>it.fromDom(fa(v).dom.defaultView),Ki=v=>be.from(v.dom.parentNode).map(it.fromDom),fl=v=>be.from(v.dom.parentElement).map(it.fromDom),pc=(v,k)=>{const D=L(k)?k:De;let P=v.dom;const Z=[];for(;P.parentNode!==null&&P.parentNode!==void 0;){const te=P.parentNode,ge=it.fromDom(te);if(Z.push(ge),D(ge)===!0)break;P=te}return Z},Zc=v=>be.from(v.dom.previousSibling).map(it.fromDom),gu=v=>be.from(v.dom.nextSibling).map(it.fromDom),gr=v=>Tt(v.dom.childNodes,it.fromDom),Ja=(v,k)=>{const D=v.dom.childNodes;return be.from(D[k]).map(it.fromDom)},pu=v=>Ja(v,0),qc=(v,k)=>{Ki(v).each(P=>{P.dom.insertBefore(k.dom,v.dom)})},Vl=(v,k)=>{gu(v).fold(()=>{Ki(v).each(Z=>{Ar(Z,k)})},P=>{qc(P,k)})},xa=(v,k)=>{pu(v).fold(()=>{Ar(v,k)},P=>{v.dom.insertBefore(k.dom,P.dom)})},Ar=(v,k)=>{v.dom.appendChild(k.dom)},Rm=(v,k,D)=>{Ja(v,D).fold(()=>{Ar(v,k)},P=>{qc(P,k)})},pf=(v,k)=>{qc(v,k),Ar(k,v)},Cr=(v,k)=>{He(k,(D,P)=>{const Z=P===0?v:k[P-1];Vl(Z,D)})},La=(v,k)=>{He(k,D=>{Ar(v,D)})},sa=v=>{v.dom.textContent="",He(gr(v),k=>{Yi(k)})},Yi=v=>{const k=v.dom;k.parentNode!==null&&k.parentNode.removeChild(k)},bu=v=>{const k=gr(v);k.length>0&&Cr(v,k),Yi(v)},Oc=(v,k)=>it.fromDom(v.dom.cloneNode(k)),Fa=v=>Oc(v,!1),Mc=v=>Oc(v,!0),bc=(v,k)=>{const D=it.fromTag(k),P=It(v);return Bi(D,P),D},gd=(v,k)=>{const D=bc(v,k),P=gr(Mc(v));return La(D,P),D},Lf=(v,k)=>{const D=bc(v,k);Vl(v,D);const P=gr(v);return La(D,P),Yi(v),D},vu=["tfoot","thead","tbody","colgroup"],Ul=v=>mt(vu,v),Rc=(v,k)=>({rows:v,columns:k}),bf=(v,k)=>({row:v,column:k}),Gc=(v,k,D)=>({element:v,rowspan:k,colspan:D}),pd=(v,k,D,P)=>({element:v,rowspan:k,colspan:D,isNew:P}),Ae=(v,k,D,P,Z,te)=>({element:v,rowspan:k,colspan:D,row:P,column:Z,isLocked:te}),et=(v,k,D)=>({element:v,cells:k,section:D}),gt=(v,k,D,P)=>({element:v,cells:k,section:D,isNew:P}),Pt=(v,k,D)=>({element:v,isNew:k,isLocked:D}),vn=(v,k,D,P)=>({element:v,cells:k,section:D,isNew:P}),Ro=(v,k,D,P)=>({startRow:v,startCol:k,finishRow:D,finishCol:P}),Rr=(v,k,D)=>({element:v,colspan:k,column:D}),vs=(v,k)=>({element:v,columns:k}),is=v=>_r(v)&&N(v.dom.host),ki=L(Element.prototype.attachShadow)&&L(Node.prototype.getRootNode),qs=F(ki),Li=ki?v=>it.fromDom(v.dom.getRootNode()):fa,yu=v=>{const k=Li(v);return is(k)?be.some(k):be.none()},bd=v=>it.fromDom(v.dom.host),Kn=v=>{if(qs()&&N(v.target)){const k=it.fromDom(v.target);if(ts(k)&&Nm(k)&&v.composed&&v.composedPath){const D=v.composedPath();if(D)return Pe(D)}}return be.from(v.target)},Nm=v=>N(v.dom.shadowRoot),Fi=v=>{const k=wo(v)?v.dom.parentNode:v.dom;if(k==null||k.ownerDocument===null)return!1;const D=k.ownerDocument;return yu(it.fromDom(k)).fold(()=>D.body.contains(k),ee(Fi,bd))},de=()=>Me(it.fromDom(document)),Me=v=>{const k=v.dom.body;if(k==null)throw new Error("Body is not available yet");return it.fromDom(k)},je=(v,k,D)=>kt(pc(v,D),k),Bt=(v,k)=>kt(gr(v),k),Ln=(v,k)=>{let D=[];return He(gr(v),P=>{k(P)&&(D=D.concat([P])),D=D.concat(Ln(P,k))}),D},Xo=(v,k,D)=>je(v,P=>Wo(P,k),D),no=(v,k)=>Bt(v,D=>Wo(D,k)),mi=(v,k)=>oa(k,v);var hn=(v,k,D,P,Z)=>v(D,P)?be.some(D):L(Z)&&Z(D)?be.none():k(D,P,Z);const qr=(v,k,D)=>{let P=v.dom;const Z=L(D)?D:De;for(;P.parentNode;){P=P.parentNode;const te=it.fromDom(P);if(k(te))return be.some(te);if(Z(te))break}return be.none()},Nl=(v,k,D)=>hn((Z,te)=>te(Z),qr,v,k,D),Xi=(v,k)=>{const D=Z=>k(it.fromDom(Z));return he(v.dom.childNodes,D).map(it.fromDom)},ni=(v,k)=>{const D=P=>{for(let Z=0;Z<P.childNodes.length;Z++){const te=it.fromDom(P.childNodes[Z]);if(k(te))return be.some(te);const ge=D(P.childNodes[Z]);if(ge.isSome())return ge}return be.none()};return D(v.dom)},vf=(v,k,D)=>qr(v,P=>Wo(P,k),D),Ss=(v,k)=>Xi(v,D=>Wo(D,k)),Kc=(v,k)=>ua(k,v),Ei=(v,k,D)=>hn((Z,te)=>Wo(Z,te),vf,v,k,D),sc=(v,k,D=oe)=>v.exists(P=>D(P,k)),Oi=v=>{const k=[],D=P=>{k.push(P)};for(let P=0;P<v.length;P++)v[P].each(D);return k},Ff=(v,k)=>v!=null?k(v):be.none(),da=(v,k)=>v?be.some(k):be.none(),Hf=(v,k,D)=>k===""||v.length>=k.length&&v.substr(D,D+k.length)===k,fr=(v,k,D=0,P)=>{const Z=v.indexOf(k,D);return Z!==-1?A(P)?!0:Z+k.length<=P:!1},zu=(v,k)=>Hf(v,k,0),Vu=(v,k)=>Hf(v,k,v.length-k.length),$f=(v=>k=>k.replace(v,""))(/^\s+|\s+$/g),jd=v=>v.length>0,Xr=v=>{const k=parseFloat(v);return isNaN(k)?be.none():be.some(k)},Ji=v=>v.style!==void 0&&L(v.style.getPropertyValue),Ha=(v,k,D)=>{if(!f(D))throw console.error("Invalid call to CSS.set. Property ",k,":: Value ",D,":: Element ",v),new Error("CSS value must be a string: "+D);Ji(v)&&v.style.setProperty(k,D)},U0=(v,k)=>{Ji(v)&&v.style.removeProperty(k)},xi=(v,k,D)=>{const P=v.dom;Ha(P,k,D)},_l=(v,k)=>{const D=v.dom;bn(k,(P,Z)=>{Ha(D,Z,P)})},Qa=(v,k)=>{const D=v.dom,Z=window.getComputedStyle(D).getPropertyValue(k);return Z===""&&!Fi(v)?Ng(D,k):Z},Ng=(v,k)=>Ji(v)?v.style.getPropertyValue(k):"",zf=(v,k)=>{const D=v.dom,P=Ng(D,k);return be.from(P).filter(Z=>Z.length>0)},yc=(v,k)=>{const D=v.dom;U0(D,k),sc(Ge(v,"style").map($f),"")&&qe(v,"style")},yf=(v,k)=>{const D=v.dom,P=k.dom;Ji(D)&&Ji(P)&&(P.style.cssText=D.style.cssText)},Tr=(v,k,D=0)=>Ge(v,k).map(P=>parseInt(P,10)).getOr(D),Uu=(v,k)=>Tr(v,k,1),Pl=v=>Ir("col")(v)?Tr(v,"span",1)>1:Uu(v,"colspan")>1,$a=v=>Uu(v,"rowspan")>1,qi=(v,k)=>parseInt(Qa(v,k),10),Hi=F(10),rc=F(10),Vf=(v,k)=>Zd(v,k,_e),Zd=(v,k,D)=>ao(gr(v),P=>Wo(P,k)?D(P)?[P]:[]:Zd(P,k,D)),Pg=(v,k,D=De)=>{if(D(k))return be.none();if(mt(v,Wt(k)))return be.some(k);const P=Z=>Wo(Z,"table")||D(Z);return vf(k,v.join(","),P)},Pm=(v,k)=>Pg(["td","th"],v,k),Il=v=>Vf(v,"th,td"),Im=v=>Wo(v,"colgroup")?no(v,"col"):ao($h(v),k=>no(k,"col")),el=(v,k)=>Ei(v,"table",k),wf=v=>Vf(v,"tr"),$h=v=>el(v).fold(F([]),k=>no(k,"colgroup")),Wu=(v,k)=>Tt(v,D=>{if(Wt(D)==="colgroup"){const P=Tt(Im(D),Z=>{const te=Tr(Z,"span",1);return Gc(Z,1,te)});return et(D,P,"colgroup")}else{const P=Tt(Il(D),Z=>{const te=Tr(Z,"rowspan",1),ge=Tr(Z,"colspan",1);return Gc(Z,te,ge)});return et(D,P,k(D))}}),zh=v=>Ki(v).map(k=>{const D=Wt(k);return Ul(D)?D:"tbody"}).getOr("tbody"),Nc=v=>{const k=wf(v),P=[...$h(v),...k];return Wu(P,zh)},Vh=(v,k)=>Wu(v,()=>k),_f=v=>{let k=!1,D;return(...P)=>(k||(k=!0,D=v.apply(null,P)),D)},Bp=(v,k,D,P)=>{const Z=v.isiOS()&&/ipad/i.test(D)===!0,te=v.isiOS()&&!Z,ge=v.isiOS()||v.isAndroid(),Ee=ge||P("(pointer:coarse)"),Fe=Z||!te&&ge&&P("(min-device-width:768px)"),ot=te||ge&&!Fe,wt=k.isSafari()&&v.isiOS()&&/safari/i.test(D)===!1,un=!ot&&!Fe&&!wt;return{isiPad:F(Z),isiPhone:F(te),isTablet:F(Fe),isPhone:F(ot),isTouch:F(Ee),isAndroid:v.isAndroid,isiOS:v.isiOS,isWebView:F(wt),isDesktop:F(un)}},Bm=(v,k)=>{for(let D=0;D<v.length;D++){const P=v[D];if(P.test(k))return P}},Uf=(v,k)=>{const D=Bm(v,k);if(!D)return{major:0,minor:0};const P=Z=>Number(k.replace(D,"$"+Z));return Ke(P(1),P(2))},Wl=(v,k)=>{const D=String(k).toLowerCase();return v.length===0?Ig():Uf(v,D)},Ig=()=>Ke(0,0),Ke=(v,k)=>({major:v,minor:k}),qd={nu:Ke,detect:Wl,unknown:Ig},wu=(v,k)=>gn(k.brands,D=>{const P=D.brand.toLowerCase();return he(v,Z=>{var te;return P===((te=Z.brand)===null||te===void 0?void 0:te.toLowerCase())}).map(Z=>({current:Z.name,version:qd.nu(parseInt(D.version,10),0)}))}),Bg=(v,k)=>{const D=String(k).toLowerCase();return he(v,P=>P.search(D))},L1=(v,k)=>Bg(v,k).map(D=>{const P=qd.detect(D.versionRegexes,k);return{current:D.name,version:P}}),Uh=(v,k)=>Bg(v,k).map(D=>{const P=qd.detect(D.versionRegexes,k);return{current:D.name,version:P}}),pt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ln=v=>k=>fr(k,v),nn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:v=>fr(v,"edge/")&&fr(v,"chrome")&&fr(v,"safari")&&fr(v,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,pt],search:v=>fr(v,"chrome")&&!fr(v,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:v=>fr(v,"msie")||fr(v,"trident")},{name:"Opera",versionRegexes:[pt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ln("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ln("firefox")},{name:"Safari",versionRegexes:[pt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:v=>(fr(v,"safari")||fr(v,"mobile/"))&&fr(v,"applewebkit")}],Eo=[{name:"Windows",search:ln("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:v=>fr(v,"iphone")||fr(v,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ln("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ln("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ln("linux"),versionRegexes:[]},{name:"Solaris",search:ln("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ln("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ln("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],er={browsers:F(nn),oses:F(Eo)},Wr="Edge",ai="Chromium",gi="IE",Gd="Opera",W0="Firefox",ya="Safari",vd=()=>Lg({current:void 0,version:qd.unknown()}),Lg=v=>{const k=v.current,D=v.version,P=Z=>()=>k===Z;return{current:k,version:D,isEdge:P(Wr),isChromium:P(ai),isIE:P(gi),isOpera:P(Gd),isFirefox:P(W0),isSafari:P(ya)}},tl={unknown:vd,nu:Lg,edge:F(Wr),chromium:F(ai),ie:F(gi),opera:F(Gd),firefox:F(W0),safari:F(ya)},Aa="Windows",ju="iOS",oi="Android",_u="Linux",ic="macOS",Wh="Solaris",F1="FreeBSD",Kd="ChromeOS",Fg=()=>Yd({current:void 0,version:qd.unknown()}),Yd=v=>{const k=v.current,D=v.version,P=Z=>()=>k===Z;return{current:k,version:D,isWindows:P(Aa),isiOS:P(ju),isAndroid:P(oi),isMacOS:P(ic),isLinux:P(_u),isSolaris:P(Wh),isFreeBSD:P(F1),isChromeOS:P(Kd)}},jl={unknown:Fg,nu:Yd,windows:F(Aa),ios:F(ju),android:F(oi),linux:F(_u),macos:F(ic),solaris:F(Wh),freebsd:F(F1),chromeos:F(Kd)},H1={detect:(v,k,D)=>{const P=er.browsers(),Z=er.oses(),te=k.bind(Fe=>wu(P,Fe)).orThunk(()=>L1(P,v)).fold(tl.unknown,tl.nu),ge=Uh(Z,v).fold(jl.unknown,jl.nu),Ee=Bp(ge,te,v,D);return{browser:te,os:ge,deviceType:Ee}}},Lm=v=>window.matchMedia(v).matches;let Hg=_f(()=>H1.detect(navigator.userAgent,be.from(navigator.userAgentData),Lm));const Zh=()=>Hg(),Xd=(v,k)=>{const D=(Ee,Fe)=>{if(!j(Fe)&&!Fe.match(/^[0-9]+$/))throw new Error(v+".set accepts only positive integer values. Value was "+Fe);const ot=Ee.dom;Ji(ot)&&(ot.style[v]=Fe+"px")},P=Ee=>{const Fe=k(Ee);if(Fe<=0||Fe===null){const ot=Qa(Ee,v);return parseFloat(ot)||0}return Fe},Z=P,te=(Ee,Fe)=>We(Fe,(ot,wt)=>{const un=Qa(Ee,wt),jn=un===void 0?0:parseInt(un,10);return isNaN(jn)?ot:ot+jn},0);return{set:D,get:P,getOuter:Z,aggregate:te,max:(Ee,Fe,ot)=>{const wt=te(Ee,ot);return Fe>wt?Fe-wt:0}}},yd=(v,k)=>Xr(v).getOr(k),si=(v,k,D)=>yd(Qa(v,k),D),li=(v,k,D,P)=>{const Z=si(v,`padding-${D}`,0),te=si(v,`padding-${P}`,0),ge=si(v,`border-${D}-width`,0),Ee=si(v,`border-${P}-width`,0);return k-Z-te-ge-Ee},Bl=(v,k)=>{const D=v.dom,P=D.getBoundingClientRect().width||D.offsetWidth;return k==="border-box"?P:li(v,P,"left","right")},Lp=v=>si(v,"height",v.dom.offsetHeight),X=v=>si(v,"width",v.dom.offsetWidth),le=v=>Bl(v,"content-box"),Se=Xd("width",v=>v.dom.offsetWidth),Ye=v=>Se.get(v),rt=v=>Se.getOuter(v),On=le,wn=X,Go=(v,k,D)=>{const P=v.cells,Z=P.slice(0,k),te=P.slice(k),ge=Z.concat(D).concat(te);return Sr(v,ge)},ns=(v,k,D)=>Go(v,k,[D]),uo=(v,k,D)=>{const P=v.cells;P[k]=D},Sr=(v,k)=>vn(v.element,k,v.section,v.isNew),Zl=(v,k)=>{const D=v.cells,P=Tt(D,k);return vn(v.element,P,v.section,v.isNew)},ra=(v,k)=>v.cells[k],Mi=(v,k)=>ra(v,k).element,Cu=v=>v.cells.length,Ta=v=>{const k=dn(v,D=>D.section==="colgroup");return{rows:k.fail,cols:k.pass}},qh=(v,k,D)=>{const P=Tt(v.cells,D);return vn(k(v.element),P,v.section,!0)},Fm="data-snooker-locked-cols",$i=v=>Ge(v,Fm).bind(k=>be.from(k.match(/\d+/g))).map(k=>Ct(k,_e)),wa=v=>{const k=We(Ta(v).rows,(P,Z)=>(He(Z.cells,(te,ge)=>{te.isLocked&&(P[ge]=!0)}),P),{}),D=Js(k,(P,Z)=>parseInt(Z,10));return Jt(D)},Yc=(v,k)=>v+","+k,Jd=(v,k,D)=>be.from(v.access[Yc(k,D)]),Qi=(v,k,D)=>{const P=j0(v,Z=>D(k,Z.element));return P.length>0?be.some(P[0]):be.none()},j0=(v,k)=>{const D=ao(v.all,P=>P.cells);return kt(D,k)},vv=v=>{const k={};let D=0;return He(v.cells,P=>{const Z=P.colspan;Ot(Z,te=>{const ge=D+te;k[ge]=Rr(P.element,Z,ge)}),D+=Z}),k},Jr=v=>{const k={},D=[],Z=Pe(v).map(Vn=>Vn.element).bind(el).bind($i).getOr({});let te=0,ge=0,Ee=0;const{pass:Fe,fail:ot}=dn(v,Vn=>Vn.section==="colgroup");He(ot,Vn=>{const tn=[];He(Vn.cells,Un=>{let Xt=0;for(;k[Yc(Ee,Xt)]!==void 0;)Xt++;const fo=Ps(Z,Xt.toString()),as=Ae(Un.element,Un.rowspan,Un.colspan,Ee,Xt,fo);for(let Ts=0;Ts<Un.colspan;Ts++)for(let aa=0;aa<Un.rowspan;aa++){const Dl=Ee+aa,bl=Xt+Ts,Nu=Yc(Dl,bl);k[Nu]=as,ge=Math.max(ge,bl+1)}tn.push(as)}),te++,D.push(et(Vn.element,tn,Vn.section)),Ee++});const{columns:wt,colgroups:un}=Ut(Fe).map(Vn=>{const tn=vv(Vn);return{colgroups:[vs(Vn.element,Zs(tn))],columns:tn}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:Rc(te,ge),access:k,all:D,columns:wt,colgroups:un}},xe={fromTable:v=>{const k=Nc(v);return Jr(k)},generate:Jr,getAt:Jd,findItem:Qi,filterItems:j0,justCells:v=>ao(v.all,k=>k.cells),justColumns:v=>Zs(v.columns),hasColumns:v=>yt(v.columns).length>0,getColumnAt:(v,k)=>be.from(v.columns[k])},Cf=(v,k=_e)=>{const D=v.grid,P=Ot(D.columns,ne),Z=Ot(D.rows,ne);return Tt(P,te=>$g(()=>ao(Z,ot=>xe.getAt(v,ot,te).filter(wt=>wt.column===te).toArray()),ot=>ot.colspan===1&&k(ot.element),()=>xe.getAt(v,0,te)))},$g=(v,k,D)=>{const P=v();return he(P,k).orThunk(()=>be.from(P[0]).orThunk(D)).map(ge=>ge.element)},Su=v=>{const k=v.grid,D=Ot(k.rows,ne),P=Ot(k.columns,ne);return Tt(D,Z=>$g(()=>ao(P,Fe=>xe.getAt(v,Z,Fe).filter(ot=>ot.row===Z).fold(F([]),ot=>[ot])),Fe=>Fe.rowspan===1,()=>xe.getAt(v,Z,0)))},ci=(v,k)=>{if(k<0||k>=v.length-1)return be.none();const D=v[k].fold(()=>{const Z=Yo(v.slice(0,k));return gn(Z,(te,ge)=>te.map(Ee=>({value:Ee,delta:ge+1})))},Z=>be.some({value:Z,delta:0})),P=v[k+1].fold(()=>{const Z=v.slice(k+1);return gn(Z,(te,ge)=>te.map(Ee=>({value:Ee,delta:ge+1})))},Z=>be.some({value:Z,delta:1}));return D.bind(Z=>P.map(te=>{const ge=te.delta+Z.delta;return Math.abs(te.value-Z.value)/ge}))},yv=(v,k)=>D=>$1(D)==="rtl"?k:v,$1=v=>Qa(v,"direction")==="rtl"?"rtl":"ltr",Z0=Xd("height",v=>{const k=v.dom;return Fi(v)?k.getBoundingClientRect().height:k.offsetHeight}),jf=v=>Z0.get(v),Hm=v=>Z0.getOuter(v),zg=Lp,wv=(v,k)=>({left:v,top:k,translate:(P,Z)=>wv(v+P,k+Z)}),Sf=wv,h2=v=>{const k=v.getBoundingClientRect();return Sf(k.left,k.top)},ku=(v,k)=>v!==void 0?v:k!==void 0?k:0,Zu=v=>{const k=v.dom.ownerDocument,D=k.body,P=k.defaultView,Z=k.documentElement;if(D===v.dom)return Sf(D.offsetLeft,D.offsetTop);const te=ku(P==null?void 0:P.pageYOffset,Z.scrollTop),ge=ku(P==null?void 0:P.pageXOffset,Z.scrollLeft),Ee=ku(Z.clientTop,D.clientTop),Fe=ku(Z.clientLeft,D.clientLeft);return q0(v).translate(ge-Fe,te-Ee)},q0=v=>{const k=v.dom,P=k.ownerDocument.body;return P===k?Sf(P.offsetLeft,P.offsetTop):Fi(v)?h2(k):Sf(0,0)},G0=(v,k)=>({row:v,y:k}),K0=(v,k)=>({col:v,x:k}),z1=v=>Zu(v).left+rt(v),Zf=v=>Zu(v).left,Y0=(v,k)=>K0(v,Zf(k)),X0=(v,k)=>K0(v,z1(k)),dl=v=>Zu(v).top,m2=(v,k)=>G0(v,dl(k)),pi=(v,k)=>G0(v,dl(k)+Hm(k)),ro=(v,k,D)=>{if(D.length===0)return[];const P=Tt(D.slice(1),(te,ge)=>te.map(Ee=>v(ge,Ee))),Z=D[D.length-1].map(te=>k(D.length-1,te));return P.concat([Z])},_d=v=>-v,Xn={delta:ne,positions:v=>ro(m2,pi,v),edge:dl},eh=yv({delta:ne,edge:Zf,positions:v=>ro(Y0,X0,v)},{delta:_d,edge:z1,positions:v=>ro(X0,Y0,v)}),Pc={delta:(v,k)=>eh(k).delta(v,k),positions:(v,k)=>eh(k).positions(v,k),edge:v=>eh(v).edge(v)},Vg={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Cd=(()=>{const v="[0-9]+",D="[eE]"+("[+-]?"+v),P="\\.",Z=Ee=>`(?:${Ee})?`,ge=`[+-]?(?:${["Infinity",v+P+Z(v)+Z(D),P+v+Z(D),v+Z(D)].join("|")})`;return new RegExp(`^(${ge})(.*)$`)})(),hl=(v,k)=>nt(k,D=>nt(Vg[D],P=>v===P)),Eu=(v,k)=>be.from(Cd.exec(v)).bind(P=>{const Z=Number(P[1]),te=P[2];return hl(te,k)?be.some({value:Z,unit:te}):be.none()}),Fp=/(\d+(\.\d+)?)%/,V1=/(\d+(\.\d+)?)px|em/,_n=Ir("col"),$m=(v,k,D)=>{const P=fl(v).getOrThunk(()=>Me(Xa(v)));return k(v)/D(P)*100},Sd=(v,k)=>{xi(v,"width",k+"px")},th=(v,k)=>{xi(v,"width",k+"%")},qu=(v,k)=>{xi(v,"height",k+"px")},U1=v=>zg(v)+"px",ui=(v,k,D,P)=>{const Z=el(v).map(te=>{const ge=D(te);return Math.floor(k/100*ge)}).getOr(k);return P(v,Z),Z},zi=(v,k,D,P)=>{const Z=parseFloat(v);return Vu(v,"%")&&Wt(k)!=="table"?ui(k,Z,D,P):Z},ha=v=>{const k=U1(v);return k?zi(k,v,jf,qu):jf(v)},xs=(v,k,D)=>{const P=D(v),Z=Uu(v,k);return P/Z},kd=(v,k)=>zf(v,k).orThunk(()=>Ge(v,k).map(D=>D+"px")),Cl=v=>kd(v,"width"),Gu=v=>kd(v,"height"),za=v=>$m(v,Ye,On),_a=v=>_n(v)?Ye(v):wn(v),Hp=v=>xs(v,"rowspan",ha),Qt=v=>Cl(v).bind(D=>Eu(D,["fixed","relative","empty"])),Gr=(v,k,D)=>{xi(v,"width",k+D)},J0=v=>Ye(v)+"px",Ca=v=>$m(v,Ye,On)+"%",Va=v=>Cl(v).exists(k=>Fp.test(k)),Ug=v=>Cl(v).exists(k=>V1.test(k)),Ic=v=>Cl(v).isNone(),qf=F(Fp),Gf=Ir("col"),$p=v=>Cl(v).getOrThunk(()=>_a(v)+"px"),Ll=v=>Gu(v).getOrThunk(()=>Hp(v)+"px"),kr=v=>Tt(xe.justColumns(v),k=>be.from(k.element)),Ua=v=>{const k=Zh().browser,D=k.isChromium()||k.isFirefox();return Gf(v)?D:!0},nh=(v,k,D,P,Z,te)=>v.filter(P).fold(()=>te(ci(D,k)),ge=>Z(ge)),Gl=(v,k,D,P)=>{const Z=Cf(v),te=xe.hasColumns(v)?kr(v):Z,ge=[be.some(Pc.edge(k))].concat(Tt(Pc.positions(Z,k),Fe=>Fe.map(ot=>ot.x))),Ee=J(Pl);return Tt(te,(Fe,ot)=>nh(Fe,ot,ge,Ee,wt=>{if(Ua(wt))return D(wt);{const un=Ff(Z[ot],ne);return nh(un,ot,ge,Ee,jn=>P(be.some(Ye(jn))),P)}},P))},Q0=v=>v.map(k=>k+"px").getOr(""),zm=(v,k)=>Gl(v,k,$p,Q0),W1=(v,k,D)=>Gl(v,k,za,P=>P.fold(()=>D.minCellWidth(),Z=>Z/D.pixelWidth()*100)),Wa=(v,k,D)=>Gl(v,k,_a,P=>P.getOrThunk(D.minCellWidth)),ac=(v,k,D,P,Z)=>{const te=Su(v),ge=[be.some(D.edge(k))].concat(Tt(D.positions(te,k),Ee=>Ee.map(Fe=>Fe.y)));return Tt(te,(Ee,Fe)=>nh(Ee,Fe,ge,J($a),P,Z))},St=(v,k,D)=>ac(v,k,D,Hp,P=>P.getOrThunk(rc)),_c=(v,k,D)=>ac(v,k,D,Ll,Q0),Xc=(v,k)=>()=>Fi(v)?k(v):parseFloat(zf(v,"width").getOr("0")),lc=v=>{const k=Xc(v,Ye),D=F(0);return{width:k,pixelWidth:k,getWidths:(Z,te)=>Wa(Z,v,te),getCellDelta:D,singleColumnWidth:F([0]),minCellWidth:D,setElementWidth:z,adjustTableWidth:z,isRelative:!0,label:"none"}},xu=v=>{const k=Xc(v,Fe=>parseFloat(Ca(Fe))),D=Xc(v,Ye);return{width:k,pixelWidth:D,getWidths:(Fe,ot)=>W1(Fe,v,ot),getCellDelta:Fe=>Fe/D()*100,singleColumnWidth:(Fe,ot)=>[100-Fe],minCellWidth:()=>Hi()/D()*100,setElementWidth:th,adjustTableWidth:Fe=>{const ot=k(),wt=Fe/100*ot,un=ot+wt;th(v,un)},isRelative:!0,label:"percent"}},ja=v=>{const k=Xc(v,Ye);return{width:k,pixelWidth:k,getWidths:(ge,Ee)=>Wa(ge,v,Ee),getCellDelta:ne,singleColumnWidth:(ge,Ee)=>[Math.max(Hi(),ge+Ee)-ge],minCellWidth:Hi,setElementWidth:Sd,adjustTableWidth:ge=>{const Ee=k()+ge;Sd(v,Ee)},isRelative:!1,label:"pixel"}},Za=(v,k)=>qf().exec(k)!==null?xu(v):ja(v),Jc={getTableSize:v=>Cl(v).fold(()=>lc(v),D=>Za(v,D)),pixelSize:ja,percentageSize:xu,noneSize:lc},eb=(v,k,D,P,Z,te)=>({minRow:v,minCol:k,maxRow:D,maxCol:P,allCells:Z,selectedCells:te}),Ho=(v,k)=>{const D=v.grid.columns;let Z=v.grid.rows,te=D,ge=0,Ee=0;const Fe=[],ot=[];return bn(v.access,wt=>{if(Fe.push(wt),k(wt)){ot.push(wt);const un=wt.row,jn=un+wt.rowspan-1,Vn=wt.column,tn=Vn+wt.colspan-1;un<Z?Z=un:jn>ge&&(ge=jn),Vn<te?te=Vn:tn>Ee&&(Ee=tn)}}),eb(Z,te,ge,Ee,Fe,ot)},$=(v,k,D)=>{const P=v[D].element,Z=it.fromTag("td");Ar(Z,it.fromTag("br")),(k?Ar:xa)(P,Z)},G=(v,k,D,P)=>{const Z=kt(v,Ee=>Ee.section!=="colgroup"),te=k.grid.columns,ge=k.grid.rows;for(let Ee=0;Ee<ge;Ee++){let Fe=!1;for(let ot=0;ot<te;ot++)Ee<D.minRow||Ee>D.maxRow||ot<D.minCol||ot>D.maxCol||(xe.getAt(k,Ee,ot).filter(P).isNone()?$(Z,Fe,Ee):Fe=!0)}},ve=(v,k,D,P)=>{bn(D.columns,ge=>{(ge.column<k.minCol||ge.column>k.maxCol)&&Yi(ge.element)});const Z=kt(Vf(v,"tr"),ge=>ge.dom.childElementCount===0);He(Z,Yi),(k.minCol===k.maxCol||k.minRow===k.maxRow)&&He(Vf(v,"th,td"),ge=>{qe(ge,"rowspan"),qe(ge,"colspan")}),qe(v,Fm),qe(v,"data-snooker-col-series"),Jc.getTableSize(v).adjustTableWidth(P)},Te=(v,k,D,P)=>{if(P.minCol===0&&k.grid.columns===P.maxCol+1)return 0;const Z=Wa(k,v,D),te=We(Z,(ot,wt)=>ot+wt,0),Fe=We(Z.slice(P.minCol,P.maxCol+1),(ot,wt)=>ot+wt,0)/te*D.pixelWidth()-D.pixelWidth();return D.getCellDelta(Fe)},at=(v,k)=>{const D=jn=>Wo(jn.element,k),P=Mc(v),Z=Nc(P),te=Jc.getTableSize(v),ge=xe.generate(Z),Ee=Ho(ge,D),Fe="th:not("+k+"),td:not("+k+")",ot=Zd(P,"th,td",jn=>Wo(jn,Fe));He(ot,Yi),G(Z,ge,Ee,D);const wt=xe.fromTable(v),un=Te(v,wt,te,Ee);return ve(P,Ee,ge,un),P},Ft="\xA0",Bn=((v,k)=>{const D=te=>{if(!v(te))throw new Error("Can only get "+k+" value of a "+k+" node");return P(te).getOr("")},P=te=>v(te)?be.from(te.dom.nodeValue):be.none();return{get:D,getOption:P,set:(te,ge)=>{if(!v(te))throw new Error("Can only set raw "+k+" value of a "+k+" node");te.dom.nodeValue=ge}}})(wo,"text"),Uo=v=>Bn.get(v),Jo=v=>Bn.getOption(v),bi=(v,k)=>Bn.set(v,k),tr=v=>Wt(v)==="img"?1:Jo(v).fold(()=>gr(v).length,k=>k.length),br=v=>Jo(v).filter(k=>k.trim().length!==0||k.indexOf(Ft)>-1).isSome(),Bc=v=>cn(v)&&hi(v,"contenteditable")==="false",Qc=["img","br"],Ku=v=>br(v)||mt(Qc,Wt(v))||Bc(v),Ef=v=>ni(v,Ku),oh=v=>sh(v,Ku),sh=(v,k)=>{const D=P=>{const Z=gr(P);for(let te=Z.length-1;te>=0;te--){const ge=Z[te];if(k(ge))return be.some(ge);const Ee=D(ge);if(Ee.isSome())return Ee}return be.none()};return D(v)},lr={scope:["row","col"]},Um=v=>()=>{const k=it.fromTag("td",v.dom);return Ar(k,it.fromTag("br",v.dom)),k},Wm=v=>()=>it.fromTag("col",v.dom),ea=v=>()=>it.fromTag("colgroup",v.dom),eu=v=>()=>it.fromTag("tr",v.dom),zp=(v,k,D)=>{const P=gd(v,k);return bn(D,(Z,te)=>{Z===null?qe(P,te):Ur(P,te,Z)}),P},jm=v=>v,Os=(v,k,D)=>Ef(v).map(Z=>{const te=D.join(","),ge=Xo(Z,te,Ee=>ur(Ee,v));return xn(ge,(Ee,Fe)=>{const ot=Fa(Fe);return Ar(Ee,ot),ot},k)}).getOr(k),Br=(v,k)=>{bn(lr,(D,P)=>Ge(v,P).filter(Z=>mt(D,Z)).each(Z=>Ur(k,P,Z)))},Da=(v,k,D)=>{const P=(ge,Ee)=>{yf(ge.element,Ee),yc(Ee,"height"),ge.colspan!==1&&yc(Ee,"width")},Z=ge=>{const Ee=it.fromTag(Wt(ge.element),k.dom),Fe=D.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),ot=Fe.length>0?Os(ge.element,Ee,Fe):Ee;return Ar(ot,it.fromTag("br")),P(ge,Ee),Br(ge.element,Ee),v(ge.element,Ee),Ee};return{col:ge=>{const Ee=it.fromTag(Wt(ge.element),k.dom);return P(ge,Ee),v(ge.element,Ee),Ee},colgroup:ea(k),row:eu(k),cell:Z,replace:zp,colGap:Wm(k),gap:Um(k)}},cc=v=>({col:Wm(v),colgroup:ea(v),row:eu(v),cell:Um(v),replace:jm,colGap:Wm(v),gap:Um(v)}),j1=(v,k)=>{const P=(k||document).createElement("div");return P.innerHTML=v,gr(it.fromDom(P))},Sl=v=>Tt(v,it.fromDom),Gi=v=>k=>k.options.get(v),tu="100%",xf=v=>{var k;const D=v.dom,P=(k=D.getParent(v.selection.getStart(),D.isBlock))!==null&&k!==void 0?k:v.getBody();return On(it.fromDom(P))+"px"},F_=(v,k)=>Gm(v)||!Yu(v)?k:qm(v)?{...k,width:xf(v)}:{...k,width:tu},Gh=(v,k)=>Gm(v)||Yu(v)?k:qm(v)?{...k,width:xf(v)}:{...k,width:tu},Wg=v=>{const k=v.options.register;k("table_clone_elements",{processor:"string[]"}),k("table_use_colgroups",{processor:"boolean",default:!0}),k("table_header_type",{processor:D=>{const P=mt(["section","cells","sectionCells","auto"],D);return P?{value:D,valid:P}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),k("table_sizing_mode",{processor:"string",default:"auto"}),k("table_default_attributes",{processor:"object",default:{border:"1"}}),k("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),k("table_column_resizing",{processor:D=>{const P=mt(["preservetable","resizetable"],D);return P?{value:D,valid:P}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),k("table_resize_bars",{processor:"boolean",default:!0}),k("table_style_by_css",{processor:"boolean",default:!0}),k("table_merge_content_on_paste",{processor:"boolean",default:!0})},Kh=v=>be.from(v.options.get("table_clone_elements")),Zm=v=>{const k=v.options.get("object_resizing");return mt(k.split(","),"table")},jg=Gi("table_header_type"),tb=Gi("table_column_resizing"),Yh=v=>tb(v)==="preservetable",Oa=v=>tb(v)==="resizetable",rh=Gi("table_sizing_mode"),Ed=v=>rh(v)==="relative",qm=v=>rh(v)==="fixed",Gm=v=>rh(v)==="responsive",Xh=Gi("table_resize_bars"),Yu=Gi("table_style_by_css"),nb=Gi("table_merge_content_on_paste"),Z1=v=>{const k=v.options,D=k.get("table_default_attributes");return k.isSet("table_default_attributes")?D:Gh(v,D)},H_=v=>{const k=v.options,D=k.get("table_default_styles");return k.isSet("table_default_styles")?D:F_(v,D)},Ma=Gi("table_use_colgroups"),Zg=v=>Ei(v,"[contenteditable]"),Km=(v,k=!1)=>Fi(v)?v.dom.isContentEditable:Zg(v).fold(F(k),D=>nu(D)==="true"),nu=v=>v.dom.contentEditable,Af=v=>it.fromDom(v.getBody()),Ym=v=>k=>ur(k,Af(v)),ih=v=>{qe(v,"data-mce-style");const k=D=>qe(D,"data-mce-style");He(Il(v),k),He(Im(v),k),He(wf(v),k)},Au=v=>it.fromDom(v.selection.getStart()),xd=v=>v.getBoundingClientRect().width,Xm=v=>v.getBoundingClientRect().height,ob=(v,k)=>{const D=v.dom.getStyle(k,"width")||v.dom.getAttrib(k,"width");return be.from(D).filter(jd)},_v=v=>/^(\d+(\.\d+)?)%$/.test(v),Cv=v=>/^(\d+(\.\d+)?)px$/.test(v),ah=v=>Nl(v,Ir("table")).exists(Km),qg=(v,k)=>{const D=k.column,P=k.column+k.colspan-1,Z=k.row,te=k.row+k.rowspan-1;return D<=v.finishCol&&P>=v.startCol&&Z<=v.finishRow&&te>=v.startRow},Sv=(v,k)=>k.column>=v.startCol&&k.column+k.colspan-1<=v.finishCol&&k.row>=v.startRow&&k.row+k.rowspan-1<=v.finishRow,Jm=(v,k)=>{let D=!0;const P=re(Sv,k);for(let Z=k.startRow;Z<=k.finishRow;Z++)for(let te=k.startCol;te<=k.finishCol;te++)D=D&&xe.getAt(v,Z,te).exists(P);return D?be.some(k):be.none()},kv=(v,k)=>Ro(Math.min(v.row,k.row),Math.min(v.column,k.column),Math.max(v.row+v.rowspan-1,k.row+k.rowspan-1),Math.max(v.column+v.colspan-1,k.column+k.colspan-1)),nr=(v,k,D)=>{const P=xe.findItem(v,k,ur),Z=xe.findItem(v,D,ur);return P.bind(te=>Z.map(ge=>kv(te,ge)))},Ao=(v,k,D)=>nr(v,k,D).bind(P=>Jm(v,P)),lh=(v,k,D,P)=>xe.findItem(v,k,ur).bind(Z=>{const te=D>0?Z.row+Z.rowspan-1:Z.row,ge=P>0?Z.column+Z.colspan-1:Z.column;return xe.getAt(v,te+D,ge+P).map(Fe=>Fe.element)}),q1=(v,k,D)=>nr(v,k,D).map(P=>{const Z=xe.filterItems(v,re(qg,P));return Tt(Z,te=>te.element)}),Gg=(v,k)=>{const D=(P,Z)=>Dc(Z,P);return xe.findItem(v,k,D).map(P=>P.element)},Tk=(v,k,D)=>el(v).bind(P=>{const Z=G1(P);return lh(Z,v,k,D)}),Ev=(v,k,D)=>{const P=G1(v);return q1(P,k,D)},ri=(v,k,D,P,Z)=>{const te=G1(v),ge=ur(v,D)?be.some(k):Gg(te,k),Ee=ur(v,Z)?be.some(P):Gg(te,P);return ge.bind(Fe=>Ee.bind(ot=>q1(te,Fe,ot)))},xv=(v,k,D)=>{const P=G1(v);return Ao(P,k,D)},G1=xe.fromTable;var g2=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],en=()=>{const v=ot=>it.fromDom(ot.dom.cloneNode(!1)),k=ot=>fa(ot).dom,D=ot=>ts(ot)?Wt(ot)==="body"?!0:mt(g2,Wt(ot)):!1,P=ot=>ts(ot)?mt(["br","img","hr","input"],Wt(ot)):!1,Z=ot=>ts(ot)&&hi(ot,"contenteditable")==="false",te=(ot,wt)=>ot.dom.compareDocumentPosition(wt.dom),ge=(ot,wt)=>{const un=It(ot);Bi(wt,un)},Ee=ot=>{const wt=Wt(ot);return mt(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],wt)},Fe=ot=>ts(ot)?Ge(ot,"lang"):be.none();return{up:F({selector:vf,closest:Ei,predicate:qr,all:pc}),down:F({selector:mi,predicate:Ln}),styles:F({get:Qa,getRaw:zf,set:xi,remove:yc}),attrs:F({get:hi,set:Ur,remove:qe,copyTo:ge}),insert:F({before:qc,after:Vl,afterAll:Cr,append:Ar,appendAll:La,prepend:xa,wrap:pf}),remove:F({unwrap:bu,remove:Yi}),create:F({nu:it.fromTag,clone:v,text:it.fromText}),query:F({comparePosition:te,prevSibling:Zc,nextSibling:gu}),property:F({children:gr,name:Wt,parent:Ki,document:k,isText:wo,isComment:go,isElement:ts,isSpecial:Ee,getLanguage:Fe,getText:Uo,setText:bi,isBoundary:D,isEmptyTag:P,isNonEditable:Z}),eq:ur,is:gc}};const Ad=(v,k,D,P)=>{const Z=D[0],te=D.slice(1);return P(v,k,Z,te)},$_=(v,k,D)=>D.length>0?Ad(v,k,D,sb):be.none(),sb=(v,k,D,P)=>{const Z=k(v,D);return xn(P,(te,ge)=>{const Ee=k(v,ge);return Dk(v,te,Ee)},Z)},Dk=(v,k,D)=>k.bind(P=>D.filter(re(v.eq,P))),Qm=(v,k)=>re(v.eq,k),p2=(v,k,D,P=De)=>{const Z=[k].concat(v.up().all(k)),te=[D].concat(v.up().all(D)),ge=wt=>es(wt,P).fold(()=>wt,jn=>wt.slice(0,jn+1)),Ee=ge(Z),Fe=ge(te),ot=he(Ee,wt=>nt(Fe,Qm(v,wt)));return{firstpath:Ee,secondpath:Fe,shared:ot}},Jh=$_,Td=p2,eg=en(),vi=(v,k)=>Jh(eg,(D,P)=>v(P),k),Dd=(v,k,D)=>Td(eg,v,k,D),Od=v=>vf(v,"table"),ou=(v,k,D)=>{const P=Z=>te=>D!==void 0&&D(te)||ur(te,Z);return ur(v,k)?be.some({boxes:be.some([v]),start:v,finish:k}):Od(v).bind(Z=>Od(k).bind(te=>{if(ur(Z,te))return be.some({boxes:Ev(Z,v,k),start:v,finish:k});if(Dc(Z,te)){const ge=Xo(k,"td,th",P(Z)),Ee=ge.length>0?ge[ge.length-1]:k;return be.some({boxes:ri(Z,v,Z,k,te),start:v,finish:Ee})}else if(Dc(te,Z)){const ge=Xo(v,"td,th",P(te)),Ee=ge.length>0?ge[ge.length-1]:v;return be.some({boxes:ri(te,v,Z,k,te),start:v,finish:Ee})}else return Dd(v,k).shared.bind(ge=>Ei(ge,"table",D).bind(Ee=>{const Fe=Xo(k,"td,th",P(Ee)),ot=Fe.length>0?Fe[Fe.length-1]:k,wt=Xo(v,"td,th",P(Ee)),un=wt.length>0?wt[wt.length-1]:v;return be.some({boxes:ri(Ee,v,Z,k,te),start:un,finish:ot})}))}))},Hs=(v,k)=>{const D=mi(v,k);return D.length>0?be.some(D):be.none()},Vp=(v,k)=>he(v,D=>Wo(D,k)),ch=(v,k,D)=>Kc(v,k).bind(P=>Kc(v,D).bind(Z=>vi(Od,[P,Z]).map(te=>({first:P,last:Z,table:te})))),Kg=(v,k)=>vf(v,"table").bind(D=>Kc(D,k).bind(P=>ou(P,v).bind(Z=>Z.boxes.map(te=>({boxes:te,start:Z.start,finish:Z.finish}))))),Ok=(v,k,D,P,Z)=>Vp(v,Z).bind(te=>Tk(te,k,D).bind(ge=>Kg(ge,P))),rb=(v,k)=>Hs(v,k),Av=(v,k,D)=>ch(v,k,D).bind(P=>{const Z=Fe=>ur(v,Fe),te="thead,tfoot,tbody,table",ge=vf(P.first,te,Z),Ee=vf(P.last,te,Z);return ge.bind(Fe=>Ee.bind(ot=>ur(Fe,ot)?xv(P.table,P.first,P.last):be.none()))}),kl=ne,o3=v=>{const k=(P,Z)=>Ge(P,Z).exists(te=>parseInt(te,10)>1),D=P=>k(P,"rowspan")||k(P,"colspan");return v.length>0&&xo(v,D)?be.some(v):be.none()},Yg=(v,k,D)=>k.length<=1?be.none():Av(v,D.firstSelectedSelector,D.lastSelectedSelector).map(P=>({bounds:P,cells:k})),El="data-mce-selected",b2="td["+El+"],th["+El+"]",oo="["+El+"]",v2="data-mce-first-selected",Mk="td["+v2+"],th["+v2+"]",y2="data-mce-last-selected",Qh="td["+y2+"],th["+y2+"]",Xu=oo,uh={selected:El,selectedSelector:b2,firstSelected:v2,firstSelectedSelector:Mk,lastSelected:y2,lastSelectedSelector:Qh},Xg=(v,k,D)=>({element:D,mergable:Yg(k,v,uh),unmergable:o3(v),selection:kl(v)}),fh=(v,k,D)=>({element:v,clipboard:k,generators:D}),ib=(v,k,D,P)=>({selection:kl(v),clipboard:D,generators:P}),Tf=v=>el(v).bind(k=>rb(k,uh.firstSelectedSelector)).fold(F(v),k=>k[0]),Jg=v=>(k,D)=>{const P=Wt(k),Z=P==="col"||P==="colgroup"?Tf(k):k;return Ei(Z,v,D)},w2=Jg("th,td,caption"),Up=Jg("th,td"),Kf=v=>Sl(v.model.table.getSelectedCells()),_2=v=>kt(Kf(v),k=>Wo(k,uh.selectedSelector)),dh=v=>el(v[0]).map(k=>{const D=at(k,Xu);return ih(D),[D]}),Tv=(v,k)=>Tt(k,D=>v.selection.serializer.serialize(D.dom,{})).join(""),z_=v=>Tt(v,k=>k.dom.innerText).join(""),C2=(v,k)=>{v.on("BeforeGetContent",D=>{const P=Z=>{D.preventDefault(),dh(Z).each(te=>{D.content=D.format==="text"?z_(te):Tv(v,te)})};if(D.selection===!0){const Z=_2(v);Z.length>=1&&P(Z)}}),v.on("BeforeSetContent",D=>{if(D.selection===!0&&D.paste===!0){const P=Kf(v);Pe(P).each(Z=>{el(Z).each(te=>{const ge=kt(j1(D.content),Fe=>Wt(Fe)!=="meta"),Ee=Ir("table");if(nb(v)&&ge.length===1&&Ee(ge[0])){D.preventDefault();const Fe=it.fromDom(v.getDoc()),ot=cc(Fe),wt=fh(Z,ge[0],ot);k.pasteCells(te,wt).each(()=>{v.focus()})}})})}})},Qg=(v,k)=>({element:v,offset:k}),Df=(v,k,D)=>v.property().isText(k)&&v.property().getText(k).trim().length===0||v.property().isComment(k)?D(k).bind(P=>Df(v,P,D).orThunk(()=>be.some(P))):be.none(),su=(v,k)=>v.property().isText(k)?v.property().getText(k).length:v.property().children(k).length,ep=(v,k)=>{const D=Df(v,k,v.query().prevSibling).getOr(k);if(v.property().isText(D))return Qg(D,su(v,D));const P=v.property().children(D);return P.length>0?ep(v,P[P.length-1]):Qg(D,su(v,D))},S2=ep,V_=en(),ab=v=>S2(V_,v),Lc=(v,k)=>{Pl(v)||Qt(v).each(P=>{const Z=P.value/2;Gr(v,Z,P.unit),Gr(k,Z,P.unit)})},lb=v=>Tt(v,F(0)),Ju=(v,k,D,P,Z)=>Z(v.slice(0,k)).concat(P).concat(Z(v.slice(D))),tp=v=>(k,D,P,Z)=>{if(v(P)){const te=Math.max(Z,k[D]-Math.abs(P)),ge=Math.abs(te-k[D]);return P>=0?ge:-ge}else return P},em=tp(v=>v<0),Dv=tp(_e),U_=()=>{const v=(Ee,Fe,ot,wt,un)=>{const jn=em(Ee,Fe,wt,un);return Ju(Ee,Fe,ot+1,[jn,0],lb)},k=(Ee,Fe,ot,wt)=>{const un=(100+ot)/100,jn=Math.max(wt,(Ee[Fe]+ot)/un);return Tt(Ee,(Vn,tn)=>(tn===Fe?jn:Vn/un)-Vn)},D=(Ee,Fe,ot,wt,un,jn)=>jn?k(Ee,Fe,wt,un):v(Ee,Fe,ot,wt,un);return{resizeTable:(Ee,Fe)=>Ee(Fe),clampTableDelta:em,calcLeftEdgeDeltas:D,calcMiddleDeltas:(Ee,Fe,ot,wt,un,jn,Vn)=>D(Ee,ot,wt,un,jn,Vn),calcRightEdgeDeltas:(Ee,Fe,ot,wt,un,jn)=>{if(jn)return k(Ee,ot,wt,un);{const Vn=em(Ee,ot,wt,un);return lb(Ee.slice(0,ot)).concat([Vn])}},calcRedestributedWidths:(Ee,Fe,ot,wt)=>{if(wt){const jn=(Fe+ot)/Fe,Vn=Tt(Ee,tn=>tn/jn);return{delta:jn*100-100,newSizes:Vn}}else return{delta:ot,newSizes:Ee}}}},Wp=()=>{const v=(ge,Ee,Fe,ot,wt)=>{const un=ot>=0?Fe:Ee,jn=Dv(ge,un,ot,wt);return Ju(ge,Ee,Fe+1,[jn,-jn],lb)};return{resizeTable:(ge,Ee,Fe)=>{Fe&&ge(Ee)},clampTableDelta:(ge,Ee,Fe,ot,wt)=>{if(wt){if(Fe>=0)return Fe;{const un=We(ge,(jn,Vn)=>jn+Vn-ot,0);return Math.max(-un,Fe)}}else return em(ge,Ee,Fe,ot)},calcLeftEdgeDeltas:v,calcMiddleDeltas:(ge,Ee,Fe,ot,wt,un)=>v(ge,Fe,ot,wt,un),calcRightEdgeDeltas:(ge,Ee,Fe,ot,wt,un)=>{if(un)return lb(ge);{const jn=ot/ge.length;return Tt(ge,F(jn))}},calcRedestributedWidths:(ge,Ee,Fe,ot)=>({delta:0,newSizes:ge})}},k2=v=>xe.fromTable(v).grid,np=Ir("th"),cb=v=>xo(v,k=>np(k.element)),K1=(v,k)=>v&&k?"sectionCells":v?"section":"cells",E2=v=>{const k=v.section==="thead",D=sc(x2(v.cells),"th");return v.section==="tfoot"?{type:"footer"}:k||D?{type:"header",subType:K1(k,D)}:{type:"body"}},x2=v=>{const k=kt(v,D=>np(D.element));return k.length===0?be.some("td"):k.length===v.length?be.some("th"):be.none()},W_=v=>{const k=Tt(v,Z=>E2(Z).type),D=mt(k,"header"),P=mt(k,"footer");if(!D&&!P)return be.some("body");{const Z=mt(k,"body");return D&&!Z&&!P?be.some("header"):!D&&!Z&&P?be.some("footer"):be.none()}},Rk=v=>gn(v.all,k=>{const D=E2(k);return D.type==="header"?be.from(D.subType):be.none()}),Lr=(v,k,D)=>Pt(D(v.element,k),!0,v.isLocked),Ov=(v,k)=>v.section!==k?vn(v.element,v.cells,k,v.isNew):v,A2=()=>({transformRow:Ov,transformCell:(v,k,D)=>{const P=D(v.element,k),Z=Wt(P)!=="td"?Lf(P,"td"):P;return Pt(Z,v.isNew,v.isLocked)}}),T2=()=>({transformRow:Ov,transformCell:Lr}),ub=()=>({transformRow:(v,k)=>Ov(v,k==="thead"?"tbody":k),transformCell:Lr}),qa={getTableSectionType:(v,k)=>{const D=xe.fromTable(v);switch(Rk(D).getOr(k)){case"section":return A2();case"sectionCells":return T2();case"cells":return ub()}},section:A2,sectionCells:T2,cells:ub,fallback:()=>({transformRow:ne,transformCell:Lr})},fb=(v,k,D,P)=>{D===P?qe(v,k):Ur(v,k,D)},Y1=(v,k,D)=>{Ut(no(v,k)).fold(()=>xa(v,D),P=>Vl(P,D))},j_=(v,k)=>{const D=Ss(v,k).getOrThunk(()=>{const P=it.fromTag(k,Xa(v).dom);return k==="thead"?Y1(v,"caption,colgroup",P):k==="colgroup"?Y1(v,"caption",P):Ar(v,P),P});return sa(D),D},db=(v,k)=>{const D=[],P=[],Z=Vn=>Tt(Vn,tn=>{tn.isNew&&D.push(tn.element);const Un=tn.element;return sa(Un),He(tn.cells,Xt=>{Xt.isNew&&P.push(Xt.element),fb(Xt.element,"colspan",Xt.colspan,1),fb(Xt.element,"rowspan",Xt.rowspan,1),Ar(Un,Xt.element)}),Un}),te=Vn=>ao(Vn,tn=>Tt(tn.cells,Un=>(fb(Un.element,"span",Un.colspan,1),Un.element))),ge=(Vn,tn)=>{const Un=j_(v,tn),fo=(tn==="colgroup"?te:Z)(Vn);La(Un,fo)},Ee=Vn=>{Ss(v,Vn).each(Yi)},Fe=(Vn,tn)=>{Vn.length>0?ge(Vn,tn):Ee(tn)},ot=[],wt=[],un=[],jn=[];return He(k,Vn=>{switch(Vn.section){case"thead":ot.push(Vn);break;case"tbody":wt.push(Vn);break;case"tfoot":un.push(Vn);break;case"colgroup":jn.push(Vn);break}}),Fe(jn,"colgroup"),Fe(ot,"thead"),Fe(wt,"tbody"),Fe(un,"tfoot"),{newRows:D,newCells:P}},D2=v=>Tt(v,k=>{const D=Fa(k.element);return He(k.cells,P=>{const Z=Mc(P.element);fb(Z,"colspan",P.colspan,1),fb(Z,"rowspan",P.rowspan,1),Ar(D,Z)}),D}),Ra=(v,k)=>Tt(v,D=>ra(D,k)),hh=(v,k)=>v[k],ma=(v,k)=>{if(v.length===0)return 0;const D=v[0];return es(v,Z=>!k(D.element,Z.element)).getOr(v.length)},Qu=(v,k,D,P)=>{const Z=hh(v,k),te=Z.section==="colgroup",ge=ma(Z.cells.slice(D),P),Ee=te?1:ma(Ra(v.slice(k),D),P);return{colspan:ge,rowspan:Ee}},tg=(v,k)=>{const D=Tt(v,Z=>Tt(Z.cells,De)),P=(Z,te,ge,Ee)=>{for(let Fe=Z;Fe<Z+ge;Fe++)for(let ot=te;ot<te+Ee;ot++)D[Fe][ot]=!0};return Tt(v,(Z,te)=>{const ge=ao(Z.cells,(Ee,Fe)=>{if(D[te][Fe]===!1){const ot=Qu(v,te,Fe,k);return P(te,Fe,ot.rowspan,ot.colspan),[pd(Ee.element,ot.rowspan,ot.colspan,Ee.isNew)]}else return[]});return gt(Z.element,ge,Z.section,Z.isNew)})},Fc=(v,k,D)=>{const P=[];He(v.colgroups,Z=>{const te=[];for(let ge=0;ge<v.grid.columns;ge++){const Ee=xe.getColumnAt(v,ge).map(Fe=>Pt(Fe.element,D,!1)).getOrThunk(()=>Pt(k.colGap(),!0,!1));te.push(Ee)}P.push(vn(Z.element,te,"colgroup",D))});for(let Z=0;Z<v.grid.rows;Z++){const te=[];for(let Fe=0;Fe<v.grid.columns;Fe++){const ot=xe.getAt(v,Z,Fe).map(wt=>Pt(wt.element,D,wt.isLocked)).getOrThunk(()=>Pt(k.gap(),!0,!1));te.push(ot)}const ge=v.all[Z],Ee=vn(ge.element,te,ge.section,D);P.push(Ee)}return P},Pk=(v,k)=>Fc(v,k,!1),O2=v=>tg(v,ur),Yf=(v,k)=>gn(v.all,D=>he(D.cells,P=>ur(k,P.element))),Na=(v,k,D)=>{const P=Tt(k.selection,te=>Pm(te).bind(ge=>Yf(v,ge)).filter(D)),Z=Oi(P);return da(Z.length>0,Z)},Sa=(v,k,D,P,Z)=>(te,ge,Ee,Fe)=>{const ot=xe.fromTable(te),wt=be.from(Fe==null?void 0:Fe.section).getOrThunk(qa.fallback);return k(ot,ge).map(jn=>{const Vn=Pk(ot,Ee),tn=v(Vn,jn,ur,Z(Ee),wt),Un=wa(tn.grid),Xt=O2(tn.grid);return{info:jn,grid:Xt,cursor:tn.cursor,lockedColumns:Un}}).bind(jn=>{const Vn=db(te,jn.grid),tn=be.from(Fe==null?void 0:Fe.sizing).getOrThunk(()=>Jc.getTableSize(te)),Un=be.from(Fe==null?void 0:Fe.resize).getOrThunk(Wp);return D(te,jn.grid,jn.info,{sizing:tn,resize:Un,section:wt}),P(te),qe(te,Fm),jn.lockedColumns.length>0&&Ur(te,Fm,jn.lockedColumns.join(",")),be.some({cursor:jn.cursor,newRows:Vn.newRows,newCells:Vn.newCells})})},Ik=(v,k)=>Pm(k.element).bind(D=>Yf(v,D).map(P=>({...P,generators:k.generators,clipboard:k.clipboard}))),mh=(v,k)=>Na(v,k,_e).map(D=>({cells:D,generators:k.generators,clipboard:k.clipboard})),hb=(v,k)=>k.mergable,Mv=(v,k)=>k.unmergable,Xf=(v,k)=>Na(v,k,_e),ef=(v,k)=>Na(v,k,D=>!D.isLocked),jp=(v,k)=>Yf(v,k).exists(D=>!D.isLocked),X1=(v,k)=>xo(k,D=>jp(v,D)),mb=(v,k)=>hb(v,k).filter(D=>X1(v,D.cells)),gb=(v,k)=>Mv(v,k).filter(D=>X1(v,D)),Z_=(v,k,D,P)=>{const Z=Ta(v).rows;if(Z.length===0)return v;for(let te=k.startRow;te<=k.finishRow;te++)for(let ge=k.startCol;ge<=k.finishCol;ge++){const Ee=Z[te],Fe=ra(Ee,ge).isLocked;uo(Ee,ge,Pt(P(),!1,Fe))}return v},M2=(v,k,D,P)=>{const Z=Ta(v).rows;let te=!0;for(let ge=0;ge<Z.length;ge++)for(let Ee=0;Ee<Cu(Z[0]);Ee++){const Fe=Z[ge],ot=ra(Fe,Ee),wt=ot.element,un=D(wt,k);un&&!te?uo(Fe,Ee,Pt(P(),!0,ot.isLocked)):un&&(te=!1)}return v},Bk=(v,k)=>We(v,(D,P)=>nt(D,Z=>k(Z.element,P.element))?D:D.concat([P]),[]),q_=(v,k,D,P)=>(k>0&&k<v[0].cells.length&&He(v,Z=>{const te=Z.cells[k-1];let ge=0;const Ee=P();for(;Z.cells.length>k+ge&&D(te.element,Z.cells[k+ge].element);)uo(Z,k+ge,Pt(Ee,!0,Z.cells[k+ge].isLocked)),ge++}),v),G_=(v,k,D,P)=>{const Z=Ta(v).rows;if(k>0&&k<Z.length){const te=Z[k-1].cells,ge=Bk(te,D);He(ge,Ee=>{let Fe=be.none();for(let ot=k;ot<Z.length;ot++)for(let wt=0;wt<Cu(Z[0]);wt++){const un=Z[ot],jn=ra(un,wt);D(jn.element,Ee.element)&&(Fe.isNone()&&(Fe=be.some(P())),Fe.each(tn=>{uo(un,wt,Pt(tn,!0,jn.isLocked))}))}})}return v},R2=v=>{const k=te=>te(v),D=F(v),P=()=>Z,Z={tag:!0,inner:v,fold:(te,ge)=>ge(v),isValue:_e,isError:De,map:te=>Rv.value(te(v)),mapError:P,bind:k,exists:k,forall:k,getOr:D,or:P,getOrThunk:D,orThunk:P,getOrDie:D,each:te=>{te(v)},toOptional:()=>be.some(v)};return Z},K_=v=>{const k=()=>D,D={tag:!1,inner:v,fold:(P,Z)=>P(v),isValue:De,isError:_e,map:k,mapError:P=>Rv.error(P(v)),bind:k,exists:De,forall:_e,getOr:ne,or:ne,getOrThunk:ye,orThunk:ye,getOrDie:we(String(v)),each:z,toOptional:be.none};return D},Rv={value:R2,error:K_,fromOption:(v,k)=>v.fold(()=>K_(k),R2)},Y_=(v,k,D)=>{if(v.row>=k.length||v.column>Cu(k[0]))return Rv.error("invalid start address out of table bounds, row: "+v.row+", column: "+v.column);const P=k.slice(v.row),Z=P[0].cells.slice(v.column),te=Cu(D[0]),ge=D.length;return Rv.value({rowDelta:P.length-ge,colDelta:Z.length-te})},Ri=(v,k)=>{const D=Cu(v[0]),P=Cu(k[0]);return{rowDelta:0,colDelta:D-P}},Nv=(v,k)=>{const D=v.length,P=k.length;return{rowDelta:D-P,colDelta:0}},N2=(v,k,D,P)=>{const Z=k.section==="colgroup"?D.col:D.cell;return Ot(v,te=>Pt(Z(),!0,P(te)))},X_=(v,k,D,P)=>{const Z=v[v.length-1];return v.concat(Ot(k,()=>{const te=Z.section==="colgroup"?D.colgroup:D.row,ge=qh(Z,te,ne),Ee=N2(ge.cells.length,ge,D,Fe=>ar(P,Fe.toString()));return Sr(ge,Ee)}))},ng=(v,k,D,P)=>Tt(v,Z=>{const te=N2(k,Z,D,De);return Go(Z,P,te)}),uc=(v,k,D)=>Tt(v,P=>We(D,(Z,te)=>{const ge=N2(1,P,k,_e)[0];return ns(Z,te,ge)},P)),ru=(v,k,D)=>{const P=k.colDelta<0?ng:ne,Z=k.rowDelta<0?X_:ne,te=wa(v),ge=Cu(v[0]),Ee=nt(te,wt=>wt===ge-1),Fe=P(v,Math.abs(k.colDelta),D,Ee?ge-1:ge),ot=wa(Fe);return Z(Fe,Math.abs(k.rowDelta),D,Ct(ot,_e))},J_=(v,k,D,P)=>{const Z=ra(v[k],D),te=re(P,Z.element),ge=v[k];return v.length>1&&Cu(ge)>1&&(D>0&&te(Mi(ge,D-1))||D<ge.cells.length-1&&te(Mi(ge,D+1))||k>0&&te(Mi(v[k-1],D))||k<v.length-1&&te(Mi(v[k+1],D)))},P2=(v,k,D,P,Z,te)=>{const ge=v.row,Ee=v.column,Fe=D.length,ot=Cu(D[0]),wt=ge+Fe,un=Ee+ot+te.length,jn=Ct(te,_e);for(let Vn=ge;Vn<wt;Vn++){let tn=0;for(let Un=Ee;Un<un;Un++){if(jn[Un]){tn++;continue}J_(k,Vn,Un,Z)&&M2(k,Mi(k[Vn],Un),Z,P.cell);const Xt=Un-Ee-tn,fo=ra(D[Vn-ge],Xt),as=fo.element,Ts=P.replace(as);uo(k[Vn],Un,Pt(Ts,!0,fo.isLocked))}}return k},op=(v,k,D)=>{const P=Cu(k[0]),Z=Ta(k).cols.length+v.row,te=Ot(P-v.column,Ee=>Ee+v.column),ge=he(te,Ee=>xo(D,Fe=>Fe!==Ee)).getOr(P-1);return{row:Z,column:ge}},sp=(v,k,D)=>kt(D,P=>P>=v.column&&P<=Cu(k[0])+v.column),Zp=(v,k,D,P,Z)=>{const te=wa(k),ge=op(v,k,te),Ee=Ta(D).rows,Fe=sp(ge,Ee,te);return Y_(ge,k,Ee).map(wt=>{const un={...wt,colDelta:wt.colDelta-Fe.length},jn=ru(k,un,P),Vn=wa(jn),tn=sp(ge,Ee,Vn);return P2(ge,jn,Ee,P,Z,tn)})},qp=(v,k,D,P,Z)=>{q_(k,v,Z,P.cell);const te=Nv(D,k),ge=ru(D,te,P),Ee=Nv(k,ge),Fe=ru(k,Ee,P);return Tt(Fe,(ot,wt)=>Go(ot,v,ge[wt].cells))},og=(v,k,D,P,Z)=>{G_(k,v,Z,P.cell);const te=wa(k),ge=Ri(k,D),Ee={...ge,colDelta:ge.colDelta-te.length},Fe=ru(k,Ee,P),{cols:ot,rows:wt}=Ta(Fe),un=wa(Fe),jn=Ri(D,k),Vn={...jn,colDelta:jn.colDelta+un.length},tn=uc(D,P,un),Un=ru(tn,Vn,P);return[...ot,...wt.slice(0,v),...Un,...wt.slice(v,wt.length)]},Pv=(v,k,D,P)=>qh(v,Z=>P(Z,D),k),ta=(v,k,D,P,Z)=>{const{rows:te,cols:ge}=Ta(v),Ee=te.slice(0,k),Fe=te.slice(k),ot=Pv(te[D],(wt,un)=>k>0&&k<te.length&&P(Mi(te[k-1],un),Mi(te[k],un))?ra(te[k],un):Pt(Z(wt.element,P),!0,wt.isLocked),P,Z);return[...ge,...Ee,ot,...Fe]},tf=(v,k,D,P,Z,te,ge)=>{if(D==="colgroup"||!P){const Ee=ra(v,Z);return Pt(ge(Ee.element,te),!0,!1)}else return ra(v,k)},J1=(v,k,D,P,Z)=>Tt(v,te=>{const ge=k>0&&k<Cu(te)&&P(Mi(te,k-1),Mi(te,k)),Ee=tf(te,k,te.section,ge,D,P,Z);return ns(te,k,Ee)}),Lk=(v,k)=>ao(v,D=>{const P=D.cells,Z=xn(k,(te,ge)=>ge>=0&&ge<te.length?te.slice(0,ge).concat(te.slice(ge+1)):te,P);return Z.length>0?[vn(D.element,Z,D.section,D.isNew)]:[]}),I2=(v,k,D)=>{const{rows:P,cols:Z}=Ta(v);return[...Z,...P.slice(0,k),...P.slice(D+1)]},Fk=(v,k,D,P)=>Mi(v[k],D)!==void 0&&k>0&&P(Mi(v[k-1],D),Mi(v[k],D)),Gp=(v,k,D)=>k>0&&D(Mi(v,k-1),Mi(v,k)),Q1=(v,k,D,P)=>Fk(v,k,D,P)||Gp(v[k],D,P),Jf=(v,k)=>xo(k,ne)&&cb(v.cells)?_e:(P,Z,te)=>!(Wt(P.element)==="th"&&k[te]),B2=(v,k)=>xo(k,ne)&&cb(v)?_e:(P,Z,te)=>!(Wt(P.element)==="th"&&k[Z]),Q_=(v,k,D,P)=>{const Z=ge=>ge==="row"?$a(k):Pl(k),te=ge=>Z(ge)?`${ge}group`:ge;return v?np(k)?te(D):null:P&&np(k)?te(D==="row"?"col":"row"):null},eC=(v,k)=>(D,P,Z)=>be.some(Q_(v,D.element,"col",k[Z])),Hk=(v,k)=>(D,P)=>be.some(Q_(v,D.element,"row",k[P])),tC=(v,k,D)=>Pt(D(v.element,k),!0,v.isLocked),pb=(v,k,D,P,Z,te,ge)=>{const Ee=Fe=>nt(k,ot=>D(Fe.element,ot.element));return Tt(v,(Fe,ot)=>Zl(Fe,(wt,un)=>{if(Ee(wt)){const jn=ge(wt,ot,un)?Z(wt,D,P):wt;return te(jn,ot,un).each(Vn=>{Ba(jn.element,{scope:be.from(Vn)})}),jn}else return wt}))},bb=(v,k,D)=>ao(v,(P,Z)=>Q1(v,Z,k,D)?[]:[ra(P,k)]),nC=(v,k,D)=>{const P=v[k];return ao(P.cells,(Z,te)=>Q1(v,k,te,D)?[]:[Z])},L2=(v,k,D,P,Z)=>{const te=Ta(v).rows,ge=ao(k,wt=>bb(te,wt,P)),Ee=Tt(te,wt=>cb(wt.cells)),Fe=B2(ge,Ee),ot=Hk(D,Ee);return pb(v,ge,P,Z,tC,ot,Fe)},Kp=(v,k,D,P,Z,te,ge)=>{const{cols:Ee,rows:Fe}=Ta(v),ot=Fe[k[0]],wt=ao(k,Xt=>nC(Fe,Xt,Z)),un=Tt(ot.cells,(Xt,fo)=>cb(bb(Fe,fo,Z))),jn=[...Fe];He(k,Xt=>{jn[Xt]=ge.transformRow(Fe[Xt],D)});const Vn=[...Ee,...jn],tn=Jf(ot,un),Un=eC(P,un);return pb(Vn,wt,Z,te,ge.transformCell,Un,tn)},oC=(v,k,D,P)=>{const Z=Ta(v).rows,te=Tt(k,ge=>ra(Z[ge.row],ge.column));return pb(v,te,D,P,tC,be.none,_e)},sg={generate:v=>{if(!g(v))throw new Error("cases must be an array");if(v.length===0)throw new Error("there must be at least one case");const k=[],D={};return He(v,(P,Z)=>{const te=yt(P);if(te.length!==1)throw new Error("one and only one name per case");const ge=te[0],Ee=P[ge];if(D[ge]!==void 0)throw new Error("duplicate key detected:"+ge);if(ge==="cata")throw new Error("cannot have a case named cata (sorry)");if(!g(Ee))throw new Error("case arguments must be an array");k.push(ge),D[ge]=(...Fe)=>{const ot=Fe.length;if(ot!==Ee.length)throw new Error("Wrong number of arguments to case "+ge+". Expected "+Ee.length+" ("+Ee+"), got "+ot);return{fold:(...un)=>{if(un.length!==v.length)throw new Error("Wrong number of arguments to fold. Expected "+v.length+", got "+un.length);return un[Z].apply(null,Fe)},match:un=>{const jn=yt(un);if(k.length!==jn.length)throw new Error("Wrong number of arguments to match. Expected: "+k.join(",")+`
Actual: `+jn.join(","));if(!xo(k,tn=>mt(jn,tn)))throw new Error("Not all branches were specified when using match. Specified: "+jn.join(", ")+`
Required: `+k.join(", "));return un[ge].apply(null,Fe)},log:un=>{console.log(un,{constructors:k,constructor:ge,params:Fe})}}}}),D}},nf={...sg.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},e0=(v,k)=>v.length===0?nf.none():v.length===1?nf.only(0):k===0?nf.left(0,1):k===v.length-1?nf.right(k-1,k):k>0&&k<v.length-1?nf.middle(k-1,k,k+1):nf.none(),Gs=(v,k,D,P,Z)=>{const te=v.slice(0),ge=e0(v,k),Ee=F(Tt(te,F(0))),Fe=jn=>P.singleColumnWidth(te[jn],D),ot=(jn,Vn)=>Z.calcLeftEdgeDeltas(te,jn,Vn,D,P.minCellWidth(),P.isRelative),wt=(jn,Vn,tn)=>Z.calcMiddleDeltas(te,jn,Vn,tn,D,P.minCellWidth(),P.isRelative),un=(jn,Vn)=>Z.calcRightEdgeDeltas(te,jn,Vn,D,P.minCellWidth(),P.isRelative);return ge.fold(Ee,Fe,ot,wt,un)},iu=(v,k,D)=>{let P=0;for(let Z=v;Z<k;Z++)P+=D[Z]!==void 0?D[Z]:0;return P},rg=(v,k)=>{const D=xe.justCells(v);return Tt(D,P=>{const Z=iu(P.column,P.column+P.colspan,k);return{element:P.element,width:Z,colspan:P.colspan}})},F2=(v,k)=>{const D=xe.justColumns(v);return Tt(D,(P,Z)=>({element:P.element,width:k[Z],colspan:P.colspan}))},Vi=(v,k)=>{const D=xe.justCells(v);return Tt(D,P=>{const Z=iu(P.row,P.row+P.rowspan,k);return{element:P.element,height:Z,rowspan:P.rowspan}})},H2=(v,k)=>Tt(v.all,(D,P)=>({element:D.element,height:k[P]})),ig=v=>xn(v,(k,D)=>k+D,0),ga=(v,k)=>xe.hasColumns(v)?F2(v,k):rg(v,k),nm=(v,k,D)=>{const P=ga(v,k);He(P,Z=>{D.setElementWidth(Z.element,Z.width)})},Vt=(v,k,D,P,Z)=>{const te=xe.fromTable(v),ge=Z.getCellDelta(k),Ee=Z.getWidths(te,Z),Fe=D===te.grid.columns-1,ot=P.clampTableDelta(Ee,D,ge,Z.minCellWidth(),Fe),wt=Gs(Ee,D,ot,Z,P),un=Tt(wt,(jn,Vn)=>jn+Ee[Vn]);nm(te,un,Z),P.resizeTable(Z.adjustTableWidth,ot,Fe)},vb=(v,k,D,P)=>{const Z=xe.fromTable(v),te=St(Z,v,P),ge=Tt(te,(wt,un)=>D===un?Math.max(k+wt,rc()):wt),Ee=Vi(Z,ge),Fe=H2(Z,ge);He(Fe,wt=>{qu(wt.element,wt.height)}),He(Ee,wt=>{qu(wt.element,wt.height)});const ot=ig(ge);qu(v,ot)},$2=(v,k,D,P,Z)=>{const te=xe.generate(k),ge=P.getWidths(te,P),Ee=P.pixelWidth(),{newSizes:Fe,delta:ot}=Z.calcRedestributedWidths(ge,Ee,D.pixelDelta,P.isRelative);nm(te,Fe,P),P.adjustTableWidth(ot)},yb=(v,k,D,P)=>{const Z=xe.generate(k),te=P.getWidths(Z,P);nm(Z,te,P)},gh=v=>We(v,(D,P)=>nt(D,te=>te.column===P.column)?D:D.concat([P]),[]).sort((D,P)=>D.column-P.column),of=Ir("col"),t0=Ir("colgroup"),Bv=v=>Wt(v)==="tr"||t0(v),z2=v=>{const k=Tr(v,"colspan",1),D=Tr(v,"rowspan",1);return{element:v,colspan:k,rowspan:D}},Lv=(v,k=z2)=>{const D=Ee=>of(Ee.element)?v.col(Ee):v.cell(Ee),P=Ee=>t0(Ee.element)?v.colgroup(Ee):v.row(Ee),Z=Ee=>{if(Bv(Ee))return P({element:Ee});{const Fe=Ee,ot=D(k(Fe));return te=be.some({item:Fe,replacement:ot}),ot}};let te=be.none();return{getOrInit:(Ee,Fe)=>te.fold(()=>Z(Ee),ot=>Fe(Ee,ot.item)?ot.replacement:Z(Ee))}},wb=v=>k=>{const D=[],P=(ge,Ee)=>he(D,Fe=>Ee(Fe.item,ge)),Z=ge=>{const Ee=v==="td"?{scope:null}:{},Fe=k.replace(ge,v,Ee);return D.push({item:ge,sub:Fe}),Fe};return{replaceOrInit:(ge,Ee)=>{if(Bv(ge)||of(ge))return ge;{const Fe=ge;return P(Fe,Ee).fold(()=>Z(Fe),ot=>Ee(ge,ot.item)?ot.sub:Z(Fe))}}}},ph=v=>Ge(v,"scope").map(k=>k.substr(0,3)),Tu={modification:Lv,transform:wb,merging:v=>({unmerge:P=>{const Z=ph(P);return Z.each(te=>Ur(P,"scope",te)),()=>{const te=v.cell({element:P,colspan:1,rowspan:1});return yc(te,"width"),yc(P,"width"),Z.each(ge=>Ur(te,"scope",ge)),te}},merge:P=>{const Z=()=>{const te=Oi(Tt(P,ph));if(te.length===0)return be.none();{const ge=te[0],Ee=["row","col"];return nt(te,ot=>ot!==ge&&mt(Ee,ot))?be.none():be.from(ge)}};return yc(P[0],"width"),Z().fold(()=>qe(P[0],"scope"),te=>Ur(P[0],"scope",te+"group")),F(P[0])}})},Fl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],V2=(v,k)=>{const D=v.property().name(k);return mt(["ol","ul"],D)},rp=(v,k)=>{const D=v.property().name(k);return mt(Fl,D)},sC=(v,k)=>mt(["br","img","hr","input"],v.property().name(k)),_b=en(),Xp=v=>rp(_b,v),U2=v=>V2(_b,v),Fv=v=>sC(_b,v),rC=v=>{const k=Ir("br"),D=Fe=>xo(Fe,ot=>k(ot)||wo(ot)&&Uo(ot).trim().length===0),P=Fe=>Wt(Fe)==="li"||qr(Fe,U2).isSome(),Z=Fe=>gu(Fe).map(ot=>Xp(ot)?!0:Fv(ot)?Wt(ot)!=="img":!1).getOr(!1),te=Fe=>oh(Fe).bind(ot=>{const wt=Z(ot);return Ki(ot).map(un=>wt===!0||P(un)||k(ot)||Xp(un)&&!ur(Fe,un)?[]:[it.fromTag("br")])}).getOr([]),Ee=(()=>{const Fe=ao(v,ot=>{const wt=gr(ot);return D(wt)?[]:wt.concat(te(ot))});return Fe.length===0?[it.fromTag("br")]:Fe})();sa(v[0]),La(v[0],Ee)},Hv=v=>Km(v,!0),W2=v=>{Il(v).length===0&&Yi(v)},ml=(v,k)=>({grid:v,cursor:k}),Kl=v=>gn(v,k=>gn(k.cells,D=>{const P=D.element;return da(Hv(P),P)})),Du=(v,k,D)=>{var P,Z;const te=Ta(v).rows;return be.from((Z=(P=te[k])===null||P===void 0?void 0:P.cells[D])===null||Z===void 0?void 0:Z.element).filter(Hv).orThunk(()=>Kl(te))},Fr=(v,k,D)=>{const P=Du(v,k,D);return ml(v,P)},Yl=v=>We(v,(D,P)=>nt(D,te=>te.row===P.row)?D:D.concat([P]),[]).sort((D,P)=>D.row-P.row),Hl=(v,k,D,P)=>{const Z=k[0].row,te=Yl(k),ge=xn(te,(Ee,Fe)=>({grid:ta(Ee.grid,Z,Fe.row+Ee.delta,D,P.getOrInit),delta:Ee.delta+1}),{grid:v,delta:0}).grid;return Fr(ge,Z,k[0].column)},om=(v,k,D,P)=>{const Z=Yl(k),te=Z[Z.length-1],ge=te.row+te.rowspan,Ee=xn(Z,(Fe,ot)=>ta(Fe,ge,ot.row,D,P.getOrInit),v);return Fr(Ee,ge,k[0].column)},vr=(v,k,D,P)=>{const Z=k.details,te=gh(Z),ge=te[0].column,Ee=xn(te,(Fe,ot)=>({grid:J1(Fe.grid,ge,ot.column+Fe.delta,D,P.getOrInit),delta:Fe.delta+1}),{grid:v,delta:0}).grid;return Fr(Ee,Z[0].row,ge)},iC=(v,k,D,P)=>{const Z=k.details,te=Z[Z.length-1],ge=te.column+te.colspan,Ee=gh(Z),Fe=xn(Ee,(ot,wt)=>J1(ot,ge,wt.column,D,P.getOrInit),v);return Fr(Fe,Z[0].row,ge)},au=(v,k,D,P)=>{const Z=gh(k),te=Tt(Z,Ee=>Ee.column),ge=L2(v,te,!0,D,P.replaceOrInit);return Fr(ge,k[0].row,k[0].column)},xl=(v,k,D,P)=>{const Z=oC(v,k,D,P.replaceOrInit);return Fr(Z,k[0].row,k[0].column)},j2=(v,k,D,P)=>{const Z=gh(k),te=Tt(Z,Ee=>Ee.column),ge=L2(v,te,!1,D,P.replaceOrInit);return Fr(ge,k[0].row,k[0].column)},ag=(v,k,D,P)=>{const Z=oC(v,k,D,P.replaceOrInit);return Fr(Z,k[0].row,k[0].column)},fc=(v,k)=>(D,P,Z,te,ge)=>{const Ee=Yl(P),Fe=Tt(Ee,wt=>wt.row),ot=Kp(D,Fe,v,k,Z,te.replaceOrInit,ge);return Fr(ot,P[0].row,P[0].column)},r3=fc("thead",!0),lg=fc("tbody",!1),$k=fc("tfoot",!1),zk=(v,k,D,P)=>{const Z=gh(k.details),te=Lk(v,Tt(Z,Ee=>Ee.column)),ge=te.length>0?te[0].cells.length-1:0;return Fr(te,Z[0].row,Math.min(Z[0].column,ge))},Z2=(v,k,D,P)=>{const Z=Yl(k),te=I2(v,Z[0].row,Z[Z.length-1].row),ge=te.length>0?te.length-1:0;return Fr(te,Math.min(k[0].row,ge),k[0].column)},q2=(v,k,D,P)=>{const Z=k.cells;rC(Z);const te=Z_(v,k.bounds,D,P.merge(Z));return ml(te,be.from(Z[0]))},sm=(v,k,D,P)=>{const te=xn(k,(ge,Ee)=>M2(ge,Ee,D,P.unmerge(Ee)),v);return ml(te,be.from(k[0]))},G2=(v,k,D,P)=>{const te=((Fe,ot)=>{const wt=xe.fromTable(Fe);return Fc(wt,ot,!0)})(k.clipboard,k.generators),ge=bf(k.row,k.column);return Zp(ge,v,te,k.generators,D).fold(()=>ml(v,be.some(k.element)),Fe=>Fr(Fe,k.row,k.column))},Jp=(v,k,D)=>{const P=Vh(v,D.section),Z=xe.generate(P);return Fc(Z,k,!0)},gl=(v,k,D,P)=>{const Z=Ta(v).rows,te=k.cells[0].column,ge=Z[k.cells[0].row],Ee=Jp(k.clipboard,k.generators,ge),Fe=qp(te,v,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},Al=(v,k,D,P)=>{const Z=Ta(v).rows,te=k.cells[k.cells.length-1].column+k.cells[k.cells.length-1].colspan,ge=Z[k.cells[0].row],Ee=Jp(k.clipboard,k.generators,ge),Fe=qp(te,v,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},An=(v,k,D,P)=>{const Z=Ta(v).rows,te=k.cells[0].row,ge=Z[te],Ee=Jp(k.clipboard,k.generators,ge),Fe=og(te,v,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},Vk=(v,k,D,P)=>{const Z=Ta(v).rows,te=k.cells[k.cells.length-1].row+k.cells[k.cells.length-1].rowspan,ge=Z[k.cells[0].row],Ee=Jp(k.clipboard,k.generators,ge),Fe=og(te,v,Ee,k.generators,D);return Fr(Fe,k.cells[0].row,k.cells[0].column)},Xl=(v,k)=>{const D=xe.fromTable(v);return Xf(D,k).bind(Z=>{const te=Z[Z.length-1],ge=Z[0].column,Ee=te.column+te.colspan,Fe=ho(Tt(D.all,ot=>kt(ot.cells,wt=>wt.column>=ge&&wt.column<Ee)));return x2(Fe)}).getOr("")},Uk=(v,k)=>{const D=xe.fromTable(v);return Xf(D,k).bind(x2).getOr("")},K2=(v,k)=>{const D=xe.fromTable(v);return Xf(D,k).bind(Z=>{const te=Z[Z.length-1],ge=Z[0].row,Ee=te.row+te.rowspan,Fe=D.all.slice(ge,Ee);return W_(Fe)}).getOr("")},to=(v,k,D,P)=>yb(v,k,D,P.sizing),Cc=(v,k,D,P)=>$2(v,k,D,P.sizing,P.resize),Y2=(v,k)=>nt(k,D=>D.column===0&&D.isLocked),n0=(v,k)=>nt(k,D=>D.column+D.colspan>=v.grid.columns&&D.isLocked),sf=(v,k)=>{const D=Cf(v),P=gh(k);return We(P,(Z,te)=>{const Ee=D[te.column].map(rt).getOr(0);return Z+Ee},0)},$v=v=>(k,D)=>Xf(k,D).filter(P=>!(v?Y2:n0)(k,P)).map(P=>({details:P,pixelDelta:sf(k,P)})),Qp=(v,k)=>ef(v,k).map(D=>({details:D,pixelDelta:-sf(v,D)})),Of=v=>(k,D)=>mh(k,D).filter(P=>!(v?Y2:n0)(k,P.cells)),nl=Tu.transform("th"),Md=Tu.transform("td"),Rd=Sa(Hl,Xf,z,z,Tu.modification),Hc=Sa(om,Xf,z,z,Tu.modification),o0=Sa(vr,$v(!0),Cc,z,Tu.modification),X2=Sa(iC,$v(!1),Cc,z,Tu.modification),aC=Sa(zk,Qp,Cc,W2,Tu.modification),J2=Sa(Z2,Xf,z,W2,Tu.modification),bh=Sa(au,ef,z,z,nl),jr=Sa(j2,ef,z,z,Md),zv=Sa(r3,ef,z,z,nl),ed=Sa(lg,ef,z,z,Md),lC=Sa($k,ef,z,z,Md),cC=Sa(xl,ef,z,z,nl),ia=Sa(ag,ef,z,z,Md),Wk=Sa(q2,mb,to,z,Tu.merging),Vv=Sa(sm,gb,to,z,Tu.merging),Uv=Sa(G2,Ik,to,z,Tu.modification),uC=Sa(gl,Of(!0),z,z,Tu.modification),jk=Sa(Al,Of(!1),z,z,Tu.modification),s0=Sa(An,mh,z,z,Tu.modification),fC=Sa(Vk,mh,z,z,Tu.modification),Zk=Xl,dC=Uk,qk=K2,hC=(v,k)=>v.dispatch("NewRow",{node:k}),Wv=(v,k)=>v.dispatch("NewCell",{node:k}),ip=(v,k,D)=>{v.dispatch("TableModified",{...D,table:k})},r0=(v,k,D,P,Z)=>{v.dispatch("TableSelectionChange",{cells:k,start:D,finish:P,otherCells:Z})},Ui=v=>{v.dispatch("TableSelectionClear")},Q2=(v,k,D,P,Z)=>{v.dispatch("ObjectResizeStart",{target:k,width:D,height:P,origin:Z})},Sc=(v,k,D,P,Z)=>{v.dispatch("ObjectResized",{target:k,width:D,height:P,origin:Z})},i0={structure:!1,style:!0},ol={structure:!0,style:!1},mC={structure:!0,style:!0},rm=(v,k)=>Ed(v)?Jc.percentageSize(k):qm(v)?Jc.pixelSize(k):Jc.getTableSize(k),Gk=(v,k,D)=>{const P=Iu=>Wt(Af(Iu))==="table",Z=Iu=>!P(v)||k2(Iu).rows>1,te=Iu=>!P(v)||k2(Iu).columns>1,ge=Kh(v),Ee=Oa(v)?z:Lc,Fe=Iu=>{switch(jg(v)){case"section":return qa.section();case"sectionCells":return qa.sectionCells();case"cells":return qa.cells();default:return qa.getTableSectionType(Iu,"section")}},ot=(Iu,Ow)=>Ow.cursor.fold(()=>{const Mw=Il(Iu);return Pe(Mw).filter(Fi).map(hg=>{D.clearSelectedCells(Iu.dom);const dc=v.dom.createRng();return dc.selectNode(hg.dom),v.selection.setRng(dc),Ur(hg,"data-mce-selected","1"),dc})},Mw=>{const hg=ab(Mw),dc=v.dom.createRng();return dc.setStart(hg.element.dom,hg.offset),dc.setEnd(hg.element.dom,hg.offset),v.selection.setRng(dc),D.clearSelectedCells(Iu.dom),be.some(dc)}),wt=(Iu,Ow,Mw,hg)=>(dc,XE,I3=!1)=>{ih(dc);const B3=it.fromDom(v.getDoc()),L3=Da(Mw,B3,ge),lM={sizing:rm(v,dc),resize:Oa(v)?U_():Wp(),section:Fe(dc)};return Ow(dc)?Iu(dc,XE,L3,lM).bind(JE=>{k.refresh(dc.dom),He(JE.newRows,Rw=>{hC(v,Rw.dom)}),He(JE.newCells,Rw=>{Wv(v,Rw.dom)});const cM=ot(dc,JE);return Fi(dc)&&(ih(dc),I3||ip(v,dc.dom,hg)),cM.map(Rw=>({rng:Rw,effect:hg}))}):be.none()},un=wt(J2,Z,z,ol),jn=wt(aC,te,z,ol),Vn=wt(Rd,_e,z,ol),tn=wt(Hc,_e,z,ol),Un=wt(o0,_e,Ee,ol),Xt=wt(X2,_e,Ee,ol),fo=wt(Wk,_e,z,ol),as=wt(Vv,_e,z,ol),Ts=wt(uC,_e,z,ol),aa=wt(jk,_e,z,ol),Dl=wt(s0,_e,z,ol),bl=wt(fC,_e,z,ol),Nu=wt(Uv,_e,z,mC),Fb=wt(cC,_e,z,ol),Dw=wt(ia,_e,z,ol),eS=wt(bh,_e,z,ol),tS=wt(jr,_e,z,ol),wi=wt(zv,_e,z,ol),Pu=wt(ed,_e,z,ol),lf=wt(lC,_e,z,ol);return{deleteRow:un,deleteColumn:jn,insertRowsBefore:Vn,insertRowsAfter:tn,insertColumnsBefore:Un,insertColumnsAfter:Xt,mergeCells:fo,unmergeCells:as,pasteColsBefore:Ts,pasteColsAfter:aa,pasteRowsBefore:Dl,pasteRowsAfter:bl,pasteCells:Nu,makeCellsHeader:Fb,unmakeCellsHeader:Dw,makeColumnsHeader:eS,unmakeColumnsHeader:tS,makeRowsHeader:wi,makeRowsBody:Pu,makeRowsFooter:lf,getTableRowType:qk,getTableCellType:dC,getTableColType:Zk}},Jl=(v,k,D)=>{const P=Tr(v,k,1);D===1||P<=1?qe(v,k):Ur(v,k,Math.min(D,P))},rf=(v,k)=>D=>{const P=D.column+D.colspan-1,Z=D.column;return P>=v&&Z<k},Cb=(v,k,D)=>{if(xe.hasColumns(v)){const P=kt(xe.justColumns(v),rf(k,D)),Z=Tt(P,ge=>{const Ee=Mc(ge.element);return Jl(Ee,"span",D-k),Ee}),te=it.fromTag("colgroup");return La(te,Z),[te]}else return[]},Kk=(v,k,D)=>Tt(v.all,P=>{const Z=kt(P.cells,rf(k,D)),te=Tt(Z,Ee=>{const Fe=Mc(Ee.element);return Jl(Fe,"colspan",D-k),Fe}),ge=it.fromTag("tr");return La(ge,te),ge}),Yk=(v,k)=>{const D=xe.fromTable(v);return ef(D,k).map(Z=>{const te=Z[Z.length-1],ge=Z[0].column,Ee=te.column+te.colspan,Fe=Cb(D,ge,Ee),ot=Kk(D,ge,Ee);return[...Fe,...ot]})},gC=(v,k,D)=>{const P=xe.fromTable(v);return Xf(P,k).bind(te=>{const ge=Fc(P,D,!1),Fe=Ta(ge).rows.slice(te[0].row,te[te.length-1].row+te[te.length-1].rowspan),ot=ao(Fe,un=>{const jn=kt(un.cells,Vn=>!Vn.isLocked);return jn.length>0?[{...un,cells:jn}]:[]}),wt=O2(ot);return da(wt.length>0,wt)}).map(te=>D2(te))},Sb=sg.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),pC=(v,k,D)=>{const P=D.substring(0,D.length-v.length),Z=parseFloat(P);return P===Z.toString()?k(Z):Sb.invalid(D)},ap={...Sb,from:v=>Vu(v,"%")?pC("%",Sb.percent,v):Vu(v,"px")?pC("px",Sb.pixels,v):Sb.invalid(v)},Xk=(v,k)=>Tt(v,D=>ap.from(D).fold(()=>D,Z=>Z/k*100+"%",Z=>Z+"%")),Jk=(v,k,D)=>{const P=D/k;return Tt(v,Z=>ap.from(Z).fold(()=>Z,ge=>ge*P+"px",ge=>ge/100*D+"px"))},Qk=(v,k)=>{const D=v.fold(()=>F(""),P=>{const Z=P/k;return F(Z+"px")},()=>{const P=100/k;return F(P+"%")});return Ot(k,D)},ew=(v,k,D)=>v.fold(()=>k,P=>Jk(k,D,P),P=>Xk(k,D)),jv=(v,k,D)=>{const P=ap.from(D),Z=xo(v,te=>te==="0px")?Qk(P,v.length):ew(P,v,k);return Zv(Z)},cg=(v,k)=>v.length===0?k:xn(v,(D,P)=>ap.from(P).fold(F(0),ne,ne)+D,0),vC=(v,k)=>{const D=Math.floor(v);return{value:D+k,remainder:v-D}},yC=(v,k)=>ap.from(v).fold(F(v),D=>D+k+"px",D=>D+k+"%"),Zv=v=>{if(v.length===0)return v;const k=xn(v,(P,Z)=>{const te=ap.from(Z).fold(()=>({value:Z,remainder:0}),ge=>vC(ge,"px"),ge=>({value:ge+"%",remainder:0}));return{output:[te.value].concat(P.output),remainder:P.remainder+te.remainder}},{output:[],remainder:0}),D=k.output;return D.slice(0,D.length-1).concat([yC(D[D.length-1],Math.round(k.remainder))])},a0=ap.from,ug=(v,k,D)=>{He(k,P=>{const Z=v.slice(P.column,P.colspan+P.column),te=cg(Z,Hi());xi(P.element,"width",te+D)})},qv=(v,k,D)=>{He(k,(P,Z)=>{const te=cg([v[Z]],Hi());xi(P.element,"width",te+D)})},Gv=(v,k,D,P)=>{He(D,Z=>{const te=v.slice(Z.row,Z.rowspan+Z.row),ge=cg(te,rc());xi(Z.element,"height",ge+P)}),He(k,(Z,te)=>{xi(Z.element,"height",v[te])})},kb=v=>a0(v).fold(F("px"),F("px"),F("%")),wC=(v,k,D)=>{const P=xe.fromTable(v),Z=P.all,te=xe.justCells(P),ge=xe.justColumns(P);k.each(Ee=>{const Fe=kb(Ee),ot=Ye(v),wt=zm(P,v),un=jv(wt,ot,Ee);xe.hasColumns(P)?qv(un,ge,Fe):ug(un,te,Fe),xi(v,"width",Ee)}),D.each(Ee=>{const Fe=kb(Ee),ot=jf(v),wt=_c(P,v,Xn),un=jv(wt,ot,Ee);Gv(un,Z,te,Fe),xi(v,"height",Ee)})},vh=Va,Eb=Ug,_C=Ic,yh=v=>{qe(v,"width")},lp=v=>{const k=Ca(v);wC(v,be.some(k),be.none()),yh(v)},tw=v=>{const k=J0(v);wC(v,be.some(k),be.none()),yh(v)},CC=v=>{yc(v,"width");const k=Im(v),D=k.length>0?k:Il(v);He(D,P=>{yc(P,"width"),yh(P)}),yh(v)},Kv={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},eE=()=>it.fromTag("th"),SC=()=>it.fromTag("td"),tE=()=>it.fromTag("col"),nE=(v,k,D,P)=>{const Z=it.fromTag("tr");for(let te=0;te<v;te++){const ge=P<k||te<D?eE():SC();te<D&&Ur(ge,"scope","row"),P<k&&Ur(ge,"scope","col"),Ar(ge,it.fromTag("br")),Ar(Z,ge)}return Z},kC=v=>{const k=it.fromTag("colgroup");return Ot(v,()=>Ar(k,tE())),k},EC=(v,k,D,P)=>Ot(v,Z=>nE(k,D,P,Z)),xC=(v,k,D,P,Z,te=Kv)=>{const ge=it.fromTag("table"),Ee=Z!=="cells";_l(ge,te.styles),Bi(ge,te.attributes),te.colGroups&&Ar(ge,kC(k));const Fe=Math.min(v,D);if(Ee&&D>0){const Vn=it.fromTag("thead");Ar(ge,Vn);const Un=EC(D,k,Z==="sectionCells"?Fe:0,P);La(Vn,Un)}const ot=it.fromTag("tbody");Ar(ge,ot);const wt=Ee?v-Fe:v,jn=EC(wt,k,Ee?0:D,P);return La(ot,jn),ge},oE=v=>v.dom.innerHTML,sE=v=>{const k=it.fromTag("div"),D=it.fromDom(v.dom.cloneNode(!0));return Ar(k,D),oE(k)},rE=(v,k)=>{v.selection.select(k.dom,!0),v.selection.collapse(!0)},AC=(v,k)=>{Kc(k,"td,th").each(re(rE,v))},nw=(v,k)=>{He(mi(k,"tr"),D=>{hC(v,D.dom),He(mi(D,"th,td"),P=>{Wv(v,P.dom)})})},ow=v=>f(v)&&v.indexOf("%")!==-1,iE=(v,k,D,P,Z)=>{const te=H_(v),ge={styles:te,attributes:Z1(v),colGroups:Ma(v)};return v.undoManager.ignore(()=>{const Ee=xC(D,k,Z,P,jg(v),ge);Ur(Ee,"data-mce-id","__mce");const Fe=sE(Ee);v.insertContent(Fe),v.addVisual()}),Kc(Af(v),'table[data-mce-id="__mce"]').map(Ee=>(qm(v)?tw(Ee):Gm(v)?CC(Ee):(Ed(v)||ow(te.width))&&lp(Ee),ih(Ee),qe(Ee,"data-mce-id"),nw(v,Ee),AC(v,Ee),Ee.dom)).getOrNull()},aE=(v,k,D,P={})=>{const Z=te=>j(te)&&te>0;if(Z(k)&&Z(D)){const te=P.headerRows||0,ge=P.headerColumns||0;return iE(v,D,k,ge,te)}else return console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table."),null};var Yv=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const TC="x-tinymce/dom-table-",Xv=TC+"rows",xb=TC+"columns",l0=v=>{const k=Yv.FakeClipboardItem(v);Yv.write([k])},Jv=v=>{var k;const D=(k=Yv.read())!==null&&k!==void 0?k:[];return gn(D,P=>be.from(P.getType(v)))},sw=v=>{Jv(v).isSome()&&Yv.clear()},DC=v=>{v.fold(lE,k=>l0({[Xv]:k}))},rw=()=>Jv(Xv),lE=()=>sw(Xv),Qv=v=>{v.fold(cE,k=>l0({[xb]:k}))},Ab=()=>Jv(xb),cE=()=>sw(xb),ey=v=>w2(Au(v),Ym(v)).filter(ah),af=v=>Up(Au(v),Ym(v)).filter(ah),ty=(v,k)=>{const D=Ym(v),P=()=>ey(v).each(Xt=>{el(Xt,D).filter(J(D)).each(fo=>{const as=it.fromText("");if(Vl(fo,as),Yi(fo),v.dom.isEmpty(v.getBody()))v.setContent(""),v.selection.setCursorLocation();else{const Ts=v.dom.createRng();Ts.setStart(as.dom,0),Ts.setEnd(as.dom,0),v.selection.setRng(Ts),v.nodeChanged()}})}),Z=Xt=>ey(v).each(fo=>{Gm(v)||qm(v)||Ed(v)||el(fo,D).each(Ts=>{Xt==="relative"&&!vh(Ts)?lp(Ts):Xt==="fixed"&&!Eb(Ts)?tw(Ts):Xt==="responsive"&&!_C(Ts)&&CC(Ts),ih(Ts),ip(v,Ts.dom,ol)})}),te=Xt=>el(Xt,D),ge=Xt=>af(v).bind(fo=>te(fo).map(as=>Xt(as,fo))),Ee=(Xt,fo)=>{ge(as=>{v.formatter.toggle("tableclass",{value:fo},as.dom),ip(v,as.dom,i0)})},Fe=(Xt,fo)=>{ge(as=>{const Ts=Kf(v),Dl=xo(Ts,bl=>v.formatter.match("tablecellclass",{value:fo},bl.dom))?v.formatter.remove:v.formatter.apply;He(Ts,bl=>Dl("tablecellclass",{value:fo},bl.dom)),ip(v,as.dom,i0)})},ot=()=>{ey(v).each(Xt=>{el(Xt,D).each(fo=>{Ss(fo,"caption").fold(()=>{const as=it.fromTag("caption");Ar(as,it.fromText("Caption")),Rm(fo,as,0),v.selection.setCursorLocation(as.dom,0)},as=>{Ir("caption")(Xt)&&ua("td",fo).each(Ts=>v.selection.setCursorLocation(Ts.dom,0)),Yi(as)}),ip(v,fo.dom,ol)})})},wt=Xt=>{v.focus()},un=(Xt,fo=!1)=>ge((as,Ts)=>{const aa=Xg(Kf(v),as,Ts);Xt(as,aa,fo).each(wt)}),jn=()=>ge((Xt,fo)=>{const as=Xg(Kf(v),Xt,fo),Ts=Da(z,it.fromDom(v.getDoc()),be.none());return gC(Xt,as,Ts)}),Vn=()=>ge((Xt,fo)=>{const as=Xg(Kf(v),Xt,fo);return Yk(Xt,as)}),tn=(Xt,fo)=>fo().each(as=>{const Ts=Tt(as,aa=>Mc(aa));ge((aa,Dl)=>{const bl=cc(it.fromDom(v.getDoc())),Nu=ib(Kf(v),Dl,Ts,bl);Xt(aa,Nu).each(wt)})}),Un=Xt=>(fo,as)=>ba(as,"type").each(Ts=>{un(Xt(Ts),as.no_events)});bn({mceTableSplitCells:()=>un(k.unmergeCells),mceTableMergeCells:()=>un(k.mergeCells),mceTableInsertRowBefore:()=>un(k.insertRowsBefore),mceTableInsertRowAfter:()=>un(k.insertRowsAfter),mceTableInsertColBefore:()=>un(k.insertColumnsBefore),mceTableInsertColAfter:()=>un(k.insertColumnsAfter),mceTableDeleteCol:()=>un(k.deleteColumn),mceTableDeleteRow:()=>un(k.deleteRow),mceTableCutCol:()=>Vn().each(Xt=>{Qv(Xt),un(k.deleteColumn)}),mceTableCutRow:()=>jn().each(Xt=>{DC(Xt),un(k.deleteRow)}),mceTableCopyCol:()=>Vn().each(Xt=>Qv(Xt)),mceTableCopyRow:()=>jn().each(Xt=>DC(Xt)),mceTablePasteColBefore:()=>tn(k.pasteColsBefore,Ab),mceTablePasteColAfter:()=>tn(k.pasteColsAfter,Ab),mceTablePasteRowBefore:()=>tn(k.pasteRowsBefore,rw),mceTablePasteRowAfter:()=>tn(k.pasteRowsAfter,rw),mceTableDelete:P,mceTableCellToggleClass:Fe,mceTableToggleClass:Ee,mceTableToggleCaption:ot,mceTableSizingMode:(Xt,fo)=>Z(fo),mceTableCellType:Un(Xt=>Xt==="th"?k.makeCellsHeader:k.unmakeCellsHeader),mceTableColType:Un(Xt=>Xt==="th"?k.makeColumnsHeader:k.unmakeColumnsHeader),mceTableRowType:Un(Xt=>{switch(Xt){case"header":return k.makeRowsHeader;case"footer":return k.makeRowsFooter;default:return k.makeRowsBody}})},(Xt,fo)=>v.addCommand(fo,Xt)),v.addCommand("mceInsertTable",(Xt,fo)=>{aE(v,fo.rows,fo.columns,fo.options)}),v.addCommand("mceTableApplyCellStyle",(Xt,fo)=>{const as=Dl=>"tablecell"+Dl.toLowerCase().replace("-","");if(!h(fo))return;const Ts=kt(Kf(v),ah);if(Ts.length===0)return;const aa=Ns(fo,(Dl,bl)=>v.formatter.has(as(bl))&&f(Dl));Zr(aa)||(bn(aa,(Dl,bl)=>{const Nu=as(bl);He(Ts,Fb=>{Dl===""?v.formatter.remove(Nu,{value:null},Fb.dom,!0):v.formatter.apply(Nu,{value:Dl},Fb.dom)})}),te(Ts[0]).each(Dl=>ip(v,Dl.dom,i0)))})},OC=(v,k)=>{const D=Ym(v),P=Z=>Up(Au(v)).bind(te=>el(te,D).map(ge=>{const Ee=Xg(Kf(v),ge,te);return Z(ge,Ee)})).getOr("");bn({mceTableRowType:()=>P(k.getTableRowType),mceTableCellType:()=>P(k.getTableCellType),mceTableColType:()=>P(k.getTableColType)},(Z,te)=>v.addQueryValueHandler(te,Z))},ny=sg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),uE=(v,k,D,P)=>v.fold(k,D,P),Tb=v=>v.fold(ne,ne,ne),iw=ny.before,fE=ny.on,oy=ny.after,pl={before:iw,on:fE,after:oy,cata:uE,getStart:Tb},c0={create:(v,k)=>({selection:v,kill:k})},hE=(v,k)=>{const D=v.document.createRange();return D.selectNode(k.dom),D},u0=(v,k)=>{const D=v.document.createRange();return aw(D,k),D},aw=(v,k)=>v.selectNodeContents(k.dom),mE=(v,k)=>{k.fold(D=>{v.setStartBefore(D.dom)},(D,P)=>{v.setStart(D.dom,P)},D=>{v.setStartAfter(D.dom)})},gE=(v,k)=>{k.fold(D=>{v.setEndBefore(D.dom)},(D,P)=>{v.setEnd(D.dom,P)},D=>{v.setEndAfter(D.dom)})},Db=(v,k,D)=>{const P=v.document.createRange();return mE(P,k),gE(P,D),P},im=(v,k,D,P,Z)=>{const te=v.document.createRange();return te.setStart(k.dom,D),te.setEnd(P.dom,Z),te},f0=v=>({left:v.left,top:v.top,right:v.right,bottom:v.bottom,width:v.width,height:v.height}),lu=v=>{const k=v.getClientRects(),D=k.length>0?k[0]:v.getBoundingClientRect();return D.width>0||D.height>0?be.some(D).map(f0):be.none()},e1=sg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),MC=(v,k,D)=>k(it.fromDom(D.startContainer),D.startOffset,it.fromDom(D.endContainer),D.endOffset),RC=(v,k)=>k.match({domRange:D=>({ltr:F(D),rtl:be.none}),relative:(D,P)=>({ltr:_f(()=>Db(v,D,P)),rtl:_f(()=>be.some(Db(v,P,D)))}),exact:(D,P,Z,te)=>({ltr:_f(()=>im(v,D,P,Z,te)),rtl:_f(()=>be.some(im(v,Z,te,D,P)))})}),lw=(v,k)=>{const D=k.ltr();return D.collapsed?k.rtl().filter(Z=>Z.collapsed===!1).map(Z=>e1.rtl(it.fromDom(Z.endContainer),Z.endOffset,it.fromDom(Z.startContainer),Z.startOffset)).getOrThunk(()=>MC(v,e1.ltr,D)):MC(v,e1.ltr,D)},cw=(v,k)=>{const D=RC(v,k);return lw(v,D)},uw=(v,k)=>cw(v,k).match({ltr:(P,Z,te,ge)=>{const Ee=v.document.createRange();return Ee.setStart(P.dom,Z),Ee.setEnd(te.dom,ge),Ee},rtl:(P,Z,te,ge)=>{const Ee=v.document.createRange();return Ee.setStart(te.dom,ge),Ee.setEnd(P.dom,Z),Ee}});e1.ltr,e1.rtl;const Ob={create:(v,k,D,P)=>({start:v,soffset:k,finish:D,foffset:P})},cp={create:(v,k,D,P)=>({start:pl.on(v,k),finish:pl.on(D,P)})},Mb=(v,k)=>{const D=uw(v,k);return Ob.create(it.fromDom(D.startContainer),D.startOffset,it.fromDom(D.endContainer),D.endOffset)},wh=cp.create,bE=(v,k,D,P,Z,te,ge)=>ur(D,Z)&&P===te?be.none():Ei(D,"td,th",k).bind(Ee=>Ei(Z,"td,th",k).bind(Fe=>am(v,k,Ee,Fe,ge))),am=(v,k,D,P,Z)=>ur(D,P)?be.none():ou(D,P,k).bind(te=>{const ge=te.boxes.getOr([]);return ge.length>1?(Z(v,ge,te.start,te.finish),be.some(c0.create(be.some(wh(D,0,D,tr(D))),!0))):be.none()}),Nd=(v,k,D,P,Z)=>{const te=ge=>(Z.clearBeforeUpdate(D),Z.selectRange(D,ge.boxes,ge.start,ge.finish),ge.boxes);return Ok(P,v,k,Z.firstSelectedSelector,Z.lastSelectedSelector).map(te)},d0=(v,k)=>({item:v,mode:k}),fw=(v,k,D,P=h0)=>v.property().parent(k).map(Z=>d0(Z,P)),h0=(v,k,D,P=fg)=>D.sibling(v,k).map(Z=>d0(Z,P)),fg=(v,k,D,P=fg)=>{const Z=v.property().children(k);return D.first(Z).map(ge=>d0(ge,P))},S=[{current:fw,next:h0,fallback:be.none()},{current:h0,next:fg,fallback:be.some(fw)},{current:fg,next:fg,fallback:be.some(h0)}],T=(v,k,D,P,Z=S)=>he(Z,ge=>ge.current===D).bind(ge=>ge.current(v,k,P,ge.next).orThunk(()=>ge.fallback.bind(Ee=>T(v,k,Ee,P)))),ke={left:()=>({sibling:(D,P)=>D.query().prevSibling(P),first:D=>D.length>0?be.some(D[D.length-1]):be.none()}),right:()=>({sibling:(D,P)=>D.query().nextSibling(P),first:D=>D.length>0?be.some(D[0]):be.none()})},Ve=(v,k,D,P,Z,te)=>T(v,k,P,Z).bind(Ee=>te(Ee.item)?be.none():D(Ee.item)?be.some(Ee.item):Ve(v,Ee.item,D,Ee.mode,Z,te)),dt=(v,k,D,P)=>Ve(v,k,D,h0,ke.left(),P),_t=(v,k,D,P)=>Ve(v,k,D,h0,ke.right(),P),zt=v=>k=>v.property().children(k).length===0,pn=(v,k,D)=>zn(v,k,zt(v),D),Hn=(v,k,D)=>Lo(v,k,zt(v),D),zn=dt,Lo=_t,hs=en(),Is=(v,k)=>pn(hs,v,k),Hr=(v,k)=>Hn(hs,v,k),$s=(v,k,D)=>zn(hs,v,k,D),fi=(v,k,D)=>Lo(hs,v,k,D),yi=(v,k,D)=>qr(v,k,D).isSome(),cu=sg.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Ou=(v,k,D)=>{const P=v.getRect(k),Z=v.getRect(D);return Z.right>P.left&&Z.left<P.right},Mf=v=>Ei(v,"tr"),td={...cu,verify:(v,k,D,P,Z,te,ge)=>Ei(P,"td,th",ge).bind(Ee=>Ei(k,"td,th",ge).map(Fe=>ur(Ee,Fe)?ur(P,Ee)&&tr(Ee)===Z?te(Fe):cu.none("in same cell"):vi(Mf,[Ee,Fe]).fold(()=>Ou(v,Fe,Ee)?cu.success():te(Fe),ot=>te(Fe)))).getOr(cu.none("default")),cata:(v,k,D,P,Z)=>v.fold(k,D,P,Z)},dw=(v,k,D,P)=>({parent:v,children:k,element:D,index:P}),uu=v=>Ki(v).bind(k=>{const D=gr(k);return NC(D,v).map(P=>dw(k,D,v,P))}),NC=(v,k)=>es(v,re(ur,k)),Rb=Ir("br"),Nb=(v,k,D)=>k(v,D).bind(P=>wo(P)&&Uo(P).trim().length===0?Nb(P,k,D):be.some(P)),Pd=(v,k,D)=>D.traverse(k).orThunk(()=>Nb(k,D.gather,v)).map(D.relative),m0=(v,k)=>Ja(v,k).filter(Rb).orThunk(()=>Ja(v,k-1).filter(Rb)),vE=(v,k,D,P)=>m0(k,D).bind(Z=>P.traverse(Z).fold(()=>Nb(Z,P.gather,v).map(P.relative),te=>uu(te).map(ge=>pl.on(ge.parent,ge.index)))),ry=(v,k,D,P)=>(Rb(k)?Pd(v,k,P):vE(v,k,D,P)).map(te=>({start:te,finish:te})),Rf=v=>td.cata(v,k=>be.none(),()=>be.none(),k=>be.some(Qg(k,0)),k=>be.some(Qg(k,tr(k)))),Mu=(v,k)=>({left:v.left,top:v.top+k,right:v.right,bottom:v.bottom+k}),sl=(v,k)=>({left:v.left,top:v.top-k,right:v.right,bottom:v.bottom-k}),Id=(v,k,D)=>({left:v.left+k,top:v.top+D,right:v.right+k,bottom:v.bottom+D}),PC=v=>v.top,$c=v=>v.bottom,g0=(v,k,D)=>D>=0&&D<tr(k)?v.getRangedRect(k,D,k,D+1):D>0?v.getRangedRect(k,D-1,k,D):be.none(),iy=v=>({left:v.left,top:v.top,right:v.right,bottom:v.bottom}),hw=(v,k)=>be.some(v.getRect(k)),yE=(v,k,D)=>ts(k)?hw(v,k).map(iy):wo(k)?g0(v,k,D).map(iy):be.none(),wE=(v,k)=>ts(k)?hw(v,k).map(iy):wo(k)?v.getRangedRect(k,0,k,tr(k)).map(iy):be.none(),t1=5,mw=100,dg=sg.generate([{none:[]},{retry:["caret"]}]),xO=(v,k)=>v.left<k.left||Math.abs(k.right-v.left)<1||v.left>k.right,_E=(v,k,D)=>Nl(k,Xp).fold(De,P=>wE(v,P).exists(Z=>xO(D,Z))),i3=(v,k,D,P,Z)=>{const te=Mu(Z,t1);return Math.abs(D.bottom-P.bottom)<1||D.top>Z.bottom?dg.retry(te):D.top===Z.bottom?dg.retry(Mu(Z,1)):_E(v,k,Z)?dg.retry(Id(te,t1,0)):dg.none()},a3={point:PC,adjuster:(v,k,D,P,Z)=>{const te=sl(Z,t1);return Math.abs(D.top-P.top)<1||D.bottom<Z.top?dg.retry(te):D.bottom===Z.top?dg.retry(sl(Z,1)):_E(v,k,Z)?dg.retry(Id(te,t1,0)):dg.none()},move:sl,gather:Is},l3={point:$c,adjuster:i3,move:Mu,gather:Hr},CE=(v,k,D)=>v.elementFromPoint(k,D).filter(P=>Wt(P)==="table").isSome(),SE=(v,k,D,P,Z)=>kE(v,k,D,k.move(P,t1),Z),kE=(v,k,D,P,Z)=>Z===0?be.some(P):CE(v,P.left,k.point(P))?SE(v,k,D,P,Z-1):v.situsFromPoint(P.left,k.point(P)).bind(te=>te.start.fold(be.none,ge=>wE(v,ge).bind(Ee=>k.adjuster(v,ge,Ee,D,P).fold(be.none,Fe=>kE(v,k,D,Fe,Z-1))).orThunk(()=>be.some(P)),be.none)),c3=(v,k,D)=>v.point(k)>D.getInnerHeight()?be.some(v.point(k)-D.getInnerHeight()):v.point(k)<0?be.some(-v.point(k)):be.none(),u3=(v,k,D)=>{const P=v.move(D,t1),Z=kE(k,v,D,P,mw).getOr(P);return c3(v,Z,k).fold(()=>k.situsFromPoint(Z.left,v.point(Z)),te=>(k.scrollBy(0,te),k.situsFromPoint(Z.left,v.point(Z)-te)))},f3={tryUp:re(u3,a3),tryDown:re(u3,l3),getJumpSize:F(t1)},AO=20,TO=(v,k,D)=>v.getSelection().bind(P=>ry(k,P.finish,P.foffset,D).fold(()=>be.some(Qg(P.finish,P.foffset)),Z=>{const te=v.fromSitus(Z),ge=td.verify(v,P.finish,P.foffset,te.finish,te.foffset,D.failure,k);return Rf(ge)})),Bd=(v,k,D,P,Z,te)=>te===0?be.none():_h(v,k,D,P,Z).bind(ge=>{const Ee=v.fromSitus(ge),Fe=td.verify(v,D,P,Ee.finish,Ee.foffset,Z.failure,k);return td.cata(Fe,()=>be.none(),()=>be.some(ge),ot=>ur(D,ot)&&P===0?DO(v,D,P,sl,Z):Bd(v,k,ot,0,Z,te-1),ot=>ur(D,ot)&&P===tr(ot)?DO(v,D,P,Mu,Z):Bd(v,k,ot,tr(ot),Z,te-1))}),DO=(v,k,D,P,Z)=>yE(v,k,D).bind(te=>Ks(v,Z,P(te,f3.getJumpSize()))),Ks=(v,k,D)=>{const P=Zh().browser;return P.isChromium()||P.isSafari()||P.isFirefox()?k.retry(v,D):be.none()},_h=(v,k,D,P,Z)=>yE(v,D,P).bind(te=>Ks(v,Z,te)),p0=(v,k,D)=>TO(v,k,D).bind(P=>Bd(v,k,P.element,P.offset,D,AO).map(v.fromSitus)),EE=(v,k)=>yi(v,D=>Ki(D).exists(P=>ur(P,k))),d3=(v,k,D,P,Z)=>Ei(P,"td,th",k).bind(te=>Ei(te,"table",k).bind(ge=>EE(Z,ge)?p0(v,k,D).bind(Ee=>Ei(Ee.finish,"td,th",k).map(Fe=>({start:te,finish:Fe,range:Ee}))):be.none())),ay=(v,k,D,P,Z,te)=>te(P,k).orThunk(()=>d3(v,k,D,P,Z).map(ge=>{const Ee=ge.range;return c0.create(be.some(wh(Ee.start,Ee.soffset,Ee.finish,Ee.foffset)),!0)})),OO=(v,k)=>Ei(v,"tr",k).bind(D=>Ei(D,"table",k).bind(P=>{const Z=mi(P,"tr");return ur(D,Z[0])?$s(P,te=>oh(te).isSome(),k).map(te=>{const ge=tr(te);return c0.create(be.some(wh(te,ge,te,ge)),!0)}):be.none()})),xE=(v,k)=>Ei(v,"tr",k).bind(D=>Ei(D,"table",k).bind(P=>{const Z=mi(P,"tr");return ur(D,Z[Z.length-1])?fi(P,te=>Ef(te).isSome(),k).map(te=>c0.create(be.some(wh(te,0,te,0)),!0)):be.none()})),IC=(v,k,D,P,Z,te,ge)=>d3(v,D,P,Z,te).bind(Ee=>am(k,D,Ee.start,Ee.finish,ge)),gw=v=>{let k=v;return{get:()=>k,set:Z=>{k=Z}}},MO=v=>{const k=gw(be.none()),D=()=>k.get().each(v);return{clear:()=>{D(),k.set(be.none())},isSet:()=>k.get().isSome(),get:()=>k.get(),set:Ee=>{D(),k.set(be.some(Ee))}}},AE=()=>{const v=MO(z);return{...v,on:D=>v.get().each(D)}},BC=(v,k)=>Ei(v,"td,th",k),TE=v=>fl(v).exists(Km),CI=(v,k,D,P)=>{const Z=AE(),te=Z.clear,ge=wt=>{Z.on(un=>{P.clearBeforeUpdate(k),BC(wt.target,D).each(jn=>{ou(un,jn,D).each(Vn=>{const tn=Vn.boxes.getOr([]);if(tn.length===1){const Un=tn[0],Xt=nu(Un)==="false",fo=sc(Zg(wt.target),Un,ur);Xt&&fo&&(P.selectRange(k,tn,Un,Un),v.selectContents(Un))}else tn.length>1&&(P.selectRange(k,tn,Vn.start,Vn.finish),v.selectContents(jn))})})})};return{clearstate:te,mousedown:wt=>{P.clear(k),BC(wt.target,D).filter(TE).each(Z.set)},mouseover:wt=>{ge(wt)},mouseup:wt=>{ge(wt),te()}}},h3={traverse:gu,gather:Hr,relative:pl.before,retry:f3.tryDown,failure:td.failedDown},DE={traverse:Zc,gather:Is,relative:pl.before,retry:f3.tryUp,failure:td.failedUp},ly=v=>k=>k===v,pw=ly(38),b0=ly(40),up=v=>v>=37&&v<=40,m3={isBackward:ly(37),isForward:ly(39)},RO={isBackward:ly(39),isForward:ly(37)},g3=v=>{const k=v!==void 0?v.dom:document,D=k.body.scrollLeft||k.documentElement.scrollLeft,P=k.body.scrollTop||k.documentElement.scrollTop;return Sf(D,P)},OE=(v,k,D)=>{const Z=(D!==void 0?D.dom:document).defaultView;Z&&Z.scrollBy(v,k)},cy=sg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ME=v=>cy.exact(v.start,v.soffset,v.finish,v.foffset),LC=v=>v.match({domRange:k=>it.fromDom(k.startContainer),relative:(k,D)=>pl.getStart(k),exact:(k,D,P,Z)=>k}),RE=cy.domRange,p3=cy.relative,bw=cy.exact,NE=v=>{const k=LC(v);return xr(k)},NO=Ob.create,cm={domRange:RE,relative:p3,exact:bw,exactFromRange:ME,getWin:NE,range:NO},b3=(v,k,D)=>{var P,Z;return be.from((Z=(P=v.dom).caretPositionFromPoint)===null||Z===void 0?void 0:Z.call(P,k,D)).bind(te=>{if(te.offsetNode===null)return be.none();const ge=v.dom.createRange();return ge.setStart(te.offsetNode,te.offset),ge.collapse(),be.some(ge)})},PO=(v,k,D)=>{var P,Z;return be.from((Z=(P=v.dom).caretRangeFromPoint)===null||Z===void 0?void 0:Z.call(P,k,D))},Yn=(()=>document.caretPositionFromPoint?b3:document.caretRangeFromPoint?PO:be.none)(),$l=(v,k,D)=>{const P=it.fromDom(v.document);return Yn(P,k,D).map(Z=>Ob.create(it.fromDom(Z.startContainer),Z.startOffset,it.fromDom(Z.endContainer),Z.endOffset))},um=(v,k)=>{const D=Wt(v);return D==="input"?pl.after(v):mt(["br","img"],D)?k===0?pl.before(v):pl.after(v):pl.on(v,k)},Ql=(v,k)=>{const D=v.fold(pl.before,um,pl.after),P=k.fold(pl.before,um,pl.after);return cm.relative(D,P)},fm=(v,k,D,P)=>{const Z=um(v,k),te=um(D,P);return cm.relative(Z,te)},v3=(v,k,D,P)=>{const te=Xa(v).dom.createRange();return te.setStart(v.dom,k),te.setEnd(D.dom,P),te},vw=(v,k,D,P)=>{const Z=v3(v,k,D,P),te=ur(v,D)&&k===P;return Z.collapsed&&!te},Ch=v=>be.from(v.getSelection()),FC=(v,k)=>{Ch(v).each(D=>{D.removeAllRanges(),D.addRange(k)})},yw=(v,k,D,P,Z)=>{const te=im(v,k,D,P,Z);FC(v,te)},ww=(v,k,D,P,Z,te)=>{k.collapse(D.dom,P),k.extend(Z.dom,te)},PE=(v,k)=>cw(v,k).match({ltr:(D,P,Z,te)=>{yw(v,D,P,Z,te)},rtl:(D,P,Z,te)=>{Ch(v).each(ge=>{if(ge.setBaseAndExtent)ge.setBaseAndExtent(D.dom,P,Z.dom,te);else if(ge.extend)try{ww(v,ge,D,P,Z,te)}catch{yw(v,Z,te,D,P)}else yw(v,Z,te,D,P)})}}),_w=(v,k,D,P,Z)=>{const te=fm(k,D,P,Z);PE(v,te)},HC=(v,k,D)=>{const P=Ql(k,D);PE(v,P)},IE=v=>{if(v.rangeCount>0){const k=v.getRangeAt(0),D=v.getRangeAt(v.rangeCount-1);return be.some(Ob.create(it.fromDom(k.startContainer),k.startOffset,it.fromDom(D.endContainer),D.endOffset))}else return be.none()},IO=v=>{if(v.anchorNode===null||v.focusNode===null)return IE(v);{const k=it.fromDom(v.anchorNode),D=it.fromDom(v.focusNode);return vw(k,v.anchorOffset,D,v.focusOffset)?be.some(Ob.create(k,v.anchorOffset,D,v.focusOffset)):IE(v)}},dm=(v,k,D=!0)=>{const Z=(D?u0:hE)(v,k);FC(v,Z)},$C=v=>Ch(v).filter(k=>k.rangeCount>0).bind(IO),Cw=v=>$C(v).map(k=>cm.exact(k.start,k.soffset,k.finish,k.foffset)),nd=(v,k)=>{const D=uw(v,k);return lu(D)},Tl=(v,k,D)=>$l(v,k,D),BE=v=>{Ch(v).each(k=>k.removeAllRanges())},Sw=v=>({elementFromPoint:(Xt,fo)=>it.fromPoint(it.fromDom(v.document),Xt,fo),getRect:Xt=>Xt.dom.getBoundingClientRect(),getRangedRect:(Xt,fo,as,Ts)=>{const aa=cm.exact(Xt,fo,as,Ts);return nd(v,aa)},getSelection:()=>Cw(v).map(Xt=>Mb(v,Xt)),fromSitus:Xt=>{const fo=cm.relative(Xt.start,Xt.finish);return Mb(v,fo)},situsFromPoint:(Xt,fo)=>Tl(v,Xt,fo).map(as=>cp.create(as.start,as.soffset,as.finish,as.foffset)),clearSelection:()=>{BE(v)},collapseSelection:(Xt=!1)=>{Cw(v).each(fo=>fo.fold(as=>as.collapse(Xt),(as,Ts)=>{const aa=Xt?as:Ts;HC(v,aa,aa)},(as,Ts,aa,Dl)=>{const bl=Xt?as:aa,Nu=Xt?Ts:Dl;_w(v,bl,Nu,bl,Nu)}))},setSelection:Xt=>{_w(v,Xt.start,Xt.soffset,Xt.finish,Xt.foffset)},setRelativeSelection:(Xt,fo)=>{HC(v,Xt,fo)},selectNode:Xt=>{dm(v,Xt,!1)},selectContents:Xt=>{dm(v,Xt)},getInnerHeight:()=>v.innerHeight,getScrollY:()=>g3(it.fromDom(v.document)).top,scrollBy:(Xt,fo)=>{OE(Xt,fo,it.fromDom(v.document))}}),Ld=(v,k)=>({rows:v,cols:k}),kw=(v,k,D,P)=>{const Z=Sw(v),te=CI(Z,k,D,P);return{clearstate:te.clearstate,mousedown:te.mousedown,mouseover:te.mouseover,mouseup:te.mouseup}},LE=v=>Nl(v,cn).exists(Km),FE=(v,k)=>LE(v)||LE(k),BO=(v,k,D,P)=>{const Z=Sw(v),te=()=>(P.clear(k),be.none());return{keydown:(Fe,ot,wt,un,jn,Vn)=>{const tn=Fe.raw,Un=tn.which,Xt=tn.shiftKey===!0;return Hs(k,P.selectedSelector).fold(()=>(up(Un)&&!Xt&&P.clearBeforeUpdate(k),up(Un)&&Xt&&!FE(ot,un)?be.none:b0(Un)&&Xt?re(IC,Z,k,D,h3,un,ot,P.selectRange):pw(Un)&&Xt?re(IC,Z,k,D,DE,un,ot,P.selectRange):b0(Un)?re(ay,Z,D,h3,un,ot,xE):pw(Un)?re(ay,Z,D,DE,un,ot,OO):be.none),as=>{const Ts=aa=>()=>gn(aa,bl=>Nd(bl.rows,bl.cols,k,as,P)).fold(()=>ch(k,P.firstSelectedSelector,P.lastSelectedSelector).map(bl=>{const Nu=b0(Un)||Vn.isForward(Un)?pl.after:pl.before;return Z.setRelativeSelection(pl.on(bl.first,0),Nu(bl.table)),P.clear(k),c0.create(be.none(),!0)}),bl=>be.some(c0.create(be.none(),!0)));return up(Un)&&Xt&&!FE(ot,un)?be.none:b0(Un)&&Xt?Ts([Ld(1,0)]):pw(Un)&&Xt?Ts([Ld(-1,0)]):Vn.isBackward(Un)&&Xt?Ts([Ld(0,-1),Ld(-1,0)]):Vn.isForward(Un)&&Xt?Ts([Ld(0,1),Ld(1,0)]):up(Un)&&!Xt?te:be.none})()},keyup:(Fe,ot,wt,un,jn)=>Hs(k,P.selectedSelector).fold(()=>{const Vn=Fe.raw,tn=Vn.which;return Vn.shiftKey===!0&&up(tn)&&FE(ot,un)?bE(k,D,ot,wt,un,jn,P.selectRange):be.none()},be.none)}},y3=(v,k,D,P)=>{const Z=Sw(v);return(te,ge)=>{P.clearBeforeUpdate(k),ou(te,ge,D).each(Ee=>{const Fe=Ee.boxes.getOr([]);P.selectRange(k,Fe,Ee.start,Ee.finish),Z.selectContents(ge),Z.collapseSelection()})}},Ew=(v,k)=>{const D=hi(v,k);return D===void 0||D===""?[]:D.split(" ")},w3=(v,k,D)=>{const Z=Ew(v,k).concat([D]);return Ur(v,k,Z.join(" ")),!0},LO=(v,k,D)=>{const P=kt(Ew(v,k),Z=>Z!==D);return P.length>0?Ur(v,k,P.join(" ")):qe(v,k),!1},v0=v=>v.dom.classList!==void 0,zc=v=>Ew(v,"class"),Sh=(v,k)=>w3(v,"class",k),Fd=(v,k)=>LO(v,"class",k),od=(v,k)=>{v0(v)?v.dom.classList.add(k):Sh(v,k)},zC=v=>{(v0(v)?v.dom.classList:zc(v)).length===0&&qe(v,"class")},Pb=(v,k)=>{v0(v)?v.dom.classList.remove(k):Fd(v,k),zC(v)},n1=(v,k)=>v0(v)&&v.dom.classList.contains(k),FO=(v,k)=>{He(k,D=>{Pb(v,D)})},HE=v=>k=>{od(k,v)},HO=v=>k=>{FO(k,v)},S3={byClass:v=>{const k=HE(v.selected),D=HO([v.selected,v.lastSelected,v.firstSelected]),P=te=>{const ge=mi(te,v.selectedSelector);He(ge,D)};return{clearBeforeUpdate:P,clear:P,selectRange:(te,ge,Ee,Fe)=>{P(te),He(ge,k),od(Ee,v.firstSelected),od(Fe,v.lastSelected)},selectedSelector:v.selectedSelector,firstSelectedSelector:v.firstSelectedSelector,lastSelectedSelector:v.lastSelectedSelector}},byAttr:(v,k,D)=>{const P=Fe=>{qe(Fe,v.selected),qe(Fe,v.firstSelected),qe(Fe,v.lastSelected)},Z=Fe=>{Ur(Fe,v.selected,"1")},te=Fe=>{ge(Fe),D()},ge=Fe=>{const ot=mi(Fe,`${v.selectedSelector},${v.firstSelectedSelector},${v.lastSelectedSelector}`);He(ot,P)};return{clearBeforeUpdate:ge,clear:te,selectRange:(Fe,ot,wt,un)=>{te(Fe),He(ot,Z),Ur(wt,v.firstSelected,"1"),Ur(un,v.lastSelected,"1"),k(ot,wt,un)},selectedSelector:v.selectedSelector,firstSelectedSelector:v.firstSelectedSelector,lastSelectedSelector:v.lastSelectedSelector}}},VC=(v,k,D,P)=>{switch(v.tag){case"none":return k();case"single":return P(v.element);case"multiple":return D(v.elements)}},$E=()=>({tag:"none"}),Ai=v=>({tag:"multiple",elements:v}),o1=v=>({tag:"single",element:v}),uy=(v,k,D)=>({get:()=>rb(v(),D).fold(()=>k().fold($E,o1),Ai)}),zE=(v,k)=>{const D=v.slice(0,k[k.length-1].row+1),P=O2(D);return ao(P,Z=>{const te=Z.cells.slice(0,k[k.length-1].column+1);return Tt(te,ge=>ge.element)})},k3=(v,k)=>{const D=v.slice(k[0].row+k[0].rowspan-1,v.length),P=O2(D);return ao(P,Z=>{const te=Z.cells.slice(k[0].column+k[0].colspan-1,Z.cells.length);return Tt(te,ge=>ge.element)})},VE=(v,k,D)=>{const P=xe.fromTable(v);return Xf(P,k).map(te=>{const ge=Fc(P,D,!1),{rows:Ee}=Ta(ge),Fe=zE(Ee,te),ot=k3(Ee,te);return{upOrLeftCells:Fe,downOrRightCells:ot}})},E3=(v,k,D,P,Z,te,ge)=>({target:v,x:k,y:D,stop:P,prevent:Z,kill:te,raw:ge}),UC=v=>{const k=it.fromDom(Kn(v).getOr(v.target)),D=()=>v.stopPropagation(),P=()=>v.preventDefault(),Z=q(P,D);return E3(k,v.clientX,v.clientY,D,P,Z,v)},$O=(v,k)=>D=>{v(D)&&k(UC(D))},zO=(v,k,D,P,Z)=>{const te=$O(D,P);return v.dom.addEventListener(k,te,Z),{unbind:re(VO,v,k,te,Z)}},x3=(v,k,D,P)=>zO(v,k,D,P,!1),VO=(v,k,D,P)=>{v.dom.removeEventListener(k,D,P)},UE=_e,fy=(v,k,D)=>x3(v,k,UE,D),dy=UC,WC=v=>!n1(it.fromDom(v.target),"ephox-snooker-resizer-bar"),A3=(v,k)=>{const D=uy(()=>it.fromDom(v.getBody()),()=>Up(Au(v),Ym(v)),uh.selectedSelector),P=(Fe,ot,wt)=>{el(ot).each(jn=>{const Vn=Kh(v),tn=Da(z,it.fromDom(v.getDoc()),Vn),Un=Kf(v),Xt=VE(jn,{selection:Un},tn);r0(v,Fe,ot,wt,Xt)})},Z=()=>Ui(v),te=S3.byAttr(uh,P,Z);return v.on("init",Fe=>{const ot=v.getWin(),wt=Af(v),un=Ym(v),jn=()=>{const wi=v.selection,Pu=it.fromDom(wi.getStart()),lf=it.fromDom(wi.getEnd());vi(el,[Pu,lf]).fold(()=>te.clear(wt),z)},Vn=kw(ot,wt,un,te),tn=BO(ot,wt,un,te),Un=y3(ot,wt,un,te),Xt=wi=>wi.raw.shiftKey===!0;v.on("TableSelectorChange",wi=>Un(wi.start,wi.finish));const fo=(wi,Pu)=>{!Xt(wi)||(Pu.kill&&wi.kill(),Pu.selection.each(lf=>{const mm=cm.relative(lf.start,lf.finish),cf=uw(ot,mm);v.selection.setRng(cf)}))},as=wi=>{const Pu=dy(wi);if(Pu.raw.shiftKey&&up(Pu.raw.which)){const lf=v.selection.getRng(),mm=it.fromDom(lf.startContainer),cf=it.fromDom(lf.endContainer);tn.keyup(Pu,mm,lf.startOffset,cf,lf.endOffset).each(Hb=>{fo(Pu,Hb)})}},Ts=wi=>{const Pu=dy(wi);k.hide();const lf=v.selection.getRng(),mm=it.fromDom(lf.startContainer),cf=it.fromDom(lf.endContainer),Hb=yv(m3,RO)(it.fromDom(v.selection.getStart()));tn.keydown(Pu,mm,lf.startOffset,cf,lf.endOffset,Hb).each(Iu=>{fo(Pu,Iu)}),k.show()},aa=wi=>wi.button===0,Dl=wi=>wi.buttons===void 0?!0:(wi.buttons&1)!==0,bl=wi=>{Vn.clearstate()},Nu=wi=>{aa(wi)&&WC(wi)&&Vn.mousedown(dy(wi))},Fb=wi=>{Dl(wi)&&WC(wi)&&Vn.mouseover(dy(wi))},Dw=wi=>{aa(wi)&&WC(wi)&&Vn.mouseup(dy(wi))},tS=(()=>{const wi=gw(it.fromDom(wt)),Pu=gw(0);return{touchEnd:mm=>{const cf=it.fromDom(mm.target);if(Ir("td")(cf)||Ir("th")(cf)){const Hb=wi.get(),Iu=Pu.get();ur(Hb,cf)&&mm.timeStamp-Iu<300&&(mm.preventDefault(),Un(cf,cf))}wi.set(cf),Pu.set(mm.timeStamp)}}})();v.on("dragstart",bl),v.on("mousedown",Nu),v.on("mouseover",Fb),v.on("mouseup",Dw),v.on("touchend",tS.touchEnd),v.on("keyup",as),v.on("keydown",Ts),v.on("NodeChange",jn)}),v.on("PreInit",()=>{v.serializer.addTempAttr(uh.firstSelected),v.serializer.addTempAttr(uh.lastSelected)}),{getSelectedCells:()=>VC(D.get(),F([]),Fe=>Tt(Fe,ot=>ot.dom),Fe=>[Fe.dom]),clearSelectedCells:Fe=>te.clear(it.fromDom(Fe))}},kh=v=>{let k=[];return{bind:te=>{if(te===void 0)throw new Error("Event bind error: undefined handler");k.push(te)},unbind:te=>{k=kt(k,ge=>ge!==te)},trigger:(...te)=>{const ge={};He(v,(Ee,Fe)=>{ge[Ee]=te[Fe]}),He(k,Ee=>{Ee(ge)})}}},Vc=v=>{const k=rs(v,P=>({bind:P.bind,unbind:P.unbind})),D=rs(v,P=>P.trigger);return{registry:k,trigger:D}},fu=(v,k)=>{let D=null;const P=()=>{y(D)||(clearTimeout(D),D=null)};return{cancel:P,throttle:(...te)=>{P(),D=setTimeout(()=>{D=null,v.apply(null,te)},k)}}},fp=v=>v.slice(0).sort(),UO=(v,k)=>{throw new Error("All required keys ("+fp(v).join(", ")+") were not specified. Specified keys were: "+fp(k).join(", ")+".")},WO=v=>{throw new Error("Unsupported keys for object: "+fp(v).join(", "))},jO=(v,k)=>{if(!g(k))throw new Error("The "+v+" fields must be an array. Was: "+k+".");He(k,D=>{if(!f(D))throw new Error("The value "+D+" in the "+v+" fields was not a string.")})},sr=(v,k)=>{throw new Error("All values need to be of type: "+k+". Keys ("+fp(v).join(", ")+") were not.")},ZO=v=>{const k=fp(v);he(k,(P,Z)=>Z<k.length-1&&P===k[Z+1]).each(P=>{throw new Error("The field: "+P+" occurs more than once in the combined fields: ["+k.join(", ")+"].")})},T3=(v,k)=>jC(v,k,{validate:L,label:"function"}),jC=(v,k,D)=>{if(k.length===0)throw new Error("You must specify at least one required field.");return jO("required",k),ZO(k),P=>{const Z=yt(P);xo(k,Ee=>mt(Z,Ee))||UO(k,Z),v(k,Z);const ge=kt(k,Ee=>!D.validate(P[Ee],Ee));return ge.length>0&&sr(ge,D.label),P}},qO=(v,k)=>{const D=kt(k,P=>!mt(v,P));D.length>0&&WO(D)},eo=v=>T3(qO,v),Ib=eo(["compare","extract","mutate","sink"]),GO=eo(["element","start","stop","destroy"]),D3=eo(["forceDrop","drop","move","delayDrop"]),ZC=()=>{let v=be.none();const k=()=>{v=be.none()},D=(te,ge)=>{const Ee=v.map(Fe=>te.compare(Fe,ge));return v=be.some(ge),Ee},P=(te,ge)=>{ge.extract(te).each(Fe=>{D(ge,Fe).each(wt=>{Z.trigger.move(wt)})})},Z=Vc({move:kh(["info"])});return{onEvent:P,reset:k,events:Z.registry}},xw=()=>{const v=Vc({move:kh(["info"])});return{onEvent:z,reset:z,events:v.registry}},WE=()=>{const v=xw(),k=ZC();let D=v;return{on:()=>{D.reset(),D=k},off:()=>{D.reset(),D=v},isOn:()=>D===k,onEvent:(Ee,Fe)=>{D.onEvent(Ee,Fe)},events:k.events}},jE=(v,k,D)=>{let P=!1;const Z=Vc({start:kh([]),stop:kh([])}),te=WE(),ge=()=>{tn.stop(),te.isOn()&&(te.off(),Z.trigger.stop())},Ee=fu(ge,200),Fe=Xt=>{tn.start(Xt),te.on(),Z.trigger.start()},ot=Xt=>{Ee.cancel(),te.onEvent(Xt,k)};te.events.move.bind(Xt=>{k.mutate(v,Xt.info)});const wt=()=>{P=!0},un=()=>{P=!1},jn=()=>P,Vn=Xt=>(...fo)=>{P&&Xt.apply(null,fo)},tn=k.sink(D3({forceDrop:ge,drop:Vn(ge),move:Vn(ot),delayDrop:Vn(Ee.throttle)}),D),Un=()=>{tn.destroy()};return{element:tn.element,go:Fe,on:wt,off:un,isActive:jn,destroy:Un,events:Z.registry}},KO=v=>{const k=v.replace(/\./g,"-");return{resolve:P=>k+"-"+P}},O3=KO("ephox-dragster").resolve,M3=v=>{const k={layerClass:O3("blocker"),...v},D=it.fromTag("div");return Ur(D,"role","presentation"),_l(D,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),od(D,O3("blocker")),od(D,k.layerClass),{element:F(D),destroy:()=>{Yi(D)}}};var JO=Ib({compare:(v,k)=>Sf(k.left-v.left,k.top-v.top),extract:v=>be.some(Sf(v.x,v.y)),sink:(v,k)=>{const D=M3(k),P=fy(D.element(),"mousedown",v.forceDrop),Z=fy(D.element(),"mouseup",v.drop),te=fy(D.element(),"mousemove",v.move),ge=fy(D.element(),"mouseout",v.delayDrop),Ee=()=>{D.destroy(),Z.unbind(),te.unbind(),ge.unbind(),P.unbind()},Fe=wt=>{Ar(wt,D.element())},ot=()=>{Yi(D.element())};return GO({element:D.element,start:Fe,stop:ot,destroy:Ee})},mutate:(v,k)=>{v.mutate(k.left,k.top)}});const kI=(v,k={})=>{var D;const P=(D=k.mode)!==null&&D!==void 0?D:JO;return jE(v,P,k)},GC=KO("ephox-snooker").resolve,QO=()=>{const v=Vc({drag:kh(["xDelta","yDelta"])});return{mutate:(D,P)=>{v.trigger.drag(D,P)},events:v.registry}},eM=()=>{const v=Vc({drag:kh(["xDelta","yDelta","target"])});let k=be.none();const D=QO();return D.events.drag.bind(te=>{k.each(ge=>{v.trigger.drag(te.xDelta,te.yDelta,ge)})}),{assign:te=>{k=be.some(te)},get:()=>k,mutate:D.mutate,events:v.registry}},tM=(v,k,D,P,Z)=>{const te=it.fromTag("div");return _l(te,{position:"absolute",left:k-P/2+"px",top:D+"px",height:Z+"px",width:P+"px"}),Bi(te,{"data-column":v,role:"presentation"}),te},Tw=(v,k,D,P,Z)=>{const te=it.fromTag("div");return _l(te,{position:"absolute",left:k+"px",top:D-Z/2+"px",height:Z+"px",width:P+"px"}),Bi(te,{"data-row":v,role:"presentation"}),te},ZE=GC("resizer-bar"),R3=GC("resizer-rows"),qE=GC("resizer-cols"),GE=7,N3=(v,k)=>ao(v.all,(D,P)=>k(D.element)?[P]:[]),s1=(v,k)=>{const D=[];return Ot(v.grid.columns,P=>{xe.getColumnAt(v,P).map(te=>te.element).forall(k)&&D.push(P)}),kt(D,P=>{const Z=xe.filterItems(v,te=>te.column===P);return xo(Z,te=>k(te.element))})},hy=v=>{const k=mi(v.parent(),"."+ZE);He(k,Yi)},KE=(v,k,D)=>{const P=v.origin();He(k,Z=>{Z.each(te=>{const ge=D(P,te);od(ge,ZE),Ar(v.parent(),ge)})})},nM=(v,k,D,P)=>{KE(v,k,(Z,te)=>{const ge=tM(te.col,te.x-Z.left,D.top-Z.top,GE,P);return od(ge,qE),ge})},oM=(v,k,D,P)=>{KE(v,k,(Z,te)=>{const ge=Tw(te.row,D.left-Z.left,te.y-Z.top,P,GE);return od(ge,R3),ge})},Nr=(v,k,D,P,Z)=>{const te=Zu(D),ge=k.isResizable,Ee=P.length>0?Xn.positions(P,D):[],Fe=Ee.length>0?N3(v,ge):[],ot=kt(Ee,(Vn,tn)=>nt(Fe,Un=>tn===Un));oM(k,ot,te,rt(D));const wt=Z.length>0?Pc.positions(Z,D):[],un=wt.length>0?s1(v,ge):[],jn=kt(wt,(Vn,tn)=>nt(un,Un=>tn===Un));nM(k,jn,te,Hm(D))},YE=(v,k)=>{if(hy(v),v.isResizable(k)){const D=xe.fromTable(k),P=Su(D),Z=Cf(D);Nr(D,v,k,P,Z)}},dp=(v,k)=>{const D=mi(v.parent(),"."+ZE);He(D,k)},hp=v=>{dp(v,k=>{xi(k,"display","none")})},r1=v=>{dp(v,k=>{xi(k,"display","block")})},Ru=v=>n1(v,R3),KC=v=>n1(v,qE),my=GC("resizer-bar-dragging"),YC=v=>{const k=eM(),D=kI(k,{});let P=be.none();const Z=(tn,Un)=>be.from(hi(tn,Un));k.events.drag.bind(tn=>{Z(tn.target,"data-row").each(Un=>{const Xt=qi(tn.target,"top");xi(tn.target,"top",Xt+tn.yDelta+"px")}),Z(tn.target,"data-column").each(Un=>{const Xt=qi(tn.target,"left");xi(tn.target,"left",Xt+tn.xDelta+"px")})});const te=(tn,Un)=>{const Xt=qi(tn,Un),fo=Tr(tn,"data-initial-"+Un,0);return Xt-fo};D.events.stop.bind(()=>{k.get().each(tn=>{P.each(Un=>{Z(tn,"data-row").each(Xt=>{const fo=te(tn,"top");qe(tn,"data-initial-top"),Vn.trigger.adjustHeight(Un,fo,parseInt(Xt,10))}),Z(tn,"data-column").each(Xt=>{const fo=te(tn,"left");qe(tn,"data-initial-left"),Vn.trigger.adjustWidth(Un,fo,parseInt(Xt,10))}),YE(v,Un)})})});const ge=(tn,Un)=>{Vn.trigger.startAdjust(),k.assign(tn),Ur(tn,"data-initial-"+Un,qi(tn,Un)),od(tn,my),xi(tn,"opacity","0.2"),D.go(v.parent())},Ee=fy(v.parent(),"mousedown",tn=>{Ru(tn.target)&&ge(tn.target,"top"),KC(tn.target)&&ge(tn.target,"left")}),Fe=tn=>ur(tn,v.view()),ot=tn=>Ei(tn,"table",Fe).filter(Km),wt=fy(v.view(),"mouseover",tn=>{ot(tn.target).fold(()=>{Fi(tn.target)&&hy(v)},Un=>{D.isActive()&&(P=be.some(Un),YE(v,Un))})}),un=()=>{Ee.unbind(),wt.unbind(),D.destroy(),hy(v)},jn=tn=>{YE(v,tn)},Vn=Vc({adjustHeight:kh(["table","delta","row"]),adjustWidth:kh(["table","delta","column"]),startAdjust:kh([])});return{destroy:un,refresh:jn,on:D.on,off:D.off,hideBars:re(hp,v),showBars:re(r1,v),events:Vn.registry}},sM={create:(v,k,D)=>{const P=Xn,Z=Pc,te=YC(v),ge=Vc({beforeResize:kh(["table","type"]),afterResize:kh(["table","type"]),startDrag:kh([])});return te.events.adjustHeight.bind(Ee=>{const Fe=Ee.table;ge.trigger.beforeResize(Fe,"row");const ot=P.delta(Ee.delta,Fe);vb(Fe,ot,Ee.row,P),ge.trigger.afterResize(Fe,"row")}),te.events.startAdjust.bind(Ee=>{ge.trigger.startDrag()}),te.events.adjustWidth.bind(Ee=>{const Fe=Ee.table;ge.trigger.beforeResize(Fe,"col");const ot=Z.delta(Ee.delta,Fe),wt=D(Fe);Vt(Fe,ot,Ee.column,k,wt),ge.trigger.afterResize(Fe,"col")}),{on:te.on,off:te.off,refreshBars:te.refresh,hideBars:te.hideBars,showBars:te.showBars,destroy:te.destroy,events:ge.registry}}},rr={only:(v,k)=>{const D=cs(v)?Qs(v):v;return{parent:F(D),view:F(v),origin:F(Sf(0,0)),isResizable:k}},detached:(v,k,D)=>{const P=()=>Zu(k);return{parent:F(k),view:F(v),origin:P,isResizable:D}},body:(v,k,D)=>({parent:F(k),view:F(v),origin:F(Sf(0,0)),isResizable:D})},hm=()=>{const v=it.fromTag("div");return _l(v,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Ar(de(),v),v},gy=(v,k)=>v.inline?rr.body(it.fromDom(v.getBody()),hm(),k):rr.only(it.fromDom(v.getDoc()),k),iM=(v,k)=>{v.inline&&Yi(k.parent())},Lb=v=>N(v)&&v.nodeName==="TABLE",cr="bar-",aM=v=>hi(v,"data-mce-resize")!=="false",XC=v=>{const k=xe.fromTable(v);xe.hasColumns(k)||He(Il(v),D=>{const P=Qa(D,"width");xi(D,"width",P),qe(D,"width")})},JC=v=>{const k=AE(),D=AE(),P=AE();let Z,te;const ge=tn=>rm(v,tn),Ee=()=>Yh(v)?Wp():U_(),Fe=tn=>k2(tn).columns,ot=(tn,Un,Xt)=>{const fo=Vu(Un,"e");if(te===""&&lp(tn),Xt!==Z&&te!==""){xi(tn,"width",te);const as=Ee(),Ts=ge(tn),aa=Yh(v)||fo?Fe(tn)-1:0;Vt(tn,Xt-Z,aa,as,Ts)}else if(_v(te)){const as=parseFloat(te.replace("%","")),Ts=Xt*as/Z;xi(tn,"width",Ts+"%")}Cv(te)&&XC(tn)},wt=()=>{D.on(tn=>{tn.destroy()}),P.on(tn=>{iM(v,tn)})};return v.on("init",()=>{const tn=gy(v,aM);if(P.set(tn),Zm(v)&&Xh(v)){const Un=Ee(),Xt=sM.create(tn,Un,ge);Xt.on(),Xt.events.startDrag.bind(fo=>{k.set(v.selection.getRng())}),Xt.events.beforeResize.bind(fo=>{const as=fo.table.dom;Q2(v,as,xd(as),Xm(as),cr+fo.type)}),Xt.events.afterResize.bind(fo=>{const as=fo.table,Ts=as.dom;ih(as),k.on(aa=>{v.selection.setRng(aa),v.focus()}),Sc(v,Ts,xd(Ts),Xm(Ts),cr+fo.type),v.undoManager.add()}),D.set(Xt)}}),v.on("ObjectResizeStart",tn=>{const Un=tn.target;if(Lb(Un)){const Xt=it.fromDom(Un);He(v.dom.select(".mce-clonedresizable"),fo=>{v.dom.addClass(fo,"mce-"+tb(v)+"-columns")}),!Eb(Xt)&&qm(v)?tw(Xt):!vh(Xt)&&Ed(v)&&lp(Xt),_C(Xt)&&zu(tn.origin,cr)&&lp(Xt),Z=tn.width,te=Gm(v)?"":ob(v,Un).getOr("")}}),v.on("ObjectResized",tn=>{const Un=tn.target;if(Lb(Un)){const Xt=it.fromDom(Un),fo=tn.origin;zu(fo,"corner-")&&ot(Xt,fo,tn.width),ih(Xt),ip(v,Xt.dom,i0)}}),v.on("SwitchMode",()=>{D.on(tn=>{v.mode.isReadOnly()?tn.hideBars():tn.showBars()})}),v.on("dragstart dragend",tn=>{D.on(Un=>{tn.type==="dragstart"?(Un.hideBars(),Un.off()):(Un.on(),Un.showBars())})}),v.on("remove",()=>{wt()}),{refresh:tn=>{D.on(Un=>Un.refreshBars(it.fromDom(tn)))},hide:()=>{D.on(tn=>tn.hideBars())},show:()=>{D.on(tn=>tn.showBars())}}},QC=v=>{Wg(v);const k=JC(v),D=A3(v,k),P=Gk(v,k,D);return ty(v,P),OC(v,P),C2(v,P),{getSelectedCells:D.getSelectedCells,clearSelectedCells:D.clearSelectedCells}},i1=v=>({table:QC(v)});var mp=()=>{s.add("dom",i1)};mp()})();tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2Zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1Z" fill-rule="nonzero"/></svg>',"accordion-toggle":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.3 7.3a1 1 0 0 1 1.4 0L16 9.6l2.3-2.3a1 1 0 1 1 1.4 1.4L16 12.4l-3.7-3.7a1 1 0 0 1 0-1.4ZM4.3 11.7a1 1 0 0 1 0-1.4L6.6 8 4.3 5.7a1 1 0 0 1 1.4-1.4L9.4 8l-3.7 3.7a1 1 0 0 1-1.4 0Z"/></svg>',accordion:'<svg width="24" height="24"><rect x="12" y="7" width="10" height="2" rx="1"/><rect x="12" y="11" width="10" height="2" rx="1"/><rect x="12" y="15" width="6" height="2" rx="1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.3 7.3a1 1 0 0 1 1.4 0L6 9.6l2.3-2.3a1 1 0 0 1 1.4 1.4L6 12.4 2.3 8.7a1 1 0 0 1 0-1.4Z"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 0 0-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 1 0-1.4-1.4L12 13.6 5.7 7.3Z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 0 0 1.4-1.4L12 6.6l-7.7 7.7a1 1 0 0 0 1.4 1.4L12 9.4l6.3 6.3Z"/></svg>',addtag:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 5a2 2 0 0 1 1.6.8L21 12l-4.4 6.2a2 2 0 0 1-1.6.8h-3v-2h3l3.5-5L15 7H5v3H3V7c0-1.1.9-2 2-2h10Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 12a1 1 0 0 0-1 1v2H3a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2H7v-2c0-.6-.4-1-1-1Z"/></svg>',"ai-prompt":'<svg width="24" height="24"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.7a1 1 0 0 0-1.4 0l-9.9 10a1 1 0 0 0 0 1.3l2.1 2.1c.4.4 1 .4 1.4 0l10-9.9c.3-.3.3-1 0-1.4l-2.2-2Zm1.4 2.8-2-2-3 2.7 2.2 2.2 2.8-2.9Z"/><path d="m18.5 7.3-.7-1.5-1.5-.8 1.5-.7.7-1.5.7 1.5 1.5.7-1.5.8-.7 1.5ZM18.5 16.5l-.7-1.6-1.5-.7 1.5-.7.7-1.6.7 1.6 1.5.7-1.5.7-.7 1.6ZM9.7 7.3 9 5.8 7.5 5 9 4.3l.7-1.5.7 1.5L12 5l-1.5.8-.7 1.5Z"/></g><defs><clipPath id="a"><path d="M0 0h24v24H0z"/></clipPath></defs></svg>',ai:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H5Zm6.8 11.5.5 1.2a68.3 68.3 0 0 0 .7 1.1l.4.1c.3 0 .5 0 .7-.3.2-.1.3-.3.3-.6l-.3-1-2.6-6.2a20.4 20.4 0 0 0-.5-1.3l-.5-.4-.7-.2c-.2 0-.5 0-.6.2-.2 0-.4.2-.5.4l-.3.6-.3.7L5.7 15l-.2.6-.1.4c0 .3 0 .5.3.7l.6.2c.3 0 .5 0 .7-.2l.4-1 .5-1.2h3.9ZM9.8 9l1.5 4h-3l1.5-4Zm5.6-.9v7.6c0 .4 0 .7.2 1l.7.2c.3 0 .6 0 .8-.3l.2-.9V8.1c0-.4 0-.7-.2-.9a1 1 0 0 0-.8-.3c-.2 0-.5.1-.7.3l-.2 1Z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5 13 7H5a1 1 0 1 1 0-2h9.2Zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h6.8Zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h4.4Zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2ZM7 17l-1.2 2H5a1 1 0 0 1 0-2h2Zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2Zm5.2-13.5 1.3.7-9.7 16.3-1.3-.7 9.7-16.3Z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="m5.6 13 12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8Z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="m18.5 13-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8Z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8Zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4Zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4Z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1Z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3Zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3Zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1ZM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7Zm10 3.5.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0Zm-10-7-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3Zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7Zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8ZM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8Zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7Z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9.4-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6Z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8ZM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7Z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="m15.7 2 1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 0 1-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2ZM18 12l-4.5-4L9 12h9ZM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16Z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 0 1-2-2v-5h2zm8-7V4h6a2 2 0 0 1 2 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="m13 11-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="m18.4 8 1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 0 1-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8Zm1.6 7-3-3-3 3h6Z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 0 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1Zm4.8-6.8V10H7.7V5.8h-1v-1h2ZM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1Zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1ZM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2V18.7l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1Zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6Zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4Zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8Zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1Z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2ZM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11Z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8Z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3 4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1Z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3Z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8 5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0Z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2 13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5Z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4Zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5Z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8Zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3 3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/><path d="M13 10h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H9a1 1 0 0 1 0-2h2V8a1 1 0 0 1 2 0v2Z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6Z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3Zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7Zm0 12V9h-7v10h7Z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3ZM9 9v5l5-5H9Zm1 6h5v-5l-5 5Z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0 1 10.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 0 1 2 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 0 1 7 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7Zm12.3 5h-3v10h3v-10ZM8 13.8h-.3l-.4.2a2.8 2.8 0 0 0-.7.4v.1a2.8 2.8 0 0 0-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 0 0 .8-.3 2.4 2.4 0 0 0 .7-.7 2.5 2.5 0 0 0 .3-.8 1.5 1.5 0 0 0 0-.8 1 1 0 0 0-.2-.4 1 1 0 0 0-.5-.2H8Zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4ZM7 5.8h-.4a1 1 0 0 0-.5.3 1 1 0 0 0-.2.5v.7a2.5 2.5 0 0 0 .3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 0 0 0-.8 2.6 2.6 0 0 0-.3-.8A2.5 2.5 0 0 0 7.7 6l-.4-.1H7Z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l2 2V3h14ZM8.5 15.3h-.3a2.6 2.6 0 0 0-.8.4 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3L9 18V18l.4-.4.2-.4.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2h-.5Zm7 0H15a1 1 0 0 0-.4.3 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4a2.8 2.8 0 0 0 .5.7h.1a2.8 2.8 0 0 0 .8.6l.4.1h.7l.5-.2.2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3h-.3ZM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4Zm8.5-7.1h-11v2h11v-2Z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8Zm-8.5 2.2.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1Zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4Zm5.4 4 .2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2Z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5Zm0 4h2v2h-2V9ZM9 9h2v2H9V9Zm4 4h2v2h-2v-2Zm-4 0h2v2H9v-2Zm0 4h2v2H9v-2Zm4 0h2v2h-2v-2ZM9 5h2v2H9V5Z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7Zm-2 2h-3v12h3V8Zm-2-6v2H8v15H6V2h7Z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16Zm-2 2H8v3h12v-3Zm-1-6v2H4v5H2V7h17Z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10Zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2Z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1Z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="m19.8 8.8-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5Zm-2-.2 1-.9v-.3l-2.2-2.2a.3.3 0 0 0-.3 0l-1 1L18 8.5Zm-1 1-2.5-2.4-6 6 2.5 2.5 6-6Zm-7 7.1-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5Z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9ZM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13Zm3-5.3 1.3 2 3-4.7 3.7 6H7l2-3.3Z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm4.8 2.6 5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4Z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3 18 7v1h-5V5H7v14h9a1 1 0 0 1 2 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5Z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3Z"/><path d="M16.4 9.2a1 1 0 0 1 1.4.2l2.4 3.6-2.4 3.6a1 1 0 0 1-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 0 1 .2-1.4Z"/></g></svg>',fill:'<svg width="24" height="26"><path d="m16.6 12-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2ZM5.2 13 10 8.2l4.8 4.8H5.2ZM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5Z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2Zm4-8h2V9h-2v2ZM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2Zm14-2v2h2a2 2 0 0 0-2-2Zm-7 16h2V3h-2v18Zm7-6h2v-2h-2v2Zm-4-8h2V5h-2v2Zm4 12a2 2 0 0 0 2-2h-2v2Z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5Zm8 4v2h2v-2h-2Zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2Zm2 14h-2v2a2 2 0 0 0 2-2ZM3 11v2h18v-2H3Zm6 7v2h2v-2H9Zm8-4v2h2v-2h-2ZM5 18c0 1.1.9 2 2 2v-2H5Z" fill-rule="nonzero"/></svg>',footnote:'<svg width="24" height="24"><path d="M19 13c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h14Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19 4v6h-1V5h-1.5V4h2.6Z"/><path d="M12 18c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h7ZM14 8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2h9Z"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3Z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 0 1 0 2h-4v11a1 1 0 0 1-2 0V7H7a1 1 0 1 1 0-2h10Z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="m15.3 10-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3Zm0 4 3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2ZM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3ZM8.7 10 5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2Z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="m5 15.7 2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7ZM5 18V19h3l1.8-1.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V7c0-.6.4-1 1-1Zm6 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4ZM4.5 4h15a.5.5 0 1 1 0 1h-15a.5.5 0 0 1 0-1Zm2-2h11a.5.5 0 1 1 0 1h-11a.5.5 0 0 1 0-1Z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0Z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1ZM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Z"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8Z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="m5 15.7 3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7ZM5 18V19h3l2.8-2.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-1 3v2h2V7h-2Zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4Z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0 2a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 0 0-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1Z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3 16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6Zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6Z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="m16.7 4.7-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 0 0 3.2-2.1l-.2-.2a6 6 0 0 0-1-.6Zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 0 1-2-2.8Zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7Zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3Zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 0 1-.3-2Zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1Zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6Zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3Zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1Zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3Zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1Zm3-1.4-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 0 0-1.3-3.5Zm-9 0 2 .2V5.5a9 9 0 0 0-2 2.2Zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 0 0-2-2.3Zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 0 1 1.9-2.5Zm4.4 0 .1.1a10 10 0 0 1 1.8 2.4l1.1-.7a7.5 7.5 0 0 0-3-1.8Z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zM7 3.6l3.7 3.7a1 1 0 0 1-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 0 1 1.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 0 1 1.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 0 1-1.3 0h-.1a1 1 0 0 1 0-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="m15 9-8 8H4v-3l8-8 3 3Zm1-1-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1ZM4 18h16v2H4v-2Z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8h-.1l-1.5 1v-1.1l1.6-1.1h1.2v6zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2Zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5Zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7Zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7Zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6ZM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7ZM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4Zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3ZM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6Zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7Zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4Zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3Zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7Zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8Zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4ZM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22Zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3ZM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM37.1 34.6 34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1ZM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4Zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8Zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3ZM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22Zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1Zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33Zm0 10v-1.2h-1.3V26H33Zm0 10v-1.2h-1.3V36H33Z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15Zm0 10v-1.2h1.3V26H15Zm0 10v-1.2h1.3V36H15Z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="m39.3 17-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3Zm-1.6-4.7-.7 2.3h1.6l-.8-2.3ZM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7Zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26ZM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="m12.6 17-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3ZM11 12.3l-.7 2.3h1.6l-.8-2.3Zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7ZM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7ZM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26Zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3Zm0 10v-1.2H33V27h-1.3Zm0 10v-1.2H33V37h-1.3Z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15Zm0 10v-1.2h1.3V27H15Zm0 10v-1.2h1.3V37H15Z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3ZM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7Z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5ZM4.4 16.2 6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',minus:'<svg width="24" height="24"><path d="M19 11a1 1 0 0 1 .1 2H5a1 1 0 0 1-.1-2H19Z"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="m15 13 2-2v8H5V7h8l-2 2H7v8h8v-4Zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19Z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3Zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1Z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M15.5 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7ZM13 17v-2h-2v2h2Zm0-4V7h-2v6h2Z" fill-rule="evenodd" clip-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 1 1 0-2Zm13-1v3.5a.5.5 0 1 1-1 0V5h-.5a.5.5 0 1 1 0-1H19Zm-1 8.8.2.2h1.3a.5.5 0 1 1 0 1h-1.6a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2h-1.3a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3Zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 0 1 0-1h1.2a.3.3 0 1 0 0-.6h-1.3a.4.4 0 1 1 0-.8h1.3a.3.3 0 0 0 0-.6h-1.2a.5.5 0 1 1 0-1H19c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3ZM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4 1 13l6.4 6.5 6.5-6.5-6.5-6.5ZM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7ZM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1Z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2Z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2ZM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1ZM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1Z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm8 7v12h-6V8h6Zm-1.5 1.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm-2 7v12H4V8h6ZM8.5 9.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 11v5H8v-5h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 7v5H8V8h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2Z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5 8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1Z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 0 1 .1 2H13v6a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H11V5c0-.6.4-1 1-1Z"/></svg>',preferences:'<svg width="24" height="24"><path d="m20.1 13.5-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5Zm-2.4-1 .7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1Zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6Z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3Zm-1 10H7v-4h10v4Zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5Zm.5-8H6v2h12V5Z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m5 22.1-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5ZM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1Z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1Zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4Zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9Zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7ZM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3Z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5Z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1Z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8Z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5Zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2Z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2Zm0 2v2h14v-2H5Zm10 0h2v2h-2v-2Zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6Z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2Zm0 8h2v-2H3v2Zm4 8h2v-2H7v2ZM3 9h2V7H3v2Zm10-6h-2v2h2V3Zm6 0v2h2a2 2 0 0 0-2-2ZM5 21v-2H3c0 1.1.9 2 2 2Zm-2-4h2v-2H3v2ZM9 3H7v2h2V3Zm2 18h2v-2h-2v2Zm8-8h2v-2h-2v2Zm0 8a2 2 0 0 0 2-2h-2v2Zm0-12h2V7h-2v2Zm0 8h2v-2h-2v2Zm-4 4h2v-2h-2v2Zm0-16h2V3h-2v2ZM7 17h10V7H7v10Zm2-8h6v6H9V9Z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm3.6 10.9L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3Z"/></svg>',send:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="m13.3 22 7-18.3-18.3 7L9 15l4.3 7ZM18 6.8l-.7-.7L9.4 14l.7.7L18 6.8Z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6ZM8 8h2V6H8v2Zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6ZM14 13h2v-2h-2v2Zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6ZM8 18h2v-2H8v2Z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="m16 6 4 4-8 9-8-9 4-4h8Zm-4 10.2 5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2Z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7ZM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7Z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6Zm0-3v2h2V5H6Zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1Zm-5 1.5-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5ZM13 10V8h-2v2h2Zm0-3V5h-2v2h2Zm3 5 1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12Z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="m10.4 10 4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10ZM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19Z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4 10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4Zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11Z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8Zm-2 2H5v5h6V6Z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 0 1 2 2v7h-8v-2h6V6h-6V4Z" opacity=".2"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3Z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8 0h-6v5h6v-5Zm-8-7H5v5h6V6Z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v7h-8v7H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8-7h-6v5h6V6Zm-8 0H5v5h6V6Z"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2Zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5Z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6Zm-4.7 1.8 1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3Z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 6v12h14V6H5Z"/><path d="m14.4 8.6 1.1 1-2.4 2.4 2.4 2.4-1.1 1.1-2.4-2.4-2.4 2.4-1-1.1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15ZM9 13H5v5h4v-5Zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1ZM9 6H5v5h4V6Z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15Zm0 9h-4v5h4v-5ZM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1Zm11-2h-4v5h4V6Z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2Zm5 10H5v4h6v-4Zm8 0h-6v4h6v-4ZM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1Z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1Zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18ZM11 6H5v4h6V6Zm8 0h-6v4h6V6Z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 9h-4v5h4v-5Zm-6 0H9v5h4v-5Zm0-7H9v5h4V6Zm6 0h-4v5h4V6Z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15.5V18h3v-2.5H5Zm14-5h-9V18h9v-7.5ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Zm-8 7.5h3v-3H5v3Z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H6Zm0 12h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 11h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 6h8v3H6V6Zm11 0c.6 0 1 .4 1 1v1a1 1 0 1 1-2 0V7c0-.6.4-1 1-1Z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h12Zm0 12h-8v3h8v-3ZM7 16a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8v-3ZM7 11a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8V6ZM7 6a1 1 0 0 0-1 1v1a1 1 0 1 0 2 0V7c0-.6-.4-1-1-1Z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-9h-6v3h6V6ZM5 9h6V6H5v3Z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM8 15.5H5V18h3v-2.5Zm11-5h-9V18h9v-7.5Zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2Zm-8.5-1H5v3h3v-3ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 14v4h6v-4H5Zm14 0h-6v4h6v-4Zm0-6h-6v4h6V8ZM5 12h6V8H5v4Z"/></svg>',"template-add":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 12v4H5a2 2 0 0 0-2 2v3h9.3a6 6 0 0 1-.3-2H5v-1h7a6 6 0 0 1 .8-2H11v-5l-.8-.6a3 3 0 1 1 3.6 0l-.8.6v4.7a6 6 0 0 1 2-1.9V12a5 5 0 1 0-6 0Z"/><path d="M18 15c.5 0 1 .4 1 .9V18h2a1 1 0 0 1 .1 2H19v2a1 1 0 0 1-2 .1V20h-2a1 1 0 0 1-.1-2H17v-2c0-.6.4-1 1-1Z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14ZM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4Zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2Z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0Zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7Z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"/></g></svg>',"text-size-decrease":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM14 12a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Z"/></svg>',"text-size-increase":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM17 9a1 1 0 0 0-1 1v2h-2a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2v-2c0-.6-.4-1-1-1Z"/></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="m12.7 14.3-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8Zm4.3-3 2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 0 1 2 0Zm-2.2 4.4h2.4L16 12.5l-1.2 3.2Z" fill-rule="evenodd"/></svg>',typography:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H7a1 1 0 0 1 0-2h10Z"/><path d="m17.5 14 .8-1.7 1.7-.8-1.7-.8-.8-1.7-.8 1.7-1.7.8 1.7.8.8 1.7ZM7 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2Z"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1ZM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2ZM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1ZM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5Zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5Zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17Zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19Zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19Z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2Z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm0 1a1 1 0 0 0-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6Z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12ZM11 6.4 8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4Z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24Zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7ZM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13Z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 0 1 1.2 1.5l-.1.1-4.1 3-4-3a1 1 0 0 1 1-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8 4 2.9a1 1 0 0 1-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 0 1-1-1v-4l-2 1.3a1 1 0 0 1-1.2-.1l-.1-.1a1 1 0 0 1 .1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2Zm-4 0v2a2 2 0 0 1-2-2h2Zm8 0v2h-2v-2h2Zm8 0a2 2 0 0 1-2 2v-2h2Zm-4 0v2h-2v-2h2ZM15 7a1 1 0 0 1 0 2v7a1 1 0 0 1-2 0V9h-1v7a1 1 0 0 1-2 0v-4a2.5 2.5 0 0 1-.2-5H15ZM5 15v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 11v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 7v2H3V7h2Zm16 0v2h-2V7h2ZM5 3v2H3c0-1.1.9-2 2-2Zm8 0v2h-2V3h2Zm6 0a2 2 0 0 1 2 2h-2V3ZM9 3v2H7V3h2Zm8 0v2h-2V3h2Z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6ZM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3Zm.7-3 .3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4Z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8Zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>'}});(function(){const s=Object.getPrototypeOf,e=(o,c,m)=>{var b;return m(o,c.prototype)?!0:((b=o.constructor)===null||b===void 0?void 0:b.name)===c.name},t=o=>{const c=typeof o;return o===null?"null":c==="object"&&Array.isArray(o)?"array":c==="object"&&e(o,String,(m,b)=>b.isPrototypeOf(m))?"string":c},r=o=>c=>t(c)===o,a=o=>c=>typeof c===o,u=o=>c=>o===c,f=(o,c)=>g(o)&&e(o,c,(m,b)=>s(m)===b),h=r("string"),g=r("object"),y=o=>f(o,Object),C=r("array"),A=u(null),O=a("boolean"),N=u(void 0),L=o=>o==null,j=o=>!L(o),z=a("function"),q=a("number"),ee=(o,c)=>{if(C(o)){for(let m=0,b=o.length;m<b;++m)if(!c(o[m]))return!1;return!0}return!1},F=()=>{},ne=o=>()=>o(),oe=(o,c)=>(...m)=>o(c.apply(null,m)),re=(o,c)=>m=>o(c(m)),J=o=>()=>o,we=o=>o,ye=(o,c)=>o===c;function De(o,...c){return(...m)=>{const b=c.concat(m);return o.apply(null,b)}}const _e=o=>c=>!o(c),be=o=>()=>{throw new Error(o)},tt=o=>o(),Qe=J(!1),ft=J(!0);class V{constructor(c,m){this.tag=c,this.value=m}static some(c){return new V(!0,c)}static none(){return V.singletonNone}fold(c,m){return this.tag?m(this.value):c()}isSome(){return this.tag}isNone(){return!this.tag}map(c){return this.tag?V.some(c(this.value)):V.none()}bind(c){return this.tag?c(this.value):V.none()}exists(c){return this.tag&&c(this.value)}forall(c){return!this.tag||c(this.value)}filter(c){return!this.tag||c(this.value)?this:V.none()}getOr(c){return this.tag?this.value:c}or(c){return this.tag?this:c}getOrThunk(c){return this.tag?this.value:c()}orThunk(c){return this.tag?this:c()}getOrDie(c){if(this.tag)return this.value;throw new Error(c!=null?c:"Called getOrDie on None")}static from(c){return j(c)?V.some(c):V.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(c){this.tag&&c(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}V.singletonNone=new V(!1);const mt=Array.prototype.slice,nt=Array.prototype.indexOf,Ot=Array.prototype.push,Tt=(o,c)=>nt.call(o,c),He=(o,c)=>{const m=Tt(o,c);return m===-1?V.none():V.some(m)},ct=(o,c)=>Tt(o,c)>-1,dn=(o,c)=>{for(let m=0,b=o.length;m<b;m++){const _=o[m];if(c(_,m))return!0}return!1},kt=(o,c)=>{const m=[];for(let b=0;b<o;b++)m.push(c(b));return m},xn=(o,c)=>{const m=[];for(let b=0;b<o.length;b+=c){const _=mt.call(o,b,b+c);m.push(_)}return m},We=(o,c)=>{const m=o.length,b=new Array(m);for(let _=0;_<m;_++){const x=o[_];b[_]=c(x,_)}return b},xt=(o,c)=>{for(let m=0,b=o.length;m<b;m++){const _=o[m];c(_,m)}},he=(o,c)=>{for(let m=o.length-1;m>=0;m--){const b=o[m];c(b,m)}},es=(o,c)=>{const m=[],b=[];for(let _=0,x=o.length;_<x;_++){const M=o[_];(c(M,_)?m:b).push(M)}return{pass:m,fail:b}},ho=(o,c)=>{const m=[];for(let b=0,_=o.length;b<_;b++){const x=o[b];c(x,b)&&m.push(x)}return m},ao=(o,c,m)=>(he(o,(b,_)=>{m=c(m,b,_)}),m),xo=(o,c,m)=>(xt(o,(b,_)=>{m=c(m,b,_)}),m),Yo=(o,c,m)=>{for(let b=0,_=o.length;b<_;b++){const x=o[b];if(c(x,b))return V.some(x);if(m(x,b))break}return V.none()},Ct=(o,c)=>Yo(o,c,Qe),Jt=(o,c)=>{for(let m=0,b=o.length;m<b;m++){const _=o[m];if(c(_,m))return V.some(m)}return V.none()},Et=o=>{const c=[];for(let m=0,b=o.length;m<b;++m){if(!C(o[m]))throw new Error("Arr.flatten item "+m+" was not an array, input: "+o);Ot.apply(c,o[m])}return c},Pe=(o,c)=>Et(We(o,c)),Ut=(o,c)=>{for(let m=0,b=o.length;m<b;++m){const _=o[m];if(c(_,m)!==!0)return!1}return!0},gn=o=>{const c=mt.call(o,0);return c.reverse(),c},yt=(o,c)=>ho(o,m=>!ct(c,m)),Yt=(o,c)=>{const m={};for(let b=0,_=o.length;b<_;b++){const x=o[b];m[String(x)]=c(x,b)}return m},bn=o=>[o],rs=(o,c)=>{const m=mt.call(o,0);return m.sort(c),m},Jn=(o,c)=>c>=0&&c<o.length?V.some(o[c]):V.none(),ds=o=>Jn(o,0),Or=o=>Jn(o,o.length-1),Ns=z(Array.from)?Array.from:o=>mt.call(o),Js=(o,c)=>{for(let m=0;m<o.length;m++){const b=c(o[m],m);if(b.isSome())return b}return V.none()},Zs=Object.keys,ba=Object.hasOwnProperty,ar=(o,c)=>{const m=Zs(o);for(let b=0,_=m.length;b<_;b++){const x=m[b],M=o[x];c(M,x)}},Ps=(o,c)=>Zr(o,(m,b)=>({k:b,v:c(m,b)})),Zr=(o,c)=>{const m={};return ar(o,(b,_)=>{const x=c(b,_);m[x.k]=x.v}),m},No=o=>(c,m)=>{o[m]=c},Mo=(o,c,m,b)=>{ar(o,(_,x)=>{(c(_,x)?m:b)(_,x)})},Mr=(o,c)=>{const m={},b={};return Mo(o,c,No(m),No(b)),{t:m,f:b}},Ls=(o,c)=>{const m={};return Mo(o,c,No(m),F),m},na=(o,c)=>{const m=[];return ar(o,(b,_)=>{m.push(c(b,_))}),m},gs=(o,c)=>{const m=Zs(o);for(let b=0,_=m.length;b<_;b++){const x=m[b],M=o[x];if(c(M,x,o))return V.some(M)}return V.none()},va=o=>na(o,we),an=(o,c)=>ps(o,c)?V.from(o[c]):V.none(),ps=(o,c)=>ba.call(o,c),Ii=(o,c)=>ps(o,c)&&o[c]!==void 0&&o[c]!==null,$e=(o,c,m=ye)=>o.exists(b=>m(b,c)),Je=(o,c,m=ye)=>Wn(o,c,m).getOr(o.isNone()&&c.isNone()),At=o=>{const c=[],m=b=>{c.push(b)};for(let b=0;b<o.length;b++)o[b].each(m);return c},Wt=o=>{const c=[];for(let m=0;m<o.length;m++){const b=o[m];if(b.isSome())c.push(b.getOrDie());else return V.none()}return V.some(c)},Wn=(o,c,m)=>o.isSome()&&c.isSome()?V.some(m(o.getOrDie(),c.getOrDie())):V.none(),lo=(o,c,m,b)=>o.isSome()&&c.isSome()&&m.isSome()?V.some(b(o.getOrDie(),c.getOrDie(),m.getOrDie())):V.none(),go=(o,c)=>o!=null?V.some(c(o)):V.none(),cn=(o,c)=>o?V.some(c):V.none(),ts=(o,c)=>o+c,wo=(o,c)=>o.substring(c),cs=(o,c,m)=>c===""||o.length>=c.length&&o.substr(m,m+c.length)===c,_r=(o,c)=>Ur(o,c)?wo(o,c.length):o,Ir=(o,c)=>Bi(o,c)?o:ts(o,c),Vs=(o,c,m=0,b)=>{const _=o.indexOf(c,m);return _!==-1?N(b)?!0:_+c.length<=b:!1},Ur=(o,c)=>cs(o,c,0),Bi=(o,c)=>cs(o,c,o.length-c.length),hi=(o=>c=>c.replace(o,""))(/^\s+|\s+$/g),Ge=o=>o.length>0,qe=o=>!Ge(o),It=o=>o.style!==void 0&&z(o.style.getPropertyValue),jt=(o,c)=>{const b=(c||document).createElement("div");if(b.innerHTML=o,!b.hasChildNodes()||b.childNodes.length>1){const _="HTML does not have a single root node";throw console.error(_,o),new Error(_)}return qo(b.childNodes[0])},co=(o,c)=>{const b=(c||document).createElement(o);return qo(b)},Bo=(o,c)=>{const b=(c||document).createTextNode(o);return qo(b)},qo=o=>{if(o==null)throw new Error("Node cannot be null or undefined");return{dom:o}},it={fromHtml:jt,fromTag:co,fromText:Bo,fromDom:qo,fromPoint:(o,c,m)=>V.from(o.dom.elementFromPoint(c,m)).map(qo)},Wo=typeof window<"u"?window:Function("return this;")(),Di=(o,c)=>{let m=c!=null?c:Wo;for(let b=0;b<o.length&&m!==void 0&&m!==null;++b)m=m[o[b]];return m},oa=(o,c)=>{const m=o.split(".");return Di(m,c)},ua=(o,c)=>oa(o,c),ur=(o,c)=>{const m=ua(o,c);if(m==null)throw new Error(o+" not available on this browser");return m},Dc=Object.getPrototypeOf,gc=o=>ur("HTMLElement",o),Xa=o=>{const c=oa("ownerDocument.defaultView",o);return g(o)&&(gc(c).prototype.isPrototypeOf(o)||/^HTML\w*Element$/.test(Dc(o).constructor.name))},fa=9,Qs=11,xr=1,Ki=3,fl=o=>o.dom.nodeName.toLowerCase(),pc=o=>o.dom.nodeType,Zc=o=>c=>pc(c)===o,gu=o=>gr(o)&&Xa(o.dom),gr=Zc(xr),Ja=Zc(Ki),pu=Zc(fa),qc=Zc(Qs),Vl=o=>c=>gr(c)&&fl(c)===o,xa=(o,c)=>{const m=o.dom;if(m.nodeType!==xr)return!1;{const b=m;if(b.matches!==void 0)return b.matches(c);if(b.msMatchesSelector!==void 0)return b.msMatchesSelector(c);if(b.webkitMatchesSelector!==void 0)return b.webkitMatchesSelector(c);if(b.mozMatchesSelector!==void 0)return b.mozMatchesSelector(c);throw new Error("Browser lacks native selectors")}},Ar=o=>o.nodeType!==xr&&o.nodeType!==fa&&o.nodeType!==Qs||o.childElementCount===0,Rm=(o,c)=>{const m=c===void 0?document:c.dom;return Ar(m)?[]:We(m.querySelectorAll(o),it.fromDom)},pf=(o,c)=>{const m=c===void 0?document:c.dom;return Ar(m)?V.none():V.from(m.querySelector(o)).map(it.fromDom)},Cr=(o,c)=>o.dom===c.dom,La=(o,c)=>{const m=o.dom,b=c.dom;return m===b?!1:m.contains(b)},sa=o=>it.fromDom(o.dom.ownerDocument),Yi=o=>pu(o)?o:sa(o),bu=o=>it.fromDom(Yi(o).dom.documentElement),Oc=o=>it.fromDom(Yi(o).dom.defaultView),Fa=o=>V.from(o.dom.parentNode).map(it.fromDom),Mc=o=>Fa(o),bc=o=>V.from(o.dom.parentElement).map(it.fromDom),gd=(o,c)=>{const m=z(c)?c:Qe;let b=o.dom;const _=[];for(;b.parentNode!==null&&b.parentNode!==void 0;){const x=b.parentNode,M=it.fromDom(x);if(_.push(M),m(M)===!0)break;b=x}return _},Lf=o=>V.from(o.dom.offsetParent).map(it.fromDom),vu=o=>V.from(o.dom.nextSibling).map(it.fromDom),Ul=o=>We(o.dom.childNodes,it.fromDom),Rc=(o,c)=>{const m=o.dom.childNodes;return V.from(m[c]).map(it.fromDom)},bf=o=>Rc(o,0),Gc=(o,c)=>({element:o,offset:c}),pd=(o,c)=>{const m=Ul(o);return m.length>0&&c<m.length?Gc(m[c],0):Gc(o,c)},Ae=o=>qc(o)&&j(o.dom.host),et=z(Element.prototype.attachShadow)&&z(Node.prototype.getRootNode),gt=J(et),Pt=et?o=>it.fromDom(o.dom.getRootNode()):Yi,vn=o=>Ae(o)?o:it.fromDom(Yi(o).dom.body),Ro=o=>Rr(o).isSome(),Rr=o=>{const c=Pt(o);return Ae(c)?V.some(c):V.none()},vs=o=>it.fromDom(o.dom.host),is=o=>{if(gt()&&j(o.target)){const c=it.fromDom(o.target);if(gr(c)&&ki(c)&&o.composed&&o.composedPath){const m=o.composedPath();if(m)return ds(m)}}return V.from(o.target)},ki=o=>j(o.dom.shadowRoot),qs=o=>{const c=Ja(o)?o.dom.parentNode:o.dom;if(c==null||c.ownerDocument===null)return!1;const m=c.ownerDocument;return Rr(it.fromDom(c)).fold(()=>m.body.contains(c),re(qs,vs))},Li=()=>yu(it.fromDom(document)),yu=o=>{const c=o.dom.body;if(c==null)throw new Error("Body is not available yet");return it.fromDom(c)},bd=(o,c,m)=>{if(h(m)||O(m)||q(m))o.setAttribute(c,m+"");else throw console.error("Invalid call to Attribute.set. Key ",c,":: Value ",m,":: Element ",o),new Error("Attribute value was not simple")},Kn=(o,c,m)=>{bd(o.dom,c,m)},Nm=(o,c)=>{const m=o.dom;ar(c,(b,_)=>{bd(m,_,b)})},Fi=(o,c)=>{const m=o.dom.getAttribute(c);return m===null?void 0:m},de=(o,c)=>V.from(Fi(o,c)),Me=(o,c)=>{const m=o.dom;return m&&m.hasAttribute?m.hasAttribute(c):!1},je=(o,c)=>{o.dom.removeAttribute(c)},Bt=o=>xo(o.dom.attributes,(c,m)=>(c[m.name]=m.value,c),{}),Ln=(o,c,m)=>{if(!h(m))throw console.error("Invalid call to CSS.set. Property ",c,":: Value ",m,":: Element ",o),new Error("CSS value must be a string: "+m);It(o)&&o.style.setProperty(c,m)},Xo=(o,c)=>{It(o)&&o.style.removeProperty(c)},no=(o,c,m)=>{const b=o.dom;Ln(b,c,m)},mi=(o,c)=>{const m=o.dom;ar(c,(b,_)=>{Ln(m,_,b)})},hn=(o,c)=>{const m=o.dom;ar(c,(b,_)=>{b.fold(()=>{Xo(m,_)},x=>{Ln(m,_,x)})})},qr=(o,c)=>{const m=o.dom,_=window.getComputedStyle(m).getPropertyValue(c);return _===""&&!qs(o)?Nl(m,c):_},Nl=(o,c)=>It(o)?o.style.getPropertyValue(c):"",Xi=(o,c)=>{const m=o.dom,b=Nl(m,c);return V.from(b).filter(_=>_.length>0)},ni=o=>{const c={},m=o.dom;if(It(m))for(let b=0;b<m.style.length;b++){const _=m.style.item(b);c[_]=m.style[_]}return c},vf=(o,c,m)=>{const b=it.fromTag(o);return no(b,c,m),Xi(b,c).isSome()},Ss=(o,c)=>{const m=o.dom;Xo(m,c),$e(de(o,"style").map(hi),"")&&je(o,"style")},Kc=o=>o.dom.offsetWidth,Ei=(o,c)=>{const m=(I,U)=>{if(!q(U)&&!U.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+U);const Y=I.dom;It(Y)&&(Y.style[o]=U+"px")},b=I=>{const U=c(I);if(U<=0||U===null){const Y=qr(I,o);return parseFloat(Y)||0}return U},_=b,x=(I,U)=>xo(U,(Y,se)=>{const fe=qr(I,se),me=fe===void 0?0:parseInt(fe,10);return isNaN(me)?Y:Y+me},0);return{set:m,get:b,getOuter:_,aggregate:x,max:(I,U,Y)=>{const se=x(I,Y);return U>se?U-se:0}}},sc=Ei("height",o=>{const c=o.dom;return qs(o)?c.getBoundingClientRect().height:c.offsetHeight}),Oi=o=>sc.get(o),Ff=o=>sc.getOuter(o),da=(o,c)=>{const m=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],b=sc.max(o,c,m);no(o,"max-height",b+"px")},Hf=(o,c)=>({left:o,top:c,translate:(b,_)=>Hf(o+b,c+_)}),fr=Hf,zu=o=>{const c=o.getBoundingClientRect();return fr(c.left,c.top)},Vu=(o,c)=>o!==void 0?o:c!==void 0?c:0,vc=o=>{const c=o.dom.ownerDocument,m=c.body,b=c.defaultView,_=c.documentElement;if(m===o.dom)return fr(m.offsetLeft,m.offsetTop);const x=Vu(b==null?void 0:b.pageYOffset,_.scrollTop),M=Vu(b==null?void 0:b.pageXOffset,_.scrollLeft),I=Vu(_.clientTop,m.clientTop),U=Vu(_.clientLeft,m.clientLeft);return $f(o).translate(M-U,x-I)},$f=o=>{const c=o.dom,b=c.ownerDocument.body;return b===c?fr(b.offsetLeft,b.offsetTop):qs(o)?zu(c):fr(0,0)},jd=Ei("width",o=>o.dom.offsetWidth),Xr=(o,c)=>jd.set(o,c),Ji=o=>jd.get(o),Ha=o=>jd.getOuter(o),U0=(o,c)=>{const m=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],b=jd.max(o,c,m);no(o,"max-width",b+"px")},xi=o=>{let c=!1,m;return(...b)=>(c||(c=!0,m=o.apply(null,b)),m)},_l=(o,c,m,b)=>{const _=o.isiOS()&&/ipad/i.test(m)===!0,x=o.isiOS()&&!_,M=o.isiOS()||o.isAndroid(),I=M||b("(pointer:coarse)"),U=_||!x&&M&&b("(min-device-width:768px)"),Y=x||M&&!U,se=c.isSafari()&&o.isiOS()&&/safari/i.test(m)===!1,fe=!Y&&!U&&!se;return{isiPad:J(_),isiPhone:J(x),isTablet:J(U),isPhone:J(Y),isTouch:J(I),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:J(se),isDesktop:J(fe)}},Qa=(o,c)=>{for(let m=0;m<o.length;m++){const b=o[m];if(b.test(c))return b}},Ng=(o,c)=>{const m=Qa(o,c);if(!m)return{major:0,minor:0};const b=_=>Number(c.replace(m,"$"+_));return yf(b(1),b(2))},zf=(o,c)=>{const m=String(c).toLowerCase();return o.length===0?yc():Ng(o,m)},yc=()=>yf(0,0),yf=(o,c)=>({major:o,minor:c}),Tr={nu:yf,detect:zf,unknown:yc},Uu=(o,c)=>Js(c.brands,m=>{const b=m.brand.toLowerCase();return Ct(o,_=>{var x;return b===((x=_.brand)===null||x===void 0?void 0:x.toLowerCase())}).map(_=>({current:_.name,version:Tr.nu(parseInt(m.version,10),0)}))}),Pl=(o,c)=>{const m=String(c).toLowerCase();return Ct(o,b=>b.search(m))},$a=(o,c)=>Pl(o,c).map(m=>{const b=Tr.detect(m.versionRegexes,c);return{current:m.name,version:b}}),qi=(o,c)=>Pl(o,c).map(m=>{const b=Tr.detect(m.versionRegexes,c);return{current:m.name,version:b}}),Hi=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,rc=o=>c=>Vs(c,o),Vf=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:o=>Vs(o,"edge/")&&Vs(o,"chrome")&&Vs(o,"safari")&&Vs(o,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Hi],search:o=>Vs(o,"chrome")&&!Vs(o,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:o=>Vs(o,"msie")||Vs(o,"trident")},{name:"Opera",versionRegexes:[Hi,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:rc("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:rc("firefox")},{name:"Safari",versionRegexes:[Hi,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:o=>(Vs(o,"safari")||Vs(o,"mobile/"))&&Vs(o,"applewebkit")}],Zd=[{name:"Windows",search:rc("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:o=>Vs(o,"iphone")||Vs(o,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:rc("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:rc("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:rc("linux"),versionRegexes:[]},{name:"Solaris",search:rc("sunos"),versionRegexes:[]},{name:"FreeBSD",search:rc("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:rc("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Pg={browsers:J(Vf),oses:J(Zd)},Pm="Edge",Il="Chromium",Im="IE",el="Opera",wf="Firefox",$h="Safari",Wu=()=>zh({current:void 0,version:Tr.unknown()}),zh=o=>{const c=o.current,m=o.version,b=_=>()=>c===_;return{current:c,version:m,isEdge:b(Pm),isChromium:b(Il),isIE:b(Im),isOpera:b(el),isFirefox:b(wf),isSafari:b($h)}},Nc={unknown:Wu,nu:zh,edge:J(Pm),chromium:J(Il),ie:J(Im),opera:J(el),firefox:J(wf),safari:J($h)},Vh="Windows",_f="iOS",Bp="Android",Bm="Linux",Uf="macOS",Wl="Solaris",Ig="FreeBSD",Ke="ChromeOS",qd=()=>wu({current:void 0,version:Tr.unknown()}),wu=o=>{const c=o.current,m=o.version,b=_=>()=>c===_;return{current:c,version:m,isWindows:b(Vh),isiOS:b(_f),isAndroid:b(Bp),isMacOS:b(Uf),isLinux:b(Bm),isSolaris:b(Wl),isFreeBSD:b(Ig),isChromeOS:b(Ke)}},Bg={unknown:qd,nu:wu,windows:J(Vh),ios:J(_f),android:J(Bp),linux:J(Bm),macos:J(Uf),solaris:J(Wl),freebsd:J(Ig),chromeos:J(Ke)},Uh={detect:(o,c,m)=>{const b=Pg.browsers(),_=Pg.oses(),x=c.bind(U=>Uu(b,U)).orThunk(()=>$a(b,o)).fold(Nc.unknown,Nc.nu),M=qi(_,o).fold(Bg.unknown,Bg.nu),I=_l(M,x,o,m);return{browser:x,os:M,deviceType:I}}},pt=o=>window.matchMedia(o).matches;let ln=xi(()=>Uh.detect(navigator.userAgent,V.from(navigator.userAgentData),pt));const nn=()=>ln(),Eo=(o,c,m,b,_,x,M)=>({target:o,x:c,y:m,stop:b,prevent:_,kill:x,raw:M}),er=o=>{const c=it.fromDom(is(o).getOr(o.target)),m=()=>o.stopPropagation(),b=()=>o.preventDefault(),_=oe(b,m);return Eo(c,o.clientX,o.clientY,m,b,_,o)},Wr=(o,c)=>m=>{o(m)&&c(er(m))},ai=(o,c,m,b,_)=>{const x=Wr(m,b);return o.dom.addEventListener(c,x,_),{unbind:De(W0,o,c,x,_)}},gi=(o,c,m,b)=>ai(o,c,m,b,!1),Gd=(o,c,m,b)=>ai(o,c,m,b,!0),W0=(o,c,m,b)=>{o.dom.removeEventListener(c,m,b)},ya=(o,c)=>{Fa(o).each(b=>{b.dom.insertBefore(c.dom,o.dom)})},vd=(o,c)=>{vu(o).fold(()=>{Fa(o).each(_=>{tl(_,c)})},b=>{ya(b,c)})},Lg=(o,c)=>{bf(o).fold(()=>{tl(o,c)},b=>{o.dom.insertBefore(c.dom,b.dom)})},tl=(o,c)=>{o.dom.appendChild(c.dom)},Aa=(o,c,m)=>{Rc(o,m).fold(()=>{tl(o,c)},b=>{ya(b,c)})},ju=(o,c)=>{xt(c,m=>{tl(o,m)})},oi=o=>{o.dom.textContent="",xt(Ul(o),c=>{_u(c)})},_u=o=>{const c=o.dom;c.parentNode!==null&&c.parentNode.removeChild(c)},ic=o=>{const c=o!==void 0?o.dom:document,m=c.body.scrollLeft||c.documentElement.scrollLeft,b=c.body.scrollTop||c.documentElement.scrollTop;return fr(m,b)},Wh=(o,c,m)=>{const _=(m!==void 0?m.dom:document).defaultView;_&&_.scrollTo(o,c)},F1=o=>{const c=o===void 0?window:o;return nn().browser.isFirefox()?V.none():V.from(c.visualViewport)},Kd=(o,c,m,b)=>({x:o,y:c,width:m,height:b,right:o+m,bottom:c+b}),Fg=o=>{const c=o===void 0?window:o,m=c.document,b=ic(it.fromDom(m));return F1(c).fold(()=>{const _=c.document.documentElement,x=_.clientWidth,M=_.clientHeight;return Kd(b.left,b.top,x,M)},_=>Kd(Math.max(_.pageLeft,b.left),Math.max(_.pageTop,b.top),_.width,_.height))},Yd=()=>it.fromDom(document),jl=(o,c)=>o.view(c).fold(J([]),b=>{const _=o.owner(b),x=jl(o,_);return[b].concat(x)}),jh=(o,c)=>{const m=c.owner(o),b=jl(c,m);return V.some(b)};var Hg=Object.freeze({__proto__:null,view:o=>{var c;return(o.dom===document?V.none():V.from((c=o.dom.defaultView)===null||c===void 0?void 0:c.frameElement)).map(it.fromDom)},owner:o=>sa(o)});const Zh=o=>{const c=Yd(),m=ic(c);return jh(o,Hg).fold(De(vc,o),_=>{const x=$f(o),M=ao(_,(I,U)=>{const Y=$f(U);return{left:I.left+Y.left,top:I.top+Y.top}},{left:0,top:0});return fr(M.left+x.left+m.left,M.top+x.top+m.top)})},Xd=(o,c,m)=>({point:o,width:c,height:m}),yd=(o,c,m,b)=>({x:o,y:c,width:m,height:b}),si=(o,c,m,b)=>({x:o,y:c,width:m,height:b,right:o+m,bottom:c+b}),li=o=>{const c=vc(o),m=Ha(o),b=Ff(o);return si(c.left,c.top,m,b)},Bl=o=>{const c=Zh(o),m=Ha(o),b=Ff(o);return si(c.left,c.top,m,b)},Lp=(o,c)=>{const m=Math.max(o.x,c.x),b=Math.max(o.y,c.y),_=Math.min(o.right,c.right),x=Math.min(o.bottom,c.bottom),M=_-m,I=x-b;return si(m,b,M,I)},X=(o,c)=>xo(c,(m,b)=>Lp(m,b),o),le=()=>Fg(window);var Se=tinymce.util.Tools.resolve("tinymce.ThemeManager");const Ye=o=>{const c=x=>x(o),m=J(o),b=()=>_,_={tag:!0,inner:o,fold:(x,M)=>M(o),isValue:ft,isError:Qe,map:x=>wn.value(x(o)),mapError:b,bind:c,exists:c,forall:c,getOr:m,or:b,getOrThunk:m,orThunk:b,getOrDie:m,each:x=>{x(o)},toOptional:()=>V.some(o)};return _},rt=o=>{const c=()=>m,m={tag:!1,inner:o,fold:(b,_)=>b(o),isValue:Qe,isError:ft,map:c,mapError:b=>wn.error(b(o)),bind:c,exists:Qe,forall:ft,getOr:we,or:we,getOrThunk:tt,orThunk:tt,getOrDie:be(String(o)),each:F,toOptional:V.none};return m},wn={value:Ye,error:rt,fromOption:(o,c)=>o.fold(()=>rt(c),Ye)};var Go;(function(o){o[o.Error=0]="Error",o[o.Value=1]="Value"})(Go||(Go={}));const ns=(o,c,m)=>o.stype===Go.Error?c(o.serror):m(o.svalue),uo=o=>{const c=[],m=[];return xt(o,b=>{ns(b,_=>m.push(_),_=>c.push(_))}),{values:c,errors:m}},Sr=(o,c)=>o.stype===Go.Error?{stype:Go.Error,serror:c(o.serror)}:o,Zl=(o,c)=>o.stype===Go.Value?{stype:Go.Value,svalue:c(o.svalue)}:o,ra=(o,c)=>o.stype===Go.Value?c(o.svalue):o,Mi=(o,c)=>o.stype===Go.Error?c(o.serror):o,Cu=o=>({stype:Go.Value,svalue:o}),Ta=o=>({stype:Go.Error,serror:o}),$i={fromResult:o=>o.fold(Ta,Cu),toResult:o=>ns(o,wn.error,wn.value),svalue:Cu,partition:uo,serror:Ta,bind:ra,bindError:Mi,map:Zl,mapError:Sr,fold:ns},wa=(o,c,m,b)=>({tag:"field",key:o,newKey:c,presence:m,prop:b}),Yc=(o,c)=>({tag:"custom",newKey:o,instantiator:c}),Jd=(o,c,m)=>{switch(o.tag){case"field":return c(o.key,o.newKey,o.presence,o.prop);case"custom":return m(o.newKey,o.instantiator)}},Qi=(o,c)=>c,j0=(o,c)=>y(o)&&y(c)?Jr(o,c):c,vv=o=>(...c)=>{if(c.length===0)throw new Error("Can't merge zero objects");const m={};for(let b=0;b<c.length;b++){const _=c[b];for(const x in _)ps(_,x)&&(m[x]=o(m[x],_[x]))}return m},Jr=vv(j0),wd=vv(Qi),pr=()=>({tag:"required",process:{}}),ql=o=>({tag:"defaultedThunk",process:o}),Wf=o=>ql(J(o)),Qd=()=>({tag:"option",process:{}}),xe=o=>({tag:"mergeWithThunk",process:o}),Cf=o=>xe(J(o)),$g=(o,c)=>o.length>0?$i.svalue(Jr(c,wd.apply(void 0,o))):$i.svalue(c),Su=o=>oe($i.serror,Et)(o),$1={consolidateObj:(o,c)=>{const m=$i.partition(o);return m.errors.length>0?Su(m.errors):$g(m.values,c)},consolidateArr:o=>{const c=$i.partition(o);return c.errors.length>0?Su(c.errors):$i.svalue(c.values)}},Z0=o=>g(o)&&Zs(o).length>100?" removed due to size":JSON.stringify(o,null,2),jf=o=>{const c=o.length>10?o.slice(0,10).concat([{path:[],getErrorInfo:J("... (only showing first ten failures)")}]):o;return We(c,m=>"Failed path: ("+m.path.join(" > ")+`)
`+m.getErrorInfo())},Hm=(o,c)=>$i.serror([{path:o,getErrorInfo:c}]),zg=(o,c,m)=>Hm(o,()=>'Could not find valid *required* value for "'+c+'" in '+Z0(m)),wv=(o,c)=>Hm(o,()=>'Choice schema did not contain choice key: "'+c+'"'),Sf=(o,c,m)=>Hm(o,()=>'The chosen schema: "'+m+'" did not exist in branches: '+Z0(c)),h2=(o,c)=>Hm(o,()=>"There are unsupported fields: ["+c.join(", ")+"] specified"),ku=(o,c)=>Hm(o,J(c)),Zu=o=>{const c=(b,_)=>$i.bindError(o(_),x=>ku(b,x)),m=J("val");return{extract:c,toString:m}},q0=Zu($i.svalue),G0=(o,c,m,b)=>an(c,m).fold(()=>zg(o,m,c),b),K0=(o,c,m,b)=>{const _=an(o,c).getOrThunk(()=>m(o));return b(_)},z1=(o,c,m)=>m(an(o,c)),Zf=(o,c,m,b)=>{const _=an(o,c).map(x=>x===!0?m(o):x);return b(_)},Y0=(o,c,m,b,_)=>{const x=I=>_.extract(c.concat([b]),I),M=I=>I.fold(()=>$i.svalue(V.none()),U=>{const Y=_.extract(c.concat([b]),U);return $i.map(Y,V.some)});switch(o.tag){case"required":return G0(c,m,b,x);case"defaultedThunk":return K0(m,b,o.process,x);case"option":return z1(m,b,M);case"defaultedOptionThunk":return Zf(m,b,o.process,M);case"mergeWithThunk":return K0(m,b,J({}),I=>{const U=Jr(o.process(m),I);return x(U)})}},X0=(o,c,m)=>{const b={},_=[];for(const x of m)Jd(x,(M,I,U,Y)=>{const se=Y0(U,o,c,M,Y);$i.fold(se,fe=>{_.push(...fe)},fe=>{b[I]=fe})},(M,I)=>{b[M]=I(c)});return _.length>0?$i.serror(_):$i.svalue(b)},dl=o=>({extract:(b,_)=>o().extract(b,_),toString:()=>o().toString()}),m2=o=>Zs(Ls(o,j)),pi=o=>{const c=ro(o),m=ao(o,(_,x)=>Jd(x,M=>Jr(_,{[M]:!0}),J(_)),{});return{extract:(_,x)=>{const M=O(x)?[]:m2(x),I=ho(M,U=>!Ii(m,U));return I.length===0?c.extract(_,x):h2(_,I)},toString:c.toString}},ro=o=>({extract:(b,_)=>X0(b,_,o),toString:()=>`obj{
`+We(o,_=>Jd(_,(x,M,I,U)=>x+" -> "+U.toString(),(x,M)=>"state("+x+")")).join(`
`)+"}"}),_d=o=>({extract:(b,_)=>{const x=We(_,(M,I)=>o.extract(b.concat(["["+I+"]"]),M));return $1.consolidateArr(x)},toString:()=>"array("+o.toString()+")"}),Xn=(o,c)=>{const m=c!==void 0?c:we;return{extract:(x,M)=>{const I=[];for(const U of o){const Y=U.extract(x,M);if(Y.stype===Go.Value)return{stype:Go.Value,svalue:m(Y.svalue)};I.push(Y)}return $1.consolidateArr(I)},toString:()=>"oneOf("+We(o,x=>x.toString()).join(", ")+")"}},wc=(o,c)=>{const m=(x,M)=>_d(Zu(o)).extract(x,M);return{extract:(x,M)=>{const I=Zs(M),U=m(x,I);return $i.bind(U,Y=>{const se=We(Y,fe=>wa(fe,fe,pr(),c));return ro(se).extract(x,M)})},toString:()=>"setOf("+c.toString()+")"}},kf=(o,c)=>{const m=xi(c);return{extract:(x,M)=>m().extract(x,M),toString:()=>m().toString()}},eh=oe(_d,ro),Pc=J(q0),Vg=(o,c)=>Zu(m=>{const b=typeof m;return o(m)?$i.svalue(m):$i.serror(`Expected type: ${c} but got: ${b}`)}),Cd=Vg(q,"number"),hl=Vg(h,"string"),Eu=Vg(O,"boolean"),Fp=Vg(z,"function"),V1=o=>{if(Object(o)!==o)return!0;switch({}.toString.call(o).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(o).every(c=>V1(o[c]));default:return!1}},_n=Zu(o=>V1(o)?$i.svalue(o):$i.serror("Expected value to be acceptable for sending via postMessage")),$m=(o,c,m,b)=>an(m,b).fold(()=>Sf(o,m,b),x=>x.extract(o.concat(["branch: "+b]),c)),Sd=(o,c)=>({extract:(_,x)=>an(x,o).fold(()=>wv(_,o),I=>$m(_,x,c,I)),toString:()=>"chooseOn("+o+"). Possible values: "+Zs(c)}),th=()=>_d(q0),qu=o=>Zu(c=>o(c).fold($i.serror,$i.svalue)),U1=(o,c)=>wc(m=>$i.fromResult(o(m)),c),ui=(o,c,m)=>{const b=c.extract([o],m);return $i.mapError(b,_=>({input:m,errors:_}))},zi=(o,c,m)=>$i.toResult(ui(o,c,m)),ha=o=>o.fold(c=>{throw new Error(kd(c))},we),xs=(o,c,m)=>ha(zi(o,c,m)),kd=o=>`Errors:
`+jf(o.errors).join(`
`)+`
Input object: `+Z0(o.input),Cl=(o,c)=>Sd(o,Ps(c,ro)),Gu=(o,c)=>kf(o,c),za=wa,_a=Yc,Hp=o=>qu(c=>ct(o,c)?wn.value(c):wn.error(`Unsupported value: "${c}", choose one of "${o.join(", ")}".`)),Qt=o=>za(o,o,pr(),Pc()),Gr=(o,c)=>za(o,o,pr(),c),J0=o=>Gr(o,Cd),Ca=o=>Gr(o,hl),Va=(o,c)=>za(o,o,pr(),Hp(c)),Ug=o=>Gr(o,Eu),Ic=o=>Gr(o,Fp),qf=(o,c)=>za(o,o,Qd(),Zu(m=>$i.serror("The field: "+o+" is forbidden. "+c))),Gf=(o,c)=>za(o,o,pr(),ro(c)),$p=(o,c)=>za(o,o,pr(),eh(c)),Ll=(o,c)=>za(o,o,pr(),_d(c)),kr=o=>za(o,o,Qd(),Pc()),Ua=(o,c)=>za(o,o,Qd(),c),nh=o=>Ua(o,Cd),Gl=o=>Ua(o,hl),Q0=(o,c)=>Ua(o,Hp(c)),zm=o=>Ua(o,Fp),W1=(o,c)=>Ua(o,_d(c)),Wa=(o,c)=>Ua(o,ro(c)),ac=(o,c)=>Ua(o,pi(c)),St=(o,c)=>za(o,o,Wf(c),Pc()),_c=(o,c,m)=>za(o,o,Wf(c),m),Xc=(o,c)=>_c(o,c,Cd),lc=(o,c)=>_c(o,c,hl),xu=(o,c,m)=>_c(o,c,Hp(m)),ja=(o,c)=>_c(o,c,Eu),Za=(o,c)=>_c(o,c,Fp),Vm=(o,c)=>_c(o,c,_n),Jc=(o,c,m)=>_c(o,c,_d(m)),eb=(o,c,m)=>_c(o,c,ro(m)),Ho=o=>{let c=o;return{get:()=>c,set:_=>{c=_}}},G={generate:o=>{if(!C(o))throw new Error("cases must be an array");if(o.length===0)throw new Error("there must be at least one case");const c=[],m={};return xt(o,(b,_)=>{const x=Zs(b);if(x.length!==1)throw new Error("one and only one name per case");const M=x[0],I=b[M];if(m[M]!==void 0)throw new Error("duplicate key detected:"+M);if(M==="cata")throw new Error("cannot have a case named cata (sorry)");if(!C(I))throw new Error("case arguments must be an array");c.push(M),m[M]=(...U)=>{const Y=U.length;if(Y!==I.length)throw new Error("Wrong number of arguments to case "+M+". Expected "+I.length+" ("+I+"), got "+Y);return{fold:(...fe)=>{if(fe.length!==o.length)throw new Error("Wrong number of arguments to fold. Expected "+o.length+", got "+fe.length);return fe[_].apply(null,U)},match:fe=>{const me=Zs(fe);if(c.length!==me.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+`
Actual: `+me.join(","));if(!Ut(c,Ne=>ct(me,Ne)))throw new Error("Not all branches were specified when using match. Specified: "+me.join(", ")+`
Required: `+c.join(", "));return fe[M].apply(null,U)},log:fe=>{console.log(fe,{constructors:c,constructor:M,params:U})}}}}),m}};G.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ve=o=>{const c=[],m=[];return xt(o,b=>{b.fold(_=>{c.push(_)},_=>{m.push(_)})}),{errors:c,values:m}},Te=(o,c)=>{const m={};return ar(o,(b,_)=>{ct(c,_)||(m[_]=b)}),m},at=(o,c)=>({[o]:c}),Ft=o=>{const c={};return xt(o,m=>{c[m.key]=m.value}),c},Cn=(o,c)=>Te(o,c),Bn=(o,c)=>at(o,c),Uo=o=>Ft(o),Jo=(o,c)=>o.length===0?wn.value(c):wn.value(Jr(c,wd.apply(void 0,o))),bi=o=>wn.error(Et(o)),tr=(o,c)=>{const m=ve(o);return m.errors.length>0?bi(m.errors):Jo(m.values,c)},br=o=>z(o)?o:Qe,Bc=(o,c,m)=>{let b=o.dom;const _=br(m);for(;b.parentNode;){b=b.parentNode;const x=it.fromDom(b),M=c(x);if(M.isSome())return M;if(_(x))break}return V.none()},Qc=(o,c,m)=>{const b=c(o),_=br(m);return b.orThunk(()=>_(o)?V.none():Bc(o,c,_))},Ku=(o,c)=>Cr(o.element,c.event.target),Ef={can:ft,abort:Qe,run:F},oh=o=>{if(!Ii(o,"can")&&!Ii(o,"abort")&&!Ii(o,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(o,null,2)+" does not have can, abort, or run!");return{...Ef,...o}},sh=(o,c)=>(...m)=>xo(o,(b,_)=>b&&c(_).apply(void 0,m),!0),lr=(o,c)=>(...m)=>xo(o,(b,_)=>b||c(_).apply(void 0,m),!1),Um=o=>z(o)?{can:ft,abort:Qe,run:o}:o,Wm=o=>{const c=sh(o,_=>_.can),m=lr(o,_=>_.abort);return{can:c,abort:m,run:(..._)=>{xt(o,x=>{x.run.apply(void 0,_)})}}},ea=J,eu=ea("touchstart"),zp=ea("touchmove"),jm=ea("touchend"),Os=ea("touchcancel"),Br=ea("mousedown"),Da=ea("mousemove"),cc=ea("mouseout"),j1=ea("mouseup"),Sl=ea("mouseover"),Gi=ea("focusin"),tu=ea("focusout"),xf=ea("keydown"),F_=ea("keyup"),Gh=ea("input"),Wg=ea("change"),Kh=ea("click"),Zm=ea("transitioncancel"),jg=ea("transitionend"),tb=ea("transitionstart"),Yh=ea("selectstart"),Oa=o=>J("alloy."+o),rh={tap:Oa("tap")},Ed=Oa("focus"),qm=Oa("blur.post"),Gm=Oa("paste.post"),Xh=Oa("receive"),Yu=Oa("execute"),nb=Oa("focus.item"),Z1=rh.tap,H_=Oa("longpress"),Ma=Oa("sandbox.close"),Zg=Oa("typeahead.cancel"),Km=Oa("system.init"),nu=Oa("system.touchmove"),Af=Oa("system.touchend"),Ym=Oa("system.scroll"),ih=Oa("system.resize"),Au=Oa("system.attached"),xd=Oa("system.detached"),Xm=Oa("system.dismissRequested"),ob=Oa("system.repositionRequested"),_v=Oa("focusmanager.shifted"),Cv=Oa("slotcontainer.visibility"),ah=Oa("system.external.element.scroll"),qg=Oa("change.tab"),Sv=Oa("dismiss.tab"),Jm=Oa("highlight"),kv=Oa("dehighlight"),nr=(o,c)=>{Gg(o,o.element,c,{})},Ao=(o,c,m)=>{Gg(o,o.element,c,m)},lh=o=>{nr(o,Yu())},q1=(o,c,m)=>{Gg(o,c,m,{})},Gg=(o,c,m,b)=>{const _={target:c,...b};o.getSystem().triggerEvent(m,c,_)},Tk=(o,c,m,b)=>{const _={...b,target:c};o.getSystem().triggerEvent(m,c,_)},Ev=(o,c,m,b)=>{o.getSystem().triggerEvent(m,c,b.event)},ri=o=>Uo(o),xv=(o,c)=>({key:o,value:oh({abort:c})}),G1=(o,c)=>({key:o,value:oh({can:c})}),g2=o=>({key:o,value:oh({run:(c,m)=>{m.event.prevent()}})}),en=(o,c)=>({key:o,value:oh({run:c})}),Ad=(o,c,m)=>({key:o,value:oh({run:(b,_)=>{c.apply(void 0,[b,_].concat(m))}})}),$_=o=>c=>en(o,c),sb=o=>c=>({key:o,value:oh({run:(m,b)=>{Ku(m,b)&&c(m,b)}})}),Dk=(o,c)=>en(o,(m,b)=>{m.getSystem().getByUid(c).each(_=>{Ev(_,_.element,o,b)})}),Qm=(o,c,m)=>{const b=c.partUids[m];return Dk(o,b)},p2=(o,c)=>en(o,(m,b)=>{const _=b.event,x=m.getSystem().getByDom(_.target).getOrThunk(()=>Qc(_.target,I=>m.getSystem().getByDom(I).toOptional(),Qe).getOr(m));c(m,x,b)}),Jh=o=>en(o,(c,m)=>{m.cut()}),Td=o=>en(o,(c,m)=>{m.stop()}),eg=(o,c)=>sb(o)(c),vi=sb(Au()),Dd=sb(xd()),Od=sb(Km()),ou=$_(Yu()),Hs=(o,c)=>{const b=(c||document).createElement("div");return b.innerHTML=o,Ul(it.fromDom(b))},Vp=o=>o.dom.innerHTML,ch=(o,c)=>{const b=sa(o).dom,_=it.fromDom(b.createDocumentFragment()),x=Hs(c,b);ju(_,x),oi(o),tl(o,_)},Kg=o=>{const c=it.fromTag("div"),m=it.fromDom(o.dom.cloneNode(!0));return tl(c,m),Vp(c)},Ok=(o,c)=>it.fromDom(o.dom.cloneNode(c)),rb=o=>Ok(o,!1),Av=o=>{if(Ae(o))return"#shadow-root";{const c=rb(o);return Kg(c)}},kl=o=>Av(o),o3=(o,c,m)=>Cr(c,o.element)&&!Cr(c,m),Yg=ri([G1(Ed(),(o,c)=>{const m=c.event,b=m.originator,_=m.target;return o3(o,b,_)?(console.warn(Ed()+` did not get interpreted by the desired target.
Originator: `+kl(b)+`
Target: `+kl(_)+`
Check the `+Ed()+" event handlers"),!1):!0})]);var El=Object.freeze({__proto__:null,events:Yg});let b2=0;const oo=o=>{const m=new Date().getTime(),b=Math.floor(Math.random()*1e9);return b2++,o+"_"+b+b2+String(m)},v2=J("alloy-id-"),Mk=J("data-alloy-id"),y2=v2(),Qh=Mk(),Xu=(o,c)=>{const m=oo(y2+o);return uh(c,m),m},uh=(o,c)=>{Object.defineProperty(o.dom,Qh,{value:c,writable:!0})},Xg=o=>{const c=gr(o)?o.dom[Qh]:null;return V.from(c)},fh=o=>oo(o),ib=we,Tf=o=>{const c=_=>`The component must be in a context to execute: ${_}`+(o?`
`+kl(o().element)+" is not in context.":""),m=_=>()=>{throw new Error(c(_))},b=_=>()=>{console.warn(c(_))};return{debugInfo:J("fake"),triggerEvent:b("triggerEvent"),triggerFocus:b("triggerFocus"),triggerEscape:b("triggerEscape"),broadcast:b("broadcast"),broadcastOn:b("broadcastOn"),broadcastEvent:b("broadcastEvent"),build:m("build"),buildOrPatch:m("buildOrPatch"),addToWorld:m("addToWorld"),removeFromWorld:m("removeFromWorld"),addToGui:m("addToGui"),removeFromGui:m("removeFromGui"),getByUid:m("getByUid"),getByDom:m("getByDom"),isConnected:Qe}},Jg=Tf(),w2=(o,c,m)=>{const b=m.toString(),_=b.indexOf(")")+1,x=b.indexOf("("),M=b.substring(x+1,_-1).split(/,\s*/);return o.toFunctionAnnotation=()=>({name:c,parameters:Up(M.slice(0,1).concat(M.slice(3)))}),o},Up=o=>We(o,c=>Bi(c,"/*")?c.substring(0,c.length-2):c),Kf=(o,c)=>{const m=o.toString(),b=m.indexOf(")")+1,_=m.indexOf("("),x=m.substring(_+1,b-1).split(/,\s*/);return o.toFunctionAnnotation=()=>({name:c,parameters:Up(x)}),o},_2=(o,c)=>{const m=c.toString(),b=m.indexOf(")")+1,_=m.indexOf("("),x=m.substring(_+1,b-1).split(/,\s*/);return o.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:Up(x.slice(1))}),o},dh=oo("alloy-premade"),Tv=o=>(Object.defineProperty(o.element.dom,dh,{value:o.uid,writable:!0}),Bn(dh,o)),z_=o=>ps(o.dom,dh),C2=o=>an(o,dh),Qg=o=>_2((c,...m)=>o(c.getApis(),c,...m),o),Df={init:()=>su({readState:J("No State required")})},su=o=>o,ep=(o,c)=>{const m=We(c,_=>Wa(_.name(),[Qt("config"),St("state",Df)])),b=zi("component.behaviours",ro(m),o.behaviours).fold(_=>{throw new Error(kd(_)+`
Complete spec:
`+JSON.stringify(o,null,2))},we);return{list:c,data:Ps(b,_=>{const x=_.map(M=>({config:M.config,state:M.state.init(M.config)}));return J(x)})}},S2=o=>o.list,V_=o=>o.data,ab=(o,c)=>{const m={};return ar(o,(b,_)=>{ar(b,(x,M)=>{const I=an(m,M).getOr([]);m[M]=I.concat([c(_,x)])})}),m},Lc=o=>({classes:N(o.classes)?[]:o.classes,attributes:N(o.attributes)?{}:o.attributes,styles:N(o.styles)?{}:o.styles}),lb=(o,c)=>({...o,attributes:{...o.attributes,...c.attributes},styles:{...o.styles,...c.styles},classes:o.classes.concat(c.classes)}),Ju=(o,c,m,b)=>{const _={...c};xt(m,se=>{_[se.name()]=se.exhibit(o,b)});const x=ab(_,(se,fe)=>({name:se,modification:fe})),M=se=>ao(se,(fe,me)=>({...me.modification,...fe}),{}),I=ao(x.classes,(se,fe)=>fe.modification.concat(se),[]),U=M(x.attributes),Y=M(x.styles);return Lc({classes:I,attributes:U,styles:Y})},tp=(o,c,m,b)=>{try{const _=rs(m,(x,M)=>{const I=x[c],U=M[c],Y=b.indexOf(I),se=b.indexOf(U);if(Y===-1)throw new Error("The ordering for "+o+" does not have an entry for "+I+`.
Order specified: `+JSON.stringify(b,null,2));if(se===-1)throw new Error("The ordering for "+o+" does not have an entry for "+U+`.
Order specified: `+JSON.stringify(b,null,2));return Y<se?-1:se<Y?1:0});return wn.value(_)}catch(_){return wn.error([_])}},em=(o,c)=>({handler:o,purpose:c}),Dv=(o,c)=>({cHandler:o,purpose:c}),U_=(o,c)=>Dv(De.apply(void 0,[o.handler].concat(c)),o.purpose),Wp=o=>o.cHandler,k2=(o,c)=>({name:o,handler:c}),np=(o,c)=>{const m={};return xt(o,b=>{m[b.name()]=b.handlers(c)}),m},cb=(o,c,m)=>{const b={...m,...np(c,o)};return ab(b,k2)},K1=(o,c,m,b)=>{const _=cb(o,m,b);return Rk(_,c)},E2=o=>{const c=Um(o);return(m,b,..._)=>{const x=[m,b].concat(_);c.abort.apply(void 0,x)?b.stop():c.can.apply(void 0,x)&&c.run.apply(void 0,x)}},x2=(o,c)=>wn.error(["The event ("+o+`) has more than one behaviour that listens to it.
When this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).
The behaviours that can trigger it are: `+JSON.stringify(We(c,m=>m.name),null,2)]),W_=(o,c,m)=>{const b=c[m];return b?tp("Event: "+m,"name",o,b).map(_=>{const x=We(_,M=>M.handler);return Wm(x)}):x2(m,o)},Rk=(o,c)=>{const m=na(o,(b,_)=>(b.length===1?wn.value(b[0].handler):W_(b,c,_)).map(M=>{const I=E2(M),U=b.length>1?ho(c[_],Y=>dn(b,se=>se.name===Y)).join(" > "):b[0].name;return Bn(_,em(I,U))}));return tr(m,{})},Lr="alloy.base.behaviour",Ov=ro([za("dom","dom",pr(),ro([Qt("tag"),St("styles",{}),St("classes",[]),St("attributes",{}),kr("value"),kr("innerHtml")])),Qt("components"),Qt("uid"),St("events",{}),St("apis",{}),za("eventOrder","eventOrder",Cf({[Yu()]:["disabling",Lr,"toggling","typeaheadevents"],[Ed()]:[Lr,"focusing","keying"],[Km()]:[Lr,"disabling","toggling","representing"],[Gh()]:[Lr,"representing","streaming","invalidating"],[xd()]:[Lr,"representing","item-events","tooltipping"],[Br()]:["focusing",Lr,"item-type-events"],[eu()]:["focusing",Lr,"item-type-events"],[Sl()]:["item-type-events","tooltipping"],[Xh()]:["receiving","reflecting","tooltipping"]}),Pc()),kr("domModification")]),A2=o=>zi("custom.definition",Ov,o),T2=o=>({...o.dom,uid:o.uid,domChildren:We(o.components,c=>c.element)}),ub=o=>o.domModification.fold(()=>Lc({}),Lc),Nk=o=>o.events,tm=(o,c)=>{const m=Fi(o,c);return m===void 0||m===""?[]:m.split(" ")},qa=(o,c,m)=>{const _=tm(o,c).concat([m]);return Kn(o,c,_.join(" ")),!0},fb=(o,c,m)=>{const b=ho(tm(o,c),_=>_!==m);return b.length>0?Kn(o,c,b.join(" ")):je(o,c),!1},Y1=o=>o.dom.classList!==void 0,j_=o=>tm(o,"class"),db=(o,c)=>qa(o,"class",c),D2=(o,c)=>fb(o,"class",c),Ra=(o,c)=>{Y1(o)?o.dom.classList.add(c):db(o,c)},hh=o=>{(Y1(o)?o.dom.classList:j_(o)).length===0&&je(o,"class")},ma=(o,c)=>{Y1(o)?o.dom.classList.remove(c):D2(o,c),hh(o)},Qu=(o,c)=>Y1(o)&&o.dom.classList.contains(c),tg=(o,c)=>{xt(c,m=>{Ra(o,m)})},Fc=(o,c)=>{xt(c,m=>{ma(o,m)})},Pk=(o,c)=>Ut(c,m=>Qu(o,m)),O2=o=>{const c=o.dom.classList,m=new Array(c.length);for(let b=0;b<c.length;b++){const _=c.item(b);_!==null&&(m[b]=_)}return m},Yf=o=>Y1(o)?O2(o):j_(o),Na=o=>o.dom.value,Sa=(o,c)=>{if(c===void 0)throw new Error("Value.set was undefined");o.dom.value=c},Ik=(o,c,m)=>Rc(o,c).map(_=>{if(m.exists(M=>!Cr(M,_))){const M=m.map(fl).getOr("span"),I=it.fromTag(M);return ya(_,I),I}else return _}),mh=(o,c,m)=>{m.fold(()=>tl(o,c),b=>{Cr(b,c)||(ya(b,c),_u(b))})},hb=(o,c,m)=>{const b=We(c,m),_=Ul(o);return xt(_.slice(b.length),_u),b},Mv=(o,c,m,b)=>{const _=Rc(o,c),x=b(m,_),M=Ik(o,c,_);return mh(o,x.element,M),x},Xf=(o,c,m)=>hb(o,c,(b,_)=>Mv(o,_,b,m)),ef=(o,c)=>hb(o,c,(m,b)=>{const _=Rc(o,b);return mh(o,m,_),m}),jp=(o,c)=>{const m=Zs(o),b=Zs(c),_=yt(b,m),x=Mr(o,(M,I)=>!ps(c,I)||M!==c[I]).t;return{toRemove:_,toSet:x}},X1=(o,c)=>{const{class:m,style:b,..._}=Bt(c),{toSet:x,toRemove:M}=jp(o.attributes,_),I=()=>{xt(M,Zt=>je(c,Zt)),Nm(c,x)},U=ni(c),{toSet:Y,toRemove:se}=jp(o.styles,U),fe=()=>{xt(se,Zt=>Ss(c,Zt)),mi(c,Y)},me=Yf(c),Ce=yt(me,o.classes),Ne=yt(o.classes,me),st=()=>{tg(c,Ne),Fc(c,Ce)},Ht=Zt=>{ch(c,Zt)},ut=()=>{const Zt=o.domChildren;ef(c,Zt)},lt=()=>{const Zt=c,Dt=o.value.getOrUndefined();Dt!==Na(Zt)&&Sa(Zt,Dt!=null?Dt:"")};return I(),st(),fe(),o.innerHtml.fold(ut,Ht),lt(),c},mb=o=>{const c=it.fromTag(o.tag);Nm(c,o.attributes),tg(c,o.classes),mi(c,o.styles),o.innerHtml.each(b=>ch(c,b));const m=o.domChildren;return ju(c,m),o.value.each(b=>{Sa(c,b)}),c},gb=(o,c)=>{try{const m=X1(o,c);return V.some(m)}catch{return V.none()}},Z_=o=>o.innerHtml.isSome()&&o.domChildren.length>0,M2=(o,c)=>{const m=_=>fl(_)===o.tag&&!Z_(o)&&!z_(_),b=c.filter(m).bind(_=>gb(o,_)).getOrThunk(()=>mb(o));return uh(b,o.uid),b},Bk=o=>{const c=an(o,"behaviours").getOr({});return Pe(Zs(c),m=>{const b=c[m];return j(b)?[b.me]:[]})},q_=(o,c)=>ep(o,c),G_=o=>{const c=Bk(o);return q_(o,c)},R2=(o,c,m)=>{const b=T2(o),_=ub(o),x={"alloy.base.modification":_},M=c.length>0?Ju(m,x,c,b):_;return lb(b,M)},K_=(o,c,m)=>{const b={"alloy.base.behaviour":Nk(o)};return K1(m,o.eventOrder,c,b).getOrDie()},s3=(o,c)=>{const m=()=>Zt,b=Ho(Jg),_=ha(A2(o)),x=G_(o),M=S2(x),I=V_(x),U=R2(_,M,I),Y=M2(U,c),se=K_(_,M,I),fe=Ho(_.components),me=Dt=>{b.set(Dt)},Ce=()=>{b.set(Tf(m))},Ne=()=>{const Dt=Ul(Y),kn=Pe(Dt,mn=>b.get().getByDom(mn).fold(()=>[],bn));fe.set(kn)},st=Dt=>{const kn=I;return(z(kn[Dt.name()])?kn[Dt.name()]:()=>{throw new Error("Could not find "+Dt.name()+" in "+JSON.stringify(o,null,2))})()},Ht=Dt=>z(I[Dt.name()]),ut=()=>_.apis,lt=Dt=>I[Dt]().map(kn=>kn.state.readState()).getOr("not enabled"),Zt={uid:o.uid,getSystem:b.get,config:st,hasConfigured:Ht,spec:o,readState:lt,getApis:ut,connect:me,disconnect:Ce,element:Y,syncComponents:Ne,components:fe.get,events:se};return Zt},Rv=(o,c)=>{const m=an(o,"components").getOr([]);return c.fold(()=>We(m,uc),b=>We(m,(_,x)=>ng(_,Rc(b,x))))},Y_=(o,c)=>{const{events:m,...b}=ib(o),_=Rv(b,c),x={...b,events:{...El,...m},components:_};return wn.value(s3(x,c))},Ri=o=>{const c=it.fromText(o);return Nv({element:c})},Nv=o=>{const c=xs("external.component",pi([Qt("element"),kr("uid")]),o),m=Ho(Tf()),b=I=>{m.set(I)},_=()=>{m.set(Tf(()=>M))},x=c.uid.getOrThunk(()=>fh("external"));uh(c.element,x);const M={uid:x,getSystem:m.get,config:V.none,hasConfigured:Qe,connect:b,disconnect:_,getApis:()=>({}),element:c.element,spec:o,readState:J("No state"),syncComponents:F,components:J([]),events:{}};return Tv(M)},N2=fh,X_=o=>ps(o,"uid"),ng=(o,c)=>C2(o).getOrThunk(()=>{const m=X_(o)?o:{uid:N2(""),...o};return Y_(m,c).getOrDie()}),uc=o=>ng(o,V.none()),ru=Tv;var J_=(o,c,m,b,_)=>o(m,b)?V.some(m):z(_)&&_(m)?V.none():c(m,b,_);const P2=(o,c,m)=>{let b=o.dom;const _=z(m)?m:Qe;for(;b.parentNode;){b=b.parentNode;const x=it.fromDom(b);if(c(x))return V.some(x);if(_(x))break}return V.none()},op=(o,c,m)=>J_((_,x)=>x(_),P2,o,c,m),sp=(o,c)=>{const m=_=>c(it.fromDom(_));return Ct(o.dom.childNodes,m).map(it.fromDom)},Zp=(o,c)=>{const m=b=>{for(let _=0;_<b.childNodes.length;_++){const x=it.fromDom(b.childNodes[_]);if(c(x))return V.some(x);const M=m(b.childNodes[_]);if(M.isSome())return M}return V.none()};return m(o.dom)},qp=(o,c,m)=>op(o,c,m).isSome(),og=(o,c,m)=>P2(o,b=>xa(b,c),m),Pv=(o,c)=>sp(o,m=>xa(m,c)),ta=(o,c)=>pf(c,o),tf=(o,c,m)=>J_((_,x)=>xa(_,x),og,o,c,m),J1="aria-controls",Lk=o=>op(o,m=>{if(!gr(m))return!1;const b=Fi(m,"id");return b!==void 0&&b.indexOf(J1)>-1}).bind(m=>{const b=Fi(m,"id"),_=Pt(m);return ta(_,`[${J1}="${b}"]`)}),I2=()=>{const o=oo(J1);return{id:o,link:b=>{Kn(b,J1,o)},unlink:b=>{je(b,J1)}}},Fk=(o,c)=>Lk(c).exists(m=>Gp(o,m)),Gp=(o,c)=>qp(c,m=>Cr(m,o.element),Qe)||Fk(o,c),Q1="unknown";var Jf;(function(o){o[o.STOP=0]="STOP",o[o.NORMAL=1]="NORMAL",o[o.LOGGING=2]="LOGGING"})(Jf||(Jf={}));const B2=Ho({}),Q_=(o,c)=>{const m=[],b=new Date().getTime();return{logEventCut:(_,x,M)=>{m.push({outcome:"cut",target:x,purpose:M})},logEventStopped:(_,x,M)=>{m.push({outcome:"stopped",target:x,purpose:M})},logNoParent:(_,x,M)=>{m.push({outcome:"no-parent",target:x,purpose:M})},logEventNoHandlers:(_,x)=>{m.push({outcome:"no-handlers-left",target:x})},logEventResponse:(_,x,M)=>{m.push({outcome:"response",purpose:M,target:x})},write:()=>{const _=new Date().getTime();ct(["mousemove","mouseover","mouseout",Km()],o)||console.log(o,{event:o,time:_-b,target:c.dom,sequence:We(m,x=>ct(["cut","stopped","response"],x.outcome)?"{"+x.purpose+"} "+x.outcome+" at ("+kl(x.target)+")":x.outcome)})}}},eC=(o,c,m)=>{switch(an(B2.get(),o).orThunk(()=>{const _=Zs(B2.get());return Js(_,x=>o.indexOf(x)>-1?V.some(B2.get()[x]):V.none())}).getOr(Jf.NORMAL)){case Jf.NORMAL:return m(nC());case Jf.LOGGING:{const _=Q_(o,c),x=m(_);return _.write(),x}case Jf.STOP:return!0}},Hk=["alloy/data/Fields","alloy/debugging/Debugging"],tC=()=>{const o=new Error;if(o.stack!==void 0){const c=o.stack.split(`
`);return Ct(c,m=>m.indexOf("alloy")>0&&!dn(Hk,b=>m.indexOf(b)>-1)).getOr(Q1)}else return Q1},pb={logEventCut:F,logEventStopped:F,logNoParent:F,logEventNoHandlers:F,logEventResponse:F,write:F},bb=(o,c,m)=>eC(o,c,m),nC=J(pb),L2=J([Qt("menu"),Qt("selectedMenu")]),Kp=J([Qt("item"),Qt("selectedItem")]);J(ro(Kp().concat(L2())));const oC=J(ro(Kp())),Yp=Gf("initSize",[Qt("numColumns"),Qt("numRows")]),sg=()=>Gr("markers",oC()),Iv=()=>Gf("markers",[Qt("backgroundMenu")].concat(L2()).concat(Kp())),nf=o=>Gf("markers",We(o,Qt)),e0=(o,c,m)=>(tC(),za(c,c,m,qu(b=>wn.value((..._)=>b.apply(void 0,_))))),Gs=o=>e0("onHandler",o,Wf(F)),iu=o=>e0("onKeyboardHandler",o,Wf(V.none)),rg=o=>e0("onHandler",o,pr()),F2=o=>e0("onKeyboardHandler",o,pr()),Vi=(o,c)=>_a(o,J(c)),H2=o=>_a(o,we),ig=J(Yp),ga=(o,c,m,b,_,x,M,I=!1)=>({x:o,y:c,bubble:m,direction:b,placement:_,restriction:x,label:`${M}-${_}`,alwaysFit:I}),nm=G.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Vt=(o,c,m,b,_,x,M,I,U)=>o.fold(c,m,b,_,x,M,I,U),vb=(o,c,m,b)=>o.fold(c,c,b,b,c,b,m,m),$2=(o,c,m,b)=>o.fold(c,b,c,b,m,m,c,b),yb=nm.southeast,gh=nm.southwest,of=nm.northeast,t0=nm.northwest,Bv=nm.south,z2=nm.north,Lv=nm.east,wb=nm.west,ph=(o,c,m,b)=>{const _=o+c;return _>b?m:_<m?b:_},Qf=(o,c,m)=>Math.min(Math.max(o,c),m),Tu=(o,c)=>{switch(c){case 1:return o.x;case 0:return o.x+o.width;case 2:return o.y;case 3:return o.y+o.height}},Fl=(o,c)=>Yt(["left","right","top","bottom"],m=>an(c,m).map(b=>Tu(o,b))),V2=(o,c,m)=>{const b=(U,Y)=>c[U].map(se=>{const fe=U==="top"||U==="bottom",me=fe?m.top:m.left,Ne=(U==="left"||U==="top"?Math.max:Math.min)(se,Y)+me;return fe?Qf(Ne,o.y,o.bottom):Qf(Ne,o.x,o.right)}).getOr(Y),_=b("left",o.x),x=b("top",o.y),M=b("right",o.right),I=b("bottom",o.bottom);return si(_,x,M-_,I-x)},rp="layout",sC=o=>o.x,_b=(o,c)=>o.x+o.width/2-c.width/2,Xp=(o,c)=>o.x+o.width-c.width,U2=(o,c)=>o.y-c.height,Fv=o=>o.y+o.height,rC=(o,c)=>o.y+o.height/2-c.height/2,Hv=o=>o.x+o.width,W2=(o,c)=>o.x-c.width,ml=(o,c,m)=>ga(sC(o),Fv(o),m.southeast(),yb(),"southeast",Fl(o,{left:1,top:3}),rp),Kl=(o,c,m)=>ga(Xp(o,c),Fv(o),m.southwest(),gh(),"southwest",Fl(o,{right:0,top:3}),rp),Du=(o,c,m)=>ga(sC(o),U2(o,c),m.northeast(),of(),"northeast",Fl(o,{left:1,bottom:2}),rp),Fr=(o,c,m)=>ga(Xp(o,c),U2(o,c),m.northwest(),t0(),"northwest",Fl(o,{right:0,bottom:2}),rp),Yl=(o,c,m)=>ga(_b(o,c),U2(o,c),m.north(),z2(),"north",Fl(o,{bottom:2}),rp),Hl=(o,c,m)=>ga(_b(o,c),Fv(o),m.south(),Bv(),"south",Fl(o,{top:3}),rp),om=(o,c,m)=>ga(Hv(o),rC(o,c),m.east(),Lv(),"east",Fl(o,{left:0}),rp),vr=(o,c,m)=>ga(W2(o,c),rC(o,c),m.west(),wb(),"west",Fl(o,{right:1}),rp),iC=()=>[ml,Kl,Du,Fr,Hl,Yl,om,vr],au=()=>[Kl,ml,Fr,Du,Hl,Yl,om,vr],xl=()=>[Du,Fr,ml,Kl,Yl,Hl],j2=()=>[Fr,Du,Kl,ml,Yl,Hl],ag=()=>[ml,Kl,Du,Fr,Hl,Yl],fc=()=>[Kl,ml,Fr,Du,Hl,Yl],r3=(o,c)=>c.universal?o:ho(o,m=>ct(c.channels,m));var $k=Object.freeze({__proto__:null,events:o=>ri([en(Xh(),(c,m)=>{const b=o.channels,_=Zs(b),x=m,M=r3(_,x);xt(M,I=>{const U=b[I],Y=U.schema,se=xs("channel["+I+`] data
Receiver: `+kl(c.element),Y,x.data);U.onReceive(c,se)})})])}),zk=[Gr("channels",U1(wn.value,pi([rg("onReceive"),St("schema",Pc())])))];const Z2=(o,c,m)=>ou(b=>{m(b,o,c)}),q2=(o,c,m)=>Od((b,_)=>{m(b,o,c)}),sm=(o,c,m,b,_,x)=>{const M=pi(o),I=Wa(c,[ac("config",o)]);return Al(M,I,c,m,b,_,x)},G2=(o,c,m,b,_,x)=>{const M=o,I=Wa(c,[Ua("config",o)]);return Al(M,I,c,m,b,_,x)},Jp=(o,c,m)=>w2((_,...x)=>{const M=[_].concat(x);return _.config({name:J(o)}).fold(()=>{throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+m)},I=>{const U=Array.prototype.slice.call(M,1);return c.apply(void 0,[_,I.config,I.state].concat(U))})},m,c),gl=o=>({key:o,value:void 0}),Al=(o,c,m,b,_,x,M)=>{const I=fe=>Ii(fe,m)?fe[m]():V.none(),U=Ps(_,(fe,me)=>Jp(m,fe,me)),se={...Ps(x,(fe,me)=>Kf(fe,me)),...U,revoke:De(gl,m),config:fe=>{const me=xs(m+"-config",o,fe);return{key:m,value:{config:me,me:se,configAsRaw:xi(()=>xs(m+"-config",o,fe)),initialConfig:fe,state:M}}},schema:J(c),exhibit:(fe,me)=>Wn(I(fe),an(b,"exhibit"),(Ce,Ne)=>Ne(me,Ce.config,Ce.state)).getOrThunk(()=>Lc({})),name:J(m),handlers:fe=>I(fe).map(me=>an(b,"events").getOr(()=>({}))(me.config,me.state)).getOr({})};return se},An=o=>Uo(o),Vk=pi([Qt("fields"),Qt("name"),St("active",{}),St("apis",{}),St("state",Df),St("extra",{})]),Xl=o=>{const c=xs("Creating behaviour: "+o.name,Vk,o);return sm(c.fields,c.name,c.active,c.apis,c.extra,c.state)},Uk=pi([Qt("branchKey"),Qt("branches"),Qt("name"),St("active",{}),St("apis",{}),St("state",Df),St("extra",{})]),K2=o=>{const c=xs("Creating behaviour: "+o.name,Uk,o);return G2(Cl(c.branchKey,c.branches),c.name,c.active,c.apis,c.extra,c.state)},to=J(void 0),Cc=Xl({fields:zk,name:"receiving",active:$k});var n0=Object.freeze({__proto__:null,exhibit:(o,c)=>Lc({classes:[],styles:c.useFixed()?{}:{position:"relative"}})});const sf=o=>o.dom.focus(),$v=o=>o.dom.blur(),Qp=o=>{const c=Pt(o).dom;return o.dom===c.activeElement},Of=(o=Yd())=>V.from(o.dom.activeElement).map(it.fromDom),nl=o=>Of(Pt(o)).filter(c=>o.dom.contains(c.dom)),Md=(o,c)=>{const m=Pt(c),b=Of(m).bind(x=>{const M=I=>Cr(x,I);return M(c)?V.some(c):Zp(c,M)}),_=o(c);return b.each(x=>{Of(m).filter(M=>Cr(M,x)).fold(()=>{sf(x)},F)}),_},Rd=(o,c,m,b,_)=>{const x=M=>M+"px";return{position:o,left:c.map(x),top:m.map(x),right:b.map(x),bottom:_.map(x)}},Hc=o=>({...o,position:V.some(o.position)}),o0=(o,c)=>{hn(o,Hc(c))},X2=G.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),aC=(o,c,m,b,_,x)=>{const M=c.rect,I=M.x-m,U=M.y-b,Y=M.width,se=M.height,fe=_-(I+Y),me=x-(U+se),Ce=V.some(I),Ne=V.some(U),st=V.some(fe),Ht=V.some(me),ut=V.none();return Vt(c.direction,()=>Rd(o,Ce,Ne,ut,ut),()=>Rd(o,ut,Ne,st,ut),()=>Rd(o,Ce,ut,ut,Ht),()=>Rd(o,ut,ut,st,Ht),()=>Rd(o,Ce,Ne,ut,ut),()=>Rd(o,Ce,ut,ut,Ht),()=>Rd(o,Ce,Ne,ut,ut),()=>Rd(o,ut,Ne,st,ut))},J2=(o,c)=>o.fold(()=>{const m=c.rect;return Rd("absolute",V.some(m.x),V.some(m.y),V.none(),V.none())},(m,b,_,x)=>aC("absolute",c,m,b,_,x),(m,b,_,x)=>aC("fixed",c,m,b,_,x)),bh=(o,c)=>{const m=De(Zh,c),b=o.fold(m,m,()=>{const M=ic();return Zh(c).translate(-M.left,-M.top)}),_=Ha(c),x=Ff(c);return si(b.left,b.top,_,x)},jr=(o,c)=>c.fold(()=>o.fold(le,le,si),m=>o.fold(J(m),J(m),()=>{const b=zv(o,m.x,m.y);return si(b.left,b.top,m.width,m.height)})),zv=(o,c,m)=>{const b=fr(c,m),_=()=>{const x=ic();return b.translate(-x.left,-x.top)};return o.fold(J(b),J(b),_)},ed=(o,c,m,b)=>o.fold(c,m,b);X2.none;const lC=X2.relative,cC=X2.fixed,ia=(o,c)=>({anchorBox:o,origin:c}),Wk=(o,c)=>ia(o,c),Vv="data-alloy-placement",Uv=(o,c)=>{Kn(o,Vv,c)},uC=o=>de(o,Vv),jk=o=>je(o,Vv),s0=G.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),fC=(o,c)=>{const{x:m,y:b,right:_,bottom:x}=c,{x:M,y:I,right:U,bottom:Y,width:se,height:fe}=o,me=M>=m&&M<=_,Ce=I>=b&&I<=x,Ne=me&&Ce,st=U<=_&&U>=m,Ht=Y<=x&&Y>=b,ut=st&&Ht,lt=Math.min(se,M>=m?_-M:U-m),Zt=Math.min(fe,I>=b?x-I:Y-b);return{originInBounds:Ne,sizeInBounds:ut,visibleW:lt,visibleH:Zt}},Zk=(o,c)=>{const{x:m,y:b,right:_,bottom:x}=c,{x:M,y:I,width:U,height:Y}=o,se=Math.max(m,_-U),fe=Math.max(b,x-Y),me=Qf(M,m,se),Ce=Qf(I,b,fe),Ne=Math.min(me+U,_)-me,st=Math.min(Ce+Y,x)-Ce;return si(me,Ce,Ne,st)},dC=(o,c,m)=>{const b=J(c.bottom-m.y),_=J(m.bottom-c.y),x=vb(o,_,_,b),M=J(c.right-m.x),I=J(m.right-c.x);return{maxWidth:$2(o,I,I,M),maxHeight:x}},qk=(o,c,m,b)=>{const _=o.bubble,x=_.offset,M=V2(b,o.restriction,x),I=o.x+x.left,U=o.y+x.top,Y=si(I,U,c,m),{originInBounds:se,sizeInBounds:fe,visibleW:me,visibleH:Ce}=fC(Y,M),Ne=se&&fe,st=Ne?Y:Zk(Y,M),Ht=st.width>0&&st.height>0,{maxWidth:ut,maxHeight:lt}=dC(o.direction,st,b),Zt={rect:st,maxHeight:lt,maxWidth:ut,direction:o.direction,placement:o.placement,classes:{on:_.classesOn,off:_.classesOff},layout:o.label,testY:U};return Ne||o.alwaysFit?s0.fit(Zt):s0.nofit(Zt,me,Ce,Ht)},hC=(o,c,m,b,_,x)=>{const M=b.width,I=b.height,U=(se,fe,me,Ce,Ne)=>{const st=se(m,b,_,o,x),Ht=qk(st,M,I,x);return Ht.fold(J(Ht),(ut,lt,Zt,Dt)=>(Ne===Dt?Zt>Ce||lt>me:!Ne&&Dt)?Ht:s0.nofit(fe,me,Ce,Ne))};return xo(c,(se,fe)=>{const me=De(U,fe);return se.fold(J(se),me)},s0.nofit({rect:m,maxHeight:b.height,maxWidth:b.width,direction:yb(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:m.y},-1,-1,!1)).fold(we,we)},Wv=o=>{const c=Ho(V.none()),m=()=>c.get().each(o);return{clear:()=>{m(),c.set(V.none())},isSet:()=>c.get().isSome(),get:()=>c.get(),set:I=>{m(),c.set(V.some(I))}}},ip=()=>Wv(o=>o.destroy()),r0=()=>Wv(o=>o.unbind()),Ui=()=>{const o=Wv(F);return{...o,on:m=>o.get().each(m)}},Q2=ft,Sc=(o,c,m)=>gi(o,c,Q2,m),i0=(o,c,m)=>Gd(o,c,Q2,m),ol=er,mC=["top","bottom","right","left"],rm="data-alloy-transition-timer",Gk=(o,c)=>Pk(o,c.classes),Jl=(o,c,m)=>m.exists(b=>{const _=o.mode;return _==="all"?!0:b[_]!==c[_]}),rf=(o,c)=>{const m=b=>parseFloat(b).toFixed(3);return gs(c,(b,_)=>{const x=o[_].map(m),M=b.map(m);return!Je(x,M)}).isSome()},Cb=o=>{const c=x=>{const I=qr(o,x).split(/\s*,\s*/);return ho(I,Ge)},m=x=>{if(h(x)&&/^[\d.]+/.test(x)){const M=parseFloat(x);return Bi(x,"ms")?M:M*1e3}else return 0},b=c("transition-delay"),_=c("transition-duration");return xo(_,(x,M,I)=>{const U=m(b[I])+m(M);return Math.max(x,U)},0)},Kk=(o,c)=>{const m=r0(),b=r0();let _;const x=Y=>{var se;const fe=(se=Y.raw.pseudoElement)!==null&&se!==void 0?se:"";return Cr(Y.target,o)&&qe(fe)&&ct(mC,Y.raw.propertyName)},M=Y=>{if(L(Y)||x(Y)){m.clear(),b.clear();const se=Y==null?void 0:Y.raw.type;(L(se)||se===jg())&&(clearTimeout(_),je(o,rm),Fc(o,c.classes))}},I=Sc(o,tb(),Y=>{x(Y)&&(I.unbind(),m.set(Sc(o,jg(),M)),b.set(Sc(o,Zm(),M)))}),U=Cb(o);requestAnimationFrame(()=>{_=setTimeout(M,U+17),Kn(o,rm,_)})},Yk=(o,c)=>{tg(o,c.classes),de(o,rm).each(m=>{clearTimeout(parseInt(m,10)),je(o,rm)}),Kk(o,c)},gC=(o,c,m,b,_,x)=>{const M=Jl(b,_,x);if(M||Gk(o,b)){no(o,"position",m.position);const I=bh(c,o),U=J2(c,{..._,rect:I}),Y=Yt(mC,se=>U[se]);rf(m,Y)&&(hn(o,Y),M&&Yk(o,b),Kc(o))}else Fc(o,b.classes)},Sb=o=>({width:Ha(o),height:Ff(o)}),pC=(o,c,m,b)=>{Ss(c,"max-height"),Ss(c,"max-width");const _=Sb(c);return hC(c,b.preference,o,_,m,b.bounds)},bC=(o,c)=>{const m=c.classes;Fc(o,m.off),tg(o,m.on)},ap=(o,c,m)=>{const b=m.maxHeightFunction;b(o,c.maxHeight)},Xk=(o,c,m)=>{const b=m.maxWidthFunction;b(o,c.maxWidth)},Jk=(o,c,m)=>{const b=J2(m.origin,c);m.transition.each(_=>{gC(o,m.origin,b,_,c,m.lastPlacement)}),o0(o,b)},Qk=(o,c)=>{Uv(o,c.placement)},ew=(o,c)=>{da(o,Math.floor(c))},jv=J((o,c)=>{ew(o,c),mi(o,{"overflow-x":"hidden","overflow-y":"auto"})}),cg=J((o,c)=>{ew(o,c)}),vC=(o,c,m)=>o[c]===void 0?m:o[c],yC=(o,c,m,b,_,x,M,I)=>{const U=vC(M,"maxHeightFunction",jv()),Y=vC(M,"maxWidthFunction",F),se=o.anchorBox,fe=o.origin,me={bounds:jr(fe,x),origin:fe,preference:b,maxHeightFunction:U,maxWidthFunction:Y,lastPlacement:_,transition:I};return Zv(se,c,m,me)},Zv=(o,c,m,b)=>{const _=pC(o,c,m,b);return Jk(c,_,b),Qk(c,_),bC(c,_),ap(c,_,b),Xk(c,_,b),{layout:_.layout,placement:_.placement}},a0=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],ug=(o,c,m,b=1)=>{const _=o*b,x=c*b,M=U=>an(m,U).getOr([]),I=(U,Y,se)=>{const fe=yt(a0,se);return{offset:fr(U,Y),classesOn:Pe(se,M),classesOff:Pe(fe,M)}};return{southeast:()=>I(-o,c,["top","alignLeft"]),southwest:()=>I(o,c,["top","alignRight"]),south:()=>I(-o/2,c,["top","alignCentre"]),northeast:()=>I(-o,-c,["bottom","alignLeft"]),northwest:()=>I(o,-c,["bottom","alignRight"]),north:()=>I(-o/2,-c,["bottom","alignCentre"]),east:()=>I(o,-c/2,["valignCentre","left"]),west:()=>I(-o,-c/2,["valignCentre","right"]),insetNortheast:()=>I(_,x,["top","alignLeft","inset"]),insetNorthwest:()=>I(-_,x,["top","alignRight","inset"]),insetNorth:()=>I(-_/2,x,["top","alignCentre","inset"]),insetSoutheast:()=>I(_,-x,["bottom","alignLeft","inset"]),insetSouthwest:()=>I(-_,-x,["bottom","alignRight","inset"]),insetSouth:()=>I(-_/2,-x,["bottom","alignCentre","inset"]),insetEast:()=>I(-_,-x/2,["valignCentre","right","inset"]),insetWest:()=>I(_,-x/2,["valignCentre","left","inset"])}},qv=()=>ug(0,0,{}),Gv=we,kb=(o,c)=>m=>wC(m)==="rtl"?c:o,wC=o=>qr(o,"direction")==="rtl"?"rtl":"ltr";var vh;(function(o){o.TopToBottom="toptobottom",o.BottomToTop="bottomtotop"})(vh||(vh={}));const Eb="data-alloy-vertical-dir",_C=o=>qp(o,c=>gr(c)&&Fi(c,"data-alloy-vertical-dir")===vh.BottomToTop),yh=()=>Wa("layouts",[Qt("onLtr"),Qt("onRtl"),kr("onBottomLtr"),kr("onBottomRtl")]),lp=(o,c,m,b,_,x,M)=>{const I=M.map(_C).getOr(!1),U=c.layouts.map(Ce=>Ce.onLtr(o)),Y=c.layouts.map(Ce=>Ce.onRtl(o)),se=I?c.layouts.bind(Ce=>Ce.onBottomLtr.map(Ne=>Ne(o))).or(U).getOr(_):U.getOr(m),fe=I?c.layouts.bind(Ce=>Ce.onBottomRtl.map(Ne=>Ne(o))).or(Y).getOr(x):Y.getOr(b);return kb(se,fe)(o)},tw=(o,c,m)=>{const b=c.hotspot,_=bh(m,b.element),x=lp(o.element,c,ag(),fc(),xl(),j2(),V.some(c.hotspot.element));return V.some(Gv({anchorBox:_,bubble:c.bubble.getOr(qv()),overrides:c.overrides,layouts:x}))};var CC=[Qt("hotspot"),kr("bubble"),St("overrides",{}),yh(),Vi("placement",tw)];const Kv=(o,c,m)=>{const b=zv(m,c.x,c.y),_=si(b.left,b.top,c.width,c.height),x=lp(o.element,c,iC(),au(),iC(),au(),V.none());return V.some(Gv({anchorBox:_,bubble:c.bubble,overrides:c.overrides,layouts:x}))};var eE=[Qt("x"),Qt("y"),St("height",0),St("width",0),St("bubble",qv()),St("overrides",{}),yh(),Vi("placement",Kv)];const SC=G.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),tE=o=>o.fold(we,(c,m,b)=>c.translate(-m,-b)),nE=o=>o.fold(we,we),kC=o=>xo(o,(c,m)=>c.translate(m.left,m.top),fr(0,0)),EC=o=>{const c=We(o,tE);return kC(c)},xC=o=>{const c=We(o,nE);return kC(c)},oE=SC.screen,sE=SC.absolute,rE=(o,c,m)=>{const b=Oc(m.root).dom,_=x=>{const M=sa(x),I=sa(o.element);return Cr(M,I)};return V.from(b.frameElement).map(it.fromDom).filter(_).map(vc)},AC=(o,c,m)=>{const b=sa(o.element),_=ic(b),x=rE(o,c,m).getOr(_);return sE(x,_.left,_.top)},nw=(o,c,m,b)=>{const _=oE(fr(o,c));return V.some(Xd(_,m,b))},ow=(o,c,m,b,_)=>o.map(x=>{const M=[c,x.point],I=ed(b,()=>xC(M),()=>xC(M),()=>EC(M)),U=yd(I.left,I.top,x.width,x.height),Y=m.showAbove?xl():ag(),se=m.showAbove?j2():fc(),fe=lp(_,m,Y,se,Y,se,V.none());return Gv({anchorBox:U,bubble:m.bubble.getOr(qv()),overrides:m.overrides,layouts:fe})}),iE=(o,c,m)=>{const b=AC(o,m,c);return c.node.filter(qs).bind(_=>{const x=_.dom.getBoundingClientRect(),M=nw(x.left,x.top,x.width,x.height),I=c.node.getOr(o.element);return ow(M,b,c,m,I)})};var aE=[Qt("node"),Qt("root"),kr("bubble"),yh(),St("overrides",{}),St("showAbove",!1),Vi("placement",iE)];const Yv="\uFEFF",TC="\xA0",xb={create:(o,c,m,b)=>({start:o,soffset:c,finish:m,foffset:b})},l0=G.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Jv=(o,c,m,b)=>o.fold(c,m,b),sw=o=>o.fold(we,we,we),DC=l0.before,rw=l0.on,lE=l0.after,Qv={before:DC,on:rw,after:lE,cata:Jv,getStart:sw},Ab=G.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),cE=o=>Ab.exact(o.start,o.soffset,o.finish,o.foffset),ey=o=>o.match({domRange:c=>it.fromDom(c.startContainer),relative:(c,m)=>Qv.getStart(c),exact:(c,m,b,_)=>c}),af=Ab.domRange,ty=Ab.relative,OC=Ab.exact,ny=o=>{const c=ey(o);return Oc(c)},uE=xb.create,Tb={domRange:af,relative:ty,exact:OC,exactFromRange:cE,getWin:ny,range:uE},iw=(o,c)=>{c.fold(m=>{o.setStartBefore(m.dom)},(m,b)=>{o.setStart(m.dom,b)},m=>{o.setStartAfter(m.dom)})},fE=(o,c)=>{c.fold(m=>{o.setEndBefore(m.dom)},(m,b)=>{o.setEnd(m.dom,b)},m=>{o.setEndAfter(m.dom)})},oy=(o,c,m)=>{const b=o.document.createRange();return iw(b,c),fE(b,m),b},pl=(o,c,m,b,_)=>{const x=o.document.createRange();return x.setStart(c.dom,m),x.setEnd(b.dom,_),x},dE=o=>({left:o.left,top:o.top,right:o.right,bottom:o.bottom,width:o.width,height:o.height}),c0=o=>{const c=o.getClientRects(),m=c.length>0?c[0]:o.getBoundingClientRect();return m.width>0||m.height>0?V.some(m).map(dE):V.none()},hE=o=>{const c=o.getBoundingClientRect();return c.width>0||c.height>0?V.some(c).map(dE):V.none()},u0=G.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),aw=(o,c,m)=>c(it.fromDom(m.startContainer),m.startOffset,it.fromDom(m.endContainer),m.endOffset),mE=(o,c)=>c.match({domRange:m=>({ltr:J(m),rtl:V.none}),relative:(m,b)=>({ltr:xi(()=>oy(o,m,b)),rtl:xi(()=>V.some(oy(o,b,m)))}),exact:(m,b,_,x)=>({ltr:xi(()=>pl(o,m,b,_,x)),rtl:xi(()=>V.some(pl(o,_,x,m,b)))})}),gE=(o,c)=>{const m=c.ltr();return m.collapsed?c.rtl().filter(_=>_.collapsed===!1).map(_=>u0.rtl(it.fromDom(_.endContainer),_.endOffset,it.fromDom(_.startContainer),_.startOffset)).getOrThunk(()=>aw(o,u0.ltr,m)):aw(o,u0.ltr,m)},Db=(o,c)=>{const m=mE(o,c);return gE(o,m)},im=(o,c)=>Db(o,c).match({ltr:(b,_,x,M)=>{const I=o.document.createRange();return I.setStart(b.dom,_),I.setEnd(x.dom,M),I},rtl:(b,_,x,M)=>{const I=o.document.createRange();return I.setStart(x.dom,M),I.setEnd(b.dom,_),I}});u0.ltr,u0.rtl;const f0=(o,c,m)=>ho(gd(o,m),c),lu=(o,c)=>Rm(c,o),e1=(o,c,m,b)=>{const x=sa(o).dom.createRange();return x.setStart(o.dom,c),x.setEnd(m.dom,b),x},MC=(o,c,m,b)=>{const _=e1(o,c,m,b),x=Cr(o,m)&&c===b;return _.collapsed&&!x},RC=o=>V.from(o.getSelection()),lw=o=>{if(o.rangeCount>0){const c=o.getRangeAt(0),m=o.getRangeAt(o.rangeCount-1);return V.some(xb.create(it.fromDom(c.startContainer),c.startOffset,it.fromDom(m.endContainer),m.endOffset))}else return V.none()},cw=o=>{if(o.anchorNode===null||o.focusNode===null)return lw(o);{const c=it.fromDom(o.anchorNode),m=it.fromDom(o.focusNode);return MC(c,o.anchorOffset,m,o.focusOffset)?V.some(xb.create(c,o.anchorOffset,m,o.focusOffset)):lw(o)}},uw=o=>RC(o).filter(c=>c.rangeCount>0).bind(cw),pE=(o,c)=>{const m=im(o,c);return c0(m)},Ob=(o,c)=>{const m=im(o,c);return hE(m)},cp=((o,c)=>{const m=x=>{if(!o(x))throw new Error("Can only get "+c+" value of a "+c+" node");return b(x).getOr("")},b=x=>o(x)?V.from(x.dom.nodeValue):V.none();return{get:m,getOption:b,set:(x,M)=>{if(!o(x))throw new Error("Can only set raw "+c+" value of a "+c+" node");x.dom.nodeValue=M}}})(Ja,"text"),Mb=o=>cp.get(o),wh=(o,c)=>({element:o,offset:c}),bE=(o,c)=>{const m=Ul(o);if(m.length===0)return wh(o,c);if(c<m.length)return wh(m[c],0);{const b=m[m.length-1],_=Ja(b)?Mb(b).length:Ul(b).length;return wh(b,_)}},am=(o,c)=>Ja(o)?wh(o,c):bE(o,c),Nd=o=>o.foffset!==void 0,d0=(o,c)=>c.getSelection.getOrThunk(()=>()=>uw(o))().map(b=>{if(Nd(b)){const _=am(b.start,b.soffset),x=am(b.finish,b.foffset);return Tb.range(_.element,_.offset,x.element,x.offset)}else return b}),fw=(o,c,m)=>{const b=Oc(c.root).dom,_=AC(o,m,c),x=d0(b,c).bind(U=>{if(Nd(U))return Ob(b,Tb.exactFromRange(U)).orThunk(()=>{const se=it.fromText(Yv);ya(U.start,se);const fe=pE(b,Tb.exact(se,0,se,1));return _u(se),fe}).bind(se=>nw(se.left,se.top,se.width,se.height));{const Y=Ps(U,fe=>fe.dom.getBoundingClientRect()),se={left:Math.min(Y.firstCell.left,Y.lastCell.left),right:Math.max(Y.firstCell.right,Y.lastCell.right),top:Math.min(Y.firstCell.top,Y.lastCell.top),bottom:Math.max(Y.firstCell.bottom,Y.lastCell.bottom)};return nw(se.left,se.top,se.right-se.left,se.bottom-se.top)}}),I=d0(b,c).bind(U=>Nd(U)?gr(U.start)?V.some(U.start):bc(U.start):V.some(U.firstCell)).getOr(o.element);return ow(x,_,c,m,I)};var h0=[kr("getSelection"),Qt("root"),kr("bubble"),yh(),St("overrides",{}),St("showAbove",!1),Vi("placement",fw)];const fg="link-layout",S=o=>o.x+o.width,T=(o,c)=>o.x-c.width,H=(o,c)=>o.y-c.height+o.height,ae=o=>o.y,ke=(o,c,m)=>ga(S(o),ae(o),m.southeast(),yb(),"southeast",Fl(o,{left:0,top:2}),fg),Ve=(o,c,m)=>ga(T(o,c),ae(o),m.southwest(),gh(),"southwest",Fl(o,{right:1,top:2}),fg),dt=(o,c,m)=>ga(S(o),H(o,c),m.northeast(),of(),"northeast",Fl(o,{left:0,bottom:3}),fg),_t=(o,c,m)=>ga(T(o,c),H(o,c),m.northwest(),t0(),"northwest",Fl(o,{right:1,bottom:3}),fg),zt=()=>[ke,Ve,dt,_t],pn=()=>[Ve,ke,_t,dt],Hn=(o,c,m)=>{const b=bh(m,c.item.element),_=lp(o.element,c,zt(),pn(),zt(),pn(),V.none());return V.some(Gv({anchorBox:b,bubble:qv(),overrides:c.overrides,layouts:_}))};var zn=[Qt("item"),yh(),St("overrides",{}),Vi("placement",Hn)],Lo=Cl("type",{selection:h0,node:aE,hotspot:CC,submenu:zn,makeshift:eE});const hs=[Ll("classes",hl),xu("mode","all",["all","layout","placement"])],Is=[St("useFixed",Qe),kr("getBounds")],Hr=[Gr("anchor",Lo),Wa("transition",hs)],$s=()=>{const o=document.documentElement;return cC(0,0,o.clientWidth,o.clientHeight)},fi=o=>{const c=vc(o.element),m=o.element.dom.getBoundingClientRect();return lC(c.left,c.top,m.width,m.height)},yi=(o,c,m,b,_,x)=>{const M=Wk(c.anchorBox,o);return yC(M,b.element,c.bubble,c.layouts,_,m,c.overrides,x)},cu=(o,c,m,b,_)=>{const x=V.none();Ou(o,c,m,b,_,x)},Ou=(o,c,m,b,_,x)=>{const M=xs("placement.info",ro(Hr),_),I=M.anchor,U=b.element,Y=m.get(b.uid);Md(()=>{no(U,"position","fixed");const se=Xi(U,"visibility");no(U,"visibility","hidden");const fe=c.useFixed()?$s():fi(o);I.placement(o,I,fe).each(me=>{const Ce=x.orThunk(()=>c.getBounds.map(tt)),Ne=yi(fe,me,Ce,b,Y,M.transition);m.set(b.uid,Ne)}),se.fold(()=>{Ss(U,"visibility")},me=>{no(U,"visibility",me)}),Xi(U,"left").isNone()&&Xi(U,"top").isNone()&&Xi(U,"right").isNone()&&Xi(U,"bottom").isNone()&&$e(Xi(U,"position"),"fixed")&&Ss(U,"position")},U)};var lm=Object.freeze({__proto__:null,position:cu,positionWithinBounds:Ou,getMode:(o,c,m)=>c.useFixed()?"fixed":"absolute",reset:(o,c,m,b)=>{const _=b.element;xt(["position","left","right","top","bottom"],x=>Ss(_,x)),jk(_),m.clear(b.uid)}}),dw=Object.freeze({__proto__:null,init:()=>{let o={};return su({readState:()=>o,clear:_=>{j(_)?delete o[_]:o={}},set:(_,x)=>{o[_]=x},get:_=>an(o,_)})}});const uu=Xl({fields:Is,name:"positioning",active:n0,apis:lm,state:dw}),NC=o=>o.getSystem().isConnected(),Rb=o=>{nr(o,xd());const c=o.components();xt(c,Rb)},Nb=o=>{const c=o.components();xt(c,Nb),nr(o,Au())},Pd=(o,c)=>{o.getSystem().addToWorld(c),qs(o.element)&&Nb(c)},m0=o=>{Rb(o),o.getSystem().removeFromWorld(o)},vE=(o,c)=>{tl(o.element,c.element)},ry=o=>{xt(o.components(),c=>_u(c.element)),oi(o.element),o.syncComponents()},Rf=(o,c,m)=>{const b=o.components();ry(o);const _=m(c),x=yt(b,_);xt(x,M=>{Rb(M),o.getSystem().removeFromWorld(M)}),xt(_,M=>{NC(M)?vE(o,M):(o.getSystem().addToWorld(M),vE(o,M),qs(o.element)&&Nb(M))}),o.syncComponents()},Mu=(o,c,m)=>{const b=o.components(),_=Pe(c,I=>C2(I).toArray());xt(b,I=>{ct(_,I)||m0(I)});const x=m(c),M=yt(b,x);xt(M,I=>{NC(I)&&m0(I)}),xt(x,I=>{NC(I)||Pd(o,I)}),o.syncComponents()},sl=(o,c)=>{Id(o,c,tl)},Id=(o,c,m)=>{o.getSystem().addToWorld(c),m(o.element,c.element),qs(o.element)&&Nb(c),o.syncComponents()},PC=o=>{Rb(o),_u(o.element),o.getSystem().removeFromWorld(o)},$c=o=>{const c=Fa(o.element).bind(m=>o.getSystem().getByDom(m).toOptional());PC(o),c.each(m=>{m.syncComponents()})},g0=o=>{const c=o.components();xt(c,PC),oi(o.element),o.syncComponents()},iy=(o,c)=>{yE(o,c,tl)},hw=(o,c)=>{yE(o,c,vd)},yE=(o,c,m)=>{m(o,c.element);const b=Ul(c.element);xt(b,_=>{c.getByDom(_).each(Nb)})},wE=o=>{const c=Ul(o.element);xt(c,m=>{o.getByDom(m).each(Rb)}),_u(o.element)},t1=(o,c,m,b)=>{m.get().each(M=>{g0(o)});const _=c.getAttachPoint(o);sl(_,o);const x=o.getSystem().build(b);return sl(o,x),m.set(x),x},mw=(o,c,m,b)=>{const _=t1(o,c,m,b);return c.onOpen(o,_),_},dg=(o,c,m,b)=>m.get().map(()=>t1(o,c,m,b)),xO=(o,c,m,b,_)=>{SE(o,c),mw(o,c,m,b),_(),c3(o,c)},_E=(o,c,m)=>{m.get().each(b=>{g0(o),$c(o),c.onClose(o,b),m.clear()})},i3=(o,c,m)=>m.isOpen(),_I=(o,c,m,b)=>i3(o,c,m)&&m.get().exists(_=>c.isPartOf(o,_,b)),a3=(o,c,m)=>m.get(),l3=(o,c,m,b)=>{Xi(o.element,c).fold(()=>{je(o.element,m)},_=>{Kn(o.element,m,_)}),no(o.element,c,b)},CE=(o,c,m)=>{de(o.element,m).fold(()=>Ss(o.element,c),b=>no(o.element,c,b))},SE=(o,c,m)=>{const b=c.getAttachPoint(o);no(o.element,"position",uu.getMode(b)),l3(o,"visibility",c.cloakVisibilityAttr,"hidden")},kE=o=>dn(["top","left","right","bottom"],c=>Xi(o,c).isSome()),c3=(o,c,m)=>{kE(o.element)||Ss(o.element,"position"),CE(o,"visibility",c.cloakVisibilityAttr)};var u3=Object.freeze({__proto__:null,cloak:SE,decloak:c3,open:mw,openWhileCloaked:xO,close:_E,isOpen:i3,isPartOf:_I,getState:a3,setContent:dg}),AO=Object.freeze({__proto__:null,events:(o,c)=>ri([en(Ma(),(m,b)=>{_E(m,o,c)})])}),TO=[Gs("onOpen"),Gs("onClose"),Qt("isPartOf"),Qt("getAttachPoint"),St("cloakVisibilityAttr","data-precloak-visibility")],DO=Object.freeze({__proto__:null,init:()=>{const o=Ui(),c=J("not-implemented");return su({readState:c,isOpen:o.isSet,clear:o.clear,set:o.set,get:o.get})}});const Ks=Xl({fields:TO,name:"sandboxing",active:AO,apis:u3,state:DO}),_h=J("dismiss.popups"),p0=J("reposition.popups"),EE=J("mouse.released"),d3=pi([St("isExtraPart",Qe),Wa("fireEventInstead",[St("event",Xm())])]),ay=o=>{const c=xs("Dismissal",d3,o);return{[_h()]:{schema:pi([Qt("target")]),onReceive:(m,b)=>{Ks.isOpen(m)&&(Ks.isPartOf(m,b.target)||c.isExtraPart(m,b.target)||c.fireEventInstead.fold(()=>Ks.close(m),x=>nr(m,x.event)))}}}},OO=pi([Wa("fireEventInstead",[St("event",ob())]),Ic("doReposition")]),xE=o=>{const c=xs("Reposition",OO,o);return{[p0()]:{onReceive:m=>{Ks.isOpen(m)&&c.fireEventInstead.fold(()=>c.doReposition(m),b=>nr(m,b.event))}}}},IC=(o,c,m)=>{c.store.manager.onLoad(o,c,m)},gw=(o,c,m)=>{c.store.manager.onUnload(o,c,m)};var TE=Object.freeze({__proto__:null,onLoad:IC,onUnload:gw,setValue:(o,c,m,b)=>{c.store.manager.setValue(o,c,m,b)},getValue:(o,c,m)=>c.store.manager.getValue(o,c,m),getState:(o,c,m)=>m}),h3=Object.freeze({__proto__:null,events:(o,c)=>{const m=o.resetOnDom?[vi((b,_)=>{IC(b,o,c)}),Dd((b,_)=>{gw(b,o,c)})]:[q2(o,c,IC)];return ri(m)}});const DE=()=>{const o=Ho(null),c=()=>({mode:"memory",value:o.get()}),m=()=>o.get()===null,b=()=>{o.set(null)};return su({set:o.set,get:o.get,isNotSet:m,clear:b,readState:c})},ly=()=>su({readState:F}),pw=()=>{const o=Ho({}),c=Ho({});return su({readState:()=>({mode:"dataset",dataByValue:o.get(),dataByText:c.get()}),lookup:M=>an(o.get(),M).orThunk(()=>an(c.get(),M)),update:M=>{const I=o.get(),U=c.get(),Y={},se={};xt(M,fe=>{Y[fe.value]=fe,an(fe,"meta").each(me=>{an(me,"text").each(Ce=>{se[Ce]=fe})})}),o.set({...I,...Y}),c.set({...U,...se})},clear:()=>{o.set({}),c.set({})}})};var up=Object.freeze({__proto__:null,memory:DE,dataset:pw,manual:ly,init:o=>o.store.manager.state(o)});const m3=(o,c,m,b)=>{const _=c.store;m.update([b]),_.setValue(o,b),c.onSetValue(o,b)},RO=(o,c,m)=>{const b=c.store,_=b.getDataKey(o);return m.lookup(_).getOrThunk(()=>b.getFallbackEntry(_))},g3=(o,c,m)=>{c.store.initialValue.each(_=>{m3(o,c,m,_)})},OE=(o,c,m)=>{m.clear()};var cy=[kr("initialValue"),Qt("getFallbackEntry"),Qt("getDataKey"),Qt("setValue"),Vi("manager",{setValue:m3,getValue:RO,onLoad:g3,onUnload:OE,state:pw})];const ME=(o,c,m)=>c.store.getValue(o),LC=(o,c,m,b)=>{c.store.setValue(o,b),c.onSetValue(o,b)},RE=(o,c,m)=>{c.store.initialValue.each(b=>{c.store.setValue(o,b)})};var p3=[Qt("getValue"),St("setValue",F),kr("initialValue"),Vi("manager",{setValue:LC,getValue:ME,onLoad:RE,onUnload:F,state:Df.init})];const bw=(o,c,m,b)=>{m.set(b),c.onSetValue(o,b)},NE=(o,c,m)=>m.get(),NO=(o,c,m)=>{c.store.initialValue.each(b=>{m.isNotSet()&&m.set(b)})},cm=(o,c,m)=>{m.clear()};var b3=[kr("initialValue"),Vi("manager",{setValue:bw,getValue:NE,onLoad:NO,onUnload:cm,state:DE})],PO=[_c("store",{mode:"memory"},Cl("mode",{memory:b3,manual:p3,dataset:cy})),Gs("onSetValue"),St("resetOnDom",!1)];const Yn=Xl({fields:PO,name:"representing",active:h3,apis:TE,extra:{setValueFrom:(o,c)=>{const m=Yn.getValue(c);Yn.setValue(o,m)}},state:up}),$l=(o,c)=>eb(o,{},We(c,m=>qf(m.name(),"Cannot configure "+m.name()+" for "+o)).concat([_a("dump",we)])),um=o=>o.dump,Ql=(o,c)=>({...An(c),...o.dump}),fm={field:$l,augment:Ql,get:um},v3="placeholder",vw=G.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Ch=o=>ps(o,"uiType"),FC=(o,c,m,b)=>o.exists(_=>_!==m.owner)?vw.single(!0,J(m)):an(b,m.name).fold(()=>{throw new Error("Unknown placeholder component: "+m.name+`
Known: [`+Zs(b)+`]
Namespace: `+o.getOr("none")+`
Spec: `+JSON.stringify(m,null,2))},_=>_.replace()),yw=(o,c,m,b)=>Ch(m)&&m.uiType===v3?FC(o,c,m,b):vw.single(!1,J(m)),ww=(o,c,m,b)=>yw(o,c,m,b).fold((x,M)=>{const I=Ch(m)?M(c,m.config,m.validated):M(c),U=an(I,"components").getOr([]),Y=Pe(U,se=>ww(o,c,se,b));return[{...I,components:Y}]},(x,M)=>{if(Ch(m)){const I=M(c,m.config,m.validated);return m.validated.preprocess.getOr(we)(I)}else return M(c)}),PE=(o,c,m,b)=>Pe(m,_=>ww(o,c,_,b)),_w=(o,c)=>{let m=!1;const b=()=>m,_=()=>{if(m)throw new Error("Trying to use the same placeholder more than once: "+o);return m=!0,c},x=()=>c.fold((M,I)=>M,(M,I)=>M);return{name:J(o),required:x,used:b,replace:_}},HC=(o,c,m,b)=>{const _=Ps(b,(M,I)=>_w(I,M)),x=PE(o,c,m,_);return ar(_,M=>{if(M.used()===!1&&M.required())throw new Error("Placeholder: "+M.name()+` was not found in components list
Namespace: `+o.getOr("none")+`
Components: `+JSON.stringify(c.components,null,2))}),x},IE=vw.single,IO=vw.multiple,dm=J(v3),$C=G.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Cw=St("factory",{sketch:we}),nd=St("schema",[]),Tl=Qt("name"),BE=za("pname","pname",ql(o=>"<alloy."+oo(o.name)+">"),Pc()),Sw=_a("schema",()=>[kr("preprocess")]),Ld=St("defaults",J({})),kw=St("overrides",J({})),LE=ro([Cw,nd,Tl,BE,Ld,kw]),FE=ro([Cw,nd,Tl,Ld,kw]),BO=ro([Cw,nd,Tl,BE,Ld,kw]),y3=ro([Cw,Sw,Tl,Qt("unit"),BE,Ld,kw]),Ew=o=>o.fold(V.some,V.none,V.some,V.some),w3=o=>{const c=m=>m.name;return o.fold(c,c,c,c)},LO=o=>o.fold(we,we,we,we),v0=(o,c)=>m=>{const b=xs("Converting part type",c,m);return o(b)},zc=v0($C.required,LE),Sh=v0($C.external,FE),Fd=v0($C.optional,BO),od=v0($C.group,y3),zC=J("entirety");var Pb=Object.freeze({__proto__:null,required:zc,external:Sh,optional:Fd,group:od,asNamedPart:Ew,name:w3,asCommon:LO,original:zC});const n1=(o,c,m,b)=>Jr(c.defaults(o,m,b),m,{uid:o.partUids[c.name]},c.overrides(o,m,b)),FO=(o,c,m)=>{const b={},_={};return xt(m,x=>{x.fold(M=>{b[M.pname]=IE(!0,(I,U,Y)=>M.factory.sketch(n1(I,M,U,Y)))},M=>{const I=c.parts[M.name];_[M.name]=J(M.factory.sketch(n1(c,M,I[zC()]),I))},M=>{b[M.pname]=IE(!1,(I,U,Y)=>M.factory.sketch(n1(I,M,U,Y)))},M=>{b[M.pname]=IO(!0,(I,U,Y)=>{const se=I[M.name];return We(se,fe=>M.factory.sketch(Jr(M.defaults(I,fe,Y),fe,M.overrides(I,fe))))})})}),{internals:J(b),externals:J(_)}},HE=(o,c)=>{const m={};return xt(c,b=>{Ew(b).each(_=>{const x=HO(o,_.pname);m[_.name]=M=>{const I=xs("Part: "+_.name+" in "+o,ro(_.schema),M);return{...x,config:M,validated:I}}})}),m},HO=(o,c)=>({uiType:dm(),owner:o,name:c}),_3=(o,c,m)=>({uiType:dm(),owner:o,name:c,config:m,validated:{}}),C3=o=>Pe(o,c=>c.fold(V.none,V.some,V.none,V.none).map(m=>Gf(m.name,m.schema.concat([H2(zC())]))).toArray()),S3=o=>We(o,w3),VC=(o,c,m)=>FO(o,c,m),$E=(o,c,m)=>HC(V.some(o),c,c.components,m),Ai=(o,c,m)=>{const b=c.partUids[m];return o.getSystem().getByUid(b).toOptional()},o1=(o,c,m)=>Ai(o,c,m).getOrDie("Could not find part: "+m),uy=(o,c,m)=>{const b={},_=c.partUids,x=o.getSystem();return xt(m,M=>{b[M]=J(x.getByUid(_[M]))}),b},zE=(o,c)=>{const m=o.getSystem();return Ps(c.partUids,(b,_)=>J(m.getByUid(b)))},k3=o=>Zs(o.partUids),VE=(o,c,m)=>{const b={},_=c.partUids,x=o.getSystem();return xt(m,M=>{b[M]=J(x.getByUid(_[M]).getOrDie())}),b},E3=(o,c)=>{const m=S3(c);return Uo(We(m,b=>({key:b,value:o+"-"+b})))},UC=o=>za("partUids","partUids",xe(c=>E3(c.uid,o)),Pc());var $O=Object.freeze({__proto__:null,generate:HE,generateOne:_3,schemas:C3,names:S3,substitutes:VC,components:$E,defaultUids:E3,defaultUidsSchema:UC,getAllParts:zE,getAllPartNames:k3,getPart:Ai,getPartOrDie:o1,getParts:uy,getPartsOrDie:VE});const zO=(o,c)=>(o.length>0?[Gf("parts",o)]:[]).concat([Qt("uid"),St("dom",{}),St("components",[]),H2("originalSpec"),St("debug.sketcher",{})]).concat(c),x3=(o,c,m,b,_)=>{const x=zO(b,_);return xs(o+" [SpecSchema]",pi(x.concat(c)),m)},VO=(o,c,m,b)=>{const _=dy(b),x=x3(o,c,_,[],[]);return m(x,_)},UE=(o,c,m,b,_)=>{const x=dy(_),M=C3(m),I=UC(m),U=x3(o,c,x,M,[I]),Y=VC(o,U,m),se=$E(o,U,Y.internals());return b(U,se,x,Y.externals())},fy=o=>ps(o,"uid"),dy=o=>fy(o)?o:{...o,uid:fh("uid")},WC=o=>o.uid!==void 0,A3=pi([Qt("name"),Qt("factory"),Qt("configFields"),St("apis",{}),St("extraApis",{})]),kh=pi([Qt("name"),Qt("factory"),Qt("configFields"),Qt("partFields"),St("apis",{}),St("extraApis",{})]),Vc=o=>{const c=xs("Sketcher for "+o.name,A3,o),m=x=>VO(c.name,c.configFields,c.factory,x),b=Ps(c.apis,Qg),_=Ps(c.extraApis,(x,M)=>Kf(x,M));return{name:c.name,configFields:c.configFields,sketch:m,...b,..._}},fu=o=>{const c=xs("Sketcher for "+o.name,kh,o),m=M=>UE(c.name,c.configFields,c.partFields,c.factory,M),b=HE(c.name,c.partFields),_=Ps(c.apis,Qg),x=Ps(c.extraApis,(M,I)=>Kf(M,I));return{name:c.name,partFields:c.partFields,configFields:c.configFields,sketch:m,parts:b,..._,...x}},fp=o=>Vl("input")(o)&&Fi(o,"type")!=="radio"||Vl("textarea")(o);var WO=Object.freeze({__proto__:null,getCurrent:(o,c,m)=>c.find(o)});const jO=[Qt("find")],sr=Xl({fields:jO,name:"composing",apis:WO}),ZO=["input","button","textarea","select"],T3=(o,c,m)=>{(c.disabled()?xw:WE)(o,c)},jC=(o,c)=>c.useNative===!0&&ct(ZO,fl(o.element)),qO=o=>Me(o.element,"disabled"),eo=o=>{Kn(o.element,"disabled","disabled")},Ib=o=>{je(o.element,"disabled")},GO=o=>Fi(o.element,"aria-disabled")==="true",D3=o=>{Kn(o.element,"aria-disabled","true")},ZC=o=>{Kn(o.element,"aria-disabled","false")},xw=(o,c,m)=>{c.disableClass.each(_=>{Ra(o.element,_)}),(jC(o,c)?eo:D3)(o),c.onDisabled(o)},WE=(o,c,m)=>{c.disableClass.each(_=>{ma(o.element,_)}),(jC(o,c)?Ib:ZC)(o),c.onEnabled(o)},jE=(o,c)=>jC(o,c)?qO(o):GO(o);var SI=Object.freeze({__proto__:null,enable:WE,disable:xw,isDisabled:jE,onLoad:T3,set:(o,c,m,b)=>{(b?xw:WE)(o,c)}}),qC=Object.freeze({__proto__:null,exhibit:(o,c)=>Lc({classes:c.disabled()?c.disableClass.toArray():[]}),events:(o,c)=>ri([xv(Yu(),(m,b)=>jE(m,o)),q2(o,c,T3)])}),YO=[Za("disabled",Qe),St("useNative",!0),kr("disableClass"),Gs("onDisabled"),Gs("onEnabled")];const Ko=Xl({fields:YO,name:"disabling",active:qC,apis:SI}),XO=(o,c,m,b)=>{const _=lu(o.element,"."+c.highlightClass);xt(_,x=>{dn(b,I=>Cr(I.element,x))||(ma(x,c.highlightClass),o.getSystem().getByDom(x).each(I=>{c.onDehighlight(o,I),nr(I,kv())}))})},JO=(o,c,m)=>XO(o,c,m,[]),kI=(o,c,m,b)=>{Tw(o,c,m,b)&&(ma(b.element,c.highlightClass),c.onDehighlight(o,b),nr(b,kv()))},Aw=(o,c,m,b)=>{XO(o,c,m,[b]),Tw(o,c,m,b)||(Ra(b.element,c.highlightClass),c.onHighlight(o,b),nr(b,Jm()))},GC=(o,c,m)=>{qE(o,c).each(b=>{Aw(o,c,m,b)})},QO=(o,c,m)=>{GE(o,c).each(b=>{Aw(o,c,m,b)})},eM=(o,c,m,b)=>{R3(o,c,m,b).fold(_=>{throw _},_=>{Aw(o,c,m,_)})},tM=(o,c,m,b)=>{const _=KE(o,c);Ct(_,b).each(M=>{Aw(o,c,m,M)})},Tw=(o,c,m,b)=>Qu(b.element,c.highlightClass),ZE=(o,c,m)=>ta(o.element,"."+c.highlightClass).bind(b=>o.getSystem().getByDom(b).toOptional()),R3=(o,c,m,b)=>{const _=lu(o.element,"."+c.itemClass);return V.from(_[b]).fold(()=>wn.error(new Error("No element found with index "+b)),o.getSystem().getByDom)},qE=(o,c,m)=>ta(o.element,"."+c.itemClass).bind(b=>o.getSystem().getByDom(b).toOptional()),GE=(o,c,m)=>{const b=lu(o.element,"."+c.itemClass);return(b.length>0?V.some(b[b.length-1]):V.none()).bind(x=>o.getSystem().getByDom(x).toOptional())},N3=(o,c,m,b)=>{const _=lu(o.element,"."+c.itemClass);return Jt(_,M=>Qu(M,c.highlightClass)).bind(M=>{const I=ph(M,b,0,_.length-1);return o.getSystem().getByDom(_[I]).toOptional()})},s1=(o,c,m)=>N3(o,c,m,-1),hy=(o,c,m)=>N3(o,c,m,1),KE=(o,c,m)=>{const b=lu(o.element,"."+c.itemClass);return At(We(b,_=>o.getSystem().getByDom(_).toOptional()))};var nM=Object.freeze({__proto__:null,dehighlightAll:JO,dehighlight:kI,highlight:Aw,highlightFirst:GC,highlightLast:QO,highlightAt:eM,highlightBy:tM,isHighlighted:Tw,getHighlighted:ZE,getFirst:qE,getLast:GE,getPrevious:s1,getNext:hy,getCandidates:KE}),oM=[Qt("highlightClass"),Qt("itemClass"),Gs("onHighlight"),Gs("onDehighlight")];const Nr=Xl({fields:oM,name:"highlighting",apis:nM}),YE=[8],dp=[9],hp=[13],r1=[27],Ru=[32],KC=[37],my=[38],YC=[39],Bb=[40],sM=(o,c,m)=>{const b=gn(o.slice(0,c)),_=gn(o.slice(c+1));return Ct(b.concat(_),m)},EI=(o,c,m)=>{const b=gn(o.slice(0,c));return Ct(b,m)},rM=(o,c,m)=>{const b=o.slice(0,c),_=o.slice(c+1);return Ct(_.concat(b),m)},P3=(o,c,m)=>{const b=o.slice(c+1);return Ct(b,m)},rr=o=>c=>{const m=c.raw;return ct(o,m.which)},hm=o=>c=>Ut(o,m=>m(c)),gy=o=>o.raw.shiftKey===!0,iM=o=>o.raw.ctrlKey===!0,Lb=_e(gy),cr=(o,c)=>({matches:o,classification:c}),aM=(o,c)=>Ct(o,b=>b.matches(c)).map(b=>b.classification),XC=(o,c,m)=>{c.exists(_=>m.exists(x=>Cr(x,_)))||Ao(o,_v(),{prevFocus:c,newFocus:m})},JC=()=>{const o=m=>nl(m.element);return{get:o,set:(m,b)=>{const _=o(m);m.getSystem().triggerFocus(b,m.element);const x=o(m);XC(m,_,x)}}},QC=()=>{const o=m=>Nr.getHighlighted(m).map(b=>b.element);return{get:o,set:(m,b)=>{const _=o(m);m.getSystem().getByDom(b).fold(F,M=>{Nr.highlight(m,M)});const x=o(m);XC(m,_,x)}}};var i1;(function(o){o.OnFocusMode="onFocus",o.OnEnterOrSpaceMode="onEnterOrSpace",o.OnApiMode="onApi"})(i1||(i1={}));const mp=(o,c,m,b,_)=>{const x=()=>o.concat([St("focusManager",JC()),_c("focusInside","onFocus",qu(Y=>ct(["onFocus","onEnterOrSpace","onApi"],Y)?wn.value(Y):wn.error("Invalid value for focusInside"))),Vi("handler",U),Vi("state",c),Vi("sendFocusIn",_)]),M=(Y,se,fe,me,Ce)=>{const Ne=fe(Y,se,me,Ce);return aM(Ne,se.event).bind(st=>st(Y,se,me,Ce))},U={schema:x,processKey:M,toEvents:(Y,se)=>{const fe=Y.focusInside!==i1.OnFocusMode?V.none():_(Y).map(Ne=>en(Ed(),(st,Ht)=>{Ne(st,Y,se),Ht.stop()})),me=(Ne,st)=>{const Ht=rr(Ru.concat(hp))(st.event);Y.focusInside===i1.OnEnterOrSpaceMode&&Ht&&Ku(Ne,st)&&_(Y).each(ut=>{ut(Ne,Y,se),st.stop()})},Ce=[en(xf(),(Ne,st)=>{M(Ne,st,m,Y,se).fold(()=>{me(Ne,st)},Ht=>{st.stop()})}),en(F_(),(Ne,st)=>{M(Ne,st,b,Y,se).each(Ht=>{st.stop()})})];return ri(fe.toArray().concat(Ce))}};return U},v=o=>{const c=[kr("onEscape"),kr("onEnter"),St("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),St("firstTabstop",0),St("useTabstopAt",ft),kr("visibilitySelector")].concat([o]),m=(ut,lt)=>{const Zt=ut.visibilitySelector.bind(Dt=>tf(lt,Dt)).getOr(lt);return Oi(Zt)>0},b=(ut,lt)=>{const Zt=lu(ut.element,lt.selector),Dt=ho(Zt,kn=>m(lt,kn));return V.from(Dt[lt.firstTabstop])},_=(ut,lt)=>lt.focusManager.get(ut).bind(Zt=>tf(Zt,lt.selector)),x=(ut,lt)=>m(ut,lt)&&ut.useTabstopAt(lt),M=(ut,lt,Zt)=>{b(ut,lt).each(Dt=>{lt.focusManager.set(ut,Dt)})},I=(ut,lt,Zt,Dt,kn)=>kn(lt,Zt,mn=>x(Dt,mn)).fold(()=>Dt.cyclic?V.some(!0):V.none(),mn=>(Dt.focusManager.set(ut,mn),V.some(!0))),U=(ut,lt,Zt,Dt)=>{const kn=lu(ut.element,Zt.selector);return _(ut,Zt).bind(mn=>Jt(kn,De(Cr,mn)).bind(Zn=>I(ut,kn,Zn,Zt,Dt)))},Y=(ut,lt,Zt)=>{const Dt=Zt.cyclic?sM:EI;return U(ut,lt,Zt,Dt)},se=(ut,lt,Zt)=>{const Dt=Zt.cyclic?rM:P3;return U(ut,lt,Zt,Dt)},fe=ut=>Mc(ut).bind(bf).exists(lt=>Cr(lt,ut)),me=(ut,lt,Zt)=>_(ut,Zt).filter(Dt=>!Zt.useTabstopAt(Dt)).bind(Dt=>(fe(Dt)?Y:se)(ut,lt,Zt)),Ce=(ut,lt,Zt)=>Zt.onEnter.bind(Dt=>Dt(ut,lt)),Ne=(ut,lt,Zt)=>Zt.onEscape.bind(Dt=>Dt(ut,lt)),st=J([cr(hm([gy,rr(dp)]),Y),cr(rr(dp),se),cr(hm([Lb,rr(hp)]),Ce)]),Ht=J([cr(rr(r1),Ne),cr(rr(dp),me)]);return mp(c,Df.init,st,Ht,()=>V.some(M))};var k=v(_a("cyclic",Qe)),D=v(_a("cyclic",ft));const P=(o,c,m)=>(q1(o,m,Yu()),V.some(!0)),Z=(o,c,m)=>fp(m)&&rr(Ru)(c.event)?V.none():P(o,c,m),te=(o,c)=>V.some(!0),ge=[St("execute",Z),St("useSpace",!1),St("useEnter",!0),St("useControlEnter",!1),St("useDown",!1)],Ee=(o,c,m)=>m.execute(o,c,o.element),Fe=(o,c,m,b)=>{const _=m.useSpace&&!fp(o.element)?Ru:[],x=m.useEnter?hp:[],M=m.useDown?Bb:[],I=_.concat(x).concat(M);return[cr(rr(I),Ee)].concat(m.useControlEnter?[cr(hm([iM,rr(hp)]),Ee)]:[])},ot=(o,c,m,b)=>m.useSpace&&!fp(o.element)?[cr(rr(Ru),te)]:[];var wt=mp(ge,Df.init,Fe,ot,()=>V.none());const un=()=>{const o=Ui();return su({readState:()=>o.get().map(_=>({numRows:String(_.numRows),numColumns:String(_.numColumns)})).getOr({numRows:"?",numColumns:"?"}),setGridSize:(_,x)=>{o.set({numRows:_,numColumns:x})},getNumRows:()=>o.get().map(_=>_.numRows),getNumColumns:()=>o.get().map(_=>_.numColumns)})};var Vn=Object.freeze({__proto__:null,flatgrid:un,init:o=>o.state(o)});const tn=o=>(c,m,b,_)=>{const x=o(c.element);return as(x,c,m,b,_)},Un=(o,c)=>{const m=kb(o,c);return tn(m)},Xt=(o,c)=>{const m=kb(c,o);return tn(m)},fo=o=>(c,m,b,_)=>as(o,c,m,b,_),as=(o,c,m,b,_)=>b.focusManager.get(c).bind(M=>o(c.element,M,b,_)).map(M=>(b.focusManager.set(c,M),!0)),Ts=fo,aa=fo,Dl=fo,bl=o=>o.offsetWidth<=0&&o.offsetHeight<=0,Nu=o=>!bl(o.dom),Fb=(o,c)=>Jt(o,c).map(m=>({index:m,candidates:o})),Dw=(o,c,m)=>{const b=M=>Cr(M,c),_=lu(o,m),x=ho(_,Nu);return Fb(x,b)},eS=(o,c)=>Jt(o,m=>Cr(c,m)),tS=(o,c,m,b)=>{const _=Math.floor(c/m),x=c%m;return b(_,x).bind(M=>{const I=M.row*m+M.column;return I>=0&&I<o.length?V.some(o[I]):V.none()})},wi=(o,c,m,b,_)=>tS(o,c,b,(x,M)=>{const U=x===m-1?o.length-x*b:b,Y=ph(M,_,0,U-1);return V.some({row:x,column:Y})}),Pu=(o,c,m,b,_)=>tS(o,c,b,(x,M)=>{const I=ph(x,_,0,m-1),Y=I===m-1?o.length-I*b:b,se=Qf(M,0,Y-1);return V.some({row:I,column:se})}),lf=(o,c,m,b)=>wi(o,c,m,b,1),mm=(o,c,m,b)=>wi(o,c,m,b,-1),cf=(o,c,m,b)=>Pu(o,c,m,b,-1),Hb=(o,c,m,b)=>Pu(o,c,m,b,1),Iu=[Qt("selector"),St("execute",Z),iu("onEscape"),St("captureTab",!1),ig()],Ow=(o,c,m)=>{ta(o.element,c.selector).each(b=>{c.focusManager.set(o,b)})},Mw=(o,c)=>c.focusManager.get(o).bind(m=>tf(m,c.selector)),hg=(o,c,m,b)=>Mw(o,m).bind(_=>m.execute(o,c,_)),dc=o=>(c,m,b,_)=>Dw(c,m,b.selector).bind(x=>o(x.candidates,x.index,_.getNumRows().getOr(b.initSize.numRows),_.getNumColumns().getOr(b.initSize.numColumns))),XE=(o,c,m)=>m.captureTab?V.some(!0):V.none(),I3=(o,c,m)=>m.onEscape(o,c),B3=dc(mm),L3=dc(lf),lM=dc(cf),JE=dc(Hb),cM=J([cr(rr(KC),Un(B3,L3)),cr(rr(YC),Xt(B3,L3)),cr(rr(my),Ts(lM)),cr(rr(Bb),aa(JE)),cr(hm([gy,rr(dp)]),XE),cr(hm([Lb,rr(dp)]),XE),cr(rr(Ru.concat(hp)),hg)]),Rw=J([cr(rr(r1),I3),cr(rr(Ru),te)]);var uM=mp(Iu,un,cM,Rw,()=>V.some(Ow));const F3=(o,c,m,b,_)=>{const x=I=>fl(I)==="button"&&Fi(I,"disabled")==="disabled",M=(I,U,Y)=>_(I,U,b,0,Y.length-1,Y[U],se=>x(Y[se])?M(I,se,Y):V.from(Y[se]));return Dw(o,m,c).bind(I=>{const U=I.index,Y=I.candidates;return M(U,U,Y)})},xI=(o,c,m,b)=>F3(o,c,m,b,(_,x,M,I,U,Y,se)=>{const fe=Qf(x+M,I,U);return fe===_?V.from(Y):se(fe)}),fM=(o,c,m,b)=>F3(o,c,m,b,(_,x,M,I,U,Y,se)=>{const fe=ph(x,M,I,U);return fe===_?V.none():se(fe)}),AI=[Qt("selector"),St("getInitial",V.none),St("execute",Z),iu("onEscape"),St("executeOnMove",!1),St("allowVertical",!0),St("allowHorizontal",!0),St("cycles",!0)],bU=(o,c)=>c.focusManager.get(o).bind(m=>tf(m,c.selector)),dM=(o,c,m)=>bU(o,m).bind(b=>m.execute(o,c,b)),mg=(o,c,m)=>{c.getInitial(o).orThunk(()=>ta(o.element,c.selector)).each(b=>{c.focusManager.set(o,b)})},TI=(o,c,m)=>(m.cycles?fM:xI)(o,m.selector,c,-1),DI=(o,c,m)=>(m.cycles?fM:xI)(o,m.selector,c,1),OI=o=>(c,m,b,_)=>o(c,m,b,_).bind(()=>b.executeOnMove?dM(c,m,b):V.some(!0)),vU=(o,c,m)=>m.onEscape(o,c),yU=(o,c,m,b)=>{const _=[...m.allowHorizontal?KC:[]].concat(m.allowVertical?my:[]),x=[...m.allowHorizontal?YC:[]].concat(m.allowVertical?Bb:[]);return[cr(rr(_),OI(Un(TI,DI))),cr(rr(x),OI(Xt(TI,DI))),cr(rr(hp),dM),cr(rr(Ru),dM)]},nS=J([cr(rr(Ru),te),cr(rr(r1),vU)]);var hM=mp(AI,Df.init,yU,nS,()=>V.some(mg));const H3=(o,c,m)=>V.from(o[c]).bind(b=>V.from(b[m]).map(_=>({rowIndex:c,columnIndex:m,cell:_}))),$3=(o,c,m,b)=>{const x=o[c].length,M=ph(m,b,0,x-1);return H3(o,c,M)},QE=(o,c,m,b)=>{const _=ph(m,b,0,o.length-1),x=o[_].length,M=Qf(c,0,x-1);return H3(o,_,M)},z3=(o,c,m,b)=>{const x=o[c].length,M=Qf(m+b,0,x-1);return H3(o,c,M)},MI=(o,c,m,b)=>{const _=Qf(m+b,0,o.length-1),x=o[_].length,M=Qf(c,0,x-1);return H3(o,_,M)},wU=(o,c,m)=>$3(o,c,m,1),_U=(o,c,m)=>$3(o,c,m,-1),CU=(o,c,m)=>QE(o,m,c,-1),SU=(o,c,m)=>QE(o,m,c,1),kU=(o,c,m)=>z3(o,c,m,-1),RI=(o,c,m)=>z3(o,c,m,1),mM=(o,c,m)=>MI(o,m,c,-1),EU=(o,c,m)=>MI(o,m,c,1),xU=[Gf("selectors",[Qt("row"),Qt("cell")]),St("cycles",!0),St("previousSelector",V.none),St("execute",Z)],AU=(o,c,m)=>{c.previousSelector(o).orThunk(()=>{const _=c.selectors;return ta(o.element,_.cell)}).each(_=>{c.focusManager.set(o,_)})},TU=(o,c,m)=>nl(o.element).bind(b=>m.execute(o,c,b)),Nw=(o,c)=>We(o,m=>lu(m,c.selectors.cell)),V3=(o,c)=>(m,b,_)=>{const x=_.cycles?o:c;return tf(b,_.selectors.row).bind(M=>{const I=lu(M,_.selectors.cell);return eS(I,b).bind(U=>{const Y=lu(m,_.selectors.row);return eS(Y,M).bind(se=>{const fe=Nw(Y,_);return x(fe,se,U).map(me=>me.cell)})})})},NI=V3(_U,kU),U3=V3(wU,RI),DU=V3(CU,mM),PI=V3(SU,EU),II=J([cr(rr(KC),Un(NI,U3)),cr(rr(YC),Xt(NI,U3)),cr(rr(my),Ts(DU)),cr(rr(Bb),aa(PI)),cr(rr(Ru.concat(hp)),TU)]),BI=J([cr(rr(Ru),te)]);var LI=mp(xU,Df.init,II,BI,()=>V.some(AU));const OU=[Qt("selector"),St("execute",Z),St("moveOnTab",!1)],FI=(o,c,m)=>m.focusManager.get(o).bind(b=>m.execute(o,c,b)),MU=(o,c,m)=>{ta(o.element,c.selector).each(b=>{c.focusManager.set(o,b)})},W3=(o,c,m)=>fM(o,m.selector,c,-1),HI=(o,c,m)=>fM(o,m.selector,c,1),RU=(o,c,m,b)=>m.moveOnTab?Dl(W3)(o,c,m,b):V.none(),NU=(o,c,m,b)=>m.moveOnTab?Dl(HI)(o,c,m,b):V.none(),PU=J([cr(rr(my),Dl(W3)),cr(rr(Bb),Dl(HI)),cr(hm([gy,rr(dp)]),RU),cr(hm([Lb,rr(dp)]),NU),cr(rr(hp),FI),cr(rr(Ru),FI)]),$I=J([cr(rr(Ru),te)]);var IU=mp(OU,Df.init,PU,$I,()=>V.some(MU));const BU=[iu("onSpace"),iu("onEnter"),iu("onShiftEnter"),iu("onLeft"),iu("onRight"),iu("onTab"),iu("onShiftTab"),iu("onUp"),iu("onDown"),iu("onEscape"),St("stopSpaceKeyup",!1),kr("focusIn")],LU=(o,c,m)=>[cr(rr(Ru),m.onSpace),cr(hm([Lb,rr(hp)]),m.onEnter),cr(hm([gy,rr(hp)]),m.onShiftEnter),cr(hm([gy,rr(dp)]),m.onShiftTab),cr(hm([Lb,rr(dp)]),m.onTab),cr(rr(my),m.onUp),cr(rr(Bb),m.onDown),cr(rr(KC),m.onLeft),cr(rr(YC),m.onRight),cr(rr(Ru),m.onSpace)],zI=(o,c,m)=>[...m.stopSpaceKeyup?[cr(rr(Ru),te)]:[],cr(rr(r1),m.onEscape)];var FU=mp(BU,Df.init,LU,zI,o=>o.focusIn);const HU=k.schema(),VI=D.schema(),$U=hM.schema(),zU=uM.schema(),j3=LI.schema(),VU=wt.schema(),UI=IU.schema(),Hd=FU.schema();var UU=Object.freeze({__proto__:null,acyclic:HU,cyclic:VI,flow:$U,flatgrid:zU,matrix:j3,execution:VU,menu:UI,special:Hd});const WI=o=>Ii(o,"setGridSize"),Po=K2({branchKey:"mode",branches:UU,name:"keying",active:{events:(o,c)=>o.handler.toEvents(o,c)},apis:{focusIn:(o,c,m)=>{c.sendFocusIn(c).fold(()=>{o.getSystem().triggerFocus(o.element,o.element)},b=>{b(o,c,m)})},setGridSize:(o,c,m,b,_)=>{WI(m)?m.setGridSize(b,_):console.error("Layout does not support setGridSize")}},state:Vn}),jI=(o,c)=>{Md(()=>{Rf(o,c,()=>We(c,o.getSystem().build))},o.element)},gM=(o,c)=>{Md(()=>{Mu(o,c,()=>Xf(o.element,c,o.getSystem().buildOrPatch))},o.element)},WU=(o,c,m,b)=>{m0(c);const _=Mv(o.element,m,b,o.getSystem().buildOrPatch);Pd(o,_),o.syncComponents()},Z3=(o,c,m)=>{const b=o.getSystem().build(m);Id(o,b,c)},ZI=(o,c,m,b)=>{$c(c),Z3(o,(_,x)=>Aa(_,x,m),b)},jU=(o,c,m,b)=>(c.reuseDom?gM:jI)(o,b),ZU=(o,c,m,b)=>{Z3(o,tl,b)},qU=(o,c,m,b)=>{Z3(o,Lg,b)},GU=(o,c,m,b)=>{const _=ex(o);Ct(_,M=>Cr(b.element,M.element)).each($c)},ex=(o,c)=>o.components(),pM=(o,c,m,b,_)=>{const x=ex(o);return V.from(x[b]).map(M=>(_.fold(()=>$c(M),I=>{(c.reuseDom?WU:ZI)(o,M,b,I)}),M))};var qI=Object.freeze({__proto__:null,append:ZU,prepend:qU,remove:GU,replaceAt:pM,replaceBy:(o,c,m,b,_)=>{const x=ex(o);return Jt(x,b).bind(M=>pM(o,c,m,M,_))},set:jU,contents:ex});const ms=Xl({fields:[ja("reuseDom",!0)],name:"replacing",apis:qI}),bM=(o,c)=>{const m=ri(c);return Xl({fields:[Qt("enabled")],name:o,active:{events:J(m)}})},ks=(o,c)=>{const m=bM(o,c);return{key:o,value:{config:{},me:m,configAsRaw:J({}),initialConfig:{},state:Df}}},GI=(o,c)=>{c.ignore||(sf(o.element),c.onFocus(o))};var KI=Object.freeze({__proto__:null,focus:GI,blur:(o,c)=>{c.ignore||$v(o.element)},isFocused:o=>Qp(o.element)}),KU=Object.freeze({__proto__:null,exhibit:(o,c)=>{const m=c.ignore?{}:{attributes:{tabindex:"-1"}};return Lc(m)},events:o=>ri([en(Ed(),(c,m)=>{GI(c,o),m.stop()})].concat(o.stopMousedown?[en(Br(),(c,m)=>{m.event.prevent()})]:[]))}),py=[Gs("onFocus"),St("stopMousedown",!1),St("ignore",!1)];const Qo=Xl({fields:py,name:"focusing",active:KU,apis:KI}),JI=o=>({init:()=>{const m=Ho(o);return{get:()=>m.get(),set:I=>m.set(I),clear:()=>m.set(o),readState:()=>m.get()}}}),YU=(o,c,m)=>{const b=c.aria;b.update(o,b,m.get())},XU=(o,c,m)=>{c.toggleClass.each(b=>{m.get()?Ra(o.element,b):ma(o.element,b)})},$b=(o,c,m,b)=>{const _=m.get();m.set(b),XU(o,c,m),YU(o,c,m),_!==b&&c.onToggled(o,b)},oS=(o,c,m)=>{$b(o,c,m,!m.get())},QI=(o,c,m)=>{$b(o,c,m,!0)},eB=(o,c,m)=>{$b(o,c,m,!1)},by=(o,c,m)=>m.get(),zb=(o,c,m)=>{$b(o,c,m,c.selected)};var JU=Object.freeze({__proto__:null,onLoad:zb,toggle:oS,isOn:by,on:QI,off:eB,set:$b}),Vb=Object.freeze({__proto__:null,exhibit:()=>Lc({}),events:(o,c)=>{const m=Z2(o,c,oS),b=q2(o,c,zb);return ri(Et([o.toggleOnExecute?[m]:[],[b]]))}});const vM=(o,c,m)=>{Kn(o.element,"aria-pressed",m),c.syncWithExpanded&&yM(o,c,m)},tB=(o,c,m)=>{Kn(o.element,"aria-selected",m)},nB=(o,c,m)=>{Kn(o.element,"aria-checked",m)},yM=(o,c,m)=>{Kn(o.element,"aria-expanded",m)};var wM=[St("selected",!1),kr("toggleClass"),St("toggleOnExecute",!0),Gs("onToggled"),_c("aria",{mode:"none"},Cl("mode",{pressed:[St("syncWithExpanded",!1),Vi("update",vM)],checked:[Vi("update",nB)],expanded:[Vi("update",yM)],selected:[Vi("update",tB)],none:[Vi("update",F)]}))];const Ms=Xl({fields:wM,name:"toggling",active:Vb,apis:JU,state:JI(!1)}),oB=()=>{const o=(c,m)=>{m.stop(),lh(c)};return[en(Kh(),o),en(Z1(),o),Jh(eu()),Jh(Br())]},q3=o=>{const c=m=>ou((b,_)=>{m(b),_.stop()});return ri(Et([o.map(c).toArray(),oB()]))},sB="alloy.item-hover",tx="alloy.item-focus",G3="alloy.item-toggled",K3=o=>{(nl(o.element).isNone()||Qo.isFocused(o))&&(Qo.isFocused(o)||Qo.focus(o),Ao(o,sB,{item:o}))},rB=o=>{Ao(o,tx,{item:o})},eW=(o,c)=>{Ao(o,G3,{item:o,state:c})},_M=J(sB),iB=J(tx),aB=J(G3),lB=o=>o.toggling.map(c=>c.exclusive?"menuitemradio":"menuitemcheckbox").getOr("menuitem"),tW=o=>({aria:{mode:"checked"},...Ls(o,(c,m)=>m!=="exclusive"),onToggled:(c,m)=>{z(o.onToggled)&&o.onToggled(c,m),eW(c,m)}}),CM=o=>({dom:o.dom,domModification:{...o.domModification,attributes:{role:lB(o),...o.domModification.attributes,"aria-haspopup":o.hasSubmenu,...o.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:fm.augment(o.itemBehaviours,[o.toggling.fold(Ms.revoke,c=>Ms.config(tW(c))),Qo.config({ignore:o.ignoreFocus,stopMousedown:o.ignoreFocus,onFocus:c=>{rB(c)}}),Po.config({mode:"execution"}),Yn.config({store:{mode:"memory",initialValue:o.data}}),ks("item-type-events",[...oB(),en(Sl(),K3),en(nb(),Qo.focus)])]),components:o.components,eventOrder:o.eventOrder}),nW=[Qt("data"),Qt("components"),Qt("dom"),St("hasSubmenu",!1),kr("toggling"),fm.field("itemBehaviours",[Ms,Qo,Po,Yn]),St("ignoreFocus",!1),St("domModification",{}),Vi("builder",CM),St("eventOrder",{})],oW=o=>({dom:o.dom,components:o.components,events:ri([Td(nb())])}),sW=[Qt("dom"),Qt("components"),Vi("builder",oW)],SM=J("item-widget"),Y3=J([zc({name:"widget",overrides:o=>({behaviours:An([Yn.config({store:{mode:"manual",getValue:c=>o.data,setValue:F}})])})})]),rW=o=>{const c=VC(SM(),o,Y3()),m=$E(SM(),o,c.internals()),b=x=>Ai(x,o,"widget").map(M=>(Po.focusIn(M),M)),_=(x,M)=>fp(M.event.target)?V.none():(()=>(o.autofocus&&M.setSource(x.element),V.none()))();return{dom:o.dom,components:m,domModification:o.domModification,events:ri([ou((x,M)=>{b(x).each(I=>{M.stop()})}),en(Sl(),K3),en(nb(),(x,M)=>{o.autofocus?b(x):Qo.focus(x)})]),behaviours:fm.augment(o.widgetBehaviours,[Yn.config({store:{mode:"memory",initialValue:o.data}}),Qo.config({ignore:o.ignoreFocus,onFocus:x=>{rB(x)}}),Po.config({mode:"special",focusIn:o.autofocus?x=>{b(x)}:to(),onLeft:_,onRight:_,onEscape:(x,M)=>!Qo.isFocused(x)&&!o.autofocus?(Qo.focus(x),V.some(!0)):(o.autofocus&&M.setSource(x.element),V.none())})])}},iW=[Qt("uid"),Qt("data"),Qt("components"),Qt("dom"),St("autofocus",!1),St("ignoreFocus",!1),fm.field("widgetBehaviours",[Yn,Qo,Po]),St("domModification",{}),UC(Y3()),Vi("builder",rW)],cB=Cl("type",{widget:iW,item:nW,separator:sW}),nx=(o,c)=>({mode:"flatgrid",selector:"."+o.markers.item,initSize:{numColumns:c.initSize.numColumns,numRows:c.initSize.numRows},focusManager:o.focusManager}),aW=(o,c)=>({mode:"matrix",selectors:{row:c.rowSelector,cell:"."+o.markers.item},previousSelector:c.previousSelector,focusManager:o.focusManager}),ox=(o,c)=>({mode:"menu",selector:"."+o.markers.item,moveOnTab:c.moveOnTab,focusManager:o.focusManager}),kM=J([od({factory:{sketch:o=>{const c=xs("menu.spec item",cB,o);return c.builder(c)}},name:"items",unit:"item",defaults:(o,c)=>ps(c,"uid")?c:{...c,uid:fh("item")},overrides:(o,c)=>({type:c.type,ignoreFocus:o.fakeFocus,domModification:{classes:[o.markers.item]}})})]),uB=J([Qt("value"),Qt("items"),Qt("dom"),Qt("components"),St("eventOrder",{}),$l("menuBehaviours",[Nr,Yn,sr,Po]),_c("movement",{mode:"menu",moveOnTab:!0},Cl("mode",{grid:[ig(),Vi("config",nx)],matrix:[Vi("config",aW),Qt("rowSelector"),St("previousSelector",V.none)],menu:[St("moveOnTab",!0),Vi("config",ox)]})),sg(),St("fakeFocus",!1),St("focusManager",JC()),Gs("onHighlight"),Gs("onDehighlight")]),EM=J("alloy.menu-focus"),lW=(o,c)=>{const m=lu(o.element,'[role="menuitemradio"][aria-checked="true"]');xt(m,b=>{Cr(b,c.element)||o.getSystem().getByDom(b).each(_=>{Ms.off(_)})})},cW=(o,c,m,b)=>({uid:o.uid,dom:o.dom,markers:o.markers,behaviours:Ql(o.menuBehaviours,[Nr.config({highlightClass:o.markers.selectedItem,itemClass:o.markers.item,onHighlight:o.onHighlight,onDehighlight:o.onDehighlight}),Yn.config({store:{mode:"memory",initialValue:o.value}}),sr.config({find:V.some}),Po.config(o.movement.config(o,o.movement))]),events:ri([en(iB(),(_,x)=>{const M=x.event;_.getSystem().getByDom(M.target).each(I=>{Nr.highlight(_,I),x.stop(),Ao(_,EM(),{menu:_,item:I})})}),en(_M(),(_,x)=>{const M=x.event.item;Nr.highlight(_,M)}),en(aB(),(_,x)=>{const{item:M,state:I}=x.event;I&&Fi(M.element,"role")==="menuitemradio"&&lW(_,M)})]),components:c,eventOrder:o.eventOrder,domModification:{attributes:{role:"menu"}}}),vy=fu({name:"Menu",configFields:uB(),partFields:kM(),factory:cW}),uW=o=>Zr(o,(c,m)=>({k:c,v:m})),xM=(o,c,m,b)=>an(m,b).bind(_=>an(o,_).bind(x=>{const M=xM(o,c,m,x);return V.some([x].concat(M))})).getOr([]),fW=(o,c)=>{const m={};ar(o,(M,I)=>{xt(M,U=>{m[U]=I})});const b=c,_=uW(c),x=Ps(_,(M,I)=>[I].concat(xM(m,b,_,I)));return Ps(m,M=>an(x,M).getOr([M]))},dW=()=>{const o=Ho({}),c=Ho({}),m=Ho({}),b=Ui(),_=Ho({}),x=()=>{o.set({}),c.set({}),m.set({}),b.clear()},M=()=>b.get().isNone(),I=(kn,mn)=>{c.set({...c.get(),[kn]:{type:"prepared",menu:mn}})},U=(kn,mn,In,Zn)=>{b.set(kn),o.set(In),c.set(mn),_.set(Zn);const js=fW(Zn,In);m.set(js)},Y=kn=>gs(o.get(),(mn,In)=>mn===kn),se=(kn,mn,In)=>st(kn).bind(Zn=>Y(kn).bind(js=>mn(js).map(yo=>({triggeredMenu:Zn,triggeringItem:yo,triggeringPath:In})))),fe=(kn,mn)=>{const In=ho(ut(kn).toArray(),Zn=>st(Zn).isSome());return an(m.get(),kn).bind(Zn=>{const js=gn(In.concat(Zn)),yo=Pe(js,(ws,fs)=>se(ws,mn,js.slice(0,fs+1)).fold(()=>$e(b.get(),ws)?[]:[V.none()],hr=>[V.some(hr)]));return Wt(yo)})},me=kn=>an(o.get(),kn).map(mn=>{const In=an(m.get(),kn).getOr([]);return[mn].concat(In)}),Ce=kn=>an(m.get(),kn).bind(mn=>mn.length>1?V.some(mn.slice(1)):V.none()),Ne=kn=>an(m.get(),kn),st=kn=>Ht(kn).bind(AM),Ht=kn=>an(c.get(),kn),ut=kn=>an(o.get(),kn);return{setMenuBuilt:I,setContents:U,expand:me,refresh:Ne,collapse:Ce,lookupMenu:Ht,lookupItem:ut,otherMenus:kn=>{const mn=_.get();return yt(Zs(mn),kn)},getPrimary:()=>b.get().bind(st),getMenus:()=>c.get(),clear:x,isClear:M,getTriggeringPath:fe}},AM=o=>o.type==="prepared"?V.some(o.menu):V.none(),sx={init:dW,extractPreparedMenu:AM},X3=oo("tiered-menu-item-highlight"),J3=oo("tiered-menu-item-dehighlight");var sd;(function(o){o[o.HighlightMenuAndItem=0]="HighlightMenuAndItem",o[o.HighlightJustMenu=1]="HighlightJustMenu",o[o.HighlightNone=2]="HighlightNone"})(sd||(sd={}));const hW=(o,c)=>{const m=Ui(),b=(Fn,po,ls)=>Ps(ls,(Xs,zo)=>{const bs=()=>vy.sketch({...Xs,value:zo,markers:o.markers,fakeFocus:o.fakeFocus,onHighlight:(Ti,$r)=>{Ao(Ti,X3,{menuComp:Ti,itemComp:$r})},onDehighlight:(Ti,$r)=>{Ao(Ti,J3,{menuComp:Ti,itemComp:$r})},focusManager:o.fakeFocus?QC():JC()});return zo===po?{type:"prepared",menu:Fn.getSystem().build(bs())}:{type:"notbuilt",nbMenu:bs}}),_=sx.init(),x=Fn=>{const po=b(Fn,o.data.primary,o.data.menus),ls=U();return _.setContents(o.data.primary,po,o.data.expansions,ls),_.getPrimary()},M=Fn=>Yn.getValue(Fn).value,I=(Fn,po,ls)=>Js(po,Xs=>{if(!Xs.getSystem().isConnected())return V.none();const zo=Nr.getCandidates(Xs);return Ct(zo,bs=>M(bs)===ls)}),U=Fn=>Ps(o.data.menus,(po,ls)=>Pe(po.items,Xs=>Xs.type==="separator"?[]:[Xs.data.value])),Y=Nr.highlight,se=(Fn,po)=>{Y(Fn,po),Nr.getHighlighted(po).orThunk(()=>Nr.getFirst(po)).each(ls=>{o.fakeFocus?Nr.highlight(po,ls):q1(Fn,ls.element,nb())})},fe=(Fn,po)=>At(We(po,ls=>Fn.lookupMenu(ls).bind(Xs=>Xs.type==="prepared"?V.some(Xs.menu):V.none()))),me=(Fn,po,ls)=>{const Xs=fe(po,po.otherMenus(ls));xt(Xs,zo=>{Fc(zo.element,[o.markers.backgroundMenu]),o.stayInDom||ms.remove(Fn,zo)})},Ce=Fn=>m.get().getOrThunk(()=>{const po={},ls=lu(Fn.element,`.${o.markers.item}`),Xs=ho(ls,zo=>Fi(zo,"aria-haspopup")==="true");return xt(Xs,zo=>{Fn.getSystem().getByDom(zo).each(bs=>{const Ti=M(bs);po[Ti]=bs})}),m.set(po),po}),Ne=(Fn,po)=>{const ls=Ce(Fn);ar(ls,(Xs,zo)=>{const bs=ct(po,zo);Kn(Xs.element,"aria-expanded",bs)})},st=(Fn,po,ls)=>V.from(ls[0]).bind(Xs=>po.lookupMenu(Xs).bind(zo=>{if(zo.type==="notbuilt")return V.none();{const bs=zo.menu,Ti=fe(po,ls.slice(1));return xt(Ti,$r=>{Ra($r.element,o.markers.backgroundMenu)}),qs(bs.element)||ms.append(Fn,ru(bs)),Fc(bs.element,[o.markers.backgroundMenu]),se(Fn,bs),me(Fn,po,ls),V.some(bs)}}));let Ht;(function(Fn){Fn[Fn.HighlightSubmenu=0]="HighlightSubmenu",Fn[Fn.HighlightParent=1]="HighlightParent"})(Ht||(Ht={}));const ut=(Fn,po,ls)=>{if(ls.type==="notbuilt"){const Xs=Fn.getSystem().build(ls.nbMenu());return _.setMenuBuilt(po,Xs),Xs}else return ls.menu},lt=(Fn,po,ls=Ht.HighlightSubmenu)=>{if(po.hasConfigured(Ko)&&Ko.isDisabled(po))return V.some(po);{const Xs=M(po);return _.expand(Xs).bind(zo=>(Ne(Fn,zo),V.from(zo[0]).bind(bs=>_.lookupMenu(bs).bind(Ti=>{const $r=ut(Fn,bs,Ti);return qs($r.element)||ms.append(Fn,ru($r)),o.onOpenSubmenu(Fn,po,$r,gn(zo)),ls===Ht.HighlightSubmenu?(Nr.highlightFirst($r),st(Fn,_,zo)):(Nr.dehighlightAll($r),V.some(po))}))))}},Zt=(Fn,po)=>{const ls=M(po);return _.collapse(ls).bind(Xs=>(Ne(Fn,Xs),st(Fn,_,Xs).map(zo=>(o.onCollapseMenu(Fn,po,zo),zo))))},Dt=(Fn,po)=>{const ls=M(po);return _.refresh(ls).bind(Xs=>(Ne(Fn,Xs),st(Fn,_,Xs)))},kn=(Fn,po)=>fp(po.element)?V.none():lt(Fn,po,Ht.HighlightSubmenu),mn=(Fn,po)=>fp(po.element)?V.none():Zt(Fn,po),In=(Fn,po)=>Zt(Fn,po).orThunk(()=>o.onEscape(Fn,po).map(()=>Fn)),Zn=Fn=>(po,ls)=>tf(ls.getSource(),`.${o.markers.item}`).bind(Xs=>po.getSystem().getByDom(Xs).toOptional().bind(zo=>Fn(po,zo).map(ft))),js=ri([en(EM(),(Fn,po)=>{const ls=po.event.item;_.lookupItem(M(ls)).each(()=>{const Xs=po.event.menu;Nr.highlight(Fn,Xs);const zo=M(po.event.item);_.refresh(zo).each(bs=>me(Fn,_,bs))})}),ou((Fn,po)=>{const ls=po.event.target;Fn.getSystem().getByDom(ls).each(Xs=>{M(Xs).indexOf("collapse-item")===0&&Zt(Fn,Xs),lt(Fn,Xs,Ht.HighlightSubmenu).fold(()=>{o.onExecute(Fn,Xs)},F)})}),vi((Fn,po)=>{x(Fn).each(ls=>{ms.append(Fn,ru(ls)),o.onOpenMenu(Fn,ls),o.highlightOnOpen===sd.HighlightMenuAndItem?se(Fn,ls):o.highlightOnOpen===sd.HighlightJustMenu&&Y(Fn,ls)})}),en(X3,(Fn,po)=>{o.onHighlightItem(Fn,po.event.menuComp,po.event.itemComp)}),en(J3,(Fn,po)=>{o.onDehighlightItem(Fn,po.event.menuComp,po.event.itemComp)}),...o.navigateOnHover?[en(_M(),(Fn,po)=>{const ls=po.event.item;Dt(Fn,ls),lt(Fn,ls,Ht.HighlightParent),o.onHover(Fn,ls)})]:[]]),yo=Fn=>Nr.getHighlighted(Fn).bind(Nr.getHighlighted),ws=Fn=>{yo(Fn).each(po=>{Zt(Fn,po)})},fs=Fn=>{_.getPrimary().each(po=>{se(Fn,po)})},hr=Fn=>V.from(Fn.components()[0]).filter(po=>Fi(po.element,"role")==="menu"),ir={collapseMenu:ws,highlightPrimary:fs,repositionMenus:Fn=>{_.getPrimary().bind(ls=>yo(Fn).bind(Xs=>{const zo=M(Xs),bs=va(_.getMenus()),Ti=At(We(bs,sx.extractPreparedMenu));return _.getTriggeringPath(zo,$r=>I(Fn,Ti,$r))}).map(Xs=>({primary:ls,triggeringPath:Xs}))).fold(()=>{hr(Fn).each(ls=>{o.onRepositionMenu(Fn,ls,[])})},({primary:ls,triggeringPath:Xs})=>{o.onRepositionMenu(Fn,ls,Xs)})}};return{uid:o.uid,dom:o.dom,markers:o.markers,behaviours:Ql(o.tmenuBehaviours,[Po.config({mode:"special",onRight:Zn(kn),onLeft:Zn(mn),onEscape:Zn(In),focusIn:(Fn,po)=>{_.getPrimary().each(ls=>{q1(Fn,ls.element,nb())})}}),Nr.config({highlightClass:o.markers.selectedMenu,itemClass:o.markers.menu}),sr.config({find:Fn=>Nr.getHighlighted(Fn)}),ms.config({})]),eventOrder:o.eventOrder,apis:ir,events:js}},mW=J("collapse-item"),gW=(o,c,m)=>({primary:o,menus:c,expansions:m}),fB=(o,c)=>({primary:o,menus:Bn(o,c),expansions:{}}),dB=o=>({value:oo(mW()),meta:{text:o}}),Iw=Vc({name:"TieredMenu",configFields:[F2("onExecute"),F2("onEscape"),rg("onOpenMenu"),rg("onOpenSubmenu"),Gs("onRepositionMenu"),Gs("onCollapseMenu"),St("highlightOnOpen",sd.HighlightMenuAndItem),Gf("data",[Qt("primary"),Qt("menus"),Qt("expansions")]),St("fakeFocus",!1),Gs("onHighlightItem"),Gs("onDehighlightItem"),Gs("onHover"),Iv(),Qt("dom"),St("navigateOnHover",!0),St("stayInDom",!1),$l("tmenuBehaviours",[Po,Nr,sr,ms]),St("eventOrder",{})],apis:{collapseMenu:(o,c)=>{o.collapseMenu(c)},highlightPrimary:(o,c)=>{o.highlightPrimary(c)},repositionMenus:(o,c)=>{o.repositionMenus(c)}},factory:hW,extraApis:{tieredData:gW,singleData:fB,collapseItem:dB}}),pW=(o,c,m,b,_)=>{const x=()=>o.lazySink(c),M=b.type==="horizontal"?{layouts:{onLtr:()=>ag(),onRtl:()=>fc()}}:{},I=Y=>Y.length===2,U=Y=>I(Y)?M:{};return Iw.sketch({dom:{tag:"div"},data:b.data,markers:b.menu.markers,highlightOnOpen:b.menu.highlightOnOpen,fakeFocus:b.menu.fakeFocus,onEscape:()=>(Ks.close(c),o.onEscape.map(Y=>Y(c)),V.some(!0)),onExecute:()=>V.some(!0),onOpenMenu:(Y,se)=>{uu.positionWithinBounds(x().getOrDie(),se,m,_())},onOpenSubmenu:(Y,se,fe,me)=>{const Ce=x().getOrDie();uu.position(Ce,fe,{anchor:{type:"submenu",item:se,...U(me)}})},onRepositionMenu:(Y,se,fe)=>{const me=x().getOrDie();uu.positionWithinBounds(me,se,m,_()),xt(fe,Ce=>{const Ne=U(Ce.triggeringPath);uu.position(me,Ce.triggeredMenu,{anchor:{type:"submenu",item:Ce.triggeringItem,...Ne}})})}})},bW=(o,c)=>{const m=(me,Ce)=>o.getRelated(me).exists(st=>Gp(st,Ce)),b=(me,Ce)=>{Ks.setContent(me,Ce)},_=(me,Ce,Ne)=>{const st=V.none;x(me,Ce,Ne,st)},x=(me,Ce,Ne,st)=>{const Ht=o.lazySink(me).getOrDie();Ks.openWhileCloaked(me,Ce,()=>uu.positionWithinBounds(Ht,me,Ne,st())),Yn.setValue(me,V.some({mode:"position",config:Ne,getBounds:st}))},M=(me,Ce,Ne)=>{I(me,Ce,Ne,V.none)},I=(me,Ce,Ne,st)=>{const Ht=pW(o,me,Ce,Ne,st);Ks.open(me,Ht),Yn.setValue(me,V.some({mode:"menu",menu:Ht}))},U=me=>{Ks.isOpen(me)&&(Yn.setValue(me,V.none()),Ks.close(me))},Y=me=>Ks.getState(me),se=me=>{Ks.isOpen(me)&&Yn.getValue(me).each(Ce=>{switch(Ce.mode){case"menu":Ks.getState(me).each(Iw.repositionMenus);break;case"position":const Ne=o.lazySink(me).getOrDie();uu.positionWithinBounds(Ne,me,Ce.config,Ce.getBounds());break}})},fe={setContent:b,showAt:_,showWithinBounds:x,showMenuAt:M,showMenuWithinBounds:I,hide:U,getContent:Y,reposition:se,isOpen:Ks.isOpen};return{uid:o.uid,dom:o.dom,behaviours:Ql(o.inlineBehaviours,[Ks.config({isPartOf:(me,Ce,Ne)=>Gp(Ce,Ne)||m(me,Ne),getAttachPoint:me=>o.lazySink(me).getOrDie(),onOpen:me=>{o.onShow(me)},onClose:me=>{o.onHide(me)}}),Yn.config({store:{mode:"memory",initialValue:V.none()}}),Cc.config({channels:{...ay({isExtraPart:c.isExtraPart,...o.fireDismissalEventInstead.map(me=>({fireEventInstead:{event:me.event}})).getOr({})}),...xE({...o.fireRepositionEventInstead.map(me=>({fireEventInstead:{event:me.event}})).getOr({}),doReposition:se})}})]),eventOrder:o.eventOrder,apis:fe}},Pa=Vc({name:"InlineView",configFields:[Qt("lazySink"),Gs("onShow"),Gs("onHide"),zm("onEscape"),$l("inlineBehaviours",[Ks,Yn,Cc]),Wa("fireDismissalEventInstead",[St("event",Xm())]),Wa("fireRepositionEventInstead",[St("event",ob())]),St("getRelated",V.none),St("isExtraPart",Qe),St("eventOrder",V.none)],factory:bW,apis:{showAt:(o,c,m,b)=>{o.showAt(c,m,b)},showWithinBounds:(o,c,m,b,_)=>{o.showWithinBounds(c,m,b,_)},showMenuAt:(o,c,m,b)=>{o.showMenuAt(c,m,b)},showMenuWithinBounds:(o,c,m,b,_)=>{o.showMenuWithinBounds(c,m,b,_)},hide:(o,c)=>{o.hide(c)},isOpen:(o,c)=>o.isOpen(c),getContent:(o,c)=>o.getContent(c),setContent:(o,c,m)=>{o.setContent(c,m)},reposition:(o,c)=>{o.reposition(c)}}});var Q3=tinymce.util.Tools.resolve("tinymce.util.Delay");const Uc=Vc({name:"Button",factory:o=>{const c=q3(o.action),m=o.dom.tag,b=x=>an(o.dom,"attributes").bind(M=>an(M,x)),_=()=>{if(m==="button"){const x=b("type").getOr("button"),M=b("role").map(I=>({role:I})).getOr({});return{type:x,...M}}else return{role:o.role.getOr(b("role").getOr("button"))}};return{uid:o.uid,dom:o.dom,components:o.components,events:c,behaviours:fm.augment(o.buttonBehaviours,[Qo.config({}),Po.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:_()},eventOrder:o.eventOrder}},configFields:[St("uid",void 0),Qt("dom"),St("components",[]),fm.field("buttonBehaviours",[Qo,Po]),kr("action"),kr("role"),St("eventOrder",{})]}),Qr=o=>{const c=WC(o)&&Ii(o,"uid")?o.uid:fh("memento");return{get:x=>x.getSystem().getByUid(c).getOrDie(),getOpt:x=>x.getSystem().getByUid(c).toOptional(),asSpec:()=>({...o,uid:c})}};var gm=tinymce.util.Tools.resolve("tinymce.util.I18n");const vW={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},hB="temporary-placeholder",TM=o=>()=>an(o,hB).getOr("!not found!"),Ub=(o,c)=>{const m=o.toLowerCase();if(gm.isRtl()){const b=Ir(m,"-rtl");return ps(c,b)?b:m}else return m},mB=(o,c)=>an(c,Ub(o,c)),gB=(o,c)=>{const m=c();return mB(o,m).getOrThunk(TM(m))},Bw=(o,c,m)=>{const b=c();return mB(o,b).or(m).getOrThunk(TM(b))},pB=o=>gm.isRtl()?ps(vW,o):!1,DM=()=>ks("add-focusable",[vi(o=>{Pv(o.element,"svg").each(c=>Kn(c,"focusable","false"))})]),Wb=(o,c,m,b)=>{var _,x;const M=pB(c)?["tox-icon--flip"]:[],I=an(m,Ub(c,m)).or(b).getOrThunk(TM(m));return{dom:{tag:o.tag,attributes:(_=o.attributes)!==null&&_!==void 0?_:{},classes:o.classes.concat(M),innerHtml:I},behaviours:An([...(x=o.behaviours)!==null&&x!==void 0?x:[],DM()])}},gp=(o,c,m,b=V.none())=>Wb(c,o,m(),b),yW=(o,c,m)=>{const b=m(),_=Ct(o,x=>ps(b,Ub(x,b)));return Wb(c,_.getOr(hB),b,V.none())},gg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},eT=Vc({name:"Notification",factory:o=>{const c=Qr({dom:{tag:"p",innerHtml:o.translationProvider(o.text)},behaviours:An([ms.config({})])}),m=Ce=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${Ce}%`}}}),b=Ce=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${Ce}%`}}),_=Qr({dom:{tag:"div",classes:o.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[m(0)]},b(0)],behaviours:An([ms.config({})])}),I={updateProgress:(Ce,Ne)=>{Ce.getSystem().isConnected()&&_.getOpt(Ce).each(st=>{ms.set(st,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[m(Ne)]},b(Ne)])})},updateText:(Ce,Ne)=>{if(Ce.getSystem().isConnected()){const st=c.get(Ce);ms.set(st,[Ri(Ne)])}}},U=Et([o.icon.toArray(),o.level.toArray(),o.level.bind(Ce=>V.from(gg[Ce])).toArray()]),Y=Qr(Uc.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[gp("close",{tag:"span",classes:["tox-icon"],attributes:{"aria-label":o.translationProvider("Close")}},o.iconProvider)],action:Ce=>{o.onAction(Ce)}})),se=yW(U,{tag:"div",classes:["tox-notification__icon"]},o.iconProvider),fe={dom:{tag:"div",classes:["tox-notification__body"]},components:[c.asSpec()],behaviours:An([ms.config({})])},me=[se,fe];return{uid:o.uid,dom:{tag:"div",attributes:{role:"alert"},classes:o.level.map(Ce=>["tox-notification","tox-notification--in",`tox-notification--${Ce}`]).getOr(["tox-notification","tox-notification--in"])},behaviours:An([Qo.config({}),ks("notification-events",[en(Gi(),Ce=>{Y.getOpt(Ce).each(Qo.focus)})])]),components:me.concat(o.progress?[_.asSpec()]:[]).concat(o.closeButton?[Y.asSpec()]:[]),apis:I}},configFields:[kr("level"),Qt("progress"),kr("icon"),Qt("onAction"),Qt("text"),Qt("iconProvider"),Qt("translationProvider"),ja("closeButton",!0)],apis:{updateProgress:(o,c,m)=>{o.updateProgress(c,m)},updateText:(o,c,m)=>{o.updateText(c,m)}}});var bB=(o,c,m)=>{const b=c.backstage.shared,_=()=>{const U=li(it.fromDom(o.getContentAreaContainer())),Y=le(),se=Qf(Y.x,U.x,U.right),fe=Qf(Y.y,U.y,U.bottom),me=Math.max(U.right,Y.right),Ce=Math.max(U.bottom,Y.bottom);return V.some(si(se,fe,me-se,Ce-fe))};return{open:(U,Y)=>{const se=()=>{Y(),Pa.hide(me)},fe=uc(eT.sketch({text:U.text,level:ct(["success","error","warning","warn","info"],U.type)?U.type:void 0,progress:U.progressBar===!0,icon:U.icon,closeButton:U.closeButton,onAction:se,iconProvider:b.providers.icons,translationProvider:b.providers.translate})),me=uc(Pa.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:b.getSink,fireDismissalEventInstead:{},...b.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}}));m.add(me),q(U.timeout)&&U.timeout>0&&Q3.setEditorTimeout(o,()=>{se()},U.timeout);const Ne={close:se,reposition:()=>{const st=ru(fe),Ht={maxHeightFunction:cg()},ut=o.notificationManager.getNotifications();if(ut[0]===Ne){const lt={...b.anchors.banner(),overrides:Ht};Pa.showWithinBounds(me,st,{anchor:lt},_)}else He(ut,Ne).each(lt=>{const Zt=ut[lt-1].getEl(),Dt={type:"node",root:Li(),node:V.some(it.fromDom(Zt)),overrides:Ht,layouts:{onRtl:()=>[Hl],onLtr:()=>[Hl]}};Pa.showWithinBounds(me,st,{anchor:Dt},_)})},text:st=>{eT.updateText(fe,st)},settings:U,getEl:()=>fe.element.dom,progressBar:{value:st=>{eT.updateProgress(fe,st)}}};return Ne},close:U=>{U.close()},getArgs:U=>U.settings}},rx=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),OM=tinymce.util.Tools.resolve("tinymce.EditorManager"),sS=tinymce.util.Tools.resolve("tinymce.Env"),pg;(function(o){o.default="wrap",o.floating="floating",o.sliding="sliding",o.scrolling="scrolling"})(pg||(pg={}));var ix;(function(o){o.auto="auto",o.top="top",o.bottom="bottom"})(ix||(ix={}));const _i=o=>c=>c.options.get(o),Lw=o=>c=>V.from(o(c)),MM=o=>{const c=sS.deviceType.isPhone(),m=sS.deviceType.isTablet()||c,b=o.options.register,_=M=>h(M)||M===!1,x=M=>h(M)||q(M);b("skin",{processor:M=>h(M)||M===!1,default:"oxide"}),b("skin_url",{processor:"string"}),b("height",{processor:x,default:Math.max(o.getElement().offsetHeight,400)}),b("width",{processor:x,default:rx.DOM.getStyle(o.getElement(),"width")}),b("min_height",{processor:"number",default:100}),b("min_width",{processor:"number"}),b("max_height",{processor:"number"}),b("max_width",{processor:"number"}),b("style_formats",{processor:"object[]"}),b("style_formats_merge",{processor:"boolean",default:!1}),b("style_formats_autohide",{processor:"boolean",default:!1}),b("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),b("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),b("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),b("font_size_input_default_unit",{processor:"string",default:"pt"}),b("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),b("content_langs",{processor:"object[]"}),b("removed_menuitems",{processor:"string",default:""}),b("menubar",{processor:M=>h(M)||O(M),default:!c}),b("menu",{processor:"object",default:{}}),b("toolbar",{processor:M=>O(M)||h(M)||C(M)?{value:M,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),kt(9,M=>{b("toolbar"+(M+1),{processor:"string"})}),b("toolbar_mode",{processor:"string",default:m?"scrolling":"floating"}),b("toolbar_groups",{processor:"object",default:{}}),b("toolbar_location",{processor:"string",default:ix.auto}),b("toolbar_persist",{processor:"boolean",default:!1}),b("toolbar_sticky",{processor:"boolean",default:o.inline}),b("toolbar_sticky_offset",{processor:"number",default:0}),b("fixed_toolbar_container",{processor:"string",default:""}),b("fixed_toolbar_container_target",{processor:"object"}),b("ui_mode",{processor:"string",default:"combined"}),b("file_picker_callback",{processor:"function"}),b("file_picker_validator_handler",{processor:"function"}),b("file_picker_types",{processor:"string"}),b("typeahead_urls",{processor:"boolean",default:!0}),b("anchor_top",{processor:_,default:"#top"}),b("anchor_bottom",{processor:_,default:"#bottom"}),b("draggable_modal",{processor:"boolean",default:!1}),b("statusbar",{processor:"boolean",default:!0}),b("elementpath",{processor:"boolean",default:!0}),b("branding",{processor:"boolean",default:!0}),b("promotion",{processor:"boolean",default:!0}),b("resize",{processor:M=>M==="both"||O(M),default:!sS.deviceType.isTouch()}),b("sidebar_show",{processor:"string"}),b("help_accessibility",{processor:"boolean",default:o.hasPlugin("help")})},RM=_i("readonly"),tT=_i("height"),NM=_i("width"),ax=Lw(_i("min_width")),PM=Lw(_i("min_height")),rS=Lw(_i("max_width")),IM=Lw(_i("max_height")),iS=Lw(_i("style_formats")),lx=_i("style_formats_merge"),BM=_i("style_formats_autohide"),LM=_i("content_langs"),vB=_i("removed_menuitems"),aS=_i("toolbar_mode"),yB=_i("toolbar_groups"),FM=_i("toolbar_location"),HM=_i("fixed_toolbar_container"),wB=_i("fixed_toolbar_container_target"),$M=_i("toolbar_persist"),nT=_i("toolbar_sticky_offset"),_B=_i("menubar"),cx=_i("toolbar"),CB=_i("file_picker_callback"),SB=_i("file_picker_validator_handler"),kB=_i("font_size_input_default_unit"),zM=_i("file_picker_types"),EB=_i("typeahead_urls"),xB=_i("anchor_top"),oT=_i("anchor_bottom"),VM=_i("draggable_modal"),UM=_i("statusbar"),AB=_i("elementpath"),ux=_i("branding"),TB=_i("resize"),DB=_i("paste_as_text"),OB=_i("sidebar_show"),MB=_i("promotion"),RB=_i("help_accessibility"),sT=o=>o.options.get("skin")===!1,lS=o=>o.options.get("menubar")!==!1,NB=o=>{const c=o.options.get("skin_url");if(sT(o))return c;if(c)return o.documentBaseURI.toAbsolute(c);{const m=o.options.get("skin");return OM.baseURL+"/skins/ui/"+m}},fx=o=>o.options.get("line_height_formats").split(" "),rT=o=>{const c=cx(o),m=h(c),b=C(c)&&c.length>0;return!dx(o)&&(b||m||c===!0)},WM=o=>{const c=kt(9,b=>o.options.get("toolbar"+(b+1))),m=ho(c,h);return cn(m.length>0,m)},dx=o=>WM(o).fold(()=>{const c=cx(o);return ee(c,h)&&c.length>0},ft),jM=o=>FM(o)===ix.bottom,PB=o=>{var c;if(!o.inline)return V.none();const m=(c=HM(o))!==null&&c!==void 0?c:"";if(m.length>0)return ta(Li(),m);const b=wB(o);return j(b)?V.some(it.fromDom(b)):V.none()},cS=o=>o.inline&&PB(o).isSome(),iT=o=>PB(o).getOrThunk(()=>vn(Pt(it.fromDom(o.getElement())))),ZM=o=>o.inline&&!lS(o)&&!rT(o)&&!dx(o),hx=o=>(o.options.get("toolbar_sticky")||o.inline)&&!cS(o)&&!ZM(o),y0=o=>!cS(o)&&o.options.get("ui_mode")==="split",yy=o=>{const c=o.options.get("menu");return Ps(c,m=>({...m,items:m.items}))};var _W=Object.freeze({__proto__:null,get ToolbarMode(){return pg},get ToolbarLocation(){return ix},register:MM,getSkinUrl:NB,isReadOnly:RM,isSkinDisabled:sT,getHeightOption:tT,getWidthOption:NM,getMinWidthOption:ax,getMinHeightOption:PM,getMaxWidthOption:rS,getMaxHeightOption:IM,getUserStyleFormats:iS,shouldMergeStyleFormats:lx,shouldAutoHideStyleFormats:BM,getLineHeightFormats:fx,getContentLanguages:LM,getRemovedMenuItems:vB,isMenubarEnabled:lS,isMultipleToolbars:dx,isToolbarEnabled:rT,isToolbarPersist:$M,getMultipleToolbarsOption:WM,getUiContainer:iT,useFixedContainer:cS,isSplitUiMode:y0,getToolbarMode:aS,isDraggableModal:VM,isDistractionFree:ZM,isStickyToolbar:hx,getStickyToolbarOffset:nT,getToolbarLocation:FM,isToolbarLocationBottom:jM,getToolbarGroups:yB,getMenus:yy,getMenubar:_B,getToolbar:cx,getFilePickerCallback:CB,getFilePickerTypes:zM,useTypeaheadUrls:EB,getAnchorTop:xB,getAnchorBottom:oT,getFilePickerValidatorHandler:SB,getFontSizeInputDefaultUnit:kB,useStatusBar:UM,useElementPath:AB,promotionEnabled:MB,useBranding:ux,getResize:TB,getPasteAsText:DB,getSidebarShow:OB,useHelpAccessibility:RB});const IB="[data-mce-autocompleter]",aT=o=>tf(o,IB),CW=o=>ta(o,IB),kW={setup:(o,c)=>{const m=(_,x)=>{Ao(_,xf(),{raw:x})},b=()=>o.getMenu().bind(Nr.getHighlighted);c.on("keydown",_=>{const x=_.which;!o.isActive()||(o.isMenuOpen()?x===13?(b().each(lh),_.preventDefault()):x===40?(b().fold(()=>{o.getMenu().each(Nr.highlightFirst)},M=>{m(M,_)}),_.preventDefault(),_.stopImmediatePropagation()):(x===37||x===38||x===39)&&b().each(M=>{m(M,_),_.preventDefault(),_.stopImmediatePropagation()}):(x===13||x===38||x===40)&&o.cancelIfNecessary())}),c.on("NodeChange",_=>{o.isActive()&&!o.isProcessingAction()&&aT(it.fromDom(_.element)).isNone()&&o.cancelIfNecessary()})}};var lT;(function(o){o[o.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",o[o.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"})(lT||(lT={}));var pp=lT;const mx="tox-menu-nav__js",cT="tox-collection__item",uT="tox-swatch",EW={normal:mx,color:uT},uS="tox-collection__item--enabled",xW="tox-collection__group-heading",BB="tox-collection__item-icon",gx="tox-collection__item-label",qM="tox-collection__item-accessory",LB="tox-collection__item-caret",FB="tox-collection__item-checkmark",px="tox-collection__item--active",HB="tox-collection__item-container",GM="tox-collection__item-container--column",$B="tox-collection__item-container--row",AW="tox-collection__item-container--align-right",TW="tox-collection__item-container--align-left",DW="tox-collection__item-container--valign-top",OW="tox-collection__item-container--valign-middle",MW="tox-collection__item-container--valign-bottom",zB=o=>an(EW,o).getOr(mx),RW=o=>o==="color"?"tox-swatches":"tox-menu",KM=o=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:RW(o),tieredMenu:"tox-tiered-menu"}),Fw=o=>{const c=KM(o);return{backgroundMenu:c.backgroundMenu,selectedMenu:c.selectedMenu,menu:c.menu,selectedItem:c.selectedItem,item:zB(o)}},NW=(o,c,m)=>{const b=KM(m);return{tag:"div",classes:Et([[b.menu,`tox-menu-${c}-column`],o?[b.hasIcons]:[]])}},PW=[vy.parts.items({})],fS=(o,c,m)=>{const b=KM(m);return{dom:{tag:"div",classes:Et([[b.tieredMenu]])},markers:Fw(m)}},VB=J([kr("data"),St("inputAttributes",{}),St("inputStyles",{}),St("tag","input"),St("inputClasses",[]),Gs("onSetValue"),St("styles",{}),St("eventOrder",{}),$l("inputBehaviours",[Yn,Qo]),St("selectOnFocus",!0)]),UB=o=>An([Qo.config({onFocus:o.selectOnFocus?c=>{const m=c.element,b=Na(m);m.dom.setSelectionRange(0,b.length)}:F})]),IW=o=>({...UB(o),...Ql(o.inputBehaviours,[Yn.config({store:{mode:"manual",...o.data.map(c=>({initialValue:c})).getOr({}),getValue:c=>Na(c.element),setValue:(c,m)=>{Na(c.element)!==m&&Sa(c.element,m)}},onSetValue:o.onSetValue})])}),YM=o=>({tag:o.tag,attributes:{type:"text",...o.inputAttributes},styles:o.inputStyles,classes:o.inputClasses}),BW=(o,c)=>({uid:o.uid,dom:YM(o),components:[],behaviours:IW(o),eventOrder:o.eventOrder}),Hw=Vc({name:"Input",configFields:VB(),factory:BW}),WB=oo("refetch-trigger-event"),jB=oo("redirect-menu-item-interaction"),ZB="tox-menu__searcher",fT=o=>ta(o.element,`.${ZB}`).bind(c=>o.getSystem().getByDom(c).toOptional()),dT=fT,LW=(o,c)=>{Yn.setValue(o,c.fetchPattern),o.element.dom.selectionStart=c.selectionStart,o.element.dom.selectionEnd=c.selectionEnd},qB=o=>{const c=Yn.getValue(o),m=o.element.dom.selectionStart,b=o.element.dom.selectionEnd;return{fetchPattern:c,selectionStart:m,selectionEnd:b}},FW=(o,c)=>{de(c.element,"id").each(m=>Kn(o.element,"aria-activedescendant",m))},HW=o=>{const c=(_,x)=>(x.cut(),V.none()),m=(_,x)=>{const M={interactionEvent:x.event,eventType:x.event.raw.type};return Ao(_,jB,M),V.some(!0)},b="searcher-events";return{dom:{tag:"div",classes:[cT]},components:[Hw.sketch({inputClasses:[ZB,"tox-textfield"],inputAttributes:{...o.placeholder.map(_=>({placeholder:o.i18n(_)})).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:An([ks(b,[en(Gh(),_=>{nr(_,WB)}),en(xf(),(_,x)=>{x.event.raw.key==="Escape"&&x.stop()})]),Po.config({mode:"special",onLeft:c,onRight:c,onSpace:c,onEnter:m,onEscape:m,onUp:m,onDown:m})]),eventOrder:{keydown:[b,Po.name()]}})]}},hT="tox-collection--results__js",GB=o=>{var c;return o.dom?{...o,dom:{...o.dom,attributes:{...(c=o.dom.attributes)!==null&&c!==void 0?c:{},id:oo("aria-item-search-result-id"),"aria-selected":"false"}}}:o},XM=(o,c)=>m=>{const b=xn(m,c);return We(b,_=>({dom:o,components:_}))},$W=o=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[vy.parts.items({preprocess:o!=="auto"?XM({tag:"div",classes:["tox-swatches__row"]},o):we})]}]}),zW=o=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[vy.parts.items({preprocess:XM({tag:"div",classes:["tox-collection__group"]},o)})]}),KB=(o,c)=>{const m=[];let b=[];return xt(o,(_,x)=>{c(_,x)?(b.length>0&&m.push(b),b=[],(ps(_.dom,"innerHtml")||_.components&&_.components.length>0)&&b.push(_)):b.push(_)}),b.length>0&&m.push(b),We(m,_=>({dom:{tag:"div",classes:["tox-collection__group"]},components:_}))},JM=(o,c,m)=>vy.parts.items({preprocess:b=>{const _=We(b,m);return o!=="auto"&&o>1?XM({tag:"div",classes:["tox-collection__group"]},o)(_):KB(_,(x,M)=>c[M].type==="separator")}}),YB=(o,c,m=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(o===1?["tox-collection--list"]:["tox-collection--grid"])},components:[JM(o,c,we)]}),mT=(o,c,m=!0)=>{const b=oo("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",hT].concat(o===1?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:b}},components:[JM(o,c,GB)]}},VW=(o,c,m)=>{const b=oo("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(o===1?["tox-collection--list"]:["tox-collection--grid"])},components:[HW({i18n:gm.translate,placeholder:m.placeholder}),{dom:{tag:"div",classes:[...o===1?["tox-collection--list"]:["tox-collection--grid"],hT],attributes:{id:b}},components:[JM(o,c,GB)]}]}},QM=(o,c=!0)=>({dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[vy.parts.items({preprocess:m=>KB(m,(b,_)=>o[_].type==="separator")})]}),gT=o=>dn(o,c=>"icon"in c&&c.icon!==void 0),jb=o=>(console.error(kd(o)),console.log(o),V.none()),UW=(o,c,m,b,_)=>{const x=QM(m);return{value:o,dom:x.dom,components:x.components,items:m}},eR=(o,c,m,b,_)=>{const x=()=>_.menuType!=="searchable"?YB(b,m):_.searchMode.searchMode==="search-with-field"?VW(b,m,_.searchMode):mT(b,m);if(_.menuType==="color"){const M=$W(b);return{value:o,dom:M.dom,components:M.components,items:m}}else if(_.menuType==="normal"&&b==="auto"){const M=YB(b,m);return{value:o,dom:M.dom,components:M.components,items:m}}else if(_.menuType==="normal"||_.menuType==="searchable"){const M=x();return{value:o,dom:M.dom,components:M.components,items:m}}else if(_.menuType==="listpreview"&&b!=="auto"){const M=zW(b);return{value:o,dom:M.dom,components:M.components,items:m}}else return{value:o,dom:NW(c,b,_.menuType),components:PW,items:m}},Ol=Ca("type"),pT=Ca("name"),tR=Ca("label"),a1=Ca("text"),bT=Ca("title"),nR=Ca("icon"),$w=Ca("value"),vT=Ic("fetch"),XB=Ic("getSubmenuItems"),Eh=Ic("onAction"),oR=Ic("onItemAction"),zw=Za("onSetup",()=>F),WW=Gl("name"),wy=Gl("text"),bg=Gl("icon"),Zb=Gl("tooltip"),sR=Gl("label"),jW=Gl("shortcut"),JB=zm("select"),bx=ja("active",!1),rR=ja("borderless",!1),bp=ja("enabled",!0),dS=ja("primary",!1),yT=o=>St("columns",o),iR=St("meta",{}),wT=Za("onAction",F),_y=o=>lc("type",o),aR=o=>za("name","name",ql(()=>oo(`${o}-name`)),hl),ZW=o=>za("value","value",ql(()=>oo(`${o}-value`)),Pc()),QB=ro([Ol,wy]),qW=o=>zi("separatormenuitem",QB,o),GW=ro([_y("autocompleteitem"),bx,bp,iR,$w,wy,bg]),KW=o=>zi("Autocompleter.Separator",QB,o),e8=o=>zi("Autocompleter.Item",GW,o),hS=[bp,Zb,bg,wy,zw],YW=ro([Ol,Eh].concat(hS)),lR=o=>zi("toolbarbutton",YW,o),_T=[bx].concat(hS),vx=ro(_T.concat([Ol,Eh])),cR=o=>zi("ToggleButton",vx,o),t8=[Za("predicate",Qe),xu("scope","node",["node","editor"]),xu("position","selection",["node","selection","line"])],XW=hS.concat([_y("contextformbutton"),dS,Eh,_a("original",we)]),n8=_T.concat([_y("contextformbutton"),dS,Eh,_a("original",we)]),JW=hS.concat([_y("contextformbutton")]),QW=_T.concat([_y("contextformtogglebutton")]),o8=Cl("type",{contextformbutton:XW,contextformtogglebutton:n8}),s8=ro([_y("contextform"),Za("initValue",J("")),sR,Ll("commands",o8),Ua("launch",Cl("type",{contextformbutton:JW,contextformtogglebutton:QW}))].concat(t8)),r8=o=>zi("ContextForm",s8,o),i8=ro([_y("contexttoolbar"),Ca("items")].concat(t8)),ej=o=>zi("ContextToolbar",i8,o),tj=[Ol,Ca("src"),Gl("alt"),Jc("classes",[],hl)],a8=ro(tj),uR=[Ol,a1,WW,Jc("classes",["tox-collection__item-label"],hl)],fR=ro(uR),dR=dl(()=>Sd("type",{cardimage:a8,cardtext:fR,cardcontainer:l8})),l8=ro([Ol,lc("direction","horizontal"),lc("align","left"),lc("valign","middle"),Ll("items",dR)]),Vw=[bp,wy,jW,ZW("menuitem"),iR],nj=ro([Ol,sR,Ll("items",dR),zw,wT].concat(Vw)),hR=o=>zi("cardmenuitem",nj,o),oj=ro([Ol,bx,bg].concat(Vw)),c8=o=>zi("choicemenuitem",oj,o),mR=[Ol,Ca("fancytype"),wT],Uw=[St("initData",{})].concat(mR),sj=[zm("select"),eb("initData",{},[ja("allowCustomColors",!0),lc("storageKey","default"),W1("colors",Pc())])].concat(mR),gR=Cl("fancytype",{inserttable:Uw,colorswatch:sj}),CT=o=>zi("fancymenuitem",gR,o),rj=ro([Ol,zw,wT,bg].concat(Vw)),u8=o=>zi("menuitem",rj,o),f8=ro([Ol,XB,zw,bg].concat(Vw)),d8=o=>zi("nestedmenuitem",f8,o),pR=ro([Ol,bg,bx,zw,Eh].concat(Vw)),h8=o=>zi("togglemenuitem",pR,o),bR=(o,c,m)=>{const b=lu(o.element,"."+m);if(b.length>0){const _=Jt(b,x=>{const M=x.dom.getBoundingClientRect().top,I=b[0].dom.getBoundingClientRect().top;return Math.abs(M-I)>c}).getOr(b.length);return V.some({numColumns:_,numRows:Math.ceil(b.length/_)})}else return V.none()},vR=(o,c)=>An([ks(o,c)]),mS={namedEvents:vR,unnamedEvents:o=>vR(oo("unnamed-events"),o)},yR=oo("tooltip.exclusive"),yx=oo("tooltip.show"),gS=oo("tooltip.hide"),m8=(o,c,m)=>{o.getSystem().broadcastOn([yR],{})};var aj=Object.freeze({__proto__:null,hideAllExclusive:m8,setComponents:(o,c,m,b)=>{m.getTooltip().each(_=>{_.getSystem().isConnected()&&ms.set(_,b)})}}),g8=Object.freeze({__proto__:null,events:(o,c)=>{const m=_=>{c.getTooltip().each(x=>{$c(x),o.onHide(_,x),c.clearTooltip()}),c.clearTimer()},b=_=>{if(!c.isShowing()){m8(_);const x=o.lazySink(_).getOrDie(),M=_.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:ri(o.mode==="normal"?[en(Sl(),I=>{nr(_,yx)}),en(cc(),I=>{nr(_,gS)})]:[]),behaviours:An([ms.config({})])});c.setTooltip(M),sl(x,M),o.onShow(_,M),uu.position(x,M,{anchor:o.anchor(_)})}};return ri(Et([[en(yx,_=>{c.resetTimer(()=>{b(_)},o.delay)}),en(gS,_=>{c.resetTimer(()=>{m(_)},o.delay)}),en(Xh(),(_,x)=>{const M=x;M.universal||ct(M.channels,yR)&&m(_)}),Dd(_=>{m(_)})],o.mode==="normal"?[en(Gi(),_=>{nr(_,yx)}),en(qm(),_=>{nr(_,gS)}),en(Sl(),_=>{nr(_,yx)}),en(cc(),_=>{nr(_,gS)})]:[en(Jm(),(_,x)=>{nr(_,yx)}),en(kv(),_=>{nr(_,gS)})]]))}}),wx=[Qt("lazySink"),Qt("tooltipDom"),St("exclusive",!0),St("tooltipComponents",[]),St("delay",300),xu("mode","normal",["normal","follow-highlight"]),St("anchor",o=>({type:"hotspot",hotspot:o,layouts:{onLtr:J([Hl,Yl,ml,Du,Kl,Fr]),onRtl:J([Hl,Yl,ml,Du,Kl,Fr])}})),Gs("onHide"),Gs("onShow")],cj=Object.freeze({__proto__:null,init:()=>{const o=Ui(),c=Ui(),m=()=>{o.on(clearTimeout)},b=(x,M)=>{m(),o.set(setTimeout(x,M))},_=J("not-implemented");return su({getTooltip:c.get,isShowing:c.isSet,setTooltip:c.set,clearTooltip:c.clear,clearTimer:m,resetTimer:b,readState:_})}});const p8=Xl({fields:wx,name:"tooltipping",active:g8,state:cj,apis:aj}),uj=o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),b8="silver.readonly",fj=ro([Ug("readonly")]),Ww=(o,c)=>{const b=o.mainUi.outerContainer.element,_=[o.mainUi.mothership,...o.uiMotherships];c&&xt(_,x=>{x.broadcastOn([_h()],{target:b})}),xt(_,x=>{x.broadcastOn([b8],{readonly:c})})},v8=(o,c)=>{o.on("init",()=>{o.mode.isReadOnly()&&Ww(c,!0)}),o.on("SwitchMode",()=>Ww(c,o.mode.isReadOnly())),RM(o)&&o.mode.set("readonly")},ec=()=>Cc.config({channels:{[b8]:{schema:fj,onReceive:(o,c)=>{Ko.set(o,c.readonly)}}}}),vg={item:o=>Ko.config({disabled:o,disableClass:"tox-collection__item--state-disabled"}),button:o=>Ko.config({disabled:o}),splitButton:o=>Ko.config({disabled:o,disableClass:"tox-tbtn--disabled"}),toolbarButton:o=>Ko.config({disabled:o,disableClass:"tox-tbtn--disabled",useNative:!1})},_x=(o,c)=>{const m=o.getApi(c);return b=>{b(m)}},qb=(o,c)=>vi(m=>{_x(o,m)(_=>{const x=o.onSetup(_);z(x)&&c.set(x)})}),Gb=(o,c)=>Dd(m=>_x(o,m)(c.get())),mj=(o,c)=>ou((m,b)=>{_x(o,m)(o.onAction),!o.triggersSubmenu&&c===pp.CLOSE_ON_EXECUTE&&(m.getSystem().isConnected()&&nr(m,Ma()),b.stop())}),gj={[Yu()]:["disabling","alloy.base.behaviour","toggling","item-events"]},pS=At,bS=(o,c,m,b)=>{const _=Ho(F);return{type:"item",dom:c.dom,components:pS(c.optComponents),data:o.data,eventOrder:gj,hasSubmenu:o.triggersSubmenu,itemBehaviours:An([ks("item-events",[mj(o,m),qb(o,_),Gb(o,_)]),vg.item(()=>!o.enabled||b.isDisabled()),ec(),ms.config({})].concat(o.itemBehaviours))}},jw=o=>({value:o.value,meta:{text:o.text.getOr(""),...o.meta}}),wR=o=>{const c=sS.os.isMacOS()||sS.os.isiOS(),_=c?{alt:"\u2325",ctrl:"\u2303",shift:"\u21E7",meta:"\u2318",access:"\u2303\u2325"}:{meta:"Ctrl",access:"Shift+Alt"},x=o.split("+"),M=We(x,I=>{const U=I.toLowerCase().trim();return ps(_,U)?_[U]:I});return c?M.join(""):M.join("+")},_R=(o,c,m=[BB])=>gp(o,{tag:"div",classes:m},c),y8=o=>({dom:{tag:"div",classes:[gx]},components:[Ri(gm.translate(o))]}),w8=(o,c)=>({dom:{tag:"div",classes:c,innerHtml:o}}),pj=(o,c)=>({dom:{tag:"div",classes:[gx]},components:[{dom:{tag:o.tag,styles:o.styles},components:[Ri(gm.translate(c))]}]}),bj=o=>({dom:{tag:"div",classes:[qM]},components:[Ri(wR(o))]}),CR=o=>_R("checkmark",o,[FB]),vj=o=>_R("chevron-right",o,[LB]),yj=o=>_R("chevron-down",o,[LB]),SR=(o,c)=>{const m=o.direction==="vertical"?GM:$B,b=o.align==="left"?TW:AW;return{dom:{tag:"div",classes:[HB,m,b,(()=>{switch(o.valign){case"top":return DW;case"middle":return OW;case"bottom":return MW}})()]},components:c}},_8=(o,c,m)=>({dom:{tag:"img",classes:c,attributes:{src:o,alt:m.getOr("")}}}),wj=(o,c,m)=>{const b="custom",_="remove",x=o.ariaLabel,M=o.value,I=o.iconContent.map(Y=>Bw(Y,c.icons,m));return{dom:(()=>{const Y=uT,se=I.getOr(""),me={tag:"div",attributes:x.map(Ce=>({title:c.translate(Ce)})).getOr({}),classes:[Y]};return M===b?{...me,tag:"button",classes:[...me.classes,"tox-swatches__picker-btn"],innerHtml:se}:M===_?{...me,classes:[...me.classes,"tox-swatch--remove"],innerHtml:se}:j(M)?{...me,attributes:{...me.attributes,"data-mce-color":M},styles:{"background-color":M},innerHtml:se}:me})(),optComponents:[]}},C8=o=>{const c=o.map(m=>({attributes:{title:gm.translate(m),id:oo("menu-item")}})).getOr({});return{tag:"div",classes:[mx,cT],...c}},S8=(o,c,m,b)=>{const _={tag:"div",classes:[BB]},x=me=>gp(me,_,c.icons,b),M=()=>V.some({dom:_}),I=m?o.iconContent.map(x).orThunk(M):V.none(),U=o.checkMark,Y=V.from(o.meta).fold(()=>y8,me=>ps(me,"style")?De(pj,me.style):y8),se=o.htmlContent.fold(()=>o.textContent.map(Y),me=>V.some(w8(me,[gx])));return{dom:C8(o.ariaLabel),optComponents:[I,se,o.shortcutContent.map(bj),U,o.caret]}},Cx=(o,c,m,b=V.none())=>o.presets==="color"?wj(o,c,b):S8(o,c,m,b),k8=(o,c)=>an(o,"tooltipWorker").map(m=>[p8.config({lazySink:c.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:b=>({type:"submenu",item:b,overrides:{maxHeightFunction:cg}}),mode:"follow-highlight",onShow:(b,_)=>{m(x=>{p8.setComponents(b,[Nv({element:it.fromDom(x)})])})}})]).getOr([]),E8=o=>rx.DOM.encode(o),kR=(o,c)=>{const m=gm.translate(o),b=E8(m);if(c.length>0){const _=new RegExp(uj(c),"gi");return b.replace(_,x=>`<span class="tox-autocompleter-highlight">${x}</span>`)}else return b},x8=(o,c,m,b,_,x,M,I=!0)=>{const U=Cx({presets:b,textContent:V.none(),htmlContent:m?o.text.map(Y=>kR(Y,c)):V.none(),ariaLabel:o.text,iconContent:o.icon,shortcutContent:V.none(),checkMark:V.none(),caret:V.none(),value:o.value},M.providers,I,o.icon);return bS({data:jw(o),enabled:o.enabled,getApi:J({}),onAction:Y=>_(o.value,o.meta),onSetup:J(F),triggersSubmenu:!1,itemBehaviours:k8(o.meta,M)},U,x,M.providers)},A8=(o,c)=>We(o,m=>{switch(m.type){case"cardcontainer":return SR(m,A8(m.items,c));case"cardimage":return _8(m.src,m.classes,m.alt);case"cardtext":const _=m.name.exists(x=>ct(c.cardText.highlightOn,x))?V.from(c.cardText.matchText).getOr(""):"";return w8(kR(m.text,_),m.classes)}}),_j=(o,c,m,b)=>{const _=M=>({isEnabled:()=>!Ko.isDisabled(M),setEnabled:I=>{Ko.set(M,!I),xt(lu(M.element,"*"),U=>{M.getSystem().getByDom(U).each(Y=>{Y.hasConfigured(Ko)&&Ko.set(Y,!I)})})}}),x={dom:C8(o.label),optComponents:[V.some({dom:{tag:"div",classes:[HB,$B]},components:A8(o.items,b)})]};return bS({data:jw({text:V.none(),...o}),enabled:o.enabled,getApi:_,onAction:o.onAction,onSetup:o.onSetup,triggersSubmenu:!1,itemBehaviours:V.from(b.itemBehaviours).getOr([])},x,c,m.providers)},Cj=(o,c,m,b,_,x,M,I=!0)=>{const U=se=>({setActive:fe=>{Ms.set(se,fe)},isActive:()=>Ms.isOn(se),isEnabled:()=>!Ko.isDisabled(se),setEnabled:fe=>Ko.set(se,!fe)}),Y=Cx({presets:m,textContent:c?o.text:V.none(),htmlContent:V.none(),ariaLabel:o.text,iconContent:o.icon,shortcutContent:c?o.shortcut:V.none(),checkMark:c?V.some(CR(M.icons)):V.none(),caret:V.none(),value:o.value},M,I);return Jr(bS({data:jw(o),enabled:o.enabled,getApi:U,onAction:se=>b(o.value),onSetup:se=>(se.setActive(_),F),triggersSubmenu:!1,itemBehaviours:[]},Y,x,M),{toggling:{toggleClass:uS,toggleOnExecute:!1,selected:o.active,exclusive:!0}})},T8=HE(SM(),Y3()),D8=o=>({value:Sx(o)}),Cy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ST=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,O8=o=>Cy.test(o)||ST.test(o),Sx=o=>_r(o,"#").toUpperCase(),l1=o=>O8(o)?V.some({value:Sx(o)}):V.none(),Sj=o=>({value:o.value.replace(Cy,(m,b,_,x)=>b+b+_+_+x+x)}),kj=o=>{const c=Sj(o),m=ST.exec(c.value);return m===null?["FFFFFF","FF","FF","FF"]:m},ER=o=>{const c=o.toString(16);return(c.length===1?"0"+c:c).toUpperCase()},Zw=o=>{const c=ER(o.red)+ER(o.green)+ER(o.blue);return D8(c)},M8=Math.min,R8=Math.max,kx=Math.round,Ej=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,xj=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Sy=(o,c,m,b)=>({red:o,green:c,blue:m,alpha:b}),rd=o=>{const c=parseInt(o,10);return c.toString()===o&&c>=0&&c<=255},c1=o=>{let c,m,b;const _=(o.hue||0)%360;let x=o.saturation/100,M=o.value/100;if(x=R8(0,M8(x,1)),M=R8(0,M8(M,1)),x===0)return c=m=b=kx(255*M),Sy(c,m,b,1);const I=_/60,U=M*x,Y=U*(1-Math.abs(I%2-1)),se=M-U;switch(Math.floor(I)){case 0:c=U,m=Y,b=0;break;case 1:c=Y,m=U,b=0;break;case 2:c=0,m=U,b=Y;break;case 3:c=0,m=Y,b=U;break;case 4:c=Y,m=0,b=U;break;case 5:c=U,m=0,b=Y;break;default:c=m=b=0}return c=kx(255*(c+se)),m=kx(255*(m+se)),b=kx(255*(b+se)),Sy(c,m,b,1)},Ex=o=>{const c=kj(o),m=parseInt(c[1],16),b=parseInt(c[2],16),_=parseInt(c[3],16);return Sy(m,b,_,1)},xR=(o,c,m,b)=>{const _=parseInt(o,10),x=parseInt(c,10),M=parseInt(m,10),I=parseFloat(b);return Sy(_,x,M,I)},vS=o=>{if(o==="transparent")return V.some(Sy(0,0,0,0));const c=Ej.exec(o);if(c!==null)return V.some(xR(c[1],c[2],c[3],"1"));const m=xj.exec(o);return m!==null?V.some(xR(m[1],m[2],m[3],m[4])):V.none()},kT=o=>`rgba(${o.red},${o.green},${o.blue},${o.alpha})`,N8=Sy(255,0,0,1),Aj=o=>{o.dispatch("SkinLoaded")},xx=(o,c)=>{o.dispatch("SkinLoadError",c)},ET=o=>{o.dispatch("ResizeEditor")},AR=(o,c)=>{o.dispatch("ResizeContent",c)},ky=(o,c)=>{o.dispatch("ScrollContent",c)},P8=(o,c)=>{o.dispatch("TextColorChange",c)},Tj=(o,c)=>{o.dispatch("AfterProgressState",{state:c})},xh=(o,c)=>o.dispatch("ResolveName",{name:c.nodeName.toLowerCase(),target:c}),TR=(o,c)=>{o.dispatch("ToggleToolbarDrawer",{state:c})},yg=(o,c)=>()=>{o(),c()},Nf=o=>_0(o,"NodeChange",c=>{c.setEnabled(o.selection.isEditable())}),Ni=(o,c)=>m=>{const b=r0(),_=()=>{m.setActive(o.formatter.match(c));const x=o.formatter.formatChanged(c,m.setActive);b.set(x)};return o.initialized?_():o.once("init",_),()=>{o.off("init",_),b.clear()}},w0=(o,c)=>m=>{const b=Nf(o)(m),_=Ni(o,c)(m);return()=>{b(),_()}},_0=(o,c,m)=>b=>{const _=()=>m(b),x=()=>{m(b),o.on(c,_)};return o.initialized?x():o.once("init",x),()=>{o.off("init",x),o.off(c,_)}},DR=o=>c=>()=>{o.undoManager.transact(()=>{o.focus(),o.execCommand("mceToggleFormat",!1,c.format)})},id=(o,c)=>()=>o.execCommand(c);var Kb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const I8={},OR=(o,c=10)=>{const m=Kb.getItem(o),b=h(m)?JSON.parse(m):[],x=(Y=>c-Y.length<0?Y.slice(0,c):Y)(b),M=Y=>{He(x,Y).each(I),x.unshift(Y),x.length>c&&x.pop(),Kb.setItem(o,JSON.stringify(x))},I=Y=>{x.splice(Y,1)};return{add:M,state:()=>x.slice(0)}},B8=o=>an(I8,o).getOrThunk(()=>{const c=`tinymce-custom-colors-${o}`,m=Kb.getItem(c);if(L(m)){const _=Kb.getItem("tinymce-custom-colors");Kb.setItem(c,j(_)?_:"[]")}const b=OR(c,10);return I8[o]=b,b}),L8=o=>We(B8(o).state(),c=>({type:"choiceitem",text:c,icon:"checkmark",value:c})),MR=(o,c)=>{B8(o).add(c)},qw=(o,c,m)=>({hue:o,saturation:c,value:m}),xT=o=>{let c=0,m=0,b=0;const _=o.red/255,x=o.green/255,M=o.blue/255,I=Math.min(_,Math.min(x,M)),U=Math.max(_,Math.max(x,M));if(I===U)return b=I,qw(0,0,b*100);const Y=_===I?x-M:M===I?_-x:M-_;return c=_===I?3:M===I?1:5,c=60*(c-Y/(U-I)),m=(U-I)/U,b=U,qw(Math.round(c),Math.round(m*100),Math.round(b*100))},AT=o=>xT(Ex(o)),F8=o=>Zw(c1(o)),Dj=o=>l1(o).orThunk(()=>vS(o).map(Zw)).getOrThunk(()=>{const c=document.createElement("canvas");c.height=1,c.width=1;const m=c.getContext("2d");m.clearRect(0,0,c.width,c.height),m.fillStyle="#FFFFFF",m.fillStyle=o,m.fillRect(0,0,1,1);const b=m.getImageData(0,0,1,1).data,_=b[0],x=b[1],M=b[2],I=b[3];return Zw(Sy(_,x,M,I))}),RR="forecolor",NR="hilitecolor",Oj=5,Mj=o=>{const c=[];for(let m=0;m<o.length;m+=2)c.push({text:o[m+1],value:"#"+Dj(o[m]).value,icon:"checkmark",type:"choiceitem"});return c},C0=o=>c=>c.options.get(o),PR="#000000",Rj=o=>{const c=o.options.register,m=_=>ee(_,h)?{value:Mj(_),valid:!0}:{valid:!1,message:"Must be an array of strings."},b=_=>q(_)&&_>0?{value:_,valid:!0}:{valid:!1,message:"Must be a positive number."};c("color_map",{processor:m,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),c("color_map_background",{processor:m}),c("color_map_foreground",{processor:m}),c("color_cols",{processor:b,default:TT(o)}),c("color_cols_foreground",{processor:b,default:H8(o,RR)}),c("color_cols_background",{processor:b,default:H8(o,NR)}),c("custom_colors",{processor:"boolean",default:!0}),c("color_default_foreground",{processor:"string",default:PR}),c("color_default_background",{processor:"string",default:PR})},IR=(o,c)=>c===RR&&o.options.isSet("color_map_foreground")?C0("color_map_foreground")(o):c===NR&&o.options.isSet("color_map_background")?C0("color_map_background")(o):C0("color_map")(o),TT=(o,c="default")=>Math.max(Oj,Math.ceil(Math.sqrt(IR(o,c).length))),H8=(o,c)=>{const m=C0("color_cols")(o),b=TT(o,c);return m===TT(o)?b:m},BR=(o,c="default")=>Math.round((()=>c===RR?C0("color_cols_foreground")(o):c===NR?C0("color_cols_background")(o):C0("color_cols")(o))()),$8=C0("custom_colors"),Nj=C0("color_default_foreground"),Pj=C0("color_default_background"),Ij="rgba(0, 0, 0, 0)",Bj=o=>vS(o).exists(c=>c.alpha!==0),Lj=o=>Qc(o,c=>{if(gr(c)){const m=qr(c,"background-color");return cn(Bj(m),m)}else return V.none()}).getOr(Ij),LR=(o,c)=>{const m=it.fromDom(o.selection.getStart()),b=c==="hilitecolor"?Lj(m):qr(m,"color");return vS(b).map(_=>"#"+Zw(_).value)},u1=(o,c,m)=>{o.undoManager.transact(()=>{o.focus(),o.formatter.apply(c,{value:m}),o.nodeChanged()})},Fj=(o,c)=>{o.undoManager.transact(()=>{o.focus(),o.formatter.remove(c,{value:null},void 0,!0),o.nodeChanged()})},FR=o=>{o.addCommand("mceApplyTextcolor",(c,m)=>{u1(o,c,m)}),o.addCommand("mceRemoveTextcolor",c=>{Fj(o,c)})},HR=o=>{const c="choiceitem",m={type:c,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return o?[m,{type:c,text:"Custom color",icon:"color-picker",value:"custom"}]:[m]},DT=(o,c,m,b)=>{m==="custom"?W8(o)(x=>{x.each(M=>{MR(c,M),o.execCommand("mceApplyTextcolor",c,M),b(M)})},LR(o,c).getOr(PR)):m==="remove"?(b(""),o.execCommand("mceRemoveTextcolor",c)):(b(m),o.execCommand("mceApplyTextcolor",c,m))},$R=(o,c,m)=>o.concat(L8(c).concat(HR(m))),zR=(o,c,m)=>b=>{b($R(o,c,m))},OT=(o,c,m)=>{const b=c==="forecolor"?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";o.setIconFill(b,m)},z8=(o,c)=>m=>{const b=LR(o,c);return $e(b,m.toUpperCase())},V8=(o,c,m,b,_)=>{o.ui.registry.addSplitButton(c,{tooltip:b,presets:"color",icon:c==="forecolor"?"text-color":"highlight-bg-color",select:z8(o,m),columns:BR(o,m),fetch:zR(IR(o,m),m,$8(o)),onAction:x=>{DT(o,m,_.get(),F)},onItemAction:(x,M)=>{DT(o,m,M,I=>{_.set(I),P8(o,{name:c,color:I})})},onSetup:x=>{OT(x,c,_.get());const M=I=>{I.name===c&&OT(x,I.name,I.color)};return o.on("TextColorChange",M),yg(Nf(o)(x),()=>{o.off("TextColorChange",M)})}})},U8=(o,c,m,b,_)=>{o.ui.registry.addNestedMenuItem(c,{text:b,icon:c==="forecolor"?"text-color":"highlight-bg-color",onSetup:x=>(OT(x,c,_.get()),Nf(o)(x)),getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:z8(o,m),initData:{storageKey:m},onAction:x=>{DT(o,m,x.value,M=>{_.set(M),P8(o,{name:c,color:M})})}}]})},W8=o=>(c,m)=>{let b=!1;const _=I=>{const Y=I.getData().colorpicker;b?(c(V.from(Y)),I.close()):o.windowManager.alert(o.translate(["Invalid hex color code: {0}",Y]))},x=(I,U)=>{U.name==="hex-valid"&&(b=U.value)},M={colorpicker:m};o.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:M,onAction:x,onSubmit:_,onClose:F,onCancel:()=>{c(V.none())}})},j8=o=>{FR(o);const c=Nj(o),m=Pj(o),b=Ho(c),_=Ho(m);V8(o,"forecolor","forecolor","Text color",b),V8(o,"backcolor","hilitecolor","Background color",_),U8(o,"forecolor","forecolor","Text color",b),U8(o,"backcolor","hilitecolor","Background color",_)},MT=(o,c,m,b,_,x,M,I)=>{const U=gT(c),se=Z8(c,m,b,_!=="color"?"normal":"color",x,M,I);return eR(o,U,se,b,{menuType:_})},Z8=(o,c,m,b,_,x,M)=>At(We(o,I=>I.type==="choiceitem"?c8(I).fold(jb,U=>V.some(Cj(U,m===1,b,c,x(U.value),_,M,gT(o)))):V.none())),RT=(o,c)=>{const m=Fw(c);return o===1?{mode:"menu",moveOnTab:!0}:o==="auto"?{mode:"grid",selector:"."+m.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+(c==="color"?"tox-swatches__row":"tox-collection__group"),previousSelector:_=>c==="color"?ta(_.element,"[aria-checked=true]"):V.none()}},Hj=(o,c)=>o===1?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:o==="auto"?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:c==="color"?".tox-swatches__row":".tox-collection__group",cell:c==="color"?`.${uT}`:`.${cT}`}},$j=(o,c)=>{const m=yS(o,c),b=c.colorinput.getColorCols(o.initData.storageKey),_="color",M={...MT(oo("menu-value"),m,I=>{o.onAction({value:I})},b,_,pp.CLOSE_ON_EXECUTE,o.select.getOr(Qe),c.shared.providers),markers:Fw(_),movement:RT(b,_)};return{type:"widget",data:{value:oo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[T8.widget(vy.sketch(M))]}},yS=(o,c)=>{const m=o.initData.allowCustomColors&&c.colorinput.hasCustomColors();return o.initData.colors.fold(()=>$R(c.colorinput.getColors(o.initData.storageKey),o.initData.storageKey,m),b=>b.concat(HR(m)))},q8=oo("cell-over"),VR=oo("cell-execute"),G8=o=>(c,m)=>o.shared.providers.translate(`${m} columns, ${c} rows`),K8=(o,c,m)=>{const b=M=>Ao(M,q8,{row:o,col:c}),_=M=>Ao(M,VR,{row:o,col:c}),x=(M,I)=>{I.stop(),_(M)};return uc({dom:{tag:"div",attributes:{role:"button",["aria-label"]:m}},behaviours:An([ks("insert-table-picker-cell",[en(Sl(),Qo.focus),en(Yu(),_),en(Kh(),x),en(Z1(),x)]),Ms.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Qo.config({onFocus:b})])})},UR=(o,c,m)=>{const b=[];for(let _=0;_<c;_++){const x=[];for(let M=0;M<m;M++){const I=o(_+1,M+1);x.push(K8(_,M,I))}b.push(x)}return b},WR=(o,c,m,b,_)=>{for(let x=0;x<b;x++)for(let M=0;M<_;M++)Ms.set(o[x][M],x<=c&&M<=m)},jR=o=>Pe(o,c=>We(c,ru)),ZR=(o,c)=>Ri(`${c}x${o}`),Y8={inserttable:(o,c)=>{const _=G8(c),x=UR(_,10,10),M=ZR(0,0),I=Qr({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[M],behaviours:An([ms.config({})])});return{type:"widget",data:{value:oo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[T8.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:jR(x).concat(I.asSpec()),behaviours:An([ks("insert-table-picker",[vi(U=>{ms.set(I.get(U),[M])}),p2(q8,(U,Y,se)=>{const{row:fe,col:me}=se.event;WR(x,fe,me,10,10),ms.set(I.get(U),[ZR(fe+1,me+1)])}),p2(VR,(U,Y,se)=>{const{row:fe,col:me}=se.event;o.onAction({numRows:fe+1,numColumns:me+1}),nr(U,Ma())})]),Po.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:$j},zj=(o,c)=>an(Y8,o.fancytype).map(m=>m(o,c)),Vj=(o,c,m,b=!0,_=!1)=>{const x=_?yj(m.icons):vj(m.icons),M=U=>({isEnabled:()=>!Ko.isDisabled(U),setEnabled:Y=>Ko.set(U,!Y),setIconFill:(Y,se)=>{ta(U.element,`svg path[class="${Y}"], rect[class="${Y}"]`).each(fe=>{Kn(fe,"fill",se)})}}),I=Cx({presets:"normal",iconContent:o.icon,textContent:o.text,htmlContent:V.none(),ariaLabel:o.text,caret:V.some(x),checkMark:V.none(),shortcutContent:o.shortcut},m,b);return bS({data:jw(o),getApi:M,enabled:o.enabled,onAction:F,onSetup:o.onSetup,triggersSubmenu:!0,itemBehaviours:[]},I,c,m)},Uj=(o,c,m,b=!0)=>{const _=M=>({isEnabled:()=>!Ko.isDisabled(M),setEnabled:I=>Ko.set(M,!I)}),x=Cx({presets:"normal",iconContent:o.icon,textContent:o.text,htmlContent:V.none(),ariaLabel:o.text,caret:V.none(),checkMark:V.none(),shortcutContent:o.shortcut},m,b);return bS({data:jw(o),getApi:_,enabled:o.enabled,onAction:o.onAction,onSetup:o.onSetup,triggersSubmenu:!1,itemBehaviours:[]},x,c,m)},X8=o=>({type:"separator",dom:{tag:"div",classes:[cT,xW]},components:o.text.map(Ri).toArray()}),J8=(o,c,m,b=!0)=>{const _=M=>({setActive:I=>{Ms.set(M,I)},isActive:()=>Ms.isOn(M),isEnabled:()=>!Ko.isDisabled(M),setEnabled:I=>Ko.set(M,!I)}),x=Cx({iconContent:o.icon,textContent:o.text,htmlContent:V.none(),ariaLabel:o.text,checkMark:V.some(CR(m.icons)),caret:V.none(),shortcutContent:o.shortcut,presets:"normal",meta:o.meta},m,b);return Jr(bS({data:jw(o),enabled:o.enabled,getApi:_,onAction:o.onAction,onSetup:o.onSetup,triggersSubmenu:!1,itemBehaviours:[]},x,c,m),{toggling:{toggleClass:uS,toggleOnExecute:!1,selected:o.active}})},Q8=x8,eL=X8,Wj=Uj,jj=Vj,Zj=J8,qj=zj,Gj=_j;var Kj=Object.freeze({__proto__:null,getCoupled:(o,c,m,b)=>m.getOrCreate(o,c,b),getExistingCoupled:(o,c,m,b)=>m.getExisting(o,c,b)}),Yj=[Gr("others",U1(wn.value,Pc()))],tL=Object.freeze({__proto__:null,init:()=>{const o={},c=(x,M)=>{if(Zs(x.others).length===0)throw new Error("Cannot find any known coupled components");return an(o,M)},m=(x,M,I)=>c(M,I).getOrThunk(()=>{const Y=an(M.others,I).getOrDie("No information found for coupled component: "+I)(x),se=x.getSystem().build(Y);return o[I]=se,se}),b=(x,M,I)=>c(M,I).orThunk(()=>(an(M.others,I).getOrDie("No information found for coupled component: "+I),V.none())),_=J({});return su({readState:_,getExisting:b,getOrCreate:m})}});const rl=Xl({fields:Yj,name:"coupling",apis:Kj,state:tL}),qR=o=>{let c=V.none(),m=[];const b=Y=>qR(se=>{_(fe=>{se(Y(fe))})}),_=Y=>{M()?U(Y):m.push(Y)},x=Y=>{M()||(c=V.some(Y),I(m),m=[])},M=()=>c.isSome(),I=Y=>{xt(Y,U)},U=Y=>{c.each(se=>{setTimeout(()=>{Y(se)},0)})};return o(x),{get:_,map:b,isReady:M}},Xj={nu:qR,pure:o=>qR(c=>{c(o)})},Jj=o=>{setTimeout(()=>{throw o},0)},Yb=o=>{const c=U=>{o().then(U,Jj)};return{map:U=>Yb(()=>o().then(U)),bind:U=>Yb(()=>o().then(Y=>U(Y).toPromise())),anonBind:U=>Yb(()=>o().then(()=>U.toPromise())),toLazy:()=>Xj.nu(c),toCached:()=>{let U=null;return Yb(()=>(U===null&&(U=o()),U))},toPromise:o,get:c}},Bu={nu:o=>Yb(()=>new Promise(o)),pure:o=>Yb(()=>Promise.resolve(o))},nL=J("sink"),oL=J(Fd({name:nL(),overrides:J({dom:{tag:"div"},behaviours:An([uu.config({useFixed:ft})]),events:ri([Jh(xf()),Jh(Br()),Jh(Kh())])})})),sL=(o,c)=>{const m=o.getHotspot(c).getOr(c),b="hotspot",_=o.getAnchorOverrides();return o.layouts.fold(()=>({type:b,hotspot:m,overrides:_}),x=>({type:b,hotspot:m,overrides:_,layouts:x}))},eZ=(o,c,m)=>{const b=o.fetch;return b(m).map(c)},GR=(o,c,m,b,_,x,M)=>{const I=eZ(o,c,b),U=aL(b,o);return I.map(Y=>Y.bind(se=>V.from(Iw.sketch({...x.menu(),uid:fh(""),data:se,highlightOnOpen:M,onOpenMenu:(fe,me)=>{const Ce=U().getOrDie();uu.position(Ce,me,{anchor:m}),Ks.decloak(_)},onOpenSubmenu:(fe,me,Ce)=>{const Ne=U().getOrDie();uu.position(Ne,Ce,{anchor:{type:"submenu",item:me}}),Ks.decloak(_)},onRepositionMenu:(fe,me,Ce)=>{const Ne=U().getOrDie();uu.position(Ne,me,{anchor:m}),xt(Ce,st=>{uu.position(Ne,st.triggeredMenu,{anchor:{type:"submenu",item:st.triggeringItem}})})},onEscape:()=>(Qo.focus(b),Ks.close(_),V.some(!0))}))))},Ax=(o,c,m,b,_,x,M)=>{const I=sL(o,m);return GR(o,c,I,m,b,_,M).map(Y=>(Y.fold(()=>{Ks.isOpen(b)&&Ks.close(b)},se=>{Ks.cloak(b),Ks.open(b,se),x(b)}),b))},rL=(o,c,m,b,_,x,M)=>(Ks.close(b),Bu.pure(b)),KR=(o,c,m,b,_,x)=>{const M=rl.getCoupled(m,"sandbox");return(Ks.isOpen(M)?rL:Ax)(o,c,m,M,b,_,x)},iL=(o,c,m)=>{const b=sr.getCurrent(c).getOr(c),_=Ji(o.element);m?no(b.element,"min-width",_+"px"):Xr(b.element,_)},aL=(o,c)=>o.getSystem().getByUid(c.uid+"-"+nL()).map(m=>()=>wn.value(m)).getOrThunk(()=>c.lazySink.fold(()=>()=>wn.error(new Error("No internal sink is specified, nor could an external sink be found")),m=>()=>m(o))),lL=o=>{Ks.getState(o).each(c=>{Iw.repositionMenus(c)})},YR=(o,c,m)=>{const b=I2(),_=(I,U)=>{const Y=sL(o,c);b.link(c.element),o.matchWidth&&iL(Y.hotspot,U,o.useMinWidth),o.onOpen(Y,I,U),m!==void 0&&m.onOpen!==void 0&&m.onOpen(I,U)},x=(I,U)=>{b.unlink(c.element),m!==void 0&&m.onClose!==void 0&&m.onClose(I,U)},M=aL(c,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:b.id,role:"listbox"}},behaviours:fm.augment(o.sandboxBehaviours,[Yn.config({store:{mode:"memory",initialValue:c}}),Ks.config({onOpen:_,onClose:x,isPartOf:(I,U,Y)=>Gp(U,Y)||Gp(c,Y),getAttachPoint:()=>M().getOrDie()}),sr.config({find:I=>Ks.getState(I).bind(U=>sr.getCurrent(U))}),Cc.config({channels:{...ay({isExtraPart:Qe}),...xE({doReposition:lL})}})])}},cL=o=>{const c=rl.getCoupled(o,"sandbox");lL(c)},XR=()=>[St("sandboxClasses",[]),fm.field("sandboxBehaviours",[sr,Cc,Ks,Yn])],tZ=J([Qt("dom"),Qt("fetch"),Gs("onOpen"),iu("onExecute"),St("getHotspot",V.some),St("getAnchorOverrides",J({})),yh(),$l("dropdownBehaviours",[Ms,rl,Po,Qo]),Qt("toggleClass"),St("eventOrder",{}),kr("lazySink"),St("matchWidth",!1),St("useMinWidth",!1),kr("role")].concat(XR())),nZ=J([Sh({schema:[Iv(),St("fakeFocus",!1)],name:"menu",defaults:o=>({onExecute:o.onExecute})}),oL()]),oZ=(o,c,m,b)=>{const _=se=>an(o.dom,"attributes").bind(fe=>an(fe,se)),x=se=>{Ks.getState(se).each(fe=>{Iw.highlightPrimary(fe)})},M=(se,fe,me)=>KR(o,we,se,b,fe,me),I=se=>{M(se,x,sd.HighlightMenuAndItem).get(F)},U={expand:se=>{Ms.isOn(se)||M(se,F,sd.HighlightNone).get(F)},open:se=>{Ms.isOn(se)||M(se,F,sd.HighlightMenuAndItem).get(F)},refetch:se=>rl.getExistingCoupled(se,"sandbox").fold(()=>M(se,F,sd.HighlightMenuAndItem).map(F),me=>Ax(o,we,se,me,b,F,sd.HighlightMenuAndItem).map(F)),isOpen:Ms.isOn,close:se=>{Ms.isOn(se)&&M(se,F,sd.HighlightMenuAndItem).get(F)},repositionMenus:se=>{Ms.isOn(se)&&cL(se)}},Y=(se,fe)=>(lh(se),V.some(!0));return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.dropdownBehaviours,[Ms.config({toggleClass:o.toggleClass,aria:{mode:"expanded"}}),rl.config({others:{sandbox:se=>YR(o,se,{onOpen:()=>Ms.on(se),onClose:()=>Ms.off(se)})}}),Po.config({mode:"special",onSpace:Y,onEnter:Y,onDown:(se,fe)=>{if(wg.isOpen(se)){const me=rl.getCoupled(se,"sandbox");x(me)}else wg.open(se);return V.some(!0)},onEscape:(se,fe)=>wg.isOpen(se)?(wg.close(se),V.some(!0)):V.none()}),Qo.config({})]),events:q3(V.some(I)),eventOrder:{...o.eventOrder,[Yu()]:["disabling","toggling","alloy.base.behaviour"]},apis:U,domModification:{attributes:{"aria-haspopup":"true",...o.role.fold(()=>({}),se=>({role:se})),...o.dom.tag==="button"?{type:_("type").getOr("button")}:{}}}}},wg=fu({name:"Dropdown",configFields:tZ(),partFields:nZ(),factory:oZ,apis:{open:(o,c)=>o.open(c),refetch:(o,c)=>o.refetch(c),expand:(o,c)=>o.expand(c),close:(o,c)=>o.close(c),isOpen:(o,c)=>o.isOpen(c),repositionMenus:(o,c)=>o.repositionMenus(c)}}),sZ=o=>{switch(o.searchMode){case"no-search":return{menuType:"normal"};default:return{menuType:"searchable",searchMode:o}}},NT=o=>{const c=Yn.getValue(o),m=fT(o).map(qB);wg.refetch(c).get(()=>{const b=rl.getCoupled(c,"sandbox");m.each(_=>fT(b).each(x=>LW(x,_)))})},JR=(o,c)=>{QR(o).each(m=>{Tk(o,m.element,c.event.eventType,c.event.interactionEvent)})},QR=o=>Ks.getState(o).bind(Nr.getHighlighted).bind(Nr.getHighlighted),uL=o=>Qu(o.element,hT)?V.some(o.element):ta(o.element,"."+hT),fL=(o,c,m)=>{dT(o).each(b=>{FW(b,m),uL(c).each(x=>{de(x,"id").each(M=>Kn(b.element,"aria-controls",M))})}),Kn(m.element,"aria-selected","true")},rZ=(o,c,m)=>{Kn(m.element,"aria-selected","false")},e5=o=>{dT(o).each(c=>Qo.focus(c))},t5=o=>rl.getExistingCoupled(o,"sandbox").bind(fT).map(qB).map(m=>m.fetchPattern).getOr("");var Gw;(function(o){o[o.ContentFocus=0]="ContentFocus",o[o.UiFocus=1]="UiFocus"})(Gw||(Gw={}));const dL=(o,c,m,b,_)=>{const x=m.shared.providers,M=I=>_?{...I,shortcut:V.none(),icon:I.text.isSome()?V.none():I.icon}:I;switch(o.type){case"menuitem":return u8(o).fold(jb,I=>V.some(Wj(M(I),c,x,b)));case"nestedmenuitem":return d8(o).fold(jb,I=>V.some(jj(M(I),c,x,b,_)));case"togglemenuitem":return h8(o).fold(jb,I=>V.some(Zj(M(I),c,x,b)));case"separator":return qW(o).fold(jb,I=>V.some(eL(I)));case"fancymenuitem":return CT(o).fold(jb,I=>qj(I,m));default:return console.error("Unknown item in general menu",o),V.none()}},iZ=(o,c,m,b,_,x,M)=>{const I=b===1,U=!I||gT(o);return At(We(o,Y=>{switch(Y.type){case"separator":return KW(Y).fold(jb,se=>V.some(eL(se)));case"cardmenuitem":return hR(Y).fold(jb,se=>V.some(Gj({...se,onAction:fe=>{se.onAction(fe),m(se.value,se.meta)}},_,x,{itemBehaviours:k8(se.meta,x),cardText:{matchText:c,highlightOn:M}})));case"autocompleteitem":default:return e8(Y).fold(jb,se=>V.some(Q8(se,c,I,"normal",m,_,x,U)))}}))},hL=(o,c,m,b,_,x)=>{const M=gT(c),I=At(We(c,se=>{const fe=Ce=>_?!ps(Ce,"text"):M,me=Ce=>dL(Ce,m,b,fe(Ce),_);return se.type==="nestedmenuitem"&&se.getSubmenuItems().length<=0?me({...se,enabled:!1}):me(se)})),U=sZ(x);return(_?UW:eR)(o,M,I,1,U)},n5=o=>Iw.singleData(o.value,o),aZ=(o,c,m,b)=>{const _=RT(c,b),x=Fw(b);return{data:n5({...o,movement:_,menuBehaviours:mS.unnamedEvents(c!=="auto"?[]:[vi((M,I)=>{bR(M,4,x.item).each(({numColumns:U,numRows:Y})=>{Po.setGridSize(M,Y,U)})})])}),menu:{markers:Fw(b),fakeFocus:m===Gw.ContentFocus}}},lZ=(o,c)=>aT(it.fromDom(c.startContainer)).map(m=>{const b=o.createRng();return b.selectNode(m.dom),b}),cZ={register:(o,c)=>{const m=Ho(!1),b=Ho(!1),_=uc(Pa.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:An([ks("dismissAutocompleter",[en(Xm(),()=>Y())])]),lazySink:c.getSink})),x=()=>Pa.isOpen(_),M=b.get,I=()=>{x()&&Pa.hide(_)},U=()=>Pa.getContent(_).bind(Ne=>Jn(Ne.components(),0)),Y=()=>o.execCommand("mceAutocompleterClose"),se=Ne=>{const st=Js(Ne,Ht=>V.from(Ht.columns)).getOr(1);return Pe(Ne,Ht=>{const ut=Ht.items;return iZ(ut,Ht.matchText,(lt,Zt)=>{const Dt=o.selection.getRng();lZ(o.dom,Dt).each(kn=>{const mn={hide:()=>Y(),reload:In=>{I(),o.execCommand("mceAutocompleterReload",!1,{fetchOptions:In})}};m.set(!0),Ht.onAction(mn,kn,lt,Zt),m.set(!1)})},st,pp.BUBBLE_TO_SANDBOX,c,Ht.highlightOn)})},fe=(Ne,st)=>{CW(it.fromDom(o.getBody())).each(Ht=>{const ut=Js(Ne,lt=>V.from(lt.columns)).getOr(1);Pa.showMenuAt(_,{anchor:{type:"node",root:it.fromDom(o.getBody()),node:V.from(Ht)}},aZ(eR("autocompleter-value",!0,st,ut,{menuType:"normal"}),ut,Gw.ContentFocus,"normal"))}),U().each(Nr.highlightFirst)},me=Ne=>{const st=se(Ne);st.length>0?fe(Ne,st):I()};o.on("AutocompleterStart",({lookupData:Ne})=>{b.set(!0),m.set(!1),me(Ne)}),o.on("AutocompleterUpdate",({lookupData:Ne})=>me(Ne)),o.on("AutocompleterEnd",()=>{I(),b.set(!1),m.set(!1)});const Ce={cancelIfNecessary:Y,isMenuOpen:x,isActive:M,isProcessingAction:m.get,getMenu:U};kW.setup(Ce,o)}},uZ=["visible","hidden","clip"],mL=o=>hi(o).length>0&&!ct(uZ,o),gL=o=>{if(gu(o)){const c=qr(o,"overflow-x"),m=qr(o,"overflow-y");return mL(c)||mL(m)}else return!1},fZ=o=>{const c=f0(o,gL),m=c.length===0?Rr(o).map(vs).map(b=>f0(b,gL)).getOr([]):c;return ds(m).map(b=>({element:b,others:m.slice(1)}))},Kw=(o,c)=>y0(o)?fZ(c):V.none(),wS=o=>{const c=[...We(o.others,li),le()];return X(li(o.element),c)},_S=(o,c,m)=>tf(o,c,m).isSome(),pL=(o,c)=>{let m=null;return{cancel:()=>{m!==null&&(clearTimeout(m),m=null)},schedule:(...x)=>{m=setTimeout(()=>{o.apply(null,x),m=null},c)}}},bL=5,S0=400,vL=o=>{const c=o.raw;return c.touches===void 0||c.touches.length!==1?V.none():V.some(c.touches[0])},dZ=(o,c)=>{const m=Math.abs(o.clientX-c.x),b=Math.abs(o.clientY-c.y);return m>bL||b>bL},o5=o=>{const c=Ui(),m=Ho(!1),b=pL(Y=>{o.triggerEvent(H_(),Y),m.set(!0)},S0),_=Y=>(vL(Y).each(se=>{b.cancel();const fe={x:se.clientX,y:se.clientY,target:Y.target};b.schedule(Y),m.set(!1),c.set(fe)}),V.none()),x=Y=>(b.cancel(),vL(Y).each(se=>{c.on(fe=>{dZ(se,fe)&&c.clear()})}),V.none()),M=Y=>{b.cancel();const se=fe=>Cr(fe.target,Y.target);return c.get().filter(se).map(fe=>m.get()?(Y.prevent(),!1):o.triggerEvent(Z1(),Y))},I=Uo([{key:eu(),value:_},{key:zp(),value:x},{key:jm(),value:M}]);return{fireIfReady:(Y,se)=>an(I,se).bind(fe=>fe(Y))}},tc=o=>o.raw.which===YE[0]&&!ct(["input","textarea"],fl(o.target))&&!_S(o.target,'[contenteditable="true"]'),hZ=(o,c)=>{const m={stopBackspace:!0,...c},b=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],_=o5(m),x=We(b.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),Ce=>Sc(o,Ce,Ne=>{_.fireIfReady(Ne,Ce).each(Ht=>{Ht&&Ne.kill()}),m.triggerEvent(Ce,Ne)&&Ne.kill()})),M=Ui(),I=Sc(o,"paste",Ce=>{_.fireIfReady(Ce,"paste").each(st=>{st&&Ce.kill()}),m.triggerEvent("paste",Ce)&&Ce.kill(),M.set(setTimeout(()=>{m.triggerEvent(Gm(),Ce)},0))}),U=Sc(o,"keydown",Ce=>{m.triggerEvent("keydown",Ce)?Ce.kill():m.stopBackspace&&tc(Ce)&&Ce.prevent()}),Y=Sc(o,"focusin",Ce=>{m.triggerEvent("focusin",Ce)&&Ce.kill()}),se=Ui(),fe=Sc(o,"focusout",Ce=>{m.triggerEvent("focusout",Ce)&&Ce.kill(),se.set(setTimeout(()=>{m.triggerEvent(qm(),Ce)},0))});return{unbind:()=>{xt(x,Ce=>{Ce.unbind()}),U.unbind(),Y.unbind(),fe.unbind(),I.unbind(),M.on(clearTimeout),se.on(clearTimeout)}}},yL=(o,c)=>{const m=an(o,"target").getOr(c);return Ho(m)},mZ=(o,c)=>{const m=Ho(!1),b=Ho(!1);return{stop:()=>{m.set(!0)},cut:()=>{b.set(!0)},isStopped:m.get,isCut:b.get,event:o,setSource:c.set,getSource:c.get}},gZ=o=>{const c=Ho(!1);return{stop:()=>{c.set(!0)},cut:F,isStopped:c.get,isCut:Qe,event:o,setSource:be("Cannot set source of a broadcasted event"),getSource:be("Cannot get source of a broadcasted event")}},Tx=G.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),wL=(o,c,m,b,_,x)=>{const M=o(c,b),I=mZ(m,_);return M.fold(()=>(x.logEventNoHandlers(c,b),Tx.complete()),U=>{const Y=U.descHandler;return Wp(Y)(I),I.isStopped()?(x.logEventStopped(c,U.element,Y.purpose),Tx.stopped()):I.isCut()?(x.logEventCut(c,U.element,Y.purpose),Tx.complete()):Fa(U.element).fold(()=>(x.logNoParent(c,U.element,Y.purpose),Tx.complete()),fe=>(x.logEventResponse(c,U.element,Y.purpose),Tx.resume(fe)))})},_L=(o,c,m,b,_,x)=>wL(o,c,m,b,_,x).fold(ft,M=>_L(o,c,m,M,_,x),Qe),pZ=(o,c,m,b,_)=>{const x=yL(m,b);return wL(o,c,m,b,x,_)},bZ=(o,c,m)=>{const b=gZ(c);return xt(o,_=>{const x=_.descHandler;Wp(x)(b)}),b.isStopped()},vZ=(o,c,m,b)=>CL(o,c,m,m.target,b),CL=(o,c,m,b,_)=>{const x=yL(m,b);return _L(o,c,m,b,x,_)},yZ=(o,c)=>({element:o,descHandler:c}),wZ=(o,c)=>({id:o,descHandler:c}),_Z=()=>{const o={},c=(M,I,U)=>{ar(U,(Y,se)=>{const fe=o[se]!==void 0?o[se]:{};fe[I]=U_(Y,M),o[se]=fe})},m=(M,I)=>Xg(I).bind(U=>an(M,U)).map(U=>yZ(I,U));return{registerId:c,unregisterId:M=>{ar(o,(I,U)=>{ps(I,M)&&delete I[M]})},filterByType:M=>an(o,M).map(I=>na(I,(U,Y)=>wZ(Y,U))).getOr([]),find:(M,I,U)=>an(o,I).bind(Y=>Qc(U,se=>m(Y,se),M))}},CZ=()=>{const o=_Z(),c={},m=Y=>{const se=Y.element;return Xg(se).getOrThunk(()=>Xu("uid-",Y.element))},b=(Y,se)=>{const fe=c[se];if(fe===Y)x(Y);else throw new Error('The tagId "'+se+'" is already used by: '+kl(fe.element)+`
Cannot use it for: `+kl(Y.element)+`
The conflicting element is`+(qs(fe.element)?" ":" not ")+"already in the DOM")},_=Y=>{const se=m(Y);Ii(c,se)&&b(Y,se);const fe=[Y];o.registerId(fe,se,Y.events),c[se]=Y},x=Y=>{Xg(Y.element).each(se=>{delete c[se],o.unregisterId(se)})};return{find:(Y,se,fe)=>o.find(Y,se,fe),filter:Y=>o.filterByType(Y),register:_,unregister:x,getById:Y=>an(c,Y)}},f1=Vc({name:"Container",factory:o=>{const{attributes:c,...m}=o.dom;return{uid:o.uid,dom:{tag:"div",attributes:{role:"presentation",...c},...m},components:o.components,behaviours:um(o.containerBehaviours),events:o.events,domModification:o.domModification,eventOrder:o.eventOrder}},configFields:[St("components",[]),$l("containerBehaviours",[]),St("events",{}),St("domModification",{}),St("eventOrder",{})]}),s5=o=>{const c=ut=>Fa(o.element).fold(ft,lt=>Cr(ut,lt)),m=CZ(),b=(ut,lt)=>m.find(c,ut,lt),_=hZ(o.element,{triggerEvent:(ut,lt)=>bb(ut,lt.target,Zt=>vZ(b,ut,lt,Zt))}),x={debugInfo:J("real"),triggerEvent:(ut,lt,Zt)=>{bb(ut,lt,Dt=>CL(b,ut,Zt,lt,Dt))},triggerFocus:(ut,lt)=>{Xg(ut).fold(()=>{sf(ut)},Zt=>{bb(Ed(),ut,Dt=>(pZ(b,Ed(),{originator:lt,kill:F,prevent:F,target:ut},ut,Dt),!1))})},triggerEscape:(ut,lt)=>{x.triggerEvent("keydown",ut.element,lt.event)},getByUid:ut=>st(ut),getByDom:ut=>Ht(ut),build:uc,buildOrPatch:ng,addToGui:ut=>{U(ut)},removeFromGui:ut=>{Y(ut)},addToWorld:ut=>{M(ut)},removeFromWorld:ut=>{I(ut)},broadcast:ut=>{me(ut)},broadcastOn:(ut,lt)=>{Ce(ut,lt)},broadcastEvent:(ut,lt)=>{Ne(ut,lt)},isConnected:ft},M=ut=>{ut.connect(x),Ja(ut.element)||(m.register(ut),xt(ut.components(),M),x.triggerEvent(Km(),ut.element,{target:ut.element}))},I=ut=>{Ja(ut.element)||(xt(ut.components(),I),m.unregister(ut)),ut.disconnect()},U=ut=>{sl(o,ut)},Y=ut=>{$c(ut)},se=()=>{_.unbind(),_u(o.element)},fe=ut=>{const lt=m.filter(Xh());xt(lt,Zt=>{const Dt=Zt.descHandler;Wp(Dt)(ut)})},me=ut=>{fe({universal:!0,data:ut})},Ce=(ut,lt)=>{fe({universal:!1,channels:ut,data:lt})},Ne=(ut,lt)=>{const Zt=m.filter(ut);return bZ(Zt,lt)},st=ut=>m.getById(ut).fold(()=>wn.error(new Error('Could not find component with uid: "'+ut+'" in system.')),wn.value),Ht=ut=>{const lt=Xg(ut).getOr("not found");return st(lt)};return M(o),{root:o,element:o.element,destroy:se,add:U,remove:Y,getByUid:st,getByDom:Ht,addToWorld:M,removeFromWorld:I,broadcast:me,broadcastOn:Ce,broadcastEvent:Ne}},SZ=(o,c)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:We(o.items,c.interpreter)}),kZ=J([St("prefix","form-field"),$l("fieldBehaviours",[sr,Yn])]),EZ=J([Fd({schema:[Qt("dom")],name:"label"}),Fd({factory:{sketch:o=>({uid:o.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:o.text}})},schema:[Qt("text")],name:"aria-descriptor"}),zc({factory:{sketch:o=>{const c=Cn(o,["factory"]);return o.factory.sketch(c)}},schema:[Qt("factory")],name:"field"})]),xZ=(o,c,m,b)=>{const _=Ql(o.fieldBehaviours,[sr.config({find:I=>Ai(I,o,"field")}),Yn.config({store:{mode:"manual",getValue:I=>sr.getCurrent(I).bind(Yn.getValue),setValue:(I,U)=>{sr.getCurrent(I).each(Y=>{Yn.setValue(Y,U)})}}})]),x=ri([vi((I,U)=>{const Y=uy(I,o,["label","field","aria-descriptor"]);Y.field().each(se=>{const fe=oo(o.prefix);Y.label().each(me=>{Kn(me.element,"for",fe),Kn(se.element,"id",fe)}),Y["aria-descriptor"]().each(me=>{const Ce=oo(o.prefix);Kn(me.element,"id",Ce),Kn(se.element,"aria-describedby",Ce)})})})]),M={getField:I=>Ai(I,o,"field"),getLabel:I=>Ai(I,o,"label")};return{uid:o.uid,dom:o.dom,components:c,behaviours:_,events:x,apis:M}},ei=fu({name:"FormField",configFields:kZ(),partFields:EZ(),factory:xZ,apis:{getField:(o,c)=>o.getField(c),getLabel:(o,c)=>o.getLabel(c)}});var AZ=Object.freeze({__proto__:null,exhibit:(o,c)=>Lc({attributes:Uo([{key:c.tabAttr,value:"true"}])})}),SL=[St("tabAttr","data-alloy-tabstop")];const Ga=Xl({fields:SL,name:"tabstopping",active:AZ});var TZ=tinymce.util.Tools.resolve("tinymce.html.Entities");const Dx=(o,c,m,b)=>{const _=DZ(o,c,m,b);return ei.sketch(_)},kL=(o,c)=>Dx(o,c,[],[]),DZ=(o,c,m,b)=>({dom:EL(m),components:o.toArray().concat([c]),fieldBehaviours:An(b)}),OZ=()=>EL([]),EL=o=>({tag:"div",classes:["tox-form__group"].concat(o)}),Xb=(o,c)=>ei.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Ri(c.translate(o))]}),Ah=oo("form-component-change"),Ox=oo("form-close"),Ey=oo("form-cancel"),k0=oo("form-action"),CS=oo("form-submit"),r5=oo("form-block"),PT=oo("form-unblock"),xL=oo("form-tabchange"),i5=oo("form-resize"),MZ=(o,c,m)=>{const b=o.label.map(fe=>Xb(fe,c)),_=fe=>(me,Ce)=>{tf(Ce.event.target,"[data-collection-item-value]").each(Ne=>{fe(me,Ce,Ne,Fi(Ne,"data-collection-item-value"))})},x=(fe,me)=>{const Ce=We(me,Ht=>{const ut=gm.translate(Ht.text),lt=o.columns===1?`<div class="tox-collection__item-label">${ut}</div>`:"",Zt=`<div class="tox-collection__item-icon">${Ht.icon}</div>`,Dt={_:" "," - ":" ","-":" "},kn=ut.replace(/\_| \- |\-/g,In=>Dt[In]);return`<div class="tox-collection__item${c.isDisabled()?" tox-collection__item--state-disabled":""}" tabindex="-1" data-collection-item-value="${TZ.encodeAllRaw(Ht.value)}" title="${kn}" aria-label="${kn}">${Zt}${lt}</div>`}),Ne=o.columns!=="auto"&&o.columns>1?xn(Ce,o.columns):[Ce],st=We(Ne,Ht=>`<div class="tox-collection__group">${Ht.join("")}</div>`);ch(fe.element,st.join(""))},M=_((fe,me,Ce,Ne)=>{me.stop(),c.isDisabled()||Ao(fe,k0,{name:o.name,value:Ne})}),I=[en(Sl(),_((fe,me,Ce)=>{sf(Ce)})),en(Kh(),M),en(Z1(),M),en(Gi(),_((fe,me,Ce)=>{ta(fe.element,"."+px).each(Ne=>{ma(Ne,px)}),Ra(Ce,px)})),en(tu(),_(fe=>{ta(fe.element,"."+px).each(me=>{ma(me,px)})})),ou(_((fe,me,Ce,Ne)=>{Ao(fe,k0,{name:o.name,value:Ne})}))],U=(fe,me)=>We(lu(fe.element,".tox-collection__item"),me),Y=ei.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(o.columns!==1?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:we},behaviours:An([Ko.config({disabled:c.isDisabled,onDisabled:fe=>{U(fe,me=>{Ra(me,"tox-collection__item--state-disabled"),Kn(me,"aria-disabled",!0)})},onEnabled:fe=>{U(fe,me=>{ma(me,"tox-collection__item--state-disabled"),je(me,"aria-disabled")})}}),ec(),ms.config({}),Yn.config({store:{mode:"memory",initialValue:m.getOr([])},onSetValue:(fe,me)=>{x(fe,me),o.columns==="auto"&&bR(fe,5,"tox-collection__item").each(({numRows:Ce,numColumns:Ne})=>{Po.setGridSize(fe,Ce,Ne)}),nr(fe,i5)}}),Ga.config({}),Po.config(Hj(o.columns,"normal")),ks("collection-events",I)]),eventOrder:{[Yu()]:["disabling","alloy.base.behaviour","collection-events"]}});return Dx(b,Y,["tox-form__group--collection"],[])},RZ=["input","textarea"],AL=o=>{const c=fl(o);return ct(RZ,c)},TL=(o,c)=>{const m=c.getRoot(o).getOr(o.element);ma(m,c.invalidClass),c.notify.each(b=>{AL(o.element)&&Kn(o.element,"aria-invalid",!1),b.getContainer(o).each(_=>{ch(_,b.validHtml)}),b.onValid(o)})},DL=(o,c,m,b)=>{const _=c.getRoot(o).getOr(o.element);Ra(_,c.invalidClass),c.notify.each(x=>{AL(o.element)&&Kn(o.element,"aria-invalid",!0),x.getContainer(o).each(M=>{ch(M,b)}),x.onInvalid(o,b)})},OL=(o,c,m)=>c.validator.fold(()=>Bu.pure(wn.value(!0)),b=>b.validate(o)),a5=(o,c,m)=>(c.notify.each(b=>{b.onValidate(o)}),OL(o,c).map(b=>o.getSystem().isConnected()?b.fold(_=>(DL(o,c,m,_),wn.error(_)),_=>(TL(o,c),wn.value(_))):wn.error("No longer in system")));var NZ=Object.freeze({__proto__:null,markValid:TL,markInvalid:DL,query:OL,run:a5,isInvalid:(o,c)=>{const m=c.getRoot(o).getOr(o.element);return Qu(m,c.invalidClass)}}),PZ=Object.freeze({__proto__:null,events:(o,c)=>o.validator.map(m=>ri([en(m.onEvent,b=>{a5(b,o,c).get(we)})].concat(m.validateOnLoad?[vi(b=>{a5(b,o,c).get(F)})]:[]))).getOr({})}),IZ=[Qt("invalidClass"),St("getRoot",V.none),Wa("notify",[St("aria","alert"),St("getContainer",V.none),St("validHtml",""),Gs("onValid"),Gs("onInvalid"),Gs("onValidate")]),Wa("validator",[Qt("validate"),St("onEvent","input"),St("validateOnLoad",!0)])];const d1=Xl({fields:IZ,name:"invalidating",active:PZ,apis:NZ,extra:{validation:o=>c=>{const m=Yn.getValue(c);return Bu.pure(o(m))}}});var BZ=Object.freeze({__proto__:null,events:()=>ri([xv(Yh(),ft)]),exhibit:()=>Lc({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})});const Mx=Xl({fields:[],name:"unselecting",active:BZ}),LZ=(o,c)=>wg.sketch({dom:o.dom,components:o.components,toggleClass:"mce-active",dropdownBehaviours:An([vg.button(c.providers.isDisabled),ec(),Mx.config({}),Ga.config({})]),layouts:o.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:c.getSink,fetch:m=>Bu.nu(b=>o.fetch(b)).map(b=>V.from(n5(Jr(MT(oo("menu-value"),b,_=>{o.onItemAction(m,_)},o.columns,o.presets,pp.CLOSE_ON_EXECUTE,Qe,c.providers),{movement:RT(o.columns,o.presets)})))),parts:{menu:fS(!1,1,o.presets)}}),IT=oo("color-input-change"),ML=oo("color-swatch-change"),RL=oo("color-picker-cancel"),FZ=(o,c,m,b)=>{const _=ei.parts.field({factory:Hw,inputClasses:["tox-textfield"],data:b,onSetValue:Y=>d1.run(Y).get(F),inputBehaviours:An([Ko.config({disabled:c.providers.isDisabled}),ec(),Ga.config({}),d1.config({invalidClass:"tox-textbox-field-invalid",getRoot:Y=>bc(Y.element),notify:{onValid:Y=>{const se=Yn.getValue(Y);Ao(Y,IT,{color:se})}},validator:{validateOnLoad:!1,validate:Y=>{const se=Yn.getValue(Y);if(se.length===0)return Bu.pure(wn.value(!0));{const fe=it.fromTag("span");no(fe,"background-color",se);const me=Xi(fe,"background-color").fold(()=>wn.error("blah"),Ce=>wn.value(se));return Bu.pure(me)}}}})]),selectOnFocus:!1}),x=o.label.map(Y=>Xb(Y,c.providers)),M=(Y,se)=>{Ao(Y,ML,{value:se})},I=(Y,se)=>{U.getOpt(Y).each(fe=>{se==="custom"?m.colorPicker(me=>{me.fold(()=>nr(fe,RL),Ce=>{M(fe,Ce),MR(o.storageKey,Ce)})},"#ffffff"):se==="remove"?M(fe,""):M(fe,se)})},U=Qr(LZ({dom:{tag:"span",attributes:{"aria-label":c.providers.translate("Color swatch")}},layouts:{onRtl:()=>[Kl,ml,Hl],onLtr:()=>[ml,Kl,Hl]},components:[],fetch:zR(m.getColors(o.storageKey),o.storageKey,m.hasCustomColors()),columns:m.getColorCols(o.storageKey),presets:"color",onItemAction:I},c));return ei.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:x.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[_,U.asSpec()]}]),fieldBehaviours:An([ks("form-field-events",[en(IT,(Y,se)=>{U.getOpt(Y).each(fe=>{no(fe.element,"background-color",se.event.color)}),Ao(Y,Ah,{name:o.name})}),en(ML,(Y,se)=>{ei.getField(Y).each(fe=>{Yn.setValue(fe,se.event.value),sr.getCurrent(Y).each(Qo.focus)})}),en(RL,(Y,se)=>{ei.getField(Y).each(fe=>{sr.getCurrent(Y).each(Qo.focus)})})])])})},NL=Fd({schema:[Qt("dom")],name:"label"}),Jb=o=>Fd({name:""+o+"-edge",overrides:c=>c.model.manager.edgeActions[o].fold(()=>({}),b=>({events:ri([Ad(eu(),(_,x,M)=>b(_,M),[c]),Ad(Br(),(_,x,M)=>b(_,M),[c]),Ad(Da(),(_,x,M)=>{M.mouseIsDown.get()&&b(_,M)},[c])])}))}),HZ=Jb("top-left"),$Z=Jb("top"),PL=Jb("top-right"),zZ=Jb("right"),VZ=Jb("bottom-right"),UZ=Jb("bottom"),WZ=Jb("bottom-left"),jZ=Jb("left"),ZZ=zc({name:"thumb",defaults:J({dom:{styles:{position:"absolute"}}}),overrides:o=>({events:ri([Qm(eu(),o,"spectrum"),Qm(zp(),o,"spectrum"),Qm(jm(),o,"spectrum"),Qm(Br(),o,"spectrum"),Qm(Da(),o,"spectrum"),Qm(j1(),o,"spectrum")])})}),BT=zc({schema:[_a("mouseIsDown",()=>Ho(!1))],name:"spectrum",overrides:o=>{const m=o.model.manager,b=(_,x)=>m.getValueFromEvent(x).map(M=>m.setValueFrom(_,o,M));return{behaviours:An([Po.config({mode:"special",onLeft:_=>m.onLeft(_,o),onRight:_=>m.onRight(_,o),onUp:_=>m.onUp(_,o),onDown:_=>m.onDown(_,o)}),Qo.config({})]),events:ri([en(eu(),b),en(zp(),b),en(Br(),b),en(Da(),(_,x)=>{o.mouseIsDown.get()&&b(_,x)})])}}});var qZ=[NL,jZ,zZ,$Z,UZ,HZ,PL,WZ,VZ,ZZ,BT];const Rx=J("slider.change.value"),GZ=o=>o.type.indexOf("touch")!==-1,c5=o=>{const c=o.event.raw;if(GZ(c)){const m=c;return m.touches!==void 0&&m.touches.length===1?V.some(m.touches[0]).map(b=>fr(b.clientX,b.clientY)):V.none()}else{const m=c;return m.clientX!==void 0?V.some(m).map(b=>fr(b.clientX,b.clientY)):V.none()}},KZ="top",Kse="right",LT="bottom",SS="left",xy=o=>o.model.minX,Ay=o=>o.model.minY,FT=o=>o.model.minX-1,HT=o=>o.model.minY-1,Yw=o=>o.model.maxX,Xw=o=>o.model.maxY,$T=o=>o.model.maxX+1,zT=o=>o.model.maxY+1,IL=(o,c,m)=>c(o)-m(o),u5=o=>IL(o,Yw,xy),f5=o=>IL(o,Xw,Ay),BL=o=>u5(o)/2,LL=o=>f5(o)/2,Jw=o=>o.stepSize,Qw=o=>o.snapToGrid,Ty=o=>o.snapStart,FL=o=>o.rounded,Nx=(o,c)=>o[c+"-edge"]!==void 0,d5=o=>Nx(o,SS),Px=o=>Nx(o,Kse),HL=o=>Nx(o,KZ),kS=o=>Nx(o,LT),_g=o=>o.model.value.get(),Dy=(o,c)=>({x:o,y:c}),vp=(o,c)=>{Ao(o,Rx(),{value:c})},YZ=(o,c)=>{vp(o,Dy(FT(c),HT(c)))},XZ=(o,c)=>{vp(o,HT(c))},JZ=(o,c)=>{vp(o,Dy(BL(c),HT(c)))},QZ=(o,c)=>{vp(o,Dy($T(c),HT(c)))},VT=(o,c)=>{vp(o,$T(c))},eq=(o,c)=>{vp(o,Dy($T(c),LL(c)))},tq=(o,c)=>{vp(o,Dy($T(c),zT(c)))},nq=(o,c)=>{vp(o,zT(c))},$L=(o,c)=>{vp(o,Dy(BL(c),zT(c)))},oq=(o,c)=>{vp(o,Dy(FT(c),zT(c)))},sq=(o,c)=>{vp(o,FT(c))},rq=(o,c)=>{vp(o,Dy(FT(c),LL(c)))},UT=(o,c,m,b)=>o<c?o:o>m?m:o===c?c-1:Math.max(c,o-b),h5=(o,c,m,b)=>o>m?o:o<c?c:o===m?m+1:Math.min(m,o+b),zL=(o,c,m)=>Math.max(c,Math.min(m,o)),iq=(o,c,m,b,_)=>_.fold(()=>{const x=o-c,M=Math.round(x/b)*b;return zL(c+M,c-1,m+1)},x=>{const M=(o-x)%b,I=Math.round(M/b),U=Math.floor((o-x)/b),Y=Math.floor((m-x)/b),se=Math.min(Y,U+I),fe=x+se*b;return Math.max(x,fe)}),aq=(o,c,m)=>Math.min(m,Math.max(o,c))-c,VL=o=>{const{min:c,max:m,range:b,value:_,step:x,snap:M,snapStart:I,rounded:U,hasMinEdge:Y,hasMaxEdge:se,minBound:fe,maxBound:me,screenRange:Ce}=o,Ne=Y?c-1:c,st=se?m+1:m;if(_<fe)return Ne;if(_>me)return st;{const Ht=aq(_,fe,me),ut=zL(Ht/Ce*b+c,Ne,st);return M&&ut>=c&&ut<=m?iq(ut,c,m,x,I):U?Math.round(ut):ut}},m5=o=>{const{min:c,max:m,range:b,value:_,hasMinEdge:x,hasMaxEdge:M,maxBound:I,maxOffset:U,centerMinEdge:Y,centerMaxEdge:se}=o;return _<c?x?0:Y:_>m?M?I:se:(_-c)/b*U},WT="top",UL="right",WL="bottom",g5="left",lq="width",cq="height",h1=o=>o.element.dom.getBoundingClientRect(),ad=(o,c)=>o[c],jT=o=>{const c=h1(o);return ad(c,g5)},jL=o=>{const c=h1(o);return ad(c,UL)},ZT=o=>{const c=h1(o);return ad(c,WT)},Ix=o=>{const c=h1(o);return ad(c,WL)},pm=o=>{const c=h1(o);return ad(c,lq)},qT=o=>{const c=h1(o);return ad(c,cq)},p5=(o,c,m)=>(o+c)/2-m,ZL=(o,c)=>{const m=h1(o),b=h1(c),_=ad(m,g5),x=ad(m,UL),M=ad(b,g5);return p5(_,x,M)},qL=(o,c)=>{const m=h1(o),b=h1(c),_=ad(m,WT),x=ad(m,WL),M=ad(b,WT);return p5(_,x,M)},GT=(o,c)=>{Ao(o,Rx(),{value:c})},b5=(o,c,m)=>{const b={min:xy(c),max:Yw(c),range:u5(c),value:m,step:Jw(c),snap:Qw(c),snapStart:Ty(c),rounded:FL(c),hasMinEdge:d5(c),hasMaxEdge:Px(c),minBound:jT(o),maxBound:jL(o),screenRange:pm(o)};return VL(b)},GL=(o,c,m)=>{const b=b5(o,c,m);return GT(o,b),b},KL=(o,c)=>{const m=xy(c);GT(o,m)},uq=(o,c)=>{const m=Yw(c);GT(o,m)},fq=(o,c,m)=>{const _=(o>0?h5:UT)(_g(m),xy(m),Yw(m),Jw(m));return GT(c,_),V.some(_)},v5=o=>(c,m)=>fq(o,c,m).map(ft),dq=o=>c5(o).map(m=>m.left),YL=(o,c,m,b,_)=>{const M=pm(o),I=b.bind(se=>V.some(ZL(se,o))).getOr(0),U=_.bind(se=>V.some(ZL(se,o))).getOr(M),Y={min:xy(c),max:Yw(c),range:u5(c),value:m,hasMinEdge:d5(c),hasMaxEdge:Px(c),minBound:jT(o),minOffset:0,maxBound:jL(o),maxOffset:M,centerMinEdge:I,centerMaxEdge:U};return m5(Y)},KT=(o,c,m,b,_,x)=>{const M=YL(c,x,m,b,_);return jT(c)-jT(o)+M},XL=(o,c,m,b)=>{const _=_g(m),x=KT(o,b.getSpectrum(o),_,b.getLeftEdge(o),b.getRightEdge(o),m),M=Ji(c.element)/2;no(c.element,"left",x-M+"px")},hq=v5(-1),mq=v5(1),gq=V.none,pq=V.none,bq={"top-left":V.none(),top:V.none(),"top-right":V.none(),right:V.some(VT),"bottom-right":V.none(),bottom:V.none(),"bottom-left":V.none(),left:V.some(sq)};var vq=Object.freeze({__proto__:null,setValueFrom:GL,setToMin:KL,setToMax:uq,findValueOfOffset:b5,getValueFromEvent:dq,findPositionOfValue:KT,setPositionFromValue:XL,onLeft:hq,onRight:mq,onUp:gq,onDown:pq,edgeActions:bq});const ES=(o,c)=>{Ao(o,Rx(),{value:c})},y5=(o,c,m)=>{const b={min:Ay(c),max:Xw(c),range:f5(c),value:m,step:Jw(c),snap:Qw(c),snapStart:Ty(c),rounded:FL(c),hasMinEdge:HL(c),hasMaxEdge:kS(c),minBound:ZT(o),maxBound:Ix(o),screenRange:qT(o)};return VL(b)},JL=(o,c,m)=>{const b=y5(o,c,m);return ES(o,b),b},yq=(o,c)=>{const m=Ay(c);ES(o,m)},wq=(o,c)=>{const m=Xw(c);ES(o,m)},_q=(o,c,m)=>{const _=(o>0?h5:UT)(_g(m),Ay(m),Xw(m),Jw(m));return ES(c,_),V.some(_)},QL=o=>(c,m)=>_q(o,c,m).map(ft),Cq=o=>c5(o).map(m=>m.top),Sq=(o,c,m,b,_)=>{const M=qT(o),I=b.bind(se=>V.some(qL(se,o))).getOr(0),U=_.bind(se=>V.some(qL(se,o))).getOr(M),Y={min:Ay(c),max:Xw(c),range:f5(c),value:m,hasMinEdge:HL(c),hasMaxEdge:kS(c),minBound:ZT(o),minOffset:0,maxBound:Ix(o),maxOffset:M,centerMinEdge:I,centerMaxEdge:U};return m5(Y)},w5=(o,c,m,b,_,x)=>{const M=Sq(c,x,m,b,_);return ZT(c)-ZT(o)+M},eF=(o,c,m,b)=>{const _=_g(m),x=w5(o,b.getSpectrum(o),_,b.getTopEdge(o),b.getBottomEdge(o),m),M=Oi(c.element)/2;no(c.element,"top",x-M+"px")},tF=V.none,kq=V.none,Eq=QL(-1),xq=QL(1),Aq={"top-left":V.none(),top:V.some(XZ),"top-right":V.none(),right:V.none(),"bottom-right":V.none(),bottom:V.some(nq),"bottom-left":V.none(),left:V.none()};var Tq=Object.freeze({__proto__:null,setValueFrom:JL,setToMin:yq,setToMax:wq,findValueOfOffset:y5,getValueFromEvent:Cq,findPositionOfValue:w5,setPositionFromValue:eF,onLeft:tF,onRight:kq,onUp:Eq,onDown:xq,edgeActions:Aq});const Bx=(o,c)=>{Ao(o,Rx(),{value:c})},Lx=(o,c)=>({x:o,y:c}),nF=(o,c,m)=>{const b=b5(o,c,m.left),_=y5(o,c,m.top),x=Lx(b,_);return Bx(o,x),x},_5=(o,c,m,b)=>{const _=o>0?h5:UT,x=c?_g(b).x:_(_g(b).x,xy(b),Yw(b),Jw(b)),M=c?_(_g(b).y,Ay(b),Xw(b),Jw(b)):_g(b).y;return Bx(m,Lx(x,M)),V.some(x)},YT=(o,c)=>(m,b)=>_5(o,c,m,b).map(ft),oF=(o,c)=>{const m=xy(c),b=Ay(c);Bx(o,Lx(m,b))},Dq=(o,c)=>{const m=Yw(c),b=Xw(c);Bx(o,Lx(m,b))},Oq=o=>c5(o),Mq=(o,c,m,b)=>{const _=_g(m),x=KT(o,b.getSpectrum(o),_.x,b.getLeftEdge(o),b.getRightEdge(o),m),M=w5(o,b.getSpectrum(o),_.y,b.getTopEdge(o),b.getBottomEdge(o),m),I=Ji(c.element)/2,U=Oi(c.element)/2;no(c.element,"left",x-I+"px"),no(c.element,"top",M-U+"px")},Rq=YT(-1,!1),C5=YT(1,!1),Qb=YT(-1,!0),Nq=YT(1,!0),Fx={"top-left":V.some(YZ),top:V.some(JZ),"top-right":V.some(QZ),right:V.some(eq),"bottom-right":V.some(tq),bottom:V.some($L),"bottom-left":V.some(oq),left:V.some(rq)};var Pq=Object.freeze({__proto__:null,setValueFrom:nF,setToMin:oF,setToMax:Dq,getValueFromEvent:Oq,setPositionFromValue:Mq,onLeft:Rq,onRight:C5,onUp:Qb,onDown:Nq,edgeActions:Fx});const S5=[St("stepSize",1),St("onChange",F),St("onChoose",F),St("onInit",F),St("onDragStart",F),St("onDragEnd",F),St("snapToGrid",!1),St("rounded",!0),kr("snapStart"),Gr("model",Cl("mode",{x:[St("minX",0),St("maxX",100),_a("value",o=>Ho(o.mode.minX)),Qt("getInitialValue"),Vi("manager",vq)],y:[St("minY",0),St("maxY",100),_a("value",o=>Ho(o.mode.minY)),Qt("getInitialValue"),Vi("manager",Tq)],xy:[St("minX",0),St("maxX",100),St("minY",0),St("maxY",100),_a("value",o=>Ho({x:o.mode.minX,y:o.mode.minY})),Qt("getInitialValue"),Vi("manager",Pq)]})),$l("sliderBehaviours",[Po,Yn]),_a("mouseIsDown",()=>Ho(!1))],yp=fu({name:"Slider",configFields:S5,partFields:qZ,factory:(o,c,m,b)=>{const _=Dt=>o1(Dt,o,"thumb"),x=Dt=>o1(Dt,o,"spectrum"),M=Dt=>Ai(Dt,o,"left-edge"),I=Dt=>Ai(Dt,o,"right-edge"),U=Dt=>Ai(Dt,o,"top-edge"),Y=Dt=>Ai(Dt,o,"bottom-edge"),se=o.model,fe=se.manager,me=(Dt,kn)=>{fe.setPositionFromValue(Dt,kn,o,{getLeftEdge:M,getRightEdge:I,getTopEdge:U,getBottomEdge:Y,getSpectrum:x})},Ce=(Dt,kn)=>{se.value.set(kn);const mn=_(Dt);me(Dt,mn)},Ne=(Dt,kn)=>{Ce(Dt,kn);const mn=_(Dt);return o.onChange(Dt,mn,kn),V.some(!0)},st=Dt=>{fe.setToMin(Dt,o)},Ht=Dt=>{fe.setToMax(Dt,o)},ut=Dt=>{const kn=()=>{Ai(Dt,o,"thumb").each(In=>{const Zn=se.value.get();o.onChoose(Dt,In,Zn)})},mn=o.mouseIsDown.get();o.mouseIsDown.set(!1),mn&&kn()},lt=(Dt,kn)=>{kn.stop(),o.mouseIsDown.set(!0),o.onDragStart(Dt,_(Dt))},Zt=(Dt,kn)=>{kn.stop(),o.onDragEnd(Dt,_(Dt)),ut(Dt)};return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.sliderBehaviours,[Po.config({mode:"special",focusIn:Dt=>Ai(Dt,o,"spectrum").map(Po.focusIn).map(ft)}),Yn.config({store:{mode:"manual",getValue:Dt=>se.value.get(),setValue:Ce}}),Cc.config({channels:{[EE()]:{onReceive:ut}}})]),events:ri([en(Rx(),(Dt,kn)=>{Ne(Dt,kn.event.value)}),vi((Dt,kn)=>{const mn=se.getInitialValue();se.value.set(mn);const In=_(Dt);me(Dt,In);const Zn=x(Dt);o.onInit(Dt,In,Zn,se.value.get())}),en(eu(),lt),en(jm(),Zt),en(Br(),lt),en(j1(),Zt)]),apis:{resetToMin:st,resetToMax:Ht,setValue:Ce,refresh:me},domModification:{styles:{position:"relative"}}}},apis:{setValue:(o,c,m)=>{o.setValue(c,m)},resetToMin:(o,c)=>{o.resetToMin(c)},resetToMax:(o,c)=>{o.resetToMax(c)},refresh:(o,c)=>{o.refresh(c)}}}),k5=oo("rgb-hex-update"),E5=oo("slider-update"),sF=oo("palette-update"),x5=(o,c)=>{const m=yp.parts.spectrum({dom:{tag:"div",classes:[c("hue-slider-spectrum")],attributes:{role:"presentation"}}}),b=yp.parts.thumb({dom:{tag:"div",classes:[c("hue-slider-thumb")],attributes:{role:"presentation"}}});return yp.sketch({dom:{tag:"div",classes:[c("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:J(0)},components:[m,b],sliderBehaviours:An([Qo.config({})]),onChange:(_,x,M)=>{Ao(_,E5,{value:M})}})},XT="form",A5=[$l("formBehaviours",[Yn])],rF=o=>"<alloy.field."+o+">",bm=o=>{const c=(()=>{const x=[];return{field:(I,U)=>(x.push(I),_3(XT,rF(I),U)),record:J(x)}})(),m=o(c),b=c.record(),_=We(b,x=>zc({name:x,pname:rF(x)}));return UE(XT,A5,_,Bq,m)},Iq=(o,c)=>o.fold(()=>wn.error(c),wn.value),Bq=(o,c)=>({uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.formBehaviours,[Yn.config({store:{mode:"manual",getValue:m=>{const b=zE(m,o);return Ps(b,(_,x)=>_().bind(M=>{const I=sr.getCurrent(M);return Iq(I,new Error(`Cannot find a current component to extract the value from for form part '${x}': `+kl(M.element)))}).map(Yn.getValue))},setValue:(m,b)=>{ar(b,(_,x)=>{Ai(m,o,x).each(M=>{sr.getCurrent(M).each(I=>{Yn.setValue(I,_)})})})}}})]),apis:{getField:(m,b)=>Ai(m,o,b).bind(sr.getCurrent)}}),e_={getField:Qg((o,c,m)=>o.getField(c,m)),sketch:bm},T5=oo("valid-input"),iF=oo("invalid-input"),aF=oo("validating-input"),D5="colorcustom.rgb.",Lq=(o,c,m,b)=>{const _=(me,Ce)=>d1.config({invalidClass:c("invalid"),notify:{onValidate:Ne=>{Ao(Ne,aF,{type:me})},onValid:Ne=>{Ao(Ne,T5,{type:me,value:Yn.getValue(Ne)})},onInvalid:Ne=>{Ao(Ne,iF,{type:me,value:Yn.getValue(Ne)})}},validator:{validate:Ne=>{const st=Yn.getValue(Ne),Ht=Ce(st)?wn.value(!0):wn.error(o("aria.input.invalid"));return Bu.pure(Ht)},validateOnLoad:!1}}),x=(me,Ce,Ne,st,Ht)=>{const ut=o(D5+"range"),lt=ei.parts.label({dom:{tag:"label",attributes:{"aria-label":st}},components:[Ri(Ne)]}),Zt=ei.parts.field({data:Ht,factory:Hw,inputAttributes:{type:"text",...Ce==="hex"?{"aria-live":"polite"}:{}},inputClasses:[c("textfield")],inputBehaviours:An([_(Ce,me),Ga.config({})]),onSetValue:In=>{d1.isInvalid(In)&&d1.run(In).get(F)}}),Dt=[lt,Zt],kn=Ce!=="hex"?[ei.parts["aria-descriptor"]({text:ut})]:[],mn=Dt.concat(kn);return{dom:{tag:"div",attributes:{role:"presentation"}},components:mn}},M=(me,Ce)=>{const Ne=Zw(Ce);return e_.getField(me,"hex").each(st=>{Qo.isFocused(st)||Yn.setValue(me,{hex:Ne.value})}),Ne},I=(me,Ce)=>{const Ne=Ce.red,st=Ce.green,Ht=Ce.blue;Yn.setValue(me,{red:Ne,green:st,blue:Ht})},U=Qr({dom:{tag:"div",classes:[c("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),Y=(me,Ce)=>{U.getOpt(me).each(Ne=>{no(Ne.element,"background-color","#"+Ce.value)})};return Vc({factory:()=>{const me={red:Ho(V.some(255)),green:Ho(V.some(255)),blue:Ho(V.some(255)),hex:Ho(V.some("ffffff"))},Ce=(fs,hr)=>{const Fo=Ex(hr);I(fs,Fo),ut(Fo)},Ne=fs=>me[fs].get(),st=(fs,hr)=>{me[fs].set(hr)},Ht=()=>Ne("red").bind(fs=>Ne("green").bind(hr=>Ne("blue").map(Fo=>Sy(fs,hr,Fo,1)))),ut=fs=>{const hr=fs.red,Fo=fs.green,ir=fs.blue;st("red",V.some(hr)),st("green",V.some(Fo)),st("blue",V.some(ir))},lt=(fs,hr)=>{const Fo=hr.event;Fo.type!=="hex"?st(Fo.type,V.none()):b(fs)},Zt=(fs,hr)=>{m(fs);const Fo=D8(hr);st("hex",V.some(Fo.value));const ir=Ex(Fo);I(fs,ir),ut(ir),Ao(fs,k5,{hex:Fo}),Y(fs,Fo)},Dt=(fs,hr,Fo)=>{const ir=parseInt(Fo,10);st(hr,V.some(ir)),Ht().each(Fn=>{const po=M(fs,Fn);Ao(fs,k5,{hex:po}),Y(fs,po)})},kn=fs=>fs.type==="hex",mn=(fs,hr)=>{const Fo=hr.event;kn(Fo)?Zt(fs,Fo.value):Dt(fs,Fo.type,Fo.value)},In=fs=>({label:o(D5+fs+".label"),description:o(D5+fs+".description")}),Zn=In("red"),js=In("green"),yo=In("blue"),ws=In("hex");return Jr(e_.sketch(fs=>({dom:{tag:"form",classes:[c("rgb-form")],attributes:{"aria-label":o("aria.color.picker")}},components:[fs.field("red",ei.sketch(x(rd,"red",Zn.label,Zn.description,255))),fs.field("green",ei.sketch(x(rd,"green",js.label,js.description,255))),fs.field("blue",ei.sketch(x(rd,"blue",yo.label,yo.description,255))),fs.field("hex",ei.sketch(x(O8,"hex",ws.label,ws.description,"ffffff"))),U.asSpec()],formBehaviours:An([d1.config({invalidClass:c("form-invalid")}),ks("rgb-form-events",[en(T5,mn),en(iF,lt),en(aF,lt)])])})),{apis:{updateHex:(fs,hr)=>{Yn.setValue(fs,{hex:hr.value}),Ce(fs,hr),Y(fs,hr)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(me,Ce,Ne)=>{me.updateHex(Ce,Ne)}},extraApis:{}})},Fq=(o,c)=>{const m=yp.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[c("sv-palette-spectrum")]}}),b=yp.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[c("sv-palette-thumb")],innerHtml:`<div class=${c("sv-palette-inner-thumb")} role="presentation"></div>`}}),_=(Y,se)=>{const{width:fe,height:me}=Y,Ce=Y.getContext("2d");if(Ce===null)return;Ce.fillStyle=se,Ce.fillRect(0,0,fe,me);const Ne=Ce.createLinearGradient(0,0,fe,0);Ne.addColorStop(0,"rgba(255,255,255,1)"),Ne.addColorStop(1,"rgba(255,255,255,0)"),Ce.fillStyle=Ne,Ce.fillRect(0,0,fe,me);const st=Ce.createLinearGradient(0,0,0,me);st.addColorStop(0,"rgba(0,0,0,0)"),st.addColorStop(1,"rgba(0,0,0,1)"),Ce.fillStyle=st,Ce.fillRect(0,0,fe,me)},x=(Y,se)=>{const fe=Y.components()[0].element.dom,me=qw(se,100,100),Ce=c1(me);_(fe,kT(Ce))},M=(Y,se)=>{const fe=xT(Ex(se));yp.setValue(Y,{x:fe.saturation,y:100-fe.value})};return Vc({factory:Y=>{const se=J({x:0,y:0}),fe=(Ne,st,Ht)=>{Ao(Ne,sF,{value:Ht})},me=(Ne,st,Ht,ut)=>{_(Ht.element.dom,kT(N8))},Ce=An([sr.config({find:V.some}),Qo.config({})]);return yp.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[c("sv-palette")]},model:{mode:"xy",getInitialValue:se},rounded:!1,components:[m,b],onChange:fe,onInit:me,sliderBehaviours:Ce})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(Y,se,fe)=>{x(se,fe)},setThumb:(Y,se,fe)=>{M(se,fe)}},extraApis:{}})},Hq=(o,c)=>{const m=_=>{const x=Lq(o,c,_.onValidHex,_.onInvalidHex),M=Fq(o,c),I=mn=>(100-mn)/100*360,U=mn=>100-mn/360*100,Y={paletteRgba:Ho(N8),paletteHue:Ho(0)},se=Qr(x5(o,c)),fe=Qr(M.sketch({})),me=Qr(x.sketch({})),Ce=(mn,In,Zn)=>{fe.getOpt(mn).each(js=>{M.setHue(js,Zn)})},Ne=(mn,In)=>{me.getOpt(mn).each(Zn=>{x.updateHex(Zn,In)})},st=(mn,In,Zn)=>{se.getOpt(mn).each(js=>{yp.setValue(js,U(Zn))})},Ht=(mn,In)=>{fe.getOpt(mn).each(Zn=>{M.setThumb(Zn,In)})},ut=(mn,In)=>{const Zn=Ex(mn);Y.paletteRgba.set(Zn),Y.paletteHue.set(In)},lt=(mn,In,Zn,js)=>{ut(In,Zn),xt(js,yo=>{yo(mn,In,Zn)})},Zt=()=>{const mn=[Ne];return(In,Zn)=>{const js=Zn.event.value,yo=Y.paletteHue.get(),ws=qw(yo,js.x,100-js.y),fs=F8(ws);lt(In,fs,yo,mn)}},Dt=()=>{const mn=[Ce,Ne];return(In,Zn)=>{const js=I(Zn.event.value),yo=Y.paletteRgba.get(),ws=xT(yo),fs=qw(js,ws.saturation,ws.value),hr=F8(fs);lt(In,hr,js,mn)}},kn=()=>{const mn=[Ce,st,Ht];return(In,Zn)=>{const js=Zn.event.hex,yo=AT(js);lt(In,js,yo.hue,mn)}};return{uid:_.uid,dom:_.dom,components:[fe.asSpec(),se.asSpec(),me.asSpec()],behaviours:An([ks("colour-picker-events",[en(k5,kn()),en(sF,Zt()),en(E5,Dt())]),sr.config({find:mn=>me.getOpt(mn)}),Po.config({mode:"acyclic"})])}};return Vc({name:"ColourPicker",configFields:[Qt("dom"),St("onValidHex",F),St("onInvalidHex",F)],factory:m})},wp={self:()=>sr.config({find:V.some}),memento:o=>sr.config({find:o.getOpt}),childAt:o=>sr.config({find:c=>Rc(c.element,o).bind(m=>c.getSystem().getByDom(m).toOptional())})},zq=ro([St("preprocess",we),St("postprocess",we)]),lF=(o,c)=>{const m=xs("RepresentingConfigs.memento processors",zq,c);return Yn.config({store:{mode:"manual",getValue:b=>{const _=o.get(b),x=Yn.getValue(_);return m.postprocess(x)},setValue:(b,_)=>{const x=m.preprocess(_),M=o.get(b);Yn.setValue(M,x)}}})},ev=(o,c,m)=>Yn.config({store:{mode:"manual",...o.map(b=>({initialValue:b})).getOr({}),getValue:c,setValue:m}}),cF=(o,c,m)=>ev(o,b=>c(b.element),(b,_)=>m(b.element,_)),O5=o=>cF(o,Vp,ch),tv=o=>Yn.config({store:{mode:"memory",initialValue:o}}),uF={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},fF=o=>c=>o.translate(uF[c]),dF=(o,c,m)=>{const b=U=>"tox-"+U,_=Hq(fF(c),b),x=U=>{Ao(U,k0,{name:"hex-valid",value:!0})},M=U=>{Ao(U,k0,{name:"hex-valid",value:!1})},I=Qr(_.sketch({dom:{tag:"div",classes:[b("color-picker-container")],attributes:{role:"presentation"}},onValidHex:x,onInvalidHex:M}));return{dom:{tag:"div"},components:[I.asSpec()],behaviours:An([ev(m,U=>{const Y=I.get(U);return sr.getCurrent(Y).bind(me=>Yn.getValue(me).hex).map(me=>"#"+_r(me,"#")).getOr("")},(U,Y)=>{const se=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,fe=V.from(se.exec(Y)).bind(Ne=>Jn(Ne,1)),me=I.get(U);sr.getCurrent(me).fold(()=>{console.log("Can not find form")},Ne=>{Yn.setValue(Ne,{hex:fe.getOr("")}),e_.getField(Ne,"hex").each(st=>{nr(st,Gh())})})}),wp.self()])}};var Vq=tinymce.util.Tools.resolve("tinymce.Resource");const Uq=o=>ps(o,"init"),JT=o=>{const c=Ui(),m=Qr({dom:{tag:o.tag}}),b=Ui();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:An([ks("custom-editor-events",[vi(_=>{m.getOpt(_).each(x=>{(Uq(o)?o.init(x.element.dom):Vq.load(o.scriptId,o.scriptUrl).then(M=>M(x.element.dom,o.settings))).then(M=>{b.on(I=>{M.setValue(I)}),b.clear(),c.set(M)})})})]),ev(V.none(),()=>c.get().fold(()=>b.get().getOr(""),_=>_.getValue()),(_,x)=>{c.get().fold(()=>b.set(x),M=>M.setValue(x))}),wp.self()]),components:[m.asSpec()]}};var nv=tinymce.util.Tools.resolve("tinymce.util.Tools");const Wq=(o,c)=>{const m=nv.explode(c.getOption("images_file_types")),b=_=>dn(m,x=>Bi(_.name.toLowerCase(),`.${x.toLowerCase()}`));return ho(Ns(o),b)},hF=(o,c,m)=>{const b=(me,Ce)=>{Ce.stop()},_=me=>(Ce,Ne)=>{xt(me,st=>{st(Ce,Ne)})},x=(me,Ce)=>{var Ne;if(!Ko.isDisabled(me)){const st=Ce.event.raw;I(me,(Ne=st.dataTransfer)===null||Ne===void 0?void 0:Ne.files)}},M=(me,Ce)=>{const Ne=Ce.event.raw.target;I(me,Ne.files)},I=(me,Ce)=>{Ce&&(Yn.setValue(me,Wq(Ce,c)),Ao(me,Ah,{name:o.name}))},U=Qr({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:An([ks("input-file-events",[Jh(Kh()),Jh(Z1())])])}),Y=me=>({uid:me.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:An([tv(m.getOr([])),wp.self(),Ko.config({}),Ms.config({toggleClass:"dragenter",toggleOnExecute:!1}),ks("dropzone-events",[en("dragenter",_([b,Ms.toggle])),en("dragleave",_([b,Ms.toggle])),en("dragover",b),en("drop",_([b,x])),en(Wg(),M)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Ri(c.translate("Drop an image here"))]},Uc.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Ri(c.translate("Browse for an image")),U.asSpec()],action:Ce=>{U.get(Ce).element.dom.click()},buttonBehaviours:An([Ga.config({}),vg.button(c.isDisabled),ec()])})]}]}),se=o.label.map(me=>Xb(me,c)),fe=ei.parts.field({factory:{sketch:Y}});return Dx(se,fe,["tox-form__group--stretched"],[])},mF=(o,c)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${o.columns}col`]},components:We(o.items,c.interpreter)}),M5=(o,c)=>{let m=null,b=null;return{cancel:()=>{A(m)||(clearTimeout(m),m=null,b=null)},throttle:(...M)=>{b=M,A(m)&&(m=setTimeout(()=>{const I=b;m=null,b=null,o.apply(null,I)},c))}}},gF=(o,c)=>{let m=null;return{cancel:()=>{A(m)||(clearTimeout(m),m=null)},throttle:(...x)=>{A(m)&&(m=setTimeout(()=>{m=null,o.apply(null,x)},c))}}},uf=(o,c)=>{let m=null;const b=()=>{A(m)||(clearTimeout(m),m=null)};return{cancel:b,throttle:(...x)=>{b(),m=setTimeout(()=>{m=null,o.apply(null,x)},c)}}},QT=oo("alloy-fake-before-tabstop"),R5=oo("alloy-fake-after-tabstop"),pF=o=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:o},behaviours:An([Qo.config({ignore:!0}),Ga.config({})])}),N5=(o,c)=>({dom:{tag:"div",classes:["tox-navobj",...o.getOr([])]},components:[pF([QT]),c,pF([R5])],behaviours:An([wp.childAt(1)])}),bF=(o,c)=>{Ao(o,xf(),{raw:{which:9,shiftKey:c}})},jq=(o,c)=>{const m=c.element;Qu(m,QT)?bF(o,!0):Qu(m,R5)&&bF(o,!1)},Hx=o=>_S(o,["."+QT,"."+R5].join(","),Qe),e4=oo("update-dialog"),m1=oo("update-title"),t4=oo("update-body"),P5=oo("update-footer"),$x=oo("body-send-message"),xS=oo("dialog-focus-shifted"),I5=nn().browser,zx=I5.isSafari(),Zq=I5.isFirefox(),vF=zx||Zq,qq=I5.isChromium(),Gq=({scrollTop:o,scrollHeight:c,clientHeight:m})=>Math.ceil(o)+m>=c,yF=(o,c)=>o.scrollTo(0,c==="bottom"?99999999:c),wF=(o,c)=>{const m=o.body;return V.from(!/^<!DOCTYPE (html|HTML)/.test(c)&&(!qq&&!zx||j(m)&&(m.scrollTop!==0||Math.abs(m.scrollHeight-m.clientHeight)>1))?m:o.documentElement)},_F=(o,c,m)=>{const b=o.dom;V.from(b.contentDocument).fold(m,_=>{let x=0;const M=wF(_,c).map(U=>(x=U.scrollTop,U)).forall(Gq),I=()=>{const U=b.contentWindow;j(U)&&(M?yF(U,"bottom"):!M&&vF&&x!==0&&yF(U,x))};zx&&b.addEventListener("load",I,{once:!0}),_.open(),_.write(c),_.close(),zx||I()})},n4=cn(vF,zx?500:200).map(o=>M5(_F,o)),Kq=(o,c)=>{const m=Ho(o.getOr(""));return{getValue:b=>m.get(),setValue:(b,_)=>{if(m.get()!==_){const x=b.element,M=()=>Kn(x,"srcdoc",_);c?n4.fold(J(_F),I=>I.throttle)(x,_,M):M()}m.set(_)}}},Yq=(o,c,m)=>{const b="tox-dialog__iframe",_=o.transparent?[]:[`${b}--opaque`],x=o.border?["tox-navobj-bordered"]:[],M={...o.label.map(fe=>({title:fe})).getOr({}),...m.map(fe=>({srcdoc:fe})).getOr({}),...o.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}},I=Kq(m,o.streamContent),U=o.label.map(fe=>Xb(fe,c)),Y=fe=>N5(V.from(x),{uid:fe.uid,dom:{tag:"iframe",attributes:M,classes:[b,..._]},behaviours:An([Ga.config({}),Qo.config({}),ev(m,I.getValue,I.setValue),Cc.config({channels:{[xS]:{onReceive:(me,Ce)=>{Ce.newFocus.each(Ne=>{bc(me.element).each(st=>{(Cr(me.element,Ne)?Ra:ma)(st,"tox-navobj-bordered-focus")})})}}}})])}),se=ei.parts.field({factory:{sketch:Y}});return Dx(U,se,["tox-form__group--stretched"],[])},CF=o=>new Promise((c,m)=>{const b=()=>{x(),c(o)},_=[Sc(o,"load",b),Sc(o,"error",()=>{x(),m("Unable to load data from image: "+o.dom.src)})],x=()=>xt(_,M=>M.unbind());o.dom.complete&&b()}),SF=(o,c,m,b,_)=>{const x=m*_,M=b*_,I=Math.max(0,o/2-x/2),U=Math.max(0,c/2-M/2);return{left:I.toString()+"px",top:U.toString()+"px",width:x.toString()+"px",height:M.toString()+"px"}},B5=(o,c,m)=>{const b=Ji(o),_=Oi(o);return Math.min(b/c,_/m,1)},o4=(o,c)=>{const m=Ho(c.getOr({url:""})),b=Qr({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:c.map(U=>({src:U.url})).getOr({})}}),_=Qr({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[b.asSpec()]}),x=(U,Y)=>{const se={url:Y.url};Y.zoom.each(me=>se.zoom=me),Y.cachedWidth.each(me=>se.cachedWidth=me),Y.cachedHeight.each(me=>se.cachedHeight=me),m.set(se);const fe=()=>{const{cachedWidth:me,cachedHeight:Ce,zoom:Ne}=se;if(!N(me)&&!N(Ce)){if(N(Ne)){const Ht=B5(U.element,me,Ce);se.zoom=Ht}const st=SF(Ji(U.element),Oi(U.element),me,Ce,se.zoom);_.getOpt(U).each(Ht=>{mi(Ht.element,st)})}};b.getOpt(U).each(me=>{const Ce=me.element;Y.url!==Fi(Ce,"src")&&(Kn(Ce,"src",Y.url),ma(U.element,"tox-imagepreview__loaded")),fe(),CF(Ce).then(Ne=>{U.getSystem().isConnected()&&(Ra(U.element,"tox-imagepreview__loaded"),se.cachedWidth=Ne.dom.naturalWidth,se.cachedHeight=Ne.dom.naturalHeight,fe())})})},M={};o.height.each(U=>M.height=U);const I=c.map(U=>({url:U.url,zoom:V.from(U.zoom),cachedWidth:V.from(U.cachedWidth),cachedHeight:V.from(U.cachedHeight)}));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:M,attributes:{role:"presentation"}},components:[_.asSpec()],behaviours:An([wp.self(),ev(I,()=>m.get(),x)])}},Vx=(o,c)=>{const m="tox-label",b=o.align==="center"?[`${m}--center`]:[],_=o.align==="end"?[`${m}--end`]:[],x={dom:{tag:"label",classes:[m,...b,..._]},components:[Ri(c.providers.translate(o.label))]},M=We(o.items,c.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[x,...M],behaviours:An([wp.self(),ms.config({}),O5(V.none()),Po.config({mode:"acyclic"})])}},AS=oo("toolbar.button.execute"),kF=o=>ou((c,m)=>{_x(o,c)(b=>{Ao(c,AS,{buttonApi:b}),o.onAction(b)})}),Oy=oo("common-button-display-events"),L5={[Yu()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],[Au()]:["toolbar-button-events",Oy],[Br()]:["focusing","alloy.base.behaviour",Oy]},s4=o=>no(o.element,"width",qr(o.element,"width")),EF=(o,c,m)=>gp(o,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:m},c),F5=(o,c)=>EF(o,c,[]),My=(o,c)=>EF(o,c,[ms.config({})]),xF=(o,c,m)=>({dom:{tag:"span",classes:[`${c}__select-label`]},components:[Ri(m.translate(o))],behaviours:An([ms.config({})])}),Cg=oo("update-menu-text"),Ry=oo("update-menu-icon"),r4=(o,c,m)=>{const b=Ho(F),_=o.text.map(me=>Qr(xF(me,c,m.providers))),x=o.icon.map(me=>Qr(My(me,m.providers.icons))),M=(me,Ce)=>{const Ne=Yn.getValue(me);return Qo.focus(Ne),Ao(Ne,"keydown",{raw:Ce.event.raw}),wg.close(Ne),V.some(!0)},I=o.role.fold(()=>({}),me=>({role:me})),U=o.tooltip.fold(()=>({}),me=>{const Ce=m.providers.translate(me);return{title:Ce,"aria-label":Ce}}),Y=gp("chevron-down",{tag:"div",classes:[`${c}__select-chevron`]},m.providers.icons),se=oo("common-button-display-events");return Qr(wg.sketch({...o.uid?{uid:o.uid}:{},...I,dom:{tag:"button",classes:[c,`${c}--select`].concat(We(o.classes,me=>`${c}--${me}`)),attributes:{...U}},components:pS([x.map(me=>me.asSpec()),_.map(me=>me.asSpec()),V.some(Y)]),matchWidth:!0,useMinWidth:!0,onOpen:(me,Ce,Ne)=>{o.searchable&&e5(Ne)},dropdownBehaviours:An([...o.dropdownBehaviours,vg.button(()=>o.disabled||m.providers.isDisabled()),ec(),Mx.config({}),ms.config({}),ks("dropdown-events",[qb(o,b),Gb(o,b)]),ks(se,[vi((me,Ce)=>s4(me))]),ks("menubutton-update-display-text",[en(Cg,(me,Ce)=>{_.bind(Ne=>Ne.getOpt(me)).each(Ne=>{ms.set(Ne,[Ri(m.providers.translate(Ce.event.text))])})}),en(Ry,(me,Ce)=>{x.bind(Ne=>Ne.getOpt(me)).each(Ne=>{ms.set(Ne,[My(Ce.event.icon,m.providers.icons)])})})])]),eventOrder:Jr(L5,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[Au()]:["toolbar-button-events","dropdown-events",se]}),sandboxBehaviours:An([Po.config({mode:"special",onLeft:M,onRight:M}),ks("dropdown-sandbox-events",[en(WB,(me,Ce)=>{NT(me),Ce.stop()}),en(jB,(me,Ce)=>{JR(me,Ce),Ce.stop()})])]),lazySink:m.getSink,toggleClass:`${c}--active`,parts:{menu:{...fS(!1,o.columns,o.presets),fakeFocus:o.searchable,onHighlightItem:fL,onCollapseMenu:(me,Ce,Ne)=>{Nr.getHighlighted(Ne).each(st=>{fL(me,Ne,st)})},onDehighlightItem:rZ}},getAnchorOverrides:()=>({maxHeightFunction:(me,Ce)=>{jv()(me,Ce-10)}}),fetch:me=>Bu.nu(De(o.fetch,me))})).asSpec()},Xq=o=>h(o),H5=o=>o.type==="separator",Jq=o=>ps(o,"getSubmenuItems"),AF={type:"separator"},Ux=(o,c)=>{const m=xo(o,(b,_)=>Xq(_)?_===""?b:_==="|"?b.length>0&&!H5(b[b.length-1])?b.concat([AF]):b:ps(c,_.toLowerCase())?b.concat([c[_.toLowerCase()]]):b:b.concat([_]),[]);return m.length>0&&H5(m[m.length-1])&&m.pop(),m},Qq=(o,c)=>{const m=o.getSubmenuItems(),b=DF(m,c),_=Jr(b.menus,{[o.value]:b.items}),x=Jr(b.expansions,{[o.value]:o.value});return{item:o,menus:_,expansions:x}},TF=o=>{const c=an(o,"value").getOrThunk(()=>oo("generated-menu-item"));return Jr({value:c},o)},DF=(o,c)=>{const m=Ux(h(o)?o.split(" "):o,c);return ao(m,(b,_)=>{if(Jq(_)){const x=TF(_),M=Qq(x,c);return{menus:Jr(b.menus,M.menus),items:[M.item,...b.items],expansions:Jr(b.expansions,M.expansions)}}else return{...b,items:[_,...b.items]}},{menus:{},expansions:{},items:[]})},eG=o=>o.search.fold(()=>({searchMode:"no-search"}),c=>({searchMode:"search-with-field",placeholder:c.placeholder})),tG=o=>o.search.fold(()=>({searchMode:"no-search"}),c=>({searchMode:"search-with-results"})),TS=(o,c,m,b)=>{const _=oo("primary-menu"),x=DF(o,m.shared.providers.menuItems());if(x.items.length===0)return V.none();const M=eG(b),I=hL(_,x.items,c,m,b.isHorizontalMenu,M),U=tG(b),Y=Ps(x.menus,(fe,me)=>hL(me,fe,c,m,!1,U)),se=Jr(Y,Bn(_,I));return V.from(Iw.tieredData(_,se,x.expansions))},i4=o=>!ps(o,"items"),OF="data-value",$5=(o,c,m,b)=>We(m,_=>i4(_)?{type:"togglemenuitem",text:_.text,value:_.value,active:_.value===b,onAction:()=>{Yn.setValue(o,_.value),Ao(o,Ah,{name:c}),Qo.focus(o)}}:{type:"nestedmenuitem",text:_.text,getSubmenuItems:()=>$5(o,c,_.items,b)}),Wx=(o,c)=>Js(o,m=>i4(m)?cn(m.value===c,m):Wx(m.items,c)),sv=(o,c,m)=>{const b=c.shared.providers,_=m.bind(U=>Wx(o.items,U)).orThunk(()=>ds(o.items).filter(i4)),x=o.label.map(U=>Xb(U,b)),M=ei.parts.field({dom:{},factory:{sketch:U=>r4({uid:U.uid,text:_.map(Y=>Y.text),icon:V.none(),tooltip:o.label,role:V.none(),fetch:(Y,se)=>{const fe=$5(Y,o.name,o.items,Yn.getValue(Y));se(TS(fe,pp.CLOSE_ON_EXECUTE,c,{isHorizontalMenu:!1,search:V.none()}))},onSetup:J(F),getApi:J({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Ga.config({}),ev(_.map(Y=>Y.value),Y=>Fi(Y.element,OF),(Y,se)=>{Wx(o.items,se).each(fe=>{Kn(Y.element,OF,fe.value),Ao(Y,Cg,{text:fe.text})})})]},"tox-listbox",c.shared)}}),I={dom:{tag:"div",classes:["tox-listboxfield"]},components:[M]};return ei.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Et([x.toArray(),[I]]),fieldBehaviours:An([Ko.config({disabled:J(!o.enabled),onDisabled:U=>{ei.getField(U).each(Ko.disable)},onEnabled:U=>{ei.getField(U).each(Ko.enable)}})])})},z5=(o,c)=>({dom:{tag:"div",classes:o.classes},components:We(o.items,c.shared.interpreter)}),MF=(o,c)=>{const m=We(o.options,_=>({dom:{tag:"option",value:_.value,innerHtml:_.text}})),b=o.data.map(_=>Bn("initialValue",_)).getOr({});return{uid:o.uid,dom:{tag:"select",classes:o.selectClasses,attributes:o.selectAttributes},components:m,behaviours:Ql(o.selectBehaviours,[Qo.config({}),Yn.config({store:{mode:"manual",getValue:_=>Na(_.element),setValue:(_,x)=>{const M=ds(o.options);Ct(o.options,U=>U.value===x).isSome()?Sa(_.element,x):_.element.dom.selectedIndex===-1&&x===""&&M.each(U=>Sa(_.element,U.value))},...b}})])}},RF=Vc({name:"HtmlSelect",configFields:[Qt("options"),$l("selectBehaviours",[Qo,Yn]),St("selectClasses",[]),St("selectAttributes",{}),kr("data")],factory:MF}),V5=(o,c,m)=>{const b=We(o.items,U=>({text:c.translate(U.text),value:U.value})),_=o.label.map(U=>Xb(U,c)),x=ei.parts.field({dom:{},...m.map(U=>({data:U})).getOr({}),selectAttributes:{size:o.size},options:b,factory:RF,selectBehaviours:An([Ko.config({disabled:()=>!o.enabled||c.isDisabled()}),Ga.config({}),ks("selectbox-change",[en(Wg(),(U,Y)=>{Ao(U,Ah,{name:o.name})})])])}),M=o.size>1?V.none():V.some(gp("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},c.icons)),I={dom:{tag:"div",classes:["tox-selectfield"]},components:Et([[x],M.toArray()])};return ei.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Et([_.toArray(),[I]]),fieldBehaviours:An([Ko.config({disabled:()=>!o.enabled||c.isDisabled(),onDisabled:U=>{ei.getField(U).each(Ko.disable)},onEnabled:U=>{ei.getField(U).each(Ko.enable)}}),ec()])})},NF=J([St("field1Name","field1"),St("field2Name","field2"),rg("onLockedChange"),nf(["lockClass"]),St("locked",!1),fm.field("coupledFieldBehaviours",[sr,Yn])]),a4=(o,c,m)=>Ai(o,c,m).bind(sr.getCurrent),U5=(o,c)=>zc({factory:ei,name:o,overrides:m=>({fieldBehaviours:An([ks("coupled-input-behaviour",[en(Gh(),b=>{a4(b,m,c).each(_=>{Ai(b,m,"lock").each(x=>{Ms.isOn(x)&&m.onLockedChange(b,_,x)})})})])])})}),PF=J([U5("field1","field2"),U5("field2","field1"),zc({factory:Uc,schema:[Qt("dom")],name:"lock",overrides:o=>({buttonBehaviours:An([Ms.config({selected:o.locked,toggleClass:o.markers.lockClass,aria:{mode:"pressed"}})])})})]),nG=(o,c,m,b)=>({uid:o.uid,dom:o.dom,components:c,behaviours:fm.augment(o.coupledFieldBehaviours,[sr.config({find:V.some}),Yn.config({store:{mode:"manual",getValue:_=>{const x=VE(_,o,["field1","field2"]);return{[o.field1Name]:Yn.getValue(x.field1()),[o.field2Name]:Yn.getValue(x.field2())}},setValue:(_,x)=>{const M=VE(_,o,["field1","field2"]);Ii(x,o.field1Name)&&Yn.setValue(M.field1(),x[o.field1Name]),Ii(x,o.field2Name)&&Yn.setValue(M.field2(),x[o.field2Name])}}})]),apis:{getField1:_=>Ai(_,o,"field1"),getField2:_=>Ai(_,o,"field2"),getLock:_=>Ai(_,o,"lock")}}),vm=fu({name:"FormCoupledInputs",configFields:NF(),partFields:PF(),factory:nG,apis:{getField1:(o,c)=>o.getField1(c),getField2:(o,c)=>o.getField2(c),getLock:(o,c)=>o.getLock(c)}}),oG=o=>{const c={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},m=_=>_ in c?c[_]:1;let b=o.value.toFixed(m(o.unit));return b.indexOf(".")!==-1&&(b=b.replace(/\.?0*$/,"")),b+o.unit},W5=o=>{const m=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(o);if(m!==null){const b=parseFloat(m[1]),_=m[2];return wn.value({value:b,unit:_})}else return wn.error(o)},IF=(o,c)=>{const m={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},b=_=>ps(m,_);return o.unit===c?V.some(o.value):b(o.unit)&&b(c)?m[o.unit]===m[c]?V.some(o.value):V.some(o.value/m[o.unit]*m[c]):V.none()},l4=o=>V.none(),BF=(o,c)=>m=>IF(m,c).map(b=>({value:b*o,unit:c})),sG=(o,c)=>{const m=W5(o).toOptional(),b=W5(c).toOptional();return Wn(m,b,(_,x)=>IF(_,x.unit).map(M=>x.value/M).map(M=>BF(M,x.unit)).getOr(l4)).getOr(l4)},rG=(o,c)=>{let m=l4;const b=oo("ratio-event"),_=fe=>gp(fe,{tag:"span",classes:["tox-icon","tox-lock-icon__"+fe]},c.icons),x=vm.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:c.translate(o.label.getOr("Constrain proportions"))}},components:[_("lock"),_("unlock")],buttonBehaviours:An([Ko.config({disabled:()=>!o.enabled||c.isDisabled()}),ec(),Ga.config({})])}),M=fe=>({dom:{tag:"div",classes:["tox-form__group"]},components:fe}),I=fe=>ei.parts.field({factory:Hw,inputClasses:["tox-textfield"],inputBehaviours:An([Ko.config({disabled:()=>!o.enabled||c.isDisabled()}),ec(),Ga.config({}),ks("size-input-events",[en(Gi(),(me,Ce)=>{Ao(me,b,{isField1:fe})}),en(Wg(),(me,Ce)=>{Ao(me,Ah,{name:o.name})})])]),selectOnFocus:!1}),U=fe=>({dom:{tag:"label",classes:["tox-label"]},components:[Ri(c.translate(fe))]}),Y=vm.parts.field1(M([ei.parts.label(U("Width")),I(!0)])),se=vm.parts.field2(M([ei.parts.label(U("Height")),I(!1)]));return vm.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[Y,se,M([U(TC),x])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(fe,me,Ce)=>{W5(Yn.getValue(fe)).each(Ne=>{m(Ne).each(st=>{Yn.setValue(me,oG(st))})})},coupledFieldBehaviours:An([Ko.config({disabled:()=>!o.enabled||c.isDisabled(),onDisabled:fe=>{vm.getField1(fe).bind(ei.getField).each(Ko.disable),vm.getField2(fe).bind(ei.getField).each(Ko.disable),vm.getLock(fe).each(Ko.disable)},onEnabled:fe=>{vm.getField1(fe).bind(ei.getField).each(Ko.enable),vm.getField2(fe).bind(ei.getField).each(Ko.enable),vm.getLock(fe).each(Ko.enable)}}),ec(),ks("size-input-events2",[en(b,(fe,me)=>{const Ce=me.event.isField1,Ne=Ce?vm.getField1(fe):vm.getField2(fe),st=Ce?vm.getField2(fe):vm.getField1(fe),Ht=Ne.map(Yn.getValue).getOr(""),ut=st.map(Yn.getValue).getOr("");m=sG(Ht,ut)})])])})},iG=(o,c,m)=>{const b=yp.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Ri(c.translate(o.label))]}),_=yp.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),x=yp.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return yp.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o.min,maxX:o.max,getInitialValue:J(m.getOrThunk(()=>(Math.abs(o.max)-Math.abs(o.min))/2))},components:[b,_,x],sliderBehaviours:An([wp.self(),Qo.config({})]),onChoose:(M,I,U)=>{Ao(M,Ah,{name:o.name,value:U})}})},c4=(o,c)=>{const m=I=>({dom:{tag:"th",innerHtml:c.translate(I)}}),b=I=>({dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:We(I,m)}]}),_=I=>({dom:{tag:"td",innerHtml:c.translate(I)}}),x=I=>({dom:{tag:"tr"},components:We(I,_)}),M=I=>({dom:{tag:"tbody"},components:We(I,x)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[b(o.header),M(o.cells)],behaviours:An([Ga.config({}),Qo.config({})])}},LF=(o,c)=>{const m=o.label.map(Ce=>Xb(Ce,c)),b=[Ko.config({disabled:()=>o.disabled||c.isDisabled()}),ec(),Po.config({mode:"execution",useEnter:o.multiline!==!0,useControlEnter:o.multiline===!0,execute:Ce=>(nr(Ce,CS),V.some(!0))}),ks("textfield-change",[en(Gh(),(Ce,Ne)=>{Ao(Ce,Ah,{name:o.name})}),en(Gm(),(Ce,Ne)=>{Ao(Ce,Ah,{name:o.name})})]),Ga.config({})],_=o.validation.map(Ce=>d1.config({getRoot:Ne=>bc(Ne.element),invalidClass:"tox-invalid",validator:{validate:Ne=>{const st=Yn.getValue(Ne),Ht=Ce.validator(st);return Bu.pure(Ht===!0?wn.value(st):wn.error(Ht))},validateOnLoad:Ce.validateOnLoad}})).toArray(),x=o.placeholder.fold(J({}),Ce=>({placeholder:c.translate(Ce)})),M=o.inputMode.fold(J({}),Ce=>({inputmode:Ce})),I={...x,...M},U=ei.parts.field({tag:o.multiline===!0?"textarea":"input",...o.data.map(Ce=>({data:Ce})).getOr({}),inputAttributes:I,inputClasses:[o.classname],inputBehaviours:An(Et([b,_])),selectOnFocus:!1,factory:Hw}),Y=o.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[U]}:U,fe=(o.flex?["tox-form__group--stretched"]:[]).concat(o.maximized?["tox-form-group--maximize"]:[]),me=[Ko.config({disabled:()=>o.disabled||c.isDisabled(),onDisabled:Ce=>{ei.getField(Ce).each(Ko.disable)},onEnabled:Ce=>{ei.getField(Ce).each(Ko.enable)}}),ec()];return Dx(m,Y,fe,me)},aG=(o,c,m)=>LF({name:o.name,multiline:!1,label:o.label,inputMode:o.inputMode,placeholder:o.placeholder,flex:!1,disabled:!o.enabled,classname:"tox-textfield",validation:V.none(),maximized:o.maximized,data:m},c),FF=(o,c,m)=>LF({name:o.name,multiline:!0,label:o.label,inputMode:V.none(),placeholder:o.placeholder,flex:!0,disabled:!o.enabled,classname:"tox-textarea",validation:V.none(),maximized:o.maximized,data:m},c),DS=(o,c)=>c.getAnimationRoot.fold(()=>o.element,m=>m(o)),rv=o=>o.dimension.property,t_=(o,c)=>o.dimension.getDimension(c),OS=(o,c)=>{const m=DS(o,c);Fc(m,[c.shrinkingClass,c.growingClass])},j5=(o,c)=>{ma(o.element,c.openClass),Ra(o.element,c.closedClass),no(o.element,rv(c),"0px"),Kc(o.element)},u4=(o,c)=>{ma(o.element,c.closedClass),Ra(o.element,c.openClass),Ss(o.element,rv(c))},HF=(o,c,m,b)=>{m.setCollapsed(),no(o.element,rv(c),t_(c,o.element)),OS(o,c),j5(o,c),c.onStartShrink(o),c.onShrunk(o)},lG=(o,c,m,b)=>{const _=b.getOrThunk(()=>t_(c,o.element));m.setCollapsed(),no(o.element,rv(c),_),Kc(o.element);const x=DS(o,c);ma(x,c.growingClass),Ra(x,c.shrinkingClass),j5(o,c),c.onStartShrink(o)},$F=(o,c,m)=>{const b=t_(c,o.element);(b==="0px"?HF:lG)(o,c,m,V.some(b))},Z5=(o,c,m)=>{const b=DS(o,c),_=Qu(b,c.shrinkingClass),x=t_(c,o.element);u4(o,c);const M=t_(c,o.element);(_?()=>{no(o.element,rv(c),x),Kc(o.element)}:()=>{j5(o,c)})(),ma(b,c.shrinkingClass),Ra(b,c.growingClass),u4(o,c),no(o.element,rv(c),M),m.setExpanded(),c.onStartGrow(o)},zF=(o,c,m)=>{if(m.isExpanded()){Ss(o.element,rv(c));const b=t_(c,o.element);no(o.element,rv(c),b)}},cG=(o,c,m)=>{m.isExpanded()||Z5(o,c,m)},uG=(o,c,m)=>{m.isExpanded()&&$F(o,c,m)},fG=(o,c,m)=>{m.isExpanded()&&HF(o,c,m)},dG=(o,c,m)=>m.isExpanded(),VF=(o,c,m)=>m.isCollapsed(),UF=(o,c,m)=>{const b=DS(o,c);return Qu(b,c.growingClass)===!0},q5=(o,c,m)=>{const b=DS(o,c);return Qu(b,c.shrinkingClass)===!0};var hG=Object.freeze({__proto__:null,refresh:zF,grow:cG,shrink:uG,immediateShrink:fG,hasGrown:dG,hasShrunk:VF,isGrowing:UF,isShrinking:q5,isTransitioning:(o,c,m)=>UF(o,c)||q5(o,c),toggleGrow:(o,c,m)=>{(m.isExpanded()?$F:Z5)(o,c,m)},disableTransitions:OS,immediateGrow:(o,c,m)=>{m.isExpanded()||(u4(o,c),no(o.element,rv(c),t_(c,o.element)),OS(o,c),m.setExpanded(),c.onStartGrow(o),c.onGrown(o))}}),mG=Object.freeze({__proto__:null,exhibit:(o,c,m)=>{const b=c.expanded;return Lc(b?{classes:[c.openClass],styles:{}}:{classes:[c.closedClass],styles:Bn(c.dimension.property,"0px")})},events:(o,c)=>ri([eg(jg(),(m,b)=>{b.event.raw.propertyName===o.dimension.property&&(OS(m,o),c.isExpanded()&&Ss(m.element,o.dimension.property),(c.isExpanded()?o.onGrown:o.onShrunk)(m))})])}),gG=[Qt("closedClass"),Qt("openClass"),Qt("shrinkingClass"),Qt("growingClass"),kr("getAnimationRoot"),Gs("onShrunk"),Gs("onStartShrink"),Gs("onGrown"),Gs("onStartGrow"),St("expanded",!1),Gr("dimension",Cl("property",{width:[Vi("property","width"),Vi("getDimension",o=>Ji(o)+"px")],height:[Vi("property","height"),Vi("getDimension",o=>Oi(o)+"px")]}))],G5=Object.freeze({__proto__:null,init:o=>{const c=Ho(o.expanded),m=()=>"expanded: "+c.get();return su({isExpanded:()=>c.get()===!0,isCollapsed:()=>c.get()===!1,setCollapsed:De(c.set,!1),setExpanded:De(c.set,!0),readState:m})}});const Th=Xl({fields:gG,name:"sliding",active:mG,apis:hG,state:G5}),WF=o=>({isEnabled:()=>!Ko.isDisabled(o),setEnabled:c=>Ko.set(o,!c),setActive:c=>{const m=o.element;c?(Ra(m,"tox-tbtn--enabled"),Kn(m,"aria-pressed",!0)):(ma(m,"tox-tbtn--enabled"),je(m,"aria-pressed"))},isActive:()=>Qu(o.element,"tox-tbtn--enabled"),setText:c=>{Ao(o,Cg,{text:c})},setIcon:c=>Ao(o,Ry,{icon:c})}),jx=(o,c,m,b,_=!0)=>r4({text:o.text,icon:o.icon,tooltip:o.tooltip,searchable:o.search.isSome(),role:b,fetch:(x,M)=>{const I={pattern:o.search.isSome()?t5(x):""};o.fetch(U=>{M(TS(U,pp.CLOSE_ON_EXECUTE,m,{isHorizontalMenu:!1,search:o.search}))},I,WF(x))},onSetup:o.onSetup,getApi:WF,columns:1,presets:"normal",classes:[],dropdownBehaviours:[..._?[Ga.config({})]:[]]},c,m.shared),Zx=(o,c,m)=>{const b=x=>M=>{const I=!M.isActive();M.setActive(I),x.storage.set(I),m.shared.getSink().each(U=>{c().getOpt(U).each(Y=>{sf(Y.element),Ao(Y,k0,{name:x.name,value:x.storage.get()})})})},_=x=>M=>{M.setActive(x.storage.get())};return x=>{x(We(o,M=>{const I=M.text.fold(()=>({}),U=>({text:U}));return{type:M.type,active:!1,...I,onAction:b(M),onSetup:_(M)}}))}},f4=o=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{title:o,"aria-label":o}},components:[Ri(o)]}),jF=oo("leaf-label-event-id"),K5=({leaf:o,onLeafAction:c,visible:m,treeId:b,selectedId:_,backstage:x})=>{const M=o.menu.map(U=>jx(U,"tox-mbtn",x,V.none(),m)),I=[f4(o.title)];return M.each(U=>I.push(U)),Uc.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(m?["tox-tree--leaf__label--visible"]:[])},components:I,role:"treeitem",action:U=>{c(o.id),U.getSystem().broadcastOn([`update-active-item-${b}`],{value:o.id})},eventOrder:{[xf()]:[jF,"keying"]},buttonBehaviours:An([...m?[Ga.config({})]:[],Ms.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Cc.config({channels:{[`update-active-item-${b}`]:{onReceive:(U,Y)=>{(Y.value===o.id?Ms.on:Ms.off)(U)}}}}),ks(jF,[vi((U,Y)=>{_.each(se=>{(se===o.id?Ms.on:Ms.off)(U)})}),en(xf(),(U,Y)=>{const se=Y.event.raw.code==="ArrowLeft",fe=Y.event.raw.code==="ArrowRight";se?(og(U.element,".tox-tree--directory").each(me=>{U.getSystem().getByDom(me).each(Ce=>{Pv(me,".tox-tree--directory__label").each(Ne=>{Ce.getSystem().getByDom(Ne).each(Qo.focus)})})}),Y.stop()):fe&&Y.stop()})])])})},Y5=(o,c,m)=>gp(o,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"],behaviours:m},c),pG=(o,c)=>Y5(o,c,[]),d4=oo("directory-label-event-id"),ZF=({directory:o,visible:c,noChildren:m,backstage:b})=>{const _=o.menu.map(I=>jx(I,"tox-mbtn",b,V.none())),x=[{dom:{tag:"div",classes:["tox-chevron"]},components:[pG("chevron-right",b.shared.providers.icons)]},f4(o.title)];_.each(I=>{x.push(I)});const M=I=>{og(I.element,".tox-tree--directory").each(U=>{I.getSystem().getByDom(U).each(Y=>{const se=!Ms.isOn(Y);Ms.toggle(Y),Ao(I,"expand-tree-node",{expanded:se,node:o.id})})})};return Uc.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(c?["tox-tree--directory__label--visible"]:[])},components:x,action:M,eventOrder:{[xf()]:[d4,"keying"]},buttonBehaviours:An([...c?[Ga.config({})]:[],ks(d4,[en(xf(),(I,U)=>{const Y=U.event.raw.code==="ArrowRight",se=U.event.raw.code==="ArrowLeft";Y&&m&&U.stop(),(Y||se)&&og(I.element,".tox-tree--directory").each(fe=>{I.getSystem().getByDom(fe).each(me=>{!Ms.isOn(me)&&Y||Ms.isOn(me)&&se?(M(I),U.stop()):se&&!Ms.isOn(me)&&(og(me.element,".tox-tree--directory").each(Ce=>{Pv(Ce,".tox-tree--directory__label").each(Ne=>{me.getSystem().getByDom(Ne).each(Qo.focus)})}),U.stop())})})})])])})},bG=({children:o,onLeafAction:c,visible:m,treeId:b,expandedIds:_,selectedId:x,backstage:M})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:o.map(I=>I.type==="leaf"?K5({leaf:I,selectedId:x,onLeafAction:c,visible:m,treeId:b,backstage:M}):h4({directory:I,expandedIds:_,selectedId:x,onLeafAction:c,labelTabstopping:m,treeId:b,backstage:M})),behaviours:An([Th.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:m}),ms.config({})])}),vG=oo("directory-event-id"),h4=({directory:o,onLeafAction:c,labelTabstopping:m,treeId:b,backstage:_,expandedIds:x,selectedId:M})=>{const{children:I}=o,U=Ho(x),Y=fe=>I.map(me=>me.type==="leaf"?K5({leaf:me,selectedId:M,onLeafAction:c,visible:fe,treeId:b,backstage:_}):h4({directory:me,expandedIds:U.get(),selectedId:M,onLeafAction:c,labelTabstopping:fe,treeId:b,backstage:_})),se=x.includes(o.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[ZF({directory:o,visible:m,noChildren:o.children.length===0,backstage:_}),bG({children:I,expandedIds:x,selectedId:M,onLeafAction:c,visible:se,treeId:b,backstage:_})],behaviours:An([ks(vG,[vi((fe,me)=>{Ms.set(fe,se)}),en("expand-tree-node",(fe,me)=>{const{expanded:Ce,node:Ne}=me.event;U.set(Ce?[...U.get(),Ne]:U.get().filter(st=>st!==Ne))})]),Ms.config({...o.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(fe,me)=>{const Ce=fe.components()[1],Ne=Y(me);me?Th.grow(Ce):Th.shrink(Ce),ms.set(Ce,Ne)}})])}},qF=oo("tree-event-id"),yG=(o,c)=>{const m=o.onLeafAction.getOr(F),b=o.onToggleExpand.getOr(F),_=o.defaultExpandedIds,x=Ho(_),M=Ho(o.defaultSelectedId),I=oo("tree-id"),U=(Y,se)=>o.items.map(fe=>fe.type==="leaf"?K5({leaf:fe,selectedId:Y,onLeafAction:m,visible:!0,treeId:I,backstage:c}):h4({directory:fe,selectedId:Y,onLeafAction:m,expandedIds:se,labelTabstopping:!0,treeId:I,backstage:c}));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:U(M.get(),x.get()),behaviours:An([Po.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),ks(qF,[en("expand-tree-node",(Y,se)=>{const{expanded:fe,node:me}=se.event;x.set(fe?[...x.get(),me]:x.get().filter(Ce=>Ce!==me)),b(x.get(),{expanded:fe,node:me})})]),Cc.config({channels:{[`update-active-item-${I}`]:{onReceive:(Y,se)=>{M.set(V.some(se.value)),ms.set(Y,U(V.some(se.value),x.get()))}}}}),ms.config({})])}};var GF=Object.freeze({__proto__:null,events:(o,c)=>{const b=o.stream.streams.setup(o,c);return ri([en(o.event,b),Dd(()=>c.cancel())].concat(o.cancelEvent.map(_=>[en(_,()=>c.cancel())]).getOr([])))}});const KF=o=>{const c=Ho(null);return su({readState:()=>({timer:c.get()!==null?"set":"unset"}),setTimer:x=>{c.set(x)},cancel:()=>{const x=c.get();x!==null&&x.cancel()}})};var YF=Object.freeze({__proto__:null,throttle:KF,init:o=>o.stream.streams.state(o)});const XF=(o,c)=>{const m=o.stream,b=uf(o.onStream,m.delay);return c.setTimer(b),(_,x)=>{b.throttle(_,x),m.stopEvent&&x.stop()}};var CG=[Gr("stream",Cl("mode",{throttle:[Qt("delay"),St("stopEvent",!0),Vi("streams",{setup:XF,state:KF})]})),St("event","input"),kr("cancelEvent"),rg("onStream")];const X5=Xl({fields:CG,name:"streaming",active:GF,state:YF}),m4=(o,c,m)=>{const b=Yn.getValue(m);Yn.setValue(c,b),JF(c)},J5=(o,c)=>{const m=o.element,b=Na(m),_=m.dom;Fi(m,"type")!=="number"&&c(_,b)},JF=o=>{J5(o,(c,m)=>c.setSelectionRange(m.length,m.length))},QF=(o,c)=>{J5(o,(m,b)=>m.setSelectionRange(c,b.length))},SG=(o,c,m)=>{if(o.selectsOver){const b=Yn.getValue(c),_=o.getDisplayText(b),x=Yn.getValue(m);return o.getDisplayText(x).indexOf(_)===0?V.some(()=>{m4(o,c,m),QF(c,_.length)}):V.none()}else return V.none()},Q5=J("alloy.typeahead.itemexecute"),eN=(o,c,m,b)=>{const _=(fe,me,Ce)=>{o.previewing.set(!1);const Ne=rl.getCoupled(fe,"sandbox");if(Ks.isOpen(Ne))sr.getCurrent(Ne).each(st=>{Nr.getHighlighted(st).fold(()=>{Ce(st)},()=>{Ev(Ne,st.element,"keydown",me)})});else{const st=Ht=>{sr.getCurrent(Ht).each(Ce)};Ax(o,M(fe),fe,Ne,b,st,sd.HighlightMenuAndItem).get(F)}},x=UB(o),M=fe=>me=>me.map(Ce=>{const Ne=va(Ce.menus),st=Pe(Ne,ut=>ho(ut.items,lt=>lt.type==="item"));return Yn.getState(fe).update(We(st,ut=>ut.data)),Ce}),I=fe=>sr.getCurrent(fe),U="typeaheadevents",Y=[Qo.config({}),Yn.config({onSetValue:o.onSetValue,store:{mode:"dataset",getDataKey:fe=>Na(fe.element),getFallbackEntry:fe=>({value:fe,meta:{}}),setValue:(fe,me)=>{Sa(fe.element,o.model.getDisplayText(me))},...o.initialData.map(fe=>Bn("initialValue",fe)).getOr({})}}),X5.config({stream:{mode:"throttle",delay:o.responseTime,stopEvent:!1},onStream:(fe,me)=>{const Ce=rl.getCoupled(fe,"sandbox");if(Qo.isFocused(fe)&&Na(fe.element).length>=o.minChars){const st=I(Ce).bind(ut=>Nr.getHighlighted(ut).map(Yn.getValue));o.previewing.set(!0);const Ht=ut=>{I(Ce).each(lt=>{st.fold(()=>{o.model.selectsOver&&Nr.highlightFirst(lt)},Zt=>{Nr.highlightBy(lt,Dt=>Yn.getValue(Dt).value===Zt.value),Nr.getHighlighted(lt).orThunk(()=>(Nr.highlightFirst(lt),V.none()))})})};Ax(o,M(fe),fe,Ce,b,Ht,sd.HighlightJustMenu).get(F)}},cancelEvent:Zg()}),Po.config({mode:"special",onDown:(fe,me)=>(_(fe,me,Nr.highlightFirst),V.some(!0)),onEscape:fe=>{const me=rl.getCoupled(fe,"sandbox");return Ks.isOpen(me)?(Ks.close(me),V.some(!0)):V.none()},onUp:(fe,me)=>(_(fe,me,Nr.highlightLast),V.some(!0)),onEnter:fe=>{const me=rl.getCoupled(fe,"sandbox"),Ce=Ks.isOpen(me);if(Ce&&!o.previewing.get())return I(me).bind(Ne=>Nr.getHighlighted(Ne)).map(Ne=>(Ao(fe,Q5(),{item:Ne}),!0));{const Ne=Yn.getValue(fe);return nr(fe,Zg()),o.onExecute(me,fe,Ne),Ce&&Ks.close(me),V.some(!0)}}}),Ms.config({toggleClass:o.markers.openClass,aria:{mode:"expanded"}}),rl.config({others:{sandbox:fe=>YR(o,fe,{onOpen:()=>Ms.on(fe),onClose:()=>{o.lazyTypeaheadComp.get().each(me=>je(me.element,"aria-activedescendant")),Ms.off(fe)}})}}),ks(U,[vi(fe=>{o.lazyTypeaheadComp.set(V.some(fe))}),Dd(fe=>{o.lazyTypeaheadComp.set(V.none())}),ou(fe=>{const me=F;KR(o,M(fe),fe,b,me,sd.HighlightMenuAndItem).get(F)}),en(Q5(),(fe,me)=>{const Ce=rl.getCoupled(fe,"sandbox");m4(o.model,fe,me.event.item),nr(fe,Zg()),o.onItemExecute(fe,Ce,me.event.item,Yn.getValue(fe)),Ks.close(Ce),JF(fe)})].concat(o.dismissOnBlur?[en(qm(),fe=>{const me=rl.getCoupled(fe,"sandbox");nl(me.element).isNone()&&Ks.close(me)})]:[]))],se={[xd()]:[Yn.name(),X5.name(),U],...o.eventOrder};return{uid:o.uid,dom:YM(Jr(o,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...x,...Ql(o.typeaheadBehaviours,Y)},eventOrder:se}},kG=J([kr("lazySink"),Qt("fetch"),St("minChars",5),St("responseTime",1e3),Gs("onOpen"),St("getHotspot",V.some),St("getAnchorOverrides",J({})),St("layouts",V.none()),St("eventOrder",{}),eb("model",{},[St("getDisplayText",o=>o.meta!==void 0&&o.meta.text!==void 0?o.meta.text:o.value),St("selectsOver",!0),St("populateFromBrowse",!0)]),Gs("onSetValue"),iu("onExecute"),Gs("onItemExecute"),St("inputClasses",[]),St("inputAttributes",{}),St("inputStyles",{}),St("matchWidth",!0),St("useMinWidth",!1),St("dismissOnBlur",!0),nf(["openClass"]),kr("initialData"),$l("typeaheadBehaviours",[Qo,Yn,X5,Po,Ms,rl]),_a("lazyTypeaheadComp",()=>Ho(V.none)),_a("previewing",()=>Ho(!0))].concat(VB()).concat(XR())),EG=J([Sh({schema:[Iv()],name:"menu",overrides:o=>({fakeFocus:!0,onHighlightItem:(c,m,b)=>{o.previewing.get()?o.lazyTypeaheadComp.get().each(_=>{SG(o.model,_,b).fold(()=>{o.model.selectsOver?(Nr.dehighlight(m,b),o.previewing.set(!0)):o.previewing.set(!1)},x=>{x(),o.previewing.set(!1)})}):o.lazyTypeaheadComp.get().each(_=>{o.model.populateFromBrowse&&m4(o.model,_,b),de(b.element,"id").each(x=>Kn(_.element,"aria-activedescendant",x))})},onExecute:(c,m)=>o.lazyTypeaheadComp.get().map(b=>(Ao(b,Q5(),{item:m}),!0)),onHover:(c,m)=>{o.previewing.set(!1),o.lazyTypeaheadComp.get().each(b=>{o.model.populateFromBrowse&&m4(o.model,b,m)})}})})]),xG=fu({name:"Typeahead",configFields:kG(),partFields:EG(),factory:eN}),Sg=o=>({...o,toCached:()=>Sg(o.toCached()),bindFuture:U=>Sg(o.bind(Y=>Y.fold(se=>Bu.pure(wn.error(se)),se=>U(se)))),bindResult:U=>Sg(o.map(Y=>Y.bind(U))),mapResult:U=>Sg(o.map(Y=>Y.map(U))),mapError:U=>Sg(o.map(Y=>Y.mapError(U))),foldResult:(U,Y)=>o.map(se=>se.fold(U,Y)),withTimeout:(U,Y)=>Sg(Bu.nu(se=>{let fe=!1;const me=setTimeout(()=>{fe=!0,se(wn.error(Y()))},U);o.get(Ce=>{fe||(clearTimeout(me),se(Ce))})}))}),e7=o=>Sg(Bu.nu(o)),tN=o=>Sg(Bu.pure(wn.value(o))),TG={nu:e7,wrap:Sg,pure:tN,value:tN,error:o=>Sg(Bu.pure(wn.error(o))),fromResult:o=>Sg(Bu.pure(o)),fromFuture:o=>Sg(o.map(wn.value)),fromPromise:o=>e7(c=>{o.then(m=>{c(wn.value(m))},m=>{c(wn.error(m))})})},g4=(o,c,m=[],b,_,x)=>{const M=c.fold(()=>({}),Y=>({action:Y})),I={buttonBehaviours:An([vg.button(()=>!o.enabled||x.isDisabled()),ec(),Ga.config({}),ks("button press",[g2("click"),g2("mousedown")])].concat(m)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...M},U=Jr(I,{dom:b});return Jr(U,{components:_})},t7=(o,c,m,b=[])=>{const _=o.tooltip.map(U=>({"aria-label":m.translate(U),title:m.translate(U)})).getOr({}),x={tag:"button",classes:["tox-tbtn"],attributes:_},M=o.icon.map(U=>F5(U,m.icons)),I=pS([M]);return g4(o,c,b,x,I,m)},nN=o=>{switch(o){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];case"secondary":default:return["tox-button","tox-button--secondary"]}},n7=(o,c,m,b=[],_=[])=>{const x=m.translate(o.text),M=o.icon.map(me=>F5(me,m.icons)),I=[M.getOrThunk(()=>Ri(x))],U=o.buttonType.getOr(!o.primary&&!o.borderless?"secondary":"primary"),fe={tag:"button",classes:[...nN(U),...M.isSome()?["tox-button--icon"]:[],...o.borderless?["tox-button--naked"]:[],..._],attributes:{title:x}};return g4(o,c,b,fe,I,m)},oN=(o,c,m,b=[],_=[])=>{const x=n7(o,V.some(c),m,b,_);return Uc.sketch(x)},o7=(o,c)=>m=>{c==="custom"?Ao(m,k0,{name:o,value:{}}):c==="submit"?nr(m,CS):c==="cancel"?nr(m,Ey):console.error("Unknown button type: ",c)},DG=(o,c)=>c==="menu",OG=(o,c)=>c==="custom"||c==="cancel"||c==="submit",s7=(o,c)=>c==="togglebutton",MG=(o,c)=>{var m,b;const _=o.icon.map(lt=>My(lt,c.icons)).map(Qr),x=lt=>{Ao(lt,k0,{name:o.name,value:{setIcon:Zt=>{_.map(Dt=>Dt.getOpt(lt).each(kn=>{ms.set(kn,[My(Zt,c.icons)])}))}}})},M=o.buttonType.getOr(o.primary?"primary":"secondary"),I={...o,name:(m=o.name)!==null&&m!==void 0?m:"",primary:M==="primary",tooltip:V.from(o.tooltip),enabled:(b=o.enabled)!==null&&b!==void 0?b:!1,borderless:!1},U=I.tooltip.map(lt=>({"aria-label":c.translate(lt),title:c.translate(lt)})).getOr({}),Y=nN(M!=null?M:"secondary"),se=o.icon.isSome()&&o.text.isSome(),fe={tag:"button",classes:[...Y.concat(o.icon.isSome()?["tox-button--icon"]:[]),...o.active?["tox-button--enabled"]:[],...se?["tox-button--icon-and-text"]:[]],attributes:U},me=[],Ce=c.translate(o.text.getOr("")),Ne=Ri(Ce),Ht=[...pS([_.map(lt=>lt.asSpec())]),...o.text.isSome()?[Ne]:[]],ut=g4(I,V.some(x),me,fe,Ht,c);return Uc.sketch(ut)},p4=(o,c,m)=>{if(DG(o,c)){const b=()=>M,_=o,x={...o,type:"menubutton",search:V.none(),onSetup:I=>(I.setEnabled(o.enabled),F),fetch:Zx(_.items,b,m)},M=Qr(jx(x,"tox-tbtn",m,V.none()));return M.asSpec()}else if(OG(o,c)){const b=o7(o.name,c),_={...o,borderless:!1};return oN(_,b,m.shared.providers,[])}else{if(s7(o,c))return MG(o,m.shared.providers);throw console.error("Unknown footer button type: ",c),new Error("Unknown footer button type")}},RG=(o,c)=>{const m=o7(o.name,"custom");return kL(V.none(),ei.parts.field({factory:Uc,...n7(o,V.some(m),c,[tv(""),wp.self()])}))},r7={type:"separator"},i7=o=>({type:"menuitem",value:o.url,text:o.title,meta:{attach:o.attach},onAction:F}),b4=(o,c)=>({type:"menuitem",value:c,text:o,meta:{attach:void 0},onAction:F}),v4=o=>We(o,i7),NG=(o,c)=>ho(c,m=>m.type===o),a7=(o,c)=>v4(NG(o,c)),PG=o=>a7("header",o.targets),IG=o=>a7("anchor",o.targets),l7=o=>V.from(o.anchorTop).map(c=>b4("<top>",c)).toArray(),BG=o=>V.from(o.anchorBottom).map(c=>b4("<bottom>",c)).toArray(),LG=o=>We(o,c=>b4(c,c)),FG=o=>xo(o,(c,m)=>c.length===0||m.length===0?c.concat(m):c.concat(r7,m),[]),y4=(o,c)=>{const m=o.toLowerCase();return ho(c,b=>{var _;const x=b.meta!==void 0&&b.meta.text!==void 0?b.meta.text:b.text,M=(_=b.value)!==null&&_!==void 0?_:"";return Vs(x.toLowerCase(),m)||Vs(M.toLowerCase(),m)})},c7=(o,c,m)=>{var b,_;const x=Yn.getValue(c),M=(_=(b=x==null?void 0:x.meta)===null||b===void 0?void 0:b.text)!==null&&_!==void 0?_:x.value;return m.getLinkInformation().fold(()=>[],U=>{const Y=y4(M,LG(m.getHistory(o)));return o==="file"?FG([Y,y4(M,PG(U)),y4(M,Et([l7(U),IG(U),BG(U)]))]):Y})},u7=oo("aria-invalid"),HG=(o,c,m,b)=>{const _=c.shared.providers,x=lt=>{const Zt=Yn.getValue(lt);m.addToHistory(Zt.value,o.filetype)},M={...b.map(lt=>({initialData:lt})).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":u7,type:"url"},minChars:0,responseTime:0,fetch:lt=>{const Zt=c7(o.filetype,lt,m),Dt=TS(Zt,pp.BUBBLE_TO_SANDBOX,c,{isHorizontalMenu:!1,search:V.none()});return Bu.pure(Dt)},getHotspot:lt=>Ne.getOpt(lt),onSetValue:(lt,Zt)=>{lt.hasConfigured(d1)&&d1.run(lt).get(F)},typeaheadBehaviours:An([...m.getValidationHandler().map(lt=>d1.config({getRoot:Zt=>bc(Zt.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(Zt,Dt)=>{se.getOpt(Zt).each(kn=>{Kn(kn.element,"title",_.translate(Dt))})}},validator:{validate:Zt=>{const Dt=Yn.getValue(Zt);return TG.nu(kn=>{lt({type:o.filetype,url:Dt.value},mn=>{if(mn.status==="invalid"){const In=wn.error(mn.message);kn(In)}else{const In=wn.value(mn.message);kn(In)}})})},validateOnLoad:!1}})).toArray(),Ko.config({disabled:()=>!o.enabled||_.isDisabled()}),Ga.config({}),ks("urlinput-events",[en(Gh(),lt=>{const Zt=Na(lt.element),Dt=Zt.trim();Dt!==Zt&&Sa(lt.element,Dt),o.filetype==="file"&&Ao(lt,Ah,{name:o.name})}),en(Wg(),lt=>{Ao(lt,Ah,{name:o.name}),x(lt)}),en(Gm(),lt=>{Ao(lt,Ah,{name:o.name}),x(lt)})])]),eventOrder:{[Gh()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:lt=>lt.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:c.shared.getSink,parts:{menu:fS(!1,1,"normal")},onExecute:(lt,Zt,Dt)=>{Ao(Zt,CS,{})},onItemExecute:(lt,Zt,Dt,kn)=>{x(lt),Ao(lt,Ah,{name:o.name})}},I=ei.parts.field({...M,factory:xG}),U=o.label.map(lt=>Xb(lt,_)),se=Qr(((lt,Zt,Dt=lt,kn=lt)=>gp(Dt,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+lt],attributes:{title:_.translate(kn),"aria-live":"polite",...Zt.fold(()=>({}),mn=>({id:mn}))}},_.icons))("invalid",V.some(u7),"warning")),fe=Qr({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[se.asSpec()]}),me=m.getUrlPicker(o.filetype),Ce=oo("browser.url.event"),Ne=Qr({dom:{tag:"div",classes:["tox-control-wrap"]},components:[I,fe.asSpec()],behaviours:An([Ko.config({disabled:()=>!o.enabled||_.isDisabled()})])}),st=Qr(oN({name:o.name,icon:V.some("browse"),text:o.label.getOr(""),enabled:o.enabled,primary:!1,buttonType:V.none(),borderless:!0},lt=>nr(lt,Ce),_,[],["tox-browse-url"])),Ht=()=>({dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Et([[Ne.asSpec()],me.map(()=>st.asSpec()).toArray()])}),ut=lt=>{sr.getCurrent(lt).each(Zt=>{const Dt=Yn.getValue(Zt),kn={fieldname:o.name,...Dt};me.each(mn=>{mn(kn).get(In=>{Yn.setValue(Zt,In),Ao(lt,Ah,{name:o.name})})})})};return ei.sketch({dom:OZ(),components:U.toArray().concat([Ht()]),fieldBehaviours:An([Ko.config({disabled:()=>!o.enabled||_.isDisabled(),onDisabled:lt=>{ei.getField(lt).each(Ko.disable),st.getOpt(lt).each(Ko.disable)},onEnabled:lt=>{ei.getField(lt).each(Ko.enable),st.getOpt(lt).each(Ko.enable)}}),ec(),ks("url-input-events",[en(Ce,ut)])])})},f7=(o,c)=>{const m=gB(o.icon,c.icons);return f1.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${o.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:o.url?void 0:m},components:o.url?[Uc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:m,attributes:{title:c.translate(o.iconTooltip)}},action:b=>Ao(b,k0,{name:"alert-banner",value:o.url}),buttonBehaviours:An([DM()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:c.translate(o.text)}}]})},$G=(o,c)=>{o.dom.checked=c},zG=o=>o.dom.checked,us=(o,c,m)=>{const b=U=>(U.element.dom.click(),V.some(!0)),_=ei.parts.field({factory:{sketch:we},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:An([wp.self(),Ko.config({disabled:()=>!o.enabled||c.isDisabled(),onDisabled:U=>{bc(U.element).each(Y=>Ra(Y,"tox-checkbox--disabled"))},onEnabled:U=>{bc(U.element).each(Y=>ma(Y,"tox-checkbox--disabled"))}}),Ga.config({}),Qo.config({}),cF(m,zG,$G),Po.config({mode:"special",onEnter:b,onSpace:b,stopSpaceKeyup:!0}),ks("checkbox-events",[en(Wg(),(U,Y)=>{Ao(U,Ah,{name:o.name})})])])}),x=ei.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Ri(c.translate(o.label))],behaviours:An([Mx.config({})])}),M=U=>gp(U==="checked"?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+U]},c.icons),I=Qr({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[M("checked"),M("unchecked")]});return ei.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[_,I.asSpec(),x],fieldBehaviours:An([Ko.config({disabled:()=>!o.enabled||c.isDisabled()}),ec()])})},qx=o=>o.presets==="presentation"?f1.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:o.html}}):f1.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:o.html,attributes:{role:"document"}},containerBehaviours:An([Ga.config({}),Qo.config({})])}),nc=o=>(c,m,b,_)=>an(m,"name").fold(()=>o(m,_,V.none()),x=>c.field(x,o(m,_,an(b,x)))),d7=o=>(c,m,b,_)=>{const x=Jr(m,{source:"dynamic"});return nc(o)(c,x,b,_)},h7={bar:nc((o,c)=>SZ(o,c.shared)),collection:nc((o,c,m)=>MZ(o,c.shared.providers,m)),alertbanner:nc((o,c)=>f7(o,c.shared.providers)),input:nc((o,c,m)=>aG(o,c.shared.providers,m)),textarea:nc((o,c,m)=>FF(o,c.shared.providers,m)),label:nc((o,c)=>Vx(o,c.shared)),iframe:d7((o,c,m)=>Yq(o,c.shared.providers,m)),button:nc((o,c)=>RG(o,c.shared.providers)),checkbox:nc((o,c,m)=>us(o,c.shared.providers,m)),colorinput:nc((o,c,m)=>FZ(o,c.shared,c.colorinput,m)),colorpicker:nc((o,c,m)=>dF(o,c.shared.providers,m)),dropzone:nc((o,c,m)=>hF(o,c.shared.providers,m)),grid:nc((o,c)=>mF(o,c.shared)),listbox:nc((o,c,m)=>sv(o,c,m)),selectbox:nc((o,c,m)=>V5(o,c.shared.providers,m)),sizeinput:nc((o,c)=>rG(o,c.shared.providers)),slider:nc((o,c,m)=>iG(o,c.shared.providers,m)),urlinput:nc((o,c,m)=>HG(o,c,c.urlinput,m)),customeditor:nc(JT),htmlpanel:nc(qx),imagepreview:nc((o,c,m)=>o4(o,m)),table:nc((o,c)=>c4(o,c.shared.providers)),tree:nc((o,c)=>yG(o,c)),panel:nc((o,c)=>z5(o,c))},m7={field:(o,c)=>c,record:J([])},sN=(o,c,m,b)=>{const _=Jr(b,{shared:{interpreter:x=>g7(o,x,m,_)}});return g7(o,c,m,_)},g7=(o,c,m,b)=>an(h7,c.type).fold(()=>(console.error(`Unknown factory type "${c.type}", defaulting to container: `,c),c),_=>_(o,c,m,b)),MS=(o,c,m)=>g7(m7,o,c,m),Ny="layout-inset",w4=o=>o.x,p7=(o,c)=>o.x+o.width/2-c.width/2,rN=(o,c)=>o.x+o.width-c.width,iN=o=>o.y,_4=(o,c)=>o.y+o.height-c.height,C4=(o,c)=>o.y+o.height/2-c.height/2,Gx=(o,c,m)=>ga(rN(o,c),_4(o,c),m.insetSouthwest(),t0(),"southwest",Fl(o,{right:0,bottom:3}),Ny),S4=(o,c,m)=>ga(w4(o),_4(o,c),m.insetSoutheast(),of(),"southeast",Fl(o,{left:1,bottom:3}),Ny),Kx=(o,c,m)=>ga(rN(o,c),iN(o),m.insetNorthwest(),gh(),"northwest",Fl(o,{right:0,top:2}),Ny),Yx=(o,c,m)=>ga(w4(o),iN(o),m.insetNortheast(),yb(),"northeast",Fl(o,{left:1,top:2}),Ny),_p=(o,c,m)=>ga(p7(o,c),iN(o),m.insetNorth(),Bv(),"north",Fl(o,{top:2}),Ny),Xx=(o,c,m)=>ga(p7(o,c),_4(o,c),m.insetSouth(),z2(),"south",Fl(o,{bottom:3}),Ny),aN=(o,c,m)=>ga(rN(o,c),C4(o,c),m.insetEast(),wb(),"east",Fl(o,{right:0}),Ny),b7=(o,c,m)=>ga(w4(o),C4(o,c),m.insetWest(),Lv(),"west",Fl(o,{left:1}),Ny),VG=o=>{switch(o){case"north":return _p;case"northeast":return Yx;case"northwest":return Kx;case"south":return Xx;case"southeast":return S4;case"southwest":return Gx;case"east":return aN;case"west":return b7}},v7=(o,c,m,b,_)=>uC(b).map(VG).getOr(_p)(o,c,m,b,_),UG=o=>{switch(o){case"north":return Xx;case"northeast":return S4;case"northwest":return Gx;case"south":return _p;case"southeast":return Yx;case"southwest":return Kx;case"east":return b7;case"west":return aN}},WG=(o,c,m,b,_)=>uC(b).map(UG).getOr(_p)(o,c,m,b,_),Jx={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},jG=(o,c,m)=>{const _={maxHeightFunction:cg()},x=()=>({type:"node",root:vn(Pt(o())),node:V.from(o()),bubble:ug(12,12,Jx),layouts:{onRtl:()=>[Yx],onLtr:()=>[Kx]},overrides:_}),M=()=>({type:"hotspot",hotspot:c(),bubble:ug(-12,12,Jx),layouts:{onRtl:()=>[ml,Kl,Hl],onLtr:()=>[Kl,ml,Hl]},overrides:_});return()=>m()?x():M()},ZG=(o,c,m,b)=>{const x={maxHeightFunction:cg()},M=()=>({type:"node",root:vn(Pt(c())),node:V.from(c()),bubble:ug(12,12,Jx),layouts:{onRtl:()=>[_p],onLtr:()=>[_p]},overrides:x}),I=()=>o?{type:"node",root:vn(Pt(c())),node:V.from(c()),bubble:ug(0,-Ff(c()),Jx),layouts:{onRtl:()=>[Yl],onLtr:()=>[Yl]},overrides:x}:{type:"hotspot",hotspot:m(),bubble:ug(0,0,Jx),layouts:{onRtl:()=>[Yl],onLtr:()=>[Yl]},overrides:x};return()=>b()?M():I()},qG=(o,c,m)=>{const b=()=>({type:"node",root:vn(Pt(o())),node:V.from(o()),layouts:{onRtl:()=>[_p],onLtr:()=>[_p]}}),_=()=>({type:"hotspot",hotspot:c(),layouts:{onRtl:()=>[Hl],onLtr:()=>[Hl]}});return()=>m()?b():_()},GG=(o,c)=>()=>({type:"selection",root:c(),getSelection:()=>{const m=o.selection.getRng(),b=o.model.table.getSelectedCells();if(b.length>1){const _=b[0],x=b[b.length-1],M={firstCell:it.fromDom(_),lastCell:it.fromDom(x)};return V.some(M)}return V.some(Tb.range(it.fromDom(m.startContainer),m.startOffset,it.fromDom(m.endContainer),m.endOffset))}}),KG=o=>c=>({type:"node",root:o(),node:c}),y7=(o,c,m,b)=>{const _=cS(o),x=()=>it.fromDom(o.getBody()),M=()=>it.fromDom(o.getContentAreaContainer()),I=()=>_||!b();return{inlineDialog:jG(M,c,I),inlineBottomDialog:ZG(o.inline,M,m,I),banner:qG(M,c,I),cursor:GG(o,x),node:KG(x)}},YG=o=>(c,m)=>{W8(o)(c,m)},XG=o=>()=>$8(o),JG=o=>c=>IR(o,c),QG=o=>c=>BR(o,c),eK=o=>({colorPicker:YG(o),hasCustomColors:XG(o),getColors:JG(o),getColorCols:QG(o)}),tK=o=>()=>VM(o),w7=o=>({isDraggableModal:tK(o)}),nK=o=>{const c=Ho(jM(o)?"bottom":"top");return{isPositionedAtTop:()=>c.get()==="top",getDockingMode:c.get,setDockingMode:c.set}},lN=o=>Ii(o,"items"),_7=o=>Ii(o,"format"),cN=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],C7=o=>ps(o,"items"),uN=o=>ps(o,"block"),oK=o=>ps(o,"inline"),S7=o=>ps(o,"selector"),fN=o=>xo(o,(c,m)=>{if(C7(m)){const b=fN(m.items);return{customFormats:c.customFormats.concat(b.customFormats),formats:c.formats.concat([{title:m.title,items:b.formats}])}}else if(oK(m)||uN(m)||S7(m)){const _=`custom-${h(m.name)?m.name:m.title.toLowerCase()}`;return{customFormats:c.customFormats.concat([{name:_,format:m}]),formats:c.formats.concat([{title:m.title,format:_,icon:m.icon}])}}else return{...c,formats:c.formats.concat(m)}},{customFormats:[],formats:[]}),sK=(o,c)=>{const m=fN(c),b=_=>{xt(_,x=>{o.formatter.has(x.name)||o.formatter.register(x.name,x.format)})};return o.formatter?b(m.customFormats):o.on("init",()=>{b(m.customFormats)}),m.formats},dN=o=>iS(o).map(c=>{const m=sK(o,c);return lx(o)?cN.concat(m):m}).getOr(cN),rK=o=>{const c=Zs(o);return c.length===1&&ct(c,"title")},k7=(o,c,m)=>({...o,type:"formatter",isSelected:c(o.format),getStylePreview:m(o.format)}),Cp=(o,c,m,b)=>{const _=U=>k7(U,m,b),x=U=>{const Y=I(U.items);return{...U,type:"submenu",getStyleItems:J(Y)}},M=U=>{const Y=h(U.name)?U.name:oo(U.title),se=`custom-${Y}`,fe={...U,type:"formatter",format:se,isSelected:m(se),getStylePreview:b(se)};return o.formatter.register(Y,fe),fe},I=U=>We(U,Y=>lN(Y)?x(Y):_7(Y)?_(Y):rK(Y)?{...Y,type:"separator"}:M(Y));return I(c)},k4=o=>{const c=I=>()=>o.formatter.match(I),m=I=>()=>{const U=o.formatter.get(I);return U!==void 0?V.some({tag:U.length>0&&(U[0].inline||U[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(I))}):V.none()},b=Ho([]),_=Ho([]),x=Ho(!1);return o.on("PreInit",I=>{const U=dN(o),Y=Cp(o,U,c,m);b.set(Y)}),o.on("addStyleModifications",I=>{const U=Cp(o,I.items,c,m);_.set(U),x.set(I.replace)}),{getData:()=>{const I=x.get()?[]:b.get(),U=_.get();return I.concat(U)}}},E4=o=>j(o)&&o.nodeType===1,iK=nv.trim,x4=o=>c=>!!(E4(c)&&(c.contentEditable===o||c.getAttribute("data-mce-contenteditable")===o)),aK=x4("true"),hN=x4("false"),mN=(o,c,m,b,_)=>({type:o,title:c,url:m,level:b,attach:_}),gN=o=>{let c=o;for(;c=c.parentNode;){const m=c.contentEditable;if(m&&m!=="inherit")return aK(c)}return!1},lK=(o,c)=>We(lu(it.fromDom(c),o),m=>m.dom),pN=o=>o.innerText||o.textContent,E7=o=>o.id?o.id:oo("h"),bN=o=>o&&o.nodeName==="A"&&(o.id||o.name)!==void 0,cK=o=>bN(o)&&vN(o),x7=o=>o&&/^(H[1-6])$/.test(o.nodeName),vN=o=>gN(o)&&!hN(o),uK=o=>x7(o)&&vN(o),fK=o=>x7(o)?parseInt(o.nodeName.substr(1),10):0,A7=o=>{var c;const m=E7(o),b=()=>{o.id=m};return mN("header",(c=pN(o))!==null&&c!==void 0?c:"","#"+m,fK(o),b)},T7=o=>{const c=o.id||o.name,m=pN(o);return mN("anchor",m||"#"+c,"#"+c,0,F)},dK=o=>We(ho(o,uK),A7),hK=o=>We(ho(o,cK),T7),mK=o=>lK("h1,h2,h3,h4,h5,h6,a:not([href])",o),gK=o=>iK(o.title).length>0,g1={find:o=>{const c=mK(o);return ho(dK(c).concat(hK(c)),gK)}},RS="tinymce-url-history",D7=5,O7=o=>h(o)&&/^https?/.test(o),bK=o=>C(o)&&o.length<=D7&&Ut(o,O7),M7=o=>g(o)&&gs(o,c=>!bK(c)).isNone(),R7=()=>{const o=Kb.getItem(RS);if(o===null)return{};let c;try{c=JSON.parse(o)}catch(m){if(m instanceof SyntaxError)return console.log("Local storage "+RS+" was not valid JSON",m),{};throw m}return M7(c)?c:(console.log("Local storage "+RS+" was not valid format",c),{})},N7=o=>{if(!M7(o))throw new Error(`Bad format for history:
`+JSON.stringify(o));Kb.setItem(RS,JSON.stringify(o))},P7=o=>{const c=R7();return an(c,o).getOr([])},lre=(o,c)=>{if(!O7(o))return;const m=R7(),b=an(m,c).getOr([]),_=ho(b,x=>x!==o);m[c]=[o].concat(_).slice(0,D7),N7(m)},vK=o=>!!o,Lu=o=>Ps(nv.makeMap(o,/[, ]/),vK),Qx=o=>V.from(CB(o)),yK=o=>{const c=V.from(zM(o)).filter(vK).map(Lu);return Qx(o).fold(Qe,m=>c.fold(ft,b=>Zs(b).length>0?b:!1))},A4=(o,c)=>{const m=yK(o);return O(m)?m?Qx(o):V.none():m[c]?Qx(o):V.none()},wK=(o,c)=>A4(o,c).map(m=>b=>Bu.nu(_=>{const x=(I,U)=>{if(!h(I))throw new Error("Expected value to be string");if(U!==void 0&&!g(U))throw new Error("Expected meta to be a object");_({value:I,meta:U})},M={filetype:c,fieldname:b.fieldname,...V.from(b.meta).getOr({})};m.call(o,x,b.value,M)})),I7=o=>V.from(o).filter(h).getOrUndefined(),_K=o=>EB(o)?V.some({targets:g1.find(o.getBody()),anchorTop:I7(xB(o)),anchorBottom:I7(oT(o))}):V.none(),CK=o=>V.from(SB(o)),SK=o=>({getHistory:P7,addToHistory:lre,getLinkInformation:()=>_K(o),getValidationHandler:()=>CK(o),getUrlPicker:c=>wK(o,c)}),kK=(o,c,m,b)=>{const _=Ho(!1),x=nK(c),M={icons:()=>c.ui.registry.getAll().icons,menuItems:()=>c.ui.registry.getAll().menuItems,translate:gm.translate,isDisabled:()=>c.mode.isReadOnly()||!c.ui.isEnabled(),getOption:c.options.get},I=SK(c),U=k4(c),Y=eK(c),se=w7(c),fe=()=>_.get(),me=Ht=>_.set(Ht),Ce={shared:{providers:M,anchors:y7(c,m,b,x.isPositionedAtTop),header:x},urlinput:I,styles:U,colorinput:Y,dialog:se,isContextMenuOpen:fe,setContextMenuState:me},Ne={...Ce,shared:{...Ce.shared,interpreter:Ht=>MS(Ht,{},Ne),getSink:o.popup}},st={...Ce,shared:{...Ce.shared,interpreter:Ht=>MS(Ht,{},st),getSink:o.dialog}};return{popup:Ne,dialog:st}},EK=(o,c,m)=>{const b=(mn,In)=>{xt([c,...m],Zn=>{Zn.broadcastEvent(mn,In)})},_=(mn,In)=>{xt([c,...m],Zn=>{Zn.broadcastOn([mn],In)})},x=mn=>_(_h(),{target:mn.target}),M=Yd(),I=Sc(M,"touchstart",x),U=Sc(M,"touchmove",mn=>b(nu(),mn)),Y=Sc(M,"touchend",mn=>b(Af(),mn)),se=Sc(M,"mousedown",x),fe=Sc(M,"mouseup",mn=>{mn.raw.button===0&&_(EE(),{target:mn.target})}),me=mn=>_(_h(),{target:it.fromDom(mn.target)}),Ce=mn=>{mn.button===0&&_(EE(),{target:it.fromDom(mn.target)})},Ne=()=>{xt(o.editorManager.get(),mn=>{o!==mn&&mn.dispatch("DismissPopups",{relatedTarget:o})})},st=mn=>b(Ym(),ol(mn)),Ht=mn=>{_(p0(),{}),b(ih(),ol(mn))},ut=Pt(it.fromDom(o.getElement())),lt=i0(ut,"scroll",mn=>{requestAnimationFrame(()=>{const In=o.getContainer();if(In!=null){const js=Kw(o,c.element).map(yo=>[yo.element,...yo.others]).getOr([]);dn(js,yo=>Cr(yo,mn.target))&&(o.dispatch("ElementScroll",{target:mn.target.dom}),b(ah(),mn))}})}),Zt=()=>_(p0(),{}),Dt=mn=>{mn.state&&_(_h(),{target:it.fromDom(o.getContainer())})},kn=mn=>{_(_h(),{target:it.fromDom(mn.relatedTarget.getContainer())})};o.on("PostRender",()=>{o.on("click",me),o.on("tap",me),o.on("mouseup",Ce),o.on("mousedown",Ne),o.on("ScrollWindow",st),o.on("ResizeWindow",Ht),o.on("ResizeEditor",Zt),o.on("AfterProgressState",Dt),o.on("DismissPopups",kn)}),o.on("remove",()=>{o.off("click",me),o.off("tap",me),o.off("mouseup",Ce),o.off("mousedown",Ne),o.off("ScrollWindow",st),o.off("ResizeWindow",Ht),o.off("ResizeEditor",Zt),o.off("AfterProgressState",Dt),o.off("DismissPopups",kn),se.unbind(),I.unbind(),U.unbind(),Y.unbind(),fe.unbind(),lt.unbind()}),o.on("detach",()=>{xt([c,...m],wE),xt([c,...m],mn=>mn.destroy())})},kc=$O,p1=Pb,T4=J([St("shell",!1),Qt("makeItem"),St("setupItem",F),fm.field("listBehaviours",[ms])]),B7=Fd({name:"items",overrides:()=>({behaviours:An([ms.config({})])})}),xK=J([B7]),L7=J("CustomList"),AK=(o,c,m,b)=>{const _=(I,U)=>{M(I).fold(()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},Y=>{const se=ms.contents(Y),fe=U.length,me=fe-se.length,Ce=me>0?kt(me,()=>o.makeItem()):[],Ne=se.slice(fe);xt(Ne,Ht=>ms.remove(Y,Ht)),xt(Ce,Ht=>ms.append(Y,Ht));const st=ms.contents(Y);xt(st,(Ht,ut)=>{o.setupItem(I,Ht,U[ut],ut)})})},x=o.shell?{behaviours:[ms.config({})],components:[]}:{behaviours:[],components:c},M=I=>o.shell?V.some(I):Ai(I,o,"items");return{uid:o.uid,dom:o.dom,components:x.components,behaviours:Ql(o.listBehaviours,x.behaviours),apis:{setItems:_}}},F7=fu({name:L7(),configFields:T4(),partFields:xK(),factory:AK,apis:{setItems:(o,c,m)=>{o.setItems(c,m)}}}),n_=J([Qt("dom"),St("shell",!0),$l("toolbarBehaviours",[ms])]),ure=J([Fd({name:"groups",overrides:()=>({behaviours:An([ms.config({})])})})]),TK=(o,c,m,b)=>{const _=(I,U)=>{x(I).fold(()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},Y=>{ms.set(Y,U)})},x=I=>o.shell?V.some(I):Ai(I,o,"groups"),M=o.shell?{behaviours:[ms.config({})],components:[]}:{behaviours:[],components:c};return{uid:o.uid,dom:o.dom,components:M.components,behaviours:Ql(o.toolbarBehaviours,M.behaviours),apis:{setGroups:_,refresh:F},domModification:{attributes:{role:"group"}}}},b1=fu({name:"Toolbar",configFields:n_(),partFields:ure(),factory:TK,apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)}}}),DK=F,H7=Qe,D4=J([]);var OK=Object.freeze({__proto__:null,setup:DK,isDocked:H7,getBehaviours:D4});const yN=o=>($e(Xi(o,"position"),"fixed")?V.none():Lf(o)).orThunk(()=>{const b=it.fromTag("span");return Fa(o).bind(_=>{tl(_,b);const x=Lf(b);return _u(b),x})}),wN=o=>yN(o).map(vc).getOrThunk(()=>fr(0,0)),MK=(o,c)=>{const m=o.element;Ra(m,c.transitionClass),ma(m,c.fadeOutClass),Ra(m,c.fadeInClass),c.onShow(o)},RK=(o,c)=>{const m=o.element;Ra(m,c.transitionClass),ma(m,c.fadeInClass),Ra(m,c.fadeOutClass),c.onHide(o)},NK=(o,c)=>o.y<c.bottom&&o.bottom>c.y,$7=(o,c)=>o.y>=c.y,O4=(o,c)=>o.bottom<=c.bottom,M4=(o,c,m)=>({location:"top",leftX:c,topY:m.bounds.y-o.y}),_N=(o,c,m)=>({location:"bottom",leftX:c,bottomY:o.bottom-m.bounds.bottom}),CN=o=>o.box.x-o.win.x,PK=(o,c,m)=>{const b=c.win,_=c.box,x=CN(c);return Js(o,M=>{switch(M){case"bottom":return O4(_,m.bounds)?V.none():V.some(_N(b,x,m));case"top":return $7(_,m.bounds)?V.none():V.some(M4(b,x,m));default:return V.none()}}).getOr({location:"no-dock"})},IK=(o,c,m)=>Ut(o,b=>{switch(b){case"bottom":return O4(c,m.bounds);case"top":return $7(c,m.bounds)}}),z7=(o,c)=>{const m=c.optScrollEnv.fold(J(o.bounds.y),b=>b.scrollElmTop+(o.bounds.y-b.currentScrollTop));return fr(o.bounds.x,m)},BK=(o,c)=>{const m=c.optScrollEnv.fold(J(o.y),b=>o.y+b.currentScrollTop-b.scrollElmTop);return fr(o.x,m)},NS=(o,c,m)=>m.getInitialPos().map(b=>{const _=z7(b,c);return{box:si(_.left,_.top,Ji(o),Oi(o)),location:b.location}}),V7=(o,c,m,b,_)=>{const x=BK(c,m),M=si(x.left,x.top,c.width,c.height);b.setInitialPos({style:ni(o),position:qr(o,"position")||"static",bounds:M,location:_.location})},R4=(o,c,m,b,_)=>{b.getInitialPos().fold(()=>V7(o,c,m,b,_),()=>F)},U7=(o,c,m)=>m.getInitialPos().bind(b=>{var _;switch(m.clearInitialPos(),b.position){case"static":return V.some({morph:"static"});case"absolute":const x=yN(o).getOr(Li()),M=li(x),I=(_=x.dom.scrollTop)!==null&&_!==void 0?_:0;return V.some({morph:"absolute",positionCss:Rd("absolute",an(b.style,"left").map(U=>c.x-M.x),an(b.style,"top").map(U=>c.y-M.y+I),an(b.style,"right").map(U=>M.right-c.right),an(b.style,"bottom").map(U=>M.bottom-c.bottom))});default:return V.none()}}),SN=(o,c,m)=>NS(o,c,m).filter(({box:b})=>IK(m.getModes(),b,c)).bind(({box:b})=>U7(o,b,m)),o_=o=>{switch(o.location){case"top":return V.some({morph:"fixed",positionCss:Rd("fixed",V.some(o.leftX),V.some(o.topY),V.none(),V.none())});case"bottom":return V.some({morph:"fixed",positionCss:Rd("fixed",V.some(o.leftX),V.none(),V.none(),V.some(o.bottomY))});default:return V.none()}},W7=(o,c,m)=>{const b=li(o),_=le(),x=PK(m.getModes(),{win:_,box:b},c);return x.location==="top"||x.location==="bottom"?(V7(o,b,c,m,x),o_(x)):V.none()},LK=(o,c,m)=>SN(o,c,m).orThunk(()=>c.optScrollEnv.bind(b=>NS(o,c,m)).bind(({box:b,location:_})=>{const x=le(),M=CN({win:x,box:b}),I=_==="top"?M4(x,M,c):_N(x,M,c);return o_(I)})),j7=(o,c,m)=>{const b=o.element;return $e(Xi(b,"position"),"fixed")?LK(b,c,m):W7(b,c,m)},Z7=(o,c,m)=>{const b=o.element;return NS(b,c,m).bind(({box:_})=>U7(b,_,m))},q7=(o,c,m,b)=>{const _=li(o),x=le(),M=CN({win:x,box:_}),I=b(x,M,c);return I.location==="bottom"||I.location==="top"?(R4(o,_,c,m,I),o_(I)):V.none()},G7=(o,c,m)=>{m.setDocked(!1),xt(["left","right","top","bottom","position"],b=>Ss(o.element,b)),c.onUndocked(o)},eA=(o,c,m,b)=>{const _=b.position==="fixed";m.setDocked(_),o0(o.element,b),(_?c.onDocked:c.onUndocked)(o)},tA=(o,c,m,b,_=!1)=>{c.contextual.each(x=>{x.lazyContext(o).each(M=>{const I=NK(M,b.bounds);I!==m.isVisible()&&(m.setVisible(I),_&&!I?(tg(o.element,[x.fadeOutClass]),x.onHide(o)):(I?MK:RK)(o,x))})})},K7=(o,c,m,b,_)=>{tA(o,c,m,b,!0),eA(o,c,m,_.positionCss)},FK=(o,c,m,b,_)=>{switch(_.morph){case"static":return G7(o,c,m);case"absolute":return eA(o,c,m,_.positionCss);case"fixed":return K7(o,c,m,b,_)}},PS=(o,c,m)=>{const b=c.lazyViewport(o);tA(o,c,m,b),j7(o,b,m).each(_=>{FK(o,c,m,b,_)})},Y7=(o,c,m)=>{const b=o.element;m.setDocked(!1);const _=c.lazyViewport(o);Z7(o,_,m).each(x=>{switch(x.morph){case"static":{G7(o,c,m);break}case"absolute":{eA(o,c,m,x.positionCss);break}}}),m.setVisible(!0),c.contextual.each(x=>{Fc(b,[x.fadeInClass,x.fadeOutClass,x.transitionClass]),x.onShow(o)}),N4(o,c,m)},N4=(o,c,m)=>{o.getSystem().isConnected()&&PS(o,c,m)},kN=(o,c,m)=>{m.isDocked()&&Y7(o,c,m)},P4=o=>(c,m,b)=>{const _=m.lazyViewport(c);q7(c.element,_,b,o).each(M=>{K7(c,m,b,_,M)})},EN=P4(M4),HK=P4(_N);var $K=Object.freeze({__proto__:null,refresh:N4,reset:kN,isDocked:(o,c,m)=>m.isDocked(),getModes:(o,c,m)=>m.getModes(),setModes:(o,c,m,b)=>m.setModes(b),forceDockToTop:EN,forceDockToBottom:HK}),zK=Object.freeze({__proto__:null,events:(o,c)=>ri([eg(jg(),(m,b)=>{o.contextual.each(_=>{Qu(m.element,_.transitionClass)&&(Fc(m.element,[_.transitionClass,_.fadeInClass]),(c.isVisible()?_.onShown:_.onHidden)(m)),b.stop()})}),en(Ym(),(m,b)=>{N4(m,o,c)}),en(ah(),(m,b)=>{N4(m,o,c)}),en(ih(),(m,b)=>{kN(m,o,c)})])}),VK=[Wa("contextual",[Ca("fadeInClass"),Ca("fadeOutClass"),Ca("transitionClass"),Ic("lazyContext"),Gs("onShow"),Gs("onShown"),Gs("onHide"),Gs("onHidden")]),Za("lazyViewport",()=>({bounds:le(),optScrollEnv:V.none()})),Jc("modes",["top","bottom"],hl),Gs("onDocked"),Gs("onUndocked")],UK=Object.freeze({__proto__:null,init:o=>{const c=Ho(!1),m=Ho(!0),b=Ui(),_=Ho(o.modes),x=()=>`docked: ${c.get()}, visible: ${m.get()}, modes: ${_.get().join(",")}`;return su({isDocked:c.get,setDocked:c.set,getInitialPos:b.get,setInitialPos:b.set,clearInitialPos:b.clear,isVisible:m.get,setVisible:m.set,getModes:_.get,setModes:_.set,readState:x})}});const vl=Xl({fields:VK,name:"docking",active:zK,apis:$K,state:UK}),I4=J(oo("toolbar-height-change")),E0={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},IS="tox-tinymce--toolbar-sticky-on",J7="tox-tinymce--toolbar-sticky-off",WK=(o,c)=>{const m=sa(c),_=Oc(c).dom.innerHeight,x=ic(m),M=it.fromDom(o.elm),I=Bl(M),U=Oi(M),Y=I.y,se=Y+U,fe=vc(c),me=Oi(c),Ce=fe.top,Ne=Ce+me,st=Math.abs(Ce-x.top)<2,Ht=Math.abs(Ne-(x.top+_))<2;if(st&&Y<Ne)Wh(x.left,Y-me,m);else if(Ht&&se>Ce){const ut=Y-_+U+me;Wh(x.left,ut,m)}},BS=(o,c)=>ct(vl.getModes(o),c),B4=o=>{const c=b=>Ff(b)+(parseInt(qr(b,"margin-top"),10)||0)+(parseInt(qr(b,"margin-bottom"),10)||0),m=o.element;bc(m).each(b=>{const _="padding-"+vl.getModes(o)[0];if(vl.isDocked(o)){const x=Ji(b);no(m,"width",x+"px"),no(b,_,c(m)+"px")}else Ss(m,"width"),Ss(b,_)})},Q7=(o,c)=>{c?(ma(o,E0.fadeOutClass),tg(o,[E0.transitionClass,E0.fadeInClass])):(ma(o,E0.fadeInClass),tg(o,[E0.fadeOutClass,E0.transitionClass]))},e9=(o,c)=>{const m=it.fromDom(o.getContainer());c?(Ra(m,IS),ma(m,J7)):(Ra(m,J7),ma(m,IS))},jK=(o,c)=>{const m=sa(c);Of(m).filter(b=>!Cr(c,b)).filter(b=>Cr(b,it.fromDom(m.dom.body))||La(o,b)).each(()=>sf(c))},ZK=(o,c)=>nl(o).orThunk(()=>c().toOptional().bind(m=>nl(m.element))),qK=(o,c,m)=>{o.inline||(c.header.isPositionedAtTop()||o.on("ResizeEditor",()=>{m().each(vl.reset)}),o.on("ResizeWindow ResizeEditor",()=>{m().each(B4)}),o.on("SkinLoaded",()=>{m().each(b=>{vl.isDocked(b)?vl.reset(b):vl.refresh(b)})}),o.on("FullscreenStateChanged",()=>{m().each(vl.reset)})),o.on("AfterScrollIntoView",b=>{m().each(_=>{vl.refresh(_);const x=_.element;Nu(x)&&WK(b,x)})}),o.on("PostRender",()=>{e9(o,!1)})},GK=o=>o().map(vl.isDocked).getOr(!1),KK=()=>[Cc.config({channels:{[I4()]:{onReceive:B4}}})],t9=(o,c)=>{const m=Ui(),b=c.getSink,_=I=>{b().each(U=>I(U.element))},x=I=>{o.inline||B4(I),e9(o,vl.isDocked(I)),I.getSystem().broadcastOn([p0()],{}),b().each(U=>U.getSystem().broadcastOn([p0()],{}))},M=o.inline?[]:KK();return[Qo.config({}),vl.config({contextual:{lazyContext:I=>{const U=Ff(I.element),Y=o.inline?o.getContentAreaContainer():o.getContainer();return V.from(Y).map(se=>{const fe=li(it.fromDom(se));return Kw(o,I.element).fold(()=>{const Ce=fe.height-U,Ne=fe.y+(BS(I,"top")?0:U);return si(fe.x,Ne,fe.width,Ce)},Ce=>{const Ne=Lp(fe,wS(Ce)),st=BS(I,"top")?Ne.y:Ne.y+U;return si(Ne.x,st,Ne.width,Ne.height-U)})})},onShow:()=>{_(I=>Q7(I,!0))},onShown:I=>{_(U=>Fc(U,[E0.transitionClass,E0.fadeInClass])),m.get().each(U=>{jK(I.element,U),m.clear()})},onHide:I=>{ZK(I.element,b).fold(m.clear,m.set),_(U=>Q7(U,!1))},onHidden:()=>{_(I=>Fc(I,[E0.transitionClass]))},...E0},lazyViewport:I=>Kw(o,I.element).fold(()=>{const Y=le(),se=nT(o),fe=Y.y+(BS(I,"top")?se:0),me=Y.height-(BS(I,"bottom")?se:0);return{bounds:si(Y.x,fe,Y.width,me),optScrollEnv:V.none()}},Y=>({bounds:wS(Y),optScrollEnv:V.some({currentScrollTop:Y.element.dom.scrollTop,scrollElmTop:vc(Y.element).top})})),modes:[c.header.getDockingMode()],onDocked:x,onUndocked:x}),...M]};var YK=Object.freeze({__proto__:null,setup:qK,isDocked:GK,getBehaviours:t9});const gre=o=>{const c=o.editor,m=o.sticky?t9:D4;return{uid:o.uid,dom:o.dom,components:o.components,behaviours:An(m(c,o.sharedBackstage))}},XK=ro([Ol,Gr("items",Xn([eh([pT,Ll("items",hl)]),hl]))].concat(hS)),n9=o=>zi("GroupToolbarButton",XK,o),o9=[Gl("text"),Gl("tooltip"),Gl("icon"),_c("search",!1,Xn([Eu,ro([Gl("placeholder")])],o=>O(o)?o?V.some({placeholder:V.none()}):V.none():V.some(o))),Ic("fetch"),Za("onSetup",()=>F)],nA=ro([Ol,...o9]),xN=o=>zi("menubutton",nA,o),JK=ro([Ol,Zb,bg,wy,JB,vT,zw,xu("presets","normal",["normal","color","listpreview"]),yT(1),Eh,oR]),QK=o=>zi("SplitButton",JK,o);var AN=Vc({factory:(o,c)=>{const m=(_,x)=>{const M=We(x,I=>{const U={type:"menubutton",text:I.text,fetch:se=>{se(I.getItems())}},Y=xN(U).mapError(se=>kd(se)).getOrDie();return jx(Y,"tox-mbtn",c.backstage,V.some("menuitem"))});ms.set(_,M)},b={focus:Po.focusIn,setMenus:m};return{uid:o.uid,dom:o.dom,components:[],behaviours:An([ms.config({}),ks("menubar-events",[vi(_=>{o.onSetup(_)}),en(Sl(),(_,x)=>{ta(_.element,".tox-mbtn--active").each(M=>{tf(x.event.target,".tox-mbtn").each(I=>{Cr(M,I)||_.getSystem().getByDom(M).each(U=>{_.getSystem().getByDom(I).each(Y=>{wg.expand(Y),wg.close(U),Qo.focus(Y)})})})})}),en(_v(),(_,x)=>{x.event.prevFocus.bind(M=>_.getSystem().getByDom(M).toOptional()).each(M=>{x.event.newFocus.bind(I=>_.getSystem().getByDom(I).toOptional()).each(I=>{wg.isOpen(M)&&(wg.expand(I),wg.close(M))})})})]),Po.config({mode:"flow",selector:".tox-mbtn",onEscape:_=>(o.onEscape(_),V.some(!0))}),Ga.config({})]),apis:b,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Qt("dom"),Qt("uid"),Qt("onEscape"),Qt("backstage"),St("onSetup",F)],apis:{focus:(o,c)=>{o.focus(c)},setMenus:(o,c,m)=>{o.setMenus(c,m)}}});const eY="\u26A1\uFE0FUpgrade",tY="https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_source=TinyMCE&utm_medium=SPAP&utm_campaign=SPAP&utm_id=editorreferral",nY=o=>({uid:o.uid,dom:o.dom,components:[{dom:{tag:"a",attributes:{href:tY,rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:eY}}]}),TN="container",s9=[$l("slotBehaviours",[])],r9=o=>"<alloy.field."+o+">",i9=o=>{const c=(()=>{const x=[];return{slot:(I,U)=>(x.push(I),_3(TN,r9(I),U)),record:J(x)}})(),m=o(c),b=c.record(),_=We(b,x=>zc({name:x,pname:r9(x)}));return UE(TN,s9,_,oY,m)},oY=(o,c)=>{const m=st=>k3(o),b=(st,Ht)=>Ai(st,o,Ht),_=(st,Ht)=>(ut,lt)=>Ai(ut,o,lt).map(Zt=>st(Zt,lt)).getOr(Ht),x=st=>(Ht,ut)=>{xt(ut,lt=>st(Ht,lt))},M=(st,Ht)=>Fi(st.element,"aria-hidden")!=="true",I=(st,Ht)=>{if(!M(st)){const ut=st.element;Ss(ut,"display"),je(ut,"aria-hidden"),Ao(st,Cv(),{name:Ht,visible:!0})}},U=(st,Ht)=>{if(M(st)){const ut=st.element;no(ut,"display","none"),Kn(ut,"aria-hidden","true"),Ao(st,Cv(),{name:Ht,visible:!1})}},Y=_(M,!1),se=_(U),fe=x(se),me=st=>fe(st,m()),Ce=_(I),Ne={getSlotNames:m,getSlot:b,isShowing:Y,hideSlot:se,hideAllSlots:me,showSlot:Ce};return{uid:o.uid,dom:o.dom,components:c,behaviours:um(o.slotBehaviours),apis:Ne}},ff={...Ps({getSlotNames:(o,c)=>o.getSlotNames(c),getSlot:(o,c,m)=>o.getSlot(c,m),isShowing:(o,c,m)=>o.isShowing(c,m),hideSlot:(o,c,m)=>o.hideSlot(c,m),hideAllSlots:(o,c)=>o.hideAllSlots(c),showSlot:(o,c,m)=>o.showSlot(c,m)},o=>Qg(o)),sketch:i9},s_=ro([bg,Zb,Za("onShow",F),Za("onHide",F),zw]),a9=o=>zi("sidebar",s_,o),oA=o=>{const{sidebars:c}=o.ui.registry.getAll();xt(Zs(c),m=>{const b=c[m],_=()=>$e(V.from(o.queryCommandValue("ToggleSidebar")),m);o.ui.registry.addToggleButton(m,{icon:b.icon,tooltip:b.tooltip,onAction:x=>{o.execCommand("ToggleSidebar",!1,m),x.setActive(_())},onSetup:x=>{x.setActive(_());const M=()=>x.setActive(_());return o.on("ToggleSidebar",M),()=>{o.off("ToggleSidebar",M)}}})})},L4=o=>({element:()=>o.element.dom}),l9=(o,c)=>{const m=We(Zs(c),b=>{const _=c[b],x=ha(a9(_));return{name:b,getApi:L4,onSetup:x.onSetup,onShow:x.onShow,onHide:x.onHide}});return We(m,b=>{const _=Ho(F);return o.slot(b.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:mS.unnamedEvents([qb(b,_),Gb(b,_),en(Cv(),(x,M)=>{const I=M.event;Ct(m,Y=>Y.name===I.name).each(Y=>{(I.visible?Y.onShow:Y.onHide)(Y.getApi(x))})})])})})},c9=o=>ff.sketch(c=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:l9(c,o),slotBehaviours:mS.unnamedEvents([vi(m=>ff.hideAllSlots(m))])})),u9=(o,c,m)=>{sr.getCurrent(o).each(_=>{ms.set(_,[c9(c)]);const x=m==null?void 0:m.toLowerCase();h(x)&&ps(c,x)&&sr.getCurrent(_).each(M=>{ff.showSlot(M,x),Th.immediateGrow(_),Ss(_.element,"width"),DN(o.element,"region")})})},DN=(o,c)=>{Kn(o,"role",c)},sY=(o,c)=>{sr.getCurrent(o).each(b=>{sr.getCurrent(b).each(x=>{Th.hasGrown(b)?ff.isShowing(x,c)?(Th.shrink(b),DN(o.element,"presentation")):(ff.hideAllSlots(x),ff.showSlot(x,c),DN(o.element,"region")):(ff.hideAllSlots(x),ff.showSlot(x,c),Th.grow(b),DN(o.element,"region"))})})},rY=o=>sr.getCurrent(o).bind(m=>Th.isGrowing(m)||Th.hasGrown(m)?sr.getCurrent(m).bind(x=>Ct(ff.getSlotNames(x),M=>ff.isShowing(x,M))):V.none()),ON=oo("FixSizeEvent"),MN=oo("AutoSizeEvent"),iY=o=>({uid:o.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:An([Ga.config({}),Qo.config({}),Th.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:c=>{sr.getCurrent(c).each(ff.hideAllSlots),nr(c,MN)},onGrown:c=>{nr(c,MN)},onStartGrow:c=>{Ao(c,ON,{width:Xi(c.element,"width").getOr("")})},onStartShrink:c=>{Ao(c,ON,{width:Ji(c.element)+"px"})}}),ms.config({}),sr.config({find:c=>{const m=ms.contents(c);return ds(m)}})])}],behaviours:An([wp.childAt(0),ks("sidebar-sliding-events",[en(ON,(c,m)=>{no(c.element,"width",m.event.width)}),en(MN,(c,m)=>{Ss(c.element,"width")})])])});var aY=Object.freeze({__proto__:null,block:(o,c,m,b)=>{Kn(o.element,"aria-busy",!0);const _=c.getRoot(o).getOr(o),x=An([Po.config({mode:"special",onTab:()=>V.some(!0),onShiftTab:()=>V.some(!0)}),Qo.config({})]),M=b(_,x),I=_.getSystem().build(M);ms.append(_,ru(I)),I.hasConfigured(Po)&&c.focus&&Po.focusIn(I),m.isBlocked()||c.onBlock(o),m.blockWith(()=>ms.remove(_,I))},unblock:(o,c,m)=>{je(o.element,"aria-busy"),m.isBlocked()&&c.onUnblock(o),m.clear()},isBlocked:(o,c,m)=>m.isBlocked()}),lY=[Za("getRoot",V.none),ja("focus",!0),Gs("onBlock"),Gs("onUnblock")],cY=Object.freeze({__proto__:null,init:()=>{const o=ip(),c=m=>{o.set({destroy:m})};return su({readState:o.isSet,blockWith:c,clear:o.clear,isBlocked:o.isSet})}});const Dh=Xl({fields:lY,name:"blocking",apis:aY,state:cY}),h9=o=>{const c=o.dom.attributes!==void 0?o.dom.attributes:[];return xo(c,(m,b)=>b.name==="class"?m:{...m,[b.name]:b.value},{})},uY=o=>Array.prototype.slice.call(o.dom.classList,0),Py=o=>{const c=it.fromHtml(o),m=Ul(c),b=h9(c),_=uY(c),x=m.length===0?{}:{innerHtml:Vp(c)};return{tag:fl(c),classes:_,attributes:b,...x}},fY=o=>(c,m)=>({dom:{tag:"div",attributes:{"aria-label":o.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Py('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),m9=o=>sr.getCurrent(o).each(c=>sf(c.element)),dY=(o,c)=>{const m="tabindex",b=`data-mce-${m}`;V.from(o.iframeElement).map(it.fromDom).each(_=>{c?(de(_,m).each(x=>Kn(_,b,x)),Kn(_,m,-1)):(je(_,m),de(_,b).each(x=>{Kn(_,m,x),je(_,b)}))})},hY=(o,c,m,b)=>{const _=c.element;if(dY(o,m),m)Dh.block(c,fY(b)),Ss(_,"display"),je(_,"aria-hidden"),o.hasFocus()&&m9(c);else{const x=sr.getCurrent(c).exists(M=>Qp(M.element));Dh.unblock(c),no(_,"display","none"),Kn(_,"aria-hidden","true"),x&&o.focus()}},g9=o=>({uid:o.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:An([ms.config({}),Dh.config({focus:!1}),sr.config({find:c=>ds(c.components())})]),components:[]}),p9=o=>o.type==="focusin",mY=o=>p9(o)?(o.composed?ds(o.composedPath()):V.from(o.target)).map(it.fromDom).filter(gr).exists(m=>Qu(m,"mce-pastebin")):!1,gY=(o,c,m)=>{const b=Ho(!1),_=Ui(),x=I=>{b.get()&&!mY(I)&&(I.preventDefault(),m9(c()),o.editorManager.setActive(o))};o.inline||o.on("PreInit",()=>{o.dom.bind(o.getWin(),"focusin",x),o.on("BeforeExecCommand",I=>{I.command.toLowerCase()==="mcefocus"&&I.value!==!0&&x(I)})});const M=I=>{I!==b.get()&&(b.set(I),hY(o,c(),I,m.providers),Tj(o,I))};o.on("ProgressState",I=>{if(_.on(clearTimeout),q(I.time)){const U=Q3.setEditorTimeout(o,()=>M(I.state),I.time);_.set(U)}else M(I.state),_.clear()})},H4=(o,c)=>xo(o,(_,x)=>c(x,_.len).fold(J(_),I=>({len:I.finish,list:_.list.concat([I])})),{len:0,list:[]}).list,LS=(o,c,m)=>({within:o,extra:c,withinWidth:m}),b9=(o,c,m)=>{const b=H4(o,(I,U)=>{const Y=m(I);return V.some({element:I,start:U,finish:U+Y,width:Y})}),_=ho(b,I=>I.finish<=c),x=ao(_,(I,U)=>I+U.width,0),M=b.slice(_.length);return{within:_,extra:M,withinWidth:x}},$4=o=>We(o,c=>c.element),pY=(o,c,m)=>{const b=$4(o.concat(c));return LS(b,[],m)},bY=(o,c,m,b)=>{const _=$4(o).concat([m]);return LS(_,$4(c),b)},RN=(o,c,m)=>LS($4(o),[],m),NN=(o,c,m)=>{const b=b9(c,o,m);return b.extra.length===0?V.some(b):V.none()},vY=(o,c,m,b)=>{const _=NN(o,c,m).getOrThunk(()=>b9(c,o-m(b),m)),x=_.within,M=_.extra,I=_.withinWidth;return M.length===1&&M[0].width<=m(b)?pY(x,M,I):M.length>=1?bY(x,M,b,I):RN(x,M,I)},z4=(o,c)=>{const m=We(c,b=>ru(b));b1.setGroups(o,m)},yY=o=>Js(o,c=>nl(c.element).bind(m=>c.getSystem().getByDom(m).toOptional())),v9=(o,c,m)=>{const b=c.builtGroups.get();if(b.length===0)return;const _=o1(o,c,"primary"),x=rl.getCoupled(o,"overflowGroup");no(_.element,"visibility","hidden");const M=b.concat([x]),I=yY(M);m([]),z4(_,M);const U=Ji(_.element),Y=vY(U,c.builtGroups.get(),se=>Ji(se.element),x);Y.extra.length===0?(ms.remove(_,x),m([])):(z4(_,Y.within),m(Y.extra)),Ss(_.element,"visibility"),Kc(_.element),I.each(Qo.focus)},y9=J([$l("splitToolbarBehaviours",[rl]),_a("builtGroups",()=>Ho([]))]),wY=J([nf(["overflowToggledClass"]),zm("getOverflowBounds"),Qt("lazySink"),_a("overflowGroups",()=>Ho([])),Gs("onOpened"),Gs("onClosed")].concat(y9())),_Y=J([zc({factory:b1,schema:n_(),name:"primary"}),Sh({schema:n_(),name:"overflow"}),Sh({name:"overflow-button"}),Sh({name:"overflow-group"})]),w9=J((o,c)=>{U0(o,Math.floor(c))}),vre=J([nf(["toggledClass"]),Qt("lazySink"),Ic("fetch"),zm("getBounds"),Wa("fireDismissalEventInstead",[St("event",Xm())]),yh(),Gs("onToggled")]),_9=J([Sh({name:"button",overrides:o=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:An([Ms.config({toggleClass:o.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:o.onToggled})])})}),Sh({factory:b1,schema:n_(),name:"toolbar",overrides:o=>({toolbarBehaviours:An([Po.config({mode:"cyclic",onEscape:c=>(Ai(c,o,"button").each(Qo.focus),V.none())})])})})]),V4=Ui(),C9=(o,c)=>{V4.set(!0),PN(o,c),V4.clear()},PN=(o,c)=>{const m=rl.getCoupled(o,"toolbarSandbox");Ks.isOpen(m)?Ks.close(m):Ks.open(m,c.toolbar())},IN=(o,c,m,b)=>{const _=m.getBounds.map(M=>M()),x=m.lazySink(o).getOrDie();uu.positionWithinBounds(x,c,{anchor:{type:"hotspot",hotspot:o,layouts:b,overrides:{maxWidthFunction:w9()}}},_)},S9=(o,c,m,b,_)=>{b1.setGroups(c,_),IN(o,c,m,b),Ms.on(o)},CY=(o,c,m)=>{const b=I2(),_=(M,I)=>{const U=V4.get().getOr(!1);m.fetch().get(Y=>{S9(o,I,m,c.layouts,Y),b.link(o.element),U||Po.focusIn(I)})},x=()=>{Ms.off(o),V4.get().getOr(!1)||Qo.focus(o),b.unlink(o.element)};return{dom:{tag:"div",attributes:{id:b.id}},behaviours:An([Po.config({mode:"special",onEscape:M=>(Ks.close(M),V.some(!0))}),Ks.config({onOpen:_,onClose:x,isPartOf:(M,I,U)=>Gp(I,U)||Gp(o,U),getAttachPoint:()=>m.lazySink(o).getOrDie()}),Cc.config({channels:{...ay({isExtraPart:Qe,...m.fireDismissalEventInstead.map(M=>({fireEventInstead:{event:M.event}})).getOr({})}),...xE({doReposition:()=>{Ks.getState(rl.getCoupled(o,"toolbarSandbox")).each(M=>{IN(o,M,m,c.layouts)})}})}})])}},iv=fu({name:"FloatingToolbarButton",factory:(o,c,m,b)=>({...Uc.sketch({...b.button(),action:_=>{PN(_,b)},buttonBehaviours:fm.augment({dump:b.button().buttonBehaviours},[rl.config({others:{toolbarSandbox:_=>CY(_,m,o)}})])}),apis:{setGroups:(_,x)=>{Ks.getState(rl.getCoupled(_,"toolbarSandbox")).each(M=>{S9(_,M,o,m.layouts,x)})},reposition:_=>{Ks.getState(rl.getCoupled(_,"toolbarSandbox")).each(x=>{IN(_,x,o,m.layouts)})},toggle:_=>{PN(_,b)},toggleWithoutFocusing:_=>{C9(_,b)},getToolbar:_=>Ks.getState(rl.getCoupled(_,"toolbarSandbox")),isOpen:_=>Ks.isOpen(rl.getCoupled(_,"toolbarSandbox"))}}),configFields:vre(),partFields:_9(),apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)},reposition:(o,c)=>{o.reposition(c)},toggle:(o,c)=>{o.toggle(c)},toggleWithoutFocusing:(o,c)=>{o.toggleWithoutFocusing(c)},getToolbar:(o,c)=>o.getToolbar(c),isOpen:(o,c)=>o.isOpen(c)}}),SY=J([Qt("items"),nf(["itemSelector"]),$l("tgroupBehaviours",[Po])]),kY=J([od({name:"items",unit:"item"})]),EY=(o,c,m,b)=>({uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.tgroupBehaviours,[Po.config({mode:"flow",selector:o.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}),BN=fu({name:"ToolbarGroup",configFields:SY(),partFields:kY(),factory:EY}),xY=o=>We(o,c=>ru(c)),LN=(o,c,m)=>{v9(o,m,b=>{m.overflowGroups.set(b),c.getOpt(o).each(_=>{iv.setGroups(_,xY(b))})})},k9=(o,c,m,b)=>{const _=Qr(iv.sketch({fetch:()=>Bu.nu(x=>{x(xY(o.overflowGroups.get()))}),layouts:{onLtr:()=>[Kl,ml],onRtl:()=>[ml,Kl],onBottomLtr:()=>[Fr,Du],onBottomRtl:()=>[Du,Fr]},getBounds:m.getOverflowBounds,lazySink:o.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:o.markers.overflowToggledClass},parts:{button:b["overflow-button"](),toolbar:b.overflow()},onToggled:(x,M)=>o[M?"onOpened":"onClosed"](x)}));return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.splitToolbarBehaviours,[rl.config({others:{overflowGroup:()=>BN.sketch({...b["overflow-group"](),items:[_.asSpec()]})}})]),apis:{setGroups:(x,M)=>{o.builtGroups.set(We(M,x.getSystem().build)),LN(x,_,o)},refresh:x=>LN(x,_,o),toggle:x=>{_.getOpt(x).each(M=>{iv.toggle(M)})},toggleWithoutFocusing:x=>{_.getOpt(x).each(iv.toggleWithoutFocusing)},isOpen:x=>_.getOpt(x).map(iv.isOpen).getOr(!1),reposition:x=>{_.getOpt(x).each(M=>{iv.reposition(M)})},getOverflow:x=>_.getOpt(x).bind(iv.getToolbar)},domModification:{attributes:{role:"group"}}}},E9=fu({name:"SplitFloatingToolbar",configFields:wY(),partFields:_Y(),factory:k9,apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)},refresh:(o,c)=>{o.refresh(c)},reposition:(o,c)=>{o.reposition(c)},toggle:(o,c)=>{o.toggle(c)},toggleWithoutFocusing:(o,c)=>{o.toggle(c)},isOpen:(o,c)=>o.isOpen(c),getOverflow:(o,c)=>o.getOverflow(c)}}),AY=J([nf(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Gs("onOpened"),Gs("onClosed")].concat(y9())),ym=J([zc({factory:b1,schema:n_(),name:"primary"}),zc({factory:b1,schema:n_(),name:"overflow",overrides:o=>({toolbarBehaviours:An([Th.config({dimension:{property:"height"},closedClass:o.markers.closedClass,openClass:o.markers.openClass,shrinkingClass:o.markers.shrinkingClass,growingClass:o.markers.growingClass,onShrunk:c=>{Ai(c,o,"overflow-button").each(m=>{Ms.off(m),Qo.focus(m)}),o.onClosed(c)},onGrown:c=>{Po.focusIn(c),o.onOpened(c)},onStartGrow:c=>{Ai(c,o,"overflow-button").each(Ms.on)}}),Po.config({mode:"acyclic",onEscape:c=>(Ai(c,o,"overflow-button").each(Qo.focus),V.some(!0))})])})}),Sh({name:"overflow-button",overrides:o=>({buttonBehaviours:An([Ms.config({toggleClass:o.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])})}),Sh({name:"overflow-group"})]),TY=(o,c)=>Ai(o,c,"overflow").map(Th.hasGrown).getOr(!1),FN=(o,c)=>{Ai(o,c,"overflow-button").bind(()=>Ai(o,c,"overflow")).each(m=>{U4(o,c),Th.toggleGrow(m)})},U4=(o,c)=>{Ai(o,c,"overflow").each(m=>{v9(o,c,b=>{const _=We(b,x=>ru(x));b1.setGroups(m,_)}),Ai(o,c,"overflow-button").each(b=>{Th.hasGrown(m)&&Ms.on(b)}),Th.refresh(m)})},DY=(o,c,m,b)=>{const _="alloy.toolbar.toggle",x=(M,I)=>{const U=We(I,M.getSystem().build);o.builtGroups.set(U)};return{uid:o.uid,dom:o.dom,components:c,behaviours:Ql(o.splitToolbarBehaviours,[rl.config({others:{overflowGroup:M=>BN.sketch({...b["overflow-group"](),items:[Uc.sketch({...b["overflow-button"](),action:I=>{nr(M,_)}})]})}}),ks("toolbar-toggle-events",[en(_,M=>{FN(M,o)})])]),apis:{setGroups:(M,I)=>{x(M,I),U4(M,o)},refresh:M=>U4(M,o),toggle:M=>FN(M,o),isOpen:M=>TY(M,o)},domModification:{attributes:{role:"group"}}}},r_=fu({name:"SplitSlidingToolbar",configFields:AY(),partFields:ym(),factory:DY,apis:{setGroups:(o,c,m)=>{o.setGroups(c,m)},refresh:(o,c)=>{o.refresh(c)},toggle:(o,c)=>{o.toggle(c)},isOpen:(o,c)=>o.isOpen(c)}}),x9=o=>{const c=o.title.fold(()=>({}),m=>({attributes:{title:m}}));return{dom:{tag:"div",classes:["tox-toolbar__group"],...c},components:[BN.parts.items({})],items:o.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled]), .tox-number-input:not([disabled])"},tgroupBehaviours:An([Ga.config({}),Qo.config({})])}},i_=o=>BN.sketch(x9(o)),A9=(o,c)=>{const m=vi(b=>{const _=We(o.initGroups,i_);b1.setGroups(b,_)});return An([vg.toolbarButton(o.providers.isDisabled),ec(),Po.config({mode:c,onEscape:o.onEscape,selector:".tox-toolbar__group"}),ks("toolbar-events",[m])])},rA=o=>{const c=o.cyclicKeying?"cyclic":"acyclic";return{uid:o.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":x9({title:V.none(),items:[]}),"overflow-button":t7({name:"more",icon:V.some("more-drawer"),enabled:!0,tooltip:V.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:V.none(),borderless:!1},V.none(),o.providers)},splitToolbarBehaviours:A9(o,c)}},OY=o=>{const c=rA(o),m=4,b=E9.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return E9.sketch({...c,lazySink:o.getSink,getOverflowBounds:()=>{const _=o.moreDrawerData.lazyHeader().element,x=Bl(_),M=bu(_),I=Bl(M),U=Math.max(M.dom.scrollHeight,I.height);return si(x.x+m,I.y,x.width-m*2,U)},parts:{...c.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:o.attributes}}},components:[b],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:_=>o.onToggled(_,!0),onClosed:_=>o.onToggled(_,!1)})},MY=o=>{const c=r_.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),m=r_.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),b=rA(o);return r_.sketch({...b,components:[c,m],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:_=>{_.getSystem().broadcastOn([I4()],{type:"opened"}),o.onToggled(_,!0)},onClosed:_=>{_.getSystem().broadcastOn([I4()],{type:"closed"}),o.onToggled(_,!1)}})},$d=o=>{const c=o.cyclicKeying?"cyclic":"acyclic";return b1.sketch({uid:o.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(o.type===pg.scrolling?["tox-toolbar--scrolling"]:[])},components:[b1.parts.groups({})],toolbarBehaviours:A9(o,c)})},T9=[wy,bg,Gl("tooltip"),xu("buttonType","secondary",["primary","secondary"]),ja("borderless",!1),Ic("onAction")],W4=[...T9,a1,Va("type",["button"])],D9=[...T9,ja("active",!1),Va("type",["togglebutton"])],HN={button:W4,togglebutton:D9},RY=[Va("type",["group"]),Jc("buttons",[],Cl("type",HN))],O9=Cl("type",{...HN,group:RY}),NY=ro([Jc("buttons",[],O9),Ic("onShow"),Ic("onHide")]),PY=o=>zi("view",NY,o),IY=(o,c)=>{var m,b;const _=o.type==="togglebutton",x=o.icon.map(Zt=>My(Zt,c.icons)).map(Qr),I=(()=>Zt=>{const Dt=In=>{x.map(Zn=>Zn.getOpt(Zt).each(js=>{ms.set(js,[My(In,c.icons)])}))},kn=In=>{const Zn=Zt.element;In?(Ra(Zn,"tox-button--enabled"),Kn(Zn,"aria-pressed",!0)):(ma(Zn,"tox-button--enabled"),je(Zn,"aria-pressed"))},mn=()=>Qu(Zt.element,"tox-button--enabled");if(_)return o.onAction({setIcon:Dt,setActive:kn,isActive:mn});if(o.type==="button")return o.onAction({setIcon:Dt})})(),U={...o,name:_?o.text.getOr(o.icon.getOr("")):(m=o.text)!==null&&m!==void 0?m:o.icon.getOr(""),primary:o.buttonType==="primary",buttonType:V.from(o.buttonType),tooltip:o.tooltip,icon:o.icon,enabled:!0,borderless:o.borderless},Y=nN((b=o.buttonType)!==null&&b!==void 0?b:"secondary"),se=_?o.text.map(c.translate):V.some(c.translate(o.text)),fe=se.map(Ri),me=U.tooltip.or(se).map(Zt=>({"aria-label":c.translate(Zt),title:c.translate(Zt)})).getOr({}),Ce=x.map(Zt=>Zt.asSpec()),Ne=pS([Ce,fe]),st=o.icon.isSome()&&fe.isSome(),Ht={tag:"button",classes:Y.concat(...o.icon.isSome()&&!st?["tox-button--icon"]:[]).concat(...st?["tox-button--icon-and-text"]:[]).concat(...o.borderless?["tox-button--naked"]:[]).concat(...o.type==="togglebutton"&&o.active?["tox-button--enabled"]:[]),attributes:me},ut=[],lt=g4(U,V.some(I),ut,Ht,Ne,c);return Uc.sketch(lt)},M9=(o,c)=>IY(o,c),BY=(o,c)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:We(o.buttons,m=>M9(m,c))}),R9=nn().deviceType,LY=R9.isPhone(),N9=R9.isTablet(),P9=o=>{let c=!1;const m=We(o.buttons,b=>b.type==="group"?(c=!0,BY(b,o.providers)):M9(b,o.providers));return{uid:o.uid,dom:{tag:"div",classes:[c?"tox-view__toolbar":"tox-view__header",...LY||N9?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:An([Qo.config({}),Po.config({mode:"flow",selector:"button, .tox-button",focusInside:i1.OnEnterOrSpaceMode})]),components:c?m:[f1.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),f1.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:m})]}},I9=o=>({uid:o.uid,dom:{tag:"div",classes:["tox-view__pane"]}}),FY=(o,c,m,b)=>{const _={getPane:x=>kc.getPart(x,o,"pane"),getOnShow:x=>o.viewConfig.onShow,getOnHide:x=>o.viewConfig.onHide};return{uid:o.uid,dom:o.dom,components:c,apis:_}};var a_=fu({name:"silver.View",configFields:[Qt("viewConfig")],partFields:[Fd({factory:{sketch:P9},schema:[Qt("buttons"),Qt("providers")],name:"header"}),Fd({factory:{sketch:I9},schema:[],name:"pane"})],factory:FY,apis:{getPane:(o,c)=>o.getPane(c),getOnShow:(o,c)=>o.getOnShow(c),getOnHide:(o,c)=>o.getOnHide(c)}});const B9=(o,c,m)=>na(c,(b,_)=>{const x=ha(PY(b));return o.slot(_,a_.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:x,components:[...x.buttons.length>0?[a_.parts.header({buttons:x.buttons,providers:m})]:[],a_.parts.pane({})]}))}),L9=(o,c)=>ff.sketch(m=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:B9(m,o,c),slotBehaviours:mS.unnamedEvents([vi(b=>ff.hideAllSlots(b))])})),F9=o=>Ct(ff.getSlotNames(o),c=>ff.isShowing(o,c)),HY=o=>{const c=o.element;no(c,"display","none"),Kn(c,"aria-hidden","true")},$Y=o=>{const c=o.element;Ss(c,"display"),je(c,"aria-hidden")},H9=o=>({getContainer:J(o)}),$9=(o,c,m)=>{ff.getSlot(o,c).each(b=>{a_.getPane(b).each(_=>{m(b)(H9(_.element.dom))})})},zY=(o,c)=>$9(o,c,a_.getOnShow),VY=(o,c)=>$9(o,c,a_.getOnHide);var j4=Vc({factory:(o,c)=>{const x={setViews:(M,I)=>{ms.set(M,[L9(I,c.backstage.shared.providers)])},whichView:M=>sr.getCurrent(M).bind(F9),toggleView:(M,I,U,Y)=>sr.getCurrent(M).exists(se=>{const fe=F9(se),me=fe.exists(Ne=>Y===Ne),Ce=ff.getSlot(se,Y).isSome();return Ce&&(ff.hideAllSlots(se),me?(HY(M),I()):(U(),$Y(M),ff.showSlot(se,Y),zY(se,Y)),fe.each(Ne=>VY(se,Ne))),Ce})};return{uid:o.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:An([ms.config({}),sr.config({find:M=>{const I=ms.contents(M);return ds(I)}})]),apis:x}},name:"silver.ViewWrapper",configFields:[Qt("backstage")],apis:{setViews:(o,c,m)=>o.setViews(c,m),toggleView:(o,c,m,b,_)=>o.toggleView(c,m,b,_),whichView:(o,c)=>o.whichView(c)}});const UY=(o,c,m)=>{let b=!1;const _={getSocket:x=>kc.getPart(x,o,"socket"),setSidebar:(x,M,I)=>{kc.getPart(x,o,"sidebar").each(U=>u9(U,M,I))},toggleSidebar:(x,M)=>{kc.getPart(x,o,"sidebar").each(I=>sY(I,M))},whichSidebar:x=>kc.getPart(x,o,"sidebar").bind(rY).getOrNull(),getHeader:x=>kc.getPart(x,o,"header"),getToolbar:x=>kc.getPart(x,o,"toolbar"),setToolbar:(x,M)=>{kc.getPart(x,o,"toolbar").each(I=>{const U=We(M,i_);I.getApis().setGroups(I,U)})},setToolbars:(x,M)=>{kc.getPart(x,o,"multiple-toolbar").each(I=>{const U=We(M,Y=>We(Y,i_));F7.setItems(I,U)})},refreshToolbar:x=>{kc.getPart(x,o,"toolbar").each(I=>I.getApis().refresh(I))},toggleToolbarDrawer:x=>{kc.getPart(x,o,"toolbar").each(M=>{go(M.getApis().toggle,I=>I(M))})},toggleToolbarDrawerWithoutFocusing:x=>{kc.getPart(x,o,"toolbar").each(M=>{go(M.getApis().toggleWithoutFocusing,I=>I(M))})},isToolbarDrawerToggled:x=>kc.getPart(x,o,"toolbar").bind(M=>V.from(M.getApis().isOpen).map(I=>I(M))).getOr(!1),getThrobber:x=>kc.getPart(x,o,"throbber"),focusToolbar:x=>{kc.getPart(x,o,"toolbar").orThunk(()=>kc.getPart(x,o,"multiple-toolbar")).each(I=>{Po.focusIn(I)})},setMenubar:(x,M)=>{kc.getPart(x,o,"menubar").each(I=>{AN.setMenus(I,M)})},focusMenubar:x=>{kc.getPart(x,o,"menubar").each(M=>{AN.focus(M)})},setViews:(x,M)=>{kc.getPart(x,o,"viewWrapper").each(I=>{j4.setViews(I,M)})},toggleView:(x,M)=>kc.getPart(x,o,"viewWrapper").exists(I=>j4.toggleView(I,()=>_.showMainView(x),()=>_.hideMainView(x),M)),whichView:x=>kc.getPart(x,o,"viewWrapper").bind(j4.whichView).getOrNull(),hideMainView:x=>{b=_.isToolbarDrawerToggled(x),b&&_.toggleToolbarDrawer(x),kc.getPart(x,o,"editorContainer").each(M=>{const I=M.element;no(I,"display","none"),Kn(I,"aria-hidden","true")})},showMainView:x=>{b&&_.toggleToolbarDrawer(x),kc.getPart(x,o,"editorContainer").each(M=>{const I=M.element;Ss(I,"display"),je(I,"aria-hidden")})}};return{uid:o.uid,dom:o.dom,components:c,apis:_,behaviours:o.behaviours}},WY=p1.optional({factory:AN,name:"menubar",schema:[Qt("backstage")]}),jY=o=>o.type===pg.sliding?MY:o.type===pg.floating?OY:$d,ZY=p1.optional({factory:{sketch:o=>F7.sketch({uid:o.uid,dom:o.dom,listBehaviours:An([Po.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>$d({type:o.type,uid:oo("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:o.providers,onEscape:()=>(o.onEscape(),V.some(!0))}),setupItem:(c,m,b,_)=>{b1.setGroups(m,b)},shell:!0})},name:"multiple-toolbar",schema:[Qt("dom"),Qt("onEscape")]}),qY=p1.optional({factory:{sketch:o=>{const c=jY(o),m={type:o.type,uid:o.uid,onEscape:()=>(o.onEscape(),V.some(!0)),onToggled:(b,_)=>o.onToolbarToggled(_),cyclicKeying:!1,initGroups:[],getSink:o.getSink,providers:o.providers,moreDrawerData:{lazyToolbar:o.lazyToolbar,lazyMoreButton:o.lazyMoreButton,lazyHeader:o.lazyHeader},attributes:o.attributes};return c(m)}},name:"toolbar",schema:[Qt("dom"),Qt("onEscape"),Qt("getSink")]}),z9=p1.optional({factory:{sketch:gre},name:"header",schema:[Qt("dom")]}),GY=p1.optional({factory:{sketch:nY},name:"promotion",schema:[Qt("dom")]}),KY=p1.optional({name:"socket",schema:[Qt("dom")]}),$N=p1.optional({factory:{sketch:iY},name:"sidebar",schema:[Qt("dom")]}),YY=p1.optional({factory:{sketch:g9},name:"throbber",schema:[Qt("dom")]}),Z4=p1.optional({factory:j4,name:"viewWrapper",schema:[Qt("backstage")]}),XY=o=>({uid:o.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:o.components}),V9=p1.optional({factory:{sketch:XY},name:"editorContainer",schema:[]});var Wi=fu({name:"OuterContainer",factory:UY,configFields:[Qt("dom"),Qt("behaviours")],partFields:[z9,WY,qY,ZY,KY,$N,GY,YY,Z4,V9],apis:{getSocket:(o,c)=>o.getSocket(c),setSidebar:(o,c,m,b)=>{o.setSidebar(c,m,b)},toggleSidebar:(o,c,m)=>{o.toggleSidebar(c,m)},whichSidebar:(o,c)=>o.whichSidebar(c),getHeader:(o,c)=>o.getHeader(c),getToolbar:(o,c)=>o.getToolbar(c),setToolbar:(o,c,m)=>{o.setToolbar(c,m)},setToolbars:(o,c,m)=>{o.setToolbars(c,m)},refreshToolbar:(o,c)=>o.refreshToolbar(c),toggleToolbarDrawer:(o,c)=>{o.toggleToolbarDrawer(c)},toggleToolbarDrawerWithoutFocusing:(o,c)=>{o.toggleToolbarDrawerWithoutFocusing(c)},isToolbarDrawerToggled:(o,c)=>o.isToolbarDrawerToggled(c),getThrobber:(o,c)=>o.getThrobber(c),setMenubar:(o,c,m)=>{o.setMenubar(c,m)},focusMenubar:(o,c)=>{o.focusMenubar(c)},focusToolbar:(o,c)=>{o.focusToolbar(c)},setViews:(o,c,m)=>{o.setViews(c,m)},toggleView:(o,c,m)=>o.toggleView(c,m),whichView:(o,c)=>o.whichView(c)}});const JY="file edit view insert format tools table help",QY={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template inserttemplate codesample inserttable accordion | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},eX=(o,c,m)=>{const b=vB(m).split(/[ ,]/);return{text:o.title,getItems:()=>Pe(o.items,_=>{const x=_.toLowerCase();return x.trim().length===0?[]:dn(b,M=>M===x)?[]:x==="separator"||x==="|"?[{type:"separator"}]:c.menuItems[x]?[c.menuItems[x]]:[]})}},zN=o=>o.split(" "),q4=(o,c)=>{const m={...QY,...c.menus},b=Zs(c.menus).length>0,_=c.menubar===void 0||c.menubar===!0?zN(JY):zN(c.menubar===!1?"":c.menubar),x=ho(_,I=>{const U=ps(QY,I);return b?U||an(c.menus,I).exists(Y=>ps(Y,"items")):U}),M=We(x,I=>{const U=m[I];return eX({title:U.title,items:zN(U.items)},c,o)});return ho(M,I=>{const U=Y=>h(Y)||Y.type!=="separator";return I.getItems().length>0&&dn(I.getItems(),U)})},U9=o=>{const c=()=>{o._skinLoaded=!0,Aj(o)};return()=>{o.initialized?c():o.on("init",c)}},G4=(o,c)=>()=>xx(o,{message:c}),VN=(o,c,m)=>(o.on("remove",()=>m.unload(c)),m.load(c)),W9=(o,c)=>{const m=c+"/skin.min.css";return VN(o,m,o.ui.styleSheetLoader)},UN=(o,c)=>{if(Ro(it.fromDom(o.getElement()))){const b=c+"/skin.shadowdom.min.css";return VN(o,b,rx.DOM.styleSheetLoader)}else return Promise.resolve()},j9=(o,c)=>{const m=NB(c);return m&&c.contentCSS.push(m+(o?"/content.inline":"/content")+".min.css"),!sT(c)&&h(m)?Promise.all([W9(c,m),UN(c,m)]).then(U9(c),G4(c,"Skin could not be loaded")):Promise.resolve(U9(c)())},Z9=De(j9,!1),FS=De(j9,!0),q9=(o,c,m)=>{const b=(I,U,Y,se)=>{const fe=c.shared.providers.translate(I.title);if(I.type==="separator")return V.some({type:"separator",text:fe});if(I.type==="submenu"){const me=Pe(I.getStyleItems(),Ce=>_(Ce,U,se));return U===0&&me.length<=0?V.none():V.some({type:"nestedmenuitem",text:fe,enabled:me.length>0,getSubmenuItems:()=>Pe(I.getStyleItems(),Ce=>_(Ce,U,se))})}else return V.some({type:"togglemenuitem",text:fe,icon:I.icon,active:I.isSelected(se),enabled:!Y,onAction:m.onAction(I),...I.getStylePreview().fold(()=>({}),me=>({meta:{style:me}}))})},_=(I,U,Y)=>{const se=I.type==="formatter"&&m.isInvalid(I);return U===0?se?[]:b(I,U,!1,Y).toArray():b(I,U,se,Y).toArray()},x=I=>{const U=m.getCurrentValue(),Y=m.shouldHide?0:1;return Pe(I,se=>_(se,Y,U))};return{validateItems:x,getFetch:(I,U)=>(Y,se)=>{const fe=U(),me=x(fe),Ce=TS(me,pp.CLOSE_ON_EXECUTE,I,{isHorizontalMenu:!1,search:V.none()});se(Ce)}}},HS=(o,c,m)=>{const b=m.dataset,_=b.type==="basic"?()=>We(b.data,x=>k7(x,m.isSelectedFor,m.getPreviewFor)):b.getData;return{items:q9(o,c,m),getStyleItems:_}},iA=(o,c,m)=>{const{items:b,getStyleItems:_}=HS(o,c,m),x=I=>({getComponent:J(I)}),M=_0(o,"NodeChange",I=>{const U=I.getComponent();m.updateText(U),Ko.set(I.getComponent(),!o.selection.isEditable())});return r4({text:m.icon.isSome()?V.none():m.text,icon:m.icon,tooltip:V.from(m.tooltip),role:V.none(),fetch:b.getFetch(c,_),onSetup:M,getApi:x,columns:1,presets:"normal",classes:m.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",c.shared)},tX=o=>We(o,c=>{let m=c,b=c;const _=c.split("=");return _.length>1&&(m=_[0],b=_[1]),{title:m,format:b}}),WN=o=>({type:"basic",data:o});var $S;(function(o){o[o.SemiColon=0]="SemiColon",o[o.Space=1]="Space"})($S||($S={}));const nX=(o,c)=>c===$S.SemiColon?o.replace(/;$/,"").split(";"):o.split(" "),K4=(o,c,m)=>{const b=o.options.get(c);return{type:"basic",data:tX(nX(b,m))}},Y4=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],aA=o=>{const c=()=>Ct(Y4,I=>o.formatter.match(I.format)),m=I=>()=>o.formatter.match(I),b=I=>V.none,_=I=>{const Y=c().fold(J("left"),se=>se.title.toLowerCase());Ao(I,Ry,{icon:`align-${Y}`})},x=WN(Y4),M=I=>()=>Ct(Y4,U=>U.format===I.format).each(U=>o.execCommand(U.command));return{tooltip:"Align",text:V.none(),icon:V.some("align-left"),isSelectedFor:m,getCurrentValue:V.none,getPreviewFor:b,onAction:M,updateText:_,dataset:x,shouldHide:!1,isInvalid:I=>!o.formatter.canApply(I.format)}},jN=(o,c)=>iA(o,c,aA(o)),oX=(o,c)=>{const m=HS(o,c,aA(o));o.ui.registry.addNestedMenuItem("align",{text:c.shared.providers.translate("Align"),onSetup:Nf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},G9=(o,c)=>{const m=c(),b=We(m,_=>_.format);return V.from(o.formatter.closest(b)).bind(_=>Ct(m,x=>x.format===_)).orThunk(()=>cn(o.formatter.match("p"),{title:"Paragraph",format:"p"}))},ZN=o=>{const c="Paragraph",m=M=>()=>o.formatter.match(M),b=M=>()=>{const I=o.formatter.get(M);return I?V.some({tag:I.length>0&&(I[0].inline||I[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(M))}):V.none()},_=M=>{const U=G9(o,()=>x.data).fold(J(c),Y=>Y.title);Ao(M,Cg,{text:U})},x=K4(o,"block_formats",$S.SemiColon);return{tooltip:"Blocks",text:V.some(c),icon:V.none(),isSelectedFor:m,getCurrentValue:V.none,getPreviewFor:b,onAction:DR(o),updateText:_,dataset:x,shouldHide:!1,isInvalid:M=>!o.formatter.canApply(M.format)}},sX=(o,c)=>iA(o,c,ZN(o)),rX=(o,c)=>{const m=HS(o,c,ZN(o));o.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:Nf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},iX=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],qN=o=>{const c=o.split(/\s*,\s*/);return We(c,m=>m.replace(/^['"]+|['"]+$/g,""))},aX=o=>{const c=()=>{const m=qN(o.toLowerCase());return Ut(iX,b=>m.indexOf(b.toLowerCase())>-1)};return o.indexOf("-apple-system")===0&&c()},K9=o=>{const c="System Font",m=()=>{const Y=Ne=>Ne?qN(Ne)[0]:"",se=o.queryCommandValue("FontName"),fe=U.data,me=se?se.toLowerCase():"";return{matchOpt:Ct(fe,Ne=>{const st=Ne.format;return st.toLowerCase()===me||Y(st).toLowerCase()===Y(me).toLowerCase()}).orThunk(()=>cn(aX(me),{title:c,format:me})),font:se}},b=Y=>se=>se.exists(fe=>fe.format===Y),_=()=>{const{matchOpt:Y}=m();return Y},x=Y=>()=>V.some({tag:"div",styles:Y.indexOf("dings")===-1?{"font-family":Y}:{}}),M=Y=>()=>{o.undoManager.transact(()=>{o.focus(),o.execCommand("FontName",!1,Y.format)})},I=Y=>{const{matchOpt:se,font:fe}=m(),me=se.fold(J(fe),Ce=>Ce.title);Ao(Y,Cg,{text:me})},U=K4(o,"font_family_formats",$S.SemiColon);return{tooltip:"Fonts",text:V.some(c),icon:V.none(),isSelectedFor:b,getCurrentValue:_,getPreviewFor:x,onAction:M,updateText:I,dataset:U,shouldHide:!1,isInvalid:Qe}},GN=(o,c)=>iA(o,c,K9(o)),lX=(o,c)=>{const m=HS(o,c,K9(o));o.ui.registry.addNestedMenuItem("fontfamily",{text:c.shared.providers.translate("Fonts"),onSetup:Nf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},cX={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Y9=(()=>{const o="[0-9]+",m="[eE]"+("[+-]?"+o),b="\\.",_=I=>`(?:${I})?`,M=`[+-]?(?:${["Infinity",o+b+_(o)+_(m),b+o+_(m),o+_(m)].join("|")})`;return new RegExp(`^(${M})(.*)$`)})(),uX=(o,c)=>dn(c,m=>dn(cX[m],b=>o===b)),lA=(o,c)=>V.from(Y9.exec(o)).bind(b=>{const _=Number(b[1]),x=b[2];return uX(x,c)?V.some({value:_,unit:x}):V.none()}),fX=(o,c)=>lA(o,c).map(({value:m,unit:b})=>m+b),KN={tab:J(9),escape:J(27),enter:J(13),backspace:J(8),delete:J(46),left:J(37),up:J(38),right:J(39),down:J(40),space:J(32),home:J(36),end:J(35),pageUp:J(33),pageDown:J(34)},dX=(o,c,m)=>{let b=V.none();const _=lt=>lt.map(Zt=>Yn.getValue(Zt)).getOr(""),x=_0(o,"NodeChange SwitchMode",lt=>{const Zt=lt.getComponent();b=V.some(Zt),m.updateInputValue(Zt),Ko.set(Zt,!o.selection.isEditable())}),M=lt=>({getComponent:J(lt)}),I=Ho(F),U=oo("custom-number-input-events"),Y=(lt,Zt,Dt)=>{const kn=_(b),mn=m.getNewValue(kn,lt),In=kn.length-`${mn}`.length,Zn=b.map(yo=>yo.element.dom.selectionStart-In),js=b.map(yo=>yo.element.dom.selectionEnd-In);m.onAction(mn,Dt),b.each(yo=>{Yn.setValue(yo,mn),Zt&&(Zn.each(ws=>yo.element.dom.selectionStart=ws),js.each(ws=>yo.element.dom.selectionEnd=ws))})},se=(lt,Zt)=>Y((Dt,kn)=>Dt-kn,lt,Zt),fe=(lt,Zt)=>Y((Dt,kn)=>Dt+kn,lt,Zt),me=lt=>bc(lt.element).fold(V.none,Zt=>(sf(Zt),V.some(!0))),Ce=lt=>Qp(lt.element)?(bf(lt.element).each(Zt=>sf(Zt)),V.some(!0)):V.none(),Ne=(lt,Zt,Dt,kn)=>{const mn=c.shared.providers.translate(Dt),In=oo("altExecuting"),Zn=_0(o,"NodeChange SwitchMode",yo=>{Ko.set(yo.getComponent(),!o.selection.isEditable())}),js=yo=>{Ko.isDisabled(yo)||lt(!0)};return Uc.sketch({dom:{tag:"button",attributes:{title:mn,"aria-label":mn},classes:kn.concat(Zt)},components:[F5(Zt,c.shared.providers.icons)],buttonBehaviours:An([Ko.config({}),ks(In,[qb({onSetup:Zn,getApi:M},I),Gb({getApi:M},I),en(xf(),(yo,ws)=>{(ws.event.raw.keyCode===KN.space()||ws.event.raw.keyCode===KN.enter())&&(Ko.isDisabled(yo)||lt(!1))}),en(Kh(),js),en(jm(),js)])]),eventOrder:{[xf()]:[In,"keying"],[Kh()]:[In,"alloy.base.behaviour"],[jm()]:[In,"alloy.base.behaviour"]}})},st=Qr(Ne(lt=>se(!1,lt),"minus","Decrease font size",["highlight-on-focus"])),Ht=Qr(Ne(lt=>fe(!1,lt),"plus","Increase font size",["highlight-on-focus"])),ut=Qr({dom:{tag:"div",classes:["tox-input-wrapper","highlight-on-focus"]},components:[Hw.sketch({inputBehaviours:An([Ko.config({}),ks(U,[qb({onSetup:x,getApi:M},I),Gb({getApi:M},I)]),ks("input-update-display-text",[en(Cg,(lt,Zt)=>{Yn.setValue(lt,Zt.event.text)}),en(tu(),lt=>{m.onAction(Yn.getValue(lt))}),en(Wg(),lt=>{m.onAction(Yn.getValue(lt))})]),Po.config({mode:"special",onEnter:lt=>(Y(we,!0,!0),V.some(!0)),onEscape:me,onUp:lt=>(fe(!0,!1),V.some(!0)),onDown:lt=>(se(!0,!1),V.some(!0)),onLeft:(lt,Zt)=>(Zt.cut(),V.none()),onRight:(lt,Zt)=>(Zt.cut(),V.none())})])})],behaviours:An([Qo.config({}),Po.config({mode:"special",onEnter:Ce,onSpace:Ce,onEscape:me}),ks("input-wrapper-events",[en(Sl(),lt=>{xt([st,Ht],Zt=>{const Dt=it.fromDom(Zt.get(lt).element.dom);Qp(Dt)&&$v(Dt)})})])])});return{dom:{tag:"div",classes:["tox-number-input"]},components:[st.asSpec(),ut.asSpec(),Ht.asSpec()],behaviours:An([Qo.config({}),Po.config({mode:"flow",focusInside:i1.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:lt=>Qp(lt.element)?V.none():(sf(lt.element),V.some(!0))})])}},hX={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},mX={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},X9=(o,c)=>{const m=Math.pow(10,c);return Math.round(o*m)/m},gX=(o,c)=>/[0-9.]+px$/.test(o)?X9(parseInt(o,10)*72/96,c||0)+"pt":an(mX,o).getOr(o),pX=o=>an(hX,o).getOr(""),J9=o=>{const c=()=>{let U=V.none();const Y=I.data,se=o.queryCommandValue("FontSize");if(se)for(let fe=3;U.isNone()&&fe>=0;fe--){const me=gX(se,fe),Ce=pX(me);U=Ct(Y,Ne=>Ne.format===se||Ne.format===me||Ne.format===Ce)}return{matchOpt:U,size:se}},m=U=>Y=>Y.exists(se=>se.format===U),b=()=>{const{matchOpt:U}=c();return U},_=J(V.none),x=U=>()=>{o.undoManager.transact(()=>{o.focus(),o.execCommand("FontSize",!1,U.format)})},M=U=>{const{matchOpt:Y,size:se}=c(),fe=Y.fold(J(se),me=>me.title);Ao(U,Cg,{text:fe})},I=K4(o,"font_size_formats",$S.Space);return{tooltip:"Font sizes",text:V.some("12pt"),icon:V.none(),isSelectedFor:m,getPreviewFor:_,getCurrentValue:b,onAction:x,updateText:M,dataset:I,shouldHide:!1,isInvalid:Qe}},YN=(o,c)=>iA(o,c,J9(o)),XN=o=>{var c;const m={step:1};return(c={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[o])!==null&&c!==void 0?c:m},bX=16,vX=o=>o>=0,yX=o=>{const c=()=>o.queryCommandValue("FontSize");return{updateInputValue:b=>Ao(b,Cg,{text:c()}),onAction:(b,_)=>o.execCommand("FontSize",!1,b,{skip_focus:!_}),getNewValue:(b,_)=>{lA(b,["unsupportedLength","empty"]);const x=lA(b,["unsupportedLength","empty"]).or(lA(c(),["unsupportedLength","empty"])),M=x.map(se=>se.value).getOr(bX),I=kB(o),U=x.map(se=>se.unit).filter(se=>se!=="").getOr(I),Y=_(M,XN(U).step);return`${vX(Y)?Y:M}${U}`}}},wX=(o,c)=>dX(o,c,yX(o)),_X=(o,c)=>{const m=HS(o,c,J9(o));o.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:Nf(o),getSubmenuItems:()=>m.items.validateItems(m.getStyleItems())})},Q9=(o,c)=>{const m="Paragraph",b=M=>()=>o.formatter.match(M),_=M=>()=>{const I=o.formatter.get(M);return I!==void 0?V.some({tag:I.length>0&&(I[0].inline||I[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(M))}):V.none()},x=M=>{const I=fe=>lN(fe)?Pe(fe.items,I):_7(fe)?[{title:fe.title,format:fe.format}]:[],U=Pe(dN(o),I),se=G9(o,J(U)).fold(J(m),fe=>fe.title);Ao(M,Cg,{text:se})};return{tooltip:"Formats",text:V.some(m),icon:V.none(),isSelectedFor:b,getCurrentValue:V.none,getPreviewFor:_,onAction:DR(o),updateText:x,shouldHide:BM(o),isInvalid:M=>!o.formatter.canApply(M.format),dataset:c}},CX=(o,c)=>{const m={type:"advanced",...c.styles};return iA(o,c,Q9(o,m))},SX=(o,c)=>{const m={type:"advanced",...c.styles},b=HS(o,c,Q9(o,m));o.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:Nf(o),getSubmenuItems:()=>b.items.validateItems(b.getStyleItems())})},kX=J([Qt("toggleClass"),Qt("fetch"),rg("onExecute"),St("getHotspot",V.some),St("getAnchorOverrides",J({})),yh(),rg("onItemExecute"),kr("lazySink"),Qt("dom"),Gs("onOpen"),$l("splitDropdownBehaviours",[rl,Po,Qo]),St("matchWidth",!1),St("useMinWidth",!1),St("eventOrder",{}),kr("role")].concat(XR())),eH=zc({factory:Uc,schema:[Qt("dom")],name:"arrow",defaults:()=>({buttonBehaviours:An([Qo.revoke()])}),overrides:o=>({dom:{tag:"span",attributes:{role:"presentation"}},action:c=>{c.getSystem().getByUid(o.uid).each(lh)},buttonBehaviours:An([Ms.config({toggleOnExecute:!1,toggleClass:o.toggleClass})])})}),X4=zc({factory:Uc,schema:[Qt("dom")],name:"button",defaults:()=>({buttonBehaviours:An([Qo.revoke()])}),overrides:o=>({dom:{tag:"span",attributes:{role:"presentation"}},action:c=>{c.getSystem().getByUid(o.uid).each(m=>{o.onExecute(m,c)})}})}),JN=J([eH,X4,Fd({factory:{sketch:o=>({uid:o.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:o.text}})},schema:[Qt("text")],name:"aria-descriptor"}),Sh({schema:[Iv()],name:"menu",defaults:o=>({onExecute:(c,m)=>{c.getSystem().getByUid(o.uid).each(b=>{o.onItemExecute(b,c,m)})}})}),oL()]),tH=(o,c,m,b)=>{const _=se=>{sr.getCurrent(se).each(fe=>{Nr.highlightFirst(fe),Po.focusIn(fe)})},x=se=>{KR(o,we,se,b,_,sd.HighlightMenuAndItem).get(F)},M=se=>(x(se),V.some(!0)),I=se=>{const fe=o1(se,o,"button");return lh(fe),V.some(!0)},U={...ri([vi((se,fe)=>{Ai(se,o,"aria-descriptor").each(Ce=>{const Ne=oo("aria");Kn(Ce.element,"id",Ne),Kn(se.element,"aria-describedby",Ne)})})]),...q3(V.some(x))},Y={repositionMenus:se=>{Ms.isOn(se)&&cL(se)}};return{uid:o.uid,dom:o.dom,components:c,apis:Y,eventOrder:{...o.eventOrder,[Yu()]:["disabling","toggling","alloy.base.behaviour"]},events:U,behaviours:Ql(o.splitDropdownBehaviours,[rl.config({others:{sandbox:se=>{const fe=o1(se,o,"arrow");return YR(o,se,{onOpen:()=>{Ms.on(fe),Ms.on(se)},onClose:()=>{Ms.off(fe),Ms.off(se)}})}}}),Po.config({mode:"special",onSpace:I,onEnter:I,onDown:M}),Qo.config({}),Ms.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},v1=fu({name:"SplitDropdown",configFields:kX(),partFields:JN(),factory:tH,apis:{repositionMenus:(o,c)=>o.repositionMenus(c)}}),QN=o=>({isEnabled:()=>!Ko.isDisabled(o),setEnabled:c=>Ko.set(o,!c),setText:c=>Ao(o,Cg,{text:c}),setIcon:c=>Ao(o,Ry,{icon:c})}),EX=o=>({setActive:c=>{Ms.set(o,c)},isActive:()=>Ms.isOn(o),isEnabled:()=>!Ko.isDisabled(o),setEnabled:c=>Ko.set(o,!c),setText:c=>Ao(o,Cg,{text:c}),setIcon:c=>Ao(o,Ry,{icon:c})}),nH=(o,c)=>o.map(m=>({"aria-label":c.translate(m),title:c.translate(m)})).getOr({}),oH=oo("focus-button"),e6=(o,c,m,b,_)=>{const x=c.map(I=>Qr(xF(I,"tox-tbtn",_))),M=o.map(I=>Qr(My(I,_.icons)));return{dom:{tag:"button",classes:["tox-tbtn"].concat(c.isSome()?["tox-tbtn--select"]:[]),attributes:nH(m,_)},components:pS([M.map(I=>I.asSpec()),x.map(I=>I.asSpec())]),eventOrder:{[Br()]:["focusing","alloy.base.behaviour",Oy],[Au()]:[Oy,"toolbar-group-button-events"]},buttonBehaviours:An([vg.toolbarButton(_.isDisabled),ec(),ks(Oy,[vi((I,U)=>s4(I)),en(Cg,(I,U)=>{x.bind(Y=>Y.getOpt(I)).each(Y=>{ms.set(Y,[Ri(_.translate(U.event.text))])})}),en(Ry,(I,U)=>{M.bind(Y=>Y.getOpt(I)).each(Y=>{ms.set(Y,[My(U.event.icon,_.icons)])})}),en(Br(),(I,U)=>{U.event.prevent(),nr(I,oH)})])].concat(b.getOr([])))}},xX=(o,c,m,b)=>{const _=c.shared,x=Ho(F),M={toolbarButtonBehaviours:[],getApi:QN,onSetup:o.onSetup},I=[ks("toolbar-group-button-events",[qb(M,x),Gb(M,x)])];return iv.sketch({lazySink:_.getSink,fetch:()=>Bu.nu(U=>{U(We(m(o.items),i_))}),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:e6(o.icon,o.text,o.tooltip,V.some(I),_.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:b}}}})},sH=(o,c,m)=>{var b;const _=Ho(F),x=e6(o.icon,o.text,o.tooltip,V.none(),m);return Uc.sketch({dom:x.dom,components:x.components,eventOrder:L5,buttonBehaviours:{...An([ks("toolbar-button-events",[kF({onAction:o.onAction,getApi:c.getApi}),qb(c,_),Gb(c,_)]),vg.toolbarButton(()=>!o.enabled||m.isDisabled()),ec()].concat(c.toolbarButtonBehaviours)),[Oy]:(b=x.buttonBehaviours)===null||b===void 0?void 0:b[Oy]}})},AX=(o,c)=>t6(o,c,[]),t6=(o,c,m)=>sH(o,{toolbarButtonBehaviours:m.length>0?[ks("toolbarButtonWith",m)]:[],getApi:QN,onSetup:o.onSetup},c),TX=(o,c)=>rH(o,c,[]),rH=(o,c,m)=>sH(o,{toolbarButtonBehaviours:[ms.config({}),Ms.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(m.length>0?[ks("toolbarToggleButtonWith",m)]:[]),getApi:EX,onSetup:o.onSetup},c),n6=(o,c,m)=>b=>Bu.nu(_=>c.fetch(_)).map(_=>V.from(n5(Jr(MT(oo("menu-value"),_,x=>{c.onItemAction(o(b),x)},c.columns,c.presets,pp.CLOSE_ON_EXECUTE,c.select.getOr(Qe),m),{movement:RT(c.columns,c.presets),menuBehaviours:mS.unnamedEvents(c.columns!=="auto"?[]:[vi((x,M)=>{bR(x,4,zB(c.presets)).each(({numRows:I,numColumns:U})=>{Po.setGridSize(x,I,U)})})])})))),DX=(o,c)=>{const m=x=>({isEnabled:()=>!Ko.isDisabled(x),setEnabled:M=>Ko.set(x,!M),setIconFill:(M,I)=>{ta(x.element,`svg path[class="${M}"], rect[class="${M}"]`).each(U=>{Kn(U,"fill",I)})},setActive:M=>{Kn(x.element,"aria-pressed",M),ta(x.element,"span").each(I=>{x.getSystem().getByDom(I).each(U=>Ms.set(U,M))})},isActive:()=>ta(x.element,"span").exists(M=>x.getSystem().getByDom(M).exists(Ms.isOn)),setText:M=>ta(x.element,"span").each(I=>x.getSystem().getByDom(I).each(U=>Ao(U,Cg,{text:M}))),setIcon:M=>ta(x.element,"span").each(I=>x.getSystem().getByDom(I).each(U=>Ao(U,Ry,{icon:M})))}),b=Ho(F),_={getApi:m,onSetup:o.onSetup};return v1.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...nH(o.tooltip,c.providers)}},onExecute:x=>{const M=m(x);M.isEnabled()&&o.onAction(M)},onItemExecute:(x,M,I)=>{},splitDropdownBehaviours:An([vg.splitButton(c.providers.isDisabled),ec(),ks("split-dropdown-events",[vi((x,M)=>s4(x)),en(oH,Qo.focus),qb(_,b),Gb(_,b)]),Mx.config({})]),eventOrder:{[Au()]:["alloy.base.behaviour","split-dropdown-events"]},toggleClass:"tox-tbtn--enabled",lazySink:c.getSink,fetch:n6(m,o,c.providers),parts:{menu:fS(!1,o.columns,o.presets)},components:[v1.parts.button(e6(o.icon,o.text,V.none(),V.some([Ms.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),c.providers)),v1.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:gB("chevron-down",c.providers.icons)},buttonBehaviours:An([vg.splitButton(c.providers.isDisabled),ec(),DM()])}),v1.parts["aria-descriptor"]({text:c.providers.translate("To open the popup, press Shift+Enter")})]})},OX=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],cA=(o,c)=>(m,b,_)=>{const x=o(m).mapError(M=>kd(M)).getOrDie();return c(x,b,_)},MX={button:cA(lR,(o,c)=>AX(o,c.shared.providers)),togglebutton:cA(cR,(o,c)=>TX(o,c.shared.providers)),menubutton:cA(xN,(o,c)=>jx(o,"tox-tbtn",c,V.none(),!1)),splitbutton:cA(QK,(o,c)=>DX(o,c.shared)),grouptoolbarbutton:cA(n9,(o,c,m)=>{const b=m.ui.registry.getAll().buttons,_=M=>J4(m,{buttons:b,toolbar:M,allowToolbarGroups:!1},c,V.none()),x={[Eb]:c.shared.header.isPositionedAtTop()?vh.TopToBottom:vh.BottomToTop};switch(aS(m)){case pg.floating:return xX(o,c,_,x);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})},RX=(o,c,m)=>an(MX,o.type).fold(()=>(console.error("skipping button defined by",o),V.none()),b=>V.some(b(o,c,m))),iH={styles:CX,fontsize:YN,fontsizeinput:wX,fontfamily:GN,blocks:sX,align:jN},aH=o=>{const c=We(OX,m=>{const b=ho(m.items,_=>ps(o,_)||ps(iH,_));return{name:m.name,items:b}});return ho(c,m=>m.items.length>0)},lH=o=>{const c=o.split("|");return We(c,m=>({items:m.trim().split(" ")}))},cH=o=>ee(o,c=>ps(c,"name")&&ps(c,"items")),NX=o=>{const c=o.toolbar,m=o.buttons;return c===!1?[]:c===void 0||c===!0?aH(m):h(c)?lH(c):cH(c)?c:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},uH=(o,c,m,b,_,x)=>an(c,m.toLowerCase()).orThunk(()=>x.bind(M=>Js(M,I=>an(c,I+m.toLowerCase())))).fold(()=>an(iH,m.toLowerCase()).map(M=>M(o,_)),M=>M.type==="grouptoolbarbutton"&&!b?(console.warn(`Ignoring the '${m}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),V.none()):RX(M,_,o)),J4=(o,c,m,b)=>{const _=NX(c),x=We(_,M=>{const I=Pe(M.items,U=>U.trim().length===0?[]:uH(o,c.buttons,U,c.allowToolbarGroups,m,b).toArray());return{title:V.from(o.translate(M.name)),items:I}});return ho(x,M=>M.items.length>0)},fH=(o,c,m,b)=>{const _=c.mainUi.outerContainer,x=m.toolbar,M=m.buttons;if(ee(x,h)){const I=x.map(U=>{const Y={toolbar:U,buttons:M,allowToolbarGroups:m.allowToolbarGroups};return J4(o,Y,b,V.none())});Wi.setToolbars(_,I)}else Wi.setToolbar(_,J4(o,m,b,V.none()))},dH=nn(),hH=dH.os.isiOS()&&dH.os.version.major<=12,PX=(o,c)=>{const{uiMotherships:m}=c,b=o.dom;let _=o.getWin();const x=o.getDoc().documentElement,M=Ho(fr(_.innerWidth,_.innerHeight)),I=Ho(fr(x.offsetWidth,x.offsetHeight)),U=()=>{const me=M.get();(me.left!==_.innerWidth||me.top!==_.innerHeight)&&(M.set(fr(_.innerWidth,_.innerHeight)),AR(o))},Y=()=>{const me=o.getDoc().documentElement,Ce=I.get();(Ce.left!==me.offsetWidth||Ce.top!==me.offsetHeight)&&(I.set(fr(me.offsetWidth,me.offsetHeight)),AR(o))},se=me=>{ky(o,me)};b.bind(_,"resize",U),b.bind(_,"scroll",se);const fe=i0(it.fromDom(o.getBody()),"load",Y);o.on("hide",()=>{xt(m,me=>{no(me.element,"display","none")})}),o.on("show",()=>{xt(m,me=>{Ss(me.element,"display")})}),o.on("NodeChange",Y),o.on("remove",()=>{fe.unbind(),b.unbind(_,"resize",U),b.unbind(_,"scroll",se),_=null})},mH=(o,c,m)=>{y0(o)&&hw(m.mainUi.mothership.element,m.popupUi.mothership),iy(c,m.dialogUi.mothership)};var IX=Object.freeze({__proto__:null,render:async(o,c,m,b,_)=>{const{mainUi:x,uiMotherships:M}=c,I=Ho(0),U=x.outerContainer;await Z9(o);const Y=it.fromDom(_.targetNode),se=vn(Pt(Y));hw(Y,x.mothership),mH(o,se,c),o.on("PostRender",()=>{Wi.setSidebar(U,m.sidebar,OB(o)),fH(o,c,m,b),I.set(o.getWin().innerWidth),Wi.setMenubar(U,q4(o,m)),Wi.setViews(U,m.views),PX(o,c)});const fe=Wi.getSocket(U).getOrDie("Could not find expected socket element");if(hH){mi(fe.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const st=gF(()=>{o.dispatch("ScrollContent")},20),Ht=Sc(fe.element,"scroll",st.throttle);o.on("remove",Ht.unbind)}v8(o,c),o.addCommand("ToggleSidebar",(st,Ht)=>{Wi.toggleSidebar(U,Ht),o.dispatch("ToggleSidebar")}),o.addQueryValueHandler("ToggleSidebar",()=>{var st;return(st=Wi.whichSidebar(U))!==null&&st!==void 0?st:""}),o.addCommand("ToggleView",(st,Ht)=>{if(Wi.toggleView(U,Ht)){const ut=U.element;x.mothership.broadcastOn([_h()],{target:ut}),xt(M,lt=>{lt.broadcastOn([_h()],{target:ut})}),A(Wi.whichView(U))&&(o.focus(),o.nodeChanged(),Wi.refreshToolbar(U))}}),o.addQueryValueHandler("ToggleView",()=>{var st;return(st=Wi.whichView(U))!==null&&st!==void 0?st:""});const me=aS(o),Ce=()=>{Wi.refreshToolbar(c.mainUi.outerContainer)};(me===pg.sliding||me===pg.floating)&&o.on("ResizeWindow ResizeEditor ResizeContent",()=>{const st=o.getWin().innerWidth;st!==I.get()&&(Ce(),I.set(st))});const Ne={setEnabled:st=>{Ww(c,!st)},isEnabled:()=>!Ko.isDisabled(U)};return{iframeContainer:fe.element.dom,editorContainer:U.element.dom,api:Ne}}});const o6=o=>/^[0-9\.]+(|px)$/i.test(""+o)?V.some(parseInt(""+o,10)):V.none(),s6=o=>q(o)?o+"px":o,Q4=(o,c,m)=>{const b=c.filter(x=>o<x),_=m.filter(x=>o>x);return b.or(_).getOr(o)},BX=o=>{const c=tT(o),m=PM(o),b=IM(o);return o6(c).map(_=>Q4(_,m,b))},LX=o=>BX(o).getOr(tT(o)),r6=o=>{const c=NM(o),m=ax(o),b=rS(o);return o6(c).map(_=>Q4(_,m,b))},FX=o=>r6(o).getOr(NM(o)),{ToolbarLocation:i6,ToolbarMode:gH}=_W,HX=40,$X=(o,c,m,b,_)=>{const{mainUi:x,uiMotherships:M}=m,I=rx.DOM,U=cS(o),Y=hx(o),se=rS(o).or(r6(o)),fe=b.shared.header,me=fe.isPositionedAtTop,Ce=aS(o),Ne=Ce===gH.sliding||Ce===gH.floating,st=Ho(!1),Ht=()=>st.get()&&!o.removed,ut=Fo=>Ne?Fo.fold(J(0),ir=>ir.components().length>1?Oi(ir.components()[1].element):0):0,lt=Fo=>{switch(FM(o)){case i6.auto:const ir=Wi.getToolbar(x.outerContainer),Fn=ut(ir),po=Oi(Fo.element)-Fn,ls=li(c);if(ls.y>po)return"top";{const zo=bu(c),bs=Math.max(zo.dom.scrollHeight,Oi(zo));return ls.bottom<bs-po||le().bottom<ls.bottom-po?"bottom":"top"}case i6.bottom:return"bottom";case i6.top:default:return"top"}},Zt=Fo=>{_.on(ir=>{vl.setModes(ir,[Fo]),fe.setDockingMode(Fo);const Fn=me()?vh.TopToBottom:vh.BottomToTop;Kn(ir.element,Eb,Fn)})},Dt=()=>{_.on(Fo=>{const ir=se.getOrThunk(()=>{const Fn=o6(qr(Li(),"margin-left")).getOr(0);return Ji(Li())-vc(c).left+Fn});no(Fo.element,"max-width",ir+"px")})},kn=Fo=>{_.on(ir=>{const Fn=Wi.getToolbar(x.outerContainer),po=ut(Fn),ls=li(c),{top:Xs,left:zo}=mn(o,x.outerContainer.element).fold(()=>({top:me()?Math.max(ls.y-Oi(ir.element)+po,0):ls.bottom,left:ls.x}),$r=>{var df;const pa=li($r),Ud=(df=$r.dom.scrollTop)!==null&&df!==void 0?df:0,Sp=Cr($r,Li()),zy=Sp?Math.max(ls.y-Oi(ir.element)+po,0):ls.y-pa.y+Ud-Oi(ir.element)+po;return{top:me()?zy:ls.bottom,left:Sp?ls.x:ls.x-pa.x}}),bs={position:"absolute",left:Math.round(zo)+"px",top:Math.round(Xs)+"px"},Ti=Fo.map($r=>{const df=ic(),pa=150,Ud=window.innerWidth-(zo-df.left);return{width:Math.max(Math.min($r,Ud),pa)+"px"}}).getOr({});mi(x.outerContainer.element,{...bs,...Ti})})},mn=(Fo,ir)=>y0(Fo)?yN(ir):V.none(),In=()=>{xt(M,Fo=>{Fo.broadcastOn([p0()],{})})},Zn=()=>{if(U)return V.none();if(vc(x.outerContainer.element).left+Ha(x.outerContainer.element)>=window.innerWidth-HX||Xi(x.outerContainer.element,"width").isSome()){no(x.outerContainer.element,"position","absolute"),no(x.outerContainer.element,"left","0px"),Ss(x.outerContainer.element,"width");const ir=Ha(x.outerContainer.element);return V.some(ir)}else return V.none()},js=Fo=>{if(!Ht())return;U||Dt();const ir=U?V.none():Zn();Ne&&Wi.refreshToolbar(x.outerContainer),U||kn(ir),Y&&_.on(Fo),In()},yo=()=>U||!Y||!Ht()?!1:_.get().exists(Fo=>{const ir=fe.getDockingMode(),Fn=lt(Fo);return Fn!==ir?(Zt(Fn),!0):!1});return{isVisible:Ht,isPositionedAtTop:me,show:()=>{st.set(!0),no(x.outerContainer.element,"display","flex"),I.addClass(o.getBody(),"mce-edit-focus"),xt(M,Fo=>{Ss(Fo.element,"display")}),yo(),y0(o)?js(Fo=>vl.isDocked(Fo)?vl.reset(Fo):vl.refresh(Fo)):js(vl.refresh)},hide:()=>{st.set(!1),no(x.outerContainer.element,"display","none"),I.removeClass(o.getBody(),"mce-edit-focus"),xt(M,Fo=>{no(Fo.element,"display","none")})},update:js,updateMode:()=>{yo()&&js(vl.reset)},repositionPopups:In}},pH=(o,c)=>{const m=li(o);return{pos:c?m.y:m.bottom,bounds:m}},zX=(o,c,m,b)=>{const _=Ho(pH(c,m.isPositionedAtTop())),x=Y=>{const{pos:se,bounds:fe}=pH(c,m.isPositionedAtTop()),{pos:me,bounds:Ce}=_.get(),Ne=fe.height!==Ce.height||fe.width!==Ce.width;_.set({pos:se,bounds:fe}),Ne&&AR(o,Y),m.isVisible()&&(me!==se?m.update(vl.reset):Ne&&(m.updateMode(),m.repositionPopups()))};b||(o.on("activate",m.show),o.on("deactivate",m.hide)),o.on("SkinLoaded ResizeWindow",()=>m.update(vl.reset)),o.on("NodeChange keydown",Y=>{requestAnimationFrame(()=>x(Y))});let M=0;const I=uf(()=>m.update(vl.refresh),33);o.on("ScrollWindow",()=>{const Y=ic().left;Y!==M&&(M=Y,I.throttle()),m.updateMode()}),y0(o)&&o.on("ElementScroll",Y=>{m.update(vl.refresh)});const U=r0();U.set(i0(it.fromDom(o.getBody()),"load",Y=>x(Y.raw))),o.on("remove",()=>{U.clear()})};var UX=Object.freeze({__proto__:null,render:async(o,c,m,b,_)=>{const{mainUi:x}=c,M=Ui(),I=it.fromDom(_.targetNode),U=$X(o,I,c,b,M),Y=$M(o);await FS(o);const se=()=>{if(M.isSet()){U.show();return}M.set(Wi.getHeader(x.outerContainer).getOrDie());const me=iT(o);y0(o)?(hw(I,x.mothership),hw(I,c.popupUi.mothership)):iy(me,x.mothership),iy(me,c.dialogUi.mothership),fH(o,c,m,b),Wi.setMenubar(x.outerContainer,q4(o,m)),U.show(),zX(o,I,U,Y),o.nodeChanged()};o.on("show",se),o.on("hide",U.hide),Y||(o.on("focus",se),o.on("blur",U.hide)),o.on("init",()=>{(o.hasFocus()||Y)&&se()}),v8(o,c);const fe={show:se,hide:U.hide,setEnabled:me=>{Ww(c,!me)},isEnabled:()=>!Ko.isDisabled(x.outerContainer)};return{editorContainer:x.outerContainer.element.dom,api:fe}}});const WX=()=>{const o=Ui(),c=Ui(),m=Ui();return{dialogUi:o,popupUi:c,mainUi:m,getUiMotherships:()=>{const x=o.get().map(I=>I.mothership),M=c.get().map(I=>I.mothership);return x.fold(()=>M.toArray(),I=>M.fold(()=>[I],U=>Cr(I.element,U.element)?[I]:[I,U]))},lazyGetInOuterOrDie:(x,M)=>()=>m.get().bind(I=>M(I.outerContainer)).getOrDie(`Could not find ${x} element in OuterContainer`)}},bH="contexttoolbar-show",vH="contexttoolbar-hide",yH=o=>({hide:()=>nr(o,Ma()),getValue:()=>Yn.getValue(o)}),a6=(o,c)=>en(AS,(m,b)=>{const _=o.get(m),x=yH(_);c.onAction(x,b.event.buttonApi)}),jX=(o,c,m)=>{const{primary:b,..._}=c.original,x=ha(lR({..._,type:"button",onAction:F}));return t6(x,m,[a6(o,c)])},ZX=(o,c,m)=>{const{primary:b,..._}=c.original,x=ha(cR({..._,type:"togglebutton",onAction:F}));return rH(x,m,[a6(o,c)])},qX=o=>o.type==="contextformtogglebutton",zS=(o,c,m)=>qX(c)?ZX(o,c,m):jX(o,c,m),GX=(o,c,m)=>{const b=We(c,M=>Qr(zS(o,M,m)));return{asSpecs:()=>We(b,M=>M.asSpec()),findPrimary:M=>Js(c,(I,U)=>I.primary?V.from(b[U]).bind(Y=>Y.getOpt(M)).filter(_e(Ko.isDisabled)):V.none())}},wH=(o,c)=>{const m=o.label.fold(()=>({}),x=>({"aria-label":x})),b=Qr(Hw.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:o.initValue(),inputAttributes:m,selectOnFocus:!0,inputBehaviours:An([Po.config({mode:"special",onEnter:x=>_.findPrimary(x).map(M=>(lh(M),!0)),onLeft:(x,M)=>(M.cut(),V.none()),onRight:(x,M)=>(M.cut(),V.none())})])})),_=GX(b,o.commands,c);return[{title:V.none(),items:[b.asSpec()]},{title:V.none(),items:_.asSpecs()}]},KX={renderContextForm:(o,c,m)=>$d({type:o,uid:oo("context-toolbar"),initGroups:wH(c,m),onEscape:V.none,cyclicKeying:!0,providers:m}),buildInitGroups:wH},_H=(o,c,m)=>c.bottom-o.y>=m&&o.bottom-c.y>=m,YX=o=>{const c=o.getBoundingClientRect();if(c.height<=0&&c.width<=0){const m=pd(it.fromDom(o.startContainer),o.startOffset).element;return(Ja(m)?Fa(m):V.some(m)).filter(gr).map(_=>_.dom.getBoundingClientRect()).getOr(c)}else return c},l6=o=>{const c=o.selection.getRng(),m=YX(c);if(o.inline){const b=ic();return si(b.left+m.left,b.top+m.top,m.width,m.height)}else{const b=Bl(it.fromDom(o.getBody()));return si(b.x+m.left,b.y+m.top,m.width,m.height)}},XX=(o,c)=>c.filter(m=>qs(m)&&gu(m)).map(Bl).getOrThunk(()=>l6(o)),c6=(o,c,m)=>{const b=Math.max(o.x+m,c.x),_=Math.min(o.right-m,c.right);return{x:b,width:_-b}},JX=(o,c,m,b,_,x)=>{const M=it.fromDom(o.getContainer()),I=ta(M,".tox-editor-header").getOr(M),U=li(I),Y=U.y>=c.bottom,se=b&&!Y;if(o.inline&&se)return{y:Math.max(U.bottom+x,m.y),bottom:m.bottom};if(o.inline&&!se)return{y:m.y,bottom:Math.min(U.y-x,m.bottom)};const fe=_==="line"?li(M):c;return se?{y:Math.max(U.bottom+x,m.y),bottom:Math.min(fe.bottom-x,m.bottom)}:{y:Math.max(fe.y+x,m.y),bottom:Math.min(U.y-x,m.bottom)}},CH=(o,c,m,b=0)=>{const _=Fg(window),x=li(it.fromDom(o.getContentAreaContainer())),M=lS(o)||rT(o)||dx(o),{x:I,width:U}=c6(x,_,b);if(o.inline&&!M)return si(I,_.y,U,_.height);{const Y=c.header.isPositionedAtTop(),{y:se,bottom:fe}=JX(o,x,_,Y,m,b);return si(I,se,U,fe-se)}},uA=12,u6={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},SH={maxHeightFunction:cg(),maxWidthFunction:w9()},QX=(o,c)=>{const m=o.selection.getRng(),b=pd(it.fromDom(m.startContainer),m.startOffset);return m.startContainer===m.endContainer&&m.startOffset===m.endOffset-1&&Cr(b.element,c)},eJ=(o,c,m)=>{const b=Xi(o,"position");no(o,"position",c);const _=m(o);return b.each(x=>no(o,"position",x)),_},kH=o=>o==="node",tJ=(o,c,m,b,_)=>{const x=l6(o),M=b.lastElement().exists(I=>Cr(m,I));if(QX(o,m))return M?v7:_p;if(M)return eJ(c,b.getMode(),()=>_H(x,li(c),-20)&&!b.isReposition()?WG:v7);{const I=b.getMode()==="fixed"?_.y+ic().top:_.y,U=Oi(c)+uA;return I+U<=x.y?_p:Xx}},nJ=(o,c,m,b)=>{const _=U=>(Y,se,fe,me,Ce)=>{const Ne=tJ(o,me,U,m,Ce),st={...Y,y:Ce.y,height:Ce.height};return{...Ne(st,se,fe,me,Ce),alwaysFit:!0}},x=U=>kH(b)?[_(U)]:[];return c?{onLtr:U=>[Hl,ml,Kl,Du,Fr,Yl].concat(x(U)),onRtl:U=>[Hl,Kl,ml,Fr,Du,Yl].concat(x(U))}:{onLtr:U=>[Yl,Hl,Du,ml,Fr,Kl].concat(x(U)),onRtl:U=>[Yl,Hl,Fr,Kl,Du,ml].concat(x(U))}},EH=(o,c,m,b)=>c==="line"?{bubble:ug(uA,0,u6),layouts:{onLtr:()=>[om],onRtl:()=>[vr]},overrides:SH}:{bubble:ug(0,uA,u6,1/uA),layouts:nJ(o,m,b,c),overrides:SH},f6=(o,c)=>{const m=ho(c,x=>x.predicate(o.dom)),{pass:b,fail:_}=es(m,x=>x.type==="contexttoolbar");return{contextToolbars:b,contextForms:_}},oJ=o=>{if(o.length<=1)return o;{const c=x=>dn(o,M=>M.position===x),m=x=>ho(o,M=>M.position===x),b=c("selection"),_=c("node");if(b||_)if(_&&b){const x=m("node"),M=We(m("selection"),I=>({...I,position:"node"}));return x.concat(M)}else return m(b?"selection":"node");else return m("line")}},sJ=o=>{if(o.length<=1)return o;{const c=b=>Ct(o,_=>_.position===b);return c("selection").orThunk(()=>c("node")).orThunk(()=>c("line")).map(b=>b.position).fold(()=>[],b=>ho(o,_=>_.position===b))}},rJ=(o,c,m)=>{const b=f6(o,c);if(b.contextForms.length>0)return V.some({elem:o,toolbars:[b.contextForms[0]]});{const _=f6(o,m);if(_.contextForms.length>0)return V.some({elem:o,toolbars:[_.contextForms[0]]});if(b.contextToolbars.length>0||_.contextToolbars.length>0){const x=oJ(b.contextToolbars.concat(_.contextToolbars));return V.some({elem:o,toolbars:x})}else return V.none()}},eD=(o,c,m)=>o(c)?V.none():Bc(c,b=>{if(gr(b)){const{contextToolbars:_,contextForms:x}=f6(b,m.inNodeScope),M=x.length>0?x:sJ(_);return M.length>0?V.some({elem:b,toolbars:M}):V.none()}else return V.none()},o),iJ=(o,c)=>{const m=it.fromDom(c.getBody()),b=M=>Cr(M,m),_=M=>!b(M)&&!La(m,M),x=it.fromDom(c.selection.getNode());return _(x)?V.none():rJ(x,o.inNodeScope,o.inEditorScope).orThunk(()=>eD(b,x,o))},tD=(o,c)=>{const m={},b=[],_=[],x={},M={},I=(se,fe)=>{const me=ha(r8(fe));m[se]=me,me.launch.map(Ce=>{x["form:"+se]={...fe.launch,type:Ce.type==="contextformtogglebutton"?"togglebutton":"button",onAction:()=>{c(me)}}}),me.scope==="editor"?_.push(me):b.push(me),M[se]=me},U=(se,fe)=>{ej(fe).each(me=>{fe.scope==="editor"?_.push(me):b.push(me),M[se]=me})},Y=Zs(o);return xt(Y,se=>{const fe=o[se];fe.type==="contextform"?I(se,fe):fe.type==="contexttoolbar"&&U(se,fe)}),{forms:m,inNodeScope:b,inEditorScope:_,lookupTable:M,formNavigators:x}},fA=oo("forward-slide"),d6=oo("backward-slide"),h6=oo("change-slide-event"),m6="tox-pop--resizing",aJ=o=>{const c=Ho([]);return Pa.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:m=>{c.set([]),Pa.getContent(m).each(b=>{Ss(b.element,"visibility")}),ma(m.element,m6),Ss(m.element,"width")},inlineBehaviours:An([ks("context-toolbar-events",[eg(jg(),(m,b)=>{b.event.raw.propertyName==="width"&&(ma(m.element,m6),Ss(m.element,"width"))}),en(h6,(m,b)=>{const _=m.element;Ss(_,"width");const x=Ji(_);Pa.setContent(m,b.event.contents),Ra(_,m6);const M=Ji(_);no(_,"width",x+"px"),Pa.getContent(m).each(I=>{b.event.focus.bind(U=>(sf(U),nl(_))).orThunk(()=>(Po.focusIn(I),Of(Pt(_))))}),setTimeout(()=>{no(m.element,"width",M+"px")},0)}),en(fA,(m,b)=>{Pa.getContent(m).each(_=>{c.set(c.get().concat([{bar:_,focus:Of(Pt(m.element))}]))}),Ao(m,h6,{contents:b.event.forwardContents,focus:V.none()})}),en(d6,(m,b)=>{Or(c.get()).each(_=>{c.set(c.get().slice(0,c.get().length-1)),Ao(m,h6,{contents:ru(_.bar),focus:_.focus})})})]),Po.config({mode:"special",onEscape:m=>Or(c.get()).fold(()=>o.onEscape(),b=>(nr(m,d6),V.some(!0)))})]),lazySink:()=>wn.value(o.sink)})},g6="tox-pop--transition",lJ=(o,c,m,b)=>{const _=b.backstage,x=_.shared,M=nn().deviceType.isTouch,I=Ui(),U=Ui(),Y=Ui(),se=uc(aJ({sink:m,onEscape:()=>(o.focus(),V.some(!0))})),fe=()=>{const yo=Y.get().getOr("node"),ws=kH(yo)?1:0;return CH(o,x,yo,ws)},me=()=>!o.removed&&!(M()&&_.isContextMenuOpen()),Ce=yo=>$e(Wn(yo,I.get(),Cr),!0),Ne=()=>{if(me()){const yo=fe(),ws=$e(Y.get(),"node")?XX(o,I.get()):l6(o);return yo.height<=0||!_H(ws,yo,.01)}else return!0},st=()=>{I.clear(),U.clear(),Y.clear(),Pa.hide(se)},Ht=()=>{if(Pa.isOpen(se)){const yo=se.element;Ss(yo,"display"),Ne()?no(yo,"display","none"):(U.set(0),Pa.reposition(se))}},ut=yo=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[yo],behaviours:An([Po.config({mode:"acyclic"}),ks("pop-dialog-wrap-events",[vi(ws=>{o.shortcuts.add("ctrl+F9","focus statusbar",()=>Po.focusIn(ws))}),Dd(ws=>{o.shortcuts.remove("ctrl+F9")})])])}),lt=xi(()=>tD(c,yo=>{const ws=kn([yo]);Ao(se,fA,{forwardContents:ut(ws)})})),Zt=(yo,ws)=>J4(o,{buttons:yo,toolbar:ws.items,allowToolbarGroups:!1},b.backstage,V.some(["form:"])),Dt=(yo,ws)=>KX.buildInitGroups(yo,ws),kn=yo=>{const{buttons:ws}=o.ui.registry.getAll(),fs=lt(),hr={...ws,...fs.formNavigators},Fo=aS(o)===pg.scrolling?pg.scrolling:pg.default,ir=Et(We(yo,Fn=>Fn.type==="contexttoolbar"?Zt(hr,Fn):Dt(Fn,x.providers)));return $d({type:Fo,uid:oo("context-toolbar"),initGroups:ir,onEscape:V.none,cyclicKeying:!0,providers:x.providers})},mn=(yo,ws)=>{const fs=yo==="node"?x.anchors.node(ws):x.anchors.cursor(),hr=EH(o,yo,M(),{lastElement:I.get,isReposition:()=>$e(U.get(),0),getMode:()=>uu.getMode(m)});return Jr(fs,hr)},In=(yo,ws)=>{if(js.cancel(),!me())return;const fs=kn(yo),hr=yo[0].position,Fo=mn(hr,ws);Y.set(hr),U.set(1);const ir=se.element;Ss(ir,"display"),Ce(ws)||(ma(ir,g6),uu.reset(m,se)),Pa.showWithinBounds(se,ut(fs),{anchor:Fo,transition:{classes:[g6],mode:"placement"}},()=>V.some(fe())),ws.fold(I.clear,I.set),Ne()&&no(ir,"display","none")};let Zn=!1;const js=uf(()=>{if(!(!o.hasFocus()||o.removed||Zn))if(Qu(se.element,g6))js.throttle();else{const yo=lt();iJ(yo,o).fold(st,ws=>{In(ws.toolbars,V.some(ws.elem))})}},17);o.on("init",()=>{o.on("remove",st),o.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",Ht),o.on("click keyup focus SetContent",js.throttle),o.on(vH,st),o.on(bH,yo=>{const ws=lt();an(ws.lookupTable,yo.toolbarKey).each(fs=>{In([fs],cn(yo.target!==o,yo.target)),Pa.getContent(se).each(Po.focusIn)})}),o.on("focusout",yo=>{Q3.setEditorTimeout(o,()=>{nl(m.element).isNone()&&nl(se.element).isNone()&&st()},0)}),o.on("SwitchMode",()=>{o.mode.isReadOnly()&&st()}),o.on("AfterProgressState",yo=>{yo.state?st():o.hasFocus()&&js.throttle()}),o.on("dragstart",()=>{Zn=!0}),o.on("dragend drop",()=>{Zn=!1}),o.on("NodeChange",yo=>{nl(se.element).fold(js.throttle,F)})})},nD=o=>{xt([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],m=>{o.ui.registry.addToggleButton(m.name,{tooltip:m.text,icon:m.icon,onAction:id(o,m.cmd),onSetup:w0(o,m.name)})}),o.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:Nf(o),onAction:id(o,"JustifyNone")})},p6=(o,c)=>{const m=()=>{const b=c.getOptions(o),_=c.getCurrent(o).map(c.hash),x=Ui();return We(b,M=>({type:"togglemenuitem",text:c.display(M),onSetup:I=>{const U=se=>{se&&(x.on(fe=>fe.setActive(!1)),x.set(I)),I.setActive(se)};U($e(_,c.hash(M)));const Y=c.watcher(o,M,U);return()=>{x.clear(),Y()}},onAction:()=>c.setCurrent(o,M)}))};o.ui.registry.addMenuButton(c.name,{tooltip:c.text,icon:c.icon,fetch:b=>b(m()),onSetup:c.onToolbarSetup}),o.ui.registry.addNestedMenuItem(c.name,{type:"nestedmenuitem",text:c.text,getSubmenuItems:m,onSetup:c.onMenuSetup})},xH=o=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:fx,hash:c=>fX(c,["fixed","relative","empty"]).getOr(c),display:we,watcher:(c,m,b)=>c.formatter.formatChanged("lineheight",b,!1,{value:m}).unbind,getCurrent:c=>V.from(c.queryCommandValue("LineHeight")),setCurrent:(c,m)=>c.execCommand("LineHeight",!1,m),onToolbarSetup:Nf(o),onMenuSetup:Nf(o)}),AH=o=>V.from(LM(o)).map(m=>({name:"language",text:"Language",icon:"language",getOptions:J(m),hash:b=>N(b.customCode)?b.code:`${b.code}/${b.customCode}`,display:b=>b.title,watcher:(b,_,x)=>{var M;return b.formatter.formatChanged("lang",x,!1,{value:_.code,customValue:(M=_.customCode)!==null&&M!==void 0?M:null}).unbind},getCurrent:b=>{const _=it.fromDom(b.selection.getNode());return Qc(_,x=>V.some(x).filter(gr).bind(M=>de(M,"lang").map(U=>{const Y=de(M,"data-mce-lang").getOrUndefined();return{code:U,customCode:Y,title:""}})))},setCurrent:(b,_)=>b.execCommand("Lang",!1,_),onToolbarSetup:b=>{const _=r0();return b.setActive(o.formatter.match("lang",{},void 0,!0)),_.set(o.formatter.formatChanged("lang",b.setActive,!0)),yg(_.clear,Nf(o)(b))},onMenuSetup:Nf(o)})),TH=o=>{p6(o,xH(o)),AH(o).each(c=>p6(o,c))},cJ=(o,c)=>{oX(o,c),lX(o,c),SX(o,c),rX(o,c),_X(o,c)},DH=o=>_0(o,"NodeChange",c=>{c.setEnabled(o.queryCommandState("outdent")&&o.selection.isEditable())}),uJ=o=>{o.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:DH(o),onAction:id(o,"outdent")}),o.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:Nf(o),onAction:id(o,"indent")})},fJ=o=>{uJ(o)},OH=(o,c)=>m=>{m.setActive(c.get());const b=_=>{c.set(_.state),m.setActive(_.state)};return o.on("PastePlainTextToggle",b),yg(()=>o.off("PastePlainTextToggle",b),Nf(o)(m))},dJ=o=>{const c=Ho(DB(o)),m=()=>o.execCommand("mceTogglePlainTextPaste");o.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:m,onSetup:OH(o,c)}),o.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:m,onSetup:OH(o,c)})},b6=(o,c)=>()=>{o.execCommand("mceToggleFormat",!1,c)},dA=o=>{nv.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(c,m)=>{o.ui.registry.addToggleButton(c.name,{tooltip:c.text,icon:c.icon,onSetup:w0(o,c.name),onAction:b6(o,c.name)})});for(let c=1;c<=6;c++){const m="h"+c;o.ui.registry.addToggleButton(m,{text:m.toUpperCase(),tooltip:"Heading "+c,onSetup:w0(o,m),onAction:b6(o,m)})}},hJ=o=>{nv.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print"}],c=>{o.ui.registry.addButton(c.name,{tooltip:c.text,icon:c.icon,onAction:id(o,c.action)})}),nv.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],c=>{o.ui.registry.addButton(c.name,{tooltip:c.text,icon:c.icon,onSetup:Nf(o),onAction:id(o,c.action)})})},mJ=o=>{nv.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],c=>{o.ui.registry.addToggleButton(c.name,{tooltip:c.text,icon:c.icon,onAction:id(o,c.action),onSetup:w0(o,c.name)})})},gJ=o=>{dA(o),hJ(o),mJ(o)},MH=o=>{nv.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],c=>{o.ui.registry.addMenuItem(c.name,{text:c.text,icon:c.icon,shortcut:c.shortcut,onAction:id(o,c.action)})}),nv.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],c=>{o.ui.registry.addMenuItem(c.name,{text:c.text,icon:c.icon,shortcut:c.shortcut,onSetup:Nf(o),onAction:id(o,c.action)})}),o.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:Nf(o),onAction:b6(o,"code")})},pJ=o=>{gJ(o),MH(o)},hA=(o,c)=>_0(o,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",m=>{m.setEnabled(!o.mode.isReadOnly()&&o.undoManager[c]())}),bJ=o=>{o.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:hA(o,"hasUndo"),onAction:id(o,"undo")}),o.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:hA(o,"hasRedo"),onAction:id(o,"redo")})},vJ=o=>{o.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:hA(o,"hasUndo"),onAction:id(o,"undo")}),o.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:hA(o,"hasRedo"),onAction:id(o,"redo")})},yJ=o=>{bJ(o),vJ(o)},wJ=o=>_0(o,"VisualAid",c=>{c.setActive(o.hasVisual)}),_J=o=>{o.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:wJ(o),onAction:id(o,"mceToggleVisualAid")})},mA=o=>{o.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:id(o,"mceToggleVisualAid")})},RH=o=>{mA(o),_J(o)},CJ=(o,c)=>{nD(o),pJ(o),cJ(o,c),yJ(o),j8(o),RH(o),fJ(o),TH(o),dJ(o)},SJ=o=>h(o)?o.split(/[ ,]/):o,v6=o=>c=>c.options.get(o),y6=o=>{const c=o.options.register;c("contextmenu_avoid_overlap",{processor:"string",default:""}),c("contextmenu_never_use_native",{processor:"boolean",default:!1}),c("contextmenu",{processor:m=>m===!1?{value:[],valid:!0}:h(m)||ee(m,h)?{value:SJ(m),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})},w6=v6("contextmenu_never_use_native"),NH=v6("contextmenu_avoid_overlap"),kJ=o=>l_(o).length===0,l_=o=>{const c=o.ui.registry.getAll().contextMenus,m=o.options.get("contextmenu");return o.options.isSet("contextmenu")?m:ho(m,b=>ps(c,b))},Iy=(o,c)=>({type:"makeshift",x:o,y:c}),_6=(o,c,m)=>Iy(o.x+c,o.y+m),C6=o=>o.type==="longpress"||o.type.indexOf("touch")===0,PH=o=>{if(C6(o)){const c=o.touches[0];return Iy(c.pageX,c.pageY)}else return Iy(o.pageX,o.pageY)},EJ=o=>{if(C6(o)){const c=o.touches[0];return Iy(c.clientX,c.clientY)}else return Iy(o.clientX,o.clientY)},IH=(o,c)=>{const m=rx.DOM.getPos(o);return _6(c,m.x,m.y)},xJ=(o,c)=>c.type==="contextmenu"||c.type==="longpress"?o.inline?PH(c):IH(o.getContentAreaContainer(),EJ(c)):BH(o),BH=o=>({type:"selection",root:it.fromDom(o.selection.getNode())}),AJ=o=>({type:"node",node:V.some(it.fromDom(o.selection.getNode())),root:it.fromDom(o.getBody())}),LH=(o,c,m)=>{switch(m){case"node":return AJ(o);case"point":return xJ(o,c);case"selection":return BH(o)}},TJ=(o,c,m,b,_,x)=>{const M=m(),I=LH(o,c,x);TS(M,pp.CLOSE_ON_EXECUTE,b,{isHorizontalMenu:!1,search:V.none()}).map(U=>{c.preventDefault(),Pa.showMenuAt(_,{anchor:I},{menu:{markers:Fw("normal")},data:U})})},FH={onLtr:()=>[Hl,ml,Kl,Du,Fr,Yl,_p,Xx,Yx,S4,Kx,Gx],onRtl:()=>[Hl,Kl,ml,Fr,Du,Yl,_p,Xx,Kx,Gx,Yx,S4]},oD=12,HH={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},$H=(o,c)=>{const m=o.selection;if(m.isCollapsed()||c.touches.length<1)return!1;{const b=c.touches[0],_=m.getRng();return pE(o.getWin(),Tb.domRange(_)).exists(M=>M.left<=b.clientX&&M.right>=b.clientX&&M.top<=b.clientY&&M.bottom>=b.clientY)}},S6=o=>{const c=o.selection.getRng(),m=()=>{Q3.setEditorTimeout(o,()=>{o.selection.setRng(c)},10),x()};o.once("touchend",m);const b=M=>{M.preventDefault(),M.stopImmediatePropagation()};o.on("mousedown",b,!0);const _=()=>x();o.once("longpresscancel",_);const x=()=>{o.off("touchend",m),o.off("longpresscancel",_),o.off("mousedown",b)}},DJ=(o,c,m)=>{const b=LH(o,c,m);return{bubble:ug(0,m==="point"?oD:0,HH),layouts:FH,overrides:{maxWidthFunction:w9(),maxHeightFunction:cg()},...b}},zH=(o,c,m,b,_,x,M)=>{const I=DJ(o,c,x);TS(m,pp.CLOSE_ON_EXECUTE,b,{isHorizontalMenu:!0,search:V.none()}).map(U=>{c.preventDefault();const Y=M?sd.HighlightMenuAndItem:sd.HighlightNone;Pa.showMenuWithinBounds(_,{anchor:I},{menu:{markers:Fw("normal"),highlightOnOpen:Y},data:U,type:"horizontal"},()=>V.some(CH(o,b.shared,x==="node"?"node":"selection"))),o.dispatch(vH)})},OJ=(o,c,m,b,_,x)=>{const M=nn(),I=M.os.isiOS(),U=M.os.isMacOS(),Y=M.os.isAndroid(),se=M.deviceType.isTouch(),fe=()=>!(Y||I||U&&se),me=()=>{const Ce=m();zH(o,c,Ce,b,_,x,fe())};if((U||I)&&x!=="node"){const Ce=()=>{S6(o),me()};$H(o,c)?Ce():(o.once("selectionchange",Ce),o.once("touchend",()=>o.off("selectionchange",Ce)))}else me()},VH=o=>h(o)?o==="|":o.type==="separator",VS={type:"separator"},k6=o=>{const c=m=>({text:m.text,icon:m.icon,enabled:m.enabled,shortcut:m.shortcut});if(h(o))return o;switch(o.type){case"separator":return VS;case"submenu":return{type:"nestedmenuitem",...c(o),getSubmenuItems:()=>{const b=o.getSubmenuItems();return h(b)?b:We(b,k6)}};default:const m=o;return{type:"menuitem",...c(m),onAction:ne(m.onAction)}}},UH=(o,c)=>{if(c.length===0)return o;const b=Or(o).filter(_=>!VH(_)).fold(()=>[],_=>[VS]);return o.concat(b).concat(c).concat([VS])},MJ=(o,c,m)=>{const b=xo(c,(_,x)=>an(o,x.toLowerCase()).map(M=>{const I=M.update(m);if(h(I)&&Ge(hi(I)))return UH(_,I.split(" "));if(C(I)&&I.length>0){const U=We(I,k6);return UH(_,U)}else return _}).getOrThunk(()=>_.concat([x])),[]);return b.length>0&&VH(b[b.length-1])&&b.pop(),b},RJ=(o,c)=>c.ctrlKey&&!w6(o),NJ=o=>o.type==="longpress"||ps(o,"touches"),WH=(o,c)=>!NJ(c)&&(c.button!==2||c.target===o.getBody()&&c.pointerType===""),E6=(o,c)=>WH(o,c)?o.selection.getStart(!0):c.target,jH=(o,c)=>{const m=NH(o),b=WH(o,c)?"selection":"point";if(Ge(m)){const _=E6(o,c);return _S(it.fromDom(_),m)?"node":b}else return b},PJ=(o,c,m)=>{const _=nn().deviceType.isTouch,x=uc(Pa.sketch({dom:{tag:"div"},lazySink:c,onEscape:()=>o.focus(),onShow:()=>m.setContextMenuState(!0),onHide:()=>m.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:An([ks("dismissContextMenu",[en(Xm(),(U,Y)=>{Ks.close(U),o.focus()})])])})),M=()=>Pa.hide(x),I=U=>{if(w6(o)&&U.preventDefault(),RJ(o,U)||kJ(o))return;const Y=jH(o,U),se=()=>{const me=E6(o,U),Ce=o.ui.registry.getAll(),Ne=l_(o);return MJ(Ce.contextMenus,Ne,me)};(_()?OJ:TJ)(o,U,se,m,x,Y)};o.on("init",()=>{const U="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(_()?"":" ResizeWindow");o.on(U,M),o.on("longpress contextmenu",I)})},x6=G.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),gA=o=>c=>c.translate(-o.left,-o.top),sD=o=>c=>c.translate(o.left,o.top),av=o=>(c,m)=>xo(o,(b,_)=>_(b),fr(c,m)),rD=(o,c,m)=>o.fold(av([sD(m),gA(c)]),av([gA(c)]),av([])),US=(o,c,m)=>o.fold(av([sD(m)]),av([]),av([sD(c)])),ZH=(o,c,m)=>o.fold(av([]),av([gA(m)]),av([sD(c),gA(m)])),A6=(o,c,m,b,_,x)=>{const M=US(o,_,x),I=US(c,_,x);return Math.abs(M.left-I.left)<=m&&Math.abs(M.top-I.top)<=b},IJ=(o,c,m,b,_,x)=>{const M=US(o,_,x),I=US(c,_,x),U=Math.abs(M.left-I.left),Y=Math.abs(M.top-I.top);return fr(U,Y)},qH=(o,c,m)=>{const b=o.fold((_,x)=>({position:V.some("absolute"),left:V.some(_+"px"),top:V.some(x+"px")}),(_,x)=>({position:V.some("absolute"),left:V.some(_-m.left+"px"),top:V.some(x-m.top+"px")}),(_,x)=>({position:V.some("fixed"),left:V.some(_+"px"),top:V.some(x+"px")}));return{right:V.none(),bottom:V.none(),...b}},T6=(o,c,m)=>o.fold((b,_)=>pA(b+c,_+m),(b,_)=>By(b+c,_+m),(b,_)=>c_(b+c,_+m)),iD=(o,c,m,b)=>{const _=(x,M)=>(I,U)=>{const Y=x(c,m,b);return M(I.getOr(Y.left),U.getOr(Y.top))};return o.fold(_(ZH,pA),_(US,By),_(rD,c_))},pA=x6.offset,By=x6.absolute,c_=x6.fixed,GH=(o,c)=>{const m=Fi(o,c);return N(m)?NaN:parseInt(m,10)},BJ=(o,c)=>{const m=o.element,b=GH(m,c.leftAttr),_=GH(m,c.topAttr);return isNaN(b)||isNaN(_)?V.none():V.some(fr(b,_))},LJ=(o,c,m)=>{const b=o.element;Kn(b,c.leftAttr,m.left+"px"),Kn(b,c.topAttr,m.top+"px")},KH=(o,c)=>{const m=o.element;je(m,c.leftAttr),je(m,c.topAttr)},FJ=(o,c,m,b)=>BJ(o,c).fold(()=>m,_=>c_(_.left+b.left,_.top+b.top)),YH=(o,c,m,b,_,x)=>{const M=FJ(o,c,m,b),I=c.mustSnap?D6(o,c,M,_,x):$J(o,c,M,_,x),U=rD(M,_,x);return LJ(o,c,U),I.fold(()=>({coord:c_(U.left,U.top),extra:V.none()}),Y=>({coord:Y.output,extra:Y.extra}))},HJ=(o,c)=>{KH(o,c)},XH=(o,c,m,b)=>Js(o,_=>{const x=_.sensor;return A6(c,x,_.range.left,_.range.top,m,b)?V.some({output:iD(_.output,c,m,b),extra:_.extra}):V.none()}),D6=(o,c,m,b,_)=>{const x=c.getSnapPoints(o);return XH(x,m,b,_).orThunk(()=>xo(x,(U,Y)=>{const se=Y.sensor,fe=IJ(m,se,Y.range.left,Y.range.top,b,_);return U.deltas.fold(()=>({deltas:V.some(fe),snap:V.some(Y)}),me=>{const Ce=(fe.left+fe.top)/2,Ne=(me.left+me.top)/2;return Ce<=Ne?{deltas:V.some(fe),snap:V.some(Y)}:U})},{deltas:V.none(),snap:V.none()}).snap.map(U=>({output:iD(U.output,m,b,_),extra:U.extra})))},$J=(o,c,m,b,_)=>{const x=c.getSnapPoints(o);return XH(x,m,b,_)},JH=(o,c,m)=>({coord:iD(o.output,o.output,c,m),extra:o.extra});var zJ=Object.freeze({__proto__:null,snapTo:(o,c,m,b)=>{const _=c.getTarget(o.element);if(c.repositionTarget){const x=sa(o.element),M=ic(x),I=wN(_),U=JH(b,M,I),Y=qH(U.coord,M,I);hn(_,Y)}}});const bA="data-initial-z-index",VJ=o=>{Fa(o.element).filter(gr).each(c=>{de(c,bA).fold(()=>Ss(c,"z-index"),m=>no(c,"z-index",m)),je(c,bA)})},UJ=o=>{Fa(o.element).filter(gr).each(c=>{Xi(c,"z-index").each(m=>{Kn(c,bA,m)}),no(c,"z-index",qr(o.element,"z-index"))})},QH=(o,c)=>{o.getSystem().addToGui(c),UJ(c)},WJ=o=>{VJ(o),o.getSystem().removeFromGui(o)},e$=(o,c,m)=>o.getSystem().build(f1.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[c]},events:m}));var t$=Wa("snaps",[Qt("getSnapPoints"),Gs("onSensor"),Qt("leftAttr"),Qt("topAttr"),St("lazyViewport",le),St("mustSnap",!1)]);const O6=[St("useFixed",Qe),Qt("blockerClass"),St("getTarget",we),St("onDrag",F),St("repositionTarget",!0),St("onDrop",F),Za("getBounds",le),t$],jJ=o=>lo(Xi(o,"left"),Xi(o,"top"),Xi(o,"position"),(c,m,b)=>(b==="fixed"?c_:pA)(parseInt(c,10),parseInt(m,10))).getOrThunk(()=>{const c=vc(o);return By(c.left,c.top)}),ZJ=(o,c,m,b,_)=>{const x=_.bounds,M=US(c,m,b),I=Qf(M.left,x.x,x.x+x.width-_.width),U=Qf(M.top,x.y,x.y+x.height-_.height),Y=By(I,U);return c.fold(()=>{const se=ZH(Y,m,b);return pA(se.left,se.top)},J(Y),()=>{const se=rD(Y,m,b);return c_(se.left,se.top)})},qJ=(o,c,m,b,_,x,M)=>{const I=c.fold(()=>{const U=T6(m,x.left,x.top),Y=rD(U,b,_);return c_(Y.left,Y.top)},U=>{const Y=YH(o,U,m,x,b,_);return Y.extra.each(se=>{U.onSensor(o,se)}),Y.coord});return ZJ(o,I,b,_,M)},GJ=(o,c,m,b)=>{const _=c.getTarget(o.element);if(c.repositionTarget){const x=sa(o.element),M=ic(x),I=wN(_),U=jJ(_),Y=qJ(o,c.snaps,U,M,I,b,m),se=qH(Y,M,I);hn(_,se)}c.onDrag(o,_,b)},n$=(o,c)=>({bounds:o.getBounds(),height:Ff(c.element),width:Ha(c.element)}),M6=(o,c,m,b,_)=>{const x=m.update(b,_),M=m.getStartData().getOrThunk(()=>n$(c,o));x.each(I=>{GJ(o,c,M,I)})},o$=(o,c,m,b)=>{c.each(WJ),m.snaps.each(x=>{HJ(o,x)});const _=m.getTarget(o.element);b.reset(),m.onDrop(o,_)},aD=o=>(c,m)=>{const b=_=>{m.setStartData(n$(c,_))};return ri([en(Ym(),_=>{m.getStartData().each(()=>b(_))}),...o(c,m,b)])},KJ=o=>ri([en(Br(),o.forceDrop),en(j1(),o.drop),en(Da(),(c,m)=>{o.move(m.event)}),en(cc(),o.delayDrop)]);var XJ=Object.freeze({__proto__:null,getData:o=>V.from(fr(o.x,o.y)),getDelta:(o,c)=>fr(c.left-o.left,c.top-o.top)});const s$=(o,c,m)=>[en(Br(),(b,_)=>{if(_.event.raw.button!==0)return;_.stop();const M=()=>o$(b,V.some(Y),o,c),I=pL(M,200),U={drop:M,delayDrop:I.schedule,forceDrop:M,move:fe=>{I.cancel(),M6(b,o,c,XJ,fe)}},Y=e$(b,o.blockerClass,KJ(U));(()=>{m(b),QH(b,Y)})()})],u_=[...O6,Vi("dragger",{handlers:aD(s$)})],r$=o=>ri([en(eu(),o.forceDrop),en(jm(),o.drop),en(Os(),o.drop),en(zp(),(c,m)=>{o.move(m.event)})]),JJ=o=>{const c=o[0];return V.some(fr(c.clientX,c.clientY))};var i$=Object.freeze({__proto__:null,getData:o=>{const m=o.raw.touches;return m.length===1?JJ(m):V.none()},getDelta:(o,c)=>fr(c.left-o.left,c.top-o.top)});const R6=(o,c,m)=>{const b=Ui(),_=x=>{o$(x,b.get(),o,c),b.clear()};return[en(eu(),(x,M)=>{M.stop();const I=()=>_(x),U={drop:I,delayDrop:F,forceDrop:I,move:fe=>{M6(x,o,c,i$,fe)}},Y=e$(x,o.blockerClass,r$(U));b.set(Y),(()=>{m(x),QH(x,Y)})()}),en(zp(),(x,M)=>{M.stop(),M6(x,o,c,i$,M.event)}),en(jm(),(x,M)=>{M.stop(),_(x)}),en(Os(),_)]},QJ=[...O6,Vi("dragger",{handlers:aD(R6)})],eQ=(o,c,m)=>[...s$(o,c,m),...R6(o,c,m)],tQ=[...O6,Vi("dragger",{handlers:aD(eQ)})];var nQ=Object.freeze({__proto__:null,mouse:u_,touch:QJ,mouseOrTouch:tQ}),oQ=Object.freeze({__proto__:null,init:()=>{let o=V.none(),c=V.none();const m=()=>{o=V.none(),c=V.none()},b=(U,Y)=>{const se=o.map(fe=>U.getDelta(fe,Y));return o=V.some(Y),se},_=(U,Y)=>U.getData(Y).bind(se=>b(U,se)),x=U=>{c=V.some(U)},M=()=>c,I=J({});return su({readState:I,reset:m,update:_,getStartData:M,setStartData:x})}});const f_=K2({branchKey:"mode",branches:nQ,name:"dragging",active:{events:(o,c)=>o.dragger.handlers(o,c)},extra:{snap:o=>({sensor:o.sensor,range:o.range,output:o.output,extra:V.from(o.extra)})},state:oQ,apis:zJ}),lD=40,vA=lD/2,a$=(o,c,m,b,_,x)=>o.fold(()=>f_.snap({sensor:By(m-vA,b-vA),range:fr(_,x),output:By(V.some(m),V.some(b)),extra:{td:c}}),M=>{const I=m-vA,U=b-vA,Y=lD,se=lD,fe=M.element.dom.getBoundingClientRect();return f_.snap({sensor:By(I,U),range:fr(Y,se),output:By(V.some(m-fe.width/2),V.some(b-fe.height/2)),extra:{td:c}})}),WS=(o,c,m)=>{const b=(_,x)=>_.exists(M=>Cr(M,x));return{getSnapPoints:o,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(_,x)=>{const M=x.td;b(c.get(),M)||(c.set(M),m(M))},mustSnap:!0}},l$=o=>Qr(Uc.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:An([f_.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:o}),Mx.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),sQ=(o,c)=>{const m=Ho([]),b=Ho([]),_=Ho(!1),x=Ui(),M=Ui(),I=In=>{const Zn=Bl(In);return a$(Ce.getOpt(c),In,Zn.x,Zn.y,Zn.width,Zn.height)},U=()=>We(m.get(),In=>I(In)),Y=In=>{const Zn=Bl(In);return a$(Ne.getOpt(c),In,Zn.right,Zn.bottom,Zn.width,Zn.height)},se=()=>We(b.get(),In=>Y(In)),fe=WS(U,x,In=>{M.get().each(Zn=>{o.dispatch("TableSelectorChange",{start:In,finish:Zn})})}),me=WS(se,M,In=>{x.get().each(Zn=>{o.dispatch("TableSelectorChange",{start:Zn,finish:In})})}),Ce=l$(fe),Ne=l$(me),st=uc(Ce.asSpec()),Ht=uc(Ne.asSpec()),ut=(In,Zn,js,yo)=>{const ws=Zn.dom.getBoundingClientRect();Ss(In.element,"display");const fs=Oc(it.fromDom(o.getBody())).dom.innerHeight,hr=js(ws),Fo=yo(ws,fs);(hr||Fo)&&no(In.element,"display","none")},lt=(In,Zn,js,yo)=>{const ws=js(Zn);f_.snapTo(In,ws),ut(In,Zn,Fo=>Fo[yo]<0,(Fo,ir)=>Fo[yo]>ir)},Zt=In=>lt(st,In,I,"top"),Dt=()=>x.get().each(Zt),kn=In=>lt(Ht,In,Y,"bottom"),mn=()=>M.get().each(kn);nn().deviceType.isTouch()&&(o.on("TableSelectionChange",In=>{_.get()||(sl(c,st),sl(c,Ht),_.set(!0)),x.set(In.start),M.set(In.finish),In.otherCells.each(Zn=>{m.set(Zn.upOrLeftCells),b.set(Zn.downOrRightCells),Zt(In.start),kn(In.finish)})}),o.on("ResizeEditor ResizeWindow ScrollContent",()=>{Dt(),mn()}),o.on("TableSelectionClear",()=>{_.get()&&($c(st),$c(Ht),_.set(!1)),x.clear(),M.clear()}))};var N6=`<svg width="50px" height="16px" viewBox="0 0 50 16" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.143 0c2.608.015 5.186 2.178 5.186 5.331 0 0 .077 3.812-.084 4.87-.361 2.41-2.164 4.074-4.65 4.496-1.453.284-2.523.49-3.212.623-.373.071-.634.122-.785.152-.184.038-.997.145-1.35.145-2.732 0-5.21-2.04-5.248-5.33 0 0 0-3.514.03-4.442.093-2.4 1.758-4.342 4.926-4.963 0 0 3.875-.752 4.036-.782.368-.07.775-.1 1.15-.1Zm1.826 2.8L5.83 3.989v2.393l-2.455.475v5.968l6.137-1.189V9.243l2.456-.476V2.8ZM5.83 6.382l3.682-.713v3.574l-3.682.713V6.382Zm27.173-1.64-.084-1.066h-2.226v9.132h2.456V7.743c-.008-1.151.998-2.064 2.149-2.072 1.15-.008 1.987.92 1.995 2.072v5.065h2.455V7.359c-.015-2.18-1.657-3.929-3.837-3.913a3.993 3.993 0 0 0-2.908 1.296Zm-6.3-4.266L29.16 0v2.387l-2.456.475V.476Zm0 3.2v9.132h2.456V3.676h-2.456Zm18.179 11.787L49.11 3.676H46.58l-1.612 4.527-.46 1.382-.384-1.382-1.611-4.527H39.98l3.3 9.132L42.15 16l2.732-.537ZM22.867 9.738c0 .752.568 1.075.921 1.075.353 0 .668-.047.998-.154l.537 1.765c-.23.154-.92.537-2.225.537-1.305 0-2.655-.997-2.686-2.686a136.877 136.877 0 0 1 0-4.374H18.8V3.676h1.612v-1.98l2.455-.476v2.456h2.302V5.9h-2.302v3.837Z"/>
</svg>
`;const rQ=o=>o.nodeName==="BR"||!!o.getAttribute("data-mce-bogus")||o.getAttribute("data-mce-type")==="bookmark",iQ=(o,c,m)=>{var b;const _=(b=c.delimiter)!==null&&b!==void 0?b:"\u203A",x=(Y,se,fe)=>Uc.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":fe,"aria-level":fe+1}},components:[Ri(Y)],action:me=>{o.focus(),o.selection.select(se),o.nodeChanged()},buttonBehaviours:An([vg.button(m.isDisabled),ec()])}),M=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Ri(` ${_} `)]}),I=Y=>xo(Y,(se,fe,me)=>{const Ce=x(fe.name,fe.element,me);return me===0?se.concat([Ce]):se.concat([M(),Ce])},[]),U=Y=>{const se=[];let fe=Y.length;for(;fe-- >0;){const me=Y[fe];if(me.nodeType===1&&!rQ(me)){const Ce=xh(o,me);if(Ce.isDefaultPrevented()||se.push({name:Ce.name,element:me}),Ce.isPropagationStopped())break}}return se};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:An([Po.config({mode:"flow",selector:"div[role=button]"}),Ko.config({disabled:m.isDisabled}),ec(),Ga.config({}),ms.config({}),ks("elementPathEvents",[vi((Y,se)=>{o.shortcuts.add("alt+F11","focus statusbar elementpath",()=>Po.focusIn(Y)),o.on("NodeChange",fe=>{const me=U(fe.parents),Ce=me.length>0?I(me):[];ms.set(Y,Ce)})})])]),components:[]}};var Ly;(function(o){o[o.None=0]="None",o[o.Both=1]="Both",o[o.Vertical=2]="Vertical"})(Ly||(Ly={}));const aQ=(o,c,m,b,_)=>{const x={height:Q4(b+c.top,PM(o),IM(o))};return m===Ly.Both&&(x.width=Q4(_+c.left,ax(o),rS(o))),x},c$=(o,c,m)=>{const b=it.fromDom(o.getContainer()),_=aQ(o,c,m,Oi(b),Ji(b));ar(_,(x,M)=>{q(x)&&no(b,M,s6(x))}),ET(o)},lQ=o=>{const c=TB(o);return c===!1?Ly.None:c==="both"?Ly.Both:Ly.Vertical},cD=(o,c,m,b)=>{const x=fr(m*20,b*20);return c$(o,x,c),V.some(!0)},cQ=(o,c)=>{const m=lQ(o);if(m===Ly.None)return V.none();const b=m===Ly.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return V.some(gp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:c.translate("Resize"),"aria-label":c.translate(b)},behaviours:[f_.config({mode:"mouse",repositionTarget:!1,onDrag:(_,x,M)=>c$(o,M,m),blockerClass:"tox-blocker"}),Po.config({mode:"special",onLeft:()=>cD(o,m,-1,0),onRight:()=>cD(o,m,1,0),onUp:()=>cD(o,m,0,-1),onDown:()=>cD(o,m,0,1)}),Ga.config({}),Qo.config({})]},c.icons))},uQ=(o,c)=>{const m=(b,_,x)=>ms.set(b,[Ri(c.translate(["{0} "+x,_[x]]))]);return Uc.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:An([vg.button(c.isDisabled),ec(),Ga.config({}),ms.config({}),Yn.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),ks("wordcount-events",[ou(b=>{const _=Yn.getValue(b),x=_.mode==="words"?"characters":"words";Yn.setValue(b,{mode:x,count:_.count}),m(b,_.count,x)}),vi(b=>{o.on("wordCountUpdate",_=>{const{mode:x}=Yn.getValue(b);Yn.setValue(b,{mode:x,count:_.wordCount}),m(b,_.wordCount,x)})})])]),eventOrder:{[Yu()]:["disabling","alloy.base.behaviour","wordcount-events"]}})},fQ=(o,c)=>{const m=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v6",rel:"noopener",target:"_blank","aria-label":gm.translate(["Powered by {0}","Tiny"])},innerHtml:N6.trim()},behaviours:An([Qo.config({})])}]}),b=()=>{const I=wR("Alt+0"),U="Press {0} for help";return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Ri(gm.translate([U,I]))]}},_=()=>{const I=[];return o.hasPlugin("wordcount")&&I.push(uQ(o,c)),ux(o)&&I.push(m()),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:I}},x=()=>{const I=[],U=RB(o),Y=AB(o),se=ux(o)||o.hasPlugin("wordcount"),fe=()=>{const me="tox-statusbar__text-container--flex-start",Ce="tox-statusbar__text-container--flex-end",Ne="tox-statusbar__text-container--space-around";if(U){const st="tox-statusbar__text-container-3-cols";return!se&&!Y?[st,Ne]:se&&!Y?[st,Ce]:[st,me]}return[se&&!Y?Ce:me]};return Y&&I.push(iQ(o,{},c)),U&&I.push(b()),se&&I.push(_()),I.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container",...fe()]},components:I}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const I=x(),U=cQ(o,c);return I.concat(U.toArray())})()}},u$=(o,c)=>c.get().getOrDie(`UI for ${o} has not been rendered`),dQ=(o,c)=>{const m=o.inline,b=m?UX:IX,_=hx(o)?YK:OK,x=WX(),M=Ui(),I=Ui(),U=Ui(),me=nn().deviceType.isTouch()?["tox-platform-touch"]:[],Ce=jM(o),Ne=aS(o),st=Qr({dom:{tag:"div",classes:["tox-anchorbar"]}}),Ht=Qr({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),ut=()=>x.mainUi.get().map(zo=>zo.outerContainer).bind(Wi.getHeader),lt=()=>wn.fromOption(x.dialogUi.get().map(zo=>zo.sink),"UI has not been rendered"),Zt=()=>wn.fromOption(x.popupUi.get().map(zo=>zo.sink),"(popup) UI has not been rendered"),Dt=x.lazyGetInOuterOrDie("anchor bar",st.getOpt),kn=x.lazyGetInOuterOrDie("bottom anchor bar",Ht.getOpt),mn=x.lazyGetInOuterOrDie("toolbar",Wi.getToolbar),In=x.lazyGetInOuterOrDie("throbber",Wi.getThrobber),Zn=kK({popup:Zt,dialog:lt},o,Dt,kn),js=()=>{const zo={attributes:{[Eb]:Ce?vh.BottomToTop:vh.TopToBottom}},bs=Wi.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:Zn.popup,onEscape:()=>{o.focus()}}),Ti=Wi.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:Zn.popup.shared.getSink,providers:Zn.popup.shared.providers,onEscape:()=>{o.focus()},onToolbarToggled:fv=>{TR(o,fv)},type:Ne,lazyToolbar:mn,lazyHeader:()=>ut().getOrDie("Could not find header element"),...zo}),$r=Wi.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:Zn.popup.shared.providers,onEscape:()=>{o.focus()},type:Ne}),df=dx(o),pa=rT(o),Ud=lS(o),Sp=MB(o),zy=yo(),Vy=df||pa||Ud,__=()=>df?[$r]:pa?[Ti]:[],Uy=Sp?[zy,bs]:[bs];return Wi.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(Vy?[]:["tox-editor-header--empty"]),...zo},components:Et([Ud?Uy:[],__(),cS(o)?[]:[st.asSpec()]]),sticky:hx(o),editor:o,sharedBackstage:Zn.popup.shared})},yo=()=>Wi.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),ws=()=>{const zo=Wi.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),bs=Wi.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}});return{dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[zo,bs]}},fs=()=>{const zo=iT(o),bs=Cr(Li(),zo)&&qr(zo,"display")==="grid",Ti={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(me),attributes:{...gm.isRtl()?{dir:"rtl"}:{}}},behaviours:An([uu.config({useFixed:()=>_.isDocked(ut)})])},$r={dom:{styles:{width:document.body.clientWidth+"px"}},events:ri([en(ih(),Ud=>{no(Ud.element,"width",document.body.clientWidth+"px")})])},df=uc(Jr(Ti,bs?$r:{})),pa=s5(df);return I.set(pa),{sink:df,mothership:pa}},hr=()=>{const zo={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(me),attributes:{...gm.isRtl()?{dir:"rtl"}:{}}},behaviours:An([uu.config({useFixed:()=>_.isDocked(ut),getBounds:()=>c.getPopupSinkBounds()})])},bs=uc(zo),Ti=s5(bs);return U.set(Ti),{sink:bs,mothership:Ti}},Fo=()=>{const zo=js(),bs=ws(),Ti=Wi.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:Zn.popup}),$r=Wi.parts.viewWrapper({backstage:Zn.popup}),df=UM(o)&&!m?V.some(fQ(o,Zn.popup.shared.providers)):V.none(),pa=Et([Ce?[]:[zo],m?[]:[bs],Ce?[zo]:[]]),Ud=Wi.parts.editorContainer({components:Et([pa,m?[]:[Ht.asSpec(),...df.toArray()]])}),Sp=ZM(o),zy={role:"application",...gm.isRtl()?{dir:"rtl"}:{},...Sp?{"aria-hidden":"true"}:{}},Vy=uc(Wi.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(m?["tox-tinymce-inline"]:[]).concat(Ce?["tox-tinymce--toolbar-bottom"]:[]).concat(me),styles:{visibility:"hidden",...Sp?{opacity:"0",border:"0"}:{}},attributes:zy},components:[Ud,...m?[]:[$r],Ti],behaviours:An([ec(),Ko.config({disableClass:"tox-tinymce--disabled"}),Po.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),__=s5(Vy);return M.set(__),{mothership:__,outerContainer:Vy}},ir=zo=>{const bs=s6(LX(o)),Ti=s6(FX(o));return o.inline||(vf("div","width",Ti)&&no(zo.element,"width",Ti),vf("div","height",bs)?no(zo.element,"height",bs):no(zo.element,"height","400px")),bs},Fn=zo=>{o.addShortcut("alt+F9","focus menubar",()=>{Wi.focusMenubar(zo)}),o.addShortcut("alt+F10","focus toolbar",()=>{Wi.focusToolbar(zo)}),o.addCommand("ToggleToolbarDrawer",(bs,Ti)=>{Ti!=null&&Ti.skipFocus?Wi.toggleToolbarDrawerWithoutFocusing(zo):Wi.toggleToolbarDrawer(zo)}),o.addQueryStateHandler("ToggleToolbarDrawer",()=>Wi.isToolbarDrawerToggled(zo))},po=zo=>{const{mainUi:bs,popupUi:Ti,uiMotherships:$r}=zo;Ps(yB(o),(Q6,XS)=>{o.ui.registry.addGroupToolbarButton(XS,Q6)});const{buttons:df,menuItems:pa,contextToolbars:Ud,sidebars:Sp,views:zy}=o.ui.registry.getAll(),Vy=WM(o),__={menuItems:pa,menus:yy(o),menubar:_B(o),toolbar:Vy.getOrThunk(()=>cx(o)),allowToolbarGroups:Ne===pg.floating,buttons:df,sidebar:Sp,views:zy};Fn(bs.outerContainer),EK(o,bs.mothership,$r),_.setup(o,Zn.popup.shared,ut),CJ(o,Zn.popup),PJ(o,Zn.popup.shared.getSink,Zn.popup),oA(o),gY(o,In,Zn.popup.shared),lJ(o,Ud,Ti.sink,{backstage:Zn.popup}),sQ(o,Ti.sink);const Uy=o.getElement(),fv=ir(bs.outerContainer),J6={targetNode:Uy,height:fv};return b.render(o,zo,__,Zn.popup,J6)},ls=zo=>(U.set(zo.mothership),zo),Xs=()=>{const zo=Fo(),bs=fs(),Ti=y0(o)?hr():ls(bs);x.dialogUi.set(bs),x.popupUi.set(Ti),x.mainUi.set(zo);const $r={popupUi:Ti,dialogUi:bs,mainUi:zo,uiMotherships:x.getUiMotherships()};return po($r)};return{popups:{backstage:Zn.popup,getMothership:()=>u$("popups",U)},dialogs:{backstage:Zn.dialog,getMothership:()=>u$("dialogs",I)},renderUI:Xs}},hQ=(o,c)=>{const m=de(o,"id").fold(()=>{const b=oo("dialog-label");return Kn(c,"id",b),b},we);Kn(o,"aria-labelledby",m)},mQ=J([Qt("lazySink"),kr("dragBlockClass"),Za("getBounds",le),St("useTabstopAt",ft),St("firstTabstop",0),St("eventOrder",{}),$l("modalBehaviours",[Po]),iu("onExecute"),F2("onEscape")]),P6={sketch:we},gQ=J([Fd({name:"draghandle",overrides:(o,c)=>({behaviours:An([f_.config({mode:"mouse",getTarget:m=>og(m,'[role="dialog"]').getOr(m),blockerClass:o.dragBlockClass.getOrDie(new Error(`The drag blocker class was not specified for a dialog with a drag handle:
`+JSON.stringify(c,null,2)).message),getBounds:o.getDragBounds})])})}),zc({schema:[Qt("dom")],name:"title"}),zc({factory:P6,schema:[Qt("dom")],name:"close"}),zc({factory:P6,schema:[Qt("dom")],name:"body"}),Fd({factory:P6,schema:[Qt("dom")],name:"footer"}),Sh({factory:{sketch:(o,c)=>({...o,dom:c.dom,components:c.components})},schema:[St("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),St("components",[])],name:"blocker"})]),pQ=(o,c,m,b)=>{const _=Ui(),x=Ce=>{_.set(Ce);const Ne=o.lazySink(Ce).getOrDie(),st=b.blocker(),Ht=Ne.getSystem().build({...st,components:st.components.concat([ru(Ce)]),behaviours:An([Qo.config({}),ks("dialog-blocker-events",[eg(Gi(),()=>{Dh.isBlocked(Ce)?F():Po.focusIn(Ce)})])])});sl(Ne,Ht),Po.focusIn(Ce)},M=Ce=>{_.clear(),Fa(Ce.element).each(Ne=>{Ce.getSystem().getByDom(Ne).each(st=>{$c(st)})})},I=Ce=>o1(Ce,o,"body"),U=Ce=>Ai(Ce,o,"footer"),Y=(Ce,Ne)=>{Dh.block(Ce,Ne)},se=Ce=>{Dh.unblock(Ce)},fe=oo("modal-events"),me={...o.eventOrder,[Au()]:[fe].concat(o.eventOrder["alloy.system.attached"]||[])};return{uid:o.uid,dom:o.dom,components:c,apis:{show:x,hide:M,getBody:I,getFooter:U,setIdle:se,setBusy:Y},eventOrder:me,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Ql(o.modalBehaviours,[ms.config({}),Po.config({mode:"cyclic",onEnter:o.onExecute,onEscape:o.onEscape,useTabstopAt:o.useTabstopAt,firstTabstop:o.firstTabstop}),Dh.config({getRoot:_.get}),ks(fe,[vi(Ce=>{hQ(Ce.element,o1(Ce,o,"title").element)})])])}},Ml=fu({name:"ModalDialog",configFields:mQ(),partFields:gQ(),factory:pQ,apis:{show:(o,c)=>{o.show(c)},hide:(o,c)=>{o.hide(c)},getBody:(o,c)=>o.getBody(c),getFooter:(o,c)=>o.getFooter(c),setBusy:(o,c,m)=>{o.setBusy(c,m)},setIdle:(o,c)=>{o.setIdle(c)}}}),bQ=ro([Ol,pT].concat(Vw)),vQ=Eu,I6=[aR("button"),bg,xu("align","end",["start","end"]),dS,bp,Q0("buttonType",["primary","secondary"])],f$=[...I6,a1],B6=[Va("type",["submit","cancel","custom"]),...f$],yQ=[Va("type",["menu"]),wy,Zb,bg,Ll("items",bQ),...I6],d$=[...I6,Va("type",["togglebutton"]),Ca("tooltip"),bg,wy,ja("active",!1)],wQ=Cl("type",{submit:B6,cancel:B6,custom:B6,menu:yQ,togglebutton:d$}),_Q=[Ol,a1,Va("level",["info","warn","error","success"]),nR,St("url","")],CQ=ro(_Q),SQ=o=>[Ol,o],kQ=[Ol,a1,bp,aR("button"),bg,rR,Q0("buttonType",["primary","secondary","toolbar"]),dS],L6=ro(kQ),d_=[Ol,pT],y1=d_.concat([sR]),EQ=d_.concat([tR,bp]),xQ=ro(EQ),AQ=Eu,TQ=y1.concat([yT("auto")]),DQ=ro(TQ),OQ=eh([$w,a1,nR]),MQ=y1.concat([lc("storageKey","default")]),RQ=ro(MQ),NQ=hl,PQ=ro(y1),IQ=hl,BQ=d_.concat([lc("tag","textarea"),Ca("scriptId"),Ca("scriptUrl"),Vm("settings",void 0)]),LQ=d_.concat([lc("tag","textarea"),Ic("init")]),FQ=qu(o=>zi("customeditor.old",pi(LQ),o).orThunk(()=>zi("customeditor.new",pi(BQ),o))),HQ=hl,zQ=ro(y1),VQ=th(),UQ=o=>[Ol,J0("columns"),o],WQ=[Ol,Ca("html"),xu("presets","presentation",["presentation","document"])],jQ=ro(WQ),ZQ=y1.concat([ja("border",!1),ja("sandboxed",!0),ja("streamContent",!1),ja("transparent",!0)]),qQ=ro(ZQ),GQ=hl,h$=ro(d_.concat([Gl("height")])),m$=ro([Ca("url"),nh("zoom"),nh("cachedWidth"),nh("cachedHeight")]),h_=y1.concat([Gl("inputMode"),Gl("placeholder"),ja("maximized",!1),bp]),KQ=ro(h_),F6=hl,uD=o=>[Ol,tR,o,xu("align","start",["start","center","end"])],YQ=[a1,$w],XQ=[a1,Ll("items",Gu("items",()=>g$))],g$=Xn([ro(YQ),ro(XQ)]),JQ=y1.concat([Ll("items",g$),bp]),QQ=ro(JQ),m_=hl,p$=y1.concat([$p("items",[a1,$w]),Xc("size",1),bp]),eee=ro(p$),tee=hl,nee=y1.concat([ja("constrain",!0),bp]),oee=ro(nee),b$=ro([Ca("width"),Ca("height")]),see=d_.concat([tR,Xc("min",0),Xc("max",0)]),ree=ro(see),iee=Cd,H6=[Ol,Ll("header",hl),Ll("cells",_d(hl))],yA=ro(H6),$6=y1.concat([Gl("placeholder"),ja("maximized",!1),bp]),fD=ro($6),g_=hl,wA=[Va("type",["directory","leaf"]),bT,Ca("id"),Ua("menu",nA)],z6=ro(wA),v$=wA.concat([Ll("children",Gu("children",()=>Sd("type",{directory:V6,leaf:z6})))]),V6=ro(v$),aee=Sd("type",{directory:V6,leaf:z6}),lee=[Ol,Ll("items",aee),zm("onLeafAction"),zm("onToggleExpand"),Jc("defaultExpandedIds",[],hl),Gl("defaultSelectedId")],cee=ro(lee),y$=y1.concat([xu("filetype","file",["image","media","file"]),bp]),w$=ro(y$),U6=ro([$w,iR]),W6=o=>za("items","items",pr(),_d(qu(c=>zi(`Checking item of ${o}`,j6,c).fold(m=>wn.error(kd(m)),m=>wn.value(m))))),j6=dl(()=>Sd("type",{alertbanner:CQ,bar:ro(SQ(W6("bar"))),button:L6,checkbox:xQ,colorinput:RQ,colorpicker:PQ,dropzone:zQ,grid:ro(UQ(W6("grid"))),iframe:qQ,input:KQ,listbox:QQ,selectbox:eee,sizeinput:oee,slider:ree,textarea:fD,urlinput:w$,customeditor:FQ,htmlpanel:jQ,imagepreview:h$,collection:DQ,label:ro(uD(W6("label"))),table:yA,tree:cee,panel:Z6})),uee=[Ol,St("classes",[]),Ll("items",j6)],Z6=ro(uee),fee=[aR("tab"),bT,Ll("items",j6)],dee=[Ol,$p("tabs",fee)],hee=ro(dee),q6=f$,G6=wQ,mee=ro([Ca("title"),Gr("body",Sd("type",{panel:Z6,tabpanel:hee})),lc("size","normal"),Jc("buttons",[],G6),St("initialData",{}),Za("onAction",F),Za("onChange",F),Za("onSubmit",F),Za("onClose",F),Za("onCancel",F),Za("onTabChange",F)]),_$=o=>zi("dialog",mee,o),gee=ro([Va("type",["cancel","custom"]),...q6]),pee=ro([Ca("title"),Ca("url"),nh("height"),nh("width"),W1("buttons",gee),Za("onAction",F),Za("onCancel",F),Za("onClose",F),Za("onMessage",F)]),C$=o=>zi("dialog",pee,o),K6=o=>g(o)?[o].concat(Pe(va(o),K6)):C(o)?Pe(o,K6):[],bee=o=>h(o.type)&&h(o.name),p_={checkbox:AQ,colorinput:NQ,colorpicker:IQ,dropzone:VQ,input:F6,iframe:GQ,imagepreview:m$,selectbox:tee,sizeinput:b$,slider:iee,listbox:m_,size:b$,textarea:g_,urlinput:U6,customeditor:HQ,collection:OQ,togglemenuitem:vQ},S$=o=>V.from(p_[o.type]),vee=o=>ho(K6(o),bee),dD=o=>{const c=vee(o),m=Pe(c,b=>S$(b).fold(()=>[],_=>[Gr(b.name,_)]));return ro(m)},b_=o=>{var c;const m=ha(_$(o)),b=dD(o),_=(c=o.initialData)!==null&&c!==void 0?c:{};return{internalDialog:m,dataValidator:b,initialData:_}},x0={open:(o,c)=>{const m=b_(c);return o(m.internalDialog,m.initialData,m.dataValidator)},openUrl:(o,c)=>{const m=ha(C$(c));return o(m)},redial:o=>b_(o)};var hD=Object.freeze({__proto__:null,events:(o,c)=>{const m=(b,_)=>{o.updateState.each(x=>{const M=x(b,_);c.set(M)}),o.renderComponents.each(x=>{const M=x(_,c.get());(o.reuseDom?gM:jI)(b,M)})};return ri([en(Xh(),(b,_)=>{const x=_;if(!x.universal){const M=o.channel;ct(x.channels,M)&&m(b,x.data)}}),vi((b,_)=>{o.initialData.each(x=>{m(b,x)})})])}}),mD=Object.freeze({__proto__:null,getState:(o,c,m)=>m}),k$=[Qt("channel"),kr("renderComponents"),kr("updateState"),kr("initialData"),ja("reuseDom",!0)],_ee=Object.freeze({__proto__:null,init:()=>{const o=Ho(V.none()),c=()=>o.set(V.none());return{readState:()=>o.get().getOr("none"),get:o.get,set:o.set,clear:c}}});const wm=Xl({fields:k$,name:"reflecting",active:hD,apis:mD,state:_ee}),lv=o=>{const c=[],m={};return ar(o,(b,_)=>{b.fold(()=>{c.push(_)},x=>{m[_]=x})}),c.length>0?wn.error(c):wn.value(m)},Nre=(o,c,m)=>{const b=Qr(e_.sketch(_=>({dom:{tag:"div",classes:["tox-form"].concat(o.classes)},components:We(o.items,x=>sN(_,x,c,m))})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[b.asSpec()]}],behaviours:An([Po.config({mode:"acyclic",useTabstopAt:_e(Hx)}),wp.memento(b),lF(b,{postprocess:_=>lv(_).fold(x=>(console.error(x),{}),we)}),ks("dialog-body-panel",[en(Gi(),(_,x)=>{_.getSystem().broadcastOn([xS],{newFocus:V.some(x.event.target)})})])])}},Cee=(o,c)=>({uid:o.uid,dom:o.dom,components:o.components,events:q3(o.action),behaviours:Ql(o.tabButtonBehaviours,[Qo.config({}),Po.config({mode:"execution",useSpace:!0,useEnter:!0}),Yn.config({store:{mode:"memory",initialValue:o.value}})]),domModification:o.domModification}),E$=Vc({name:"TabButton",configFields:[St("uid",void 0),Qt("value"),za("dom","dom",xe(()=>({attributes:{role:"tab",id:oo("aria"),"aria-selected":"false"}})),Pc()),kr("action"),St("domModification",{}),$l("tabButtonBehaviours",[Qo,Po,Yn]),Qt("view")],factory:Cee}),jS=J([Qt("tabs"),Qt("dom"),St("clickToDismiss",!1),$l("tabbarBehaviours",[Nr,Po]),nf(["tabClass","selectedClass"])]),gD=od({factory:E$,name:"tabs",unit:"tab",overrides:o=>{const c=(b,_)=>{Nr.dehighlight(b,_),Ao(b,Sv(),{tabbar:b,button:_})},m=(b,_)=>{Nr.highlight(b,_),Ao(b,qg(),{tabbar:b,button:_})};return{action:b=>{const _=b.getSystem().getByUid(o.uid).getOrDie(),x=Nr.isHighlighted(_,b);(()=>x&&o.clickToDismiss?c:x?F:m)()(_,b)},domModification:{classes:[o.markers.tabClass]}}}}),x$=J([gD]),See=(o,c,m,b)=>({uid:o.uid,dom:o.dom,components:c,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Ql(o.tabbarBehaviours,[Nr.config({highlightClass:o.markers.selectedClass,itemClass:o.markers.tabClass,onHighlight:(_,x)=>{Kn(x.element,"aria-selected","true")},onDehighlight:(_,x)=>{Kn(x.element,"aria-selected","false")}}),Po.config({mode:"flow",getInitial:_=>Nr.getHighlighted(_).map(x=>x.element),selector:"."+o.markers.tabClass,executeOnMove:!0})])}),A$=fu({name:"Tabbar",configFields:jS(),partFields:x$(),factory:See}),kee=(o,c)=>({uid:o.uid,dom:o.dom,behaviours:Ql(o.tabviewBehaviours,[ms.config({})]),domModification:{attributes:{role:"tabpanel"}}}),Eee=Vc({name:"Tabview",configFields:[$l("tabviewBehaviours",[ms])],factory:kee}),ZS=J([St("selectFirst",!0),Gs("onChangeTab"),Gs("onDismissTab"),St("tabs",[]),$l("tabSectionBehaviours",[])]),Pre=zc({factory:A$,schema:[Qt("dom"),Gf("markers",[Qt("tabClass"),Qt("selectedClass")])],name:"tabbar",defaults:o=>({tabs:o.tabs})}),xee=zc({factory:Eee,name:"tabview"}),Aee=J([Pre,xee]),Ire=(o,c,m,b)=>{const _=M=>{const I=Yn.getValue(M);Ai(M,o,"tabview").each(U=>{Ct(o.tabs,se=>se.value===I).each(se=>{const fe=se.view();de(M.element,"id").each(me=>{Kn(U.element,"aria-labelledby",me)}),ms.set(U,fe),o.onChangeTab(U,M,fe)})})},x=(M,I)=>{Ai(M,o,"tabbar").each(U=>{I(U).each(lh)})};return{uid:o.uid,dom:o.dom,components:c,behaviours:um(o.tabSectionBehaviours),events:ri(Et([o.selectFirst?[vi((M,I)=>{x(M,Nr.getFirst)})]:[],[en(qg(),(M,I)=>{const U=I.event.button;_(U)}),en(Sv(),(M,I)=>{const U=I.event.button;o.onDismissTab(M,U)})]])),apis:{getViewItems:M=>Ai(M,o,"tabview").map(I=>ms.contents(I)).getOr([]),showTab:(M,I)=>{x(M,Y=>{const se=Nr.getCandidates(Y);return Ct(se,me=>Yn.getValue(me)===I).filter(me=>!Nr.isHighlighted(Y,me))})}}}},qS=fu({name:"TabSection",configFields:ZS(),partFields:Aee(),factory:Ire,apis:{getViewItems:(o,c)=>o.getViewItems(c),showTab:(o,c,m)=>{o.showTab(c,m)}}}),Tee=(o,c,m)=>We(o,(b,_)=>{ms.set(m,o[_].view());const x=c.dom.getBoundingClientRect();return ms.set(m,[]),x.height}),_A=o=>ds(rs(o,(c,m)=>c>m?-1:c<m?1:0)),Dee=(o,c,m)=>{const b=bu(o).dom,_=og(o,".tox-dialog-wrap").getOr(o),x=qr(_,"position")==="fixed";let M;x?M=Math.max(b.clientHeight,window.innerHeight):M=Math.max(b.offsetHeight,b.scrollHeight);const I=Oi(c),Y=c.dom.offsetLeft>=m.dom.offsetLeft+Ji(m)?Math.max(Oi(m),I):I,se=parseInt(qr(o,"margin-top"),10)||0,fe=parseInt(qr(o,"margin-bottom"),10)||0,Ce=Oi(o)+se+fe-Y;return M-Ce},Oee=(o,c)=>{ds(o).each(m=>qS.showTab(c,m.value))},Y6=(o,c)=>{no(o,"height",c+"px"),no(o,"flex-basis",c+"px")},pD=(o,c,m)=>{og(o,'[role="dialog"]').each(b=>{ta(b,'[role="tablist"]').each(_=>{m.get().map(x=>(no(c,"height","0"),no(c,"flex-basis","0"),Math.min(x,Dee(b,c,_)))).each(x=>{Y6(c,x)})})})},T$=o=>ta(o,'[role="tabpanel"]'),n=o=>{const c=Ui();return{extraEvents:[vi(_=>{const x=_.element;T$(x).each(M=>{no(M,"visibility","hidden"),_.getSystem().getByDom(M).toOptional().each(I=>{const U=Tee(o,M,I);_A(U).fold(c.clear,c.set)}),pD(x,M,c),Ss(M,"visibility"),Oee(o,_),requestAnimationFrame(()=>{pD(x,M,c)})})}),en(ih(),_=>{const x=_.element;T$(x).each(M=>{pD(x,M,c)})}),en(i5,(_,x)=>{const M=_.element;T$(M).each(I=>{const U=Of(Pt(I));no(I,"visibility","hidden");const Y=Xi(I,"height").map(me=>parseInt(me,10));Ss(I,"height"),Ss(I,"flex-basis");const se=I.dom.getBoundingClientRect().height;Y.forall(me=>se>me)?(c.set(se),pD(M,I,c)):Y.each(me=>{Y6(I,me)}),Ss(I,"visibility"),U.each(sf)})})],selectFirst:!1}},i="send-data-to-section",l="send-data-to-view",d=(o,c,m)=>{const b=Ho({}),_=Y=>{const se=Yn.getValue(Y),fe=lv(se).getOr({}),me=b.get(),Ce=Jr(me,fe);b.set(Ce)},x=Y=>{const se=b.get();Yn.setValue(Y,se)},M=Ho(null),I=We(o.tabs,Y=>({value:Y.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Ri(m.shared.providers.translate(Y.title))],view:()=>[e_.sketch(se=>({dom:{tag:"div",classes:["tox-form"]},components:We(Y.items,fe=>sN(se,fe,c,m)),formBehaviours:An([Po.config({mode:"acyclic",useTabstopAt:_e(Hx)}),ks("TabView.form.events",[vi(x),Dd(_)]),Cc.config({channels:Uo([{key:i,value:{onReceive:_}},{key:l,value:{onReceive:x}}])})])}))]})),U=n(I);return qS.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(Y,se,fe)=>{const me=Yn.getValue(se);Ao(Y,xL,{name:me,oldName:M.get()}),M.set(me)},tabs:I,components:[qS.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[A$.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:An([Ga.config({})])}),qS.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:U.selectFirst,tabSectionBehaviours:An([ks("tabpanel",U.extraEvents),Po.config({mode:"acyclic"}),sr.config({find:Y=>ds(qS.getViewItems(Y))}),ev(V.none(),Y=>(Y.getSystem().broadcastOn([i],{}),b.get()),(Y,se)=>{b.set(se),Y.getSystem().broadcastOn([l],{})})])})},p=(o,c,m,b,_)=>{const x=U=>{const Y=U.body;switch(Y.type){case"tabpanel":return[d(Y,U.initialData,b)];default:return[Nre(Y,U.initialData,b)]}},M=(U,Y)=>V.some({isTabPanel:()=>Y.body.type==="tabpanel"}),I={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...m.map(U=>({id:U})).getOr({}),..._?I:{}}},components:[],behaviours:An([wp.childAt(0),wm.config({channel:`${t4}-${c}`,updateState:M,renderComponents:x,initialData:o})])}},w=(o,c,m,b,_)=>p(o,c,V.some(m),b,_),E=(o,c,m)=>{const b=p(o,c,V.none(),m,!1);return Ml.parts.body(b)},R=o=>{const c={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[N5(V.none(),{dom:{tag:"iframe",attributes:{src:o.url}},behaviours:An([Ga.config({}),Qo.config({})])})]}],behaviours:An([Po.config({mode:"acyclic",useTabstopAt:_e(Hx)})])};return Ml.parts.body(c)};function B(o){return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},B(o)}function K(o,c){return K=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},K(o,c)}function ie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ue(o,c,m){return ie()?ue=Reflect.construct:ue=function(_,x,M){var I=[null];I.push.apply(I,x);var U=Function.bind.apply(_,I),Y=new U;return M&&K(Y,M.prototype),Y},ue.apply(null,arguments)}function pe(o){return Be(o)||Ze(o)||Oe(o)||ht()}function Be(o){if(Array.isArray(o))return ze(o)}function Ze(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function Oe(o,c){if(!!o){if(typeof o=="string")return ze(o,c);var m=Object.prototype.toString.call(o).slice(8,-1);if(m==="Object"&&o.constructor&&(m=o.constructor.name),m==="Map"||m==="Set")return Array.from(o);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return ze(o,c)}}function ze(o,c){(c==null||c>o.length)&&(c=o.length);for(var m=0,b=new Array(c);m<c;m++)b[m]=o[m];return b}function ht(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bt=Object.hasOwnProperty,vt=Object.setPrototypeOf,Mt=Object.isFrozen,fn=Object.getPrototypeOf,$n=Object.getOwnPropertyDescriptor,Pn=Object.freeze,Lt=Object.seal,$t=Object.create,yn=typeof Reflect<"u"&&Reflect,mo=yn.apply,Oo=yn.construct;mo||(mo=function(c,m,b){return c.apply(m,b)}),Pn||(Pn=function(c){return c}),Lt||(Lt=function(c){return c}),Oo||(Oo=function(c,m){return ue(c,pe(m))});var Cs=Bs(Array.prototype.forEach),Us=Bs(Array.prototype.pop),Pr=Bs(Array.prototype.push),di=Bs(String.prototype.toLowerCase),il=Bs(String.prototype.match),Rl=Bs(String.prototype.replace),hc=Bs(String.prototype.indexOf),Mn=Bs(String.prototype.trim),Qn=Bs(RegExp.prototype.test),yr=vo(TypeError);function Bs(o){return function(c){for(var m=arguments.length,b=new Array(m>1?m-1:0),_=1;_<m;_++)b[_-1]=arguments[_];return mo(o,c,b)}}function vo(o){return function(){for(var c=arguments.length,m=new Array(c),b=0;b<c;b++)m[b]=arguments[b];return Oo(o,m)}}function Rn(o,c){vt&&vt(o,null);for(var m=c.length;m--;){var b=c[m];if(typeof b=="string"){var _=di(b);_!==b&&(Mt(c)||(c[m]=_),b=_)}o[b]=!0}return o}function Tn(o){var c=$t(null),m;for(m in o)mo(bt,o,[m])&&(c[m]=o[m]);return c}function jo(o,c){for(;o!==null;){var m=$n(o,c);if(m){if(m.get)return Bs(m.get);if(typeof m.value=="function")return Bs(m.value)}o=fn(o)}function b(_){return console.warn("fallback value for",_),null}return b}var Ys=Pn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Kr=Pn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),io=Pn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ws=Pn(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ii=Pn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Ka=Pn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ci=Pn(["#text"]),Ec=Pn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Mh=Pn(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),zd=Pn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),_m=Pn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Fy=Lt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),v_=Lt(/<%[\w\W]*|[\w\W]*%>/gm),Hy=Lt(/^data-[\-\w.\u00B7-\uFFFF]/),$y=Lt(/^aria-[\-\w]+$/),bD=Lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vD=Lt(/^(?:\w+script|data):/i),yD=Lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),CA=Lt(/^html$/i),SA=function(){return typeof window>"u"?null:window},kA=function(c,m){if(B(c)!=="object"||typeof c.createPolicy!="function")return null;var b=null,_="data-tt-policy-suffix";m.currentScript&&m.currentScript.hasAttribute(_)&&(b=m.currentScript.getAttribute(_));var x="dompurify"+(b?"#"+b:"");try{return c.createPolicy(x,{createHTML:function(I){return I}})}catch{return console.warn("TrustedTypes policy "+x+" could not be created."),null}};function GS(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:SA(),c=function(Gt){return GS(Gt)};if(c.version="2.3.8",c.removed=[],!o||!o.document||o.document.nodeType!==9)return c.isSupported=!1,c;var m=o.document,b=o.document,_=o.DocumentFragment,x=o.HTMLTemplateElement,M=o.Node,I=o.Element,U=o.NodeFilter,Y=o.NamedNodeMap,se=Y===void 0?o.NamedNodeMap||o.MozNamedAttrMap:Y,fe=o.HTMLFormElement,me=o.DOMParser,Ce=o.trustedTypes,Ne=I.prototype,st=jo(Ne,"cloneNode"),Ht=jo(Ne,"nextSibling"),ut=jo(Ne,"childNodes"),lt=jo(Ne,"parentNode");if(typeof x=="function"){var Zt=b.createElement("template");Zt.content&&Zt.content.ownerDocument&&(b=Zt.content.ownerDocument)}var Dt=kA(Ce,m),kn=Dt?Dt.createHTML(""):"",mn=b,In=mn.implementation,Zn=mn.createNodeIterator,js=mn.createDocumentFragment,yo=mn.getElementsByTagName,ws=m.importNode,fs={};try{fs=Tn(b).documentMode?b.documentMode:{}}catch{}var hr={};c.isSupported=typeof lt=="function"&&In&&typeof In.createHTMLDocument<"u"&&fs!==9;var Fo=Fy,ir=v_,Fn=Hy,po=$y,ls=vD,Xs=yD,zo=bD,bs=null,Ti=Rn({},[].concat(pe(Ys),pe(Kr),pe(io),pe(ii),pe(Ci))),$r=null,df=Rn({},[].concat(pe(Ec),pe(Mh),pe(zd),pe(_m))),pa=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ud=null,Sp=null,zy=!0,Vy=!0,__=!1,Uy=!1,fv=!1,J6=!1,Q6=!1,XS=!1,R$=!1,N$=!1,Hre=!0,Nee=!0,eP=!1,CD={},SD=null,$re=Rn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),zre=null,Vre=Rn({},["audio","video","img","source","image","track"]),Pee=null,Ure=Rn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Iee="http://www.w3.org/1998/Math/MathML",Bee="http://www.w3.org/2000/svg",JS="http://www.w3.org/1999/xhtml",P$=JS,Lee=!1,kD,y0e=["application/xhtml+xml","text/html"],w0e="text/html",RA,ED=null,_0e=b.createElement("form"),Wre=function(Gt){return Gt instanceof RegExp||Gt instanceof Function},Fee=function(Gt){ED&&ED===Gt||((!Gt||B(Gt)!=="object")&&(Gt={}),Gt=Tn(Gt),bs="ALLOWED_TAGS"in Gt?Rn({},Gt.ALLOWED_TAGS):Ti,$r="ALLOWED_ATTR"in Gt?Rn({},Gt.ALLOWED_ATTR):df,Pee="ADD_URI_SAFE_ATTR"in Gt?Rn(Tn(Ure),Gt.ADD_URI_SAFE_ATTR):Ure,zre="ADD_DATA_URI_TAGS"in Gt?Rn(Tn(Vre),Gt.ADD_DATA_URI_TAGS):Vre,SD="FORBID_CONTENTS"in Gt?Rn({},Gt.FORBID_CONTENTS):$re,Ud="FORBID_TAGS"in Gt?Rn({},Gt.FORBID_TAGS):{},Sp="FORBID_ATTR"in Gt?Rn({},Gt.FORBID_ATTR):{},CD="USE_PROFILES"in Gt?Gt.USE_PROFILES:!1,zy=Gt.ALLOW_ARIA_ATTR!==!1,Vy=Gt.ALLOW_DATA_ATTR!==!1,__=Gt.ALLOW_UNKNOWN_PROTOCOLS||!1,Uy=Gt.SAFE_FOR_TEMPLATES||!1,fv=Gt.WHOLE_DOCUMENT||!1,XS=Gt.RETURN_DOM||!1,R$=Gt.RETURN_DOM_FRAGMENT||!1,N$=Gt.RETURN_TRUSTED_TYPE||!1,Q6=Gt.FORCE_BODY||!1,Hre=Gt.SANITIZE_DOM!==!1,Nee=Gt.KEEP_CONTENT!==!1,eP=Gt.IN_PLACE||!1,zo=Gt.ALLOWED_URI_REGEXP||zo,P$=Gt.NAMESPACE||JS,Gt.CUSTOM_ELEMENT_HANDLING&&Wre(Gt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(pa.tagNameCheck=Gt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Gt.CUSTOM_ELEMENT_HANDLING&&Wre(Gt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(pa.attributeNameCheck=Gt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Gt.CUSTOM_ELEMENT_HANDLING&&typeof Gt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(pa.allowCustomizedBuiltInElements=Gt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),kD=y0e.indexOf(Gt.PARSER_MEDIA_TYPE)===-1?kD=w0e:kD=Gt.PARSER_MEDIA_TYPE,RA=kD==="application/xhtml+xml"?function(_o){return _o}:di,Uy&&(Vy=!1),R$&&(XS=!0),CD&&(bs=Rn({},pe(Ci)),$r=[],CD.html===!0&&(Rn(bs,Ys),Rn($r,Ec)),CD.svg===!0&&(Rn(bs,Kr),Rn($r,Mh),Rn($r,_m)),CD.svgFilters===!0&&(Rn(bs,io),Rn($r,Mh),Rn($r,_m)),CD.mathMl===!0&&(Rn(bs,ii),Rn($r,zd),Rn($r,_m))),Gt.ADD_TAGS&&(bs===Ti&&(bs=Tn(bs)),Rn(bs,Gt.ADD_TAGS)),Gt.ADD_ATTR&&($r===df&&($r=Tn($r)),Rn($r,Gt.ADD_ATTR)),Gt.ADD_URI_SAFE_ATTR&&Rn(Pee,Gt.ADD_URI_SAFE_ATTR),Gt.FORBID_CONTENTS&&(SD===$re&&(SD=Tn(SD)),Rn(SD,Gt.FORBID_CONTENTS)),Nee&&(bs["#text"]=!0),fv&&Rn(bs,["html","head","body"]),bs.table&&(Rn(bs,["tbody"]),delete Ud.tbody),Pn&&Pn(Gt),ED=Gt)},jre=Rn({},["mi","mo","mn","ms","mtext"]),Zre=Rn({},["foreignobject","desc","title","annotation-xml"]),C0e=Rn({},["title","style","font","a","script"]),I$=Rn({},Kr);Rn(I$,io),Rn(I$,Ws);var Hee=Rn({},ii);Rn(Hee,Ka);var S0e=function(Gt){var _o=lt(Gt);(!_o||!_o.tagName)&&(_o={namespaceURI:JS,tagName:"template"});var Es=di(Gt.tagName),zl=di(_o.tagName);return Gt.namespaceURI===Bee?_o.namespaceURI===JS?Es==="svg":_o.namespaceURI===Iee?Es==="svg"&&(zl==="annotation-xml"||jre[zl]):Boolean(I$[Es]):Gt.namespaceURI===Iee?_o.namespaceURI===JS?Es==="math":_o.namespaceURI===Bee?Es==="math"&&Zre[zl]:Boolean(Hee[Es]):Gt.namespaceURI===JS?_o.namespaceURI===Bee&&!Zre[zl]||_o.namespaceURI===Iee&&!jre[zl]?!1:!Hee[Es]&&(C0e[Es]||!I$[Es]):!1},C_=function(Gt){Pr(c.removed,{element:Gt});try{Gt.parentNode.removeChild(Gt)}catch{try{Gt.outerHTML=kn}catch{Gt.remove()}}},B$=function(Gt,_o){try{Pr(c.removed,{attribute:_o.getAttributeNode(Gt),from:_o})}catch{Pr(c.removed,{attribute:null,from:_o})}if(_o.removeAttribute(Gt),Gt==="is"&&!$r[Gt])if(XS||R$)try{C_(_o)}catch{}else try{_o.setAttribute(Gt,"")}catch{}},qre=function(Gt){var _o,Es;if(Q6)Gt="<remove></remove>"+Gt;else{var zl=il(Gt,/^[\r\n\t ]+/);Es=zl&&zl[0]}kD==="application/xhtml+xml"&&(Gt='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Gt+"</body></html>");var kp=Dt?Dt.createHTML(Gt):Gt;if(P$===JS)try{_o=new me().parseFromString(kp,kD)}catch{}if(!_o||!_o.documentElement){_o=In.createDocument(P$,"template",null);try{_o.documentElement.innerHTML=Lee?"":kp}catch{}}var Sm=_o.body||_o.documentElement;return Gt&&Es&&Sm.insertBefore(b.createTextNode(Es),Sm.childNodes[0]||null),P$===JS?yo.call(_o,fv?"html":"body")[0]:fv?_o.documentElement:Sm},Gre=function(Gt){return Zn.call(Gt.ownerDocument||Gt,Gt,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT,null,!1)},k0e=function(Gt){return Gt instanceof fe&&(typeof Gt.nodeName!="string"||typeof Gt.textContent!="string"||typeof Gt.removeChild!="function"||!(Gt.attributes instanceof se)||typeof Gt.removeAttribute!="function"||typeof Gt.setAttribute!="function"||typeof Gt.namespaceURI!="string"||typeof Gt.insertBefore!="function")},tP=function(Gt){return B(M)==="object"?Gt instanceof M:Gt&&B(Gt)==="object"&&typeof Gt.nodeType=="number"&&typeof Gt.nodeName=="string"},S_=function(Gt,_o,Es){!hr[Gt]||Cs(hr[Gt],function(zl){zl.call(c,_o,Es,ED)})},Kre=function(Gt){var _o;if(S_("beforeSanitizeElements",Gt,null),k0e(Gt)||Qn(/[\u0080-\uFFFF]/,Gt.nodeName))return C_(Gt),!0;var Es=RA(Gt.nodeName);if(S_("uponSanitizeElement",Gt,{tagName:Es,allowedTags:bs}),Gt.hasChildNodes()&&!tP(Gt.firstElementChild)&&(!tP(Gt.content)||!tP(Gt.content.firstElementChild))&&Qn(/<[/\w]/g,Gt.innerHTML)&&Qn(/<[/\w]/g,Gt.textContent)||Es==="select"&&Qn(/<template/i,Gt.innerHTML))return C_(Gt),!0;if(!bs[Es]||Ud[Es]){if(!Ud[Es]&&Xre(Es)&&(pa.tagNameCheck instanceof RegExp&&Qn(pa.tagNameCheck,Es)||pa.tagNameCheck instanceof Function&&pa.tagNameCheck(Es)))return!1;if(Nee&&!SD[Es]){var zl=lt(Gt)||Gt.parentNode,kp=ut(Gt)||Gt.childNodes;if(kp&&zl)for(var Sm=kp.length,Rh=Sm-1;Rh>=0;--Rh)zl.insertBefore(st(kp[Rh],!0),Ht(Gt))}return C_(Gt),!0}return Gt instanceof I&&!S0e(Gt)||(Es==="noscript"||Es==="noembed")&&Qn(/<\/no(script|embed)/i,Gt.innerHTML)?(C_(Gt),!0):(Uy&&Gt.nodeType===3&&(_o=Gt.textContent,_o=Rl(_o,Fo," "),_o=Rl(_o,ir," "),Gt.textContent!==_o&&(Pr(c.removed,{element:Gt.cloneNode()}),Gt.textContent=_o)),S_("afterSanitizeElements",Gt,null),!1)},Yre=function(Gt,_o,Es){if(Hre&&(_o==="id"||_o==="name")&&(Es in b||Es in _0e))return!1;if(!(Vy&&!Sp[_o]&&Qn(Fn,_o))){if(!(zy&&Qn(po,_o))){if(!$r[_o]||Sp[_o]){if(!(Xre(Gt)&&(pa.tagNameCheck instanceof RegExp&&Qn(pa.tagNameCheck,Gt)||pa.tagNameCheck instanceof Function&&pa.tagNameCheck(Gt))&&(pa.attributeNameCheck instanceof RegExp&&Qn(pa.attributeNameCheck,_o)||pa.attributeNameCheck instanceof Function&&pa.attributeNameCheck(_o))||_o==="is"&&pa.allowCustomizedBuiltInElements&&(pa.tagNameCheck instanceof RegExp&&Qn(pa.tagNameCheck,Es)||pa.tagNameCheck instanceof Function&&pa.tagNameCheck(Es))))return!1}else if(!Pee[_o]){if(!Qn(zo,Rl(Es,Xs,""))){if(!((_o==="src"||_o==="xlink:href"||_o==="href")&&Gt!=="script"&&hc(Es,"data:")===0&&zre[Gt])){if(!(__&&!Qn(ls,Rl(Es,Xs,"")))){if(Es)return!1}}}}}}return!0},Xre=function(Gt){return Gt.indexOf("-")>0},Jre=function(Gt){var _o,Es,zl,kp;S_("beforeSanitizeAttributes",Gt,null);var Sm=Gt.attributes;if(!!Sm){var Rh={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$r};for(kp=Sm.length;kp--;){_o=Sm[kp];var L$=_o,Nh=L$.name,Qre=L$.namespaceURI;Es=Nh==="value"?_o.value:Mn(_o.value),zl=RA(Nh);var x0e=Es;if(Rh.attrName=zl,Rh.attrValue=Es,Rh.keepAttr=!0,Rh.forceKeepAttr=void 0,S_("uponSanitizeAttribute",Gt,Rh),Es=Rh.attrValue,!Rh.forceKeepAttr){if(!Rh.keepAttr){B$(Nh,Gt);continue}if(Qn(/\/>/i,Es)){B$(Nh,Gt);continue}Uy&&(Es=Rl(Es,Fo," "),Es=Rl(Es,ir," "));var A0e=RA(Gt.nodeName);if(!Yre(A0e,zl,Es)){B$(Nh,Gt);continue}if(Es!==x0e)try{Qre?Gt.setAttributeNS(Qre,Nh,Es):Gt.setAttribute(Nh,Es)}catch{B$(Nh,Gt)}}}S_("afterSanitizeAttributes",Gt,null)}},E0e=function or(Gt){var _o,Es=Gre(Gt);for(S_("beforeSanitizeShadowDOM",Gt,null);_o=Es.nextNode();)S_("uponSanitizeShadowNode",_o,null),!Kre(_o)&&(_o.content instanceof _&&or(_o.content),Jre(_o));S_("afterSanitizeShadowDOM",Gt,null)};return c.sanitize=function(or,Gt){var _o,Es,zl,kp,Sm;if(Lee=!or,Lee&&(or="<!-->"),typeof or!="string"&&!tP(or)){if(typeof or.toString!="function")throw yr("toString is not a function");if(or=or.toString(),typeof or!="string")throw yr("dirty is not a string, aborting")}if(!c.isSupported){if(B(o.toStaticHTML)==="object"||typeof o.toStaticHTML=="function"){if(typeof or=="string")return o.toStaticHTML(or);if(tP(or))return o.toStaticHTML(or.outerHTML)}return or}if(J6||Fee(Gt),c.removed=[],typeof or=="string"&&(eP=!1),eP){if(or.nodeName){var Rh=RA(or.nodeName);if(!bs[Rh]||Ud[Rh])throw yr("root node is forbidden and cannot be sanitized in-place")}}else if(or instanceof M)_o=qre("<!---->"),Es=_o.ownerDocument.importNode(or,!0),Es.nodeType===1&&Es.nodeName==="BODY"||Es.nodeName==="HTML"?_o=Es:_o.appendChild(Es);else{if(!XS&&!Uy&&!fv&&or.indexOf("<")===-1)return Dt&&N$?Dt.createHTML(or):or;if(_o=qre(or),!_o)return XS?null:N$?kn:""}_o&&Q6&&C_(_o.firstChild);for(var L$=Gre(eP?or:_o);zl=L$.nextNode();)zl.nodeType===3&&zl===kp||Kre(zl)||(zl.content instanceof _&&E0e(zl.content),Jre(zl),kp=zl);if(kp=null,eP)return or;if(XS){if(R$)for(Sm=js.call(_o.ownerDocument);_o.firstChild;)Sm.appendChild(_o.firstChild);else Sm=_o;return $r.shadowroot&&(Sm=ws.call(m,Sm,!0)),Sm}var Nh=fv?_o.outerHTML:_o.innerHTML;return fv&&bs["!doctype"]&&_o.ownerDocument&&_o.ownerDocument.doctype&&_o.ownerDocument.doctype.name&&Qn(CA,_o.ownerDocument.doctype.name)&&(Nh="<!DOCTYPE "+_o.ownerDocument.doctype.name+`>
`+Nh),Uy&&(Nh=Rl(Nh,Fo," "),Nh=Rl(Nh,ir," ")),Dt&&N$?Dt.createHTML(Nh):Nh},c.setConfig=function(or){Fee(or),J6=!0},c.clearConfig=function(){ED=null,J6=!1},c.isValidAttribute=function(or,Gt,_o){ED||Fee({});var Es=RA(or),zl=RA(Gt);return Yre(Es,zl,_o)},c.addHook=function(or,Gt){typeof Gt=="function"&&(hr[or]=hr[or]||[],Pr(hr[or],Gt))},c.removeHook=function(or){if(hr[or])return Us(hr[or])},c.removeHooks=function(or){hr[or]&&(hr[or]=[])},c.removeAllHooks=function(){hr={}},c}var w1=GS();const KS=o=>w1().sanitize(o),y_=sS.deviceType.isTouch(),cv=(o,c)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[o,c]}),EA=(o,c)=>Ml.parts.close(Uc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":c.translate("Close")}},action:o,buttonBehaviours:An([Ga.config({})])})),xA=()=>Ml.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),A0=(o,c)=>Ml.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Py(`<p>${KS(c.translate(o))}</p>`)}]}]}),uv=o=>Ml.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:o}),AA=(o,c)=>[f1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:o}),f1.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:c})],TA=o=>{const c="tox-dialog",m=c+"-wrap",b=m+"__backdrop",_=c+"__disable-scroll";return Ml.sketch({lazySink:o.lazySink,onEscape:x=>(o.onEscape(x),V.some(!0)),useTabstopAt:x=>!Hx(x),firstTabstop:o.firstTabstop,dom:{tag:"div",classes:[c].concat(o.extraClasses),styles:{position:"relative",...o.extraStyles}},components:[o.header,o.body,...o.footer.toArray()],parts:{blocker:{dom:Py(`<div class="${m}"></div>`),components:[{dom:{tag:"div",classes:y_?[b,b+"--opaque"]:[b]}}]}},dragBlockClass:m,modalBehaviours:An([Qo.config({}),ks("dialog-events",o.dialogEvents.concat([eg(Gi(),(x,M)=>{Dh.isBlocked(x)?F():Po.focusIn(x)}),en(_v(),(x,M)=>{x.getSystem().broadcastOn([xS],{newFocus:M.event.newFocus})})])),ks("scroll-lock",[vi(()=>{Ra(Li(),_)}),Dd(()=>{ma(Li(),_)})]),...o.extraBehaviours]),eventOrder:{[Yu()]:["dialog-events"],[Au()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[xd()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...o.eventOrder}})},DA=o=>Uc.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":o.translate("Close"),title:o.translate("Close")}},buttonBehaviours:An([Ga.config({})]),components:[gp("close",{tag:"span",classes:["tox-icon"]},o.icons)],action:c=>{nr(c,Ey)}}),wD=(o,c,m,b)=>{const _=x=>[Ri(b.translate(x.title))];return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:{...m.map(x=>({id:x})).getOr({})}},components:[],behaviours:An([wm.config({channel:`${m1}-${c}`,initialData:o,renderComponents:_})])}},_D=()=>({dom:Py('<div class="tox-dialog__draghandle"></div>')}),D$=(o,c,m,b)=>f1.sketch({dom:Py('<div class="tox-dialog__header"></div>'),components:[wD(o,c,V.some(m),b),_D(),DA(b)],containerBehaviours:An([f_.config({mode:"mouse",blockerClass:"blocker",getTarget:_=>tf(_,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}),_1=(o,c,m)=>{const b=Ml.parts.title(wD(o,c,V.none(),m)),_=Ml.parts.draghandle(_D()),x=Ml.parts.close(DA(m)),M=[b].concat(o.draggable?[_]:[]).concat([x]);return f1.sketch({dom:Py('<div class="tox-dialog__header"></div>'),components:M})},w_=(o,c,m)=>_1({title:m.shared.providers.translate(o),draggable:m.dialog.isDraggableModal()},c,m.shared.providers),Rt=(o,c,m,b)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":m.translate(o)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${b.getOr(0)}px`,position:"absolute"}},behaviours:c,components:[{dom:Py('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),Nt=(o,c,m)=>({onClose:()=>m.closeWindow(),onBlock:b=>{const _=ta(o().element,".tox-dialog__header").map(x=>Oi(x));Ml.setBusy(o(),(x,M)=>Rt(b.message,M,c,_))},onUnblock:()=>{Ml.setIdle(o())}}),Nn=(o,c,m,b)=>{const _=(x,M)=>V.some(M);return uc(TA({...o,firstTabstop:1,lazySink:b.shared.getSink,extraBehaviours:[wm.config({channel:`${e4}-${o.id}`,updateState:_,initialData:c}),tv({}),...o.extraBehaviours],onEscape:x=>{nr(x,Ey)},dialogEvents:m,eventOrder:{[Xh()]:[wm.name(),Cc.name()],[Au()]:["scroll-lock",wm.name(),"messages","dialog-events","alloy.base.behaviour"],[xd()]:["alloy.base.behaviour","dialog-events","messages",wm.name(),"scroll-lock"]}}))},En=(o,c={})=>{const m=b=>{const _=We(b.items,x=>{const M=an(c,x.name).getOr(Ho(!1));return{...x,storage:M}});return{...b,items:_}};return We(o,b=>b.type==="menu"?m(b):b)},Io=o=>xo(o,(c,m)=>m.type==="menu"?xo(m.items,(_,x)=>(_[x.name]=x.storage,_),c):c,{}),dr=(o,c)=>[p2(Gi(),jq),o(Ox,(m,b,_,x)=>{Of(Pt(x.element)).fold(F,$v),c.onClose(),b.onClose()}),o(Ey,(m,b,_,x)=>{b.onCancel(m),nr(x,Ox)}),en(PT,(m,b)=>c.onUnblock()),en(r5,(m,b)=>c.onBlock(b.event))],la=(o,c)=>{const m=(_,x)=>en(_,(M,I)=>{b(M,(U,Y)=>{x(o(),U,I.event,M)})}),b=(_,x)=>{wm.getState(_).get().each(M=>{x(M,_)})};return[...dr(m,c),m(k0,(_,x,M)=>{x.onAction(_,{name:M.name})})]},xc=(o,c,m)=>{const b=(x,M)=>en(x,(I,U)=>{_(I,(Y,se)=>{M(o(),Y,U.event,I)})}),_=(x,M)=>{wm.getState(x).get().each(I=>{M(I.internalDialog,x)})};return[...dr(b,c),b(CS,(x,M)=>M.onSubmit(x)),b(Ah,(x,M,I)=>{M.onChange(x,{name:I.name})}),b(k0,(x,M,I,U)=>{const Y=()=>U.getSystem().isConnected()?Po.focusIn(U):void 0,se=Ce=>Me(Ce,"disabled")||de(Ce,"aria-disabled").exists(Ne=>Ne==="true"),fe=Pt(U.element),me=Of(fe);M.onAction(x,{name:I.name,value:I.value}),Of(fe).fold(Y,Ce=>{se(Ce)||me.exists(Ne=>La(Ce,Ne)&&se(Ne))?Y():m().toOptional().filter(Ne=>!La(Ne.element,Ce)).each(Y)})}),b(xL,(x,M,I)=>{M.onTabChange(x,{newTabName:I.name,oldTabName:I.oldName})}),Dd(x=>{const M=o();Yn.setValue(x,M.getData())})]},du=(o,c)=>p4(o,o.type,c),OA=(o,c,m)=>Ct(c,b=>b.name===m).bind(b=>b.memento.getOpt(o)),MA=(o,c)=>{const m=c.map(I=>I.footerButtons).getOr([]),b=es(m,I=>I.align==="start"),_=(I,U)=>f1.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${I}`]},components:We(U,Y=>Y.memento.asSpec())}),x=_("start",b.pass),M=_("end",b.fail);return[x,M]},X6=(o,c,m)=>{const b=(_,x)=>{const M=We(x.buttons,U=>{const Y=Qr(du(U,m));return{name:U.name,align:U.align,memento:Y}}),I=U=>OA(_,M,U);return V.some({lookupByName:I,footerButtons:M})};return{dom:Py('<div class="tox-dialog__footer"></div>'),components:[],behaviours:An([wm.config({channel:`${P5}-${c}`,initialData:o,updateState:b,renderComponents:MA})])}},Mee=(o,c,m)=>X6(o,c,m),zs=(o,c,m)=>Ml.parts.footer(X6(o,c,m)),qt=(o,c)=>{if(o.getRoot().getSystem().isConnected()){const b=sr.getCurrent(o.getFormWrapper()).getOr(o.getFormWrapper());return e_.getField(b,c).orThunk(()=>o.getFooter().bind(M=>wm.getState(M).get()).bind(M=>M.lookupByName(c)))}else return V.none()},bo=(o,c)=>{const m=o.getRoot();return wm.getState(m).get().map(b=>ha(zi("data",b.dataValidator,c))).getOr(c)},ys=(o,c,m)=>{const b=Ne=>{const st=o.getRoot();st.getSystem().isConnected()&&Ne(st)},Ce={getData:()=>{const Ne=o.getRoot(),st=Ne.getSystem().isConnected()?o.getFormWrapper():Ne,Ht=Yn.getValue(st),ut=Ps(m,lt=>lt.get());return{...Ht,...ut}},setData:Ne=>{b(st=>{const Ht=Ce.getData(),ut=Jr(Ht,Ne),lt=bo(o,ut),Zt=o.getFormWrapper();Yn.setValue(Zt,lt),ar(m,(Dt,kn)=>{ps(ut,kn)&&Dt.set(ut[kn])})})},setEnabled:(Ne,st)=>{qt(o,Ne).each(st?Ko.enable:Ko.disable)},focus:Ne=>{qt(o,Ne).each(Qo.focus)},block:Ne=>{if(!h(Ne))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");b(st=>{Ao(st,r5,{message:Ne})})},unblock:()=>{b(Ne=>{nr(Ne,PT)})},showTab:Ne=>{b(st=>{const Ht=o.getBody();wm.getState(Ht).get().exists(lt=>lt.isTabPanel())&&sr.getCurrent(Ht).each(lt=>{qS.showTab(lt,Ne)})})},redial:Ne=>{b(st=>{const Ht=o.getId(),ut=c(Ne),lt=En(ut.internalDialog.buttons,m);st.getSystem().broadcastOn([`${e4}-${Ht}`],ut),st.getSystem().broadcastOn([`${m1}-${Ht}`],ut.internalDialog),st.getSystem().broadcastOn([`${t4}-${Ht}`],ut.internalDialog),st.getSystem().broadcastOn([`${P5}-${Ht}`],{...ut.internalDialog,buttons:lt}),Ce.setData(ut.initialData)})},close:()=>{b(Ne=>{nr(Ne,Ox)})},toggleFullscreen:o.toggleFullscreen};return Ce},yl=o=>{switch(o){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},Cm=(o,c,m)=>{const b=oo("dialog"),_=o.internalDialog,x=w_(_.title,b,m),M=E({body:_.body,initialData:_.initialData},b,m),I=En(_.buttons),U=Io(I),Y=cn(I.length!==0,zs({buttons:I},b,m)),se=xc(()=>st,Nt(()=>Ce,m.shared.providers,c),m.shared.getSink),fe=yl(_.size),Ce=Nn({id:b,header:x,body:M,footer:Y,extraClasses:fe,extraBehaviours:[],extraStyles:{}},o,se,m),Ne=(()=>{const Ht=()=>{const lt=Ml.getBody(Ce);return sr.getCurrent(lt).getOr(lt)},ut=()=>{const lt="tox-dialog--fullscreen",Zt=it.fromDom(Ce.element.dom);Qu(Zt,lt)?(ma(Zt,lt),tg(Zt,fe)):(Fc(Zt,fe),Ra(Zt,lt))};return{getId:J(b),getRoot:J(Ce),getBody:()=>Ml.getBody(Ce),getFooter:()=>Ml.getFooter(Ce),getFormWrapper:Ht,toggleFullscreen:ut}})(),st=ys(Ne,c.redial,U);return{dialog:Ce,instanceApi:st}},Vd=o=>{switch(o){case"medium":return V.some("tox-dialog--width-md");default:return V.none()}},Pf=(o,c,m,b=!1)=>{const _=oo("dialog"),x=oo("dialog-label"),M=oo("dialog-content"),I=o.internalDialog,U=Vd(I.size),Y=(Dt,kn)=>V.some(kn),se=Qr(D$({title:I.title,draggable:!0},_,x,m.shared.providers)),fe=Qr(w({body:I.body,initialData:I.initialData},_,M,m,b)),me=En(I.buttons),Ce=Io(me),Ne=cn(me.length!==0,Qr(Mee({buttons:me},_,m))),st=xc(()=>Zt,{onBlock:Dt=>{Dh.block(ut,(kn,mn)=>{const In=se.getOpt(ut).map(Zn=>Oi(Zn.element));return Rt(Dt.message,mn,m.shared.providers,In)})},onUnblock:()=>{Dh.unblock(ut)},onClose:()=>c.closeWindow()},m.shared.getSink),Ht="tox-dialog-inline",ut=uc({dom:{tag:"div",classes:["tox-dialog",Ht,...U.toArray()],attributes:{role:"dialog",["aria-labelledby"]:x}},eventOrder:{[Xh()]:[wm.name(),Cc.name()],[Yu()]:["execute-on-form"],[Au()]:["reflecting","execute-on-form"]},behaviours:An([Po.config({mode:"cyclic",onEscape:Dt=>(nr(Dt,Ox),V.some(!0)),useTabstopAt:Dt=>!Hx(Dt)&&(fl(Dt)!=="button"||Fi(Dt,"disabled")!=="disabled"),firstTabstop:1}),wm.config({channel:`${e4}-${_}`,updateState:Y,initialData:o}),Qo.config({}),ks("execute-on-form",st.concat([eg(Gi(),(Dt,kn)=>{Po.focusIn(Dt)}),en(_v(),(Dt,kn)=>{Dt.getSystem().broadcastOn([xS],{newFocus:kn.event.newFocus})})])),Dh.config({getRoot:()=>V.some(ut)}),ms.config({}),tv({})]),components:[se.asSpec(),fe.asSpec(),...Ne.map(Dt=>Dt.asSpec()).toArray()]}),lt=()=>{const Dt="tox-dialog--fullscreen",kn=it.fromDom(ut.element.dom);Pk(kn,[Dt])?(Fc(kn,[Dt]),tg(kn,[Ht])):(Fc(kn,[Ht]),tg(kn,[Dt]))},Zt=ys({getId:J(_),getRoot:J(ut),getFooter:()=>Ne.map(Dt=>Dt.get(ut)),getBody:()=>fe.get(ut),getFormWrapper:()=>{const Dt=fe.get(ut);return sr.getCurrent(Dt).getOr(Dt)},toggleFullscreen:lt},c.redial,Ce);return{dialog:ut,instanceApi:Zt}};var YS=tinymce.util.Tools.resolve("tinymce.util.URI");const ld=o=>{const c=M=>{o.getSystem().isConnected()&&M(o)};return{block:M=>{if(!h(M))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");c(I=>{Ao(I,r5,{message:M})})},unblock:()=>{c(M=>{nr(M,PT)})},close:()=>{c(M=>{nr(M,Ox)})},sendMessage:M=>{c(I=>{I.getSystem().broadcastOn([$x],M)})}}},O$=["insertContent","setContent","execCommand","close","block","unblock"],M$=o=>g(o)&&O$.indexOf(o.mceAction)!==-1,Ree=o=>!M$(o)&&g(o)&&ps(o,"mceAction"),Bre=(o,c,m)=>{switch(m.mceAction){case"insertContent":o.insertContent(m.content);break;case"setContent":o.setContent(m.content);break;case"execCommand":const b=O(m.ui)?m.ui:!1;o.execCommand(m.cmd,b,m.value);break;case"close":c.close();break;case"block":c.block(m.message);break;case"unblock":c.unblock();break}},d0e=(o,c,m,b)=>{const _=oo("dialog"),x=w_(o.title,_,b),M=R(o),I=o.buttons.bind(lt=>lt.length===0?V.none():V.some(zs({buttons:lt},_,b))),U=la(()=>ut,Nt(()=>Ht,b.shared.providers,c)),Y={...o.height.fold(()=>({}),lt=>({height:lt+"px","max-height":lt+"px"})),...o.width.fold(()=>({}),lt=>({width:lt+"px","max-width":lt+"px"}))},se=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],fe=new YS(o.url,{base_uri:new YS(window.location.href)}),me=`${fe.protocol}://${fe.host}${fe.port?":"+fe.port:""}`,Ce=r0(),Ne=[ks("messages",[vi(()=>{const lt=Sc(it.fromDom(window),"message",Zt=>{if(fe.isSameOrigin(new YS(Zt.raw.origin))){const Dt=Zt.raw.data;M$(Dt)?Bre(m,ut,Dt):Ree(Dt)&&o.onMessage(ut,Dt)}});Ce.set(lt)}),Dd(Ce.clear)]),Cc.config({channels:{[$x]:{onReceive:(lt,Zt)=>{ta(lt.element,"iframe").each(Dt=>{const kn=Dt.dom.contentWindow;j(kn)&&kn.postMessage(Zt,me)})}}}})],Ht=Nn({id:_,header:x,body:M,footer:I,extraClasses:se,extraBehaviours:Ne,extraStyles:Y},o,U,b),ut=ld(Ht);return{dialog:Ht,instanceApi:ut}},h0e=o=>{const c=o.shared;return{open:(b,_)=>{const x=()=>{Ml.hide(Y),_()},M=Qr(p4({name:"close-alert",text:"OK",primary:!0,buttonType:V.some("primary"),align:"end",enabled:!0,icon:V.none()},"cancel",o)),I=xA(),U=EA(x,c.providers),Y=uc(TA({lazySink:()=>c.getSink(),header:cv(I,U),body:A0(b,c.providers),footer:V.some(uv(AA([],[M.asSpec()]))),onEscape:x,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[en(Ey,x)],eventOrder:{}}));Ml.show(Y);const se=M.get(Y);Qo.focus(se)}}},m0e=o=>{const c=o.shared;return{open:(b,_)=>{const x=me=>{Ml.hide(se),_(me)},M=Qr(p4({name:"yes",text:"Yes",primary:!0,buttonType:V.some("primary"),align:"end",enabled:!0,icon:V.none()},"submit",o)),I=p4({name:"no",text:"No",primary:!1,buttonType:V.some("secondary"),align:"end",enabled:!0,icon:V.none()},"cancel",o),U=xA(),Y=EA(()=>x(!1),c.providers),se=uc(TA({lazySink:()=>c.getSink(),header:cv(U,Y),body:A0(b,c.providers),footer:V.some(uv(AA([],[I,M.asSpec()]))),onEscape:()=>x(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[en(Ey,()=>x(!1)),en(CS,()=>x(!0))],eventOrder:{}}));Ml.show(se);const fe=M.get(se);Qo.focus(fe)}}},Lre=(o,c)=>ha(zi("data",c,o)),Fre=o=>_S(o,".tox-alert-dialog")||_S(o,".tox-confirm-dialog"),g0e=(o,c,m)=>c&&m?[]:[vl.config({contextual:{lazyContext:()=>V.some(li(it.fromDom(o.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:b=>Kw(o,b.element).map(x=>({bounds:wS(x),optScrollEnv:V.some({currentScrollTop:x.element.dom.scrollTop,scrollElmTop:vc(x.element).top})})).getOrThunk(()=>({bounds:le(),optScrollEnv:V.none()}))})],p0e=o=>{const c=o.editor,m=hx(c),b=h0e(o.backstages.dialog),_=m0e(o.backstages.dialog),x=(Ne,st,Ht)=>{if(!N(st)){if(st.inline==="toolbar")return Y(Ne,o.backstages.popup.shared.anchors.inlineDialog(),Ht,st);if(st.inline==="bottom")return se(Ne,o.backstages.popup.shared.anchors.inlineBottomDialog(),Ht,st);if(st.inline==="cursor")return Y(Ne,o.backstages.popup.shared.anchors.cursor(),Ht,st)}return U(Ne,Ht)},M=(Ne,st)=>I(Ne,st),I=(Ne,st)=>{const Ht=ut=>{const lt=d0e(ut,{closeWindow:()=>{Ml.hide(lt.dialog),st(lt.instanceApi)}},c,o.backstages.dialog);return Ml.show(lt.dialog),lt.instanceApi};return x0.openUrl(Ht,Ne)},U=(Ne,st)=>{const Ht=(ut,lt,Zt)=>{const Dt=lt,mn=Cm({dataValidator:Zt,initialData:Dt,internalDialog:ut},{redial:x0.redial,closeWindow:()=>{Ml.hide(mn.dialog),st(mn.instanceApi)}},o.backstages.dialog);return Ml.show(mn.dialog),mn.instanceApi.setData(Dt),mn.instanceApi};return x0.open(Ht,Ne)},Y=(Ne,st,Ht,ut)=>{const lt=(Zt,Dt,kn)=>{const mn=Lre(Dt,kn),In=Ui(),Zn=o.backstages.popup.shared.header.isPositionedAtTop(),js={dataValidator:kn,initialData:mn,internalDialog:Zt},yo=()=>In.on(Fo=>{Pa.reposition(Fo),vl.refresh(Fo)}),ws=Pf(js,{redial:x0.redial,closeWindow:()=>{In.on(Pa.hide),c.off("ResizeEditor",yo),In.clear(),Ht(ws.instanceApi)}},o.backstages.popup,ut.ariaAttrs),fs=uc(Pa.sketch({lazySink:o.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:ut.persistent?{event:"doNotDismissYet"}:{},...Zn?{}:{fireRepositionEventInstead:{}},inlineBehaviours:An([ks("window-manager-inline-events",[en(Xm(),(Fo,ir)=>{nr(ws.dialog,Ey)})]),...g0e(c,m,Zn)]),isExtraPart:(Fo,ir)=>Fre(ir)}));In.set(fs);const hr=()=>{const Fo=c.inline?Li():it.fromDom(c.getContainer()),ir=li(Fo);return V.some(ir)};return Pa.showWithinBounds(fs,ru(ws.dialog),{anchor:st},hr),(!m||!Zn)&&(vl.refresh(fs),c.on("ResizeEditor",yo)),ws.instanceApi.setData(mn),Po.focusIn(ws.dialog),ws.instanceApi};return x0.open(lt,Ne)},se=(Ne,st,Ht,ut)=>{const lt=(Zt,Dt,kn)=>{const mn=Lre(Dt,kn),In=Ui(),Zn=o.backstages.popup.shared.header.isPositionedAtTop(),js={dataValidator:kn,initialData:mn,internalDialog:Zt},yo=()=>In.on(Fo=>{Pa.reposition(Fo),vl.refresh(Fo)}),ws=Pf(js,{redial:x0.redial,closeWindow:()=>{In.on(Pa.hide),c.off("ResizeEditor ScrollWindow ElementScroll",yo),In.clear(),Ht(ws.instanceApi)}},o.backstages.popup,ut.ariaAttrs),fs=uc(Pa.sketch({lazySink:o.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:ut.persistent?{event:"doNotDismissYet"}:{},...Zn?{}:{fireRepositionEventInstead:{}},inlineBehaviours:An([ks("window-manager-inline-events",[en(Xm(),(Fo,ir)=>{nr(ws.dialog,Ey)})]),vl.config({contextual:{lazyContext:()=>V.some(li(it.fromDom(c.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:Fo=>Kw(c,Fo.element).map(Fn=>({bounds:wS(Fn),optScrollEnv:V.some({currentScrollTop:Fn.element.dom.scrollTop,scrollElmTop:vc(Fn.element).top})})).getOrThunk(()=>({bounds:le(),optScrollEnv:V.none()}))})]),isExtraPart:(Fo,ir)=>Fre(ir)}));In.set(fs);const hr=()=>o.backstages.popup.shared.getSink().toOptional().bind(Fo=>{const ir=Kw(c,Fo.element),Fn=15,po=ir.map(zo=>wS(zo)).getOr(le()),ls=li(it.fromDom(c.getContentAreaContainer())),Xs=Lp(ls,po);return V.some(si(Xs.x,Xs.y,Xs.width,Xs.height-Fn))});return Pa.showWithinBounds(fs,ru(ws.dialog),{anchor:st},hr),vl.refresh(fs),c.on("ResizeEditor ScrollWindow ElementScroll",yo),ws.instanceApi.setData(mn),Po.focusIn(ws.dialog),ws.instanceApi};return x0.open(lt,Ne)};return{open:x,openUrl:M,alert:(Ne,st)=>{b.open(Ne,st)},close:Ne=>{Ne.close()},confirm:(Ne,st)=>{_.open(Ne,st)}}},b0e=o=>{MM(o),Rj(o),y6(o)};var v0e=()=>{Se.add("silver",o=>{b0e(o);let c=()=>le();const{dialogs:m,popups:b,renderUI:_}=dQ(o,{getPopupSinkBounds:()=>c()}),x=async()=>{const U=await _();return Kw(o,b.getMothership().element).each(se=>{c=()=>wS(se)}),U};cZ.register(o,b.backstage.shared);const M=p0e({editor:o,backstages:{popup:b.backstage,dialog:m.backstage}}),I=()=>bB(o,{backstage:b.backstage},b.getMothership());return{renderUI:x,getWindowManagerImpl:J(M),getNotificationManagerImpl:I}})};v0e()})();const cCe=`.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center}.mce-content-body .mce-item-anchor:empty{cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor:not(:empty){background-position-x:2px;display:inline-block;padding-left:12px}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment[contenteditable=false]:not([data-mce-selected]),.tox-comments-visible span.tox-comment img:not([data-mce-selected]),.tox-comments-visible span.tox-comment>audio:not([data-mce-selected]),.tox-comments-visible span.tox-comment>video:not([data-mce-selected]),.tox-comments-visible span.tox-comment span.mce-preview-object:not([data-mce-selected]){outline:3px solid #ffe89d}.tox-comments-visible .tox-comment[contenteditable=false][data-mce-annotation-active=true]:not([data-mce-selected]){outline:3px solid #fed635}.tox-comments-visible span.tox-comment[data-mce-annotation-active=true] img:not([data-mce-selected]),.tox-comments-visible span.tox-comment[data-mce-annotation-active=true]>audio:not([data-mce-selected]),.tox-comments-visible span.tox-comment[data-mce-annotation-active=true]>video:not([data-mce-selected]),.tox-comments-visible span.tox-comment[data-mce-annotation-active=true] span.mce-preview-object:not([data-mce-selected]){outline:3px solid #fed635}.tox-comments-visible span.tox-comment:not([data-mce-selected]){background-color:#ffe89d;outline:none}.tox-comments-visible span.tox-comment[data-mce-annotation-active=true]:not([data-mce-selected="inline-boundary"]){background-color:#fed635}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden):before{content:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A);cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked:before{content:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A)}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden):before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:none;text-shadow:0 1px white;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,code[class*=language-] ::-moz-selection{text-shadow:none;background:#b3d4fc}pre[class*=language-]::selection,pre[class*=language-] ::selection,code[class*=language-]::selection,code[class*=language-] ::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function,.token.class-name{color:#dd4a68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body *[data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body *[contentEditable=false]{cursor:default}.mce-content-body *[contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A),default}div.mce-footnotes hr{margin-inline-end:auto;margin-inline-start:0;width:25%}div.mce-footnotes li>a.mce-footnotes-backlink{text-decoration:none}@media print{sup.mce-footnote a{color:#000;text-decoration:none}div.mce-footnotes{break-inside:avoid;width:100%}div.mce-footnotes li>a.mce-footnotes-backlink{display:none}}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-content-body .mce-mergetag{cursor:default!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mce-content-body .mce-mergetag:hover{background-color:#006ce71a}.mce-content-body .mce-mergetag-affix{background-color:#006ce71a;color:#006ce7}.mce-object{background:transparent url(data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A) no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--21by9,.tiny-pageembed--16by9,.tiny-pageembed--4by3,.tiny-pageembed--1by1{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--21by9 iframe,.tiny-pageembed--16by9 iframe,.tiny-pageembed--4by3 iframe,.tiny-pageembed--1by1 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks):before{color:#222f3eb3;content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks):before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks):before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:1298}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-resize-backdrop{z-index:10000}.mce-content-body .mce-clonedresizable{cursor:default;opacity:.5;outline:1px dashed black;position:absolute;z-index:10001}.mce-content-body .mce-clonedresizable.mce-resizetable-columns th,.mce-content-body .mce-clonedresizable.mce-resizetable-columns td{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10002}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor:before{background-color:inherit;border-radius:50%;content:"";display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover:after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::-moz-selection{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body img[data-mce-selected],.mce-content-body video[data-mce-selected],.mce-content-body audio[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body details[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body *[contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,.mce-content-body.mce-content-readonly *[contentEditable=true]:hover{outline:none}.mce-content-body *[data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:none}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:none}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]:after,.mce-content-body th[data-mce-selected]:after{background-color:#b4d7ffb3;border:1px solid rgba(180,215,255,.7);bottom:-1px;content:"";left:-1px;mix-blend-mode:multiply;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){.mce-content-body td[data-mce-selected]:after,.mce-content-body th[data-mce-selected]:after{border-color:#0054b4b3}}.mce-content-body img[data-mce-selected]::-moz-selection{background:none}.mce-content-body img[data-mce-selected]::selection{background:none}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc ul>li{list-style-type:none}[data-mce-block]{display:block}table[style*="border-width: 0px"],.mce-item-table:not([border]),.mce-item-table[border="0"],table[style*="border-width: 0px"] td,.mce-item-table:not([border]) td,.mce-item-table[border="0"] td,table[style*="border-width: 0px"] th,.mce-item-table:not([border]) th,.mce-item-table[border="0"] th,table[style*="border-width: 0px"] caption,.mce-item-table:not([border]) caption,.mce-item-table[border="0"] caption{border:1px dashed #bbb}.mce-visualblocks p,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks section,.mce-visualblocks article,.mce-visualblocks blockquote,.mce-visualblocks address,.mce-visualblocks pre,.mce-visualblocks figure,.mce-visualblocks figcaption,.mce-visualblocks hgroup,.mce-visualblocks aside,.mce-visualblocks ul,.mce-visualblocks ol,.mce-visualblocks dl{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) ul,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) dl{margin-left:3px}.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] ul,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] dl{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy:after{content:"-"}body{font-family:sans-serif}table{border-collapse:collapse}
`;(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(Ae,et,gt)=>{var Pt;return gt(Ae,et.prototype)?!0:((Pt=Ae.constructor)===null||Pt===void 0?void 0:Pt.name)===et.name},t=Ae=>{const et=typeof Ae;return Ae===null?"null":et==="object"&&Array.isArray(Ae)?"array":et==="object"&&e(Ae,String,(gt,Pt)=>Pt.isPrototypeOf(gt))?"string":et},r=Ae=>et=>t(et)===Ae,a=Ae=>et=>typeof et===Ae,u=Ae=>et=>Ae===et,f=r("string"),h=r("object"),g=r("array"),y=u(null),C=a("boolean"),A=Ae=>Ae==null,O=Ae=>!A(Ae),N=a("function"),L=(Ae,et)=>{if(g(Ae)){for(let gt=0,Pt=Ae.length;gt<Pt;++gt)if(!et(Ae[gt]))return!1;return!0}return!1},j=()=>{},z=Ae=>()=>Ae,q=(Ae,et)=>Ae===et;class ee{constructor(et,gt){this.tag=et,this.value=gt}static some(et){return new ee(!0,et)}static none(){return ee.singletonNone}fold(et,gt){return this.tag?gt(this.value):et()}isSome(){return this.tag}isNone(){return!this.tag}map(et){return this.tag?ee.some(et(this.value)):ee.none()}bind(et){return this.tag?et(this.value):ee.none()}exists(et){return this.tag&&et(this.value)}forall(et){return!this.tag||et(this.value)}filter(et){return!this.tag||et(this.value)?this:ee.none()}getOr(et){return this.tag?this.value:et}or(et){return this.tag?this:et}getOrThunk(et){return this.tag?this.value:et()}orThunk(et){return this.tag?this:et()}getOrDie(et){if(this.tag)return this.value;throw new Error(et!=null?et:"Called getOrDie on None")}static from(et){return O(et)?ee.some(et):ee.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(et){this.tag&&et(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}ee.singletonNone=new ee(!1);const F=Array.prototype.indexOf,ne=Array.prototype.push,oe=(Ae,et)=>F.call(Ae,et),re=(Ae,et)=>oe(Ae,et)>-1,J=(Ae,et)=>{const gt=Ae.length,Pt=new Array(gt);for(let vn=0;vn<gt;vn++){const Ro=Ae[vn];Pt[vn]=et(Ro,vn)}return Pt},we=(Ae,et)=>{for(let gt=0,Pt=Ae.length;gt<Pt;gt++){const vn=Ae[gt];et(vn,gt)}},ye=(Ae,et,gt)=>(we(Ae,(Pt,vn)=>{gt=et(gt,Pt,vn)}),gt),De=Ae=>{const et=[];for(let gt=0,Pt=Ae.length;gt<Pt;++gt){if(!g(Ae[gt]))throw new Error("Arr.flatten item "+gt+" was not an array, input: "+Ae);ne.apply(et,Ae[gt])}return et},_e=(Ae,et)=>De(J(Ae,et)),be=(Ae,et)=>{for(let gt=0;gt<Ae.length;gt++){const Pt=et(Ae[gt],gt);if(Pt.isSome())return Pt}return ee.none()},tt=(Ae,et,gt=q)=>Ae.exists(Pt=>gt(Pt,et)),Qe=Ae=>{const et=[],gt=Pt=>{et.push(Pt)};for(let Pt=0;Pt<Ae.length;Pt++)Ae[Pt].each(gt);return et},ft=(Ae,et)=>Ae?ee.some(et):ee.none(),V=Ae=>et=>et.options.get(Ae),mt=Ae=>{const et=Ae.options.register;et("link_assume_external_targets",{processor:gt=>{const Pt=f(gt)||C(gt);return Pt?gt===!0?{value:1,valid:Pt}:gt==="http"||gt==="https"?{value:gt,valid:Pt}:{value:0,valid:Pt}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),et("link_context_toolbar",{processor:"boolean",default:!1}),et("link_list",{processor:gt=>f(gt)||N(gt)||L(gt,h)}),et("link_default_target",{processor:"string"}),et("link_default_protocol",{processor:"string",default:"https"}),et("link_target_list",{processor:gt=>C(gt)||L(gt,h),default:!0}),et("link_rel_list",{processor:"object[]",default:[]}),et("link_class_list",{processor:"object[]",default:[]}),et("link_title",{processor:"boolean",default:!0}),et("allow_unsafe_link_target",{processor:"boolean",default:!1}),et("link_quicklink",{processor:"boolean",default:!1})},nt=V("link_assume_external_targets"),Ot=V("link_context_toolbar"),Tt=V("link_list"),He=V("link_default_target"),ct=V("link_default_protocol"),dn=V("link_target_list"),kt=V("link_rel_list"),xn=V("link_class_list"),We=V("link_title"),xt=V("allow_unsafe_link_target"),he=V("link_quicklink");var es=tinymce.util.Tools.resolve("tinymce.util.Tools");const ho=Ae=>f(Ae.value)?Ae.value:"",ao=Ae=>f(Ae.text)?Ae.text:f(Ae.title)?Ae.title:"",xo=(Ae,et)=>{const gt=[];return es.each(Ae,Pt=>{const vn=ao(Pt);if(Pt.menu!==void 0){const Ro=xo(Pt.menu,et);gt.push({text:vn,items:Ro})}else{const Ro=et(Pt);gt.push({text:vn,value:Ro})}}),gt},Yo=(Ae=ho)=>et=>ee.from(et).map(gt=>xo(gt,Ae)),Et={sanitize:Ae=>Yo(ho)(Ae),sanitizeWith:Yo,createUi:(Ae,et)=>gt=>({name:Ae,type:"listbox",label:et,items:gt}),getValue:ho},Pe=Object.keys,Ut=Object.hasOwnProperty,gn=(Ae,et)=>{const gt=Pe(Ae);for(let Pt=0,vn=gt.length;Pt<vn;Pt++){const Ro=gt[Pt],Rr=Ae[Ro];et(Rr,Ro)}},yt=Ae=>(et,gt)=>{Ae[gt]=et},Yt=(Ae,et,gt,Pt)=>{gn(Ae,(vn,Ro)=>{(et(vn,Ro)?gt:Pt)(vn,Ro)})},bn=(Ae,et)=>{const gt={};return Yt(Ae,et,yt(gt),j),gt},rs=(Ae,et)=>Ut.call(Ae,et),Jn=(Ae,et)=>rs(Ae,et)&&Ae[et]!==void 0&&Ae[et]!==null;var ds=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Or=tinymce.util.Tools.resolve("tinymce.util.URI");const Ns=Ae=>O(Ae)&&Ae.nodeName.toLowerCase()==="a",Js=Ae=>Ns(Ae)&&!!ar(Ae),Zs=(Ae,et)=>{if(Ae.collapsed)return[];{const gt=Ae.cloneContents(),Pt=gt.firstChild,vn=new ds(Pt,gt),Ro=[];let Rr=Pt;do et(Rr)&&Ro.push(Rr);while(Rr=vn.next());return Ro}},ba=Ae=>/^\w+:/i.test(Ae),ar=Ae=>{var et,gt;return(gt=(et=Ae.getAttribute("data-mce-href"))!==null&&et!==void 0?et:Ae.getAttribute("href"))!==null&&gt!==void 0?gt:""},Ps=(Ae,et)=>{const gt=["noopener"],Pt=Ae?Ae.split(/\s+/):[],vn=is=>es.trim(is.sort().join(" ")),Ro=is=>(is=Rr(is),is.length>0?is.concat(gt):gt),Rr=is=>is.filter(ki=>es.inArray(gt,ki)===-1),vs=et?Ro(Pt):Rr(Pt);return vs.length>0?vn(vs):""},Zr=Ae=>Ae.replace(/\uFEFF/g,""),No=(Ae,et)=>(et=et||Ls(Ae.selection.getRng())[0]||Ae.selection.getNode(),ps(et)?ee.from(Ae.dom.select("a[href]",et)[0]):ee.from(Ae.dom.getParent(et,"a[href]"))),Mo=(Ae,et)=>No(Ae,et).isSome(),Mr=(Ae,et)=>{const gt=et.fold(()=>Ae.getContent({format:"text"}),Pt=>Pt.innerText||Pt.textContent||"");return Zr(gt)},Ls=Ae=>Zs(Ae,Js),na=Ae=>es.grep(Ae,Js),gs=Ae=>na(Ae).length>0,va=Ae=>Ls(Ae).length>0,an=Ae=>{const et=Ae.schema.getTextInlineElements(),gt=Ro=>Ro.nodeType===1&&!Ns(Ro)&&!rs(et,Ro.nodeName.toLowerCase());if(No(Ae).exists(Ro=>Ro.hasAttribute("data-mce-block")))return!1;const vn=Ae.selection.getRng();return vn.collapsed?!0:Zs(vn,gt).length===0},ps=Ae=>O(Ae)&&Ae.nodeName==="FIGURE"&&/\bimage\b/i.test(Ae.className),Ii=Ae=>ye(["title","rel","class","target"],(gt,Pt)=>(Ae[Pt].each(vn=>{gt[Pt]=vn.length>0?vn:null}),gt),{href:Ae.href}),$e=(Ae,et)=>(et==="http"||et==="https")&&!ba(Ae)?et+"://"+Ae:Ae,Je=(Ae,et)=>{const gt={...et};if(kt(Ae).length===0&&!xt(Ae)){const Pt=Ps(gt.rel,gt.target==="_blank");gt.rel=Pt||null}return ee.from(gt.target).isNone()&&dn(Ae)===!1&&(gt.target=He(Ae)),gt.href=$e(gt.href,nt(Ae)),gt},At=(Ae,et,gt,Pt)=>{gt.each(vn=>{rs(et,"innerText")?et.innerText=vn:et.textContent=vn}),Ae.dom.setAttribs(et,Pt),Ae.selection.select(et)},Wt=(Ae,et,gt,Pt)=>{const vn=Ae.dom;ps(et)?Ir(vn,et,Pt):gt.fold(()=>{Ae.execCommand("mceInsertLink",!1,Pt)},Ro=>{Ae.insertContent(vn.createHTML("a",Pt,vn.encode(Ro)))})},Wn=(Ae,et,gt)=>{const Pt=Ae.selection.getNode(),vn=No(Ae,Pt),Ro=Je(Ae,Ii(gt));Ae.undoManager.transact(()=>{gt.href===et.href&&et.attach(),vn.fold(()=>{Wt(Ae,Pt,gt.text,Ro)},Rr=>{Ae.focus(),At(Ae,Rr,gt.text,Ro)})})},lo=Ae=>{const et=Ae.dom,gt=Ae.selection,Pt=gt.getBookmark(),vn=gt.getRng().cloneRange(),Ro=et.getParent(vn.startContainer,"a[href]",Ae.getBody()),Rr=et.getParent(vn.endContainer,"a[href]",Ae.getBody());Ro&&vn.setStartBefore(Ro),Rr&&vn.setEndAfter(Rr),gt.setRng(vn),Ae.execCommand("unlink"),gt.moveToBookmark(Pt)},go=Ae=>{Ae.undoManager.transact(()=>{const et=Ae.selection.getNode();ps(et)?_r(Ae,et):lo(Ae),Ae.focus()})},cn=Ae=>{const{class:et,href:gt,rel:Pt,target:vn,text:Ro,title:Rr}=Ae;return bn({class:et.getOrNull(),href:gt,rel:Pt.getOrNull(),target:vn.getOrNull(),text:Ro.getOrNull(),title:Rr.getOrNull()},(vs,is)=>y(vs)===!1)},ts=(Ae,et)=>{const gt=Ae.options.get,Pt={allow_html_data_urls:gt("allow_html_data_urls"),allow_script_urls:gt("allow_script_urls"),allow_svg_data_urls:gt("allow_svg_data_urls")},vn=et.href;return{...et,href:Or.isDomSafe(vn,"a",Pt)?vn:""}},wo=(Ae,et,gt)=>{const Pt=ts(Ae,gt);Ae.hasPlugin("rtc",!0)?Ae.execCommand("createlink",!1,cn(Pt)):Wn(Ae,et,Pt)},cs=Ae=>{Ae.hasPlugin("rtc",!0)?Ae.execCommand("unlink"):go(Ae)},_r=(Ae,et)=>{var gt;const Pt=Ae.dom.select("img",et)[0];if(Pt){const vn=Ae.dom.getParents(Pt,"a[href]",et)[0];vn&&((gt=vn.parentNode)===null||gt===void 0||gt.insertBefore(Pt,vn),Ae.dom.remove(vn))}},Ir=(Ae,et,gt)=>{var Pt;const vn=Ae.select("img",et)[0];if(vn){const Ro=Ae.create("a",gt);(Pt=vn.parentNode)===null||Pt===void 0||Pt.insertBefore(Ro,vn),Ro.appendChild(vn)}},Vs=Ae=>Jn(Ae,"items"),Ur=(Ae,et)=>be(et,gt=>Vs(gt)?Ur(Ae,gt.items):ft(gt.value===Ae,gt)),Bi=(Ae,et,gt,Pt)=>{const vn=Pt[et],Ro=Ae.length>0;return vn!==void 0?Ur(vn,gt).map(Rr=>({url:{value:Rr.value,meta:{text:Ro?Ae:Rr.text,attach:j}},text:Ro?Ae:Rr.text})):ee.none()},Ba=(Ae,et)=>et==="link"?Ae.link:et==="anchor"?Ae.anchor:ee.none(),Ge={init:(Ae,et)=>{const gt={text:Ae.text,title:Ae.title},Pt=is=>{var ki;return ft(gt.title.length<=0,ee.from((ki=is.meta)===null||ki===void 0?void 0:ki.title).getOr(""))},vn=is=>{var ki;return ft(gt.text.length<=0,ee.from((ki=is.meta)===null||ki===void 0?void 0:ki.text).getOr(is.value))},Ro=is=>{const ki=vn(is.url),qs=Pt(is.url);return ki.isSome()||qs.isSome()?ee.some({...ki.map(Li=>({text:Li})).getOr({}),...qs.map(Li=>({title:Li})).getOr({})}):ee.none()},Rr=(is,ki)=>{const qs=Ba(et,ki).getOr([]);return Bi(gt.text,ki,qs,is)};return{onChange:(is,ki)=>{const qs=ki.name;return qs==="url"?Ro(is()):re(["anchor","link"],qs)?Rr(is(),qs):((qs==="text"||qs==="title")&&(gt[qs]=is()[qs]),ee.none())}}},getDelta:Bi};var qe=tinymce.util.Tools.resolve("tinymce.util.Delay");const It=(Ae,et,gt)=>{const Pt=Ae.selection.getRng();qe.setEditorTimeout(Ae,()=>{Ae.windowManager.confirm(et,vn=>{Ae.selection.setRng(Pt),gt(vn)})})},jt=Ae=>{const et=Ae.href;return et.indexOf("@")>0&&et.indexOf("/")===-1&&et.indexOf("mailto:")===-1?ee.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:Pt=>({...Pt,href:"mailto:"+et})}):ee.none()},co=(Ae,et)=>gt=>{const Pt=gt.href;return Ae===1&&!ba(Pt)||Ae===0&&/^\s*www(\.|\d\.)/i.test(Pt)?ee.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${et}:// prefix?`,preprocess:Ro=>({...Ro,href:et+"://"+Pt})}):ee.none()},qo={preprocess:(Ae,et)=>be([jt,co(nt(Ae),ct(Ae))],gt=>gt(et)).fold(()=>Promise.resolve(et),gt=>new Promise(Pt=>{It(Ae,gt.message,vn=>{Pt(vn?gt.preprocess(et):et)})}))},it={getAnchors:Ae=>{const et=Ae.dom.select("a:not([href])"),gt=_e(et,Pt=>{const vn=Pt.name||Pt.id;return vn?[{text:vn,value:"#"+vn}]:[]});return gt.length>0?ee.some([{text:"None",value:""}].concat(gt)):ee.none()}},Di={getClasses:Ae=>{const et=xn(Ae);return et.length>0?Et.sanitize(et):ee.none()}},oa=Ae=>{try{return ee.some(JSON.parse(Ae))}catch{return ee.none()}},ur={getLinks:Ae=>{const et=Pt=>Ae.convertURL(Pt.value||Pt.url||"","href"),gt=Tt(Ae);return new Promise(Pt=>{f(gt)?fetch(gt).then(vn=>vn.ok?vn.text().then(oa):Promise.reject()).then(Pt,()=>Pt(ee.none())):N(gt)?gt(vn=>Pt(ee.some(vn))):Pt(ee.from(gt))}).then(Pt=>Pt.bind(Et.sanitizeWith(et)).map(vn=>vn.length>0?[{text:"None",value:""}].concat(vn):vn))}},gc={getRels:(Ae,et)=>{const gt=kt(Ae);if(gt.length>0){const Pt=tt(et,"_blank"),vn=xt(Ae)===!1,Ro=vs=>Ps(Et.getValue(vs),Pt);return(vn?Et.sanitizeWith(Ro):Et.sanitize)(gt)}return ee.none()}},Xa=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Qs={getTargets:Ae=>{const et=dn(Ae);return g(et)?Et.sanitize(et).orThunk(()=>ee.some(Xa)):et===!1?ee.none():ee.some(Xa)}},xr=(Ae,et,gt)=>{const Pt=Ae.getAttrib(et,gt);return Pt!==null&&Pt.length>0?ee.some(Pt):ee.none()},Ki=(Ae,et)=>{const gt=Ae.dom,vn=an(Ae)?ee.some(Mr(Ae.selection,et)):ee.none(),Ro=et.bind(qs=>ee.from(gt.getAttrib(qs,"href"))),Rr=et.bind(qs=>ee.from(gt.getAttrib(qs,"target"))),vs=et.bind(qs=>xr(gt,qs,"rel")),is=et.bind(qs=>xr(gt,qs,"class")),ki=et.bind(qs=>xr(gt,qs,"title"));return{url:Ro,text:vn,title:ki,target:Rr,rel:vs,linkClass:is}},pc={collect:(Ae,et)=>ur.getLinks(Ae).then(gt=>{const Pt=Ki(Ae,et);return{anchor:Pt,catalogs:{targets:Qs.getTargets(Ae),rels:gc.getRels(Ae,Pt.target),classes:Di.getClasses(Ae),anchor:it.getAnchors(Ae),link:gt},optNode:et,flags:{titleEnabled:We(Ae)}}})},Zc=(Ae,et)=>gt=>{const Pt=gt.getData();if(!Pt.url.value){cs(Ae),gt.close();return}const vn=vs=>ee.from(Pt[vs]).filter(is=>!tt(et.anchor[vs],is)),Ro={href:Pt.url.value,text:vn("text"),target:vn("target"),rel:vn("rel"),class:vn("linkClass"),title:vn("title")},Rr={href:Pt.url.value,attach:Pt.url.meta!==void 0&&Pt.url.meta.attach?Pt.url.meta.attach:j};qo.preprocess(Ae,Ro).then(vs=>{wo(Ae,Rr,vs)}),gt.close()},gu=Ae=>{const et=No(Ae);return pc.collect(Ae,et)},gr=(Ae,et)=>{const gt=Ae.anchor,Pt=gt.url.getOr("");return{url:{value:Pt,meta:{original:{value:Pt}}},text:gt.text.getOr(""),title:gt.title.getOr(""),anchor:Pt,link:Pt,rel:gt.rel.getOr(""),target:gt.target.or(et).getOr(""),linkClass:gt.linkClass.getOr("")}},Ja=(Ae,et,gt)=>{const Pt=[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],vn=Ae.anchor.text.map(()=>({name:"text",type:"input",label:"Text to display"})).toArray(),Ro=Ae.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],Rr=ee.from(He(gt)),vs=gr(Ae,Rr),is=Ae.catalogs,ki=Ge.init(vs,is);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:De([Pt,vn,Ro,Qe([is.anchor.map(Et.createUi("anchor","Anchors")),is.rels.map(Et.createUi("rel","Rel")),is.targets.map(Et.createUi("target","Open link in...")),is.link.map(Et.createUi("link","Link list")),is.classes.map(Et.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:vs,onChange:(Li,{name:yu})=>{ki.onChange(Li.getData,{name:yu}).each(bd=>{Li.setData(bd)})},onSubmit:et}},pu=Ae=>{gu(Ae).then(gt=>{const Pt=Zc(Ae,gt);return Ja(gt,Pt,Ae)}).then(gt=>{Ae.windowManager.open(gt)})},qc=Ae=>{Ae.addCommand("mceLink",(et,gt)=>{(gt==null?void 0:gt.dialog)===!0||!he(Ae)?pu(Ae):Ae.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"})})};var Vl=tinymce.util.Tools.resolve("tinymce.util.VK");const xa=(Ae,et)=>{document.body.appendChild(Ae),Ae.dispatchEvent(et),document.body.removeChild(Ae)},Ar=Ae=>{const et=document.createElement("a");et.target="_blank",et.href=Ae,et.rel="noreferrer noopener";const gt=document.createEvent("MouseEvents");gt.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),xa(et,gt)},Rm=(Ae,et)=>Ae.dom.getParent(et,"a[href]"),pf=Ae=>Rm(Ae,Ae.selection.getStart()),Cr=Ae=>Ae.altKey===!0&&Ae.shiftKey===!1&&Ae.ctrlKey===!1&&Ae.metaKey===!1,La=(Ae,et)=>{if(et){const gt=ar(et);if(/^#/.test(gt)){const Pt=Ae.dom.select(gt);Pt.length&&Ae.selection.scrollIntoView(Pt[0],!0)}else Ar(et.href)}},sa=Ae=>()=>{Ae.execCommand("mceLink",!1,{dialog:!0})},Yi=Ae=>()=>{La(Ae,pf(Ae))},bu=Ae=>{Ae.on("click",et=>{const gt=Rm(Ae,et.target);gt&&Vl.metaKeyPressed(et)&&(et.preventDefault(),La(Ae,gt))}),Ae.on("keydown",et=>{if(!et.isDefaultPrevented()&&et.keyCode===13&&Cr(et)){const gt=pf(Ae);gt&&(et.preventDefault(),La(Ae,gt))}})},Oc=(Ae,et)=>(Ae.on("NodeChange",et),()=>Ae.off("NodeChange",et)),Fa=Ae=>et=>{const gt=()=>{et.setActive(!Ae.mode.isReadOnly()&&Mo(Ae,Ae.selection.getNode())),et.setEnabled(Ae.selection.isEditable())};return gt(),Oc(Ae,gt)},Mc=Ae=>et=>{const gt=()=>{et.setEnabled(Ae.selection.isEditable())};return gt(),Oc(Ae,gt)},bc=Ae=>(Ae.selection.isCollapsed()?na(Ae.dom.getParents(Ae.selection.getStart())):Ls(Ae.selection.getRng())).length===1,gd=Ae=>et=>{const gt=()=>et.setEnabled(bc(Ae));return gt(),Oc(Ae,gt)},Lf=Ae=>et=>{const gt=Ro=>gs(Ro)||va(Ae.selection.getRng()),Pt=Ae.dom.getParents(Ae.selection.getStart()),vn=Ro=>{et.setEnabled(gt(Ro)&&Ae.selection.isEditable())};return vn(Pt),Oc(Ae,Ro=>vn(Ro.parents))},vu=Ae=>{Ae.addShortcut("Meta+K","",()=>{Ae.execCommand("mceLink")})},Ul=Ae=>{Ae.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:sa(Ae),onSetup:Fa(Ae)}),Ae.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Yi(Ae),onSetup:gd(Ae)}),Ae.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>cs(Ae),onSetup:Lf(Ae)})},Rc=Ae=>{Ae.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Yi(Ae),onSetup:gd(Ae)}),Ae.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:Mc(Ae),onAction:sa(Ae)}),Ae.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>cs(Ae),onSetup:Lf(Ae)})},bf=Ae=>{const et="link unlink openlink",gt="link";Ae.ui.registry.addContextMenu("link",{update:Pt=>Ae.dom.isEditable(Pt)?gs(Ae.dom.getParents(Pt,"a"))?et:gt:""})},Gc=Ae=>{const et=vn=>{vn.selection.collapse(!1)},gt=vn=>{const Ro=Ae.selection.getNode();return vn.setEnabled(Mo(Ae,Ro)),j},Pt=vn=>{const Ro=No(Ae),Rr=an(Ae);if(Ro.isNone()&&Rr){const vs=Mr(Ae.selection,Ro);return ft(vs.length===0,vn)}else return ee.none()};Ae.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Fa(Ae)},label:"Link",predicate:vn=>Ot(Ae)&&Mo(Ae,vn),initValue:()=>No(Ae).fold(z(""),ar),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:vn=>{const Ro=Ae.selection.getNode();return vn.setActive(Mo(Ae,Ro)),Fa(Ae)(vn)},onAction:vn=>{const Ro=vn.getValue(),Rr=Pt(Ro);wo(Ae,{href:Ro,attach:j},{href:Ro,text:Rr,title:ee.none(),rel:ee.none(),target:ee.none(),class:ee.none()}),et(Ae),vn.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:gt,onAction:vn=>{cs(Ae),vn.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:gt,onAction:vn=>{Yi(Ae)(),vn.hide()}}]})};var pd=()=>{s.add("link",Ae=>{mt(Ae),Ul(Ae),Rc(Ae),bf(Ae),Gc(Ae),bu(Ae),qc(Ae),vu(Ae)})};pd()})();(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(h,g)=>{h.focus(),h.undoManager.transact(()=>{h.setContent(g)}),h.selection.setCursorLocation(),h.nodeChanged()},t=h=>h.getContent({source_view:!0}),r=h=>{const g=t(h);h.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:g},onSubmit:y=>{e(h,y.getData().code),y.close()}})},a=h=>{h.addCommand("mceCodeEditor",()=>{r(h)})},u=h=>{const g=()=>h.execCommand("mceCodeEditor");h.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:g}),h.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:g})};var f=()=>{s.add("code",h=>(a(h),u(h),{}))};f()})();(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=Object.getPrototypeOf,t=(de,Me,je)=>{var Bt;return je(de,Me.prototype)?!0:((Bt=de.constructor)===null||Bt===void 0?void 0:Bt.name)===Me.name},r=de=>{const Me=typeof de;return de===null?"null":Me==="object"&&Array.isArray(de)?"array":Me==="object"&&t(de,String,(je,Bt)=>Bt.isPrototypeOf(je))?"string":Me},a=de=>Me=>r(Me)===de,u=de=>Me=>typeof Me===de,f=de=>Me=>de===Me,h=(de,Me)=>y(de)&&t(de,Me,(je,Bt)=>e(je)===Bt),g=a("string"),y=a("object"),C=de=>h(de,Object),A=a("array"),O=f(null),N=u("boolean"),L=de=>de==null,j=de=>!L(de),z=u("function"),q=u("number"),ee=(de,Me)=>{if(A(de)){for(let je=0,Bt=de.length;je<Bt;++je)if(!Me(de[je]))return!1;return!0}return!1},F=()=>{};class ne{constructor(Me,je){this.tag=Me,this.value=je}static some(Me){return new ne(!0,Me)}static none(){return ne.singletonNone}fold(Me,je){return this.tag?je(this.value):Me()}isSome(){return this.tag}isNone(){return!this.tag}map(Me){return this.tag?ne.some(Me(this.value)):ne.none()}bind(Me){return this.tag?Me(this.value):ne.none()}exists(Me){return this.tag&&Me(this.value)}forall(Me){return!this.tag||Me(this.value)}filter(Me){return!this.tag||Me(this.value)?this:ne.none()}getOr(Me){return this.tag?this.value:Me}or(Me){return this.tag?this:Me}getOrThunk(Me){return this.tag?this.value:Me()}orThunk(Me){return this.tag?this:Me()}getOrDie(Me){if(this.tag)return this.value;throw new Error(Me!=null?Me:"Called getOrDie on None")}static from(Me){return j(Me)?ne.some(Me):ne.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Me){this.tag&&Me(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}ne.singletonNone=new ne(!1);const oe=Object.keys,re=Object.hasOwnProperty,J=(de,Me)=>{const je=oe(de);for(let Bt=0,Ln=je.length;Bt<Ln;Bt++){const Xo=je[Bt],no=de[Xo];Me(no,Xo)}},we=de=>(Me,je)=>{de[je]=Me},ye=(de,Me,je,Bt)=>{J(de,(Ln,Xo)=>{(Me(Ln,Xo)?je:Bt)(Ln,Xo)})},De=(de,Me)=>{const je={};return ye(de,Me,we(je),F),je},_e=(de,Me)=>re.call(de,Me),be=(de,Me)=>_e(de,Me)&&de[Me]!==void 0&&de[Me]!==null,tt=Array.prototype.push,Qe=de=>{const Me=[];for(let je=0,Bt=de.length;je<Bt;++je){if(!A(de[je]))throw new Error("Arr.flatten item "+je+" was not an array, input: "+de);tt.apply(Me,de[je])}return Me},ft=(de,Me)=>Me>=0&&Me<de.length?ne.some(de[Me]):ne.none(),V=de=>ft(de,0),mt=(de,Me)=>{for(let je=0;je<de.length;je++){const Bt=Me(de[je],je);if(Bt.isSome())return Bt}return ne.none()};typeof window<"u"||Function("return this;")();const nt=(de,Me,je)=>{if(g(je)||N(je)||q(je))de.setAttribute(Me,je+"");else throw console.error("Invalid call to Attribute.set. Key ",Me,":: Value ",je,":: Element ",de),new Error("Attribute value was not simple")},Ot=(de,Me,je)=>{nt(de.dom,Me,je)},Tt=(de,Me)=>{de.dom.removeAttribute(Me)},He=(de,Me)=>{const Bt=(Me||document).createElement("div");if(Bt.innerHTML=de,!Bt.hasChildNodes()||Bt.childNodes.length>1){const Ln="HTML does not have a single root node";throw console.error(Ln,de),new Error(Ln)}return kt(Bt.childNodes[0])},ct=(de,Me)=>{const Bt=(Me||document).createElement(de);return kt(Bt)},dn=(de,Me)=>{const Bt=(Me||document).createTextNode(de);return kt(Bt)},kt=de=>{if(de==null)throw new Error("Node cannot be null or undefined");return{dom:de}},We={fromHtml:He,fromTag:ct,fromText:dn,fromDom:kt,fromPoint:(de,Me,je)=>ne.from(de.dom.elementFromPoint(Me,je)).map(kt)};var xt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),he=tinymce.util.Tools.resolve("tinymce.util.URI");const es=de=>de.length>0,ho=de=>Me=>Me.options.get(de),ao=de=>{const Me=de.options.register;Me("image_dimensions",{processor:"boolean",default:!0}),Me("image_advtab",{processor:"boolean",default:!1}),Me("image_uploadtab",{processor:"boolean",default:!0}),Me("image_prepend_url",{processor:"string",default:""}),Me("image_class_list",{processor:"object[]"}),Me("image_description",{processor:"boolean",default:!0}),Me("image_title",{processor:"boolean",default:!1}),Me("image_caption",{processor:"boolean",default:!1}),Me("image_list",{processor:je=>{const Bt=je===!1||g(je)||ee(je,y)||z(je);return Bt?{value:je,valid:Bt}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},xo=ho("image_dimensions"),Yo=ho("image_advtab"),Ct=ho("image_uploadtab"),Jt=ho("image_prepend_url"),Et=ho("image_class_list"),Pe=ho("image_description"),Ut=ho("image_title"),gn=ho("image_caption"),yt=ho("image_list"),Yt=ho("a11y_advanced_options"),bn=ho("automatic_uploads"),rs=de=>es(de.options.get("images_upload_url")),Jn=de=>j(de.options.get("images_upload_handler")),ds=(de,Me)=>Math.max(parseInt(de,10),parseInt(Me,10)),Or=de=>new Promise(Me=>{const je=document.createElement("img"),Bt=Xo=>{je.onload=je.onerror=null,je.parentNode&&je.parentNode.removeChild(je),Me(Xo)};je.onload=()=>{const Xo=ds(je.width,je.clientWidth),no=ds(je.height,je.clientHeight),mi={width:Xo,height:no};Bt(Promise.resolve(mi))},je.onerror=()=>{Bt(Promise.reject(`Failed to get image dimensions for: ${de}`))};const Ln=je.style;Ln.visibility="hidden",Ln.position="fixed",Ln.bottom=Ln.left="0px",Ln.width=Ln.height="auto",document.body.appendChild(je),je.src=de}),Ns=de=>(de&&(de=de.replace(/px$/,"")),de),Js=de=>(de.length>0&&/^[0-9]+$/.test(de)&&(de+="px"),de),Zs=de=>{if(de.margin){const Me=String(de.margin).split(" ");switch(Me.length){case 1:de["margin-top"]=de["margin-top"]||Me[0],de["margin-right"]=de["margin-right"]||Me[0],de["margin-bottom"]=de["margin-bottom"]||Me[0],de["margin-left"]=de["margin-left"]||Me[0];break;case 2:de["margin-top"]=de["margin-top"]||Me[0],de["margin-right"]=de["margin-right"]||Me[1],de["margin-bottom"]=de["margin-bottom"]||Me[0],de["margin-left"]=de["margin-left"]||Me[1];break;case 3:de["margin-top"]=de["margin-top"]||Me[0],de["margin-right"]=de["margin-right"]||Me[1],de["margin-bottom"]=de["margin-bottom"]||Me[2],de["margin-left"]=de["margin-left"]||Me[1];break;case 4:de["margin-top"]=de["margin-top"]||Me[0],de["margin-right"]=de["margin-right"]||Me[1],de["margin-bottom"]=de["margin-bottom"]||Me[2],de["margin-left"]=de["margin-left"]||Me[3]}delete de.margin}return de},ba=(de,Me)=>{const je=yt(de);g(je)?fetch(je).then(Bt=>{Bt.ok&&Bt.json().then(Me)}):z(je)?je(Me):Me(je)},ar=(de,Me,je)=>{const Bt=()=>{je.onload=je.onerror=null,de.selection&&(de.selection.select(je),de.nodeChanged())};je.onload=()=>{!Me.width&&!Me.height&&xo(de)&&de.dom.setAttribs(je,{width:String(je.clientWidth),height:String(je.clientHeight)}),Bt()},je.onerror=Bt},Ps=de=>new Promise((Me,je)=>{const Bt=new FileReader;Bt.onload=()=>{Me(Bt.result)},Bt.onerror=()=>{var Ln;je((Ln=Bt.error)===null||Ln===void 0?void 0:Ln.message)},Bt.readAsDataURL(de)}),Zr=de=>de.nodeName==="IMG"&&(de.hasAttribute("data-mce-object")||de.hasAttribute("data-mce-placeholder")),No=(de,Me)=>{const je=de.options.get;return he.isDomSafe(Me,"img",{allow_html_data_urls:je("allow_html_data_urls"),allow_script_urls:je("allow_script_urls"),allow_svg_data_urls:je("allow_svg_data_urls")})},Mo=xt.DOM,Mr=de=>de.style.marginLeft&&de.style.marginRight&&de.style.marginLeft===de.style.marginRight?Ns(de.style.marginLeft):"",Ls=de=>de.style.marginTop&&de.style.marginBottom&&de.style.marginTop===de.style.marginBottom?Ns(de.style.marginTop):"",na=de=>de.style.borderWidth?Ns(de.style.borderWidth):"",gs=(de,Me)=>{var je;return de.hasAttribute(Me)&&(je=de.getAttribute(Me))!==null&&je!==void 0?je:""},va=de=>de.parentNode!==null&&de.parentNode.nodeName==="FIGURE",an=(de,Me,je)=>{je===""||je===null?de.removeAttribute(Me):de.setAttribute(Me,je)},ps=de=>{const Me=Mo.create("figure",{class:"image"});Mo.insertAfter(Me,de),Me.appendChild(de),Me.appendChild(Mo.create("figcaption",{contentEditable:"true"},"Caption")),Me.contentEditable="false"},Ii=de=>{const Me=de.parentNode;j(Me)&&(Mo.insertAfter(de,Me),Mo.remove(Me))},$e=de=>{va(de)?Ii(de):ps(de)},Je=(de,Me)=>{const je=de.getAttribute("style"),Bt=Me(je!==null?je:"");Bt.length>0?(de.setAttribute("style",Bt),de.setAttribute("data-mce-style",Bt)):de.removeAttribute("style")},At=(de,Me)=>(je,Bt,Ln)=>{const Xo=je.style;Xo[Bt]?(Xo[Bt]=Js(Ln),Je(je,Me)):an(je,Bt,Ln)},Wt=(de,Me)=>de.style[Me]?Ns(de.style[Me]):gs(de,Me),Wn=(de,Me)=>{const je=Js(Me);de.style.marginLeft=je,de.style.marginRight=je},lo=(de,Me)=>{const je=Js(Me);de.style.marginTop=je,de.style.marginBottom=je},go=(de,Me)=>{const je=Js(Me);de.style.borderWidth=je},cn=(de,Me)=>{de.style.borderStyle=Me},ts=de=>{var Me;return(Me=de.style.borderStyle)!==null&&Me!==void 0?Me:""},wo=de=>j(de)&&de.nodeName==="FIGURE",cs=de=>de.nodeName==="IMG",_r=de=>Mo.getAttrib(de,"alt").length===0&&Mo.getAttrib(de,"role")==="presentation",Ir=de=>_r(de)?"":gs(de,"alt"),Vs=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),Ur=(de,Me)=>{var je;const Bt=document.createElement("img");return an(Bt,"style",Me.style),(Mr(Bt)||Me.hspace!=="")&&Wn(Bt,Me.hspace),(Ls(Bt)||Me.vspace!=="")&&lo(Bt,Me.vspace),(na(Bt)||Me.border!=="")&&go(Bt,Me.border),(ts(Bt)||Me.borderStyle!=="")&&cn(Bt,Me.borderStyle),de((je=Bt.getAttribute("style"))!==null&&je!==void 0?je:"")},Bi=(de,Me)=>{const je=document.createElement("img");if(jt(de,{...Me,caption:!1},je),Ge(je,Me.alt,Me.isDecorative),Me.caption){const Bt=Mo.create("figure",{class:"image"});return Bt.appendChild(je),Bt.appendChild(Mo.create("figcaption",{contentEditable:"true"},"Caption")),Bt.contentEditable="false",Bt}else return je},Ba=(de,Me)=>({src:gs(Me,"src"),alt:Ir(Me),title:gs(Me,"title"),width:Wt(Me,"width"),height:Wt(Me,"height"),class:gs(Me,"class"),style:de(gs(Me,"style")),caption:va(Me),hspace:Mr(Me),vspace:Ls(Me),border:na(Me),borderStyle:ts(Me),isDecorative:_r(Me)}),hi=(de,Me,je,Bt,Ln)=>{je[Bt]!==Me[Bt]&&Ln(de,Bt,String(je[Bt]))},Ge=(de,Me,je)=>{if(je){Mo.setAttrib(de,"role","presentation");const Bt=We.fromDom(de);Ot(Bt,"alt","")}else{if(O(Me)){const Bt=We.fromDom(de);Tt(Bt,"alt")}else{const Bt=We.fromDom(de);Ot(Bt,"alt",Me)}Mo.getAttrib(de,"role")==="presentation"&&Mo.setAttrib(de,"role","")}},qe=(de,Me,je)=>{(je.alt!==Me.alt||je.isDecorative!==Me.isDecorative)&&Ge(de,je.alt,je.isDecorative)},It=(de,Me)=>(je,Bt,Ln)=>{de(je,Ln),Je(je,Me)},jt=(de,Me,je)=>{const Bt=Ba(de,je);hi(je,Bt,Me,"caption",(Ln,Xo,no)=>$e(Ln)),hi(je,Bt,Me,"src",an),hi(je,Bt,Me,"title",an),hi(je,Bt,Me,"width",At("width",de)),hi(je,Bt,Me,"height",At("height",de)),hi(je,Bt,Me,"class",an),hi(je,Bt,Me,"style",It((Ln,Xo)=>an(Ln,"style",Xo),de)),hi(je,Bt,Me,"hspace",It(Wn,de)),hi(je,Bt,Me,"vspace",It(lo,de)),hi(je,Bt,Me,"border",It(go,de)),hi(je,Bt,Me,"borderStyle",It(cn,de)),qe(je,Bt,Me)},co=(de,Me)=>{const je=de.dom.styles.parse(Me),Bt=Zs(je),Ln=de.dom.styles.parse(de.dom.styles.serialize(Bt));return de.dom.styles.serialize(Ln)},Bo=de=>{const Me=de.selection.getNode(),je=de.dom.getParent(Me,"figure.image");return je?de.dom.select("img",je)[0]:Me&&(Me.nodeName!=="IMG"||Zr(Me))?null:Me},qo=(de,Me)=>{var je;const Bt=de.dom,Ln=De(de.schema.getTextBlockElements(),(no,mi)=>!de.schema.isValidChild(mi,"figure")),Xo=Bt.getParent(Me.parentNode,no=>be(Ln,no.nodeName),de.getBody());return Xo&&(je=Bt.split(Xo,Me))!==null&&je!==void 0?je:Me},Yr=de=>{const Me=Bo(de);return Me?Ba(je=>co(de,je),Me):Vs()},it=(de,Me)=>{const je=Bi(Ln=>co(de,Ln),Me);de.dom.setAttrib(je,"data-mce-id","__mcenew"),de.focus(),de.selection.setContent(je.outerHTML);const Bt=de.dom.select('*[data-mce-id="__mcenew"]')[0];if(de.dom.setAttrib(Bt,"data-mce-id",null),wo(Bt)){const Ln=qo(de,Bt);de.selection.select(Ln)}else de.selection.select(Bt)},Wo=(de,Me)=>{de.dom.setAttrib(Me,"src",Me.getAttribute("src"))},Di=(de,Me)=>{if(Me){const je=de.dom.is(Me.parentNode,"figure.image")?Me.parentNode:Me;de.dom.remove(je),de.focus(),de.nodeChanged(),de.dom.isEmpty(de.getBody())&&(de.setContent(""),de.selection.setCursorLocation())}},oa=(de,Me)=>{const je=Bo(de);if(je)if(jt(Bt=>co(de,Bt),Me,je),Wo(de,je),wo(je.parentNode)){const Bt=je.parentNode;qo(de,Bt),de.selection.select(je.parentNode)}else de.selection.select(je),ar(de,Me,je)},ua=(de,Me)=>{const je=Me.src;return{...Me,src:No(de,je)?je:""}},ur=(de,Me)=>{const je=Bo(de);if(je){const Ln={...Ba(no=>co(de,no),je),...Me},Xo=ua(de,Ln);Ln.src?oa(de,Xo):Di(de,je)}else Me.src&&it(de,{...Vs(),...Me})},Xa=(de=>(...Me)=>{if(Me.length===0)throw new Error("Can't merge zero objects");const je={};for(let Bt=0;Bt<Me.length;Bt++){const Ln=Me[Bt];for(const Xo in Ln)_e(Ln,Xo)&&(je[Xo]=de(je[Xo],Ln[Xo]))}return je})((de,Me)=>C(de)&&C(Me)?Xa(de,Me):Me);var fa=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Qs=tinymce.util.Tools.resolve("tinymce.util.Tools");const xr=de=>g(de.value)?de.value:"",Ki=de=>g(de.text)?de.text:g(de.title)?de.title:"",fl=(de,Me)=>{const je=[];return Qs.each(de,Bt=>{const Ln=Ki(Bt);if(Bt.menu!==void 0){const Xo=fl(Bt.menu,Me);je.push({text:Ln,items:Xo})}else{const Xo=Me(Bt);je.push({text:Ln,value:Xo})}}),je},pc=(de=xr)=>Me=>Me?ne.from(Me).map(je=>fl(je,de)):ne.none(),Zc=de=>pc(xr)(de),gu=de=>_e(de,"items"),gr=(de,Me)=>mt(de,je=>gu(je)?gr(je.items,Me):je.value===Me?ne.some(je):ne.none()),pu={sanitizer:pc,sanitize:Zc,findEntry:(de,Me)=>de.bind(je=>gr(je,Me))},Vl={makeTab:de=>({title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]})},xa=de=>{const Me=pu.sanitizer(Ei=>de.convertURL(Ei.value||Ei.url||"","src")),je=new Promise(Ei=>{ba(de,sc=>{Ei(Me(sc).map(Oi=>Qe([[{text:"None",value:""}],Oi])))})}),Bt=pu.sanitize(Et(de)),Ln=Yo(de),Xo=Ct(de),no=rs(de),mi=Jn(de),hn=Yr(de),qr=Pe(de),Nl=Ut(de),Xi=xo(de),ni=gn(de),vf=Yt(de),Ss=bn(de),Kc=ne.some(Jt(de)).filter(Ei=>g(Ei)&&Ei.length>0);return je.then(Ei=>({image:hn,imageList:Ei,classList:Bt,hasAdvTab:Ln,hasUploadTab:Xo,hasUploadUrl:no,hasUploadHandler:mi,hasDescription:qr,hasImageTitle:Nl,hasDimensions:Xi,hasImageCaption:ni,prependURL:Kc,hasAccessibilityOptions:vf,automaticUploads:Ss}))},Ar=de=>{const Me={name:"src",type:"urlinput",filetype:"image",label:"Source"},je=de.imageList.map(Nl=>({name:"images",type:"listbox",label:"Image list",items:Nl})),Bt={name:"alt",type:"input",label:"Alternative description",enabled:!(de.hasAccessibilityOptions&&de.image.isDecorative)},Ln={name:"title",type:"input",label:"Image title"},Xo={name:"dimensions",type:"sizeinput"},no={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},mi=de.classList.map(Nl=>({name:"classes",type:"listbox",label:"Class",items:Nl})),hn={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},qr=Nl=>Nl?{type:"grid",columns:2}:{type:"panel"};return Qe([[Me],je.toArray(),de.hasAccessibilityOptions&&de.hasDescription?[no]:[],de.hasDescription?[Bt]:[],de.hasImageTitle?[Ln]:[],de.hasDimensions?[Xo]:[],[{...qr(de.classList.isSome()&&de.hasImageCaption),items:Qe([mi.toArray(),de.hasImageCaption?[hn]:[]])}]])},pf={makeTab:de=>({title:"General",name:"general",items:Ar(de)}),makeItems:Ar},La={makeTab:de=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]})},sa=de=>({prevImage:pu.findEntry(de.imageList,de.image.src),prevAlt:de.image.alt,open:!0}),Yi=de=>({src:{value:de.src,meta:{}},images:de.src,alt:de.alt,title:de.title,dimensions:{width:de.width,height:de.height},classes:de.class,caption:de.caption,style:de.style,vspace:de.vspace,border:de.border,hspace:de.hspace,borderstyle:de.borderStyle,fileinput:[],isDecorative:de.isDecorative}),bu=(de,Me)=>({src:de.src.value,alt:(de.alt===null||de.alt.length===0)&&Me?null:de.alt,title:de.title,width:de.dimensions.width,height:de.dimensions.height,class:de.classes,style:de.style,caption:de.caption,hspace:de.hspace,vspace:de.vspace,border:de.border,borderStyle:de.borderstyle,isDecorative:de.isDecorative}),Oc=(de,Me)=>/^(?:[a-zA-Z]+:)?\/\//.test(Me)?ne.none():de.prependURL.bind(je=>Me.substring(0,je.length)!==je?ne.some(je+Me):ne.none()),Fa=(de,Me)=>{const je=Me.getData();Oc(de,je.src.value).each(Bt=>{Me.setData({src:{value:Bt,meta:je.src.meta}})})},Mc=(de,Me,je)=>{de.hasDescription&&g(je.alt)&&(Me.alt=je.alt),de.hasAccessibilityOptions&&(Me.isDecorative=je.isDecorative||Me.isDecorative||!1),de.hasImageTitle&&g(je.title)&&(Me.title=je.title),de.hasDimensions&&(g(je.width)&&(Me.dimensions.width=je.width),g(je.height)&&(Me.dimensions.height=je.height)),g(je.class)&&pu.findEntry(de.classList,je.class).each(Bt=>{Me.classes=Bt.value}),de.hasImageCaption&&N(je.caption)&&(Me.caption=je.caption),de.hasAdvTab&&(g(je.style)&&(Me.style=je.style),g(je.vspace)&&(Me.vspace=je.vspace),g(je.border)&&(Me.border=je.border),g(je.hspace)&&(Me.hspace=je.hspace),g(je.borderstyle)&&(Me.borderstyle=je.borderstyle))},bc=(de,Me)=>{const je=Me.getData(),Bt=je.src.meta;if(Bt!==void 0){const Ln=Xa({},je);Mc(de,Ln,Bt),Me.setData(Ln)}},gd=(de,Me,je,Bt)=>{const Ln=Bt.getData(),Xo=Ln.src.value,no=Ln.src.meta||{};!no.width&&!no.height&&Me.hasDimensions&&(es(Xo)?de.imageSize(Xo).then(mi=>{je.open&&Bt.setData({dimensions:mi})}).catch(mi=>console.error(mi)):Bt.setData({dimensions:{width:"",height:""}}))},Lf=(de,Me,je)=>{const Bt=je.getData(),Ln=pu.findEntry(de.imageList,Bt.src.value);Me.prevImage=Ln,je.setData({images:Ln.map(Xo=>Xo.value).getOr("")})},vu=(de,Me,je,Bt)=>{Fa(Me,Bt),bc(Me,Bt),gd(de,Me,je,Bt),Lf(Me,je,Bt)},Ul=(de,Me,je,Bt)=>{const Ln=Bt.getData(),Xo=pu.findEntry(Me.imageList,Ln.images);Xo.each(no=>{Ln.alt===""||je.prevImage.map(hn=>hn.text===Ln.alt).getOr(!1)?no.value===""?Bt.setData({src:no,alt:je.prevAlt}):Bt.setData({src:no,alt:no.text}):Bt.setData({src:no})}),je.prevImage=Xo,vu(de,Me,je,Bt)},Rc=(de,Me,je,Bt)=>{const Ln=Bt.getData();Bt.block("Uploading image"),V(Ln.fileinput).fold(()=>{Bt.unblock()},Xo=>{const no=URL.createObjectURL(Xo),mi=()=>{Bt.unblock(),URL.revokeObjectURL(no)},hn=qr=>{Bt.setData({src:{value:qr,meta:{}}}),Bt.showTab("general"),vu(de,Me,je,Bt)};Ps(Xo).then(qr=>{const Nl=de.createBlobCache(Xo,no,qr);Me.automaticUploads?de.uploadImage(Nl).then(Xi=>{hn(Xi.url),mi()}).catch(Xi=>{mi(),de.alertErr(Xi)}):(de.addToBlobCache(Nl),hn(Nl.blobUri()),Bt.unblock())})})},bf=(de,Me,je)=>(Bt,Ln)=>{Ln.name==="src"?vu(de,Me,je,Bt):Ln.name==="images"?Ul(de,Me,je,Bt):Ln.name==="alt"?je.prevAlt=Bt.getData().alt:Ln.name==="fileinput"?Rc(de,Me,je,Bt):Ln.name==="isDecorative"&&Bt.setEnabled("alt",!Bt.getData().isDecorative)},Gc=de=>()=>{de.open=!1},pd=de=>de.hasAdvTab||de.hasUploadUrl||de.hasUploadHandler?{type:"tabpanel",tabs:Qe([[pf.makeTab(de)],de.hasAdvTab?[Vl.makeTab(de)]:[],de.hasUploadTab&&(de.hasUploadUrl||de.hasUploadHandler)?[La.makeTab(de)]:[]])}:{type:"panel",items:pf.makeItems(de)},Ae=(de,Me,je)=>Bt=>{const Ln=Xa(Yi(Me.image),Bt.getData()),Xo={...Ln,style:Ur(je.normalizeCss,bu(Ln,!1))};de.execCommand("mceUpdateImage",!1,bu(Xo,Me.hasAccessibilityOptions)),de.editorUpload.uploadImagesAuto(),Bt.close()},et=de=>Me=>No(de,Me)?Or(de.documentBaseURI.toAbsolute(Me)).then(je=>({width:String(je.width),height:String(je.height)})):Promise.resolve({width:"",height:""}),gt=de=>(Me,je,Bt)=>{var Ln;return de.editorUpload.blobCache.create({blob:Me,blobUri:je,name:(Ln=Me.name)===null||Ln===void 0?void 0:Ln.replace(/\.[^\.]+$/,""),filename:Me.name,base64:Bt.split(",")[1]})},Pt=de=>Me=>{de.editorUpload.blobCache.add(Me)},vn=de=>Me=>{de.windowManager.alert(Me)},Ro=de=>Me=>co(de,Me),Rr=de=>Me=>de.dom.parseStyle(Me),vs=de=>(Me,je)=>de.dom.serializeStyle(Me,je),is=de=>Me=>fa(de).upload([Me],!1).then(je=>{var Bt;return je.length===0?Promise.reject("Failed to upload image"):je[0].status===!1?Promise.reject((Bt=je[0].error)===null||Bt===void 0?void 0:Bt.message):je[0]}),ki=de=>{const Me={imageSize:et(de),addToBlobCache:Pt(de),createBlobCache:gt(de),alertErr:vn(de),normalizeCss:Ro(de),parseStyle:Rr(de),serializeStyle:vs(de),uploadImage:is(de)};return{open:()=>{xa(de).then(Bt=>{const Ln=sa(Bt);return{title:"Insert/Edit Image",size:"normal",body:pd(Bt),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Yi(Bt.image),onSubmit:Ae(de,Bt,Me),onChange:bf(Me,Bt,Ln),onClose:Gc(Ln)}}).then(de.windowManager.open)}}},qs=de=>{de.addCommand("mceImage",ki(de).open),de.addCommand("mceUpdateImage",(Me,je)=>{de.undoManager.transact(()=>ur(de,je))})},Li=de=>{const Me=de.attr("class");return j(Me)&&/\bimage\b/.test(Me)},yu=de=>Me=>{let je=Me.length;const Bt=Ln=>{Ln.attr("contenteditable",de?"true":null)};for(;je--;){const Ln=Me[je];Li(Ln)&&(Ln.attr("contenteditable",de?"false":null),Qs.each(Ln.getAll("figcaption"),Bt))}},bd=de=>{de.on("PreInit",()=>{de.parser.addNodeFilter("figure",yu(!0)),de.serializer.addNodeFilter("figure",yu(!1))})},Kn=de=>Me=>{const je=()=>{Me.setEnabled(de.selection.isEditable())};return de.on("NodeChange",je),je(),()=>{de.off("NodeChange",je)}},Nm=de=>{de.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ki(de).open,onSetup:Me=>{Me.setActive(j(Bo(de)));const je=de.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",Me.setActive).unbind,Bt=Kn(de)(Me);return()=>{je(),Bt()}}}),de.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ki(de).open,onSetup:Kn(de)}),de.ui.registry.addContextMenu("image",{update:Me=>de.selection.isEditable()&&(wo(Me)||cs(Me)&&!Zr(Me))?["image"]:[]})};var Fi=()=>{s.add("image",de=>{ao(de),bd(de),Nm(de),qs(de)})};Fi()})();(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=($,G,ve)=>{var Te;return ve($,G.prototype)?!0:((Te=$.constructor)===null||Te===void 0?void 0:Te.name)===G.name},t=$=>{const G=typeof $;return $===null?"null":G==="object"&&Array.isArray($)?"array":G==="object"&&e($,String,(ve,Te)=>Te.isPrototypeOf(ve))?"string":G},r=$=>G=>t(G)===$,a=$=>G=>typeof G===$,u=$=>G=>$===G,f=r("string"),h=r("array"),g=a("boolean"),y=u(void 0),C=$=>$==null,A=$=>!C($),O=a("function"),N=a("number"),L=()=>{},j=($,G)=>ve=>$(G(ve)),z=$=>()=>$,q=$=>$,ee=($,G)=>$===G;function F($,...G){return(...ve)=>{const Te=G.concat(ve);return $.apply(null,Te)}}const ne=$=>{$()},oe=z(!1),re=z(!0);class J{constructor(G,ve){this.tag=G,this.value=ve}static some(G){return new J(!0,G)}static none(){return J.singletonNone}fold(G,ve){return this.tag?ve(this.value):G()}isSome(){return this.tag}isNone(){return!this.tag}map(G){return this.tag?J.some(G(this.value)):J.none()}bind(G){return this.tag?G(this.value):J.none()}exists(G){return this.tag&&G(this.value)}forall(G){return!this.tag||G(this.value)}filter(G){return!this.tag||G(this.value)?this:J.none()}getOr(G){return this.tag?this.value:G}or(G){return this.tag?this:G}getOrThunk(G){return this.tag?this.value:G()}orThunk(G){return this.tag?this:G()}getOrDie(G){if(this.tag)return this.value;throw new Error(G!=null?G:"Called getOrDie on None")}static from(G){return A(G)?J.some(G):J.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(G){this.tag&&G(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}J.singletonNone=new J(!1);const we=Object.keys,ye=Object.hasOwnProperty,De=($,G)=>{const ve=we($);for(let Te=0,at=ve.length;Te<at;Te++){const Ft=ve[Te],Cn=$[Ft];G(Cn,Ft)}},_e=$=>(G,ve)=>{$[ve]=G},be=($,G,ve,Te)=>{De($,(at,Ft)=>{(G(at,Ft)?ve:Te)(at,Ft)})},tt=($,G)=>{const ve={};return be($,G,_e(ve),L),ve},Qe=($,G)=>{const ve=[];return De($,(Te,at)=>{ve.push(G(Te,at))}),ve},ft=$=>Qe($,q),V=$=>we($).length,mt=($,G)=>nt($,G)?J.from($[G]):J.none(),nt=($,G)=>ye.call($,G),Ot=($,G)=>nt($,G)&&$[G]!==void 0&&$[G]!==null,Tt=$=>{for(const G in $)if(ye.call($,G))return!1;return!0},He=Array.prototype.indexOf,ct=Array.prototype.push,dn=($,G)=>He.call($,G),kt=($,G)=>dn($,G)>-1,xn=($,G)=>{for(let ve=0,Te=$.length;ve<Te;ve++){const at=$[ve];if(G(at,ve))return!0}return!1},We=($,G)=>{const ve=[];for(let Te=0;Te<$;Te++)ve.push(G(Te));return ve},xt=($,G)=>{const ve=$.length,Te=new Array(ve);for(let at=0;at<ve;at++){const Ft=$[at];Te[at]=G(Ft,at)}return Te},he=($,G)=>{for(let ve=0,Te=$.length;ve<Te;ve++){const at=$[ve];G(at,ve)}},es=($,G)=>{for(let ve=$.length-1;ve>=0;ve--){const Te=$[ve];G(Te,ve)}},ho=($,G)=>{const ve=[],Te=[];for(let at=0,Ft=$.length;at<Ft;at++){const Cn=$[at];(G(Cn,at)?ve:Te).push(Cn)}return{pass:ve,fail:Te}},ao=($,G)=>{const ve=[];for(let Te=0,at=$.length;Te<at;Te++){const Ft=$[Te];G(Ft,Te)&&ve.push(Ft)}return ve},xo=($,G,ve)=>(es($,(Te,at)=>{ve=G(ve,Te,at)}),ve),Yo=($,G,ve)=>(he($,(Te,at)=>{ve=G(ve,Te,at)}),ve),Ct=($,G,ve)=>{for(let Te=0,at=$.length;Te<at;Te++){const Ft=$[Te];if(G(Ft,Te))return J.some(Ft);if(ve(Ft,Te))break}return J.none()},Jt=($,G)=>Ct($,G,oe),Et=$=>{const G=[];for(let ve=0,Te=$.length;ve<Te;++ve){if(!h($[ve]))throw new Error("Arr.flatten item "+ve+" was not an array, input: "+$);ct.apply(G,$[ve])}return G},Pe=($,G)=>Et(xt($,G)),Ut=($,G)=>{for(let ve=0,Te=$.length;ve<Te;++ve){const at=$[ve];if(G(at,ve)!==!0)return!1}return!0},gn=($,G)=>{const ve={};for(let Te=0,at=$.length;Te<at;Te++){const Ft=$[Te];ve[String(Ft)]=G(Ft,Te)}return ve},yt=($,G)=>G>=0&&G<$.length?J.some($[G]):J.none(),Yt=$=>yt($,0),bn=$=>yt($,$.length-1),rs=($,G)=>{for(let ve=0;ve<$.length;ve++){const Te=G($[ve],ve);if(Te.isSome())return Te}return J.none()},Jn=8,ds=9,Or=11,Ns=1,Js=3,Zs=($,G)=>{const Te=(G||document).createElement("div");if(Te.innerHTML=$,!Te.hasChildNodes()||Te.childNodes.length>1){const at="HTML does not have a single root node";throw console.error(at,$),new Error(at)}return Ps(Te.childNodes[0])},ba=($,G)=>{const Te=(G||document).createElement($);return Ps(Te)},ar=($,G)=>{const Te=(G||document).createTextNode($);return Ps(Te)},Ps=$=>{if($==null)throw new Error("Node cannot be null or undefined");return{dom:$}},No={fromHtml:Zs,fromTag:ba,fromText:ar,fromDom:Ps,fromPoint:($,G,ve)=>J.from($.dom.elementFromPoint(G,ve)).map(Ps)},Mo=($,G)=>{const ve=$.dom;if(ve.nodeType!==Ns)return!1;{const Te=ve;if(Te.matches!==void 0)return Te.matches(G);if(Te.msMatchesSelector!==void 0)return Te.msMatchesSelector(G);if(Te.webkitMatchesSelector!==void 0)return Te.webkitMatchesSelector(G);if(Te.mozMatchesSelector!==void 0)return Te.mozMatchesSelector(G);throw new Error("Browser lacks native selectors")}},Mr=$=>$.nodeType!==Ns&&$.nodeType!==ds&&$.nodeType!==Or||$.childElementCount===0,Ls=($,G)=>{const ve=G===void 0?document:G.dom;return Mr(ve)?[]:xt(ve.querySelectorAll($),No.fromDom)},na=($,G)=>{const ve=G===void 0?document:G.dom;return Mr(ve)?J.none():J.from(ve.querySelector($)).map(No.fromDom)},gs=($,G)=>$.dom===G.dom,va=Mo;typeof window<"u"||Function("return this;")();const an=$=>$.dom.nodeName.toLowerCase(),ps=$=>$.dom.nodeType,Ii=$=>G=>ps(G)===$,$e=$=>ps($)===Jn||an($)==="#comment",Je=Ii(Ns),At=Ii(Js),Wt=Ii(ds),Wn=Ii(Or),lo=$=>G=>Je(G)&&an(G)===$,go=$=>No.fromDom($.dom.ownerDocument),cn=$=>Wt($)?$:go($),ts=$=>J.from($.dom.parentNode).map(No.fromDom),wo=($,G)=>{const ve=O(G)?G:oe;let Te=$.dom;const at=[];for(;Te.parentNode!==null&&Te.parentNode!==void 0;){const Ft=Te.parentNode,Cn=No.fromDom(Ft);if(at.push(Cn),ve(Cn)===!0)break;Te=Ft}return at},cs=$=>J.from($.dom.previousSibling).map(No.fromDom),_r=$=>J.from($.dom.nextSibling).map(No.fromDom),Ir=$=>xt($.dom.childNodes,No.fromDom),Vs=($,G)=>{const ve=$.dom.childNodes;return J.from(ve[G]).map(No.fromDom)},Ur=$=>Vs($,0),Bi=$=>Wn($)&&A($.dom.host),hi=O(Element.prototype.attachShadow)&&O(Node.prototype.getRootNode)?$=>No.fromDom($.dom.getRootNode()):cn,Ge=$=>{const G=hi($);return Bi(G)?J.some(G):J.none()},qe=$=>No.fromDom($.dom.host),It=$=>{const G=At($)?$.dom.parentNode:$.dom;if(G==null||G.ownerDocument===null)return!1;const ve=G.ownerDocument;return Ge(No.fromDom(G)).fold(()=>ve.body.contains(G),j(It,qe))};var jt=($,G,ve,Te,at)=>$(ve,Te)?J.some(ve):O(at)&&at(ve)?J.none():G(ve,Te,at);const co=($,G,ve)=>{let Te=$.dom;const at=O(ve)?ve:oe;for(;Te.parentNode;){Te=Te.parentNode;const Ft=No.fromDom(Te);if(G(Ft))return J.some(Ft);if(at(Ft))break}return J.none()},Bo=($,G,ve)=>jt((at,Ft)=>Ft(at),co,$,G,ve),qo=($,G)=>{const ve=at=>G(No.fromDom(at));return Jt($.dom.childNodes,ve).map(No.fromDom)},Yr=($,G,ve)=>co($,Te=>Mo(Te,G),ve),it=($,G)=>qo($,ve=>Mo(ve,G)),Wo=($,G)=>na(G,$),Di=($,G,ve)=>jt((at,Ft)=>Mo(at,Ft),Yr,$,G,ve),oa=$=>Di($,"[contenteditable]"),ua=($,G=!1)=>It($)?$.dom.isContentEditable:oa($).fold(z(G),ve=>ur(ve)==="true"),ur=$=>$.dom.contentEditable,Dc=$=>$.nodeName.toLowerCase(),gc=$=>No.fromDom($.getBody()),Xa=$=>G=>gs(G,gc($)),fa=$=>$?$.replace(/px$/,""):"",Qs=$=>/^\d+(\.\d+)?$/.test($)?$+"px":$,xr=$=>No.fromDom($.selection.getStart()),Ki=$=>No.fromDom($.selection.getEnd()),fl=$=>Bo($,lo("table")).forall(ua),pc=($,G)=>ao(Ir($),G),Zc=($,G)=>{let ve=[];return he(Ir($),Te=>{G(Te)&&(ve=ve.concat([Te])),ve=ve.concat(Zc(Te,G))}),ve},gu=($,G)=>pc($,ve=>Mo(ve,G)),gr=($,G)=>Ls(G,$),Ja=($,G,ve)=>{if(f(ve)||g(ve)||N(ve))$.setAttribute(G,ve+"");else throw console.error("Invalid call to Attribute.set. Key ",G,":: Value ",ve,":: Element ",$),new Error("Attribute value was not simple")},pu=($,G,ve)=>{Ja($.dom,G,ve)},qc=($,G)=>{const ve=$.dom;De(G,(Te,at)=>{Ja(ve,at,Te)})},Vl=($,G)=>{const ve=$.dom.getAttribute(G);return ve===null?void 0:ve},xa=($,G)=>J.from(Vl($,G)),Ar=($,G)=>{$.dom.removeAttribute(G)},Rm=$=>Yo($.dom.attributes,(G,ve)=>(G[ve.name]=ve.value,G),{}),pf=($,G,ve=ee)=>$.exists(Te=>ve(Te,G)),Cr=$=>{const G=[],ve=Te=>{G.push(Te)};for(let Te=0;Te<$.length;Te++)$[Te].each(ve);return G},La=($,G,ve)=>$.isSome()&&G.isSome()?J.some(ve($.getOrDie(),G.getOrDie())):J.none(),sa=$=>$.bind(q),Yi=($,G)=>$?J.some(G):J.none(),bu=($,G)=>$.substring(G),Oc=($,G,ve)=>G===""||$.length>=G.length&&$.substr(ve,ve+G.length)===G,Fa=($,G)=>Mc($,G)?bu($,G.length):$,Mc=($,G)=>Oc($,G,0),gd=($=>G=>G.replace($,""))(/^\s+|\s+$/g),Lf=$=>$.length>0,vu=$=>!Lf($),Ul=($,G=10)=>{const ve=parseInt($,G);return isNaN(ve)?J.none():J.some(ve)},Rc=$=>{const G=parseFloat($);return isNaN(G)?J.none():J.some(G)},bf=$=>$.style!==void 0&&O($.style.getPropertyValue),Gc=($,G,ve)=>{if(!f(ve))throw console.error("Invalid call to CSS.set. Property ",G,":: Value ",ve,":: Element ",$),new Error("CSS value must be a string: "+ve);bf($)&&$.style.setProperty(G,ve)},pd=($,G)=>{bf($)&&$.style.removeProperty(G)},Ae=($,G,ve)=>{const Te=$.dom;Gc(Te,G,ve)},et=($,G)=>{const ve=$.dom,at=window.getComputedStyle(ve).getPropertyValue(G);return at===""&&!It($)?gt(ve,G):at},gt=($,G)=>bf($)?$.style.getPropertyValue(G):"",Pt=($,G)=>{const ve=$.dom,Te=gt(ve,G);return J.from(Te).filter(at=>at.length>0)},vn=($,G)=>{const ve=$.dom;pd(ve,G),pf(xa($,"style").map(gd),"")&&Ar($,"style")},Ro=($,G,ve=0)=>xa($,G).map(Te=>parseInt(Te,10)).getOr(ve),Rr=($,G)=>vs($,G,re),vs=($,G,ve)=>Pe(Ir($),Te=>Mo(Te,G)?ve(Te)?[Te]:[]:vs(Te,G,ve)),is=["tfoot","thead","tbody","colgroup"],ki=$=>kt(is,$),qs=($,G)=>({rows:$,columns:G}),Li=($,G,ve)=>({element:$,rowspan:G,colspan:ve}),yu=($,G,ve,Te,at,Ft)=>({element:$,rowspan:G,colspan:ve,row:Te,column:at,isLocked:Ft}),bd=($,G,ve)=>({element:$,cells:G,section:ve}),Kn=($,G,ve,Te)=>({startRow:$,startCol:G,finishRow:ve,finishCol:Te}),Nm=($,G,ve)=>({element:$,colspan:G,column:ve}),Fi=($,G)=>({element:$,columns:G}),de=($,G,ve=oe)=>{if(ve(G))return J.none();if(kt($,an(G)))return J.some(G);const Te=at=>Mo(at,"table")||ve(at);return Yr(G,$.join(","),Te)},Me=($,G)=>de(["td","th"],$,G),je=$=>Rr($,"th,td"),Bt=$=>Mo($,"colgroup")?gu($,"col"):Pe(no($),G=>gu(G,"col")),Ln=($,G)=>Di($,"table",G),Xo=$=>Rr($,"tr"),no=$=>Ln($).fold(z([]),G=>gu(G,"colgroup")),mi=($,G)=>xt($,ve=>{if(an(ve)==="colgroup"){const Te=xt(Bt(ve),at=>{const Ft=Ro(at,"span",1);return Li(at,1,Ft)});return bd(ve,Te,"colgroup")}else{const Te=xt(je(ve),at=>{const Ft=Ro(at,"rowspan",1),Cn=Ro(at,"colspan",1);return Li(at,Ft,Cn)});return bd(ve,Te,G(ve))}}),hn=$=>ts($).map(G=>{const ve=an(G);return ki(ve)?ve:"tbody"}).getOr("tbody"),qr=$=>{const G=Xo($),Te=[...no($),...G];return mi(Te,hn)},Nl="data-snooker-locked-cols",Xi=$=>xa($,Nl).bind(G=>J.from(G.match(/\d+/g))).map(G=>gn(G,re)),ni=($,G)=>$+","+G,vf=($,G,ve)=>J.from($.access[ni(G,ve)]),Ss=($,G,ve)=>{const Te=Kc($,at=>ve(G,at.element));return Te.length>0?J.some(Te[0]):J.none()},Kc=($,G)=>{const ve=Pe($.all,Te=>Te.cells);return ao(ve,G)},Ei=$=>{const G={};let ve=0;return he($.cells,Te=>{const at=Te.colspan;We(at,Ft=>{const Cn=ve+Ft;G[Cn]=Nm(Te.element,at,Cn)}),ve+=at}),G},sc=$=>{const G={},ve=[],at=Yt($).map(Bc=>Bc.element).bind(Ln).bind(Xi).getOr({});let Ft=0,Cn=0,Bn=0;const{pass:Uo,fail:Jo}=ho($,Bc=>Bc.section==="colgroup");he(Jo,Bc=>{const Qc=[];he(Bc.cells,Ku=>{let Ef=0;for(;G[ni(Bn,Ef)]!==void 0;)Ef++;const oh=Ot(at,Ef.toString()),sh=yu(Ku.element,Ku.rowspan,Ku.colspan,Bn,Ef,oh);for(let lr=0;lr<Ku.colspan;lr++)for(let Um=0;Um<Ku.rowspan;Um++){const Wm=Bn+Um,ea=Ef+lr,eu=ni(Wm,ea);G[eu]=sh,Cn=Math.max(Cn,ea+1)}Qc.push(sh)}),Ft++,ve.push(bd(Bc.element,Qc,Bc.section)),Bn++});const{columns:bi,colgroups:tr}=bn(Uo).map(Bc=>{const Qc=Ei(Bc);return{colgroups:[Fi(Bc.element,ft(Qc))],columns:Qc}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:qs(Ft,Cn),access:G,all:ve,columns:bi,colgroups:tr}},zu={fromTable:$=>{const G=qr($);return sc(G)},generate:sc,getAt:vf,findItem:Ss,filterItems:Kc,justCells:$=>Pe($.all,G=>G.cells),justColumns:$=>ft($.columns),hasColumns:$=>we($.columns).length>0,getColumnAt:($,G)=>J.from($.columns[G])};var Vu=tinymce.util.Tools.resolve("tinymce.util.Tools");const vc=($,G,ve)=>{const Te=$.select("td,th",G);let at;for(let Ft=0;Ft<Te.length;Ft++){const Cn=$.getStyle(Te[Ft],ve);if(y(at)&&(at=Cn),at!==Cn)return""}return at},$f=($,G,ve)=>{Vu.each("left center right".split(" "),Te=>{Te!==ve&&$.formatter.remove("align"+Te,{},G)}),ve&&$.formatter.apply("align"+ve,{},G)},jd=($,G,ve)=>{Vu.each("top middle bottom".split(" "),Te=>{Te!==ve&&$.formatter.remove("valign"+Te,{},G)}),ve&&$.formatter.apply("valign"+ve,{},G)},Xr=($,G,ve)=>{$.dispatch("TableModified",{...ve,table:G})},Ji=($,G)=>Rc($).getOr(G),Ha=($,G,ve)=>Ji(et($,G),ve),U0=($,G,ve,Te)=>{const at=Ha($,`padding-${ve}`,0),Ft=Ha($,`padding-${Te}`,0),Cn=Ha($,`border-${ve}-width`,0),Bn=Ha($,`border-${Te}-width`,0);return G-at-Ft-Cn-Bn},xi=($,G)=>{const ve=$.dom,Te=ve.getBoundingClientRect().width||ve.offsetWidth;return G==="border-box"?Te:U0($,Te,"left","right")},Qa=$=>xi($,"content-box");var Ng=tinymce.util.Tools.resolve("tinymce.Env");const zf="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",yc=We(5,$=>{const G=`${$+1}px`;return{title:G,value:G}}),yf=xt(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],$=>({title:$,value:$.toLowerCase()})),Tr="100%",Uu=$=>{var G;const ve=$.dom,Te=(G=ve.getParent($.selection.getStart(),ve.isBlock))!==null&&G!==void 0?G:$.getBody();return Qa(No.fromDom(Te))+"px"},Pl=($,G)=>Bm($)||!wf($)?G:Bp($)?{...G,width:Uu($)}:{...G,width:Tr},$a=($,G)=>Bm($)||wf($)?G:Bp($)?{...G,width:Uu($)}:{...G,width:Tr},qi=$=>G=>G.options.get($),Hi=$=>{const G=$.options.register;G("table_border_widths",{processor:"object[]",default:yc}),G("table_border_styles",{processor:"object[]",default:yf}),G("table_cell_advtab",{processor:"boolean",default:!0}),G("table_row_advtab",{processor:"boolean",default:!0}),G("table_advtab",{processor:"boolean",default:!0}),G("table_appearance_options",{processor:"boolean",default:!0}),G("table_grid",{processor:"boolean",default:!Ng.deviceType.isTouch()}),G("table_cell_class_list",{processor:"object[]",default:[]}),G("table_row_class_list",{processor:"object[]",default:[]}),G("table_class_list",{processor:"object[]",default:[]}),G("table_toolbar",{processor:"string",default:zf}),G("table_background_color_map",{processor:"object[]",default:[]}),G("table_border_color_map",{processor:"object[]",default:[]})},rc=qi("table_sizing_mode"),Vf=qi("table_border_widths"),Zd=qi("table_border_styles"),Pg=qi("table_cell_advtab"),Pm=qi("table_row_advtab"),Il=qi("table_advtab"),Im=qi("table_appearance_options"),el=qi("table_grid"),wf=qi("table_style_by_css"),$h=qi("table_cell_class_list"),Wu=qi("table_row_class_list"),zh=qi("table_class_list"),Nc=qi("table_toolbar"),Vh=qi("table_background_color_map"),_f=qi("table_border_color_map"),Bp=$=>rc($)==="fixed",Bm=$=>rc($)==="responsive",Uf=$=>{const G=$.options,ve=G.get("table_default_styles");return G.isSet("table_default_styles")?ve:Pl($,ve)},Wl=$=>{const G=$.options,ve=G.get("table_default_attributes");return G.isSet("table_default_attributes")?ve:$a($,ve)},Ig=($,G)=>G.column>=$.startCol&&G.column+G.colspan-1<=$.finishCol&&G.row>=$.startRow&&G.row+G.rowspan-1<=$.finishRow,Ke=($,G)=>{let ve=!0;const Te=F(Ig,G);for(let at=G.startRow;at<=G.finishRow;at++)for(let Ft=G.startCol;Ft<=G.finishCol;Ft++)ve=ve&&zu.getAt($,at,Ft).exists(Te);return ve?J.some(G):J.none()},qd=($,G)=>Kn(Math.min($.row,G.row),Math.min($.column,G.column),Math.max($.row+$.rowspan-1,G.row+G.rowspan-1),Math.max($.column+$.colspan-1,G.column+G.colspan-1)),wu=($,G,ve)=>{const Te=zu.findItem($,G,gs),at=zu.findItem($,ve,gs);return Te.bind(Ft=>at.map(Cn=>qd(Ft,Cn)))},Bg=($,G,ve)=>wu($,G,ve).bind(Te=>Ke($,Te)),L1=($,G,ve)=>{const Te=Uh($);return Bg(Te,G,ve)},Uh=zu.fromTable,pt=($,G)=>{ts($).each(Te=>{Te.dom.insertBefore(G.dom,$.dom)})},ln=($,G)=>{_r($).fold(()=>{ts($).each(at=>{Eo(at,G)})},Te=>{pt(Te,G)})},nn=($,G)=>{Ur($).fold(()=>{Eo($,G)},Te=>{$.dom.insertBefore(G.dom,Te.dom)})},Eo=($,G)=>{$.dom.appendChild(G.dom)},er=($,G)=>{pt($,G),Eo(G,$)},Wr=($,G)=>{he(G,(ve,Te)=>{const at=Te===0?$:G[Te-1];ln(at,ve)})},ai=($,G)=>{he(G,ve=>{Eo($,ve)})},gi=$=>{const G=$.dom;G.parentNode!==null&&G.parentNode.removeChild(G)},Gd=$=>{const G=Ir($);G.length>0&&Wr($,G),gi($)},ya=(($,G)=>{const ve=Ft=>{if(!$(Ft))throw new Error("Can only get "+G+" value of a "+G+" node");return Te(Ft).getOr("")},Te=Ft=>$(Ft)?J.from(Ft.dom.nodeValue):J.none();return{get:ve,getOption:Te,set:(Ft,Cn)=>{if(!$(Ft))throw new Error("Can only set raw "+G+" value of a "+G+" node");Ft.dom.nodeValue=Cn}}})(At,"text"),vd=$=>ya.get($),Lg=($,G)=>ya.set($,G);var tl=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Aa=()=>{const $=Jo=>No.fromDom(Jo.dom.cloneNode(!1)),G=Jo=>cn(Jo).dom,ve=Jo=>Je(Jo)?an(Jo)==="body"?!0:kt(tl,an(Jo)):!1,Te=Jo=>Je(Jo)?kt(["br","img","hr","input"],an(Jo)):!1,at=Jo=>Je(Jo)&&Vl(Jo,"contenteditable")==="false",Ft=(Jo,bi)=>Jo.dom.compareDocumentPosition(bi.dom),Cn=(Jo,bi)=>{const tr=Rm(Jo);qc(bi,tr)},Bn=Jo=>{const bi=an(Jo);return kt(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],bi)},Uo=Jo=>Je(Jo)?xa(Jo,"lang"):J.none();return{up:z({selector:Yr,closest:Di,predicate:co,all:wo}),down:z({selector:gr,predicate:Zc}),styles:z({get:et,getRaw:Pt,set:Ae,remove:vn}),attrs:z({get:Vl,set:pu,remove:Ar,copyTo:Cn}),insert:z({before:pt,after:ln,afterAll:Wr,append:Eo,appendAll:ai,prepend:nn,wrap:er}),remove:z({unwrap:Gd,remove:gi}),create:z({nu:No.fromTag,clone:$,text:No.fromText}),query:z({comparePosition:Ft,prevSibling:cs,nextSibling:_r}),property:z({children:Ir,name:an,parent:ts,document:G,isText:At,isComment:$e,isElement:Je,isSpecial:Bn,getLanguage:Uo,getText:vd,setText:Lg,isBoundary:ve,isEmptyTag:Te,isNonEditable:at}),eq:gs,is:va}};const ju=($,G,ve,Te)=>{const at=ve[0],Ft=ve.slice(1);return Te($,G,at,Ft)},oi=($,G,ve)=>ve.length>0?ju($,G,ve,_u):J.none(),_u=($,G,ve,Te)=>{const at=G($,ve);return xo(Te,(Ft,Cn)=>{const Bn=G($,Cn);return ic($,Ft,Bn)},at)},ic=($,G,ve)=>G.bind(Te=>ve.filter(F($.eq,Te))),Wh=oi,F1=Aa(),Kd=($,G)=>Wh(F1,(ve,Te)=>$(Te),G),Fg=$=>Yr($,"table"),Yd=($,G)=>{const ve=gr($,G);return ve.length>0?J.some(ve):J.none()},jl=($,G,ve)=>Wo($,G).bind(Te=>Wo($,ve).bind(at=>Kd(Fg,[Te,at]).map(Ft=>({first:Te,last:at,table:Ft})))),jh=($,G)=>Yd($,G),H1=($,G,ve)=>jl($,G,ve).bind(Te=>{const at=Uo=>gs($,Uo),Ft="thead,tfoot,tbody,table",Cn=Yr(Te.first,Ft,at),Bn=Yr(Te.last,Ft,at);return Cn.bind(Uo=>Bn.bind(Jo=>gs(Uo,Jo)?L1(Te.table,Te.first,Te.last):J.none()))}),Lm=$=>xt($,No.fromDom),Hg="data-mce-selected",Zh="td["+Hg+"],th["+Hg+"]",Xd="data-mce-first-selected",yd="td["+Xd+"],th["+Xd+"]",si="data-mce-last-selected",li="td["+si+"],th["+si+"]",Bl={selected:Hg,selectedSelector:Zh,firstSelected:Xd,firstSelectedSelector:yd,lastSelected:si,lastSelectedSelector:li},Lp=$=>Ln($).bind(G=>jh(G,Bl.firstSelectedSelector)).fold(z($),G=>G[0]),X=$=>(G,ve)=>{const Te=an(G),at=Te==="col"||Te==="colgroup"?Lp(G):G;return Di(at,$,ve)},le=X("th,td,caption"),Se=X("th,td"),Ye=$=>Lm($.model.table.getSelectedCells()),rt=($,G)=>{const ve=Se($),Te=ve.bind(at=>Ln(at)).map(at=>Xo(at));return La(ve,Te,(at,Ft)=>ao(Ft,Cn=>xn(Lm(Cn.dom.cells),Bn=>Vl(Bn,G)==="1"||gs(Bn,at)))).getOr([])},On=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],wn=$=>({value:Sr($)}),Go=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ns=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,uo=$=>Go.test($)||ns.test($),Sr=$=>Fa($,"#").toUpperCase(),Zl=$=>uo($)?J.some({value:Sr($)}):J.none(),ra=$=>{const G=$.toString(16);return(G.length===1?"0"+G:G).toUpperCase()},Mi=$=>{const G=ra($.red)+ra($.green)+ra($.blue);return wn(G)},Cu=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Ta=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,qh=($,G,ve,Te)=>({red:$,green:G,blue:ve,alpha:Te}),Fm=($,G,ve,Te)=>{const at=parseInt($,10),Ft=parseInt(G,10),Cn=parseInt(ve,10),Bn=parseFloat(Te);return qh(at,Ft,Cn,Bn)},$i=$=>{if($==="transparent")return J.some(qh(0,0,0,0));const G=Cu.exec($);if(G!==null)return J.some(Fm(G[1],G[2],G[3],"1"));const ve=Ta.exec($);return ve!==null?J.some(Fm(ve[1],ve[2],ve[3],ve[4])):J.none()},wa=$=>Zl($).orThunk(()=>$i($).map(Mi)).getOrThunk(()=>{const G=document.createElement("canvas");G.height=1,G.width=1;const ve=G.getContext("2d");ve.clearRect(0,0,G.width,G.height),ve.fillStyle="#FFFFFF",ve.fillStyle=$,ve.fillRect(0,0,1,1);const Te=ve.getImageData(0,0,1,1).data,at=Te[0],Ft=Te[1],Cn=Te[2],Bn=Te[3];return Mi(qh(at,Ft,Cn,Bn))}),Yc=$=>$i($).map(Mi).map(G=>"#"+G.value).getOr($),Jd=$=>{let G=$;return{get:()=>G,set:at=>{G=at}}},Qi=$=>{const G=Jd(J.none()),ve=()=>G.get().each($);return{clear:()=>{ve(),G.set(J.none())},isSet:()=>G.get().isSome(),get:()=>G.get(),set:Bn=>{ve(),G.set(J.some(Bn))}}},j0=()=>Qi($=>$.unbind()),vv=($,G,ve)=>Te=>{const at=j0(),Ft=vu(ve),Cn=()=>{const Bn=Ye($),Uo=Jo=>$.formatter.match(G,{value:ve},Jo.dom,Ft);Ft?(Te.setActive(!xn(Bn,Uo)),at.set($.formatter.formatChanged(G,Jo=>Te.setActive(!Jo),!0))):(Te.setActive(Ut(Bn,Uo)),at.set($.formatter.formatChanged(G,Te.setActive,!1,{value:ve})))};return $.initialized?Cn():$.on("init",Cn),at.clear},Jr=$=>Ot($,"menu"),wd=$=>xt($,G=>{const ve=G.text||G.title||"";return Jr(G)?{text:ve,items:wd(G.menu)}:{text:ve,value:G.value}}),pr=($,G,ve,Te)=>xt(G,at=>{const Ft=at.text||at.title;return Jr(at)?{type:"nestedmenuitem",text:Ft,getSubmenuItems:()=>pr($,at.menu,ve,Te)}:{text:Ft,type:"togglemenuitem",onAction:()=>Te(at.value),onSetup:vv($,ve,at.value)}}),ql=($,G)=>ve=>{$.execCommand("mceTableApplyCellStyle",!1,{[G]:ve})},Wf=$=>Pe($,G=>Jr(G)?[{...G,menu:Wf(G.menu)}]:Lf(G.value)?[G]:[]),Qd=($,G,ve,Te)=>at=>at(pr($,G,ve,Te)),xe=($,G,ve)=>{const Te=xt(G,at=>({text:at.title,value:"#"+wa(at.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:Te.length>0?Te:void 0,allowCustomColors:!1},onAction:at=>{const Ft=at.value==="remove"?"":at.value;$.execCommand("mceTableApplyCellStyle",!1,{[ve]:Ft})}}]},Cf=$=>()=>{const ve=$.queryCommandValue("mceTableRowType")==="header"?"body":"header";$.execCommand("mceTableRowType",!1,{type:ve})},$g=$=>()=>{const ve=$.queryCommandValue("mceTableColType")==="th"?"td":"th";$.execCommand("mceTableColType",!1,{type:ve})},Su=$=>{const G=wd($h($));return G.length>0?J.some({name:"class",type:"listbox",label:"Class",items:G}):J.none()},ci=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:On}],yv=$=>ci.concat(Su($).toArray()),$1=($,G)=>{const Te=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(wd(Zd($)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:G==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(Te):Te}},jf={normal:($,G)=>{const ve=$.dom;return{setAttrib:(Cn,Bn)=>{ve.setAttrib(G,Cn,Bn)},setStyle:(Cn,Bn)=>{ve.setStyle(G,Cn,Bn)},setFormat:(Cn,Bn)=>{Bn===""?$.formatter.remove(Cn,{value:null},G,!0):$.formatter.apply(Cn,{value:Bn},G)}}}},Hm=lo("th"),zg=($,G)=>$&&G?"sectionCells":$?"section":"cells",wv=$=>{const G=$.section==="thead",ve=pf(Sf($.cells),"th");return $.section==="tfoot"?{type:"footer"}:G||ve?{type:"header",subType:zg(G,ve)}:{type:"body"}},Sf=$=>{const G=ao($,ve=>Hm(ve.element));return G.length===0?J.some("td"):G.length===$.length?J.some("th"):J.none()},h2=$=>{const G=xt($,at=>wv(at).type),ve=kt(G,"header"),Te=kt(G,"footer");if(!ve&&!Te)return J.some("body");{const at=kt(G,"body");return ve&&!at&&!Te?J.some("header"):!ve&&!at&&Te?J.some("footer"):J.none()}},ku=$=>{let G=!1,ve;return(...Te)=>(G||(G=!0,ve=$.apply(null,Te)),ve)},Zu=($,G)=>rs($.all,ve=>Jt(ve.cells,Te=>gs(G,Te.element))),q0=($,G,ve)=>{const Te=xt(G.selection,Ft=>Me(Ft).bind(Cn=>Zu($,Cn)).filter(ve)),at=Cr(Te);return Yi(at.length>0,at)},G0=($,G)=>G.mergable,K0=($,G)=>G.unmergable,z1=($,G)=>q0($,G,re),Zf=($,G)=>Zu($,G).exists(ve=>!ve.isLocked),Y0=($,G)=>Ut(G,ve=>Zf($,ve)),X0=($,G)=>G0($,G).filter(ve=>Y0($,ve.cells)),dl=($,G)=>K0($,G).filter(ve=>Y0($,ve));({...{generate:$=>{if(!h($))throw new Error("cases must be an array");if($.length===0)throw new Error("there must be at least one case");const G=[],ve={};return he($,(Te,at)=>{const Ft=we(Te);if(Ft.length!==1)throw new Error("one and only one name per case");const Cn=Ft[0],Bn=Te[Cn];if(ve[Cn]!==void 0)throw new Error("duplicate key detected:"+Cn);if(Cn==="cata")throw new Error("cannot have a case named cata (sorry)");if(!h(Bn))throw new Error("case arguments must be an array");G.push(Cn),ve[Cn]=(...Uo)=>{const Jo=Uo.length;if(Jo!==Bn.length)throw new Error("Wrong number of arguments to case "+Cn+". Expected "+Bn.length+" ("+Bn+"), got "+Jo);return{fold:(...tr)=>{if(tr.length!==$.length)throw new Error("Wrong number of arguments to fold. Expected "+$.length+", got "+tr.length);return tr[at].apply(null,Uo)},match:tr=>{const br=we(tr);if(G.length!==br.length)throw new Error("Wrong number of arguments to match. Expected: "+G.join(",")+`
Actual: `+br.join(","));if(!Ut(G,Qc=>kt(br,Qc)))throw new Error("Not all branches were specified when using match. Specified: "+br.join(", ")+`
Required: `+G.join(", "));return tr[Cn].apply(null,Uo)},log:tr=>{console.log(tr,{constructors:G,constructor:Cn,params:Uo})}}}}),ve}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const Xn=($,G)=>{const ve=zu.fromTable($);return z1(ve,G).bind(at=>{const Ft=at[at.length-1],Cn=at[0].row,Bn=Ft.row+Ft.rowspan,Uo=ve.all.slice(Cn,Bn);return h2(Uo)}).getOr("")},wc=$=>Mc($,"rgb")?Yc($):$,kf=$=>{const G=No.fromDom($);return{borderwidth:Pt(G,"border-width").getOr(""),borderstyle:Pt(G,"border-style").getOr(""),bordercolor:Pt(G,"border-color").map(wc).getOr(""),backgroundcolor:Pt(G,"background-color").map(wc).getOr("")}},eh=$=>{const G=$[0],ve=$.slice(1);return he(ve,Te=>{he(we(G),at=>{De(Te,(Ft,Cn)=>{const Bn=G[at];Bn!==""&&at===Cn&&Bn!==Ft&&(G[at]="")})})}),G},Pc=($,G,ve,Te)=>Jt($,at=>!y(ve.formatter.matchNode(Te,G+at))).getOr(""),Vg=F(Pc,["left","center","right"],"align"),Cd=F(Pc,["top","middle","bottom"],"valign"),hl=($,G)=>{const ve=Uf($),Te=Wl($),at=()=>({borderstyle:mt(ve,"border-style").getOr(""),bordercolor:wc(mt(ve,"border-color").getOr("")),backgroundcolor:wc(mt(ve,"background-color").getOr(""))}),Ft={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},Cn=()=>{const bi=ve["border-width"];return wf($)&&bi?{border:bi}:mt(Te,"border").fold(()=>({}),tr=>({border:tr}))},Bn=G?at():{},Uo=()=>{const bi=mt(ve,"border-spacing").or(mt(Te,"cellspacing")).fold(()=>({}),br=>({cellspacing:br})),tr=mt(ve,"border-padding").or(mt(Te,"cellpadding")).fold(()=>({}),br=>({cellpadding:br}));return{...bi,...tr}};return{...Ft,...ve,...Te,...Bn,...Cn(),...Uo()}},Eu=$=>Ln(No.fromDom($)).map(G=>{const ve={selection:Lm($.cells)};return Xn(G,ve)}).getOr(""),Fp=($,G,ve)=>{const Te=(Bn,Uo)=>{const Jo=Pt(No.fromDom(Uo),"border-width");return wf($)&&Jo.isSome()?Jo.getOr(""):Bn.getAttrib(Uo,"border")||vc($.dom,Uo,"border-width")||vc($.dom,Uo,"border")||""},at=$.dom,Ft=wf($)?at.getStyle(G,"border-spacing")||at.getAttrib(G,"cellspacing"):at.getAttrib(G,"cellspacing")||at.getStyle(G,"border-spacing"),Cn=wf($)?vc(at,G,"padding")||at.getAttrib(G,"cellpadding"):at.getAttrib(G,"cellpadding")||vc(at,G,"padding");return{width:at.getStyle(G,"width")||at.getAttrib(G,"width"),height:at.getStyle(G,"height")||at.getAttrib(G,"height"),cellspacing:Ft!=null?Ft:"",cellpadding:Cn!=null?Cn:"",border:Te(at,G),caption:!!at.select("caption",G)[0],class:at.getAttrib(G,"class",""),align:Vg($,G),...ve?kf(G):{}}},V1=($,G,ve)=>{const Te=$.dom;return{height:Te.getStyle(G,"height")||Te.getAttrib(G,"height"),class:Te.getAttrib(G,"class",""),type:Eu(G),align:Vg($,G),...ve?kf(G):{}}},_n=($,G,ve,Te)=>{const at=$.dom,Ft=Te.getOr(G),Cn=(Bn,Uo)=>at.getStyle(Bn,Uo)||at.getAttrib(Bn,Uo);return{width:Cn(Ft,"width"),height:Cn(G,"height"),scope:at.getAttrib(G,"scope"),celltype:Dc(G),class:at.getAttrib(G,"class",""),halign:Vg($,G),valign:Cd($,G),...ve?kf(G):{}}},$m=($,G)=>{const ve=zu.fromTable($),Te=zu.justCells(ve),at=ao(Te,Ft=>xn(G,Cn=>gs(Ft.element,Cn)));return xt(at,Ft=>({element:Ft.element.dom,column:zu.getColumnAt(ve,Ft.column).map(Cn=>Cn.element.dom)}))},Sd=($,G,ve,Te)=>{Te("scope")&&$.setAttrib("scope",ve.scope),Te("class")&&$.setAttrib("class",ve.class),Te("height")&&$.setStyle("height",Qs(ve.height)),Te("width")&&G.setStyle("width",Qs(ve.width))},th=($,G,ve)=>{ve("backgroundcolor")&&$.setFormat("tablecellbackgroundcolor",G.backgroundcolor),ve("bordercolor")&&$.setFormat("tablecellbordercolor",G.bordercolor),ve("borderstyle")&&$.setFormat("tablecellborderstyle",G.borderstyle),ve("borderwidth")&&$.setFormat("tablecellborderwidth",Qs(G.borderwidth))},qu=($,G,ve,Te)=>{const at=G.length===1;he(G,Ft=>{const Cn=Ft.element,Bn=at?re:Te,Uo=jf.normal($,Cn),Jo=Ft.column.map(bi=>jf.normal($,bi)).getOr(Uo);Sd(Uo,Jo,ve,Bn),Pg($)&&th(Uo,ve,Bn),Te("halign")&&$f($,Cn,ve.halign),Te("valign")&&jd($,Cn,ve.valign)})},U1=($,G)=>{$.execCommand("mceTableCellType",!1,{type:G.celltype,no_events:!0})},ui=($,G,ve,Te)=>{const at=tt(Te,(Ft,Cn)=>ve[Cn]!==Ft);V(at)>0&&G.length>=1&&Ln(G[0]).each(Ft=>{const Cn=$m(Ft,G),Bn=V(tt(at,(Jo,bi)=>bi!=="scope"&&bi!=="celltype"))>0,Uo=nt(at,"celltype");(Bn||nt(at,"scope"))&&qu($,Cn,Te,F(nt,at)),Uo&&U1($,Te),Xr($,Ft.dom,{structure:Uo,style:Bn})})},zi=($,G,ve,Te)=>{const at=Te.getData();Te.close(),$.undoManager.transact(()=>{ui($,G,ve,at),$.focus()})},ha=($,G)=>{const ve=Ln(G[0]).map(Te=>xt($m(Te,G),at=>_n($,at.element,Pg($),at.column)));return eh(ve.getOrDie())},xs=$=>{const G=Ye($);if(G.length===0)return;const ve=ha($,G),Te={type:"tabpanel",tabs:[{title:"General",name:"general",items:yv($)},$1($,"cell")]},at={type:"panel",items:[{type:"grid",columns:2,items:yv($)}]};$.windowManager.open({title:"Cell Properties",size:"normal",body:Pg($)?Te:at,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ve,onSubmit:F(zi,$,G,ve)})},kd=$=>{const G=wd(Wu($));return G.length>0?J.some({name:"class",type:"listbox",label:"Class",items:G}):J.none()},Cl=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Gu=$=>Cl.concat(kd($).toArray()),za=($,G,ve)=>{ve("class")&&$.setAttrib("class",G.class),ve("height")&&$.setStyle("height",Qs(G.height))},_a=($,G,ve)=>{ve("backgroundcolor")&&$.setStyle("background-color",G.backgroundcolor),ve("bordercolor")&&$.setStyle("border-color",G.bordercolor),ve("borderstyle")&&$.setStyle("border-style",G.borderstyle)},Hp=($,G,ve,Te)=>{const Ft=G.length===1?re:Te;he(G,Cn=>{const Bn=jf.normal($,Cn);za(Bn,ve,Ft),Pm($)&&_a(Bn,ve,Ft),Te("align")&&$f($,Cn,ve.align)})},Qt=($,G)=>{$.execCommand("mceTableRowType",!1,{type:G.type,no_events:!0})},Gr=($,G,ve,Te)=>{const at=tt(Te,(Ft,Cn)=>ve[Cn]!==Ft);if(V(at)>0){const Ft=nt(at,"type"),Cn=Ft?V(at)>1:!0;Cn&&Hp($,G,Te,F(nt,at)),Ft&&Qt($,Te),Ln(No.fromDom(G[0])).each(Bn=>Xr($,Bn.dom,{structure:Ft,style:Cn}))}},J0=($,G,ve,Te)=>{const at=Te.getData();Te.close(),$.undoManager.transact(()=>{Gr($,G,ve,at),$.focus()})},Ca=$=>{const G=rt(xr($),Bl.selected);if(G.length===0)return;const ve=xt(G,Cn=>V1($,Cn.dom,Pm($))),Te=eh(ve),at={type:"tabpanel",tabs:[{title:"General",name:"general",items:Gu($)},$1($,"row")]},Ft={type:"panel",items:[{type:"grid",columns:2,items:Gu($)}]};$.windowManager.open({title:"Row Properties",size:"normal",body:Pm($)?at:Ft,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Te,onSubmit:F(J0,$,xt(G,Cn=>Cn.dom),Te)})},Va=($,G,ve)=>{const Te=ve?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],at=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],Ft=Im($)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],Cn=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],Bn=G.length>0?[{type:"listbox",name:"class",label:"Class",items:G}]:[];return Te.concat(at).concat(Ft).concat(Cn).concat(Bn)},Ug=($,G,ve,Te)=>{if(G.tagName==="TD"||G.tagName==="TH")f(ve)&&A(Te)?$.setStyle(G,ve,Te):$.setStyles(G,ve);else if(G.children)for(let at=0;at<G.children.length;at++)Ug($,G.children[at],ve,Te)},Ic=($,G,ve,Te)=>{const at=$.dom,Ft={},Cn={},Bn=wf($),Uo=Il($);if(y(ve.class)||(Ft.class=ve.class),Cn.height=Qs(ve.height),Bn?Cn.width=Qs(ve.width):at.getAttrib(G,"width")&&(Ft.width=fa(ve.width)),Bn?(Cn["border-width"]=Qs(ve.border),Cn["border-spacing"]=Qs(ve.cellspacing)):(Ft.border=ve.border,Ft.cellpadding=ve.cellpadding,Ft.cellspacing=ve.cellspacing),Bn&&G.children){const Jo={};if(Te.border&&(Jo["border-width"]=Qs(ve.border)),Te.cellpadding&&(Jo.padding=Qs(ve.cellpadding)),Uo&&Te.bordercolor&&(Jo["border-color"]=ve.bordercolor),!Tt(Jo))for(let bi=0;bi<G.children.length;bi++)Ug(at,G.children[bi],Jo)}if(Uo){const Jo=ve;Cn["background-color"]=Jo.backgroundcolor,Cn["border-color"]=Jo.bordercolor,Cn["border-style"]=Jo.borderstyle}at.setStyles(G,{...Uf($),...Cn}),at.setAttribs(G,{...Wl($),...Ft})},qf=($,G,ve,Te)=>{const at=$.dom,Ft=Te.getData(),Cn=tt(Ft,(Bn,Uo)=>ve[Uo]!==Bn);Te.close(),Ft.class===""&&delete Ft.class,$.undoManager.transact(()=>{if(!G){const Bn=Ul(Ft.cols).getOr(1),Uo=Ul(Ft.rows).getOr(1);$.execCommand("mceInsertTable",!1,{rows:Uo,columns:Bn}),G=Se(xr($),Xa($)).bind(Jo=>Ln(Jo,Xa($))).map(Jo=>Jo.dom).getOrDie()}if(V(Cn)>0){const Bn={border:nt(Cn,"border"),bordercolor:nt(Cn,"bordercolor"),cellpadding:nt(Cn,"cellpadding")};Ic($,G,Ft,Bn);const Uo=at.select("caption",G)[0];(Uo&&!Ft.caption||!Uo&&Ft.caption)&&$.execCommand("mceTableToggleCaption"),$f($,G,Ft.align)}if($.focus(),$.addVisual(),V(Cn)>0){const Bn=nt(Cn,"caption"),Uo=Bn?V(Cn)>1:!0;Xr($,G,{structure:Bn,style:Uo})}})},Gf=($,G)=>{const ve=$.dom;let Te,at=hl($,Il($));G?(at.cols="1",at.rows="1",Il($)&&(at.borderstyle="",at.bordercolor="",at.backgroundcolor="")):(Te=ve.getParent($.selection.getStart(),"table",$.getBody()),Te?at=Fp($,Te,Il($)):Il($)&&(at.borderstyle="",at.bordercolor="",at.backgroundcolor=""));const Ft=wd(zh($));Ft.length>0&&at.class&&(at.class=at.class.replace(/\s*mce\-item\-table\s*/g,""));const Cn={type:"grid",columns:2,items:Va($,Ft,G)},Bn=()=>({type:"panel",items:[Cn]}),Uo=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[Cn]},$1($,"table")]}),Jo=Il($)?Uo():Bn();$.windowManager.open({title:"Table Properties",size:"normal",body:Jo,onSubmit:F(qf,$,Te,at),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:at})},$p=$=>{const G=ve=>{fl(xr($))&&ve()};De({mceTableProps:F(Gf,$,!1),mceTableRowProps:F(Ca,$),mceTableCellProps:F(xs,$),mceInsertTableDialog:F(Gf,$,!0)},(ve,Te)=>$.addCommand(Te,()=>G(ve)))},Ll=($,G)=>it($,G).isSome(),kr=q,Ua=$=>{const G=(Te,at)=>xa(Te,at).exists(Ft=>parseInt(Ft,10)>1),ve=Te=>G(Te,"rowspan")||G(Te,"colspan");return $.length>0&&Ut($,ve)?J.some($):J.none()},nh=($,G,ve)=>G.length<=1?J.none():H1($,ve.firstSelectedSelector,ve.lastSelectedSelector).map(Te=>({bounds:Te,cells:G})),Gl=$=>({element:$,mergable:J.none(),unmergable:J.none(),selection:[$]}),Q0=($,G,ve)=>({element:ve,mergable:nh(G,$,Bl),unmergable:Ua($),selection:kr($)}),zm=$=>{const G=Jd(J.none()),ve=Jd([]);let Te=J.none();const at=lo("caption"),Ft=Os=>Te.forall(Br=>!Br[Os]),Cn=()=>le(xr($),Xa($)),Bn=()=>le(Ki($),Xa($)),Uo=()=>Cn().bind(Os=>sa(La(Ln(Os),Bn().bind(Ln),(Br,Da)=>gs(Br,Da)?at(Os)?J.some(Gl(Os)):J.some(Q0(Ye($),Br,Os)):J.none()))),Jo=Os=>Ln(Os.element).map(Da=>{const cc=zu.fromTable(Da),j1=z1(cc,Os).getOr([]),Sl=Yo(j1,(Gi,tu)=>(tu.isLocked&&(Gi.onAny=!0,tu.column===0?Gi.onFirst=!0:tu.column+tu.colspan>=cc.grid.columns&&(Gi.onLast=!0)),Gi),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:X0(cc,Os).isSome(),unmergeable:dl(cc,Os).isSome(),locked:Sl}}),bi=()=>{G.set(ku(Uo)()),Te=G.get().bind(Jo),he(ve.get(),ne)},tr=Os=>(Os(),ve.set(ve.get().concat([Os])),()=>{ve.set(ao(ve.get(),Br=>Br!==Os))}),br=(Os,Br)=>tr(()=>G.get().fold(()=>{Os.setEnabled(!1)},Da=>{Os.setEnabled(!Br(Da)&&$.selection.isEditable())})),Bc=(Os,Br,Da)=>tr(()=>G.get().fold(()=>{Os.setEnabled(!1),Os.setActive(!1)},cc=>{Os.setEnabled(!Br(cc)&&$.selection.isEditable()),Os.setActive(Da(cc))})),Qc=Os=>Te.exists(Br=>Br.locked[Os]),Ku=Os=>br(Os,Br=>!1),Ef=Os=>br(Os,Br=>at(Br.element)),oh=Os=>Br=>br(Br,Da=>at(Da.element)||Qc(Os)),sh=Os=>Br=>br(Br,Da=>at(Da.element)||Os().isNone()),lr=(Os,Br)=>Da=>br(Da,cc=>at(cc.element)||Os().isNone()||Qc(Br)),Um=Os=>br(Os,Br=>Ft("mergeable")),Wm=Os=>br(Os,Br=>Ft("unmergeable")),ea=Os=>Bc(Os,oe,Br=>Ln(Br.element,Xa($)).exists(cc=>Ll(cc,"caption"))),eu=(Os,Br)=>Da=>Bc(Da,cc=>at(cc.element),()=>$.queryCommandValue(Os)===Br),zp=eu("mceTableRowType","header"),jm=eu("mceTableColType","th");return $.on("NodeChange ExecCommand TableSelectorChange",bi),{onSetupTable:Ku,onSetupCellOrRow:Ef,onSetupColumn:oh,onSetupPasteable:sh,onSetupPasteableColumn:lr,onSetupMergeable:Um,onSetupUnmergeable:Wm,resetTargets:bi,onSetupTableWithCaption:ea,onSetupTableRowHeaders:zp,onSetupTableColumnHeaders:jm,targets:G.get}};var W1=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Wa="x-tinymce/dom-table-",ac=Wa+"rows",St=Wa+"columns",_c=$=>{var G;const ve=(G=W1.read())!==null&&G!==void 0?G:[];return rs(ve,Te=>J.from(Te.getType($)))},Xc=()=>_c(ac),lc=()=>_c(St),xu=$=>G=>{const ve=()=>{G.setEnabled($.selection.isEditable())};return $.on("NodeChange",ve),ve(),()=>{$.off("NodeChange",ve)}},ja=($,G)=>{$.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:xu($),fetch:Bn=>Bn("inserttable | cell row column | advtablesort | tableprops deletetable")});const ve=Bn=>()=>$.execCommand(Bn),Te=(Bn,Uo)=>{$.queryCommandSupported(Uo.command)&&$.ui.registry.addButton(Bn,{...Uo,onAction:O(Uo.onAction)?Uo.onAction:ve(Uo.command)})},at=(Bn,Uo)=>{$.queryCommandSupported(Uo.command)&&$.ui.registry.addToggleButton(Bn,{...Uo,onAction:O(Uo.onAction)?Uo.onAction:ve(Uo.command)})};Te("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:G.onSetupTable}),Te("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:G.onSetupTable}),Te("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:G.onSetupCellOrRow}),Te("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:G.onSetupMergeable}),Te("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:G.onSetupUnmergeable}),Te("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:G.onSetupCellOrRow}),Te("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:G.onSetupCellOrRow}),Te("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:G.onSetupCellOrRow}),Te("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:G.onSetupCellOrRow}),Te("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:G.onSetupColumn("onFirst")}),Te("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:G.onSetupColumn("onLast")}),Te("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:G.onSetupColumn("onAny")}),Te("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:G.onSetupCellOrRow}),Te("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:G.onSetupCellOrRow}),Te("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:G.onSetupPasteable(Xc)}),Te("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:G.onSetupPasteable(Xc)}),Te("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:G.onSetupColumn("onAny")}),Te("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:G.onSetupColumn("onAny")}),Te("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:G.onSetupPasteableColumn(lc,"onFirst")}),Te("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:G.onSetupPasteableColumn(lc,"onLast")}),Te("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:xu($)});const Ft=Wf(zh($));Ft.length!==0&&$.queryCommandSupported("mceTableToggleClass")&&$.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Qd($,Ft,"tableclass",Bn=>$.execCommand("mceTableToggleClass",!1,Bn)),onSetup:G.onSetupTable});const Cn=Wf($h($));Cn.length!==0&&$.queryCommandSupported("mceTableCellToggleClass")&&$.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Qd($,Cn,"tablecellclass",Bn=>$.execCommand("mceTableCellToggleClass",!1,Bn)),onSetup:G.onSetupCellOrRow}),$.queryCommandSupported("mceTableApplyCellStyle")&&($.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Qd($,On,"tablecellverticalalign",ql($,"vertical-align")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Qd($,Vf($),"tablecellborderwidth",ql($,"border-width")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Qd($,Zd($),"tablecellborderstyle",ql($,"border-style")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:Bn=>Bn(xe($,Vh($),"background-color")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:Bn=>Bn(xe($,_f($),"border-color")),onSetup:G.onSetupCellOrRow})),at("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:G.onSetupTableWithCaption}),at("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Cf($),onSetup:G.onSetupTableRowHeaders}),at("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:$g($),onSetup:G.onSetupTableColumnHeaders})},Za=$=>{const G=Te=>$.dom.is(Te,"table")&&$.getBody().contains(Te)&&$.dom.isEditable(Te.parentNode),ve=Nc($);ve.length>0&&$.ui.registry.addContextToolbar("table",{predicate:G,items:ve,scope:"node",position:"node"})},Vm=$=>G=>{const ve=()=>{G.setEnabled($.selection.isEditable())};return $.on("NodeChange",ve),ve(),()=>{$.off("NodeChange",ve)}},Jc=($,G)=>{const ve=tr=>()=>$.execCommand(tr),Te=(tr,br)=>$.queryCommandSupported(br.command)?($.ui.registry.addMenuItem(tr,{...br,onAction:O(br.onAction)?br.onAction:ve(br.command)}),!0):!1,at=(tr,br)=>{$.queryCommandSupported(br.command)&&$.ui.registry.addToggleMenuItem(tr,{...br,onAction:O(br.onAction)?br.onAction:ve(br.command)})},Ft=tr=>{$.execCommand("mceInsertTable",!1,{rows:tr.numRows,columns:tr.numColumns})},Cn=[Te("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:G.onSetupCellOrRow}),Te("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:G.onSetupCellOrRow}),Te("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:G.onSetupCellOrRow}),Te("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:G.onSetupCellOrRow}),Te("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:G.onSetupCellOrRow}),Te("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:G.onSetupCellOrRow}),Te("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:G.onSetupPasteable(Xc)}),Te("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:G.onSetupPasteable(Xc)})],Bn=[Te("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:G.onSetupColumn("onFirst")}),Te("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:G.onSetupColumn("onLast")}),Te("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:G.onSetupColumn("onAny")}),Te("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:G.onSetupColumn("onAny")}),Te("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:G.onSetupColumn("onAny")}),Te("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:G.onSetupPasteableColumn(lc,"onFirst")}),Te("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:G.onSetupPasteableColumn(lc,"onLast")})],Uo=[Te("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:G.onSetupCellOrRow}),Te("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:G.onSetupMergeable}),Te("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:G.onSetupUnmergeable})];el($)?$.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:Ft}],onSetup:Vm($)}):$.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:ve("mceInsertTableDialog"),onSetup:Vm($)}),$.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:ve("mceInsertTableDialog"),onSetup:Vm($)}),Te("tableprops",{text:"Table properties",onSetup:G.onSetupTable,command:"mceTableProps"}),Te("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:G.onSetupTable,command:"mceTableDelete"}),kt(Cn,!0)&&$.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:z("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),kt(Bn,!0)&&$.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:z("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),kt(Uo,!0)&&$.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:z("tablecellprops tablemergecells tablesplitcells")}),$.ui.registry.addContextMenu("table",{update:()=>(G.resetTargets(),G.targets().fold(z(""),tr=>an(tr.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const Jo=Wf(zh($));Jo.length!==0&&$.queryCommandSupported("mceTableToggleClass")&&$.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>pr($,Jo,"tableclass",tr=>$.execCommand("mceTableToggleClass",!1,tr)),onSetup:G.onSetupTable});const bi=Wf($h($));bi.length!==0&&$.queryCommandSupported("mceTableCellToggleClass")&&$.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>pr($,bi,"tablecellclass",tr=>$.execCommand("mceTableCellToggleClass",!1,tr)),onSetup:G.onSetupCellOrRow}),$.queryCommandSupported("mceTableApplyCellStyle")&&($.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>pr($,On,"tablecellverticalalign",ql($,"vertical-align")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>pr($,Vf($),"tablecellborderwidth",ql($,"border-width")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>pr($,Zd($),"tablecellborderstyle",ql($,"border-style")),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>xe($,Vh($),"background-color"),onSetup:G.onSetupCellOrRow}),$.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>xe($,_f($),"border-color"),onSetup:G.onSetupCellOrRow})),at("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:G.onSetupTableWithCaption}),at("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Cf($),onSetup:G.onSetupTableRowHeaders}),at("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:$g($),onSetup:G.onSetupTableRowHeaders})},eb=$=>{const G=zm($);Hi($),$p($),Jc($,G),ja($,G),Za($)};var Ho=()=>{s.add("table",eb)};Ho()})();(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=V=>V==null,t=V=>!e(V),r=()=>{},a=V=>()=>V;class u{constructor(mt,nt){this.tag=mt,this.value=nt}static some(mt){return new u(!0,mt)}static none(){return u.singletonNone}fold(mt,nt){return this.tag?nt(this.value):mt()}isSome(){return this.tag}isNone(){return!this.tag}map(mt){return this.tag?u.some(mt(this.value)):u.none()}bind(mt){return this.tag?mt(this.value):u.none()}exists(mt){return this.tag&&mt(this.value)}forall(mt){return!this.tag||mt(this.value)}filter(mt){return!this.tag||mt(this.value)?this:u.none()}getOr(mt){return this.tag?this.value:mt}or(mt){return this.tag?this:mt}getOrThunk(mt){return this.tag?this.value:mt()}orThunk(mt){return this.tag?this:mt()}getOrDie(mt){if(this.tag)return this.value;throw new Error(mt!=null?mt:"Called getOrDie on None")}static from(mt){return t(mt)?u.some(mt):u.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(mt){this.tag&&mt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}u.singletonNone=new u(!1);const f=(V,mt)=>mt>=0&&mt<V.length?u.some(V[mt]):u.none(),h=V=>f(V,0);var g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");const y=typeof window<"u"?window:Function("return this;")(),C=function(V,mt,nt){const Ot=window.Prism;window.Prism={manual:!0};var Tt=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},He=function(ct){var dn=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,kt=0,xn={},We={manual:ct.Prism&&ct.Prism.manual,disableWorkerMessageHandler:ct.Prism&&ct.Prism.disableWorkerMessageHandler,util:{encode:function Pe(Ut){return Ut instanceof xt?new xt(Ut.type,Pe(Ut.content),Ut.alias):Array.isArray(Ut)?Ut.map(Pe):Ut.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(Pe){return Object.prototype.toString.call(Pe).slice(8,-1)},objId:function(Pe){return Pe.__id||Object.defineProperty(Pe,"__id",{value:++kt}),Pe.__id},clone:function Pe(Ut,gn){gn=gn||{};var yt,Yt;switch(We.util.type(Ut)){case"Object":if(Yt=We.util.objId(Ut),gn[Yt])return gn[Yt];yt={},gn[Yt]=yt;for(var bn in Ut)Ut.hasOwnProperty(bn)&&(yt[bn]=Pe(Ut[bn],gn));return yt;case"Array":return Yt=We.util.objId(Ut),gn[Yt]?gn[Yt]:(yt=[],gn[Yt]=yt,Ut.forEach(function(rs,Jn){yt[Jn]=Pe(rs,gn)}),yt);default:return Ut}},getLanguage:function(Pe){for(;Pe;){var Ut=dn.exec(Pe.className);if(Ut)return Ut[1].toLowerCase();Pe=Pe.parentElement}return"none"},setLanguage:function(Pe,Ut){Pe.className=Pe.className.replace(RegExp(dn,"gi"),""),Pe.classList.add("language-"+Ut)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(yt){var Pe=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(yt.stack)||[])[1];if(Pe){var Ut=document.getElementsByTagName("script");for(var gn in Ut)if(Ut[gn].src==Pe)return Ut[gn]}return null}},isActive:function(Pe,Ut,gn){for(var yt="no-"+Ut;Pe;){var Yt=Pe.classList;if(Yt.contains(Ut))return!0;if(Yt.contains(yt))return!1;Pe=Pe.parentElement}return!!gn}},languages:{plain:xn,plaintext:xn,text:xn,txt:xn,extend:function(Pe,Ut){var gn=We.util.clone(We.languages[Pe]);for(var yt in Ut)gn[yt]=Ut[yt];return gn},insertBefore:function(Pe,Ut,gn,yt){yt=yt||We.languages;var Yt=yt[Pe],bn={};for(var rs in Yt)if(Yt.hasOwnProperty(rs)){if(rs==Ut)for(var Jn in gn)gn.hasOwnProperty(Jn)&&(bn[Jn]=gn[Jn]);gn.hasOwnProperty(rs)||(bn[rs]=Yt[rs])}var ds=yt[Pe];return yt[Pe]=bn,We.languages.DFS(We.languages,function(Or,Ns){Ns===ds&&Or!=Pe&&(this[Or]=bn)}),bn},DFS:function Pe(Ut,gn,yt,Yt){Yt=Yt||{};var bn=We.util.objId;for(var rs in Ut)if(Ut.hasOwnProperty(rs)){gn.call(Ut,rs,Ut[rs],yt||rs);var Jn=Ut[rs],ds=We.util.type(Jn);ds==="Object"&&!Yt[bn(Jn)]?(Yt[bn(Jn)]=!0,Pe(Jn,gn,null,Yt)):ds==="Array"&&!Yt[bn(Jn)]&&(Yt[bn(Jn)]=!0,Pe(Jn,gn,rs,Yt))}}},plugins:{},highlightAll:function(Pe,Ut){We.highlightAllUnder(document,Pe,Ut)},highlightAllUnder:function(Pe,Ut,gn){var yt={callback:gn,container:Pe,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};We.hooks.run("before-highlightall",yt),yt.elements=Array.prototype.slice.apply(yt.container.querySelectorAll(yt.selector)),We.hooks.run("before-all-elements-highlight",yt);for(var Yt=0,bn;bn=yt.elements[Yt++];)We.highlightElement(bn,Ut===!0,yt.callback)},highlightElement:function(Pe,Ut,gn){var yt=We.util.getLanguage(Pe),Yt=We.languages[yt];We.util.setLanguage(Pe,yt);var bn=Pe.parentElement;bn&&bn.nodeName.toLowerCase()==="pre"&&We.util.setLanguage(bn,yt);var rs=Pe.textContent,Jn={element:Pe,language:yt,grammar:Yt,code:rs};function ds(Ns){Jn.highlightedCode=Ns,We.hooks.run("before-insert",Jn),Jn.element.innerHTML=Jn.highlightedCode,We.hooks.run("after-highlight",Jn),We.hooks.run("complete",Jn),gn&&gn.call(Jn.element)}if(We.hooks.run("before-sanity-check",Jn),bn=Jn.element.parentElement,bn&&bn.nodeName.toLowerCase()==="pre"&&!bn.hasAttribute("tabindex")&&bn.setAttribute("tabindex","0"),!Jn.code){We.hooks.run("complete",Jn),gn&&gn.call(Jn.element);return}if(We.hooks.run("before-highlight",Jn),!Jn.grammar){ds(We.util.encode(Jn.code));return}if(Ut&&ct.Worker){var Or=new Worker(We.filename);Or.onmessage=function(Ns){ds(Ns.data)},Or.postMessage(JSON.stringify({language:Jn.language,code:Jn.code,immediateClose:!0}))}else ds(We.highlight(Jn.code,Jn.grammar,Jn.language))},highlight:function(Pe,Ut,gn){var yt={code:Pe,grammar:Ut,language:gn};if(We.hooks.run("before-tokenize",yt),!yt.grammar)throw new Error('The language "'+yt.language+'" has no grammar.');return yt.tokens=We.tokenize(yt.code,yt.grammar),We.hooks.run("after-tokenize",yt),xt.stringify(We.util.encode(yt.tokens),yt.language)},tokenize:function(Pe,Ut){var gn=Ut.rest;if(gn){for(var yt in gn)Ut[yt]=gn[yt];delete Ut.rest}var Yt=new ho;return ao(Yt,Yt.head,Pe),es(Pe,Yt,Ut,Yt.head,0),Yo(Yt)},hooks:{all:{},add:function(Pe,Ut){var gn=We.hooks.all;gn[Pe]=gn[Pe]||[],gn[Pe].push(Ut)},run:function(Pe,Ut){var gn=We.hooks.all[Pe];if(!(!gn||!gn.length))for(var yt=0,Yt;Yt=gn[yt++];)Yt(Ut)}},Token:xt};ct.Prism=We;function xt(Pe,Ut,gn,yt){this.type=Pe,this.content=Ut,this.alias=gn,this.length=(yt||"").length|0}xt.stringify=function Pe(Ut,gn){if(typeof Ut=="string")return Ut;if(Array.isArray(Ut)){var yt="";return Ut.forEach(function(ds){yt+=Pe(ds,gn)}),yt}var Yt={type:Ut.type,content:Pe(Ut.content,gn),tag:"span",classes:["token",Ut.type],attributes:{},language:gn},bn=Ut.alias;bn&&(Array.isArray(bn)?Array.prototype.push.apply(Yt.classes,bn):Yt.classes.push(bn)),We.hooks.run("wrap",Yt);var rs="";for(var Jn in Yt.attributes)rs+=" "+Jn+'="'+(Yt.attributes[Jn]||"").replace(/"/g,"&quot;")+'"';return"<"+Yt.tag+' class="'+Yt.classes.join(" ")+'"'+rs+">"+Yt.content+"</"+Yt.tag+">"};function he(Pe,Ut,gn,yt){Pe.lastIndex=Ut;var Yt=Pe.exec(gn);if(Yt&&yt&&Yt[1]){var bn=Yt[1].length;Yt.index+=bn,Yt[0]=Yt[0].slice(bn)}return Yt}function es(Pe,Ut,gn,yt,Yt,bn){for(var rs in gn)if(!(!gn.hasOwnProperty(rs)||!gn[rs])){var Jn=gn[rs];Jn=Array.isArray(Jn)?Jn:[Jn];for(var ds=0;ds<Jn.length;++ds){if(bn&&bn.cause==rs+","+ds)return;var Or=Jn[ds],Ns=Or.inside,Js=!!Or.lookbehind,Zs=!!Or.greedy,ba=Or.alias;if(Zs&&!Or.pattern.global){var ar=Or.pattern.toString().match(/[imsuy]*$/)[0];Or.pattern=RegExp(Or.pattern.source,ar+"g")}for(var Ps=Or.pattern||Or,Zr=yt.next,No=Yt;Zr!==Ut.tail&&!(bn&&No>=bn.reach);No+=Zr.value.length,Zr=Zr.next){var Mo=Zr.value;if(Ut.length>Pe.length)return;if(!(Mo instanceof xt)){var Mr=1,Ls;if(Zs){if(Ls=he(Ps,No,Pe,Js),!Ls||Ls.index>=Pe.length)break;var an=Ls.index,na=Ls.index+Ls[0].length,gs=No;for(gs+=Zr.value.length;an>=gs;)Zr=Zr.next,gs+=Zr.value.length;if(gs-=Zr.value.length,No=gs,Zr.value instanceof xt)continue;for(var va=Zr;va!==Ut.tail&&(gs<na||typeof va.value=="string");va=va.next)Mr++,gs+=va.value.length;Mr--,Mo=Pe.slice(No,gs),Ls.index-=No}else if(Ls=he(Ps,0,Mo,Js),!Ls)continue;var an=Ls.index,ps=Ls[0],Ii=Mo.slice(0,an),$e=Mo.slice(an+ps.length),Je=No+Mo.length;bn&&Je>bn.reach&&(bn.reach=Je);var At=Zr.prev;Ii&&(At=ao(Ut,At,Ii),No+=Ii.length),xo(Ut,At,Mr);var Wt=new xt(rs,Ns?We.tokenize(ps,Ns):ps,ba,ps);if(Zr=ao(Ut,At,Wt),$e&&ao(Ut,Zr,$e),Mr>1){var Wn={cause:rs+","+ds,reach:Je};es(Pe,Ut,gn,Zr.prev,No,Wn),bn&&Wn.reach>bn.reach&&(bn.reach=Wn.reach)}}}}}}function ho(){var Pe={value:null,prev:null,next:null},Ut={value:null,prev:Pe,next:null};Pe.next=Ut,this.head=Pe,this.tail=Ut,this.length=0}function ao(Pe,Ut,gn){var yt=Ut.next,Yt={value:gn,prev:Ut,next:yt};return Ut.next=Yt,yt.prev=Yt,Pe.length++,Yt}function xo(Pe,Ut,gn){for(var yt=Ut.next,Yt=0;Yt<gn&&yt!==Pe.tail;Yt++)yt=yt.next;Ut.next=yt,yt.prev=Ut,Pe.length-=Yt}function Yo(Pe){for(var Ut=[],gn=Pe.head.next;gn!==Pe.tail;)Ut.push(gn.value),gn=gn.next;return Ut}if(!ct.document)return ct.addEventListener&&(We.disableWorkerMessageHandler||ct.addEventListener("message",function(Pe){var Ut=JSON.parse(Pe.data),gn=Ut.language,yt=Ut.code,Yt=Ut.immediateClose;ct.postMessage(We.highlight(yt,We.languages[gn],gn)),Yt&&ct.close()},!1)),We;var Ct=We.util.currentScript();Ct&&(We.filename=Ct.src,Ct.hasAttribute("data-manual")&&(We.manual=!0));function Jt(){We.manual||We.highlightAll()}if(!We.manual){var Et=document.readyState;Et==="loading"||Et==="interactive"&&Ct&&Ct.defer?document.addEventListener("DOMContentLoaded",Jt):window.requestAnimationFrame?window.requestAnimationFrame(Jt):window.setTimeout(Jt,16)}return We}(Tt);return typeof mt<"u"&&mt.exports&&(mt.exports=He),typeof V<"u"&&(V.Prism=He),He.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},function(ct){function dn(kt,xn){return"___"+kt.toUpperCase()+xn+"___"}Object.defineProperties(ct.languages["markup-templating"]={},{buildPlaceholders:{value:function(kt,xn,We,xt){if(kt.language===xn){var he=kt.tokenStack=[];kt.code=kt.code.replace(We,function(es){if(typeof xt=="function"&&!xt(es))return es;for(var ho=he.length,ao;kt.code.indexOf(ao=dn(xn,ho))!==-1;)++ho;return he[ho]=es,ao}),kt.grammar=ct.languages.markup}}},tokenizePlaceholders:{value:function(kt,xn){if(kt.language!==xn||!kt.tokenStack)return;kt.grammar=ct.languages[xn];var We=0,xt=Object.keys(kt.tokenStack);function he(es){for(var ho=0;ho<es.length&&!(We>=xt.length);ho++){var ao=es[ho];if(typeof ao=="string"||ao.content&&typeof ao.content=="string"){var xo=xt[We],Yo=kt.tokenStack[xo],Ct=typeof ao=="string"?ao:ao.content,Jt=dn(xn,xo),Et=Ct.indexOf(Jt);if(Et>-1){++We;var Pe=Ct.substring(0,Et),Ut=new ct.Token(xn,ct.tokenize(Yo,kt.grammar),"language-"+xn,Yo),gn=Ct.substring(Et+Jt.length),yt=[];Pe&&yt.push.apply(yt,he([Pe])),yt.push(Ut),gn&&yt.push.apply(yt,he([gn])),typeof ao=="string"?es.splice.apply(es,[ho,1].concat(yt)):ao.content=yt}}else ao.content&&he(ao.content)}return es}he(kt.tokens)}}})}(He),He.languages.c=He.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),He.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),He.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},He.languages.c.string],char:He.languages.c.char,comment:He.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:He.languages.c}}}}),He.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete He.languages.c.boolean,function(ct){var dn=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,kt=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return dn.source});ct.languages.cpp=ct.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return dn.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:dn,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),ct.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return kt})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),ct.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:ct.languages.cpp}}}}),ct.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),ct.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:ct.languages.extend("cpp",{})}}),ct.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},ct.languages.cpp["base-clause"])}(He),function(ct){function dn(Ls,na){return Ls.replace(/<<(\d+)>>/g,function(gs,va){return"(?:"+na[+va]+")"})}function kt(Ls,na,gs){return RegExp(dn(Ls,na),gs||"")}function xn(Ls,na){for(var gs=0;gs<na;gs++)Ls=Ls.replace(/<<self>>/g,function(){return"(?:"+Ls+")"});return Ls.replace(/<<self>>/g,"[^\\s\\S]")}var We={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function xt(Ls){return"\\b(?:"+Ls.trim().replace(/ /g,"|")+")\\b"}var he=xt(We.typeDeclaration),es=RegExp(xt(We.type+" "+We.typeDeclaration+" "+We.contextual+" "+We.other)),ho=xt(We.typeDeclaration+" "+We.contextual+" "+We.other),ao=xt(We.type+" "+We.typeDeclaration+" "+We.other),xo=xn(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),Yo=xn(/\((?:[^()]|<<self>>)*\)/.source,2),Ct=/@?\b[A-Za-z_]\w*\b/.source,Jt=dn(/<<0>>(?:\s*<<1>>)?/.source,[Ct,xo]),Et=dn(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[ho,Jt]),Pe=/\[\s*(?:,\s*)*\]/.source,Ut=dn(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[Et,Pe]),gn=dn(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[xo,Yo,Pe]),yt=dn(/\(<<0>>+(?:,<<0>>+)+\)/.source,[gn]),Yt=dn(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[yt,Et,Pe]),bn={keyword:es,punctuation:/[<>()?,.:[\]]/},rs=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,Jn=/"(?:\\.|[^\\"\r\n])*"/.source,ds=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;ct.languages.csharp=ct.languages.extend("clike",{string:[{pattern:kt(/(^|[^$\\])<<0>>/.source,[ds]),lookbehind:!0,greedy:!0},{pattern:kt(/(^|[^@$\\])<<0>>/.source,[Jn]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:kt(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[Et]),lookbehind:!0,inside:bn},{pattern:kt(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[Ct,Yt]),lookbehind:!0,inside:bn},{pattern:kt(/(\busing\s+)<<0>>(?=\s*=)/.source,[Ct]),lookbehind:!0},{pattern:kt(/(\b<<0>>\s+)<<1>>/.source,[he,Jt]),lookbehind:!0,inside:bn},{pattern:kt(/(\bcatch\s*\(\s*)<<0>>/.source,[Et]),lookbehind:!0,inside:bn},{pattern:kt(/(\bwhere\s+)<<0>>/.source,[Ct]),lookbehind:!0},{pattern:kt(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[Ut]),lookbehind:!0,inside:bn},{pattern:kt(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[Yt,ao,Ct]),inside:bn}],keyword:es,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),ct.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),ct.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:kt(/([(,]\s*)<<0>>(?=\s*:)/.source,[Ct]),lookbehind:!0,alias:"punctuation"}}),ct.languages.insertBefore("csharp","class-name",{namespace:{pattern:kt(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[Ct]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:kt(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[Yo]),lookbehind:!0,alias:"class-name",inside:bn},"return-type":{pattern:kt(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[Yt,Et]),inside:bn,alias:"class-name"},"constructor-invocation":{pattern:kt(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[Yt]),lookbehind:!0,inside:bn,alias:"class-name"},"generic-method":{pattern:kt(/<<0>>\s*<<1>>(?=\s*\()/.source,[Ct,xo]),inside:{function:kt(/^<<0>>/.source,[Ct]),generic:{pattern:RegExp(xo),alias:"class-name",inside:bn}}},"type-list":{pattern:kt(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[he,Jt,Ct,Yt,es.source,Yo,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:kt(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[Jt,Yo]),lookbehind:!0,greedy:!0,inside:ct.languages.csharp},keyword:es,"class-name":{pattern:RegExp(Yt),greedy:!0,inside:bn},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var Or=Jn+"|"+rs,Ns=dn(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[Or]),Js=xn(dn(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[Ns]),2),Zs=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,ba=dn(/<<0>>(?:\s*\(<<1>>*\))?/.source,[Et,Js]);ct.languages.insertBefore("csharp","class-name",{attribute:{pattern:kt(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[Zs,ba]),lookbehind:!0,greedy:!0,inside:{target:{pattern:kt(/^<<0>>(?=\s*:)/.source,[Zs]),alias:"keyword"},"attribute-arguments":{pattern:kt(/\(<<0>>*\)/.source,[Js]),inside:ct.languages.csharp},"class-name":{pattern:RegExp(Et),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var ar=/:[^}\r\n]+/.source,Ps=xn(dn(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[Ns]),2),Zr=dn(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Ps,ar]),No=xn(dn(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[Or]),2),Mo=dn(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[No,ar]);function Mr(Ls,na){return{interpolation:{pattern:kt(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[Ls]),lookbehind:!0,inside:{"format-string":{pattern:kt(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[na,ar]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:ct.languages.csharp}}},string:/[\s\S]+/}}ct.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:kt(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[Zr]),lookbehind:!0,greedy:!0,inside:Mr(Zr,Ps)},{pattern:kt(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Mo]),lookbehind:!0,greedy:!0,inside:Mr(Mo,No)}],char:{pattern:RegExp(rs),greedy:!0}}),ct.languages.dotnet=ct.languages.cs=ct.languages.csharp}(He),function(ct){var dn=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;ct.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+dn.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+dn.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+dn.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+dn.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:dn,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},ct.languages.css.atrule.inside.rest=ct.languages.css;var kt=ct.languages.markup;kt&&(kt.tag.addInlined("style","css"),kt.tag.addAttribute("style","css"))}(He),function(ct){var dn=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,kt=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,xn={pattern:RegExp(/(^|[^\w.])/.source+kt+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};ct.languages.java=ct.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[xn,{pattern:RegExp(/(^|[^\w.])/.source+kt+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:xn.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+kt+/[A-Z]\w*\b/.source),lookbehind:!0,inside:xn.inside}],keyword:dn,function:[ct.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),ct.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),ct.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":xn,keyword:dn,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+kt+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:xn.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+kt+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:xn.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return dn.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(He),He.languages.javascript=He.languages.extend("clike",{"class-name":[He.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),He.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,He.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:He.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:He.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:He.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:He.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:He.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),He.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:He.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),He.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),He.languages.markup&&(He.languages.markup.tag.addInlined("script","javascript"),He.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),He.languages.js=He.languages.javascript,He.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},He.languages.markup.tag.inside["attr-value"].inside.entity=He.languages.markup.entity,He.languages.markup.doctype.inside["internal-subset"].inside=He.languages.markup,He.hooks.add("wrap",function(ct){ct.type==="entity"&&(ct.attributes.title=ct.content.replace(/&amp;/,"&"))}),Object.defineProperty(He.languages.markup.tag,"addInlined",{value:function(dn,kt){var xn={};xn["language-"+kt]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:He.languages[kt]},xn.cdata=/^<!\[CDATA\[|\]\]>$/i;var We={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:xn}};We["language-"+kt]={pattern:/[\s\S]+/,inside:He.languages[kt]};var xt={};xt[dn]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return dn}),"i"),lookbehind:!0,greedy:!0,inside:We},He.languages.insertBefore("markup","cdata",xt)}}),Object.defineProperty(He.languages.markup.tag,"addAttribute",{value:function(ct,dn){He.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+ct+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[dn,"language-"+dn],inside:He.languages[dn]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),He.languages.html=He.languages.markup,He.languages.mathml=He.languages.markup,He.languages.svg=He.languages.markup,He.languages.xml=He.languages.extend("markup",{}),He.languages.ssml=He.languages.xml,He.languages.atom=He.languages.xml,He.languages.rss=He.languages.xml,function(ct){var dn=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,kt=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],xn=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,We=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,xt=/[{}\[\](),:;]/;ct.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:dn,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:kt,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:xn,operator:We,punctuation:xt};var he={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:ct.languages.php},es=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:he}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:he}}];ct.languages.insertBefore("php","variable",{string:es,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:dn,string:es,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:kt,number:xn,operator:We,punctuation:xt}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),ct.hooks.add("before-tokenize",function(ho){if(!!/<\?/.test(ho.code)){var ao=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;ct.languages["markup-templating"].buildPlaceholders(ho,"php",ao)}}),ct.hooks.add("after-tokenize",function(ho){ct.languages["markup-templating"].tokenizePlaceholders(ho,"php")})}(He),He.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},He.languages.python["string-interpolation"].inside.interpolation.inside.rest=He.languages.python,He.languages.py=He.languages.python,function(ct){ct.languages.ruby=ct.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),ct.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var dn={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:ct.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete ct.languages.ruby.function;var kt="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",xn=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;ct.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+kt+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:dn,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:dn,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+xn),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+xn+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),ct.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+kt),greedy:!0,inside:{interpolation:dn,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:dn,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:dn,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+kt),greedy:!0,inside:{interpolation:dn,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:dn,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete ct.languages.ruby.string,ct.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),ct.languages.rb=ct.languages.ruby}(He),window.Prism=Ot,He}(void 0,void 0),A=V=>mt=>mt.options.get(V),O=V=>{const mt=V.options.register;mt("codesample_languages",{processor:"object[]"}),mt("codesample_global_prismjs",{processor:"boolean",default:!1})},N=A("codesample_languages"),L=A("codesample_global_prismjs"),j=V=>y.Prism&&L(V)?y.Prism:C,z=V=>t(V)&&V.nodeName==="PRE"&&V.className.indexOf("language-")!==-1,q=V=>{const mt=V.selection?V.selection.getNode():null;return z(mt)?u.some(mt):u.none()},ee=(V,mt,nt)=>{const Ot=V.dom;V.undoManager.transact(()=>{const Tt=q(V);return nt=g.DOM.encode(nt),Tt.fold(()=>{V.insertContent('<pre id="__new" class="language-'+mt+'">'+nt+"</pre>");const He=Ot.select("#__new")[0];Ot.setAttrib(He,"id",null),V.selection.select(He)},He=>{Ot.setAttrib(He,"class","language-"+mt),He.innerHTML=nt,j(V).highlightElement(He),V.selection.select(He)})})},F=V=>q(V).bind(nt=>u.from(nt.textContent)).getOr(""),ne=V=>{const mt=[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],nt=N(V);return nt||mt},oe=(V,mt)=>q(V).fold(()=>mt,Ot=>{const Tt=Ot.className.match(/language-(\w+)/);return Tt?Tt[1]:mt}),re=V=>{const mt=ne(V),nt=h(mt).fold(a(""),He=>He.value),Ot=oe(V,nt),Tt=F(V);V.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"listbox",name:"language",label:"Language",items:mt},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:Ot,code:Tt},onSubmit:He=>{const ct=He.getData();ee(V,ct.language,ct.code),He.close()}})},J=V=>{V.addCommand("codesample",()=>{const mt=V.selection.getNode();V.selection.isCollapsed()||z(mt)?re(V):V.formatter.toggle("code")})},ye=(V=>mt=>mt.replace(V,""))(/^\s+|\s+$/g);var De=tinymce.util.Tools.resolve("tinymce.util.Tools");const _e=V=>{V.on("PreProcess",mt=>{const nt=V.dom,Ot=nt.select("pre[contenteditable=false]",mt.node);De.each(De.grep(Ot,z),Tt=>{const He=Tt.textContent;nt.setAttrib(Tt,"class",ye(nt.getAttrib(Tt,"class"))),nt.setAttrib(Tt,"contentEditable",null),nt.setAttrib(Tt,"data-mce-highlighted",null);let ct;for(;ct=Tt.firstChild;)Tt.removeChild(ct);const dn=nt.add(Tt,"code");dn.textContent=He})}),V.on("SetContent",()=>{const mt=V.dom,nt=De.grep(mt.select("pre"),Ot=>z(Ot)&&mt.getAttrib(Ot,"data-mce-highlighted")!=="true");nt.length&&V.undoManager.transact(()=>{De.each(nt,Ot=>{var Tt;De.each(mt.select("br",Ot),He=>{mt.replace(V.getDoc().createTextNode(`
`),He)}),Ot.innerHTML=mt.encode((Tt=Ot.textContent)!==null&&Tt!==void 0?Tt:""),j(V).highlightElement(Ot),mt.setAttrib(Ot,"data-mce-highlighted",!0),Ot.className=ye(Ot.className)})})}),V.on("PreInit",()=>{V.parser.addNodeFilter("pre",mt=>{var nt;for(let Ot=0,Tt=mt.length;Ot<Tt;Ot++){const He=mt[Ot];((nt=He.attr("class"))!==null&&nt!==void 0?nt:"").indexOf("language-")!==-1&&(He.attr("contenteditable","false"),He.attr("data-mce-highlighted","false"))}})})},be=(V,mt=r)=>nt=>{const Ot=()=>{nt.setEnabled(V.selection.isEditable()),mt(nt)};return V.on("NodeChange",Ot),Ot(),()=>{V.off("NodeChange",Ot)}},tt=V=>{const mt=V.selection.getStart();return V.dom.is(mt,'pre[class*="language-"]')},Qe=V=>{const mt=()=>V.execCommand("codesample");V.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:mt,onSetup:be(V,nt=>{nt.setActive(tt(V))})}),V.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:mt,onSetup:be(V)})};var ft=()=>{s.add("codesample",V=>{O(V),_e(V),Qe(V),J(V),V.on("dblclick",mt=>{z(mt.target)&&re(V)})})};ft()})();(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(Ge,qe,It)=>{var jt;return It(Ge,qe.prototype)?!0:((jt=Ge.constructor)===null||jt===void 0?void 0:jt.name)===qe.name},t=Ge=>{const qe=typeof Ge;return Ge===null?"null":qe==="object"&&Array.isArray(Ge)?"array":qe==="object"&&e(Ge,String,(It,jt)=>jt.isPrototypeOf(It))?"string":qe},r=Ge=>qe=>t(qe)===Ge,a=r("string"),u=r("object"),f=r("array"),h=Ge=>Ge==null,g=Ge=>!h(Ge);class y{constructor(qe,It){this.tag=qe,this.value=It}static some(qe){return new y(!0,qe)}static none(){return y.singletonNone}fold(qe,It){return this.tag?It(this.value):qe()}isSome(){return this.tag}isNone(){return!this.tag}map(qe){return this.tag?y.some(qe(this.value)):y.none()}bind(qe){return this.tag?qe(this.value):y.none()}exists(qe){return this.tag&&qe(this.value)}forall(qe){return!this.tag||qe(this.value)}filter(qe){return!this.tag||qe(this.value)?this:y.none()}getOr(qe){return this.tag?this.value:qe}or(qe){return this.tag?this:qe}getOrThunk(qe){return this.tag?this.value:qe()}orThunk(qe){return this.tag?this:qe()}getOrDie(qe){if(this.tag)return this.value;throw new Error(qe!=null?qe:"Called getOrDie on None")}static from(qe){return g(qe)?y.some(qe):y.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(qe){this.tag&&qe(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}y.singletonNone=new y(!1);const C=Array.prototype.push,A=(Ge,qe)=>{for(let It=0,jt=Ge.length;It<jt;It++){const co=Ge[It];qe(co,It)}},O=Ge=>{const qe=[];for(let It=0,jt=Ge.length;It<jt;++It){if(!f(Ge[It]))throw new Error("Arr.flatten item "+It+" was not an array, input: "+Ge);C.apply(qe,Ge[It])}return qe},N=Ge=>{let qe=Ge;return{get:()=>qe,set:co=>{qe=co}}},L=Object.keys,j=Object.hasOwnProperty,z=(Ge,qe)=>{const It=L(Ge);for(let jt=0,co=It.length;jt<co;jt++){const Bo=It[jt],qo=Ge[Bo];qe(qo,Bo)}},q=(Ge,qe)=>ee(Ge,qe)?y.from(Ge[qe]):y.none(),ee=(Ge,qe)=>j.call(Ge,qe),F=Ge=>qe=>qe.options.get(Ge),ne=Ge=>{const qe=Ge.options.register;qe("audio_template_callback",{processor:"function"}),qe("video_template_callback",{processor:"function"}),qe("iframe_template_callback",{processor:"function"}),qe("media_live_embeds",{processor:"boolean",default:!0}),qe("media_filter_html",{processor:"boolean",default:!0}),qe("media_url_resolver",{processor:"function"}),qe("media_alt_source",{processor:"boolean",default:!0}),qe("media_poster",{processor:"boolean",default:!0}),qe("media_dimensions",{processor:"boolean",default:!0})},oe=F("audio_template_callback"),re=F("video_template_callback"),J=F("iframe_template_callback"),we=F("media_live_embeds"),ye=F("media_filter_html"),De=F("media_url_resolver"),_e=F("media_alt_source"),be=F("media_poster"),tt=F("media_dimensions");var Qe=tinymce.util.Tools.resolve("tinymce.util.Tools"),ft=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),V=tinymce.util.Tools.resolve("tinymce.html.DomParser");const mt=ft.DOM,nt=Ge=>Ge.replace(/px$/,""),Ot=Ge=>{const qe=Ge.attr("style"),It=qe?mt.parseStyle(qe):{};return{type:"ephox-embed-iri",source:Ge.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:q(It,"max-width").map(nt).getOr(""),height:q(It,"max-height").map(nt).getOr("")}},Tt=(Ge,qe)=>{let It={};const co=V({validate:!1,forced_root_block:!1},qe).parse(Ge);for(let Bo=co;Bo;Bo=Bo.walk())if(Bo.type===1){const qo=Bo.name;if(Bo.attr("data-ephox-embed-iri")){It=Ot(Bo);break}else!It.source&&qo==="param"&&(It.source=Bo.attr("movie")),(qo==="iframe"||qo==="object"||qo==="embed"||qo==="video"||qo==="audio")&&(It.type||(It.type=qo),It=Qe.extend(Bo.attributes.map,It)),qo==="source"&&(It.source?It.altsource||(It.altsource=Bo.attr("src")):It.source=Bo.attr("src")),qo==="img"&&!It.poster&&(It.poster=Bo.attr("src"))}return It.source=It.source||It.src||"",It.altsource=It.altsource||"",It.poster=It.poster||"",It},He=Ge=>{var qe;const It={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},jt=(qe=Ge.toLowerCase().split(".").pop())!==null&&qe!==void 0?qe:"";return q(It,jt).getOr("")};var ct=tinymce.util.Tools.resolve("tinymce.html.Node"),dn=tinymce.util.Tools.resolve("tinymce.html.Serializer");const kt=(Ge,qe={})=>V({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...qe},Ge),xn=ft.DOM,We=Ge=>/^[0-9.]+$/.test(Ge)?Ge+"px":Ge,xt=(Ge,qe)=>{const It=qe.attr("style"),jt=It?xn.parseStyle(It):{};g(Ge.width)&&(jt["max-width"]=We(Ge.width)),g(Ge.height)&&(jt["max-height"]=We(Ge.height)),qe.attr("style",xn.serializeStyle(jt))},he=["source","altsource"],es=(Ge,qe,It,jt)=>{let co=0,Bo=0;const qo=kt(jt);qo.addNodeFilter("source",it=>co=it.length);const Yr=qo.parse(Ge);for(let it=Yr;it;it=it.walk())if(it.type===1){const Wo=it.name;if(it.attr("data-ephox-embed-iri")){xt(qe,it);break}else{switch(Wo){case"video":case"object":case"embed":case"img":case"iframe":qe.height!==void 0&&qe.width!==void 0&&(it.attr("width",qe.width),it.attr("height",qe.height));break}if(It)switch(Wo){case"video":it.attr("poster",qe.poster),it.attr("src",null);for(let oa=co;oa<2;oa++)if(qe[he[oa]]){const ua=new ct("source",1);ua.attr("src",qe[he[oa]]),ua.attr("type",qe[he[oa]+"mime"]||null),it.append(ua)}break;case"iframe":it.attr("src",qe.source);break;case"object":const Di=it.getAll("img").length>0;if(qe.poster&&!Di){it.attr("src",qe.poster);const oa=new ct("img",1);oa.attr("src",qe.poster),oa.attr("width",qe.width),oa.attr("height",qe.height),it.append(oa)}break;case"source":if(Bo<2&&(it.attr("src",qe[he[Bo]]),it.attr("type",qe[he[Bo]+"mime"]||null),!qe[he[Bo]])){it.remove();continue}Bo++;break;case"img":qe.poster||it.remove();break}}}return dn({},jt).serialize(Yr)},ho=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?h=$2&title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)\?h=(\w+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?h=$3&title=0&amp;byline=0",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&amp;byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],ao=Ge=>{const qe=Ge.match(/^(https?:\/\/|www\.)(.+)$/i);return qe&&qe.length>1?qe[1]==="www."?"https://":qe[1]:"https://"},xo=(Ge,qe)=>{const It=ao(qe),jt=Ge.regex.exec(qe);let co=It+Ge.url;if(g(jt))for(let Bo=0;Bo<jt.length;Bo++)co=co.replace("$"+Bo,()=>jt[Bo]?jt[Bo]:"");return co.replace(/\?$/,"")},Yo=Ge=>{const qe=ho.filter(It=>It.regex.test(Ge));return qe.length>0?Qe.extend({},qe[0],{url:xo(qe[0],Ge)}):null},Ct=(Ge,qe)=>{if(qe)return qe(Ge);{const It=Ge.allowfullscreen?' allowFullscreen="1"':"";return'<iframe src="'+Ge.source+'" width="'+Ge.width+'" height="'+Ge.height+'"'+It+"></iframe>"}},Jt=Ge=>{let qe='<object data="'+Ge.source+'" width="'+Ge.width+'" height="'+Ge.height+'" type="application/x-shockwave-flash">';return Ge.poster&&(qe+='<img src="'+Ge.poster+'" width="'+Ge.width+'" height="'+Ge.height+'" />'),qe+="</object>",qe},Et=(Ge,qe)=>qe?qe(Ge):'<audio controls="controls" src="'+Ge.source+'">'+(Ge.altsource?`
<source src="`+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
`:"")+"</audio>",Pe=(Ge,qe)=>qe?qe(Ge):'<video width="'+Ge.width+'" height="'+Ge.height+'"'+(Ge.poster?' poster="'+Ge.poster+'"':"")+` controls="controls">
<source src="`+Ge.source+'"'+(Ge.sourcemime?' type="'+Ge.sourcemime+'"':"")+` />
`+(Ge.altsource?'<source src="'+Ge.altsource+'"'+(Ge.altsourcemime?' type="'+Ge.altsourcemime+'"':"")+` />
`:"")+"</video>",Ut=(Ge,qe)=>{var It;const jt=Qe.extend({},qe);if(!jt.source&&(Qe.extend(jt,Tt((It=jt.embed)!==null&&It!==void 0?It:"",Ge.schema)),!jt.source))return"";jt.altsource||(jt.altsource=""),jt.poster||(jt.poster=""),jt.source=Ge.convertURL(jt.source,"source"),jt.altsource=Ge.convertURL(jt.altsource,"source"),jt.sourcemime=He(jt.source),jt.altsourcemime=He(jt.altsource),jt.poster=Ge.convertURL(jt.poster,"poster");const co=Yo(jt.source);if(co&&(jt.source=co.url,jt.type=co.type,jt.allowfullscreen=co.allowFullscreen,jt.width=jt.width||String(co.w),jt.height=jt.height||String(co.h)),jt.embed)return es(jt.embed,jt,!0,Ge.schema);{const Bo=oe(Ge),qo=re(Ge),Yr=J(Ge);return jt.width=jt.width||"300",jt.height=jt.height||"150",Qe.each(jt,(it,Wo)=>{jt[Wo]=Ge.dom.encode(""+it)}),jt.type==="iframe"?Ct(jt,Yr):jt.sourcemime==="application/x-shockwave-flash"?Jt(jt):jt.sourcemime.indexOf("audio")!==-1?Et(jt,Bo):Pe(jt,qo)}},gn=Ge=>Ge.hasAttribute("data-mce-object")||Ge.hasAttribute("data-ephox-embed-iri"),yt=Ge=>{Ge.on("click keyup touchend",()=>{const qe=Ge.selection.getNode();qe&&Ge.dom.hasClass(qe,"mce-preview-object")&&Ge.dom.getAttrib(qe,"data-mce-selected")&&qe.setAttribute("data-mce-selected","2")}),Ge.on("ObjectResized",qe=>{const It=qe.target;if(It.getAttribute("data-mce-object")){let jt=It.getAttribute("data-mce-html");jt&&(jt=unescape(jt),It.setAttribute("data-mce-html",escape(es(jt,{width:String(qe.width),height:String(qe.height)},!1,Ge.schema))))}})},Yt={},bn=(Ge,qe,It)=>new Promise((jt,co)=>{const Bo=qo=>(qo.html&&(Yt[Ge.source]=qo),jt({url:Ge.source,html:qo.html?qo.html:qe(Ge)}));Yt[Ge.source]?Bo(Yt[Ge.source]):It({url:Ge.source},Bo,co)}),rs=(Ge,qe)=>Promise.resolve({html:qe(Ge),url:Ge.source}),Jn=Ge=>qe=>Ut(Ge,qe),ds=(Ge,qe)=>{const It=De(Ge);return It?bn(qe,Jn(Ge),It):rs(qe,Jn(Ge))},Or=Ge=>ee(Yt,Ge),Ns=(Ge,qe)=>q(qe,Ge).bind(It=>q(It,"meta")),Js=(Ge,qe,It)=>jt=>{const co=()=>q(Ge,jt),Bo=()=>q(qe,jt),qo=Wo=>q(Wo,"value").bind(Di=>Di.length>0?y.some(Di):y.none()),Yr=()=>co().bind(Wo=>u(Wo)?qo(Wo).orThunk(Bo):Bo().orThunk(()=>y.from(Wo))),it=()=>Bo().orThunk(()=>co().bind(Wo=>u(Wo)?qo(Wo):y.from(Wo)));return{[jt]:(jt===It?Yr():it()).getOr("")}},Zs=(Ge,qe)=>{const It={};return q(Ge,"dimensions").each(jt=>{A(["width","height"],co=>{q(qe,co).orThunk(()=>q(jt,co)).each(Bo=>It[co]=Bo)})}),It},ba=(Ge,qe)=>{const It=qe&&qe!=="dimensions"?Ns(qe,Ge).getOr({}):{},jt=Js(Ge,It,qe);return{...jt("source"),...jt("altsource"),...jt("poster"),...jt("embed"),...Zs(Ge,It)}},ar=Ge=>{const qe={...Ge,source:{value:q(Ge,"source").getOr("")},altsource:{value:q(Ge,"altsource").getOr("")},poster:{value:q(Ge,"poster").getOr("")}};return A(["width","height"],It=>{q(Ge,It).each(jt=>{const co=qe.dimensions||{};co[It]=jt,qe.dimensions=co})}),qe},Ps=Ge=>qe=>{const It=qe&&qe.msg?"Media embed handler error: "+qe.msg:"Media embed handler threw unknown error.";Ge.notificationManager.open({type:"error",text:It})},Zr=Ge=>{const qe=Ge.selection.getNode(),It=gn(qe)?Ge.serializer.serialize(qe,{selection:!0}):"",jt=Tt(It,Ge.schema),Bo=(()=>{if(Ls(jt.source,jt.type)){const qo=Ge.dom.getRect(qe);return{width:qo.w.toString().replace(/px$/,""),height:qo.h.toString().replace(/px$/,"")}}else return{}})();return{embed:It,...jt,...Bo}},No=(Ge,qe)=>It=>{if(a(It.url)&&It.url.trim().length>0){const jt=It.html,Bo={...Tt(jt,qe.schema),source:It.url,embed:jt};Ge.setData(ar(Bo))}},Mo=(Ge,qe)=>{const It=Ge.dom.select("*[data-mce-object]");for(let jt=0;jt<qe.length;jt++)for(let co=It.length-1;co>=0;co--)qe[jt]===It[co]&&It.splice(co,1);Ge.selection.select(It[0])},Mr=(Ge,qe)=>{const It=Ge.dom.select("*[data-mce-object]");Ge.insertContent(qe),Mo(Ge,It),Ge.nodeChanged()},Ls=(Ge,qe)=>g(qe)&&qe==="ephox-embed-iri"&&g(Yo(Ge)),na=(Ge,qe)=>((jt,co)=>jt.width!==co.width||jt.height!==co.height)(Ge,qe)&&Ls(qe.source,Ge.type),gs=(Ge,qe,It)=>{var jt;qe.embed=na(Ge,qe)&&tt(It)?Ut(It,{...qe,embed:""}):es((jt=qe.embed)!==null&&jt!==void 0?jt:"",qe,!1,It.schema),qe.embed&&(Ge.source===qe.source||Or(qe.source))?Mr(It,qe.embed):ds(It,qe).then(co=>{Mr(It,co.html)}).catch(Ps(It))},va=Ge=>{const qe=Zr(Ge),It=N(qe),jt=ar(qe),co=(fa,Qs)=>{const xr=ba(Qs.getData(),"source");fa.source!==xr.source&&(No(Xa,Ge)({url:xr.source,html:""}),ds(Ge,xr).then(No(Xa,Ge)).catch(Ps(Ge)))},Bo=fa=>{var Qs;const xr=ba(fa.getData()),Ki=Tt((Qs=xr.embed)!==null&&Qs!==void 0?Qs:"",Ge.schema);fa.setData(ar(Ki))},qo=(fa,Qs,xr)=>{const Ki=ba(fa.getData(),Qs),fl=na(xr,Ki)&&tt(Ge)?{...Ki,embed:""}:Ki,pc=Ut(Ge,fl);fa.setData(ar({...fl,embed:pc}))},Yr=[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],it=tt(Ge)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Wo={title:"General",name:"general",items:O([Yr,it])},oa={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},ua=[];_e(Ge)&&ua.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),be(Ge)&&ua.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const ur={title:"Advanced",name:"advanced",items:ua},Dc=[Wo,oa];ua.length>0&&Dc.push(ur);const gc={type:"tabpanel",tabs:Dc},Xa=Ge.windowManager.open({title:"Insert/Edit Media",size:"normal",body:gc,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:fa=>{const Qs=ba(fa.getData());gs(It.get(),Qs,Ge),fa.close()},onChange:(fa,Qs)=>{switch(Qs.name){case"source":co(It.get(),fa);break;case"embed":Bo(fa);break;case"dimensions":case"altsource":case"poster":qo(fa,Qs.name,It.get());break}It.set(ba(fa.getData()))},initialData:jt})},an=Ge=>({showDialog:()=>{va(Ge)}}),ps=Ge=>{const qe=()=>{va(Ge)};Ge.addCommand("mceMedia",qe)},Ii=(Ge,qe,It)=>qe===""||Ge.length>=qe.length&&Ge.substr(It,It+qe.length)===qe,$e=(Ge,qe)=>Ii(Ge,qe,0);var Je=tinymce.util.Tools.resolve("tinymce.Env");const At=Ge=>{const qe=Ge.name;return qe==="iframe"||qe==="video"||qe==="audio"},Wt=(Ge,qe,It,jt=null)=>{const co=Ge.attr(It);return g(co)?co:ee(qe,It)?null:jt},Wn=(Ge,qe,It)=>{const jt=qe.name==="img"||Ge.name==="video",co=jt?"300":null,Bo=Ge.name==="audio"?"30":"150",qo=jt?Bo:null;qe.attr({width:Wt(Ge,It,"width",co),height:Wt(Ge,It,"height",qo)})},lo=(Ge,qe,It,jt)=>{const co=kt(Ge.schema).parse(jt,{context:qe});for(;co.firstChild;)It.append(co.firstChild)},go=(Ge,qe)=>{const It=qe.name,jt=new ct("img",1);return ts(Ge,qe,jt),Wn(qe,jt,{}),jt.attr({style:qe.attr("style"),src:Je.transparentSrc,"data-mce-object":It,class:"mce-object mce-object-"+It}),jt},cn=(Ge,qe)=>{var It;const jt=qe.name,co=new ct("span",1);co.attr({contentEditable:"false",style:qe.attr("style"),"data-mce-object":jt,class:"mce-preview-object mce-object-"+jt}),ts(Ge,qe,co);const Bo=Ge.dom.parseStyle((It=qe.attr("style"))!==null&&It!==void 0?It:""),qo=new ct(jt,1);if(Wn(qe,qo,Bo),qo.attr({src:qe.attr("src"),style:qe.attr("style"),class:qe.attr("class")}),jt==="iframe")qo.attr({allowfullscreen:qe.attr("allowfullscreen"),frameborder:"0"});else{A(["controls","crossorigin","currentTime","loop","muted","poster","preload"],Di=>{qo.attr(Di,qe.attr(Di))});const Wo=co.attr("data-mce-html");g(Wo)&&lo(Ge,jt,qo,unescape(Wo))}const Yr=new ct("span",1);return Yr.attr("class","mce-shim"),co.append(qo),co.append(Yr),co},ts=(Ge,qe,It)=>{var jt;const co=(jt=qe.attributes)!==null&&jt!==void 0?jt:[];let Bo=co.length;for(;Bo--;){const Wo=co[Bo].name;let Di=co[Bo].value;Wo!=="width"&&Wo!=="height"&&Wo!=="style"&&!$e(Wo,"data-mce-")&&((Wo==="data"||Wo==="src")&&(Di=Ge.convertURL(Di,Wo)),It.attr("data-mce-p-"+Wo,Di))}const qo=dn({inner:!0},Ge.schema),Yr=new ct("div",1);A(qe.children(),Wo=>Yr.append(Wo));const it=qo.serialize(Yr);it&&(It.attr("data-mce-html",escape(it)),It.empty())},wo=Ge=>{const qe=Ge.attr("class");return a(qe)&&/\btiny-pageembed\b/.test(qe)},cs=Ge=>{let qe=Ge;for(;qe=qe.parent;)if(qe.attr("data-ephox-embed-iri")||wo(qe))return!0;return!1},_r=Ge=>qe=>{let It=qe.length,jt;for(;It--;)jt=qe[It],jt.parent&&(jt.parent.attr("data-mce-object")||(At(jt)&&we(Ge)?cs(jt)||jt.replace(cn(Ge,jt)):cs(jt)||jt.replace(go(Ge,jt))))},Ir=(Ge,qe,It)=>{const jt=Ge.options.get,co=jt("xss_sanitization"),Bo=ye(Ge);return kt(Ge.schema,{sanitize:co,validate:Bo}).parse(It,{context:qe})},Vs=Ge=>{Ge.on("PreInit",()=>{const{schema:qe,serializer:It,parser:jt}=Ge,co=qe.getBoolAttrs();A("webkitallowfullscreen mozallowfullscreen".split(" "),Bo=>{co[Bo]={}}),z({embed:["wmode"]},(Bo,qo)=>{const Yr=qe.getElementRule(qo);Yr&&A(Bo,it=>{Yr.attributes[it]={},Yr.attributesOrder.push(it)})}),jt.addNodeFilter("iframe,video,audio,object,embed",_r(Ge)),It.addAttributeFilter("data-mce-object",(Bo,qo)=>{var Yr;let it=Bo.length;for(;it--;){const Wo=Bo[it];if(!Wo.parent)continue;const Di=Wo.attr(qo),oa=new ct(Di,1);if(Di!=="audio"){const gc=Wo.attr("class");gc&&gc.indexOf("mce-preview-object")!==-1&&Wo.firstChild?oa.attr({width:Wo.firstChild.attr("width"),height:Wo.firstChild.attr("height")}):oa.attr({width:Wo.attr("width"),height:Wo.attr("height")})}oa.attr({style:Wo.attr("style")});const ua=(Yr=Wo.attributes)!==null&&Yr!==void 0?Yr:[];let ur=ua.length;for(;ur--;){const gc=ua[ur].name;gc.indexOf("data-mce-p-")===0&&oa.attr(gc.substr(11),ua[ur].value)}const Dc=Wo.attr("data-mce-html");if(Dc){const gc=Ir(Ge,Di,unescape(Dc));A(gc.children(),Xa=>oa.append(Xa))}Wo.replace(oa)}})}),Ge.on("SetContent",()=>{const qe=Ge.dom;A(qe.select("span.mce-preview-object"),It=>{qe.select("span.mce-shim",It).length===0&&qe.add(It,"span",{class:"mce-shim"})})})},Ur=Ge=>{Ge.on("ResolveName",qe=>{let It;qe.target.nodeType===1&&(It=qe.target.getAttribute("data-mce-object"))&&(qe.name=It)})},Bi=Ge=>qe=>{const It=()=>{qe.setEnabled(Ge.selection.isEditable())};return Ge.on("NodeChange",It),It(),()=>{Ge.off("NodeChange",It)}},Ba=Ge=>{const qe=()=>Ge.execCommand("mceMedia");Ge.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:qe,onSetup:It=>{const jt=Ge.selection;It.setActive(gn(jt.getNode()));const co=jt.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",It.setActive).unbind,Bo=Bi(Ge)(It);return()=>{co(),Bo()}}}),Ge.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:qe,onSetup:Bi(Ge)})};var hi=()=>{s.add("media",Ge=>(ne(Ge),ps(Ge),Ba(Ge),Ur(Ge),Vs(Ge),yt(Ge),an(Ge)))};hi()})();(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=(X,le,Se)=>{var Ye;return Se(X,le.prototype)?!0:((Ye=X.constructor)===null||Ye===void 0?void 0:Ye.name)===le.name},t=X=>{const le=typeof X;return X===null?"null":le==="object"&&Array.isArray(X)?"array":le==="object"&&e(X,String,(Se,Ye)=>Ye.isPrototypeOf(Se))?"string":le},r=X=>le=>t(le)===X,a=X=>le=>typeof le===X,u=r("string"),f=r("object"),h=r("array"),g=a("boolean"),y=X=>X==null,C=X=>!y(X),A=a("function"),O=a("number"),N=()=>{},L=X=>()=>X,j=(X,le)=>X===le;function z(X,...le){return(...Se)=>{const Ye=le.concat(Se);return X.apply(null,Ye)}}const q=X=>le=>!X(le),ee=L(!1);class F{constructor(le,Se){this.tag=le,this.value=Se}static some(le){return new F(!0,le)}static none(){return F.singletonNone}fold(le,Se){return this.tag?Se(this.value):le()}isSome(){return this.tag}isNone(){return!this.tag}map(le){return this.tag?F.some(le(this.value)):F.none()}bind(le){return this.tag?le(this.value):F.none()}exists(le){return this.tag&&le(this.value)}forall(le){return!this.tag||le(this.value)}filter(le){return!this.tag||le(this.value)?this:F.none()}getOr(le){return this.tag?this.value:le}or(le){return this.tag?this:le}getOrThunk(le){return this.tag?this.value:le()}orThunk(le){return this.tag?this:le()}getOrDie(le){if(this.tag)return this.value;throw new Error(le!=null?le:"Called getOrDie on None")}static from(le){return C(le)?F.some(le):F.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(le){this.tag&&le(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}F.singletonNone=new F(!1);const ne=Array.prototype.slice,oe=Array.prototype.indexOf,re=Array.prototype.push,J=(X,le)=>oe.call(X,le),we=(X,le)=>J(X,le)>-1,ye=(X,le)=>{for(let Se=0,Ye=X.length;Se<Ye;Se++){const rt=X[Se];if(le(rt,Se))return!0}return!1},De=(X,le)=>{const Se=X.length,Ye=new Array(Se);for(let rt=0;rt<Se;rt++){const On=X[rt];Ye[rt]=le(On,rt)}return Ye},_e=(X,le)=>{for(let Se=0,Ye=X.length;Se<Ye;Se++){const rt=X[Se];le(rt,Se)}},be=(X,le)=>{const Se=[];for(let Ye=0,rt=X.length;Ye<rt;Ye++){const On=X[Ye];le(On,Ye)&&Se.push(On)}return Se},tt=(X,le)=>{if(X.length===0)return[];{let Se=le(X[0]);const Ye=[];let rt=[];for(let On=0,wn=X.length;On<wn;On++){const Go=X[On],ns=le(Go);ns!==Se&&(Ye.push(rt),rt=[]),Se=ns,rt.push(Go)}return rt.length!==0&&Ye.push(rt),Ye}},Qe=(X,le,Se)=>(_e(X,(Ye,rt)=>{Se=le(Se,Ye,rt)}),Se),ft=(X,le,Se)=>{for(let Ye=0,rt=X.length;Ye<rt;Ye++){const On=X[Ye];if(le(On,Ye))return F.some(On);if(Se(On,Ye))break}return F.none()},V=(X,le)=>ft(X,le,ee),mt=X=>{const le=[];for(let Se=0,Ye=X.length;Se<Ye;++Se){if(!h(X[Se]))throw new Error("Arr.flatten item "+Se+" was not an array, input: "+X);re.apply(le,X[Se])}return le},nt=(X,le)=>mt(De(X,le)),Ot=X=>{const le=ne.call(X,0);return le.reverse(),le},Tt=(X,le)=>le>=0&&le<X.length?F.some(X[le]):F.none(),He=X=>Tt(X,0),ct=X=>Tt(X,X.length-1),dn=(X,le)=>{const Se=[],Ye=A(le)?rt=>ye(Se,On=>le(On,rt)):rt=>we(Se,rt);for(let rt=0,On=X.length;rt<On;rt++){const wn=X[rt];Ye(wn)||Se.push(wn)}return Se},kt=(X,le,Se=j)=>X.exists(Ye=>Se(Ye,le)),xn=(X,le,Se=j)=>We(X,le,Se).getOr(X.isNone()&&le.isNone()),We=(X,le,Se)=>X.isSome()&&le.isSome()?F.some(Se(X.getOrDie(),le.getOrDie())):F.none(),xt=1,he=(X,le)=>{const Ye=(le||document).createElement("div");if(Ye.innerHTML=X,!Ye.hasChildNodes()||Ye.childNodes.length>1){const rt="HTML does not have a single root node";throw console.error(rt,X),new Error(rt)}return ao(Ye.childNodes[0])},es=(X,le)=>{const Ye=(le||document).createElement(X);return ao(Ye)},ho=(X,le)=>{const Ye=(le||document).createTextNode(X);return ao(Ye)},ao=X=>{if(X==null)throw new Error("Node cannot be null or undefined");return{dom:X}},Yo={fromHtml:he,fromTag:es,fromText:ho,fromDom:ao,fromPoint:(X,le,Se)=>F.from(X.dom.elementFromPoint(le,Se)).map(ao)},Ct=(X,le)=>{const Se=X.dom;if(Se.nodeType!==xt)return!1;{const Ye=Se;if(Ye.matches!==void 0)return Ye.matches(le);if(Ye.msMatchesSelector!==void 0)return Ye.msMatchesSelector(le);if(Ye.webkitMatchesSelector!==void 0)return Ye.webkitMatchesSelector(le);if(Ye.mozMatchesSelector!==void 0)return Ye.mozMatchesSelector(le);throw new Error("Browser lacks native selectors")}},Jt=(X,le)=>X.dom===le.dom,Et=(X,le)=>{const Se=X.dom,Ye=le.dom;return Se===Ye?!1:Se.contains(Ye)},Pe=Ct;var Ut=(X,le,Se,Ye,rt)=>X(Se,Ye)?F.some(Se):A(rt)&&rt(Se)?F.none():le(Se,Ye,rt);typeof window<"u"||Function("return this;")();const gn=X=>X.dom.nodeName.toLowerCase(),yt=X=>X.dom.nodeType,bn=(X=>le=>yt(le)===X)(xt),rs=X=>le=>bn(le)&&gn(le)===X,Jn=X=>F.from(X.dom.parentNode).map(Yo.fromDom),ds=X=>F.from(X.dom.parentElement).map(Yo.fromDom),Or=X=>F.from(X.dom.nextSibling).map(Yo.fromDom),Ns=X=>De(X.dom.childNodes,Yo.fromDom),Js=(X,le)=>{const Se=X.dom.childNodes;return F.from(Se[le]).map(Yo.fromDom)},Zs=X=>Js(X,0),ba=X=>Js(X,X.dom.childNodes.length-1),ar=(X,le,Se)=>{let Ye=X.dom;const rt=A(Se)?Se:ee;for(;Ye.parentNode;){Ye=Ye.parentNode;const On=Yo.fromDom(Ye);if(le(On))return F.some(On);if(rt(On))break}return F.none()},Ps=(X,le,Se)=>Ut((rt,On)=>On(rt),ar,X,le,Se),Zr=(X,le)=>{Jn(X).each(Ye=>{Ye.dom.insertBefore(le.dom,X.dom)})},No=(X,le)=>{Or(X).fold(()=>{Jn(X).each(rt=>{Mo(rt,le)})},Ye=>{Zr(Ye,le)})},Mo=(X,le)=>{X.dom.appendChild(le.dom)},Mr=(X,le)=>{_e(le,Se=>{Zr(X,Se)})},Ls=(X,le)=>{_e(le,Se=>{Mo(X,Se)})},na=X=>{X.dom.textContent="",_e(Ns(X),le=>{gs(le)})},gs=X=>{const le=X.dom;le.parentNode!==null&&le.parentNode.removeChild(le)};var va=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),an=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ps=tinymce.util.Tools.resolve("tinymce.util.VK");const Ii=X=>De(X,Yo.fromDom),$e=Object.keys,Je=(X,le)=>{const Se=$e(X);for(let Ye=0,rt=Se.length;Ye<rt;Ye++){const On=Se[Ye],wn=X[On];le(wn,On)}},At=X=>(le,Se)=>{X[Se]=le},Wt=(X,le,Se,Ye)=>{Je(X,(rt,On)=>{(le(rt,On)?Se:Ye)(rt,On)})},Wn=(X,le)=>{const Se={};return Wt(X,le,At(Se),N),Se},lo=(X,le,Se)=>{if(u(Se)||g(Se)||O(Se))X.setAttribute(le,Se+"");else throw console.error("Invalid call to Attribute.set. Key ",le,":: Value ",Se,":: Element ",X),new Error("Attribute value was not simple")},go=(X,le)=>{const Se=X.dom;Je(le,(Ye,rt)=>{lo(Se,rt,Ye)})},cn=X=>Qe(X.dom.attributes,(le,Se)=>(le[Se.name]=Se.value,le),{}),ts=(X,le)=>Yo.fromDom(X.dom.cloneNode(le)),wo=X=>ts(X,!0),cs=(X,le)=>{const Se=Yo.fromTag(le),Ye=cn(X);return go(Se,Ye),Se},_r=(X,le)=>{const Se=cs(X,le);No(X,Se);const Ye=Ns(X);return Ls(Se,Ye),gs(X),Se};var Ir=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Vs=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ur=X=>le=>C(le)&&le.nodeName.toLowerCase()===X,Bi=X=>le=>C(le)&&X.test(le.nodeName),Ba=X=>C(X)&&X.nodeType===3,hi=X=>C(X)&&X.nodeType===1,Ge=Bi(/^(OL|UL|DL)$/),qe=Bi(/^(OL|UL)$/),It=Ur("ol"),jt=Bi(/^(LI|DT|DD)$/),co=Bi(/^(DT|DD)$/),Bo=Bi(/^(TH|TD)$/),qo=Ur("br"),Yr=X=>{var le;return((le=X.parentNode)===null||le===void 0?void 0:le.firstChild)===X},it=(X,le)=>C(le)&&le.nodeName in X.schema.getTextBlockElements(),Wo=(X,le)=>C(X)&&X.nodeName in le,Di=(X,le)=>C(le)&&le.nodeName in X.schema.getVoidElements(),oa=(X,le)=>qo(le)?X.isBlock(le.nextSibling)&&!qo(le.previousSibling):!1,ua=(X,le,Se)=>{const Ye=X.isEmpty(le);return Se&&X.select("span[data-mce-type=bookmark]",le).length>0?!1:Ye},ur=(X,le)=>X.isChildOf(le,X.getRoot()),Dc=X=>le=>le.options.get(X),gc=X=>{const le=X.options.register;le("lists_indent_on_tab",{processor:"boolean",default:!0})},Xa=Dc("lists_indent_on_tab"),fa=Dc("forced_root_block"),Qs=Dc("forced_root_block_attrs"),xr=(X,le)=>{const Se=X.dom,Ye=X.schema.getBlockElements(),rt=Se.createFragment(),On=fa(X),wn=Qs(X);let Go,ns,uo=!1;for(ns=Se.create(On,wn),Wo(le.firstChild,Ye)||rt.appendChild(ns);Go=le.firstChild;){const Sr=Go.nodeName;!uo&&(Sr!=="SPAN"||Go.getAttribute("data-mce-type")!=="bookmark")&&(uo=!0),Wo(Go,Ye)?(rt.appendChild(Go),ns=null):(ns||(ns=Se.create(On,wn),rt.appendChild(ns)),ns.appendChild(Go))}return!uo&&ns&&ns.appendChild(Se.create("br",{"data-mce-bogus":"1"})),rt},Ki=Ir.DOM,fl=(X,le,Se)=>{const Ye=uo=>{const Sr=uo.parentNode;Sr&&Vs.each(rt,Zl=>{Sr.insertBefore(Zl,Se.parentNode)}),Ki.remove(uo)},rt=Ki.select('span[data-mce-type="bookmark"]',le),On=xr(X,Se),wn=Ki.createRng();wn.setStartAfter(Se),wn.setEndAfter(le);const Go=wn.extractContents();for(let uo=Go.firstChild;uo;uo=uo.firstChild)if(uo.nodeName==="LI"&&X.dom.isEmpty(uo)){Ki.remove(uo);break}X.dom.isEmpty(Go)||Ki.insertAfter(Go,le),Ki.insertAfter(On,le);const ns=Se.parentElement;ns&&ua(X.dom,ns)&&Ye(ns),Ki.remove(Se),ua(X.dom,le)&&Ki.remove(le)},pc=rs("dd"),Zc=rs("dt"),gu=(X,le)=>{pc(le)?_r(le,"dt"):Zc(le)&&ds(le).each(Se=>fl(X,Se.dom,le.dom))},gr=X=>{Zc(X)&&_r(X,"dd")},Ja=(X,le,Se)=>{le==="Indent"?_e(Se,gr):_e(Se,Ye=>gu(X,Ye))},pu=(X,le)=>{if(Ba(X))return{container:X,offset:le};const Se=va.getNode(X,le);return Ba(Se)?{container:Se,offset:le>=X.childNodes.length?Se.data.length:0}:Se.previousSibling&&Ba(Se.previousSibling)?{container:Se.previousSibling,offset:Se.previousSibling.data.length}:Se.nextSibling&&Ba(Se.nextSibling)?{container:Se.nextSibling,offset:0}:{container:X,offset:le}},qc=X=>{const le=X.cloneRange(),Se=pu(X.startContainer,X.startOffset);le.setStart(Se.container,Se.offset);const Ye=pu(X.endContainer,X.endOffset);return le.setEnd(Ye.container,Ye.offset),le},Vl=["OL","UL","DL"],xa=Vl.join(","),Ar=(X,le)=>{const Se=le||X.selection.getStart(!0);return X.dom.getParent(Se,xa,Fa(X,Se))},Rm=(X,le)=>C(X)&&le.length===1&&le[0]===X,pf=X=>be(X.querySelectorAll(xa),Ge),Cr=X=>{const le=Ar(X),Se=X.selection.getSelectedBlocks();return Rm(le,Se)?pf(le):be(Se,Ye=>Ge(Ye)&&le!==Ye)},La=(X,le)=>{const Se=Vs.map(le,Ye=>{const rt=X.dom.getParent(Ye,"li,dd,dt",Fa(X,Ye));return rt||Ye});return dn(Se)},sa=X=>{const le=X.selection.getSelectedBlocks();return be(La(X,le),jt)},Yi=X=>be(sa(X),co),bu=(X,le)=>{const Se=X.dom.getParents(le,"TD,TH");return Se.length>0?Se[0]:X.getBody()},Oc=(X,le)=>!Ge(le)&&!jt(le)&&ye(Vl,Se=>X.isValidChild(le.nodeName,Se)),Fa=(X,le)=>{const Se=X.dom.getParents(le,X.dom.isBlock);return V(Se,rt=>Oc(X.schema,rt)).getOr(X.getBody())},Mc=(X,le)=>{const Se=X.dom.getParents(le,"ol,ul",Fa(X,le));return ct(Se)},bc=X=>{const le=Mc(X,X.selection.getStart()),Se=be(X.selection.getSelectedBlocks(),qe);return le.toArray().concat(Se)},gd=X=>{const le=bc(X);return Lf(X,le)},Lf=(X,le)=>{const Se=De(le,Ye=>Mc(X,Ye).getOr(Ye));return dn(Se)},vu=X=>/\btox\-/.test(X.className),Ul=(X,le)=>ft(X,Ge,Bo).exists(Se=>Se.nodeName===le&&!vu(Se)),Rc=(X,le)=>le!==null&&!X.dom.isEditable(le),bf=X=>{const le=Ar(X);return Rc(X,le)},Gc=(X,le)=>{const Se=X.dom.getParent(le,"ol,ul,dl");return Rc(X,Se)},pd=(X,le)=>{const Se=X.selection.getNode();return le({parents:X.dom.getParents(Se),element:Se}),X.on("NodeChange",le),()=>X.off("NodeChange",le)},Ae=(X,le)=>{const Ye=(le||document).createDocumentFragment();return _e(X,rt=>{Ye.appendChild(rt.dom)}),Yo.fromDom(Ye)},et=(X,le,Se)=>X.dispatch("ListMutation",{action:le,element:Se}),Pt=(X=>le=>le.replace(X,""))(/^\s+|\s+$/g),vn=X=>X.length>0,Ro=X=>!vn(X),Rr=X=>X.style!==void 0&&A(X.style.getPropertyValue),vs=(X,le,Se)=>{if(!u(Se))throw console.error("Invalid call to CSS.set. Property ",le,":: Value ",Se,":: Element ",X),new Error("CSS value must be a string: "+Se);Rr(X)&&X.style.setProperty(le,Se)},is=(X,le,Se)=>{const Ye=X.dom;vs(Ye,le,Se)},ki=(X,le)=>{Mo(X.item,le.list)},qs=X=>{for(let le=1;le<X.length;le++)ki(X[le-1],X[le])},Li=(X,le)=>{We(ct(X),He(le),ki)},yu=(X,le)=>{const Se={list:Yo.fromTag(le,X),item:Yo.fromTag("li",X)};return Mo(Se.list,Se.item),Se},bd=(X,le,Se)=>{const Ye=[];for(let rt=0;rt<Se;rt++)Ye.push(yu(X,le.listType));return Ye},Kn=(X,le)=>{for(let Se=0;Se<X.length-1;Se++)is(X[Se].item,"list-style-type","none");ct(X).each(Se=>{go(Se.list,le.listAttributes),go(Se.item,le.itemAttributes),Ls(Se.item,le.content)})},Nm=(X,le)=>{gn(X.list)!==le.listType&&(X.list=_r(X.list,le.listType)),go(X.list,le.listAttributes)},Fi=(X,le,Se)=>{const Ye=Yo.fromTag("li",X);return go(Ye,le),Ls(Ye,Se),Ye},de=(X,le)=>{Mo(X.list,le),X.item=le},Me=(X,le,Se)=>{const Ye=le.slice(0,Se.depth);return ct(Ye).each(rt=>{const On=Fi(X,Se.itemAttributes,Se.content);de(rt,On),Nm(rt,Se)}),Ye},je=(X,le,Se)=>{const Ye=bd(X,Se,Se.depth-le.length);return qs(Ye),Kn(Ye,Se),Li(le,Ye),le.concat(Ye)},Bt=(X,le)=>{const Se=Qe(le,(Ye,rt)=>rt.depth>Ye.length?je(X,Ye,rt):Me(X,Ye,rt),[]);return He(Se).map(Ye=>Ye.list)},Ln=X=>Pe(X,"OL,UL"),Xo=X=>Zs(X).exists(Ln),no=X=>ba(X).exists(Ln),mi=X=>X.depth>0,hn=X=>X.isSelected,qr=X=>{const le=Ns(X),Se=no(X)?le.slice(0,-1):le;return De(Se,wo)},Nl=(X,le,Se)=>Jn(X).filter(bn).map(Ye=>({depth:le,dirty:!1,isSelected:Se,content:qr(X),itemAttributes:cn(X),listAttributes:cn(Ye),listType:gn(Ye)})),Xi=(X,le)=>{switch(X){case"Indent":le.depth++;break;case"Outdent":le.depth--;break;case"Flatten":le.depth=0}le.dirty=!0},ni=(X,le)=>{X.listType=le.listType,X.listAttributes={...le.listAttributes}},vf=X=>{X.listAttributes=Wn(X.listAttributes,(le,Se)=>Se!=="start")},Ss=(X,le)=>{const Se=X[le].depth,Ye=On=>On.depth===Se&&!On.dirty,rt=On=>On.depth<Se;return ft(Ot(X.slice(0,le)),Ye,rt).orThunk(()=>ft(X.slice(le+1),Ye,rt))},Kc=X=>(_e(X,(le,Se)=>{Ss(X,Se).fold(()=>{le.dirty&&vf(le)},Ye=>ni(le,Ye))}),X),Ei=X=>{let le=X;return{get:()=>le,set:rt=>{le=rt}}},sc=(X,le,Se,Ye)=>Zs(Ye).filter(Ln).fold(()=>{le.each(wn=>{Jt(wn.start,Ye)&&Se.set(!0)});const rt=Nl(Ye,X,Se.get());le.each(wn=>{Jt(wn.end,Ye)&&Se.set(!1)});const On=ba(Ye).filter(Ln).map(wn=>Oi(X,le,Se,wn)).getOr([]);return rt.toArray().concat(On)},rt=>Oi(X,le,Se,rt)),Oi=(X,le,Se,Ye)=>nt(Ns(Ye),rt=>{const On=Ln(rt)?Oi:sc,wn=X+1;return On(wn,le,Se,rt)}),Ff=(X,le)=>{const Se=Ei(!1),Ye=0;return De(X,rt=>({sourceList:rt,entries:Oi(Ye,le,Se,rt)}))},da=(X,le)=>{const Se=Kc(le);return De(Se,Ye=>{const rt=Ae(Ye.content);return Yo.fromDom(xr(X,rt.dom))})},Hf=(X,le)=>{const Se=Kc(le);return Bt(X.contentDocument,Se).toArray()},fr=(X,le)=>nt(tt(le,mi),Se=>He(Se).exists(mi)?Hf(X,Se):da(X,Se)),zu=(X,le)=>{_e(be(X,hn),Se=>Xi(le,Se))},Vu=X=>{const le=De(sa(X),Yo.fromDom);return We(V(le,q(Xo)),V(Ot(le),q(Xo)),(Se,Ye)=>({start:Se,end:Ye}))},vc=(X,le,Se)=>{const Ye=Ff(le,Vu(X));_e(Ye,rt=>{zu(rt.entries,Se);const On=fr(X,rt.entries);_e(On,wn=>{et(X,Se==="Indent"?"IndentList":"OutdentList",wn.dom)}),Mr(rt.sourceList,On),gs(rt.sourceList)})},$f=(X,le)=>{const Se=Ii(gd(X)),Ye=Ii(Yi(X));let rt=!1;if(Se.length||Ye.length){const On=X.selection.getBookmark();vc(X,Se,le),Ja(X,le,Ye),X.selection.moveToBookmark(On),X.selection.setRng(qc(X.selection.getRng())),X.nodeChanged(),rt=!0}return rt},jd=(X,le)=>!bf(X)&&$f(X,le),Xr=X=>jd(X,"Indent"),Ji=X=>jd(X,"Outdent"),Ha=X=>jd(X,"Flatten"),U0="\uFEFF",xi=X=>X===U0,_l=(X,le,Se)=>ar(X,le,Se).isSome(),Qa=(X,le)=>_l(X,z(Jt,le));var Ng=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const zf=Ir.DOM,yc=X=>{const le={},Se=Ye=>{let rt=X[Ye?"startContainer":"endContainer"],On=X[Ye?"startOffset":"endOffset"];if(hi(rt)){const wn=zf.create("span",{"data-mce-type":"bookmark"});rt.hasChildNodes()?(On=Math.min(On,rt.childNodes.length-1),Ye?rt.insertBefore(wn,rt.childNodes[On]):zf.insertAfter(wn,rt.childNodes[On])):rt.appendChild(wn),rt=wn,On=0}le[Ye?"startContainer":"endContainer"]=rt,le[Ye?"startOffset":"endOffset"]=On};return Se(!0),X.collapsed||Se(),le},yf=X=>{const le=Ye=>{const rt=Go=>{var ns;let uo=(ns=Go.parentNode)===null||ns===void 0?void 0:ns.firstChild,Sr=0;for(;uo;){if(uo===Go)return Sr;(!hi(uo)||uo.getAttribute("data-mce-type")!=="bookmark")&&Sr++,uo=uo.nextSibling}return-1};let On=X[Ye?"startContainer":"endContainer"],wn=X[Ye?"startOffset":"endOffset"];if(!!On){if(hi(On)&&On.parentNode){const Go=On;wn=rt(On),On=On.parentNode,zf.remove(Go),!On.hasChildNodes()&&zf.isBlock(On)&&On.appendChild(zf.create("br"))}X[Ye?"startContainer":"endContainer"]=On,X[Ye?"startOffset":"endOffset"]=wn}};le(!0),le();const Se=zf.createRng();return Se.setStart(X.startContainer,X.startOffset),X.endContainer&&Se.setEnd(X.endContainer,X.endOffset),qc(Se)},Tr=X=>{switch(X){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Uu=(X,le,Se)=>{const Ye=Se["list-style-type"]?Se["list-style-type"]:null;X.setStyle(le,"list-style-type",Ye)},Pl=(X,le)=>{Vs.each(le,(Se,Ye)=>{X.setAttribute(Ye,Se)})},$a=(X,le,Se)=>{Pl(le,Se["list-attributes"]),Vs.each(X.select("li",le),Ye=>{Pl(Ye,Se["list-item-attributes"])})},qi=(X,le,Se)=>{Uu(X,le,Se),$a(X,le,Se)},Hi=(X,le,Se)=>{Vs.each(Se,Ye=>X.setStyle(le,Ye,""))},rc=(X,le)=>C(le)&&!Wo(le,X.schema.getBlockElements()),Vf=(X,le,Se,Ye)=>{let rt=le[Se?"startContainer":"endContainer"];const On=le[Se?"startOffset":"endOffset"];hi(rt)&&(rt=rt.childNodes[Math.min(On,rt.childNodes.length-1)]||rt),!Se&&qo(rt.nextSibling)&&(rt=rt.nextSibling);const wn=ns=>{for(;!X.dom.isBlock(ns)&&ns.parentNode&&Ye!==ns;)ns=ns.parentNode;return ns},Go=(ns,uo)=>{var Sr;const Zl=new an(ns,wn(ns)),ra=uo?"next":"prev";let Mi;for(;Mi=Zl[ra]();)if(!(Di(X,Mi)||xi(Mi.textContent)||((Sr=Mi.textContent)===null||Sr===void 0?void 0:Sr.length)===0))return F.some(Mi);return F.none()};if(Se&&Ba(rt))if(xi(rt.textContent))rt=Go(rt,!1).getOr(rt);else for(rt.parentNode!==null&&rc(X,rt.parentNode)&&(rt=rt.parentNode);rt.previousSibling!==null&&(rc(X,rt.previousSibling)||Ba(rt.previousSibling));)rt=rt.previousSibling;if(!Se&&Ba(rt))if(xi(rt.textContent))rt=Go(rt,!0).getOr(rt);else for(rt.parentNode!==null&&rc(X,rt.parentNode)&&(rt=rt.parentNode);rt.nextSibling!==null&&(rc(X,rt.nextSibling)||Ba(rt.nextSibling));)rt=rt.nextSibling;for(;rt.parentNode!==Ye;){const ns=rt.parentNode;if(it(X,rt)||/^(TD|TH)$/.test(ns.nodeName))return rt;rt=ns}return rt},Zd=(X,le,Se)=>{const Ye=[],rt=X.dom,On=Vf(X,le,!0,Se),wn=Vf(X,le,!1,Se);let Go;const ns=[];for(let uo=On;uo&&(ns.push(uo),uo!==wn);uo=uo.nextSibling);return Vs.each(ns,uo=>{var Sr;if(it(X,uo)){Ye.push(uo),Go=null;return}if(rt.isBlock(uo)||qo(uo)){qo(uo)&&rt.remove(uo),Go=null;return}const Zl=uo.nextSibling;if(Ng.isBookmarkNode(uo)&&(Ge(Zl)||it(X,Zl)||!Zl&&uo.parentNode===Se)){Go=null;return}Go||(Go=rt.create("p"),(Sr=uo.parentNode)===null||Sr===void 0||Sr.insertBefore(Go,uo),Ye.push(Go)),Go.appendChild(uo)}),Ye},Pg=(X,le,Se)=>{const Ye=X.getStyle(le,"list-style-type");let rt=Se?Se["list-style-type"]:"";return rt=rt===null?"":rt,Ye===rt},Pm=(X,le)=>{const Se=X.selection.getStart(!0),Ye=Vf(X,le,!0,X.getBody());return Qa(Yo.fromDom(Ye),Yo.fromDom(le.commonAncestorContainer))?le.commonAncestorContainer:Se},Il=(X,le,Se)=>{const Ye=X.selection.getRng();let rt="LI";const On=Fa(X,Pm(X,Ye)),wn=X.dom;if(wn.getContentEditable(X.selection.getNode())==="false")return;le=le.toUpperCase(),le==="DL"&&(rt="DT");const Go=yc(Ye),ns=be(Zd(X,Ye,On),X.dom.isEditable);Vs.each(ns,uo=>{let Sr;const Zl=uo.previousSibling,ra=uo.parentNode;jt(ra)||(Zl&&Ge(Zl)&&Zl.nodeName===le&&Pg(wn,Zl,Se)?(Sr=Zl,uo=wn.rename(uo,rt),Zl.appendChild(uo)):(Sr=wn.create(le),ra.insertBefore(Sr,uo),Sr.appendChild(uo),uo=wn.rename(uo,rt)),Hi(wn,uo,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),qi(wn,Sr,Se),Wu(X.dom,Sr))}),X.selection.setRng(yf(Go))},Im=(X,le)=>Ge(X)&&X.nodeName===(le==null?void 0:le.nodeName),el=(X,le,Se)=>{const Ye=X.getStyle(le,"list-style-type",!0),rt=X.getStyle(Se,"list-style-type",!0);return Ye===rt},wf=(X,le)=>X.className===le.className,$h=(X,le,Se)=>Im(le,Se)&&el(X,le,Se)&&wf(le,Se),Wu=(X,le)=>{let Se,Ye=le.nextSibling;if($h(X,le,Ye)){const rt=Ye;for(;Se=rt.firstChild;)le.appendChild(Se);X.remove(rt)}if(Ye=le.previousSibling,$h(X,le,Ye)){const rt=Ye;for(;Se=rt.lastChild;)le.insertBefore(Se,le.firstChild);X.remove(rt)}},zh=(X,le,Se,Ye)=>{if(le.nodeName!==Se){const rt=X.dom.rename(le,Se);qi(X.dom,rt,Ye),et(X,Tr(Se),rt)}else qi(X.dom,le,Ye),et(X,Tr(Se),le)},Nc=(X,le,Se,Ye)=>{if(le.classList.forEach((rt,On,wn)=>{rt.startsWith("tox-")&&(wn.remove(rt),wn.length===0&&le.removeAttribute("class"))}),le.nodeName!==Se){const rt=X.dom.rename(le,Se);qi(X.dom,rt,Ye),et(X,Tr(Se),rt)}else qi(X.dom,le,Ye),et(X,Tr(Se),le)},Vh=(X,le,Se,Ye,rt)=>{const On=Ge(le);if(On&&le.nodeName===Ye&&!_f(rt)&&!vu(le))Ha(X);else{Il(X,Ye,rt);const wn=yc(X.selection.getRng()),Go=On?[le,...Se]:Se,ns=On&&vu(le)?Nc:zh;Vs.each(Go,uo=>{ns(X,uo,Ye,rt)}),X.selection.setRng(yf(wn))}},_f=X=>"list-style-type"in X,Bp=(X,le,Se,Ye)=>{if(le!==X.getBody())if(le)if(le.nodeName===Se&&!_f(Ye)&&!vu(le))Ha(X);else{const rt=yc(X.selection.getRng());vu(le)&&le.classList.forEach((wn,Go,ns)=>{wn.startsWith("tox-")&&(ns.remove(wn),ns.length===0&&le.removeAttribute("class"))}),qi(X.dom,le,Ye);const On=X.dom.rename(le,Se);Wu(X.dom,On),X.selection.setRng(yf(rt)),Il(X,Se,Ye),et(X,Tr(Se),On)}else Il(X,Se,Ye),et(X,Tr(Se),le)},Bm=(X,le,Se)=>{const Ye=Ar(X);if(Gc(X,Ye))return;const rt=Cr(X),On=f(Se)?Se:{};rt.length>0?Vh(X,Ye,rt,le,On):Bp(X,Ye,le,On)},Uf=Ir.DOM,Wl=(X,le)=>{const Se=le.parentElement;if(Se&&Se.nodeName==="LI"&&Se.firstChild===le){const Ye=Se.previousSibling;Ye&&Ye.nodeName==="LI"?(Ye.appendChild(le),ua(X,Se)&&Uf.remove(Se)):Uf.setStyle(Se,"listStyleType","none")}if(Ge(Se)){const Ye=Se.previousSibling;Ye&&Ye.nodeName==="LI"&&Ye.appendChild(le)}},Ig=(X,le)=>{const Se=Vs.grep(X.select("ol,ul",le));Vs.each(Se,Ye=>{Wl(X,Ye)})},Ke=(X,le,Se,Ye)=>{let rt=le.startContainer;const On=le.startOffset;if(Ba(rt)&&(Se?On<rt.data.length:On>0))return rt;const wn=X.schema.getNonEmptyElements();hi(rt)&&(rt=va.getNode(rt,On));const Go=new an(rt,Ye);Se&&oa(X.dom,rt)&&Go.next();const ns=Se?Go.next.bind(Go):Go.prev2.bind(Go);for(;rt=ns();)if(rt.nodeName==="LI"&&!rt.hasChildNodes()||wn[rt.nodeName]||Ba(rt)&&rt.data.length>0)return rt;return null},qd=(X,le)=>{const Se=le.childNodes;return Se.length===1&&!Ge(Se[0])&&X.isBlock(Se[0])},wu=(X,le)=>{qd(X,le)&&X.remove(le.firstChild,!0)},Bg=(X,le,Se)=>{let Ye;const rt=qd(X,Se)?Se.firstChild:Se;if(wu(X,le),!ua(X,le,!0))for(;Ye=le.firstChild;)rt.appendChild(Ye)},L1=(X,le,Se)=>{let Ye;const rt=le.parentNode;if(!ur(X,le)||!ur(X,Se))return;Ge(Se.lastChild)&&(Ye=Se.lastChild),rt===Se.lastChild&&qo(rt.previousSibling)&&X.remove(rt.previousSibling);const On=Se.lastChild;On&&qo(On)&&le.hasChildNodes()&&X.remove(On),ua(X,Se,!0)&&na(Yo.fromDom(Se)),Bg(X,le,Se),Ye&&Se.appendChild(Ye);const Go=Et(Yo.fromDom(Se),Yo.fromDom(le))?X.getParents(le,Ge,Se):[];X.remove(le),_e(Go,ns=>{ua(X,ns)&&ns!==X.getRoot()&&X.remove(ns)})},Uh=(X,le,Se)=>{na(Yo.fromDom(Se)),L1(X.dom,le,Se),X.selection.setCursorLocation(Se,0)},pt=(X,le,Se,Ye)=>{const rt=X.dom;if(rt.isEmpty(Ye))Uh(X,Se,Ye);else{const On=yc(le);L1(rt,Se,Ye),X.selection.setRng(yf(On))}},ln=(X,le,Se,Ye)=>{const rt=yc(le);L1(X.dom,Se,Ye);const On=yf(rt);X.selection.setRng(On)},nn=(X,le)=>{const Se=X.dom,Ye=X.selection,rt=Ye.getStart(),On=bu(X,rt),wn=Se.getParent(Ye.getStart(),"LI",On);if(wn){const Go=wn.parentElement;if(Go===X.getBody()&&ua(Se,Go))return!0;const ns=qc(Ye.getRng()),uo=Se.getParent(Ke(X,ns,le,On),"LI",On);if(uo&&uo!==wn)return X.undoManager.transact(()=>{le?pt(X,ns,uo,wn):Yr(wn)?Ji(X):ln(X,ns,wn,uo)}),!0;if(!uo&&!le&&ns.startOffset===0&&ns.endOffset===0)return X.undoManager.transact(()=>{Ha(X)}),!0}return!1},Eo=(X,le,Se)=>{const Ye=X.getParent(le.parentNode,X.isBlock,Se);X.remove(le),Ye&&X.isEmpty(Ye)&&X.remove(Ye)},er=(X,le)=>{const Se=X.dom,Ye=X.selection.getStart(),rt=bu(X,Ye),On=Se.getParent(Ye,Se.isBlock,rt);if(On&&Se.isEmpty(On)){const wn=qc(X.selection.getRng()),Go=Se.getParent(Ke(X,wn,le,rt),"LI",rt);if(Go){const ns=ra=>we(["td","th","caption"],gn(ra)),uo=ra=>ra.dom===rt,Sr=Ps(Yo.fromDom(Go),ns,uo),Zl=Ps(Yo.fromDom(wn.startContainer),ns,uo);return xn(Sr,Zl,Jt)?(X.undoManager.transact(()=>{const ra=Go.parentNode;Eo(Se,On,rt),Wu(Se,ra),X.selection.select(Go,!0),X.selection.collapse(le)}),!0):!1}}return!1},Wr=(X,le)=>nn(X,le)||er(X,le),ai=X=>{const le=X.selection.getStart(),Se=bu(X,le);return X.dom.getParent(le,"LI,DT,DD",Se)||sa(X).length>0},gi=X=>ai(X)?(X.undoManager.transact(()=>{X.execCommand("Delete"),Ig(X.dom,X.getBody())}),!0):!1,Gd=(X,le)=>{const Se=X.selection;return!Gc(X,Se.getNode())&&(Se.isCollapsed()?Wr(X,le):gi(X))},W0=X=>{X.on("ExecCommand",le=>{const Se=le.command.toLowerCase();(Se==="delete"||Se==="forwarddelete")&&ai(X)&&Ig(X.dom,X.getBody())}),X.on("keydown",le=>{le.keyCode===ps.BACKSPACE?Gd(X,!1)&&le.preventDefault():le.keyCode===ps.DELETE&&Gd(X,!0)&&le.preventDefault()})},ya=X=>({backspaceDelete:le=>{Gd(X,le)}}),vd=(X,le)=>{const Se=Ar(X);Se===null||Gc(X,Se)||X.undoManager.transact(()=>{f(le.styles)&&X.dom.setStyles(Se,le.styles),f(le.attrs)&&Je(le.attrs,(Ye,rt)=>X.dom.setAttrib(Se,rt,Ye))})},Lg=X=>{const le=Ot(Pt(X).split("")),Se=De(le,(Ye,rt)=>{const On=Ye.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,rt)*On});return Qe(Se,(Ye,rt)=>Ye+rt,0)},tl=X=>{if(X--,X<0)return"";{const le=X%26,Se=Math.floor(X/26),Ye=tl(Se),rt=String.fromCharCode("A".charCodeAt(0)+le);return Ye+rt}},Aa=X=>/^[A-Z]+$/.test(X),ju=X=>/^[a-z]+$/.test(X),oi=X=>/^[0-9]+$/.test(X),_u=X=>oi(X)?2:Aa(X)?0:ju(X)?1:Ro(X)?3:4,ic=X=>{switch(_u(X)){case 2:return F.some({listStyleType:F.none(),start:X});case 0:return F.some({listStyleType:F.some("upper-alpha"),start:Lg(X).toString()});case 1:return F.some({listStyleType:F.some("lower-alpha"),start:Lg(X).toString()});case 3:return F.some({listStyleType:F.none(),start:""});case 4:return F.none()}},Wh=X=>{const le=parseInt(X.start,10);return kt(X.listStyleType,"upper-alpha")?tl(le):kt(X.listStyleType,"lower-alpha")?tl(le).toLowerCase():X.start},F1=X=>{const le=Ar(X);!It(le)||Gc(X,le)||X.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:Wh({start:X.dom.getAttrib(le,"start","1"),listStyleType:F.from(X.dom.getStyle(le,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:Se=>{const Ye=Se.getData();ic(Ye.start).each(rt=>{X.execCommand("mceListUpdate",!1,{attrs:{start:rt.start==="1"?"":rt.start},styles:{"list-style-type":rt.listStyleType.getOr("")}})}),Se.close()}})},Kd=(X,le)=>()=>{const Se=Ar(X);return C(Se)&&Se.nodeName===le},Fg=X=>{X.addCommand("mceListProps",()=>{F1(X)})},Yd=X=>{X.on("BeforeExecCommand",le=>{const Se=le.command.toLowerCase();Se==="indent"?Xr(X):Se==="outdent"&&Ji(X)}),X.addCommand("InsertUnorderedList",(le,Se)=>{Bm(X,"UL",Se)}),X.addCommand("InsertOrderedList",(le,Se)=>{Bm(X,"OL",Se)}),X.addCommand("InsertDefinitionList",(le,Se)=>{Bm(X,"DL",Se)}),X.addCommand("RemoveList",()=>{Ha(X)}),Fg(X),X.addCommand("mceListUpdate",(le,Se)=>{f(Se)&&vd(X,Se)}),X.addQueryStateHandler("InsertUnorderedList",Kd(X,"UL")),X.addQueryStateHandler("InsertOrderedList",Kd(X,"OL")),X.addQueryStateHandler("InsertDefinitionList",Kd(X,"DL"))};var jl=tinymce.util.Tools.resolve("tinymce.html.Node");const jh=X=>X.type===3,H1=X=>X.length===0,Lm=X=>{const le=(rt,On)=>{const wn=jl.create("li");_e(rt,Go=>wn.append(Go)),On?X.insert(wn,On,!0):X.append(wn)},Se=(rt,On)=>jh(On)?[...rt,On]:!H1(rt)&&!jh(On)?(le(rt,On),[]):rt,Ye=Qe(X.children(),Se,[]);H1(Ye)||le(Ye)},Hg=X=>{X.on("PreInit",()=>{const{parser:le}=X;le.addNodeFilter("ul,ol",Se=>_e(Se,Lm))})},Zh=X=>{X.on("keydown",le=>{le.keyCode!==ps.TAB||ps.metaKeyPressed(le)||X.undoManager.transact(()=>{(le.shiftKey?Ji(X):Xr(X))&&le.preventDefault()})})},Xd=X=>{Xa(X)&&Zh(X),W0(X)},yd=(X,le)=>Se=>{const Ye=rt=>{Se.setActive(Ul(rt.parents,le)),Se.setEnabled(!Gc(X,rt.element)&&X.selection.isEditable())};return Se.setEnabled(X.selection.isEditable()),pd(X,Ye)},si=X=>{const le=Se=>()=>X.execCommand(Se);X.hasPlugin("advlist")||(X.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:le("InsertOrderedList"),onSetup:yd(X,"OL")}),X.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:le("InsertUnorderedList"),onSetup:yd(X,"UL")}))},li=(X,le)=>Se=>pd(X,rt=>Se.setEnabled(Ul(rt.parents,le)&&!Gc(X,rt.element))),Bl=X=>{const le={text:"List properties...",icon:"ordered-list",onAction:()=>X.execCommand("mceListProps"),onSetup:li(X,"OL")};X.ui.registry.addMenuItem("listprops",le),X.ui.registry.addContextMenu("lists",{update:Se=>{const Ye=Ar(X,Se);return It(Ye)?["listprops"]:[]}})};var Lp=()=>{s.add("lists",X=>(gc(X),Hg(X),X.hasPlugin("rtc",!0)?Fg(X):(Xd(X),Yd(X)),si(X),Bl(X),ya(X)))};Lp()})();(function(){const s=F=>{let ne=F;return{get:()=>ne,set:J=>{ne=J}}};var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=F=>()=>F;var r=tinymce.util.Tools.resolve("tinymce.Env");const a=F=>F.dispatch("ResizeEditor"),u=F=>ne=>ne.options.get(F),f=F=>{const ne=F.options.register;ne("autoresize_overflow_padding",{processor:"number",default:1}),ne("autoresize_bottom_margin",{processor:"number",default:50})},h=u("min_height"),g=u("max_height"),y=u("autoresize_overflow_padding"),C=u("autoresize_bottom_margin"),A=F=>F.plugins.fullscreen&&F.plugins.fullscreen.isFullscreen(),O=(F,ne)=>{const oe=F.getBody();oe&&(oe.style.overflowY=ne?"":"hidden",ne||(oe.scrollTop=0))},N=(F,ne,oe,re)=>{var J;const we=parseInt((J=F.getStyle(ne,oe,re))!==null&&J!==void 0?J:"",10);return isNaN(we)?0:we},L=F=>{if((F==null?void 0:F.type.toLowerCase())==="setcontent"){const ne=F;return ne.selection===!0||ne.paste===!0}else return!1},j=(F,ne,oe,re)=>{var J;const we=F.dom,ye=F.getDoc();if(!ye)return;if(A(F)){O(F,!0);return}const De=ye.documentElement,_e=re?re():y(F),be=(J=h(F))!==null&&J!==void 0?J:F.getElement().offsetHeight;let tt=be;const Qe=N(we,De,"margin-top",!0),ft=N(we,De,"margin-bottom",!0);let V=De.offsetHeight+Qe+ft+_e;V<0&&(V=0);const mt=F.getContainer().offsetHeight,nt=F.getContentAreaContainer().offsetHeight,Ot=mt-nt;V+Ot>be&&(tt=V+Ot);const Tt=g(F);if(Tt&&tt>Tt?(tt=Tt,O(F,!0)):O(F,!1),tt!==ne.get()){const He=tt-ne.get();if(we.setStyle(F.getContainer(),"height",tt+"px"),ne.set(tt),a(F),r.browser.isSafari()&&(r.os.isMacOS()||r.os.isiOS())){const ct=F.getWin();ct.scrollTo(ct.pageXOffset,ct.pageYOffset)}F.hasFocus()&&L(oe)&&F.selection.scrollIntoView(),(r.browser.isSafari()||r.browser.isChromium())&&He<0&&j(F,ne,oe,re)}},z=(F,ne)=>{let oe=()=>C(F),re,J;F.on("init",we=>{re=0;const ye=y(F),De=F.dom;De.setStyles(F.getDoc().documentElement,{height:"auto"}),r.browser.isEdge()||r.browser.isIE()?De.setStyles(F.getBody(),{paddingLeft:ye,paddingRight:ye,"min-height":0}):De.setStyles(F.getBody(),{paddingLeft:ye,paddingRight:ye}),j(F,ne,we,oe),re+=1}),F.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",we=>{if(re===1)J=F.getContainer().offsetHeight,j(F,ne,we,oe),re+=1;else if(re===2){const ye=J<F.getContainer().offsetHeight;if(ye){const De=F.dom,_e=F.getDoc();De.setStyles(_e.documentElement,{"min-height":0}),De.setStyles(F.getBody(),{"min-height":"inherit"})}oe=ye?t(0):oe,re+=1}else j(F,ne,we,oe)})},q=(F,ne)=>{F.addCommand("mceAutoResize",()=>{j(F,ne)})};var ee=()=>{e.add("autoresize",F=>{if(f(F),F.options.isSet("resize")||F.options.set("resize",!1),!F.inline){const ne=s(0);q(F,ne),z(F,ne)}})};ee()})();(function(){var s=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(Ct=>Jt=>Ct===Jt)(null),r=Ct=>Ct,a=(Ct,Jt)=>{const Et=Ct.length,Pe=new Array(Et);for(let Ut=0;Ut<Et;Ut++){const gn=Ct[Ut];Pe[Ut]=Jt(gn,Ut)}return Pe},f={aletter:"[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F3\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1A00-\u1A16\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BC0-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790\uA791\uA7A0-\uA7A9\uA7FA-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]",midnumlet:"[-'\\.\u2018\u2019\u2024\uFE52\uFF07\uFF0E]",midletter:"[:\xB7\xB7\u05F4\u2027\uFE13\uFE55\uFF1A]",midnum:"[\xB1+*/,;;\u0589\u060C\u060D\u066C\u07F8\u2044\uFE10\uFE14\uFE50\uFE54\uFF0C\uFF1B]",numeric:"[0-9\u0660-\u0669\u066B\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9]",cr:"\\r",lf:"\\n",newline:"[\v\f\x85\u2028\u2029]",extend:"[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B6-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAA\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2\u1DC0-\u1DE6\u1DFC-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA67C\uA67D\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26\uFF9E\uFF9F]",format:"[\xAD\u0600-\u0603\u06DD\u070F\u17B4\u17B5\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\uFEFF\uFFF9-\uFFFB]",katakana:"[\u3031-\u3035\u309B\u309C\u30A0-\u30FA\u30FC-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF9D]",extendnumlet:"[=_\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F\u2200-\u22FF<>]",punctuation:"[~\u2116|!-*+-\\/:;?@\\[-`{}\xA1\xAB\xB7\xBB\xBF;\xB7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]"},h={ALETTER:0,MIDNUMLET:1,MIDLETTER:2,MIDNUM:3,NUMERIC:4,CR:5,LF:6,NEWLINE:7,EXTEND:8,FORMAT:9,KATAKANA:10,EXTENDNUMLET:11,AT:12,OTHER:13},g=[new RegExp(f.aletter),new RegExp(f.midnumlet),new RegExp(f.midletter),new RegExp(f.midnum),new RegExp(f.numeric),new RegExp(f.cr),new RegExp(f.lf),new RegExp(f.newline),new RegExp(f.extend),new RegExp(f.format),new RegExp(f.katakana),new RegExp(f.extendnumlet),new RegExp("@")],y="",C=new RegExp("^"+f.punctuation+"$"),A=/^\s+$/,O=g,N=h.OTHER,L=Ct=>{let Jt=N;const Et=O.length;for(let Pe=0;Pe<Et;++Pe){const Ut=O[Pe];if(Ut&&Ut.test(Ct)){Jt=Pe;break}}return Jt},j=Ct=>{const Jt={};return Et=>{if(Jt[Et])return Jt[Et];{const Pe=Ct(Et);return Jt[Et]=Pe,Pe}}},z=Ct=>{const Jt=j(L);return a(Ct,Jt)},q=(Ct,Jt)=>{const Et=Ct[Jt],Pe=Ct[Jt+1];if(Jt<0||Jt>Ct.length-1&&Jt!==0||Et===h.ALETTER&&Pe===h.ALETTER)return!1;const Ut=Ct[Jt+2];if(Et===h.ALETTER&&(Pe===h.MIDLETTER||Pe===h.MIDNUMLET||Pe===h.AT)&&Ut===h.ALETTER)return!1;const gn=Ct[Jt-1];return(Et===h.MIDLETTER||Et===h.MIDNUMLET||Pe===h.AT)&&Pe===h.ALETTER&&gn===h.ALETTER||(Et===h.NUMERIC||Et===h.ALETTER)&&(Pe===h.NUMERIC||Pe===h.ALETTER)||(Et===h.MIDNUM||Et===h.MIDNUMLET)&&Pe===h.NUMERIC&&gn===h.NUMERIC||Et===h.NUMERIC&&(Pe===h.MIDNUM||Pe===h.MIDNUMLET)&&Ut===h.NUMERIC||(Et===h.EXTEND||Et===h.FORMAT)&&(Pe===h.ALETTER||Pe===h.NUMERIC||Pe===h.KATAKANA||Pe===h.EXTEND||Pe===h.FORMAT)||(Pe===h.EXTEND||Pe===h.FORMAT&&(Ut===h.ALETTER||Ut===h.NUMERIC||Ut===h.KATAKANA||Ut===h.EXTEND||Ut===h.FORMAT))&&(Et===h.ALETTER||Et===h.NUMERIC||Et===h.KATAKANA||Et===h.EXTEND||Et===h.FORMAT)||Et===h.CR&&Pe===h.LF?!1:Et===h.NEWLINE||Et===h.CR||Et===h.LF||Pe===h.NEWLINE||Pe===h.CR||Pe===h.LF?!0:!(Et===h.KATAKANA&&Pe===h.KATAKANA||Pe===h.EXTENDNUMLET&&(Et===h.ALETTER||Et===h.NUMERIC||Et===h.KATAKANA||Et===h.EXTENDNUMLET)||Et===h.EXTENDNUMLET&&(Pe===h.ALETTER||Pe===h.NUMERIC||Pe===h.KATAKANA)||Et===h.AT)},ee=y,F=A,ne=C,oe=Ct=>Ct==="http"||Ct==="https",re=(Ct,Jt)=>{let Et;for(Et=Jt;Et<Ct.length&&!F.test(Ct[Et]);Et++);return Et},J=(Ct,Jt)=>{const Et=re(Ct,Jt+1);return Ct.slice(Jt+1,Et).join(ee).substr(0,3)==="://"?Et:Jt},we=(Ct,Jt,Et,Pe)=>{const Ut=[],gn=[];let yt=[];for(let Yt=0;Yt<Et.length;++Yt)if(yt.push(Ct[Yt]),q(Et,Yt)){const bn=Jt[Yt];if((Pe.includeWhitespace||!F.test(bn))&&(Pe.includePunctuation||!ne.test(bn))){const rs=Yt-yt.length+1,Jn=Yt+1,ds=Jt.slice(rs,Jn).join(ee);if(oe(ds)){const Or=J(Jt,Yt),Ns=Ct.slice(Jn,Or);Array.prototype.push.apply(yt,Ns),Yt=Or}Ut.push(yt),gn.push({start:rs,end:Jn})}yt=[]}return{words:Ut,indices:gn}},ye=()=>({includeWhitespace:!1,includePunctuation:!1}),De=(Ct,Jt,Et)=>{Et={...ye(),...Et};const Pe=a(Ct,Jt),Ut=z(Pe);return we(Ct,Pe,Ut,Et)},be=(Ct,Jt,Et)=>De(Ct,Jt,Et).words,tt=Ct=>Ct.replace(/\uFEFF/g,"");var Qe=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const ft=(Ct,Jt)=>{const Et=Jt.getBlockElements(),Pe=Jt.getVoidElements(),Ut=rs=>Et[rs.nodeName]||Pe[rs.nodeName],gn=[];let yt="";const Yt=new Qe(Ct,Ct);let bn;for(;bn=Yt.next();)bn.nodeType===3?yt+=tt(bn.data):Ut(bn)&&yt.length&&(gn.push(yt),yt="");return yt.length&&gn.push(yt),gn},V=Ct=>Ct.replace(/\u200B/g,""),mt=Ct=>Ct.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length,nt=(Ct,Jt)=>{const Et=V(ft(Ct,Jt).join(`
`));return be(Et.split(""),r).length},Ot=(Ct,Jt)=>{const Et=ft(Ct,Jt).join("");return mt(Et)},Tt=(Ct,Jt)=>{const Et=ft(Ct,Jt).join("").replace(/\s/g,"");return mt(Et)},He=(Ct,Jt)=>()=>Jt(Ct.getBody(),Ct.schema),ct=(Ct,Jt)=>()=>Jt(Ct.selection.getRng().cloneContents(),Ct.schema),dn=Ct=>He(Ct,nt),kt=Ct=>({body:{getWordCount:dn(Ct),getCharacterCount:He(Ct,Ot),getCharacterCountWithoutSpaces:He(Ct,Tt)},selection:{getWordCount:ct(Ct,nt),getCharacterCount:ct(Ct,Ot),getCharacterCountWithoutSpaces:ct(Ct,Tt)},getCount:dn(Ct)}),xn=(Ct,Jt)=>{Ct.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(Jt.body.getWordCount()),String(Jt.selection.getWordCount())],["Characters (no spaces)",String(Jt.body.getCharacterCountWithoutSpaces()),String(Jt.selection.getCharacterCountWithoutSpaces())],["Characters",String(Jt.body.getCharacterCount()),String(Jt.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})},We=(Ct,Jt)=>{Ct.addCommand("mceWordCount",()=>xn(Ct,Jt))},xt=(Ct,Jt)=>{let Et=null;return{cancel:()=>{t(Et)||(clearTimeout(Et),Et=null)},throttle:(...gn)=>{t(Et)&&(Et=setTimeout(()=>{Et=null,Ct.apply(null,gn)},Jt))}}};var he=tinymce.util.Tools.resolve("tinymce.util.Delay");const es=(Ct,Jt)=>{Ct.dispatch("wordCountUpdate",{wordCount:{words:Jt.body.getWordCount(),characters:Jt.body.getCharacterCount(),charactersWithoutSpaces:Jt.body.getCharacterCountWithoutSpaces()}})},ho=(Ct,Jt)=>{es(Ct,Jt)},ao=(Ct,Jt,Et)=>{const Pe=xt(()=>ho(Ct,Jt),Et);Ct.on("init",()=>{ho(Ct,Jt),he.setEditorTimeout(Ct,()=>{Ct.on("SetContent BeforeAddUndo Undo Redo ViewUpdate keyup",Pe.throttle)},0),Ct.on("remove",Pe.cancel)})},xo=Ct=>{const Jt=()=>Ct.execCommand("mceWordCount");Ct.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:Jt}),Ct.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:Jt})};var Yo=(Ct=300)=>{s.add("wordcount",Jt=>{const Et=kt(Jt);return We(Jt,Et),xo(Jt),ao(Jt,Et,Ct),Et})};Yo()})();function uCe(s){let e,t;return{c(){e=ce("div"),t=ce("div"),W(t,"class","form-control"),W(e,"class","tox-wrapper")},m(r,a){Le(r,e,a),Q(e,t),t.innerHTML=s[0],s[4](t),s[5](e)},p(r,[a]){a&1&&(t.innerHTML=r[0])},i:Sn,o:Sn,d(r){r&&Ie(e),s[4](null),s[5](null)}}}const fCe="bold italic underline strikethrough removeformat | link | subscript superscript bullist numlist media image codesample table code wordcount blockquote indent outdent blocks";function dCe(s,e,t){let{value:r=""}=e,{additionalConfig:a={}}=e,u="",f,h,g;const y=["autoresize","code","image","table","codesample","link","lists","media","wordcount"];yhe(()=>{h&&h.destroy()}),H0(()=>{const O={target:f,toolbar_mode:"sliding",toolbar_sticky:!0,skin:!1,content_css:!1,content_style:cCe.toString(),branding:!1,inline:!1,plugins:y,contextmenu:!1,menubar:!1,statusbar:!1,entity_encoding:"raw",convert_urls:!1,toolbar:fCe,image_caption:!0,relative_urls:!1,browser_spellcheck:!0,max_height:600,content_style:"img {max-width: 100%;height: auto;",setup(N){h=N,N.on("init",function(L){N.setContent(r!=null?r:"")}),N.on("change input undo redo",function(L){u=N.getContent(),u!==r&&t(0,r=u)})}};lCe.init({...O,...a})});function C(O){ss[O?"unshift":"push"](()=>{f=O,t(1,f)})}function A(O){ss[O?"unshift":"push"](()=>{g=O,t(2,g)})}return s.$$set=O=>{"value"in O&&t(0,r=O.value),"additionalConfig"in O&&t(3,a=O.additionalConfig)},[r,f,g,a,C,A]}class sme extends ko{constructor(e){super(),So(this,e,dCe,uCe,Co,{value:0,additionalConfig:3})}}function hCe(s){let e,t,r,a;function u(h){s[2](h)}let f={additionalConfig:s[1]};return s[0].value!==void 0&&(f.value=s[0].value),t=new sme({props:f}),ss.push(()=>Er(t,"value",u)),{c(){e=ce("div"),rn(t.$$.fragment),W(e,"class","mb-0")},m(h,g){Le(h,e,g),on(t,e,null),a=!0},p(h,[g]){const y={};!r&&g&1&&(r=!0,y.value=h[0].value,Dr(()=>r=!1)),t.$set(y)},i(h){a||(Re(t.$$.fragment,h),a=!0)},o(h){Ue(t.$$.fragment,h),a=!1},d(h){h&&Ie(e),sn(t)}}}function mCe(s,e,t){let{block:r}=e,a={};function u(f){s.$$.not_equal(r.value,f)&&(r.value=f,t(0,r))}return s.$$set=f=>{"block"in f&&t(0,r=f.block)},[r,a,u]}class gCe extends ko{constructor(e){super(),So(this,e,mCe,hCe,Co,{block:0})}}function Ule(s,e,t){const r=s.slice();return r[10]=e[t],r}function Wle(s){let e,t;return e=new ZV({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[pCe]},$$scope:{ctx:s}}}),e.$on("update",s[5]),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&8198&&(u.$$scope={dirty:a,ctx:r}),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function jle(s,e){let t,r,a,u;return r=new WV({props:{classes:"h-100",schemas:e[1],record:e[10],hasDelete:!0}}),r.$on("remove",e[4]),{key:s,first:null,c(){t=ce("div"),rn(r.$$.fragment),a=Xe(),W(t,"class","col mb-3"),this.first=t},m(f,h){Le(f,t,h),on(r,t,null),Q(t,a),u=!0},p(f,h){e=f;const g={};h&2&&(g.schemas=e[1]),h&4&&(g.record=e[10]),r.$set(g)},i(f){u||(Re(r.$$.fragment,f),u=!0)},o(f){Ue(r.$$.fragment,f),u=!1},d(f){f&&Ie(t),sn(r)}}}function pCe(s){let e=[],t=new Map,r,a,u=s[2];const f=h=>h[10].data.id;for(let h=0;h<u.length;h+=1){let g=Ule(s,u,h),y=f(g);t.set(y,e[h]=jle(y,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();r=Rs()},m(h,g){for(let y=0;y<e.length;y+=1)e[y]&&e[y].m(h,g);Le(h,r,g),a=!0},p(h,g){g&22&&(u=h[2],To(),e=Om(e,g,f,1,h,u,t,r.parentNode,f2,jle,r,Ule),Do())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Re(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)Ue(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Ie(r)}}}function bCe(s){let e,t,r,a,u;t=new lI({props:{field:s[0],buttonClass:"mt-2",recordId:null,schemas:s[3]}}),t.$on("insert",s[6]),t.$on("save",s[6]);let f=s[2].length>0&&Wle(s);return{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),f&&f.c(),a=Rs(),W(e,"class","inline-card-wrapper")},m(h,g){Le(h,e,g),on(t,e,null),Le(h,r,g),f&&f.m(h,g),Le(h,a,g),u=!0},p(h,[g]){const y={};g&1&&(y.field=h[0]),t.$set(y),h[2].length>0?f?(f.p(h,g),g&4&&Re(f,1)):(f=Wle(h),f.c(),Re(f,1),f.m(a.parentNode,a)):f&&(To(),Ue(f,1,1,()=>{f=null}),Do())},i(h){u||(Re(t.$$.fragment,h),Re(f),u=!0)},o(h){Ue(t.$$.fragment,h),Ue(f),u=!1},d(h){h&&Ie(e),sn(t),h&&Ie(r),f&&f.d(h),h&&Ie(a)}}}function vCe(s,e,t){let r,{block:a}=e,{record:u}=e,{field:f}=e,{schemas:h}=e,{graph:g}=e,y=h.filter(N=>f.collections.includes(N.name));function C(N){var L;N.preventDefault(),t(8,g.edges=g.edges.filter(j=>!(j.target===N.detail&&j.field===f.name)),g),t(7,a.value=(L=g.edges.filter(j=>{var z;return j.field===f.name&&((z=a.value)==null?void 0:z.includes(j.target))}).map(j=>j.target))!=null?L:[],a)}function A(N){t(8,g.edges=aI(N.detail.source,N.detail.target,g.edges,f.name),g)}function O(N){var F;N.preventDefault();const L=N.detail.records,j=N.detail.action;let z=L.map(ne=>({schema:ne.schema,target:ne.data.id,source:u.data.id,field:f.name,rank:""})),q=g.edges,ee=[];j==="replace"?(ee=z.map(ne=>ne.target),q=q.filter(ne=>ne.field!==f.name)):ee=[...(F=a.value)!=null?F:[],...z.map(ne=>ne.target)],t(7,a.value=Hu.exports.uniq(ee),a),t(8,g.records=Hu.exports.uniqBy([...g.records,...L],ne=>ne.data.id),g),t(8,g.edges=Hu.exports.uniqBy([...q,...z],ne=>ne.target+ne.field),g)}return s.$$set=N=>{"block"in N&&t(7,a=N.block),"record"in N&&t(9,u=N.record),"field"in N&&t(0,f=N.field),"schemas"in N&&t(1,h=N.schemas),"graph"in N&&t(8,g=N.graph)},s.$$.update=()=>{var N;s.$$.dirty&897&&t(2,r=(N=g.edges.filter(L=>{var j;return L.field===f.name&&((j=a.value)==null?void 0:j.includes(L.target))}).map(L=>g.records.find(j=>j.data.id===L.target&&u.data.id===L.source)).filter(L=>{var j;return!!((j=L==null?void 0:L.data)!=null&&j.id)}))!=null?N:[])},[f,h,r,y,C,A,O,a,g,u]}class yCe extends ko{constructor(e){super(),So(this,e,vCe,bCe,Co,{block:7,record:9,field:0,schemas:1,graph:8})}}function wCe(s){let e,t,r,a;function u(g){s[8](g)}function f(g){s[9](g)}let h={record:s[2],field:s[3],schemas:s[4]};return s[0]!==void 0&&(h.graph=s[0]),s[1]!==void 0&&(h.block=s[1]),e=new yCe({props:h}),ss.push(()=>Er(e,"graph",u)),ss.push(()=>Er(e,"block",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&4&&(C.record=g[2]),y&8&&(C.field=g[3]),y&16&&(C.schemas=g[4]),!t&&y&1&&(t=!0,C.graph=g[0],Dr(()=>t=!1)),!r&&y&2&&(r=!0,C.block=g[1],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){sn(e,g)}}}function _Ce(s){let e,t,r;function a(f){s[7](f)}let u={};return s[1]!==void 0&&(u.block=s[1]),e=new gCe({props:u}),ss.push(()=>Er(e,"block",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};!t&&h&2&&(t=!0,g.block=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function CCe(s){let e,t,r;function a(f){s[6](f)}let u={};return s[1]!==void 0&&(u.block=s[1]),e=new aCe({props:u}),ss.push(()=>Er(e,"block",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};!t&&h&2&&(t=!0,g.block=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function SCe(s){let e,t,r;function a(f){s[5](f)}let u={};return s[1]!==void 0&&(u.block=s[1]),e=new sCe({props:u}),ss.push(()=>Er(e,"block",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};!t&&h&2&&(t=!0,g.block=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function kCe(s){let e,t,r=s[1].ui+"",a,u,f,h,g;const y=[SCe,CCe,_Ce,wCe],C=[];function A(O,N){return O[1].ui==="text"?0:O[1].ui==="textarea"?1:O[1].ui==="rich"?2:O[1].ui==="reference"?3:-1}return~(f=A(s))&&(h=C[f]=y[f](s)),{c(){e=ce("div"),t=ce("span"),a=Kt(r),u=Xe(),h&&h.c(),W(t,"class","text-muted d-block fs-6 mb-1"),W(e,"class","card editor-field bg-light lx-card d-flex")},m(O,N){Le(O,e,N),Q(e,t),Q(t,a),Q(e,u),~f&&C[f].m(e,null),g=!0},p(O,[N]){(!g||N&2)&&r!==(r=O[1].ui+"")&&Gn(a,r);let L=f;f=A(O),f===L?~f&&C[f].p(O,N):(h&&(To(),Ue(C[L],1,1,()=>{C[L]=null}),Do()),~f?(h=C[f],h?h.p(O,N):(h=C[f]=y[f](O),h.c()),Re(h,1),h.m(e,null)):h=null)},i(O){g||(Re(h),g=!0)},o(O){Ue(h),g=!1},d(O){O&&Ie(e),~f&&C[f].d()}}}function ECe(s,e,t){let{record:r}=e,{field:a}=e,{schemas:u}=e,{graph:f}=e,{block:h}=e;function g(N){h=N,t(1,h)}function y(N){h=N,t(1,h)}function C(N){h=N,t(1,h)}function A(N){f=N,t(0,f)}function O(N){h=N,t(1,h)}return s.$$set=N=>{"record"in N&&t(2,r=N.record),"field"in N&&t(3,a=N.field),"schemas"in N&&t(4,u=N.schemas),"graph"in N&&t(0,f=N.graph),"block"in N&&t(1,h=N.block)},[f,h,r,a,u,g,y,C,A,O]}class xCe extends ko{constructor(e){super(),So(this,e,ECe,kCe,Co,{record:2,field:3,schemas:4,graph:0,block:1})}}function Zle(s,e,t){const r=s.slice();return r[9]=e[t],r[10]=e,r[11]=t,r}function qle(s,e){let t,r,a,u,f,h,g,y,C,A=Sn,O;function N(ee){e[6](ee,e[9],e[10],e[11])}function L(ee){e[7](ee)}let j={record:e[2],field:e[3],schemas:e[4]};e[9]!==void 0&&(j.block=e[9]),e[1]!==void 0&&(j.graph=e[1]),r=new xCe({props:j}),ss.push(()=>Er(r,"block",N)),ss.push(()=>Er(r,"graph",L));function z(ee){e[8](ee)}let q={};return e[0]!==void 0&&(q.blockData=e[0]),h=new tme({props:q}),ss.push(()=>Er(h,"blockData",z)),{key:s,first:null,c(){t=ce("div"),rn(r.$$.fragment),f=Xe(),rn(h.$$.fragment),y=Xe(),W(t,"class","block-field-wrapper"),this.first=t},m(ee,F){Le(ee,t,F),on(r,t,null),Q(t,f),on(h,t,null),Q(t,y),O=!0},p(ee,F){e=ee;const ne={};F&4&&(ne.record=e[2]),F&8&&(ne.field=e[3]),F&16&&(ne.schemas=e[4]),!a&&F&1&&(a=!0,ne.block=e[9],Dr(()=>a=!1)),!u&&F&2&&(u=!0,ne.graph=e[1],Dr(()=>u=!1)),r.$set(ne);const oe={};!g&&F&1&&(g=!0,oe.blockData=e[0],Dr(()=>g=!1)),h.$set(oe)},r(){C=t.getBoundingClientRect()},f(){bhe(t),A()},a(){A(),A=phe(t,C,eme,{delay:250,duration:250,easing:She})},i(ee){O||(Re(r.$$.fragment,ee),Re(h.$$.fragment,ee),O=!0)},o(ee){Ue(r.$$.fragment,ee),Ue(h.$$.fragment,ee),O=!1},d(ee){ee&&Ie(t),sn(r),sn(h)}}}function ACe(s){let e,t,r,a,u=[],f=new Map,h,g;function y(N){s[5](N)}let C={};s[0]!==void 0&&(C.blockData=s[0]),t=new tme({props:C}),ss.push(()=>Er(t,"blockData",y));let A=s[0];const O=N=>N[9].id;for(let N=0;N<A.length;N+=1){let L=Zle(s,A,N),j=O(L);f.set(j,u[N]=qle(j,L))}return{c(){e=ce("div"),rn(t.$$.fragment),a=Xe();for(let N=0;N<u.length;N+=1)u[N].c();h=Rs(),W(e,"class","inline-card-wrapper")},m(N,L){Le(N,e,L),on(t,e,null),Le(N,a,L);for(let j=0;j<u.length;j+=1)u[j]&&u[j].m(N,L);Le(N,h,L),g=!0},p(N,[L]){const j={};if(!r&&L&1&&(r=!0,j.blockData=N[0],Dr(()=>r=!1)),t.$set(j),L&31){A=N[0],To();for(let z=0;z<u.length;z+=1)u[z].r();u=Om(u,L,O,1,N,A,f,h.parentNode,_he,qle,h,Zle);for(let z=0;z<u.length;z+=1)u[z].a();Do()}},i(N){if(!g){Re(t.$$.fragment,N);for(let L=0;L<A.length;L+=1)Re(u[L]);g=!0}},o(N){Ue(t.$$.fragment,N);for(let L=0;L<u.length;L+=1)Ue(u[L]);g=!1},d(N){N&&Ie(e),sn(t),N&&Ie(a);for(let L=0;L<u.length;L+=1)u[L].d(N);N&&Ie(h)}}}function TCe(s,e,t){let{record:r}=e,{field:a}=e,{value:u=[]}=e,{schemas:f}=e,{graph:h}=e;function g(O){u=O,t(0,u)}function y(O,N,L,j){L[j]=O,t(0,u)}function C(O){h=O,t(1,h)}function A(O){u=O,t(0,u)}return s.$$set=O=>{"record"in O&&t(2,r=O.record),"field"in O&&t(3,a=O.field),"value"in O&&t(0,u=O.value),"schemas"in O&&t(4,f=O.schemas),"graph"in O&&t(1,h=O.graph)},[u,h,r,a,f,g,y,C,A]}class DCe extends ko{constructor(e){super(),So(this,e,TCe,ACe,Co,{record:2,field:3,value:0,schemas:4,graph:1})}}function Gle(s){let e,t;return{c(){e=ce("div"),t=Kt(s[4]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&16&&Gn(t,r[4])},d(r){r&&Ie(e)}}}function OCe(s){let e,t,r,a,u,f,h,g,y,C,A,O=s[4]&&Gle(s);return{c(){e=ce("div"),t=ce("div"),r=ce("div"),a=ce("input"),f=Xe(),h=ce("input"),y=Xe(),O&&O.c(),W(a,"type","color"),W(a,"id",s[3]),W(a,"class","form-control form-control-color"),a.disabled=u=s[1].readonly&&!s[2],os(r,"width","64px"),W(h,"type","text"),W(h,"id",s[3]),W(h,"class","form-control"),h.readOnly=g=s[1].readonly&&!s[2],_s(h,"is-invalid",s[4]),W(t,"class","input-group "),W(e,"class","mb-0")},m(N,L){Le(N,e,L),Q(e,t),Q(t,r),Q(r,a),wr(a,s[0]),Q(t,f),Q(t,h),wr(h,s[0]),Q(e,y),O&&O.m(e,null),C||(A=[Dn(a,"input",s[6]),Dn(h,"input",s[7])],C=!0)},p(N,[L]){L&8&&W(a,"id",N[3]),L&6&&u!==(u=N[1].readonly&&!N[2])&&(a.disabled=u),L&1&&wr(a,N[0]),L&8&&W(h,"id",N[3]),L&6&&g!==(g=N[1].readonly&&!N[2])&&(h.readOnly=g),L&1&&h.value!==N[0]&&wr(h,N[0]),L&16&&_s(h,"is-invalid",N[4]),N[4]?O?O.p(N,L):(O=Gle(N),O.c(),O.m(e,null)):O&&(O.d(1),O=null)},i:Sn,o:Sn,d(N){N&&Ie(e),O&&O.d(),C=!1,Zi(A)}}}function MCe(s,e,t){let r,{field:a}=e,{value:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e,{id:g}=e;function y(){u=this.value,t(0,u)}function C(){u=this.value,t(0,u)}return s.$$set=A=>{"field"in A&&t(1,a=A.field),"value"in A&&t(0,u=A.value),"isCreateMode"in A&&t(2,f=A.isCreateMode),"validationErrors"in A&&t(5,h=A.validationErrors),"id"in A&&t(3,g=A.id)},s.$$.update=()=>{s.$$.dirty&34&&t(4,r=Rg(h,a.name))},[u,a,f,g,r,h,y,C]}class RCe extends ko{constructor(e){super(),So(this,e,MCe,OCe,Co,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function Kle(s){let e,t,r,a,u,f,h,g,y,C,A;return y=Aoe(s[7][0]),{c(){e=ce("div"),t=ce("input"),u=Xe(),f=ce("label"),h=Kt("Don't Know"),W(t,"class","form-check-input"),W(t,"id",r=s[1]+"-3"),W(t,"type","radio"),t.__value=null,t.value=t.__value,t.disabled=a=s[2].readonly&&!s[3],_s(t,"is-invalid",s[4]),W(f,"class","form-check-label"),W(f,"for",g=s[1]+"-3"),W(e,"class","form-check form-check-inline"),y.p(t)},m(O,N){Le(O,e,N),Q(e,t),t.checked=t.__value===s[0],Q(e,u),Q(e,f),Q(f,h),C||(A=Dn(t,"change",s[9]),C=!0)},p(O,N){N&2&&r!==(r=O[1]+"-3")&&W(t,"id",r),N&12&&a!==(a=O[2].readonly&&!O[3])&&(t.disabled=a),N&1&&(t.checked=t.__value===O[0]),N&16&&_s(t,"is-invalid",O[4]),N&2&&g!==(g=O[1]+"-3")&&W(f,"for",g)},d(O){O&&Ie(e),y.r(),C=!1,A()}}}function Yle(s){let e,t;return{c(){e=ce("div"),t=Kt(s[4]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&16&&Gn(t,r[4])},d(r){r&&Ie(e)}}}function NCe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee,F,ne,oe,re,J,we,ye=s[2].nullable&&Kle(s),De=s[4]&&Yle(s);return re=Aoe(s[7][0]),{c(){e=ce("div"),t=ce("div"),r=ce("input"),f=Xe(),h=ce("label"),g=Kt("Yes"),C=Xe(),A=ce("div"),O=ce("input"),j=Xe(),z=ce("label"),q=Kt("No"),F=Xe(),ye&&ye.c(),ne=Xe(),De&&De.c(),oe=Rs(),W(r,"class","form-check-input"),W(r,"type","radio"),W(r,"id",a=s[1]+"-1"),r.__value=!0,r.value=r.__value,r.disabled=u=s[2].readonly&&!s[3],_s(r,"is-invalid",s[4]),W(h,"class","form-check-label"),W(h,"for",y=s[1]+"-1"),W(t,"class","form-check form-check-inline"),W(O,"class","form-check-input"),W(O,"type","radio"),W(O,"id",N=s[1]+"-2"),O.__value=!1,O.value=O.__value,O.disabled=L=s[2].readonly&&!s[3],_s(O,"is-invalid",s[4]),W(z,"class","form-check-label"),W(z,"for",ee=s[1]+"-2"),W(A,"class","form-check form-check-inline"),re.p(r,O)},m(_e,be){Le(_e,e,be),Q(e,t),Q(t,r),r.checked=r.__value===s[0],Q(t,f),Q(t,h),Q(h,g),Q(e,C),Q(e,A),Q(A,O),O.checked=O.__value===s[0],Q(A,j),Q(A,z),Q(z,q),Q(e,F),ye&&ye.m(e,null),Le(_e,ne,be),De&&De.m(_e,be),Le(_e,oe,be),J||(we=[Dn(r,"change",s[6]),Dn(O,"change",s[8])],J=!0)},p(_e,[be]){be&2&&a!==(a=_e[1]+"-1")&&W(r,"id",a),be&12&&u!==(u=_e[2].readonly&&!_e[3])&&(r.disabled=u),be&1&&(r.checked=r.__value===_e[0]),be&16&&_s(r,"is-invalid",_e[4]),be&2&&y!==(y=_e[1]+"-1")&&W(h,"for",y),be&2&&N!==(N=_e[1]+"-2")&&W(O,"id",N),be&12&&L!==(L=_e[2].readonly&&!_e[3])&&(O.disabled=L),be&1&&(O.checked=O.__value===_e[0]),be&16&&_s(O,"is-invalid",_e[4]),be&2&&ee!==(ee=_e[1]+"-2")&&W(z,"for",ee),_e[2].nullable?ye?ye.p(_e,be):(ye=Kle(_e),ye.c(),ye.m(e,null)):ye&&(ye.d(1),ye=null),_e[4]?De?De.p(_e,be):(De=Yle(_e),De.c(),De.m(oe.parentNode,oe)):De&&(De.d(1),De=null)},i:Sn,o:Sn,d(_e){_e&&Ie(e),ye&&ye.d(),_e&&Ie(ne),De&&De.d(_e),_e&&Ie(oe),re.r(),J=!1,Zi(we)}}}function PCe(s,e,t){let r,{id:a}=e,{field:u}=e,{value:f}=e,{isCreateMode:h}=e,{validationErrors:g}=e;const y=[[]];function C(){f=this.__value,t(0,f)}function A(){f=this.__value,t(0,f)}function O(){f=this.__value,t(0,f)}return s.$$set=N=>{"id"in N&&t(1,a=N.id),"field"in N&&t(2,u=N.field),"value"in N&&t(0,f=N.value),"isCreateMode"in N&&t(3,h=N.isCreateMode),"validationErrors"in N&&t(5,g=N.validationErrors)},s.$$.update=()=>{s.$$.dirty&36&&t(4,r=Rg(g,u.name))},[f,a,u,h,r,g,C,y,A,O]}class ICe extends ko{constructor(e){super(),So(this,e,PCe,NCe,Co,{id:1,field:2,value:0,isCreateMode:3,validationErrors:5})}}function BCe(s){let e,t,r,a;return{c(){e=ce("input"),W(e,"type","number"),W(e,"id",s[4]),W(e,"class","form-control"),W(e,"autocomplete","off"),e.readOnly=t=s[1].readonly&&!s[3],_s(e,"is-invalid",s[7])},m(u,f){Le(u,e,f),wr(e,s[0]),r||(a=[Dn(e,"change",s[9]),Dn(e,"input",s[16])],r=!0)},p(u,f){f&16&&W(e,"id",u[4]),f&10&&t!==(t=u[1].readonly&&!u[3])&&(e.readOnly=t),f&1&&qz(e.value)!==u[0]&&wr(e,u[0]),f&128&&_s(e,"is-invalid",u[7])},i:Sn,o:Sn,d(u){u&&Ie(e),r=!1,Zi(a)}}}function LCe(s){let e,t,r,a,u,f,h,g,y,C,A=s[1].optionsFrom&&Xle(s),O=s[0]&&Jle(s);return{c(){e=ce("div"),t=ce("input"),a=Xe(),u=ce("ul"),A&&A.c(),f=Xe(),O&&O.c(),h=Rs(),W(t,"type","number"),W(t,"id",s[4]),W(t,"placeholder","Search for options"),W(t,"class","form-control dropdown-toggle"),W(t,"data-bs-toggle","dropdown"),W(t,"autocomplete","off"),t.readOnly=r=s[1].readonly&&!s[3],_s(t,"is-invalid",s[7]),W(u,"class","dropdown-menu w-100"),W(e,"class","dropdown")},m(N,L){Le(N,e,L),Q(e,t),wr(t,s[8]),Q(e,a),Q(e,u),A&&A.m(u,null),Le(N,f,L),O&&O.m(N,L),Le(N,h,L),g=!0,y||(C=[Dn(t,"keyup",function(){B0(s[5].update)&&s[5].update.apply(this,arguments)}),Dn(t,"focus",function(){B0(s[5].update)&&s[5].update.apply(this,arguments)}),Dn(t,"input",s[11])],y=!0)},p(N,L){s=N,(!g||L&16)&&W(t,"id",s[4]),(!g||L&10&&r!==(r=s[1].readonly&&!s[3]))&&(t.readOnly=r),L&256&&qz(t.value)!==s[8]&&wr(t,s[8]),(!g||L&128)&&_s(t,"is-invalid",s[7]),s[1].optionsFrom?A?(A.p(s,L),L&2&&Re(A,1)):(A=Xle(s),A.c(),Re(A,1),A.m(u,null)):A&&(To(),Ue(A,1,1,()=>{A=null}),Do()),s[0]?O?O.p(s,L):(O=Jle(s),O.c(),O.m(h.parentNode,h)):O&&(O.d(1),O=null)},i(N){g||(Re(A),g=!0)},o(N){Ue(A),g=!1},d(N){N&&Ie(e),A&&A.d(),N&&Ie(f),O&&O.d(N),N&&Ie(h),y=!1,Zi(C)}}}function Xle(s){let e,t,r,a;function u(g){s[13](g)}function f(g){s[14](g)}let h={field:s[1],schemas:s[2]};return s[0]!==void 0&&(h.value=s[0]),s[8]!==void 0&&(h.search=s[8]),e=new UV({props:h}),s[12](e),ss.push(()=>Er(e,"value",u)),ss.push(()=>Er(e,"search",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&2&&(C.field=g[1]),y&4&&(C.schemas=g[2]),!t&&y&1&&(t=!0,C.value=g[0],Dr(()=>t=!1)),!r&&y&256&&(r=!0,C.search=g[8],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){s[12](null),sn(e,g)}}}function Jle(s){let e,t,r,a,u,f,h;return{c(){e=ce("span"),t=ce("div"),r=Kt(s[0]),a=Xe(),u=ce("button"),W(u,"type","button"),W(u,"class","btn-close btn-sm ms-1"),os(u,"font-size","10px"),W(u,"aria-label","Close"),W(t,"class","d-flex align-items-center "),W(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,y){Le(g,e,y),Q(e,t),Q(t,r),Q(t,a),Q(t,u),f||(h=Dn(u,"click",$u(s[15])),f=!0)},p(g,y){y&1&&Gn(r,g[0])},d(g){g&&Ie(e),f=!1,h()}}}function Qle(s){let e,t;return{c(){e=ce("div"),t=Kt(s[7]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&128&&Gn(t,r[7])},d(r){r&&Ie(e)}}}function FCe(s){let e,t,r,a,u;const f=[LCe,BCe],h=[];function g(C,A){return C[6]?0:1}t=g(s),r=h[t]=f[t](s);let y=s[7]&&Qle(s);return{c(){e=ce("div"),r.c(),a=Xe(),y&&y.c(),W(e,"class","mb-0")},m(C,A){Le(C,e,A),h[t].m(e,null),Q(e,a),y&&y.m(e,null),u=!0},p(C,[A]){let O=t;t=g(C),t===O?h[t].p(C,A):(To(),Ue(h[O],1,1,()=>{h[O]=null}),Do(),r=h[t],r?r.p(C,A):(r=h[t]=f[t](C),r.c()),Re(r,1),r.m(e,a)),C[7]?y?y.p(C,A):(y=Qle(C),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i(C){u||(Re(r),u=!0)},o(C){Ue(r),u=!1},d(C){C&&Ie(e),h[t].d(),y&&y.d()}}}function HCe(s,e,t){let r,a,u,{field:f}=e,{value:h}=e,{schemas:g}=e,{validationErrors:y}=e,{isCreateMode:C}=e,{id:A}=e,O;function N(oe){const re=oe.currentTarget.value,J=L(re);t(0,h=isNaN(J)?null:J)}function L(oe){return parseFloat(oe).toFixed(f.decimals)}function j(){r=qz(this.value),t(8,r)}function z(oe){ss[oe?"unshift":"push"](()=>{O=oe,t(5,O)})}function q(oe){h=oe,t(0,h)}function ee(oe){r=oe,t(8,r)}const F=oe=>t(0,h="");function ne(){h=qz(this.value),t(0,h)}return s.$$set=oe=>{"field"in oe&&t(1,f=oe.field),"value"in oe&&t(0,h=oe.value),"schemas"in oe&&t(2,g=oe.schemas),"validationErrors"in oe&&t(10,y=oe.validationErrors),"isCreateMode"in oe&&t(3,C=oe.isCreateMode),"id"in oe&&t(4,A=oe.id)},s.$$.update=()=>{s.$$.dirty&1026&&t(7,a=Rg(y,f.name)),s.$$.dirty&10&&t(6,u=f.optionsFrom&&!(f.readonly&&!C))},t(8,r=""),[h,f,g,C,A,O,u,a,r,N,y,j,z,q,ee,F,ne]}class $Ce extends ko{constructor(e){super(),So(this,e,HCe,FCe,Co,{field:1,value:0,schemas:2,validationErrors:10,isCreateMode:3,id:4})}}function ece(s){let e,t=s[1].help+"",r;return{c(){e=ce("small"),r=Kt(t),W(e,"class","text-primary opacity-50")},m(a,u){Le(a,e,u),Q(e,r)},p(a,u){u&2&&t!==(t=a[1].help+"")&&Gn(r,t)},d(a){a&&Ie(e)}}}function zCe(s){let e,t,r,a=s[1].label+"",u,f,h,g,y=s[1].name+"",C,A,O,N,L,j,z,q=s[1].help&&ece(s);return{c(){e=ce("div"),t=ce("div"),r=ce("label"),u=Kt(a),f=Xe(),h=ce("a"),g=ce("code"),C=Kt(y),O=Xe(),N=ce("input"),L=Xe(),q&&q.c(),W(r,"for",s[4]),W(r,"class","form-label"),W(g,"class","text-primary opacity-50"),W(h,"class","text-decoration-none"),W(h,"href",A=s[3]+"/schemas/"+s[2].name+"/fields/edit/"+s[1].name),W(t,"class","d-flex justify-content-between"),W(N,"type","url"),W(N,"id",s[4]),W(N,"class","form-control"),W(N,"placeholder","https://www.example.com"),W(e,"class","mb-0")},m(ee,F){Le(ee,e,F),Q(e,t),Q(t,r),Q(r,u),Q(t,f),Q(t,h),Q(h,g),Q(g,C),Q(e,O),Q(e,N),wr(N,s[0]),Q(e,L),q&&q.m(e,null),j||(z=Dn(N,"input",s[5]),j=!0)},p(ee,[F]){F&2&&a!==(a=ee[1].label+"")&&Gn(u,a),F&2&&y!==(y=ee[1].name+"")&&Gn(C,y),F&6&&A!==(A=ee[3]+"/schemas/"+ee[2].name+"/fields/edit/"+ee[1].name)&&W(h,"href",A),F&1&&N.value!==ee[0]&&wr(N,ee[0]),ee[1].help?q?q.p(ee,F):(q=ece(ee),q.c(),q.m(e,null)):q&&(q.d(1),q=null)},i:Sn,o:Sn,d(ee){ee&&Ie(e),q&&q.d(),j=!1,z()}}}function VCe(s,e,t){const r=ji("channelurl");let{field:a}=e,{value:u}=e,{schema:f}=e,h=Hu.exports.uniqueId();function g(){u=this.value,t(0,u)}return s.$$set=y=>{"field"in y&&t(1,a=y.field),"value"in y&&t(0,u=y.value),"schema"in y&&t(2,f=y.schema)},[u,a,f,r,h,g]}class UCe extends ko{constructor(e){super(),So(this,e,VCe,zCe,Co,{field:1,value:0,schema:2})}}var yte=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],KD={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(s){return typeof console<"u"&&console.warn(s)},getWeek:function(s){var e=new Date(s.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},BP={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(s){var e=s%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},xp=function(s,e){return e===void 0&&(e=2),("000"+s).slice(e*-1)},T0=function(s){return s===!0?1:0};function tce(s,e){var t;return function(){var r=this,a=arguments;clearTimeout(t),t=setTimeout(function(){return s.apply(r,a)},e)}}var wte=function(s){return s instanceof Array?s:[s]};function kg(s,e,t){if(t===!0)return s.classList.add(e);s.classList.remove(e)}function al(s,e,t){var r=window.document.createElement(s);return e=e||"",t=t||"",r.className=e,t!==void 0&&(r.textContent=t),r}function W$(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function rme(s,e){if(e(s))return s;if(s.parentNode)return rme(s.parentNode,e)}function j$(s,e){var t=al("div","numInputWrapper"),r=al("input","numInput "+s),a=al("span","arrowUp"),u=al("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),e!==void 0)for(var f in e)r.setAttribute(f,e[f]);return t.appendChild(r),t.appendChild(a),t.appendChild(u),t}function S1(s){try{if(typeof s.composedPath=="function"){var e=s.composedPath();return e[0]}return s.target}catch{return s.target}}var _te=function(){},sV=function(s,e,t){return t.months[e?"shorthand":"longhand"][s]},WCe={D:_te,F:function(s,e,t){s.setMonth(t.months.longhand.indexOf(e))},G:function(s,e){s.setHours((s.getHours()>=12?12:0)+parseFloat(e))},H:function(s,e){s.setHours(parseFloat(e))},J:function(s,e){s.setDate(parseFloat(e))},K:function(s,e,t){s.setHours(s.getHours()%12+12*T0(new RegExp(t.amPM[1],"i").test(e)))},M:function(s,e,t){s.setMonth(t.months.shorthand.indexOf(e))},S:function(s,e){s.setSeconds(parseFloat(e))},U:function(s,e){return new Date(parseFloat(e)*1e3)},W:function(s,e,t){var r=parseInt(e),a=new Date(s.getFullYear(),0,2+(r-1)*7,0,0,0,0);return a.setDate(a.getDate()-a.getDay()+t.firstDayOfWeek),a},Y:function(s,e){s.setFullYear(parseFloat(e))},Z:function(s,e){return new Date(e)},d:function(s,e){s.setDate(parseFloat(e))},h:function(s,e){s.setHours((s.getHours()>=12?12:0)+parseFloat(e))},i:function(s,e){s.setMinutes(parseFloat(e))},j:function(s,e){s.setDate(parseFloat(e))},l:_te,m:function(s,e){s.setMonth(parseFloat(e)-1)},n:function(s,e){s.setMonth(parseFloat(e)-1)},s:function(s,e){s.setSeconds(parseFloat(e))},u:function(s,e){return new Date(parseFloat(e))},w:_te,y:function(s,e){s.setFullYear(2e3+parseFloat(e))}},LA={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},AP={Z:function(s){return s.toISOString()},D:function(s,e,t){return e.weekdays.shorthand[AP.w(s,e,t)]},F:function(s,e,t){return sV(AP.n(s,e,t)-1,!1,e)},G:function(s,e,t){return xp(AP.h(s,e,t))},H:function(s){return xp(s.getHours())},J:function(s,e){return e.ordinal!==void 0?s.getDate()+e.ordinal(s.getDate()):s.getDate()},K:function(s,e){return e.amPM[T0(s.getHours()>11)]},M:function(s,e){return sV(s.getMonth(),!0,e)},S:function(s){return xp(s.getSeconds())},U:function(s){return s.getTime()/1e3},W:function(s,e,t){return t.getWeek(s)},Y:function(s){return xp(s.getFullYear(),4)},d:function(s){return xp(s.getDate())},h:function(s){return s.getHours()%12?s.getHours()%12:12},i:function(s){return xp(s.getMinutes())},j:function(s){return s.getDate()},l:function(s,e){return e.weekdays.longhand[s.getDay()]},m:function(s){return xp(s.getMonth()+1)},n:function(s){return s.getMonth()+1},s:function(s){return s.getSeconds()},u:function(s){return s.getTime()},w:function(s){return s.getDay()},y:function(s){return String(s.getFullYear()).substring(2)}},ime=function(s){var e=s.config,t=e===void 0?KD:e,r=s.l10n,a=r===void 0?BP:r,u=s.isMobile,f=u===void 0?!1:u;return function(h,g,y){var C=y||a;return t.formatDate!==void 0&&!f?t.formatDate(h,g,C):g.split("").map(function(A,O,N){return AP[A]&&N[O-1]!=="\\"?AP[A](h,C,t):A!=="\\"?A:""}).join("")}},_ne=function(s){var e=s.config,t=e===void 0?KD:e,r=s.l10n,a=r===void 0?BP:r;return function(u,f,h,g){if(!(u!==0&&!u)){var y=g||a,C,A=u;if(u instanceof Date)C=new Date(u.getTime());else if(typeof u!="string"&&u.toFixed!==void 0)C=new Date(u);else if(typeof u=="string"){var O=f||(t||KD).dateFormat,N=String(u).trim();if(N==="today")C=new Date,h=!0;else if(t&&t.parseDate)C=t.parseDate(u,O);else if(/Z$/.test(N)||/GMT$/.test(N))C=new Date(u);else{for(var L=void 0,j=[],z=0,q=0,ee="";z<O.length;z++){var F=O[z],ne=F==="\\",oe=O[z-1]==="\\"||ne;if(LA[F]&&!oe){ee+=LA[F];var re=new RegExp(ee).exec(u);re&&(L=!0)&&j[F!=="Y"?"push":"unshift"]({fn:WCe[F],val:re[++q]})}else ne||(ee+=".")}C=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),j.forEach(function(J){var we=J.fn,ye=J.val;return C=we(C,ye,y)||C}),C=L?C:void 0}}if(!(C instanceof Date&&!isNaN(C.getTime()))){t.errorHandler(new Error("Invalid date provided: "+A));return}return h===!0&&C.setHours(0,0,0,0),C}}};function A1(s,e,t){return t===void 0&&(t=!0),t!==!1?new Date(s.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):s.getTime()-e.getTime()}var jCe=function(s,e,t){return s>Math.min(e,t)&&s<Math.max(e,t)},Cte=function(s,e,t){return s*3600+e*60+t},ZCe=function(s){var e=Math.floor(s/3600),t=(s-e*3600)/60;return[e,t,s-e*3600-t*60]},qCe={DAY:864e5};function Ste(s){var e=s.defaultHour,t=s.defaultMinute,r=s.defaultSeconds;if(s.minDate!==void 0){var a=s.minDate.getHours(),u=s.minDate.getMinutes(),f=s.minDate.getSeconds();e<a&&(e=a),e===a&&t<u&&(t=u),e===a&&t===u&&r<f&&(r=s.minDate.getSeconds())}if(s.maxDate!==void 0){var h=s.maxDate.getHours(),g=s.maxDate.getMinutes();e=Math.min(e,h),e===h&&(t=Math.min(g,t)),e===h&&t===g&&(r=s.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(s){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!s)throw TypeError("Cannot convert undefined or null to object");for(var r=function(h){h&&Object.keys(h).forEach(function(g){return s[g]=h[g]})},a=0,u=e;a<u.length;a++){var f=u[a];r(f)}return s});var Em=globalThis&&globalThis.__assign||function(){return Em=Object.assign||function(s){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(s[a]=e[a])}return s},Em.apply(this,arguments)},nce=globalThis&&globalThis.__spreadArrays||function(){for(var s=0,e=0,t=arguments.length;e<t;e++)s+=arguments[e].length;for(var r=Array(s),a=0,e=0;e<t;e++)for(var u=arguments[e],f=0,h=u.length;f<h;f++,a++)r[a]=u[f];return r},GCe=300;function KCe(s,e){var t={config:Em(Em({},KD),mf.defaultConfig),l10n:BP};t.parseDate=_ne({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=j,t._setHoursFromDate=O,t._positionCalendar=gn,t.changeMonth=He,t.changeYear=xt,t.clear=ct,t.close=dn,t.onMouseOver=xo,t._createElement=al,t.createDay=re,t.destroy=kt,t.isEnabled=he,t.jumpToDate=ee,t.updateValue=an,t.open=Ct,t.redraw=bn,t.set=Or,t.setDate=Js,t.toggle=No;function r(){t.utils={getDaysInMonth:function($e,Je){return $e===void 0&&($e=t.currentMonth),Je===void 0&&(Je=t.currentYear),$e===1&&(Je%4===0&&Je%100!==0||Je%400===0)?29:t.l10n.daysInMonth[$e]}}}function a(){t.element=t.input=s,t.isOpen=!1,Et(),Ut(),ar(),ba(),r(),t.isMobile||oe(),q(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&O(t.config.noCalendar?t.latestSelectedDateObj:void 0),an(!1)),h();var $e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&$e&&gn(),Mo("onReady")}function u(){var $e;return(($e=t.calendarContainer)===null||$e===void 0?void 0:$e.getRootNode()).activeElement||document.activeElement}function f($e){return $e.bind(t)}function h(){var $e=t.config;$e.weekNumbers===!1&&$e.showMonths===1||$e.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var Je=(t.days.offsetWidth+1)*$e.showMonths;t.daysContainer.style.width=Je+"px",t.calendarContainer.style.width=Je+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function g($e){if(t.selectedDates.length===0){var Je=t.config.minDate===void 0||A1(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),At=Ste(t.config);Je.setHours(At.hours,At.minutes,At.seconds,Je.getMilliseconds()),t.selectedDates=[Je],t.latestSelectedDateObj=Je}$e!==void 0&&$e.type!=="blur"&&Ii($e);var Wt=t._input.value;A(),an(),t._input.value!==Wt&&t._debouncedChange()}function y($e,Je){return $e%12+12*T0(Je===t.l10n.amPM[1])}function C($e){switch($e%24){case 0:case 12:return 12;default:return $e%12}}function A(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var $e=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,Je=(parseInt(t.minuteElement.value,10)||0)%60,At=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&($e=y($e,t.amPM.textContent));var Wt=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&A1(t.latestSelectedDateObj,t.config.minDate,!0)===0,Wn=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&A1(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var lo=Cte(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),go=Cte(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),cn=Cte($e,Je,At);if(cn>go&&cn<lo){var ts=ZCe(lo);$e=ts[0],Je=ts[1],At=ts[2]}}else{if(Wn){var wo=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;$e=Math.min($e,wo.getHours()),$e===wo.getHours()&&(Je=Math.min(Je,wo.getMinutes())),Je===wo.getMinutes()&&(At=Math.min(At,wo.getSeconds()))}if(Wt){var cs=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;$e=Math.max($e,cs.getHours()),$e===cs.getHours()&&Je<cs.getMinutes()&&(Je=cs.getMinutes()),Je===cs.getMinutes()&&(At=Math.max(At,cs.getSeconds()))}}N($e,Je,At)}}function O($e){var Je=$e||t.latestSelectedDateObj;Je&&Je instanceof Date&&N(Je.getHours(),Je.getMinutes(),Je.getSeconds())}function N($e,Je,At){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours($e%24,Je,At||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=xp(t.config.time_24hr?$e:(12+$e)%12+12*T0($e%12===0)),t.minuteElement.value=xp(Je),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[T0($e>=12)]),t.secondElement!==void 0&&(t.secondElement.value=xp(At)))}function L($e){var Je=S1($e),At=parseInt(Je.value)+($e.delta||0);(At/1e3>1||$e.key==="Enter"&&!/[^\d]/.test(At.toString()))&&xt(At)}function j($e,Je,At,Wt){if(Je instanceof Array)return Je.forEach(function(Wn){return j($e,Wn,At,Wt)});if($e instanceof Array)return $e.forEach(function(Wn){return j(Wn,Je,At,Wt)});$e.addEventListener(Je,At,Wt),t._handlers.push({remove:function(){return $e.removeEventListener(Je,At,Wt)}})}function z(){Mo("onChange")}function q(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(At){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+At+"]"),function(Wt){return j(Wt,"click",t[At])})}),t.isMobile){Zr();return}var $e=tce(Yo,50);if(t._debouncedChange=tce(z,GCe),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&j(t.daysContainer,"mouseover",function(At){t.config.mode==="range"&&xo(S1(At))}),j(t._input,"keydown",ao),t.calendarContainer!==void 0&&j(t.calendarContainer,"keydown",ao),!t.config.inline&&!t.config.static&&j(window,"resize",$e),window.ontouchstart!==void 0?j(window.document,"touchstart",We):j(window.document,"mousedown",We),j(window.document,"focus",We,{capture:!0}),t.config.clickOpens===!0&&(j(t._input,"focus",t.open),j(t._input,"click",t.open)),t.daysContainer!==void 0&&(j(t.monthNav,"click",ps),j(t.monthNav,["keyup","increment"],L),j(t.daysContainer,"click",Jn)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var Je=function(At){return S1(At).select()};j(t.timeContainer,["increment"],g),j(t.timeContainer,"blur",g,{capture:!0}),j(t.timeContainer,"click",F),j([t.hourElement,t.minuteElement],["focus","click"],Je),t.secondElement!==void 0&&j(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&j(t.amPM,"click",function(At){g(At)})}t.config.allowInput&&j(t._input,"blur",ho)}function ee($e,Je){var At=$e!==void 0?t.parseDate($e):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),Wt=t.currentYear,Wn=t.currentMonth;try{At!==void 0&&(t.currentYear=At.getFullYear(),t.currentMonth=At.getMonth())}catch(lo){lo.message="Invalid date supplied: "+At,t.config.errorHandler(lo)}Je&&t.currentYear!==Wt&&(Mo("onYearChange"),tt()),Je&&(t.currentYear!==Wt||t.currentMonth!==Wn)&&Mo("onMonthChange"),t.redraw()}function F($e){var Je=S1($e);~Je.className.indexOf("arrow")&&ne($e,Je.classList.contains("arrowUp")?1:-1)}function ne($e,Je,At){var Wt=$e&&S1($e),Wn=At||Wt&&Wt.parentNode&&Wt.parentNode.firstChild,lo=Mr("increment");lo.delta=Je,Wn&&Wn.dispatchEvent(lo)}function oe(){var $e=window.document.createDocumentFragment();if(t.calendarContainer=al("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if($e.appendChild(V()),t.innerContainer=al("div","flatpickr-innerContainer"),t.config.weekNumbers){var Je=Tt(),At=Je.weekWrapper,Wt=Je.weekNumbers;t.innerContainer.appendChild(At),t.weekNumbers=Wt,t.weekWrapper=At}t.rContainer=al("div","flatpickr-rContainer"),t.rContainer.appendChild(nt()),t.daysContainer||(t.daysContainer=al("div","flatpickr-days"),t.daysContainer.tabIndex=-1),be(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),$e.appendChild(t.innerContainer)}t.config.enableTime&&$e.appendChild(mt()),kg(t.calendarContainer,"rangeMode",t.config.mode==="range"),kg(t.calendarContainer,"animate",t.config.animate===!0),kg(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild($e);var Wn=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Wn&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var lo=al("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(lo,t.element),lo.appendChild(t.element),t.altInput&&lo.appendChild(t.altInput),lo.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function re($e,Je,At,Wt){var Wn=he(Je,!0),lo=al("span",$e,Je.getDate().toString());return lo.dateObj=Je,lo.$i=Wt,lo.setAttribute("aria-label",t.formatDate(Je,t.config.ariaDateFormat)),$e.indexOf("hidden")===-1&&A1(Je,t.now)===0&&(t.todayDateElem=lo,lo.classList.add("today"),lo.setAttribute("aria-current","date")),Wn?(lo.tabIndex=-1,Ls(Je)&&(lo.classList.add("selected"),t.selectedDateElem=lo,t.config.mode==="range"&&(kg(lo,"startRange",t.selectedDates[0]&&A1(Je,t.selectedDates[0],!0)===0),kg(lo,"endRange",t.selectedDates[1]&&A1(Je,t.selectedDates[1],!0)===0),$e==="nextMonthDay"&&lo.classList.add("inRange")))):lo.classList.add("flatpickr-disabled"),t.config.mode==="range"&&na(Je)&&!Ls(Je)&&lo.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&$e!=="prevMonthDay"&&Wt%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(Je)+"</span>"),Mo("onDayCreate",lo),lo}function J($e){$e.focus(),t.config.mode==="range"&&xo($e)}function we($e){for(var Je=$e>0?0:t.config.showMonths-1,At=$e>0?t.config.showMonths:-1,Wt=Je;Wt!=At;Wt+=$e)for(var Wn=t.daysContainer.children[Wt],lo=$e>0?0:Wn.children.length-1,go=$e>0?Wn.children.length:-1,cn=lo;cn!=go;cn+=$e){var ts=Wn.children[cn];if(ts.className.indexOf("hidden")===-1&&he(ts.dateObj))return ts}}function ye($e,Je){for(var At=$e.className.indexOf("Month")===-1?$e.dateObj.getMonth():t.currentMonth,Wt=Je>0?t.config.showMonths:-1,Wn=Je>0?1:-1,lo=At-t.currentMonth;lo!=Wt;lo+=Wn)for(var go=t.daysContainer.children[lo],cn=At-t.currentMonth===lo?$e.$i+Je:Je<0?go.children.length-1:0,ts=go.children.length,wo=cn;wo>=0&&wo<ts&&wo!=(Je>0?ts:-1);wo+=Wn){var cs=go.children[wo];if(cs.className.indexOf("hidden")===-1&&he(cs.dateObj)&&Math.abs($e.$i-wo)>=Math.abs(Je))return J(cs)}t.changeMonth(Wn),De(we(Wn),0)}function De($e,Je){var At=u(),Wt=es(At||document.body),Wn=$e!==void 0?$e:Wt?At:t.selectedDateElem!==void 0&&es(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&es(t.todayDateElem)?t.todayDateElem:we(Je>0?1:-1);Wn===void 0?t._input.focus():Wt?ye(Wn,Je):J(Wn)}function _e($e,Je){for(var At=(new Date($e,Je,1).getDay()-t.l10n.firstDayOfWeek+7)%7,Wt=t.utils.getDaysInMonth((Je-1+12)%12,$e),Wn=t.utils.getDaysInMonth(Je,$e),lo=window.document.createDocumentFragment(),go=t.config.showMonths>1,cn=go?"prevMonthDay hidden":"prevMonthDay",ts=go?"nextMonthDay hidden":"nextMonthDay",wo=Wt+1-At,cs=0;wo<=Wt;wo++,cs++)lo.appendChild(re("flatpickr-day "+cn,new Date($e,Je-1,wo),wo,cs));for(wo=1;wo<=Wn;wo++,cs++)lo.appendChild(re("flatpickr-day",new Date($e,Je,wo),wo,cs));for(var _r=Wn+1;_r<=42-At&&(t.config.showMonths===1||cs%7!==0);_r++,cs++)lo.appendChild(re("flatpickr-day "+ts,new Date($e,Je+1,_r%Wn),_r,cs));var Ir=al("div","dayContainer");return Ir.appendChild(lo),Ir}function be(){if(t.daysContainer!==void 0){W$(t.daysContainer),t.weekNumbers&&W$(t.weekNumbers);for(var $e=document.createDocumentFragment(),Je=0;Je<t.config.showMonths;Je++){var At=new Date(t.currentYear,t.currentMonth,1);At.setMonth(t.currentMonth+Je),$e.appendChild(_e(At.getFullYear(),At.getMonth()))}t.daysContainer.appendChild($e),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&xo()}}function tt(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var $e=function(Wt){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&Wt<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&Wt>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var Je=0;Je<12;Je++)if(!!$e(Je)){var At=al("option","flatpickr-monthDropdown-month");At.value=new Date(t.currentYear,Je).getMonth().toString(),At.textContent=sV(Je,t.config.shorthandCurrentMonth,t.l10n),At.tabIndex=-1,t.currentMonth===Je&&(At.selected=!0),t.monthsDropdownContainer.appendChild(At)}}}function Qe(){var $e=al("div","flatpickr-month"),Je=window.document.createDocumentFragment(),At;t.config.showMonths>1||t.config.monthSelectorType==="static"?At=al("span","cur-month"):(t.monthsDropdownContainer=al("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),j(t.monthsDropdownContainer,"change",function(go){var cn=S1(go),ts=parseInt(cn.value,10);t.changeMonth(ts-t.currentMonth),Mo("onMonthChange")}),tt(),At=t.monthsDropdownContainer);var Wt=j$("cur-year",{tabindex:"-1"}),Wn=Wt.getElementsByTagName("input")[0];Wn.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Wn.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Wn.setAttribute("max",t.config.maxDate.getFullYear().toString()),Wn.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var lo=al("div","flatpickr-current-month");return lo.appendChild(At),lo.appendChild(Wt),Je.appendChild(lo),$e.appendChild(Je),{container:$e,yearElement:Wn,monthElement:At}}function ft(){W$(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var $e=t.config.showMonths;$e--;){var Je=Qe();t.yearElements.push(Je.yearElement),t.monthElements.push(Je.monthElement),t.monthNav.appendChild(Je.container)}t.monthNav.appendChild(t.nextMonthNav)}function V(){return t.monthNav=al("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=al("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=al("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,ft(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function($e){t.__hidePrevMonthArrow!==$e&&(kg(t.prevMonthNav,"flatpickr-disabled",$e),t.__hidePrevMonthArrow=$e)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function($e){t.__hideNextMonthArrow!==$e&&(kg(t.nextMonthNav,"flatpickr-disabled",$e),t.__hideNextMonthArrow=$e)}}),t.currentYearElement=t.yearElements[0],gs(),t.monthNav}function mt(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var $e=Ste(t.config);t.timeContainer=al("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var Je=al("span","flatpickr-time-separator",":"),At=j$("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=At.getElementsByTagName("input")[0];var Wt=j$("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=Wt.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=xp(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?$e.hours:C($e.hours)),t.minuteElement.value=xp(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():$e.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(At),t.timeContainer.appendChild(Je),t.timeContainer.appendChild(Wt),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Wn=j$("flatpickr-second");t.secondElement=Wn.getElementsByTagName("input")[0],t.secondElement.value=xp(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():$e.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(al("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Wn)}return t.config.time_24hr||(t.amPM=al("span","flatpickr-am-pm",t.l10n.amPM[T0((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function nt(){t.weekdayContainer?W$(t.weekdayContainer):t.weekdayContainer=al("div","flatpickr-weekdays");for(var $e=t.config.showMonths;$e--;){var Je=al("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(Je)}return Ot(),t.weekdayContainer}function Ot(){if(!!t.weekdayContainer){var $e=t.l10n.firstDayOfWeek,Je=nce(t.l10n.weekdays.shorthand);$e>0&&$e<Je.length&&(Je=nce(Je.splice($e,Je.length),Je.splice(0,$e)));for(var At=t.config.showMonths;At--;)t.weekdayContainer.children[At].innerHTML=`
<span class='flatpickr-weekday'>
`+Je.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function Tt(){t.calendarContainer.classList.add("hasWeeks");var $e=al("div","flatpickr-weekwrapper");$e.appendChild(al("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Je=al("div","flatpickr-weeks");return $e.appendChild(Je),{weekWrapper:$e,weekNumbers:Je}}function He($e,Je){Je===void 0&&(Je=!0);var At=Je?$e:$e-t.currentMonth;At<0&&t._hidePrevMonthArrow===!0||At>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=At,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Mo("onYearChange"),tt()),be(),Mo("onMonthChange"),gs())}function ct($e,Je){if($e===void 0&&($e=!0),Je===void 0&&(Je=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Je===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var At=Ste(t.config),Wt=At.hours,Wn=At.minutes,lo=At.seconds;N(Wt,Wn,lo)}t.redraw(),$e&&Mo("onChange")}function dn(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Mo("onClose")}function kt(){t.config!==void 0&&Mo("onDestroy");for(var $e=t._handlers.length;$e--;)t._handlers[$e].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var Je=t.calendarContainer.parentNode;if(Je.lastChild&&Je.removeChild(Je.lastChild),Je.parentNode){for(;Je.firstChild;)Je.parentNode.insertBefore(Je.firstChild,Je);Je.parentNode.removeChild(Je)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(At){try{delete t[At]}catch{}})}function xn($e){return t.calendarContainer.contains($e)}function We($e){if(t.isOpen&&!t.config.inline){var Je=S1($e),At=xn(Je),Wt=Je===t.input||Je===t.altInput||t.element.contains(Je)||$e.path&&$e.path.indexOf&&(~$e.path.indexOf(t.input)||~$e.path.indexOf(t.altInput)),Wn=!Wt&&!At&&!xn($e.relatedTarget),lo=!t.config.ignoredFocusElements.some(function(go){return go.contains(Je)});Wn&&lo&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&g(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function xt($e){if(!(!$e||t.config.minDate&&$e<t.config.minDate.getFullYear()||t.config.maxDate&&$e>t.config.maxDate.getFullYear())){var Je=$e,At=t.currentYear!==Je;t.currentYear=Je||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),At&&(t.redraw(),Mo("onYearChange"),tt())}}function he($e,Je){var At;Je===void 0&&(Je=!0);var Wt=t.parseDate($e,void 0,Je);if(t.config.minDate&&Wt&&A1(Wt,t.config.minDate,Je!==void 0?Je:!t.minDateHasTime)<0||t.config.maxDate&&Wt&&A1(Wt,t.config.maxDate,Je!==void 0?Je:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Wt===void 0)return!1;for(var Wn=!!t.config.enable,lo=(At=t.config.enable)!==null&&At!==void 0?At:t.config.disable,go=0,cn=void 0;go<lo.length;go++){if(cn=lo[go],typeof cn=="function"&&cn(Wt))return Wn;if(cn instanceof Date&&Wt!==void 0&&cn.getTime()===Wt.getTime())return Wn;if(typeof cn=="string"){var ts=t.parseDate(cn,void 0,!0);return ts&&ts.getTime()===Wt.getTime()?Wn:!Wn}else if(typeof cn=="object"&&Wt!==void 0&&cn.from&&cn.to&&Wt.getTime()>=cn.from.getTime()&&Wt.getTime()<=cn.to.getTime())return Wn}return!Wn}function es($e){return t.daysContainer!==void 0?$e.className.indexOf("hidden")===-1&&$e.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains($e):!1}function ho($e){var Je=$e.target===t._input,At=t._input.value.trimEnd()!==va();Je&&At&&!($e.relatedTarget&&xn($e.relatedTarget))&&t.setDate(t._input.value,!0,$e.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function ao($e){var Je=S1($e),At=t.config.wrap?s.contains(Je):Je===t._input,Wt=t.config.allowInput,Wn=t.isOpen&&(!Wt||!At),lo=t.config.inline&&At&&!Wt;if($e.keyCode===13&&At){if(Wt)return t.setDate(t._input.value,!0,Je===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),Je.blur();t.open()}else if(xn(Je)||Wn||lo){var go=!!t.timeContainer&&t.timeContainer.contains(Je);switch($e.keyCode){case 13:go?($e.preventDefault(),g(),rs()):Jn($e);break;case 27:$e.preventDefault(),rs();break;case 8:case 46:At&&!t.config.allowInput&&($e.preventDefault(),t.clear());break;case 37:case 39:if(!go&&!At){$e.preventDefault();var cn=u();if(t.daysContainer!==void 0&&(Wt===!1||cn&&es(cn))){var ts=$e.keyCode===39?1:-1;$e.ctrlKey?($e.stopPropagation(),He(ts),De(we(1),0)):De(void 0,ts)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:$e.preventDefault();var wo=$e.keyCode===40?1:-1;t.daysContainer&&Je.$i!==void 0||Je===t.input||Je===t.altInput?$e.ctrlKey?($e.stopPropagation(),xt(t.currentYear-wo),De(we(1),0)):go||De(void 0,wo*7):Je===t.currentYearElement?xt(t.currentYear-wo):t.config.enableTime&&(!go&&t.hourElement&&t.hourElement.focus(),g($e),t._debouncedChange());break;case 9:if(go){var cs=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Vs){return Vs}),_r=cs.indexOf(Je);if(_r!==-1){var Ir=cs[_r+($e.shiftKey?-1:1)];$e.preventDefault(),(Ir||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(Je)&&$e.shiftKey&&($e.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&Je===t.amPM)switch($e.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],A(),an();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],A(),an();break}(At||xn(Je))&&Mo("onKeyDown",$e)}function xo($e,Je){if(Je===void 0&&(Je="flatpickr-day"),!(t.selectedDates.length!==1||$e&&(!$e.classList.contains(Je)||$e.classList.contains("flatpickr-disabled")))){for(var At=$e?$e.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Wt=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Wn=Math.min(At,t.selectedDates[0].getTime()),lo=Math.max(At,t.selectedDates[0].getTime()),go=!1,cn=0,ts=0,wo=Wn;wo<lo;wo+=qCe.DAY)he(new Date(wo),!0)||(go=go||wo>Wn&&wo<lo,wo<Wt&&(!cn||wo>cn)?cn=wo:wo>Wt&&(!ts||wo<ts)&&(ts=wo));var cs=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+Je));cs.forEach(function(_r){var Ir=_r.dateObj,Vs=Ir.getTime(),Ur=cn>0&&Vs<cn||ts>0&&Vs>ts;if(Ur){_r.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Bi){_r.classList.remove(Bi)});return}else if(go&&!Ur)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Bi){_r.classList.remove(Bi)}),$e!==void 0&&($e.classList.add(At<=t.selectedDates[0].getTime()?"startRange":"endRange"),Wt<At&&Vs===Wt?_r.classList.add("startRange"):Wt>At&&Vs===Wt&&_r.classList.add("endRange"),Vs>=cn&&(ts===0||Vs<=ts)&&jCe(Vs,Wt,At)&&_r.classList.add("inRange"))})}}function Yo(){t.isOpen&&!t.config.static&&!t.config.inline&&gn()}function Ct($e,Je){if(Je===void 0&&(Je=t._positionElement),t.isMobile===!0){if($e){$e.preventDefault();var At=S1($e);At&&At.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Mo("onOpen");return}else if(t._input.disabled||t.config.inline)return;var Wt=t.isOpen;t.isOpen=!0,Wt||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Mo("onOpen"),gn(Je)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&($e===void 0||!t.timeContainer.contains($e.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Jt($e){return function(Je){var At=t.config["_"+$e+"Date"]=t.parseDate(Je,t.config.dateFormat),Wt=t.config["_"+($e==="min"?"max":"min")+"Date"];At!==void 0&&(t[$e==="min"?"minDateHasTime":"maxDateHasTime"]=At.getHours()>0||At.getMinutes()>0||At.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Wn){return he(Wn)}),!t.selectedDates.length&&$e==="min"&&O(At),an()),t.daysContainer&&(bn(),At!==void 0?t.currentYearElement[$e]=At.getFullYear().toString():t.currentYearElement.removeAttribute($e),t.currentYearElement.disabled=!!Wt&&At!==void 0&&Wt.getFullYear()===At.getFullYear())}}function Et(){var $e=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Je=Em(Em({},JSON.parse(JSON.stringify(s.dataset||{}))),e),At={};t.config.parseDate=Je.parseDate,t.config.formatDate=Je.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(cs){t.config._enable=Zs(cs)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(cs){t.config._disable=Zs(cs)}});var Wt=Je.mode==="time";if(!Je.dateFormat&&(Je.enableTime||Wt)){var Wn=mf.defaultConfig.dateFormat||KD.dateFormat;At.dateFormat=Je.noCalendar||Wt?"H:i"+(Je.enableSeconds?":S":""):Wn+" H:i"+(Je.enableSeconds?":S":"")}if(Je.altInput&&(Je.enableTime||Wt)&&!Je.altFormat){var lo=mf.defaultConfig.altFormat||KD.altFormat;At.altFormat=Je.noCalendar||Wt?"h:i"+(Je.enableSeconds?":S K":" K"):lo+(" h:i"+(Je.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Jt("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Jt("max")});var go=function(cs){return function(_r){t.config[cs==="min"?"_minTime":"_maxTime"]=t.parseDate(_r,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:go("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:go("max")}),Je.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,At,Je);for(var cn=0;cn<$e.length;cn++)t.config[$e[cn]]=t.config[$e[cn]]===!0||t.config[$e[cn]]==="true";yte.filter(function(cs){return t.config[cs]!==void 0}).forEach(function(cs){t.config[cs]=wte(t.config[cs]||[]).map(f)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var cn=0;cn<t.config.plugins.length;cn++){var ts=t.config.plugins[cn](t)||{};for(var wo in ts)yte.indexOf(wo)>-1?t.config[wo]=wte(ts[wo]).map(f).concat(t.config[wo]):typeof Je[wo]>"u"&&(t.config[wo]=ts[wo])}Je.altInputClass||(t.config.altInputClass=Pe().className+" "+t.config.altInputClass),Mo("onParseConfig")}function Pe(){return t.config.wrap?s.querySelector("[data-input]"):s}function Ut(){typeof t.config.locale!="object"&&typeof mf.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Em(Em({},mf.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?mf.l10ns[t.config.locale]:void 0),LA.D="("+t.l10n.weekdays.shorthand.join("|")+")",LA.l="("+t.l10n.weekdays.longhand.join("|")+")",LA.M="("+t.l10n.months.shorthand.join("|")+")",LA.F="("+t.l10n.months.longhand.join("|")+")",LA.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var $e=Em(Em({},e),JSON.parse(JSON.stringify(s.dataset||{})));$e.time_24hr===void 0&&mf.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=ime(t),t.parseDate=_ne({config:t.config,l10n:t.l10n})}function gn($e){if(typeof t.config.position=="function")return void t.config.position(t,$e);if(t.calendarContainer!==void 0){Mo("onPreCalendarPosition");var Je=$e||t._positionElement,At=Array.prototype.reduce.call(t.calendarContainer.children,function(qo,Yr){return qo+Yr.offsetHeight},0),Wt=t.calendarContainer.offsetWidth,Wn=t.config.position.split(" "),lo=Wn[0],go=Wn.length>1?Wn[1]:null,cn=Je.getBoundingClientRect(),ts=window.innerHeight-cn.bottom,wo=lo==="above"||lo!=="below"&&ts<At&&cn.top>At,cs=window.pageYOffset+cn.top+(wo?-At-2:Je.offsetHeight+2);if(kg(t.calendarContainer,"arrowTop",!wo),kg(t.calendarContainer,"arrowBottom",wo),!t.config.inline){var _r=window.pageXOffset+cn.left,Ir=!1,Vs=!1;go==="center"?(_r-=(Wt-cn.width)/2,Ir=!0):go==="right"&&(_r-=Wt-cn.width,Vs=!0),kg(t.calendarContainer,"arrowLeft",!Ir&&!Vs),kg(t.calendarContainer,"arrowCenter",Ir),kg(t.calendarContainer,"arrowRight",Vs);var Ur=window.document.body.offsetWidth-(window.pageXOffset+cn.right),Bi=_r+Wt>window.document.body.offsetWidth,Ba=Ur+Wt>window.document.body.offsetWidth;if(kg(t.calendarContainer,"rightMost",Bi),!t.config.static)if(t.calendarContainer.style.top=cs+"px",!Bi)t.calendarContainer.style.left=_r+"px",t.calendarContainer.style.right="auto";else if(!Ba)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Ur+"px";else{var hi=yt();if(hi===void 0)return;var Ge=window.document.body.offsetWidth,qe=Math.max(0,Ge/2-Wt/2),It=".flatpickr-calendar.centerMost:before",jt=".flatpickr-calendar.centerMost:after",co=hi.cssRules.length,Bo="{left:"+cn.left+"px;right:auto;}";kg(t.calendarContainer,"rightMost",!1),kg(t.calendarContainer,"centerMost",!0),hi.insertRule(It+","+jt+Bo,co),t.calendarContainer.style.left=qe+"px",t.calendarContainer.style.right="auto"}}}}function yt(){for(var $e=null,Je=0;Je<document.styleSheets.length;Je++){var At=document.styleSheets[Je];if(!!At.cssRules){try{At.cssRules}catch{continue}$e=At;break}}return $e!=null?$e:Yt()}function Yt(){var $e=document.createElement("style");return document.head.appendChild($e),$e.sheet}function bn(){t.config.noCalendar||t.isMobile||(tt(),gs(),be())}function rs(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function Jn($e){$e.preventDefault(),$e.stopPropagation();var Je=function(cs){return cs.classList&&cs.classList.contains("flatpickr-day")&&!cs.classList.contains("flatpickr-disabled")&&!cs.classList.contains("notAllowed")},At=rme(S1($e),Je);if(At!==void 0){var Wt=At,Wn=t.latestSelectedDateObj=new Date(Wt.dateObj.getTime()),lo=(Wn.getMonth()<t.currentMonth||Wn.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Wt,t.config.mode==="single")t.selectedDates=[Wn];else if(t.config.mode==="multiple"){var go=Ls(Wn);go?t.selectedDates.splice(parseInt(go),1):t.selectedDates.push(Wn)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Wn,t.selectedDates.push(Wn),A1(Wn,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(cs,_r){return cs.getTime()-_r.getTime()}));if(A(),lo){var cn=t.currentYear!==Wn.getFullYear();t.currentYear=Wn.getFullYear(),t.currentMonth=Wn.getMonth(),cn&&(Mo("onYearChange"),tt()),Mo("onMonthChange")}if(gs(),be(),an(),!lo&&t.config.mode!=="range"&&t.config.showMonths===1?J(Wt):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var ts=t.config.mode==="single"&&!t.config.enableTime,wo=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(ts||wo)&&rs()}z()}}var ds={locale:[Ut,Ot],showMonths:[ft,h,nt],minDate:[ee],maxDate:[ee],positionElement:[Ps],clickOpens:[function(){t.config.clickOpens===!0?(j(t._input,"focus",t.open),j(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Or($e,Je){if($e!==null&&typeof $e=="object"){Object.assign(t.config,$e);for(var At in $e)ds[At]!==void 0&&ds[At].forEach(function(Wt){return Wt()})}else t.config[$e]=Je,ds[$e]!==void 0?ds[$e].forEach(function(Wt){return Wt()}):yte.indexOf($e)>-1&&(t.config[$e]=wte(Je));t.redraw(),an(!0)}function Ns($e,Je){var At=[];if($e instanceof Array)At=$e.map(function(Wt){return t.parseDate(Wt,Je)});else if($e instanceof Date||typeof $e=="number")At=[t.parseDate($e,Je)];else if(typeof $e=="string")switch(t.config.mode){case"single":case"time":At=[t.parseDate($e,Je)];break;case"multiple":At=$e.split(t.config.conjunction).map(function(Wt){return t.parseDate(Wt,Je)});break;case"range":At=$e.split(t.l10n.rangeSeparator).map(function(Wt){return t.parseDate(Wt,Je)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify($e)));t.selectedDates=t.config.allowInvalidPreload?At:At.filter(function(Wt){return Wt instanceof Date&&he(Wt,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Wt,Wn){return Wt.getTime()-Wn.getTime()})}function Js($e,Je,At){if(Je===void 0&&(Je=!1),At===void 0&&(At=t.config.dateFormat),$e!==0&&!$e||$e instanceof Array&&$e.length===0)return t.clear(Je);Ns($e,At),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),ee(void 0,Je),O(),t.selectedDates.length===0&&t.clear(!1),an(Je),Je&&Mo("onChange")}function Zs($e){return $e.slice().map(function(Je){return typeof Je=="string"||typeof Je=="number"||Je instanceof Date?t.parseDate(Je,void 0,!0):Je&&typeof Je=="object"&&Je.from&&Je.to?{from:t.parseDate(Je.from,void 0),to:t.parseDate(Je.to,void 0)}:Je}).filter(function(Je){return Je})}function ba(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var $e=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);$e&&Ns($e,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function ar(){if(t.input=Pe(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=al(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Ps()}function Ps(){t._positionElement=t.config.positionElement||t._input}function Zr(){var $e=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=al("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=$e,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=$e==="datetime-local"?"Y-m-d\\TH:i:S":$e==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}j(t.mobileInput,"change",function(Je){t.setDate(S1(Je).value,!1,t.mobileFormatStr),Mo("onChange"),Mo("onClose")})}function No($e){if(t.isOpen===!0)return t.close();t.open($e)}function Mo($e,Je){if(t.config!==void 0){var At=t.config[$e];if(At!==void 0&&At.length>0)for(var Wt=0;At[Wt]&&Wt<At.length;Wt++)At[Wt](t.selectedDates,t.input.value,t,Je);$e==="onChange"&&(t.input.dispatchEvent(Mr("change")),t.input.dispatchEvent(Mr("input")))}}function Mr($e){var Je=document.createEvent("Event");return Je.initEvent($e,!0,!0),Je}function Ls($e){for(var Je=0;Je<t.selectedDates.length;Je++){var At=t.selectedDates[Je];if(At instanceof Date&&A1(At,$e)===0)return""+Je}return!1}function na($e){return t.config.mode!=="range"||t.selectedDates.length<2?!1:A1($e,t.selectedDates[0])>=0&&A1($e,t.selectedDates[1])<=0}function gs(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function($e,Je){var At=new Date(t.currentYear,t.currentMonth,1);At.setMonth(t.currentMonth+Je),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[Je].textContent=sV(At.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=At.getMonth().toString(),$e.value=At.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function va($e){var Je=$e||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(At){return t.formatDate(At,Je)}).filter(function(At,Wt,Wn){return t.config.mode!=="range"||t.config.enableTime||Wn.indexOf(At)===Wt}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function an($e){$e===void 0&&($e=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=va(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=va(t.config.altFormat)),$e!==!1&&Mo("onValueUpdate")}function ps($e){var Je=S1($e),At=t.prevMonthNav.contains(Je),Wt=t.nextMonthNav.contains(Je);At||Wt?He(At?-1:1):t.yearElements.indexOf(Je)>=0?Je.select():Je.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):Je.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Ii($e){$e.preventDefault();var Je=$e.type==="keydown",At=S1($e),Wt=At;t.amPM!==void 0&&At===t.amPM&&(t.amPM.textContent=t.l10n.amPM[T0(t.amPM.textContent===t.l10n.amPM[0])]);var Wn=parseFloat(Wt.getAttribute("min")),lo=parseFloat(Wt.getAttribute("max")),go=parseFloat(Wt.getAttribute("step")),cn=parseInt(Wt.value,10),ts=$e.delta||(Je?$e.which===38?1:-1:0),wo=cn+go*ts;if(typeof Wt.value<"u"&&Wt.value.length===2){var cs=Wt===t.hourElement,_r=Wt===t.minuteElement;wo<Wn?(wo=lo+wo+T0(!cs)+(T0(cs)&&T0(!t.amPM)),_r&&ne(void 0,-1,t.hourElement)):wo>lo&&(wo=Wt===t.hourElement?wo-lo-T0(!t.amPM):Wn,_r&&ne(void 0,1,t.hourElement)),t.amPM&&cs&&(go===1?wo+cn===23:Math.abs(wo-cn)>go)&&(t.amPM.textContent=t.l10n.amPM[T0(t.amPM.textContent===t.l10n.amPM[0])]),Wt.value=xp(wo)}}return a(),t}function YD(s,e){for(var t=Array.prototype.slice.call(s).filter(function(f){return f instanceof HTMLElement}),r=[],a=0;a<t.length;a++){var u=t[a];try{if(u.getAttribute("data-fp-omit")!==null)continue;u._flatpickr!==void 0&&(u._flatpickr.destroy(),u._flatpickr=void 0),u._flatpickr=KCe(u,e||{}),r.push(u._flatpickr)}catch(f){console.error(f)}}return r.length===1?r[0]:r}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(s){return YD(this,s)},HTMLElement.prototype.flatpickr=function(s){return YD([this],s)});var mf=function(s,e){return typeof s=="string"?YD(window.document.querySelectorAll(s),e):s instanceof Node?YD([s],e):YD(s,e)};mf.defaultConfig={};mf.l10ns={en:Em({},BP),default:Em({},BP)};mf.localize=function(s){mf.l10ns.default=Em(Em({},mf.l10ns.default),s)};mf.setDefaults=function(s){mf.defaultConfig=Em(Em({},mf.defaultConfig),s)};mf.parseDate=_ne({});mf.formatDate=ime({});mf.compareDates=A1;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(s){return YD(this,s)});Date.prototype.fp_incr=function(s){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof s=="string"?parseInt(s,10):s))};typeof window<"u"&&(window.flatpickr=mf);function YCe(s){let e,t,r,a;return{c(){e=ce("input"),W(e,"type","text"),W(e,"id",s[2]),W(e,"class","form-control"),W(e,"autocomplete","off"),e.readOnly=t=s[1].readonly&&!s[3],_s(e,"is-invalid",s[8])},m(u,f){Le(u,e,f),wr(e,s[0]),s[19](e),r||(a=Dn(e,"input",s[18]),r=!0)},p(u,f){f&4&&W(e,"id",u[2]),f&10&&t!==(t=u[1].readonly&&!u[3])&&(e.readOnly=t),f&1&&e.value!==u[0]&&wr(e,u[0]),f&256&&_s(e,"is-invalid",u[8])},i:Sn,o:Sn,d(u){u&&Ie(e),s[19](null),r=!1,a()}}}function XCe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N;f=new wl({props:{icon:"calendar"}});let L=s[1].optionsFrom&&oce(s),j=s[0]&&sce(s);return{c(){e=ce("div"),t=ce("input"),a=Xe(),u=ce("button"),rn(f.$$.fragment),h=Xe(),g=ce("ul"),L&&L.c(),y=Xe(),j&&j.c(),C=Rs(),W(t,"type","search"),W(t,"id",s[2]),W(t,"class","form-control dropdown-toggle"),W(t,"placeholder","Search for options"),W(t,"data-bs-toggle","dropdown"),W(t,"autocomplete","off"),t.readOnly=r=s[1].readonly&&!s[3],_s(t,"is-invalid",s[8]),W(u,"class","btn btn-light ms-1"),W(g,"class","dropdown-menu w-100"),W(e,"class","dropdown d-flex")},m(z,q){Le(z,e,q),Q(e,t),wr(t,s[9]),s[12](t),Q(e,a),Q(e,u),on(f,u,null),Q(e,h),Q(e,g),L&&L.m(g,null),Le(z,y,q),j&&j.m(z,q),Le(z,C,q),A=!0,O||(N=[Dn(t,"keyup",function(){B0(s[4].update)&&s[4].update.apply(this,arguments)}),Dn(t,"focus",function(){B0(s[4].update)&&s[4].update.apply(this,arguments)}),Dn(t,"input",s[11]),Dn(u,"click",$u(s[13]))],O=!0)},p(z,q){s=z,(!A||q&4)&&W(t,"id",s[2]),(!A||q&10&&r!==(r=s[1].readonly&&!s[3]))&&(t.readOnly=r),q&512&&t.value!==s[9]&&wr(t,s[9]),(!A||q&256)&&_s(t,"is-invalid",s[8]),s[1].optionsFrom?L?(L.p(s,q),q&2&&Re(L,1)):(L=oce(s),L.c(),Re(L,1),L.m(g,null)):L&&(To(),Ue(L,1,1,()=>{L=null}),Do()),s[0]?j?j.p(s,q):(j=sce(s),j.c(),j.m(C.parentNode,C)):j&&(j.d(1),j=null)},i(z){A||(Re(f.$$.fragment,z),Re(L),A=!0)},o(z){Ue(f.$$.fragment,z),Ue(L),A=!1},d(z){z&&Ie(e),s[12](null),sn(f),L&&L.d(),z&&Ie(y),j&&j.d(z),z&&Ie(C),O=!1,Zi(N)}}}function oce(s){let e,t,r,a;function u(g){s[15](g)}function f(g){s[16](g)}let h={field:s[1]};return s[0]!==void 0&&(h.value=s[0]),s[9]!==void 0&&(h.search=s[9]),e=new UV({props:h}),s[14](e),ss.push(()=>Er(e,"value",u)),ss.push(()=>Er(e,"search",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&2&&(C.field=g[1]),!t&&y&1&&(t=!0,C.value=g[0],Dr(()=>t=!1)),!r&&y&512&&(r=!0,C.search=g[9],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){s[14](null),sn(e,g)}}}function sce(s){let e,t,r,a,u,f,h;return{c(){e=ce("span"),t=ce("div"),r=Kt(s[0]),a=Xe(),u=ce("button"),W(u,"type","button"),W(u,"class","btn-close btn-sm ms-1"),os(u,"font-size","10px"),W(u,"aria-label","Close"),W(t,"class","d-flex align-items-center "),W(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,y){Le(g,e,y),Q(e,t),Q(t,r),Q(t,a),Q(t,u),f||(h=Dn(u,"click",$u(s[17])),f=!0)},p(g,y){y&1&&Gn(r,g[0])},d(g){g&&Ie(e),f=!1,h()}}}function rce(s){let e,t;return{c(){e=ce("div"),t=Kt(s[8]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&256&&Gn(t,r[8])},d(r){r&&Ie(e)}}}function JCe(s){let e,t,r,a,u;const f=[XCe,YCe],h=[];function g(C,A){return C[7]?0:1}t=g(s),r=h[t]=f[t](s);let y=s[8]&&rce(s);return{c(){e=ce("div"),r.c(),a=Xe(),y&&y.c(),W(e,"class","mb-0")},m(C,A){Le(C,e,A),h[t].m(e,null),Q(e,a),y&&y.m(e,null),u=!0},p(C,[A]){let O=t;t=g(C),t===O?h[t].p(C,A):(To(),Ue(h[O],1,1,()=>{h[O]=null}),Do(),r=h[t],r?r.p(C,A):(r=h[t]=f[t](C),r.c()),Re(r,1),r.m(e,a)),C[8]?y?y.p(C,A):(y=rce(C),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i(C){u||(Re(r),u=!0)},o(C){Ue(r),u=!1},d(C){C&&Ie(e),h[t].d(),y&&y.d()}}}function QCe(s,e,t){let r,a,u,{field:f}=e,{value:h}=e,{id:g}=e,{isCreateMode:y}=e,{validationErrors:C}=e,A,O,N,L={enableTime:!1,allowInput:!0,dateFormat:"Y-m-d"};f.min&&(L.minDate=f.min),f.max&&(L.maxDate=f.max),H0(()=>{(!f.readonly||y)&&(a&&(L.clickOpens=!1),t(6,N=mf(O,L)))});function j(){r=this.value,t(9,r)}function z(we){ss[we?"unshift":"push"](()=>{O=we,t(5,O)})}const q=we=>N.open();function ee(we){ss[we?"unshift":"push"](()=>{A=we,t(4,A)})}function F(we){h=we,t(0,h)}function ne(we){r=we,t(9,r)}const oe=we=>t(0,h="");function re(){h=this.value,t(0,h)}function J(we){ss[we?"unshift":"push"](()=>{O=we,t(5,O)})}return s.$$set=we=>{"field"in we&&t(1,f=we.field),"value"in we&&t(0,h=we.value),"id"in we&&t(2,g=we.id),"isCreateMode"in we&&t(3,y=we.isCreateMode),"validationErrors"in we&&t(10,C=we.validationErrors)},s.$$.update=()=>{s.$$.dirty&10&&t(7,a=f.optionsFrom&&!(f.readonly&&!y)),s.$$.dirty&1026&&t(8,u=Rg(C,f.name))},t(9,r=""),[h,f,g,y,A,O,N,a,u,r,C,j,z,q,ee,F,ne,oe,re,J]}class eSe extends ko{constructor(e){super(),So(this,e,QCe,JCe,Co,{field:1,value:0,id:2,isCreateMode:3,validationErrors:10})}}var Z$,tSe=new Uint8Array(16);function nSe(){if(!Z$&&(Z$=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Z$))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z$(tSe)}const oSe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function sSe(s){return typeof s=="string"&&oSe.test(s)}var Ph=[];for(var kte=0;kte<256;++kte)Ph.push((kte+256).toString(16).substr(1));function rSe(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(Ph[s[e+0]]+Ph[s[e+1]]+Ph[s[e+2]]+Ph[s[e+3]]+"-"+Ph[s[e+4]]+Ph[s[e+5]]+"-"+Ph[s[e+6]]+Ph[s[e+7]]+"-"+Ph[s[e+8]]+Ph[s[e+9]]+"-"+Ph[s[e+10]]+Ph[s[e+11]]+Ph[s[e+12]]+Ph[s[e+13]]+Ph[s[e+14]]+Ph[s[e+15]]).toLowerCase();if(!sSe(t))throw TypeError("Stringified UUID is invalid");return t}function iSe(s,e,t){s=s||{};var r=s.random||(s.rng||nSe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(var a=0;a<16;++a)e[t+a]=r[a];return e}return rSe(r)}function aSe(s){let e,t,r,a,u;return t=new wl({props:{icon:"dice"}}),{c(){e=ce("button"),rn(t.$$.fragment),W(e,"class","btn btn-primary ms-2"),W(e,"title","Generate a new UUIDv4")},m(f,h){Le(f,e,h),on(t,e,null),r=!0,a||(u=Dn(e,"click",s[4]),a=!0)},p:Sn,i(f){r||(Re(t.$$.fragment,f),r=!0)},o(f){Ue(t.$$.fragment,f),r=!1},d(f){f&&Ie(e),sn(t),a=!1,u()}}}function ice(s){let e,t;return{c(){e=ce("div"),t=Kt(s[2]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&4&&Gn(t,r[2])},d(r){r&&Ie(e)}}}function lSe(s){let e,t,r,a,u,f,h,g,y=!s[3]&&aSe(s),C=s[2]&&ice(s);return{c(){e=ce("div"),t=ce("div"),r=ce("input"),a=Xe(),y&&y.c(),u=Xe(),C&&C.c(),W(r,"type","text"),W(r,"id",s[1]),W(r,"class","form-control"),W(r,"autocomplete","off"),r.readOnly=s[3],_s(r,"is-invalid",s[2]),W(t,"class","d-flex justify-content-between"),W(e,"class","mb-0")},m(A,O){Le(A,e,O),Q(e,t),Q(t,r),wr(r,s[0]),Q(t,a),y&&y.m(t,null),Q(e,u),C&&C.m(e,null),f=!0,h||(g=Dn(r,"input",s[8]),h=!0)},p(A,[O]){(!f||O&2)&&W(r,"id",A[1]),O&1&&r.value!==A[0]&&wr(r,A[0]),(!f||O&4)&&_s(r,"is-invalid",A[2]),A[3]||y.p(A,O),A[2]?C?C.p(A,O):(C=ice(A),C.c(),C.m(e,null)):C&&(C.d(1),C=null)},i(A){f||(Re(y),f=!0)},o(A){Ue(y),f=!1},d(A){A&&Ie(e),y&&y.d(),C&&C.d(),h=!1,g()}}}function cSe(s,e,t){let r;ji("channelurl");let{validationErrors:a}=e,{field:u}=e,{value:f}=e,{id:h}=e,{isCreateMode:g}=e,y=u.readonly&&!g;function C(O){O.preventDefault(),t(0,f=iSe())}function A(){f=this.value,t(0,f)}return s.$$set=O=>{"validationErrors"in O&&t(5,a=O.validationErrors),"field"in O&&t(6,u=O.field),"value"in O&&t(0,f=O.value),"id"in O&&t(1,h=O.id),"isCreateMode"in O&&t(7,g=O.isCreateMode)},s.$$.update=()=>{s.$$.dirty&96&&t(2,r=Rg(a,u.name))},[f,h,r,y,C,a,u,g,A]}class uSe extends ko{constructor(e){super(),So(this,e,cSe,lSe,Co,{validationErrors:5,field:6,value:0,id:1,isCreateMode:7})}}function ace(s,e,t){const r=s.slice();return r[14]=e[t],r}function lce(s,e,t){const r=s.slice();return r[17]=e[t],r}function fSe(s){let e,t,r,a,u=s[3],f=[];for(let h=0;h<u.length;h+=1)f[h]=cce(lce(s,u,h));return{c(){e=ce("div"),t=ce("button"),t.textContent="Browse",r=Xe(),a=ce("ul");for(let h=0;h<f.length;h+=1)f[h].c();W(t,"class","btn btn-outline-primary btn-sm"),W(t,"type","button"),W(t,"data-bs-toggle","dropdown"),W(t,"aria-expanded","false"),W(a,"class","dropdown-menu"),W(e,"class","dropdown d-inline-block")},m(h,g){Le(h,e,g),Q(e,t),Q(e,r),Q(e,a);for(let y=0;y<f.length;y+=1)f[y]&&f[y].m(a,null)},p(h,g){if(g&40){u=h[3];let y;for(y=0;y<u.length;y+=1){const C=lce(h,u,y);f[y]?f[y].p(C,g):(f[y]=cce(C),f[y].c(),f[y].m(a,null))}for(;y<f.length;y+=1)f[y].d(1);f.length=u.length}},d(h){h&&Ie(e),ul(f,h)}}}function dSe(s){let e,t,r;return{c(){e=ce("button"),e.textContent="Browse",W(e,"class","btn btn-outline-primary")},m(a,u){Le(a,e,u),t||(r=Dn(e,"click",s[10]),t=!0)},p:Sn,d(a){a&&Ie(e),t=!1,r()}}}function cce(s){let e,t,r=s[17].label+"",a,u,f,h;function g(...y){return s[11](s[17],...y)}return{c(){e=ce("li"),t=ce("a"),a=Kt(r),u=Xe(),W(t,"class","dropdown-item"),W(t,"href","/")},m(y,C){Le(y,e,C),Q(e,t),Q(t,a),Q(e,u),f||(h=Dn(t,"click",g),f=!0)},p(y,C){s=y},d(y){y&&Ie(e),f=!1,h()}}}function uce(s){let e,t;return e=new ZV({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[hSe]},$$scope:{ctx:s}}}),e.$on("update",s[6]),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&1048580&&(u.$$scope={dirty:a,ctx:r}),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function fce(s,e){let t,r,a,u;return r=new WV({props:{classes:"h-100",record:e[14],hasDelete:!0}}),r.$on("remove",e[4]),{key:s,first:null,c(){t=ce("div"),rn(r.$$.fragment),a=Xe(),W(t,"class","col mb-3"),this.first=t},m(f,h){Le(f,t,h),on(r,t,null),Q(t,a),u=!0},p(f,h){e=f;const g={};h&4&&(g.record=e[14]),r.$set(g)},i(f){u||(Re(r.$$.fragment,f),u=!0)},o(f){Ue(r.$$.fragment,f),u=!1},d(f){f&&Ie(t),sn(r)}}}function hSe(s){let e=[],t=new Map,r,a,u=s[2];const f=h=>h[14].id;for(let h=0;h<u.length;h+=1){let g=ace(s,u,h),y=f(g);t.set(y,e[h]=fce(y,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();r=Rs()},m(h,g){for(let y=0;y<e.length;y+=1)e[y]&&e[y].m(h,g);Le(h,r,g),a=!0},p(h,g){g&20&&(u=h[2],To(),e=Om(e,g,f,1,h,u,t,r.parentNode,f2,fce,r,ace),Do())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Re(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)Ue(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Ie(r)}}}function mSe(s){let e,t,r,a,u;function f(A,O){return A[0].collections.length===1?dSe:fSe}let h=f(s),g=h(s),y=s[2].length>0&&uce(s),C={};return a=new $he({props:C}),s[12](a),a.$on("insert",s[7]),{c(){e=ce("div"),g.c(),t=Xe(),y&&y.c(),r=Xe(),rn(a.$$.fragment),W(e,"class","mb-0")},m(A,O){Le(A,e,O),g.m(e,null),Le(A,t,O),y&&y.m(A,O),Le(A,r,O),on(a,A,O),u=!0},p(A,[O]){h===(h=f(A))&&g?g.p(A,O):(g.d(1),g=h(A),g&&(g.c(),g.m(e,null))),A[2].length>0?y?(y.p(A,O),O&4&&Re(y,1)):(y=uce(A),y.c(),Re(y,1),y.m(r.parentNode,r)):y&&(To(),Ue(y,1,1,()=>{y=null}),Do());const N={};a.$set(N)},i(A){u||(Re(y),Re(a.$$.fragment,A),u=!0)},o(A){Ue(y),Ue(a.$$.fragment,A),u=!1},d(A){A&&Ie(e),g.d(),A&&Ie(t),y&&y.d(A),A&&Ie(r),s[12](null),sn(a,A)}}}function gSe(s,e,t){let r;const a=ji("channel");let{field:u}=e,{record:f}=e,{graph:h}=e,g,y=a.schemas.filter(q=>u.collections.includes(q.name));function C(q){q.preventDefault(),t(8,h.edges=h.edges.filter(ee=>!(ee.target===q.detail&&ee.field===u.name)),h)}function A(q,ee){q.preventDefault(),g.open(ee)}async function O(q){console.log(q.detail),t(8,h.edges=await aI(q.detail.source,q.detail.target,h.edges,u.name),h)}function N(q){var re;q.preventDefault(),g.close();const ee=q.detail.records,F=q.detail.action;let ne=ee.map(J=>({target:J.id,source:f.id,sourceSchema:f.schema,targetSchema:J.schema,field:u.name,rank:""})),oe=(re=h.edges)!=null?re:[];F==="replace"&&(oe=oe.filter(J=>J.field!==u.name)),t(8,h.records=Hu.exports.uniqBy([...h.records,...ee],J=>J.id),h),t(8,h.edges=Hu.exports.uniqBy([...oe,...ne],J=>J.target+J.field),h)}const L=q=>A(q,y[0].name),j=(q,ee)=>A(ee,q.name);function z(q){ss[q?"unshift":"push"](()=>{g=q,t(1,g)})}return s.$$set=q=>{"field"in q&&t(0,u=q.field),"record"in q&&t(9,f=q.record),"graph"in q&&t(8,h=q.graph)},s.$$.update=()=>{var q;s.$$.dirty&769&&t(2,r=(q=h==null?void 0:h.edges.filter(ee=>ee.field===u.name).map(ee=>h.records.find(F=>F.id==ee.target&&f.id==ee.source)).filter(ee=>!!(ee!=null&&ee.id)))!=null?q:[])},[u,g,r,y,C,A,O,N,h,f,L,j,z]}class pSe extends ko{constructor(e){super(),So(this,e,gSe,mSe,Co,{field:0,record:9,graph:8})}}function dce(s){let e,t;return{c(){e=ce("div"),t=Kt(s[5]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&32&&Gn(t,r[5])},d(r){r&&Ie(e)}}}function bSe(s){let e,t,r,a,u,f,h=s[5]&&dce(s);return{c(){e=ce("div"),t=ce("textarea"),a=Xe(),h&&h.c(),W(t,"id",s[3]),W(t,"class","form-control svelte-1er4ovm"),W(t,"rows","2"),t.readOnly=r=s[1].readonly&&!s[2],_s(t,"is-invalid",s[5]),W(e,"class","mb-0")},m(g,y){Le(g,e,y),Q(e,t),wr(t,s[0]),s[8](t),Q(e,a),h&&h.m(e,null),u||(f=[Dn(t,"input",s[7]),Dn(t,"input",Cne),Dn(t,"focus",Cne)],u=!0)},p(g,[y]){y&8&&W(t,"id",g[3]),y&6&&r!==(r=g[1].readonly&&!g[2])&&(t.readOnly=r),y&1&&wr(t,g[0]),y&32&&_s(t,"is-invalid",g[5]),g[5]?h?h.p(g,y):(h=dce(g),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i:Sn,o:Sn,d(g){g&&Ie(e),s[8](null),h&&h.d(),u=!1,Zi(f)}}}function Cne(s){let e;s.target?e=s.target:e=s,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function vSe(s,e,t){let r,{field:a}=e,{value:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e,g,{id:y}=e;H0(()=>{Cne(g)});function C(){u=this.value,t(0,u)}function A(O){ss[O?"unshift":"push"](()=>{g=O,t(4,g)})}return s.$$set=O=>{"field"in O&&t(1,a=O.field),"value"in O&&t(0,u=O.value),"isCreateMode"in O&&t(2,f=O.isCreateMode),"validationErrors"in O&&t(6,h=O.validationErrors),"id"in O&&t(3,y=O.id)},s.$$.update=()=>{s.$$.dirty&66&&t(5,r=Rg(h,a.name))},[u,a,f,y,g,r,h,C,A]}class ame extends ko{constructor(e){super(),So(this,e,vSe,bSe,Co,{field:1,value:0,isCreateMode:2,validationErrors:6,id:3})}}function ySe(s){let e,t,r,a;return{c(){e=ce("input"),W(e,"type","text"),W(e,"id",s[3]),W(e,"class","form-control"),W(e,"autocomplete","off"),e.readOnly=t=s[1].readonly&&!s[2],_s(e,"is-invalid",s[8])},m(u,f){Le(u,e,f),wr(e,s[0]),s[20](e),r||(a=Dn(e,"input",s[19]),r=!0)},p(u,f){f&8&&W(e,"id",u[3]),f&6&&t!==(t=u[1].readonly&&!u[2])&&(e.readOnly=t),f&1&&e.value!==u[0]&&wr(e,u[0]),f&256&&_s(e,"is-invalid",u[8])},i:Sn,o:Sn,d(u){u&&Ie(e),s[20](null),r=!1,a()}}}function wSe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N;f=new wl({props:{icon:"calendar"}});let L=s[1].optionsFrom&&hce(s),j=s[0]&&mce(s);return{c(){e=ce("div"),t=ce("input"),a=Xe(),u=ce("button"),rn(f.$$.fragment),h=Xe(),g=ce("ul"),L&&L.c(),y=Xe(),j&&j.c(),C=Rs(),W(t,"type","search"),W(t,"id",s[3]),W(t,"class","form-control dropdown-toggle"),W(t,"placeholder","Search for options"),W(t,"data-bs-toggle","dropdown"),W(t,"autocomplete","off"),t.readOnly=r=s[1].readonly&&!s[2],_s(t,"is-invalid",s[8]),W(u,"class","btn btn-light ms-1"),W(g,"class","dropdown-menu w-100"),W(e,"class","dropdown d-flex")},m(z,q){Le(z,e,q),Q(e,t),wr(t,s[9]),s[13](t),Q(e,a),Q(e,u),on(f,u,null),Q(e,h),Q(e,g),L&&L.m(g,null),Le(z,y,q),j&&j.m(z,q),Le(z,C,q),A=!0,O||(N=[Dn(t,"keyup",function(){B0(s[4].update)&&s[4].update.apply(this,arguments)}),Dn(t,"focus",function(){B0(s[4].update)&&s[4].update.apply(this,arguments)}),Dn(t,"input",s[12]),Dn(u,"click",$u(s[14]))],O=!0)},p(z,q){s=z,(!A||q&8)&&W(t,"id",s[3]),(!A||q&6&&r!==(r=s[1].readonly&&!s[2]))&&(t.readOnly=r),q&512&&t.value!==s[9]&&wr(t,s[9]),(!A||q&256)&&_s(t,"is-invalid",s[8]),s[1].optionsFrom?L?(L.p(s,q),q&2&&Re(L,1)):(L=hce(s),L.c(),Re(L,1),L.m(g,null)):L&&(To(),Ue(L,1,1,()=>{L=null}),Do()),s[0]?j?j.p(s,q):(j=mce(s),j.c(),j.m(C.parentNode,C)):j&&(j.d(1),j=null)},i(z){A||(Re(f.$$.fragment,z),Re(L),A=!0)},o(z){Ue(f.$$.fragment,z),Ue(L),A=!1},d(z){z&&Ie(e),s[13](null),sn(f),L&&L.d(),z&&Ie(y),j&&j.d(z),z&&Ie(C),O=!1,Zi(N)}}}function hce(s){let e,t,r,a;function u(g){s[16](g)}function f(g){s[17](g)}let h={field:s[1]};return s[0]!==void 0&&(h.value=s[0]),s[9]!==void 0&&(h.search=s[9]),e=new UV({props:h}),s[15](e),ss.push(()=>Er(e,"value",u)),ss.push(()=>Er(e,"search",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&2&&(C.field=g[1]),!t&&y&1&&(t=!0,C.value=g[0],Dr(()=>t=!1)),!r&&y&512&&(r=!0,C.search=g[9],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){s[15](null),sn(e,g)}}}function mce(s){let e,t,r,a,u,f,h;return{c(){e=ce("span"),t=ce("div"),r=Kt(s[0]),a=Xe(),u=ce("button"),W(u,"type","button"),W(u,"class","btn-close btn-sm ms-1"),os(u,"font-size","10px"),W(u,"aria-label","Close"),W(t,"class","d-flex align-items-center "),W(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(g,y){Le(g,e,y),Q(e,t),Q(t,r),Q(t,a),Q(t,u),f||(h=Dn(u,"click",$u(s[18])),f=!0)},p(g,y){y&1&&Gn(r,g[0])},d(g){g&&Ie(e),f=!1,h()}}}function gce(s){let e,t;return{c(){e=ce("div"),t=Kt(s[8]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&256&&Gn(t,r[8])},d(r){r&&Ie(e)}}}function _Se(s){let e,t,r,a,u,f,h;const g=[wSe,ySe],y=[];function C(O,N){return O[7]?0:1}t=C(s),r=y[t]=g[t](s);let A=s[8]&&gce(s);return{c(){e=ce("div"),r.c(),a=Xe(),u=ce("small"),u.textContent=`Dates are displayed according to your timezone: ${s[10]}`,f=Xe(),A&&A.c(),W(u,"class","text-primary opacity-50"),W(e,"class","mb-0")},m(O,N){Le(O,e,N),y[t].m(e,null),Q(e,a),Q(e,u),Q(e,f),A&&A.m(e,null),h=!0},p(O,[N]){let L=t;t=C(O),t===L?y[t].p(O,N):(To(),Ue(y[L],1,1,()=>{y[L]=null}),Do(),r=y[t],r?r.p(O,N):(r=y[t]=g[t](O),r.c()),Re(r,1),r.m(e,a)),O[8]?A?A.p(O,N):(A=gce(O),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},i(O){h||(Re(r),h=!0)},o(O){Ue(r),h=!1},d(O){O&&Ie(e),y[t].d(),A&&A.d()}}}function CSe(s,e,t){let r,a,u,{field:f}=e,{value:h}=e,{isCreateMode:g}=e,{validationErrors:y}=e;const C=Intl.DateTimeFormat().resolvedOptions().timeZone;let{id:A}=e,O,N,L,j={enableTime:!1,allowInput:!0,altInput:!0,altFormat:"Y-m-d H:i:S",dateFormat:"Z",enableTime:!0,time_24hr:!0,enableSeconds:!0};f.min&&(j.minDate=f.min),f.max&&(j.maxDate=f.max),H0(()=>{(!f.readonly||g)&&(a&&(j.clickOpens=!1),t(6,L=mf(N,j)))});function z(){r=this.value,t(9,r)}function q(ye){ss[ye?"unshift":"push"](()=>{N=ye,t(5,N)})}const ee=ye=>L.open();function F(ye){ss[ye?"unshift":"push"](()=>{O=ye,t(4,O)})}function ne(ye){h=ye,t(0,h)}function oe(ye){r=ye,t(9,r)}const re=ye=>t(0,h="");function J(){h=this.value,t(0,h)}function we(ye){ss[ye?"unshift":"push"](()=>{N=ye,t(5,N)})}return s.$$set=ye=>{"field"in ye&&t(1,f=ye.field),"value"in ye&&t(0,h=ye.value),"isCreateMode"in ye&&t(2,g=ye.isCreateMode),"validationErrors"in ye&&t(11,y=ye.validationErrors),"id"in ye&&t(3,A=ye.id)},s.$$.update=()=>{s.$$.dirty&6&&t(7,a=f.optionsFrom&&!(f.readonly&&!g)),s.$$.dirty&2050&&t(8,u=Rg(y,f.name))},t(9,r=""),[h,f,g,A,O,N,L,a,u,r,C,y,z,q,ee,F,ne,oe,re,J,we]}class SSe extends ko{constructor(e){super(),So(this,e,CSe,_Se,Co,{field:1,value:0,isCreateMode:2,validationErrors:11,id:3})}}function pce(s){let e,t;return{c(){e=ce("div"),t=Kt(s[2]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&4&&Gn(t,r[2])},d(r){r&&Ie(e)}}}function kSe(s){let e,t,r,a,u;function f(y){s[7](y)}let h={additionalConfig:s[3],schema:s[1]};s[0]!==void 0&&(h.value=s[0]),t=new sme({props:h}),ss.push(()=>Er(t,"value",f));let g=s[2]&&pce(s);return{c(){e=ce("div"),rn(t.$$.fragment),a=Xe(),g&&g.c(),W(e,"class","mb-0")},m(y,C){Le(y,e,C),on(t,e,null),Q(e,a),g&&g.m(e,null),u=!0},p(y,[C]){const A={};C&2&&(A.schema=y[1]),!r&&C&1&&(r=!0,A.value=y[0],Dr(()=>r=!1)),t.$set(A),y[2]?g?g.p(y,C):(g=pce(y),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i(y){u||(Re(t.$$.fragment,y),u=!0)},o(y){Ue(t.$$.fragment,y),u=!1},d(y){y&&Ie(e),sn(t),g&&g.d()}}}function ESe(s,e,t){let r,{value:a}=e,{field:u}=e,{isCreateMode:f}=e,{schema:h}=e,{validationErrors:g}=e,y={readonly:u.readonly&&!f};function C(A){a=A,t(0,a)}return s.$$set=A=>{"value"in A&&t(0,a=A.value),"field"in A&&t(4,u=A.field),"isCreateMode"in A&&t(5,f=A.isCreateMode),"schema"in A&&t(1,h=A.schema),"validationErrors"in A&&t(6,g=A.validationErrors)},s.$$.update=()=>{s.$$.dirty&80&&t(2,r=Rg(g,u.name))},[a,h,r,y,u,f,g,C]}class xSe extends ko{constructor(e){super(),So(this,e,ESe,kSe,Co,{value:0,field:4,isCreateMode:5,schema:1,validationErrors:6})}}class cl{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){let a=[];return this.decompose(0,e,a,2),r.length&&r.decompose(0,r.length,a,3),this.decompose(t,this.length,a,1),Yy.from(a,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let r=[];return this.decompose(e,t,r,0),Yy.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),a=new TP(this),u=new TP(e);for(let f=t,h=t;;){if(a.next(f),u.next(f),f=0,a.lineBreak!=u.lineBreak||a.done!=u.done||a.value!=u.value)return!1;if(h+=a.value.length,a.done||h>=r)return!0}}iter(e=1){return new TP(this,e)}iterRange(e,t=this.length){return new lme(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let a=this.line(e).from;r=this.iterRange(a,Math.max(a,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new cme(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?cl.empty:e.length<=32?new hf(e):Yy.from(hf.split(e,[]))}}class hf extends cl{constructor(e,t=ASe(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,a){for(let u=0;;u++){let f=this.text[u],h=a+f.length;if((t?r:h)>=e)return new TSe(a,h,r,f);a=h+1,r++}}decompose(e,t,r,a){let u=e<=0&&t>=this.length?this:new hf(bce(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(a&1){let f=r.pop(),h=Nz(u.text,f.text.slice(),0,u.length);if(h.length<=32)r.push(new hf(h,f.length+u.length));else{let g=h.length>>1;r.push(new hf(h.slice(0,g)),new hf(h.slice(g)))}}else r.push(u)}replace(e,t,r){if(!(r instanceof hf))return super.replace(e,t,r);let a=Nz(this.text,Nz(r.text,bce(this.text,0,e)),t),u=this.length+r.length-(t-e);return a.length<=32?new hf(a,u):Yy.from(hf.split(a,[]),u)}sliceString(e,t=this.length,r=`
`){let a="";for(let u=0,f=0;u<=t&&f<this.text.length;f++){let h=this.text[f],g=u+h.length;u>e&&f&&(a+=r),e<g&&t>u&&(a+=h.slice(Math.max(0,e-u),t-u)),u=g+1}return a}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],a=-1;for(let u of e)r.push(u),a+=u.length+1,r.length==32&&(t.push(new hf(r,a)),r=[],a=-1);return a>-1&&t.push(new hf(r,a)),t}}class Yy extends cl{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,a){for(let u=0;;u++){let f=this.children[u],h=a+f.length,g=r+f.lines-1;if((t?g:h)>=e)return f.lineInner(e,t,r,a);a=h+1,r=g+1}}decompose(e,t,r,a){for(let u=0,f=0;f<=t&&u<this.children.length;u++){let h=this.children[u],g=f+h.length;if(e<=g&&t>=f){let y=a&((f<=e?1:0)|(g>=t?2:0));f>=e&&g<=t&&!y?r.push(h):h.decompose(e-f,t-f,r,y)}f=g+1}}replace(e,t,r){if(r.lines<this.lines)for(let a=0,u=0;a<this.children.length;a++){let f=this.children[a],h=u+f.length;if(e>=u&&t<=h){let g=f.replace(e-u,t-u,r),y=this.lines-f.lines+g.lines;if(g.lines<y>>5-1&&g.lines>y>>5+1){let C=this.children.slice();return C[a]=g,new Yy(C,this.length-(t-e)+r.length)}return super.replace(u,h,g)}u=h+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
`){let a="";for(let u=0,f=0;u<this.children.length&&f<=t;u++){let h=this.children[u],g=f+h.length;f>e&&u&&(a+=r),e<g&&t>f&&(a+=h.sliceString(e-f,t-f,r)),f=g+1}return a}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Yy))return 0;let r=0,[a,u,f,h]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;a+=t,u+=t){if(a==f||u==h)return r;let g=this.children[a],y=e.children[u];if(g!=y)return r+g.scanIdentical(y,t);r+=g.length+1}}static from(e,t=e.reduce((r,a)=>r+a.length+1,-1)){let r=0;for(let N of e)r+=N.lines;if(r<32){let N=[];for(let L of e)L.flatten(N);return new hf(N,t)}let a=Math.max(32,r>>5),u=a<<1,f=a>>1,h=[],g=0,y=-1,C=[];function A(N){let L;if(N.lines>u&&N instanceof Yy)for(let j of N.children)A(j);else N.lines>f&&(g>f||!g)?(O(),h.push(N)):N instanceof hf&&g&&(L=C[C.length-1])instanceof hf&&N.lines+L.lines<=32?(g+=N.lines,y+=N.length+1,C[C.length-1]=new hf(L.text.concat(N.text),L.length+1+N.length)):(g+N.lines>a&&O(),g+=N.lines,y+=N.length+1,C.push(N))}function O(){g!=0&&(h.push(C.length==1?C[0]:Yy.from(C,y)),y=-1,g=C.length=0)}for(let N of e)A(N);return O(),h.length==1?h[0]:new Yy(h,t)}}cl.empty=new hf([""],0);function ASe(s){let e=-1;for(let t of s)e+=t.length+1;return e}function Nz(s,e,t=0,r=1e9){for(let a=0,u=0,f=!0;u<s.length&&a<=r;u++){let h=s[u],g=a+h.length;g>=t&&(g>r&&(h=h.slice(0,r-a)),a<t&&(h=h.slice(t-a)),f?(e[e.length-1]+=h,f=!1):e.push(h)),a=g+1}return e}function bce(s,e,t){return Nz(s,[""],e,t)}class TP{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof hf?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,a=this.nodes[r],u=this.offsets[r],f=u>>1,h=a instanceof hf?a.text.length:a.children.length;if(f==(t>0?h:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((u&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(a instanceof hf){let g=a.text[f+(t<0?-1:0)];if(this.offsets[r]+=t,g.length>Math.max(0,e))return this.value=e==0?g:t>0?g.slice(e):g.slice(0,g.length-e),this;e-=g.length}else{let g=a.children[f+(t<0?-1:0)];e>g.length?(e-=g.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(g),this.offsets.push(t>0?1:(g instanceof hf?g.text.length:g.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class lme{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new TP(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:a}=this.cursor.next(e);return this.pos+=(a.length+e)*t,this.value=a.length<=r?a:t<0?a.slice(a.length-r):a.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class cme{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:a}=this.inner.next(e);return t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=a,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(cl.prototype[Symbol.iterator]=function(){return this.iter()},TP.prototype[Symbol.iterator]=lme.prototype[Symbol.iterator]=cme.prototype[Symbol.iterator]=function(){return this});class TSe{constructor(e,t,r,a){this.from=e,this.to=t,this.number=r,this.text=a}get length(){return this.to-this.from}}let XD="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(s=>s?parseInt(s,36):1);for(let s=1;s<XD.length;s++)XD[s]+=XD[s-1];function DSe(s){for(let e=1;e<XD.length;e+=2)if(XD[e]>s)return XD[e-1]<=s;return!1}function vce(s){return s>=127462&&s<=127487}const yce=8205;function Tm(s,e,t=!0,r=!0){return(t?ume:OSe)(s,e,r)}function ume(s,e,t){if(e==s.length)return e;e&&fme(s.charCodeAt(e))&&dme(s.charCodeAt(e-1))&&e--;let r=Lh(s,e);for(e+=O0(r);e<s.length;){let a=Lh(s,e);if(r==yce||a==yce||t&&DSe(a))e+=O0(a),r=a;else if(vce(a)){let u=0,f=e-2;for(;f>=0&&vce(Lh(s,f));)u++,f-=2;if(u%2==0)break;e+=2}else break}return e}function OSe(s,e,t){for(;e>0;){let r=ume(s,e-2,t);if(r<e)return r;e--}return 0}function fme(s){return s>=56320&&s<57344}function dme(s){return s>=55296&&s<56320}function Lh(s,e){let t=s.charCodeAt(e);if(!dme(t)||e+1==s.length)return t;let r=s.charCodeAt(e+1);return fme(r)?(t-55296<<10)+(r-56320)+65536:t}function Poe(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function O0(s){return s<65536?1:2}const Sne=/\r\n?|\n/;var xg=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(xg||(xg={}));class n2{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,a=0;t<this.sections.length;){let u=this.sections[t++],f=this.sections[t++];f<0?(e(r,a,u),a+=u):a+=f,r+=u}}iterChangedRanges(e,t=!1){kne(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],a=this.sections[t++];a<0?e.push(r,a):e.push(a,r)}return new n2(e)}composeDesc(e){return this.empty?e:e.empty?this:hme(this,e)}mapDesc(e,t=!1){return e.empty?this:Ene(this,e,t)}mapPos(e,t=-1,r=xg.Simple){let a=0,u=0;for(let f=0;f<this.sections.length;){let h=this.sections[f++],g=this.sections[f++],y=a+h;if(g<0){if(y>e)return u+(e-a);u+=h}else{if(r!=xg.Simple&&y>=e&&(r==xg.TrackDel&&a<e&&y>e||r==xg.TrackBefore&&a<e||r==xg.TrackAfter&&y>e))return null;if(y>e||y==e&&t<0&&!h)return e==a||t<0?u:u+g;u+=g}a=y}if(e>a)throw new RangeError(`Position ${e} is out of range for changeset of length ${a}`);return u}touchesRange(e,t=e){for(let r=0,a=0;r<this.sections.length&&a<=t;){let u=this.sections[r++],f=this.sections[r++],h=a+u;if(f>=0&&a<=t&&h>=e)return a<e&&h>t?"cover":!0;a=h}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],a=this.sections[t++];e+=(e?" ":"")+r+(a>=0?":"+a:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new n2(e)}static create(e){return new n2(e)}}class fd extends n2{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return kne(this,(t,r,a,u,f)=>e=e.replace(a,a+(r-t),f),!1),e}mapDesc(e,t=!1){return Ene(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let a=0,u=0;a<t.length;a+=2){let f=t[a],h=t[a+1];if(h>=0){t[a]=h,t[a+1]=f;let g=a>>1;for(;r.length<g;)r.push(cl.empty);r.push(f?e.slice(u,u+f):cl.empty)}u+=f}return new fd(t,r)}compose(e){return this.empty?e:e.empty?this:hme(this,e,!0)}map(e,t=!1){return e.empty?this:Ene(this,e,t,!0)}iterChanges(e,t=!1){kne(this,e,t)}get desc(){return n2.create(this.sections)}filter(e){let t=[],r=[],a=[],u=new LP(this);e:for(let f=0,h=0;;){let g=f==e.length?1e9:e[f++];for(;h<g||h==g&&u.len==0;){if(u.done)break e;let C=Math.min(u.len,g-h);xm(a,C,-1);let A=u.ins==-1?-1:u.off==0?u.ins:0;xm(t,C,A),A>0&&ik(r,t,u.text),u.forward(C),h+=C}let y=e[f++];for(;h<y;){if(u.done)break e;let C=Math.min(u.len,y-h);xm(t,C,-1),xm(a,C,u.ins==-1?-1:u.off==0?u.ins:0),u.forward(C),h+=C}}return{changes:new fd(t,r),filtered:n2.create(a)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],a=this.sections[t+1];a<0?e.push(r):a==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let a=[],u=[],f=0,h=null;function g(C=!1){if(!C&&!a.length)return;f<t&&xm(a,t-f,-1);let A=new fd(a,u);h=h?h.compose(A.map(h)):A,a=[],u=[],f=0}function y(C){if(Array.isArray(C))for(let A of C)y(A);else if(C instanceof fd){if(C.length!=t)throw new RangeError(`Mismatched change set length (got ${C.length}, expected ${t})`);g(),h=h?h.compose(C.map(h)):C}else{let{from:A,to:O=A,insert:N}=C;if(A>O||A<0||O>t)throw new RangeError(`Invalid change range ${A} to ${O} (in doc of length ${t})`);let L=N?typeof N=="string"?cl.of(N.split(r||Sne)):N:cl.empty,j=L.length;if(A==O&&j==0)return;A<f&&g(),A>f&&xm(a,A-f,-1),xm(a,O-A,j),ik(u,a,L),f=O}}return y(e),g(!h),h}static empty(e){return new fd(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let a=0;a<e.length;a++){let u=e[a];if(typeof u=="number")t.push(u,-1);else{if(!Array.isArray(u)||typeof u[0]!="number"||u.some((f,h)=>h&&typeof f!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(u.length==1)t.push(u[0],0);else{for(;r.length<a;)r.push(cl.empty);r[a]=cl.of(u.slice(1)),t.push(u[0],r[a].length)}}}return new fd(t,r)}static createSet(e,t){return new fd(e,t)}}function xm(s,e,t,r=!1){if(e==0&&t<=0)return;let a=s.length-2;a>=0&&t<=0&&t==s[a+1]?s[a]+=e:e==0&&s[a]==0?s[a+1]+=t:r?(s[a]+=e,s[a+1]+=t):s.push(e,t)}function ik(s,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<s.length)s[s.length-1]=s[s.length-1].append(t);else{for(;s.length<r;)s.push(cl.empty);s.push(t)}}function kne(s,e,t){let r=s.inserted;for(let a=0,u=0,f=0;f<s.sections.length;){let h=s.sections[f++],g=s.sections[f++];if(g<0)a+=h,u+=h;else{let y=a,C=u,A=cl.empty;for(;y+=h,C+=g,g&&r&&(A=A.append(r[f-2>>1])),!(t||f==s.sections.length||s.sections[f+1]<0);)h=s.sections[f++],g=s.sections[f++];e(a,y,u,C,A),a=y,u=C}}}function Ene(s,e,t,r=!1){let a=[],u=r?[]:null,f=new LP(s),h=new LP(e);for(let g=-1;;)if(f.ins==-1&&h.ins==-1){let y=Math.min(f.len,h.len);xm(a,y,-1),f.forward(y),h.forward(y)}else if(h.ins>=0&&(f.ins<0||g==f.i||f.off==0&&(h.len<f.len||h.len==f.len&&!t))){let y=h.len;for(xm(a,h.ins,-1);y;){let C=Math.min(f.len,y);f.ins>=0&&g<f.i&&f.len<=C&&(xm(a,0,f.ins),u&&ik(u,a,f.text),g=f.i),f.forward(C),y-=C}h.next()}else if(f.ins>=0){let y=0,C=f.len;for(;C;)if(h.ins==-1){let A=Math.min(C,h.len);y+=A,C-=A,h.forward(A)}else if(h.ins==0&&h.len<C)C-=h.len,h.next();else break;xm(a,y,g<f.i?f.ins:0),u&&g<f.i&&ik(u,a,f.text),g=f.i,f.forward(f.len-C)}else{if(f.done&&h.done)return u?fd.createSet(a,u):n2.create(a);throw new Error("Mismatched change set lengths")}}function hme(s,e,t=!1){let r=[],a=t?[]:null,u=new LP(s),f=new LP(e);for(let h=!1;;){if(u.done&&f.done)return a?fd.createSet(r,a):n2.create(r);if(u.ins==0)xm(r,u.len,0,h),u.next();else if(f.len==0&&!f.done)xm(r,0,f.ins,h),a&&ik(a,r,f.text),f.next();else{if(u.done||f.done)throw new Error("Mismatched change set lengths");{let g=Math.min(u.len2,f.len),y=r.length;if(u.ins==-1){let C=f.ins==-1?-1:f.off?0:f.ins;xm(r,g,C,h),a&&C&&ik(a,r,f.text)}else f.ins==-1?(xm(r,u.off?0:u.len,g,h),a&&ik(a,r,u.textBit(g))):(xm(r,u.off?0:u.len,f.off?0:f.ins,h),a&&!f.off&&ik(a,r,f.text));h=(u.ins>g||f.ins>=0&&f.len>g)&&(h||r.length>y),u.forward2(g),f.forward(g)}}}}class LP{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?cl.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?cl.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class $A{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let r,a;return this.empty?r=a=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),a=e.mapPos(this.to,-1)),r==this.from&&a==this.to?this:new $A(r,a,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return qn.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return qn.range(this.anchor,r)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return qn.range(e.anchor,e.head)}static create(e,t,r){return new $A(e,t,r)}}class qn{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:qn.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new qn([this.main],0)}addRange(e,t=!0){return qn.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,qn.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new qn(e.ranges.map(t=>$A.fromJSON(t)),e.main)}static single(e,t=e){return new qn([qn.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,a=0;a<e.length;a++){let u=e[a];if(u.empty?u.from<=r:u.from<r)return qn.normalized(e.slice(),t);r=u.to}return new qn(e,t)}static cursor(e,t=0,r,a){return $A.create(e,e,(t==0?0:t<0?4:8)|(r==null?3:Math.min(2,r))|(a!=null?a:33554431)<<5)}static range(e,t,r,a){let u=(r!=null?r:33554431)<<5|(a==null?3:Math.min(2,a));return t<e?$A.create(t,e,24|u):$A.create(e,t,(t>e?4:0)|u)}static normalized(e,t=0){let r=e[t];e.sort((a,u)=>a.from-u.from),t=e.indexOf(r);for(let a=1;a<e.length;a++){let u=e[a],f=e[a-1];if(u.empty?u.from<=f.to:u.from<f.to){let h=f.from,g=Math.max(u.to,f.to);a<=t&&t--,e.splice(--a,2,u.anchor>u.head?qn.range(g,h):qn.range(h,g))}}return new qn(e,t)}}function mme(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Ioe=0;class Ds{constructor(e,t,r,a,u){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=a,this.id=Ioe++,this.default=e([]),this.extensions=typeof u=="function"?u(this):u}static define(e={}){return new Ds(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Boe),!!e.static,e.enables)}of(e){return new Pz([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Pz(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Pz(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Boe(s,e){return s==e||s.length==e.length&&s.every((t,r)=>t===e[r])}class Pz{constructor(e,t,r,a){this.dependencies=e,this.facet=t,this.type=r,this.value=a,this.id=Ioe++}dynamicSlot(e){var t;let r=this.value,a=this.facet.compareInput,u=this.id,f=e[u]>>1,h=this.type==2,g=!1,y=!1,C=[];for(let A of this.dependencies)A=="doc"?g=!0:A=="selection"?y=!0:(((t=e[A.id])!==null&&t!==void 0?t:1)&1)==0&&C.push(e[A.id]);return{create(A){return A.values[f]=r(A),1},update(A,O){if(g&&O.docChanged||y&&(O.docChanged||O.selection)||xne(A,C)){let N=r(A);if(h?!wce(N,A.values[f],a):!a(N,A.values[f]))return A.values[f]=N,1}return 0},reconfigure:(A,O)=>{let N,L=O.config.address[u];if(L!=null){let j=iV(O,L);if(this.dependencies.every(z=>z instanceof Ds?O.facet(z)===A.facet(z):z instanceof md?O.field(z,!1)==A.field(z,!1):!0)||(h?wce(N=r(A),j,a):a(N=r(A),j)))return A.values[f]=j,0}else N=r(A);return A.values[f]=N,1}}}}function wce(s,e,t){if(s.length!=e.length)return!1;for(let r=0;r<s.length;r++)if(!t(s[r],e[r]))return!1;return!0}function xne(s,e){let t=!1;for(let r of e)DP(s,r)&1&&(t=!0);return t}function MSe(s,e,t){let r=t.map(g=>s[g.id]),a=t.map(g=>g.type),u=r.filter(g=>!(g&1)),f=s[e.id]>>1;function h(g){let y=[];for(let C=0;C<r.length;C++){let A=iV(g,r[C]);if(a[C]==2)for(let O of A)y.push(O);else y.push(A)}return e.combine(y)}return{create(g){for(let y of r)DP(g,y);return g.values[f]=h(g),1},update(g,y){if(!xne(g,u))return 0;let C=h(g);return e.compare(C,g.values[f])?0:(g.values[f]=C,1)},reconfigure(g,y){let C=xne(g,r),A=y.config.facets[e.id],O=y.facet(e);if(A&&!C&&Boe(t,A))return g.values[f]=O,0;let N=h(g);return e.compare(N,O)?(g.values[f]=O,0):(g.values[f]=N,1)}}}const _ce=Ds.define({static:!0});class md{constructor(e,t,r,a,u){this.id=e,this.createF=t,this.updateF=r,this.compareF=a,this.spec=u,this.provides=void 0}static define(e){let t=new md(Ioe++,e.create,e.update,e.compare||((r,a)=>r===a),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(_ce).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,a)=>{let u=r.values[t],f=this.updateF(u,a);return this.compareF(u,f)?0:(r.values[t]=f,1)},reconfigure:(r,a)=>a.config.address[this.id]!=null?(r.values[t]=a.field(this),0):(r.values[t]=this.create(r),1)}}init(e){return[this,_ce.of({field:this,create:e})]}get extension(){return this}}const FA={lowest:4,low:3,default:2,high:1,highest:0};function iP(s){return e=>new gme(e,s)}const yO={highest:iP(FA.highest),high:iP(FA.high),default:iP(FA.default),low:iP(FA.low),lowest:iP(FA.lowest)};class gme{constructor(e,t){this.inner=e,this.prec=t}}class rO{of(e){return new Ane(this,e)}reconfigure(e){return rO.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ane{constructor(e,t){this.compartment=e,this.inner=t}}class rV{constructor(e,t,r,a,u,f){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=a,this.staticValues=u,this.facets=f,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let a=[],u=Object.create(null),f=new Map;for(let O of RSe(e,t,f))O instanceof md?a.push(O):(u[O.facet.id]||(u[O.facet.id]=[])).push(O);let h=Object.create(null),g=[],y=[];for(let O of a)h[O.id]=y.length<<1,y.push(N=>O.slot(N));let C=r==null?void 0:r.config.facets;for(let O in u){let N=u[O],L=N[0].facet,j=C&&C[O]||[];if(N.every(z=>z.type==0))if(h[L.id]=g.length<<1|1,Boe(j,N))g.push(r.facet(L));else{let z=L.combine(N.map(q=>q.value));g.push(r&&L.compare(z,r.facet(L))?r.facet(L):z)}else{for(let z of N)z.type==0?(h[z.id]=g.length<<1|1,g.push(z.value)):(h[z.id]=y.length<<1,y.push(q=>z.dynamicSlot(q)));h[L.id]=y.length<<1,y.push(z=>MSe(z,L,N))}}let A=y.map(O=>O(h));return new rV(e,f,A,h,g,u)}}function RSe(s,e,t){let r=[[],[],[],[],[]],a=new Map;function u(f,h){let g=a.get(f);if(g!=null){if(g<=h)return;let y=r[g].indexOf(f);y>-1&&r[g].splice(y,1),f instanceof Ane&&t.delete(f.compartment)}if(a.set(f,h),Array.isArray(f))for(let y of f)u(y,h);else if(f instanceof Ane){if(t.has(f.compartment))throw new RangeError("Duplicate use of compartment in extensions");let y=e.get(f.compartment)||f.inner;t.set(f.compartment,y),u(y,h)}else if(f instanceof gme)u(f.inner,f.prec);else if(f instanceof md)r[h].push(f),f.provides&&u(f.provides,h);else if(f instanceof Pz)r[h].push(f),f.facet.extensions&&u(f.facet.extensions,FA.default);else{let y=f.extension;if(!y)throw new Error(`Unrecognized extension value in extension set (${f}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);u(y,h)}}return u(s,FA.default),r.reduce((f,h)=>f.concat(h))}function DP(s,e){if(e&1)return 2;let t=e>>1,r=s.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;s.status[t]=4;let a=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|a}function iV(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}const pme=Ds.define(),bme=Ds.define({combine:s=>s.some(e=>e),static:!0}),vme=Ds.define({combine:s=>s.length?s[0]:void 0,static:!0}),yme=Ds.define(),wme=Ds.define(),_me=Ds.define(),Cme=Ds.define({combine:s=>s.length?s[0]:!1});class B_{constructor(e,t){this.type=e,this.value=t}static define(){return new NSe}}class NSe{of(e){return new B_(this,e)}}class PSe{constructor(e){this.map=e}of(e){return new Pi(this,e)}}class Pi{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Pi(this.type,t)}is(e){return this.type==e}static define(e={}){return new PSe(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let a of e){let u=a.map(t);u&&r.push(u)}return r}}Pi.reconfigure=Pi.define();Pi.appendConfig=Pi.define();class hd{constructor(e,t,r,a,u,f){this.startState=e,this.changes=t,this.selection=r,this.effects=a,this.annotations=u,this.scrollIntoView=f,this._doc=null,this._state=null,r&&mme(r,t.newLength),u.some(h=>h.type==hd.time)||(this.annotations=u.concat(hd.time.of(Date.now())))}static create(e,t,r,a,u,f){return new hd(e,t,r,a,u,f)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(hd.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}hd.time=B_.define();hd.userEvent=B_.define();hd.addToHistory=B_.define();hd.remote=B_.define();function ISe(s,e){let t=[];for(let r=0,a=0;;){let u,f;if(r<s.length&&(a==e.length||e[a]>=s[r]))u=s[r++],f=s[r++];else if(a<e.length)u=e[a++],f=e[a++];else return t;!t.length||t[t.length-1]<u?t.push(u,f):t[t.length-1]<f&&(t[t.length-1]=f)}}function Sme(s,e,t){var r;let a,u,f;return t?(a=e.changes,u=fd.empty(e.changes.length),f=s.changes.compose(e.changes)):(a=e.changes.map(s.changes),u=s.changes.mapDesc(e.changes,!0),f=s.changes.compose(a)),{changes:f,selection:e.selection?e.selection.map(u):(r=s.selection)===null||r===void 0?void 0:r.map(a),effects:Pi.mapEffects(s.effects,a).concat(Pi.mapEffects(e.effects,u)),annotations:s.annotations.length?s.annotations.concat(e.annotations):e.annotations,scrollIntoView:s.scrollIntoView||e.scrollIntoView}}function Tne(s,e,t){let r=e.selection,a=JD(e.annotations);return e.userEvent&&(a=a.concat(hd.userEvent.of(e.userEvent))),{changes:e.changes instanceof fd?e.changes:fd.of(e.changes||[],t,s.facet(vme)),selection:r&&(r instanceof qn?r:qn.single(r.anchor,r.head)),effects:JD(e.effects),annotations:a,scrollIntoView:!!e.scrollIntoView}}function kme(s,e,t){let r=Tne(s,e.length?e[0]:{},s.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let u=1;u<e.length;u++){e[u].filter===!1&&(t=!1);let f=!!e[u].sequential;r=Sme(r,Tne(s,e[u],f?r.changes.newLength:s.doc.length),f)}let a=hd.create(s,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return LSe(t?BSe(a):a)}function BSe(s){let e=s.startState,t=!0;for(let a of e.facet(yme)){let u=a(s);if(u===!1){t=!1;break}Array.isArray(u)&&(t=t===!0?u:ISe(t,u))}if(t!==!0){let a,u;if(t===!1)u=s.changes.invertedDesc,a=fd.empty(e.doc.length);else{let f=s.changes.filter(t);a=f.changes,u=f.filtered.mapDesc(f.changes).invertedDesc}s=hd.create(e,a,s.selection&&s.selection.map(u),Pi.mapEffects(s.effects,u),s.annotations,s.scrollIntoView)}let r=e.facet(wme);for(let a=r.length-1;a>=0;a--){let u=r[a](s);u instanceof hd?s=u:Array.isArray(u)&&u.length==1&&u[0]instanceof hd?s=u[0]:s=kme(e,JD(u),!1)}return s}function LSe(s){let e=s.startState,t=e.facet(_me),r=s;for(let a=t.length-1;a>=0;a--){let u=t[a](s);u&&Object.keys(u).length&&(r=Sme(r,Tne(e,u,s.changes.newLength),!0))}return r==s?s:hd.create(e,s.changes,s.selection,r.effects,r.annotations,r.scrollIntoView)}const FSe=[];function JD(s){return s==null?FSe:Array.isArray(s)?s:[s]}var jc=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(jc||(jc={}));const HSe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Dne;try{Dne=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $Se(s){if(Dne)return Dne.test(s);for(let e=0;e<s.length;e++){let t=s[e];if(/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||HSe.test(t)))return!0}return!1}function zSe(s){return e=>{if(!/\S/.test(e))return jc.Space;if($Se(e))return jc.Word;for(let t=0;t<s.length;t++)if(e.indexOf(s[t])>-1)return jc.Word;return jc.Other}}class Ea{constructor(e,t,r,a,u,f){this.config=e,this.doc=t,this.selection=r,this.values=a,this.status=e.statusTemplate.slice(),this.computeSlot=u,f&&(f._state=this);for(let h=0;h<this.config.dynamicSlots.length;h++)DP(this,h<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return DP(this,r),iV(this,r)}update(...e){return kme(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:a}=t;for(let f of e.effects)f.is(rO.reconfigure)?(t&&(a=new Map,t.compartments.forEach((h,g)=>a.set(g,h)),t=null),a.set(f.value.compartment,f.value.extension)):f.is(Pi.reconfigure)?(t=null,r=f.value):f.is(Pi.appendConfig)&&(t=null,r=JD(r).concat(f.value));let u;t?u=e.startState.values.slice():(t=rV.resolve(r,a,this),u=new Ea(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(h,g)=>g.reconfigure(h,this),null).values),new Ea(t,e.newDoc,e.newSelection,u,(f,h)=>h.update(f,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:qn.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),a=this.changes(r.changes),u=[r.range],f=JD(r.effects);for(let h=1;h<t.ranges.length;h++){let g=e(t.ranges[h]),y=this.changes(g.changes),C=y.map(a);for(let O=0;O<h;O++)u[O]=u[O].map(C);let A=a.mapDesc(y,!0);u.push(g.range.map(A)),a=a.compose(C),f=Pi.mapEffects(f,C).concat(Pi.mapEffects(JD(g.effects),A))}return{changes:a,selection:qn.create(u,t.mainIndex),effects:f}}changes(e=[]){return e instanceof fd?e:fd.of(e,this.doc.length,this.facet(Ea.lineSeparator))}toText(e){return cl.of(e.split(this.facet(Ea.lineSeparator)||Sne))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(DP(this,t),iV(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let a=e[r];a instanceof md&&this.config.address[a.id]!=null&&(t[r]=a.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let a=[];if(r){for(let u in r)if(Object.prototype.hasOwnProperty.call(e,u)){let f=r[u],h=e[u];a.push(f.init(g=>f.spec.fromJSON(h,g)))}}return Ea.create({doc:e.doc,selection:qn.fromJSON(e.selection),extensions:t.extensions?a.concat([t.extensions]):a})}static create(e={}){let t=rV.resolve(e.extensions||[],new Map),r=e.doc instanceof cl?e.doc:cl.of((e.doc||"").split(t.staticFacet(Ea.lineSeparator)||Sne)),a=e.selection?e.selection instanceof qn?e.selection:qn.single(e.selection.anchor,e.selection.head):qn.single(0);return mme(a,r.length),t.staticFacet(bme)||(a=a.asSingle()),new Ea(t,r,a,t.dynamicSlots.map(()=>null),(u,f)=>f.create(u),null)}get tabSize(){return this.facet(Ea.tabSize)}get lineBreak(){return this.facet(Ea.lineSeparator)||`
`}get readOnly(){return this.facet(Cme)}phrase(e,...t){for(let r of this.facet(Ea.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,a)=>{if(a=="$")return"$";let u=+(a||1);return!u||u>t.length?r:t[u-1]})),e}languageDataAt(e,t,r=-1){let a=[];for(let u of this.facet(pme))for(let f of u(this,t,r))Object.prototype.hasOwnProperty.call(f,e)&&a.push(f[e]);return a}charCategorizer(e){return zSe(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:a}=this.doc.lineAt(e),u=this.charCategorizer(e),f=e-r,h=e-r;for(;f>0;){let g=Tm(t,f,!1);if(u(t.slice(g,f))!=jc.Word)break;f=g}for(;h<a;){let g=Tm(t,h);if(u(t.slice(h,g))!=jc.Word)break;h=g}return f==h?null:qn.range(f+r,h+r)}}Ea.allowMultipleSelections=bme;Ea.tabSize=Ds.define({combine:s=>s.length?s[0]:4});Ea.lineSeparator=vme;Ea.readOnly=Cme;Ea.phrases=Ds.define({compare(s,e){let t=Object.keys(s),r=Object.keys(e);return t.length==r.length&&t.every(a=>s[a]==e[a])}});Ea.languageData=pme;Ea.changeFilter=yme;Ea.transactionFilter=wme;Ea.transactionExtender=_me;rO.reconfigure=Pi.define();function gv(s,e,t={}){let r={};for(let a of s)for(let u of Object.keys(a)){let f=a[u],h=r[u];if(h===void 0)r[u]=f;else if(!(h===f||f===void 0))if(Object.hasOwnProperty.call(t,u))r[u]=t[u](h,f);else throw new Error("Config merge conflict for field "+u)}for(let a in e)r[a]===void 0&&(r[a]=e[a]);return r}class GA{eq(e){return this==e}range(e,t=e){return FP.create(e,t,this)}}GA.prototype.startSide=GA.prototype.endSide=0;GA.prototype.point=!1;GA.prototype.mapMode=xg.TrackDel;class FP{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new FP(e,t,r)}}function One(s,e){return s.from-e.from||s.value.startSide-e.value.startSide}class Loe{constructor(e,t,r,a){this.from=e,this.to=t,this.value=r,this.maxPoint=a}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,a=0){let u=r?this.to:this.from;for(let f=a,h=u.length;;){if(f==h)return f;let g=f+h>>1,y=u[g]-e||(r?this.value[g].endSide:this.value[g].startSide)-t;if(g==f)return y>=0?f:h;y>=0?h=g:f=g+1}}between(e,t,r,a){for(let u=this.findIndex(t,-1e9,!0),f=this.findIndex(r,1e9,!1,u);u<f;u++)if(a(this.from[u]+e,this.to[u]+e,this.value[u])===!1)return!1}map(e,t){let r=[],a=[],u=[],f=-1,h=-1;for(let g=0;g<this.value.length;g++){let y=this.value[g],C=this.from[g]+e,A=this.to[g]+e,O,N;if(C==A){let L=t.mapPos(C,y.startSide,y.mapMode);if(L==null||(O=N=L,y.startSide!=y.endSide&&(N=t.mapPos(C,y.endSide),N<O)))continue}else if(O=t.mapPos(C,y.startSide),N=t.mapPos(A,y.endSide),O>N||O==N&&y.startSide>0&&y.endSide<=0)continue;(N-O||y.endSide-y.startSide)<0||(f<0&&(f=O),y.point&&(h=Math.max(h,N-O)),r.push(y),a.push(O-f),u.push(N-f))}return{mapped:r.length?new Loe(a,u,r,h):null,pos:f}}}class Ya{constructor(e,t,r,a){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=a}static create(e,t,r,a){return new Ya(e,t,r,a)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:a=0,filterTo:u=this.length}=e,f=e.filter;if(t.length==0&&!f)return this;if(r&&(t=t.slice().sort(One)),this.isEmpty)return t.length?Ya.of(t):this;let h=new Eme(this,null,-1).goto(0),g=0,y=[],C=new mk;for(;h.value||g<t.length;)if(g<t.length&&(h.from-t[g].from||h.startSide-t[g].value.startSide)>=0){let A=t[g++];C.addInner(A.from,A.to,A.value)||y.push(A)}else h.rangeIndex==1&&h.chunkIndex<this.chunk.length&&(g==t.length||this.chunkEnd(h.chunkIndex)<t[g].from)&&(!f||a>this.chunkEnd(h.chunkIndex)||u<this.chunkPos[h.chunkIndex])&&C.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!f||a>h.to||u<h.from||f(h.from,h.to,h.value))&&(C.addInner(h.from,h.to,h.value)||y.push(FP.create(h.from,h.to,h.value))),h.next());return C.finishInner(this.nextLayer.isEmpty&&!y.length?Ya.empty:this.nextLayer.update({add:y,filter:f,filterFrom:a,filterTo:u}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],a=-1;for(let f=0;f<this.chunk.length;f++){let h=this.chunkPos[f],g=this.chunk[f],y=e.touchesRange(h,h+g.length);if(y===!1)a=Math.max(a,g.maxPoint),t.push(g),r.push(e.mapPos(h));else if(y===!0){let{mapped:C,pos:A}=g.map(h,e);C&&(a=Math.max(a,C.maxPoint),t.push(C),r.push(A))}}let u=this.nextLayer.map(e);return t.length==0?u:new Ya(r,t,u||Ya.empty,a)}between(e,t,r){if(!this.isEmpty){for(let a=0;a<this.chunk.length;a++){let u=this.chunkPos[a],f=this.chunk[a];if(t>=u&&e<=u+f.length&&f.between(u,e-u,t-u,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return HP.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return HP.from(e).goto(t)}static compare(e,t,r,a,u=-1){let f=e.filter(A=>A.maxPoint>0||!A.isEmpty&&A.maxPoint>=u),h=t.filter(A=>A.maxPoint>0||!A.isEmpty&&A.maxPoint>=u),g=Cce(f,h,r),y=new aP(f,g,u),C=new aP(h,g,u);r.iterGaps((A,O,N)=>Sce(y,A,C,O,N,a)),r.empty&&r.length==0&&Sce(y,0,C,0,0,a)}static eq(e,t,r=0,a){a==null&&(a=1e9-1);let u=e.filter(C=>!C.isEmpty&&t.indexOf(C)<0),f=t.filter(C=>!C.isEmpty&&e.indexOf(C)<0);if(u.length!=f.length)return!1;if(!u.length)return!0;let h=Cce(u,f),g=new aP(u,h,0).goto(r),y=new aP(f,h,0).goto(r);for(;;){if(g.to!=y.to||!Mne(g.active,y.active)||g.point&&(!y.point||!g.point.eq(y.point)))return!1;if(g.to>a)return!0;g.next(),y.next()}}static spans(e,t,r,a,u=-1){let f=new aP(e,null,u).goto(t),h=t,g=f.openStart;for(;;){let y=Math.min(f.to,r);if(f.point){let C=f.activeForPoint(f.to),A=f.pointFrom<t?C.length+1:Math.min(C.length,g);a.point(h,y,f.point,C,A,f.pointRank),g=Math.min(f.openEnd(y),C.length)}else y>h&&(a.span(h,y,f.active,g),g=f.openEnd(y));if(f.to>r)return g+(f.point&&f.to>r?1:0);h=f.to,f.next()}}static of(e,t=!1){let r=new mk;for(let a of e instanceof FP?[e]:t?VSe(e):e)r.add(a.from,a.to,a.value);return r.finish()}}Ya.empty=new Ya([],[],null,-1);function VSe(s){if(s.length>1)for(let e=s[0],t=1;t<s.length;t++){let r=s[t];if(One(e,r)>0)return s.slice().sort(One);e=r}return s}Ya.empty.nextLayer=Ya.empty;class mk{finishChunk(e){this.chunks.push(new Loe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new mk)).add(e,t,r)}addInner(e,t,r){let a=e-this.lastTo||r.startSide-this.last.endSide;if(a<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return a<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(Ya.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ya.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Cce(s,e,t){let r=new Map;for(let u of s)for(let f=0;f<u.chunk.length;f++)u.chunk[f].maxPoint<=0&&r.set(u.chunk[f],u.chunkPos[f]);let a=new Set;for(let u of e)for(let f=0;f<u.chunk.length;f++){let h=r.get(u.chunk[f]);h!=null&&(t?t.mapPos(h):h)==u.chunkPos[f]&&!(t!=null&&t.touchesRange(h,h+u.chunk[f].length))&&a.add(u.chunk[f])}return a}class Eme{constructor(e,t,r,a=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=a}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let a=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(a)||this.layer.chunkEnd(this.chunkIndex)<e||a.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let a=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<a)&&this.setRangeIndex(a)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class HP{constructor(e){this.heap=e}static from(e,t=null,r=-1){let a=[];for(let u=0;u<e.length;u++)for(let f=e[u];!f.isEmpty;f=f.nextLayer)f.maxPoint>=r&&a.push(new Eme(f,t,r,u));return a.length==1?a[0]:new HP(a)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)Ete(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)Ete(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ete(this.heap,0)}}}function Ete(s,e){for(let t=s[e];;){let r=(e<<1)+1;if(r>=s.length)break;let a=s[r];if(r+1<s.length&&a.compare(s[r+1])>=0&&(a=s[r+1],r++),t.compare(a)<0)break;s[r]=t,s[e]=a,e=r}}class aP{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HP.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){q$(this.active,e),q$(this.activeTo,e),q$(this.activeRank,e),this.minActive=kce(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:a,rank:u}=this.cursor;for(;t<this.activeRank.length&&this.activeRank[t]<=u;)t++;G$(this.active,t,r),G$(this.activeTo,t,a),G$(this.activeRank,t,u),e&&G$(e,t,this.cursor.from),this.minActive=kce(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let a=this.minActive;if(a>-1&&(this.activeTo[a]-this.cursor.from||this.active[a].endSide-this.cursor.startSide)<0){if(this.activeTo[a]>e){this.to=this.activeTo[a],this.endSide=this.active[a].endSide;break}this.removeActive(a),r&&q$(r,a)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let u=this.cursor.value;if(!u.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=u,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=u.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let a=r.length-1;a>=0&&r[a]<e;a--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function Sce(s,e,t,r,a,u){s.goto(e),t.goto(r);let f=r+a,h=r,g=r-e;for(;;){let y=s.to+g-t.to||s.endSide-t.endSide,C=y<0?s.to+g:t.to,A=Math.min(C,f);if(s.point||t.point?s.point&&t.point&&(s.point==t.point||s.point.eq(t.point))&&Mne(s.activeForPoint(s.to),t.activeForPoint(t.to))||u.comparePoint(h,A,s.point,t.point):A>h&&!Mne(s.active,t.active)&&u.compareRange(h,A,s.active,t.active),C>f)break;h=C,y<=0&&s.next(),y>=0&&t.next()}}function Mne(s,e){if(s.length!=e.length)return!1;for(let t=0;t<s.length;t++)if(s[t]!=e[t]&&!s[t].eq(e[t]))return!1;return!0}function q$(s,e){for(let t=e,r=s.length-1;t<r;t++)s[t]=s[t+1];s.pop()}function G$(s,e,t){for(let r=s.length-1;r>=e;r--)s[r+1]=s[r];s[e]=t}function kce(s,e){let t=-1,r=1e9;for(let a=0;a<e.length;a++)(e[a]-r||s[a].endSide-s[t].endSide)<0&&(t=a,r=e[a]);return t}function wO(s,e,t=s.length){let r=0;for(let a=0;a<t;)s.charCodeAt(a)==9?(r+=e-r%e,a++):(r++,a=Tm(s,a));return r}function Rne(s,e,t,r){for(let a=0,u=0;;){if(u>=e)return a;if(a==s.length)break;u+=s.charCodeAt(a)==9?t-u%t:1,a=Tm(s,a)}return r===!0?-1:s.length}const Nne="\u037C",Ece=typeof Symbol>"u"?"__"+Nne:Symbol.for(Nne),Pne=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),xce=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class gk{constructor(e,t){this.rules=[];let{finish:r}=t||{};function a(f){return/^@/.test(f)?[f]:f.split(/,\s*/)}function u(f,h,g,y){let C=[],A=/^@(\w+)\b/.exec(f[0]),O=A&&A[1]=="keyframes";if(A&&h==null)return g.push(f[0]+";");for(let N in h){let L=h[N];if(/&/.test(N))u(N.split(/,\s*/).map(j=>f.map(z=>j.replace(/&/,z))).reduce((j,z)=>j.concat(z)),L,g);else if(L&&typeof L=="object"){if(!A)throw new RangeError("The value of a property ("+N+") should be a primitive value.");u(a(N),L,C,O)}else L!=null&&C.push(N.replace(/_.*/,"").replace(/[A-Z]/g,j=>"-"+j.toLowerCase())+": "+L+";")}(C.length||O)&&g.push((r&&!A&&!y?f.map(r):f).join(", ")+" {"+C.join(" ")+"}")}for(let f in e)u(a(f),e[f],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=xce[Ece]||1;return xce[Ece]=e+1,Nne+e.toString(36)}static mount(e,t,r){let a=e[Pne],u=r&&r.nonce;a?u&&a.setNonce(u):a=new USe(e,u),a.mount(Array.isArray(t)?t:[t])}}let Ace=new Map;class USe{constructor(e,t){let r=e.ownerDocument||e,a=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&a.CSSStyleSheet){let u=Ace.get(r);if(u)return e.adoptedStyleSheets=[u.sheet,...e.adoptedStyleSheets],e[Pne]=u;this.sheet=new a.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Ace.set(r,this)}else{this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let u=e.head||e;u.insertBefore(this.styleTag,u.firstChild)}this.modules=[],e[Pne]=this}mount(e){let t=this.sheet,r=0,a=0;for(let u=0;u<e.length;u++){let f=e[u],h=this.modules.indexOf(f);if(h<a&&h>-1&&(this.modules.splice(h,1),a--,h=-1),h==-1){if(this.modules.splice(a++,0,f),t)for(let g=0;g<f.rules.length;g++)t.insertRule(f.rules[g],r++)}else{for(;a<h;)r+=this.modules[a++].rules.length;r+=f.rules.length,a++}}if(!t){let u="";for(let f=0;f<this.modules.length;f++)u+=this.modules[f].getRules()+`
`;this.styleTag.textContent=u}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var pk={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:"'"},$P={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},WSe=typeof navigator<"u"&&/Mac/.test(navigator.platform),jSe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Fh=0;Fh<10;Fh++)pk[48+Fh]=pk[96+Fh]=String(Fh);for(var Fh=1;Fh<=24;Fh++)pk[Fh+111]="F"+Fh;for(var Fh=65;Fh<=90;Fh++)pk[Fh]=String.fromCharCode(Fh+32),$P[Fh]=String.fromCharCode(Fh);for(var xte in pk)$P.hasOwnProperty(xte)||($P[xte]=pk[xte]);function ZSe(s){var e=WSe&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||jSe&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?$P:pk)[s.keyCode]||s.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function aV(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function Ine(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function qSe(s){let e=s.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Iz(s,e){if(!e.anchorNode)return!1;try{return Ine(s,e.anchorNode)}catch{return!1}}function zP(s){return s.nodeType==3?KA(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function lV(s,e,t,r){return t?Tce(s,e,t,r,-1)||Tce(s,e,t,r,1):!1}function VP(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function Tce(s,e,t,r,a){for(;;){if(s==t&&e==r)return!0;if(e==(a<0?0:O_(s))){if(s.nodeName=="DIV")return!1;let u=s.parentNode;if(!u||u.nodeType!=1)return!1;e=VP(s)+(a<0?0:1),s=u}else if(s.nodeType==1){if(s=s.childNodes[e+(a<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=a<0?O_(s):0}else return!1}}function O_(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Foe(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function GSe(s){return{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function KSe(s,e,t,r,a,u,f,h){let g=s.ownerDocument,y=g.defaultView||window;for(let C=s,A=!1;C&&!A;)if(C.nodeType==1){let O,N=C==g.body,L=1,j=1;if(N)O=GSe(y);else{if(/^(fixed|sticky)$/.test(getComputedStyle(C).position)&&(A=!0),C.scrollHeight<=C.clientHeight&&C.scrollWidth<=C.clientWidth){C=C.assignedSlot||C.parentNode;continue}let ee=C.getBoundingClientRect();L=ee.width/C.offsetWidth,j=ee.height/C.offsetHeight,O={left:ee.left,right:ee.left+C.clientWidth*L,top:ee.top,bottom:ee.top+C.clientHeight*j}}let z=0,q=0;if(a=="nearest")e.top<O.top?(q=-(O.top-e.top+f),t>0&&e.bottom>O.bottom+q&&(q=e.bottom-O.bottom+q+f)):e.bottom>O.bottom&&(q=e.bottom-O.bottom+f,t<0&&e.top-q<O.top&&(q=-(O.top+q-e.top+f)));else{let ee=e.bottom-e.top,F=O.bottom-O.top;q=(a=="center"&&ee<=F?e.top+ee/2-F/2:a=="start"||a=="center"&&t<0?e.top-f:e.bottom-F+f)-O.top}if(r=="nearest"?e.left<O.left?(z=-(O.left-e.left+u),t>0&&e.right>O.right+z&&(z=e.right-O.right+z+u)):e.right>O.right&&(z=e.right-O.right+u,t<0&&e.left<O.left+z&&(z=-(O.left+z-e.left+u))):z=(r=="center"?e.left+(e.right-e.left)/2-(O.right-O.left)/2:r=="start"==h?e.left-u:e.right-(O.right-O.left)+u)-O.left,z||q)if(N)y.scrollBy(z,q);else{let ee=0,F=0;if(q){let ne=C.scrollTop;C.scrollTop+=q/j,F=(C.scrollTop-ne)*j}if(z){let ne=C.scrollLeft;C.scrollLeft+=z/L,ee=(C.scrollLeft-ne)*L}e={left:e.left-ee,top:e.top-F,right:e.right-ee,bottom:e.bottom-F},ee&&Math.abs(ee-z)<1&&(r="nearest"),F&&Math.abs(F-q)<1&&(a="nearest")}if(N)break;C=C.assignedSlot||C.parentNode}else if(C.nodeType==11)C=C.host;else break}function YSe(s){let e=s.ownerDocument;for(let t=s.parentNode;t&&t!=e.body;)if(t.nodeType==1){if(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class XSe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?O_(t):0),r,Math.min(e.focusOffset,r?O_(r):0))}set(e,t,r,a){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=a}}let MD=null;function xme(s){if(s.setActive)return s.setActive();if(MD)return s.focus(MD);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(MD==null?{get preventScroll(){return MD={preventScroll:!0},!0}}:void 0),!MD){MD=!1;for(let t=0;t<e.length;){let r=e[t++],a=e[t++],u=e[t++];r.scrollTop!=a&&(r.scrollTop=a),r.scrollLeft!=u&&(r.scrollLeft=u)}}}let Dce;function KA(s,e,t=e){let r=Dce||(Dce=document.createRange());return r.setEnd(s,t),r.setStart(s,e),r}function QD(s,e,t){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0},a=new KeyboardEvent("keydown",r);a.synthetic=!0,s.dispatchEvent(a);let u=new KeyboardEvent("keyup",r);return u.synthetic=!0,s.dispatchEvent(u),a.defaultPrevented||u.defaultPrevented}function JSe(s){for(;s;){if(s&&(s.nodeType==9||s.nodeType==11&&s.host))return s;s=s.assignedSlot||s.parentNode}return null}function Ame(s){for(;s.attributes.length;)s.removeAttributeNode(s.attributes[0])}function QSe(s,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,O_(t));;)if(r){if(t.nodeType!=1)return!1;let a=t.childNodes[r-1];a.contentEditable=="false"?r--:(t=a,r=O_(t))}else{if(t==s)return!0;r=VP(t),t=t.parentNode}}function Tme(s){return s.scrollTop>Math.max(1,s.scrollHeight-s.clientHeight-4)}class Am{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new Am(e.parentNode,VP(e),t)}static after(e,t){return new Am(e.parentNode,VP(e)+1,t)}}const Hoe=[];class Tc{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let r of this.children){if(r==e)return t;t+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let r=this.dom,a=null,u;for(let f of this.children){if(f.flags&7){if(!f.dom&&(u=a?a.nextSibling:r.firstChild)){let h=Tc.get(u);(!h||!h.parent&&h.canReuseDOM(f))&&f.reuseDOM(u)}f.sync(e,t),f.flags&=-8}if(u=a?a.nextSibling:r.firstChild,t&&!t.written&&t.node==r&&u!=f.dom&&(t.written=!0),f.dom.parentNode==r)for(;u&&u!=f.dom;)u=Oce(u);else r.insertBefore(f.dom,u);a=f.dom}for(u=a?a.nextSibling:r.firstChild,u&&t&&t.node==r&&(t.written=!0);u;)u=Oce(u)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,t),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let r;if(e==this.dom)r=this.dom.childNodes[t];else{let a=O_(e)==0?0:t==0?-1:1;for(;;){let u=e.parentNode;if(u==this.dom)break;a==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?a=-1:a=1),e=u}a<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!Tc.get(r);)r=r.nextSibling;if(!r)return this.length;for(let a=0,u=0;;a++){let f=this.children[a];if(f.dom==r)return u;u+=f.length+f.breakAfter}}domBoundsAround(e,t,r=0){let a=-1,u=-1,f=-1,h=-1;for(let g=0,y=r,C=r;g<this.children.length;g++){let A=this.children[g],O=y+A.length;if(y<e&&O>t)return A.domBoundsAround(e,t,y);if(O>=e&&a==-1&&(a=g,u=y),y>t&&A.dom.parentNode==this.dom){f=g,h=C;break}C=O,y=O+A.breakAfter}return{from:u,to:h<0?r+this.length:h,startDOM:(a?this.children[a-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:f<this.children.length&&f>=0?this.children[f].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=Hoe){this.markDirty();for(let a=e;a<t;a++){let u=this.children[a];u.parent==this&&u.destroy()}this.children.splice(e,t-e,...r);for(let a=0;a<r.length;a++)r[a].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Dme(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,r,a,u,f){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){this.parent=null}}Tc.prototype.breakAfter=0;function Oce(s){let e=s.nextSibling;return s.parentNode.removeChild(s),e}class Dme{constructor(e,t,r){this.children=e,this.pos=t,this.i=r,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Ome(s,e,t,r,a,u,f,h,g){let{children:y}=s,C=y.length?y[e]:null,A=u.length?u[u.length-1]:null,O=A?A.breakAfter:f;if(!(e==r&&C&&!f&&!O&&u.length<2&&C.merge(t,a,u.length?A:null,t==0,h,g))){if(r<y.length){let N=y[r];N&&(a<N.length||N.breakAfter&&(A==null?void 0:A.breakAfter))?(e==r&&(N=N.split(a),a=0),!O&&A&&N.merge(0,a,A,!0,0,g)?u[u.length-1]=N:(a&&N.merge(0,a,null,!1,0,g),u.push(N))):N!=null&&N.breakAfter&&(A?A.breakAfter=1:f=1),r++}for(C&&(C.breakAfter=f,t>0&&(!f&&u.length&&C.merge(t,C.length,u[0],!1,h,0)?C.breakAfter=u.shift().breakAfter:(t<C.length||C.children.length&&C.children[C.children.length-1].length==0)&&C.merge(t,C.length,null,!1,h,0),e++));e<r&&u.length;)if(y[r-1].become(u[u.length-1]))r--,u.pop(),g=u.length?0:h;else if(y[e].become(u[0]))e++,u.shift(),h=u.length?0:g;else break;!u.length&&e&&r<y.length&&!y[e-1].breakAfter&&y[r].merge(0,0,y[e-1],!1,h,g)&&e--,(e<r||u.length)&&s.replaceChildren(e,r,u)}}function Mme(s,e,t,r,a,u){let f=s.childCursor(),{i:h,off:g}=f.findPos(t,1),{i:y,off:C}=f.findPos(e,-1),A=e-t;for(let O of r)A+=O.length;s.length+=A,Ome(s,y,C,h,g,r,0,a,u)}let R1=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Bne=typeof document<"u"?document:{documentElement:{style:{}}};const Lne=/Edge\/(\d+)/.exec(R1.userAgent),Rme=/MSIE \d/.test(R1.userAgent),Fne=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(R1.userAgent),qV=!!(Rme||Fne||Lne),Mce=!qV&&/gecko\/(\d+)/i.test(R1.userAgent),Ate=!qV&&/Chrome\/(\d+)/.exec(R1.userAgent),Rce="webkitFontSmoothing"in Bne.documentElement.style,Nme=!qV&&/Apple Computer/.test(R1.vendor),Nce=Nme&&(/Mobile\/\w+/.test(R1.userAgent)||R1.maxTouchPoints>2);var Fs={mac:Nce||/Mac/.test(R1.platform),windows:/Win/.test(R1.platform),linux:/Linux|X11/.test(R1.platform),ie:qV,ie_version:Rme?Bne.documentMode||6:Fne?+Fne[1]:Lne?+Lne[1]:0,gecko:Mce,gecko_version:Mce?+(/Firefox\/(\d+)/.exec(R1.userAgent)||[0,0])[1]:0,chrome:!!Ate,chrome_version:Ate?+Ate[1]:0,ios:Nce,android:/Android\b/.test(R1.userAgent),webkit:Rce,safari:Nme,webkit_version:Rce?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Bne.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const eke=256;class M_ extends Tc{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof M_)||this.length-(t-e)+r.length>eke||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new M_(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Am(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return tke(this.dom,e,t)}}class R_ extends Tc{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let a of t)a.setParent(this)}setAttrs(e){if(Ame(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,a,u,f){return r&&(!(r instanceof R_&&r.mark.eq(this.mark))||e&&u<=0||t<this.length&&f<=0)?!1:(Mme(this,e,t,r?r.children:[],u-1,f-1),this.markDirty(),!0)}split(e){let t=[],r=0,a=-1,u=0;for(let h of this.children){let g=r+h.length;g>e&&t.push(r<e?h.split(e-r):h),a<0&&r>=e&&(a=u),r=g,u++}let f=this.length-e;return this.length=e,a>-1&&(this.children.length=a,this.markDirty()),new R_(this.mark,t,f)}domAtPos(e){return Pme(this,e)}coordsAt(e,t){return Bme(this,e,t)}}function tke(s,e,t){let r=s.nodeValue.length;e>r&&(e=r);let a=e,u=e,f=0;e==0&&t<0||e==r&&t>=0?Fs.chrome||Fs.gecko||(e?(a--,f=1):u<r&&(u++,f=-1)):t<0?a--:u<r&&u++;let h=KA(s,a,u).getClientRects();if(!h.length)return null;let g=h[(f?f<0:t>=0)?0:h.length-1];return Fs.safari&&!f&&g.width==0&&(g=Array.prototype.find.call(h,y=>y.width)||g),f?Foe(g,f<0):g||null}class ak extends Tc{static create(e,t,r){return new ak(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=ak.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,r,a,u,f){return r&&(!(r instanceof ak)||!this.widget.compare(r.widget)||e>0&&u<=0||t<this.length&&f<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}become(e){return e instanceof ak&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return cl.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,r=t&&t.state.doc,a=this.posAtStart;return r?r.slice(a,a+this.length):cl.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Am.before(this.dom):Am.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let a=this.dom.getClientRects(),u=null;if(!a.length)return null;let f=this.side?this.side<0:e>0;for(let h=f?a.length-1:0;u=a[h],!(e>0?h==0:h==a.length-1||u.top<u.bottom);h+=f?-1:1);return Foe(u,!f)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class iO extends Tc{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof iO&&e.side==this.side}split(){return new iO(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Am.before(this.dom):Am.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return cl.empty}get isHidden(){return!0}}M_.prototype.children=ak.prototype.children=iO.prototype.children=Hoe;function Pme(s,e){let t=s.dom,{children:r}=s,a=0;for(let u=0;a<r.length;a++){let f=r[a],h=u+f.length;if(!(h==u&&f.getSide()<=0)){if(e>u&&e<h&&f.dom.parentNode==t)return f.domAtPos(e-u);if(e<=u)break;u=h}}for(let u=a;u>0;u--){let f=r[u-1];if(f.dom.parentNode==t)return f.domAtPos(f.length)}for(let u=a;u<r.length;u++){let f=r[u];if(f.dom.parentNode==t)return f.domAtPos(0)}return new Am(t,0)}function Ime(s,e,t){let r,{children:a}=s;t>0&&e instanceof R_&&a.length&&(r=a[a.length-1])instanceof R_&&r.mark.eq(e.mark)?Ime(r,e.children[0],t-1):(a.push(e),e.setParent(s)),s.length+=e.length}function Bme(s,e,t){let r=null,a=-1,u=null,f=-1;function h(y,C){for(let A=0,O=0;A<y.children.length&&O<=C;A++){let N=y.children[A],L=O+N.length;L>=C&&(N.children.length?h(N,C-O):(!u||u.isHidden&&t>0)&&(L>C||O==L&&N.getSide()>0)?(u=N,f=C-O):(O<C||O==L&&N.getSide()<0&&!N.isHidden)&&(r=N,a=C-O)),O=L}}h(s,e);let g=(t<0?r:u)||r||u;return g?g.coordsAt(Math.max(0,g==r?a:f),t):nke(s)}function nke(s){let e=s.dom.lastChild;if(!e)return s.dom.getBoundingClientRect();let t=zP(e);return t[t.length-1]||null}function Hne(s,e){for(let t in s)t=="class"&&e.class?e.class+=" "+s.class:t=="style"&&e.style?e.style+=";"+s.style:e[t]=s[t];return e}const Pce=Object.create(null);function $oe(s,e,t){if(s==e)return!0;s||(s=Pce),e||(e=Pce);let r=Object.keys(s),a=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=a.length-(t&&a.indexOf(t)>-1?1:0))return!1;for(let u of r)if(u!=t&&(a.indexOf(u)==-1||s[u]!==e[u]))return!1;return!0}function $ne(s,e,t){let r=!1;if(e)for(let a in e)t&&a in t||(r=!0,a=="style"?s.style.cssText="":s.removeAttribute(a));if(t)for(let a in t)e&&e[a]==t[a]||(r=!0,a=="style"?s.style.cssText=t[a]:s.setAttribute(a,t[a]));return r}function oke(s){let e=Object.create(null);for(let t=0;t<s.attributes.length;t++){let r=s.attributes[t];e[r.name]=r.value}return e}class cd extends Tc{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,r,a,u,f){if(r){if(!(r instanceof cd))return!1;this.dom||r.transferDOM(this)}return a&&this.setDeco(r?r.attrs:null),Mme(this,e,t,r?r.children:[],u,f),!0}split(e){let t=new cd;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:r,off:a}=this.childPos(e);a&&(t.append(this.children[r].split(a),0),this.children[r].merge(a,this.children[r].length,null,!1,0,0),r++);for(let u=r;u<this.children.length;u++)t.append(this.children[u],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){$oe(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Ime(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=Hne(t,this.attrs||{})),r&&(this.attrs=Hne({class:r},this.attrs||{}))}domAtPos(e){return Pme(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&(Ame(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&($ne(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let a=this.dom.lastChild;for(;a&&Tc.get(a)instanceof R_;)a=a.lastChild;if(!a||!this.length||a.nodeName!="BR"&&((r=Tc.get(a))===null||r===void 0?void 0:r.isEditable)==!1&&(!Fs.ios||!this.children.some(u=>u instanceof M_))){let u=document.createElement("BR");u.cmIgnore=!0,this.dom.appendChild(u)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof M_)||/[^ -~]/.test(r.text))return null;let a=zP(r.dom);if(a.length!=1)return null;e+=a[0].width,t=a[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=Bme(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:a}=this.parent.view.viewState,u=r.bottom-r.top;if(Math.abs(u-a.lineHeight)<2&&a.textHeight<u){let f=(u-a.textHeight)/2;return{top:r.top+f,bottom:r.bottom-f,left:r.left,right:r.left}}}return r}become(e){return!1}covers(){return!0}static find(e,t){for(let r=0,a=0;r<e.children.length;r++){let u=e.children[r],f=a+u.length;if(f>=t){if(u instanceof cd)return u;if(f>t)break}a=f+u.breakAfter}return null}}class jA extends Tc{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,a,u,f){return r&&(!(r instanceof jA)||!this.widget.compare(r.widget)||e>0&&u<=0||t<this.length&&f<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?Am.before(this.dom):Am.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let r=new jA(this.widget,t,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return Hoe}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):cl.empty}domBoundsAround(){return null}become(e){return e instanceof jA&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:r}=this.deco;return t==r?!1:e<0?t<0:r>0}}class Sk{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}destroy(e){}}var Ag=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(Ag||(Ag={}));class ti extends GA{constructor(e,t,r,a){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=a}get heightRelevant(){return!1}static mark(e){return new fI(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new bk(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,a;if(e.isBlockGap)r=-5e8,a=4e8;else{let{start:u,end:f}=Lme(e,t);r=(u?t?-3e8:-1:5e8)-1,a=(f?t?2e8:1:-6e8)+1}return new bk(e,r,a,t,e.widget||null,!0)}static line(e){return new dI(e)}static set(e,t=!1){return Ya.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ti.none=Ya.empty;class fI extends ti{constructor(e){let{start:t,end:r}=Lme(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof fI&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&$oe(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}fI.prototype.point=!1;class dI extends ti{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof dI&&this.spec.class==e.spec.class&&$oe(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}dI.prototype.mapMode=xg.TrackBefore;dI.prototype.point=!0;class bk extends ti{constructor(e,t,r,a,u,f){super(t,r,u,e),this.block=a,this.isReplace=f,this.mapMode=a?t<=0?xg.TrackBefore:xg.TrackAfter:xg.TrackDel}get type(){return this.startSide!=this.endSide?Ag.WidgetRange:this.startSide<=0?Ag.WidgetBefore:Ag.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bk&&ske(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}bk.prototype.point=!0;function Lme(s,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=s;return t==null&&(t=s.inclusive),r==null&&(r=s.inclusive),{start:t!=null?t:e,end:r!=null?r:e}}function ske(s,e){return s==e||!!(s&&e&&s.compare(e))}function zne(s,e,t,r=0){let a=t.length-1;a>=0&&t[a]+r>=s?t[a]=Math.max(t[a],e):t.push(s,e)}class OP{constructor(e,t,r,a){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=a,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof jA&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new cd),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(K$(new iO(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!e&&!this.posCovered()&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:u,lineBreak:f,done:h}=this.cursor.next(this.skip);if(this.skip=0,h)throw new Error("Ran out of text content when drawing inline views");if(f){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=u,this.textOff=0}let a=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(K$(new M_(this.text.slice(this.textOff,this.textOff+a)),t),r),this.atCursorPos=!0,this.textOff+=a,e-=a,r=0}}span(e,t,r,a){this.buildText(t-e,r,a),this.pos=t,this.openStart<0&&(this.openStart=a)}point(e,t,r,a,u,f){if(this.disallowBlockEffectsFor[f]&&r instanceof bk){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let h=t-e;if(r instanceof bk)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new jA(r.widget||new Ice("div"),h,r));else{let g=ak.create(r.widget||new Ice("span"),h,h?0:r.startSide),y=this.atCursorPos&&!g.isEditable&&u<=a.length&&(e<t||r.startSide>0),C=!g.isEditable&&(e<t||u>a.length||r.startSide<=0),A=this.getLine();this.pendingBuffer==2&&!y&&!g.isEditable&&(this.pendingBuffer=0),this.flushBuffer(a),y&&(A.append(K$(new iO(1),a),u),u=a.length+Math.max(0,u-a.length)),A.append(K$(g,a),u),this.atCursorPos=C,this.pendingBuffer=C?e<t||u>a.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=a.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);h&&(this.textOff+h<=this.text.length?this.textOff+=h:(this.skip+=h-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=u)}static build(e,t,r,a,u){let f=new OP(e,t,r,u);return f.openEnd=Ya.spans(a,t,r,f),f.openStart<0&&(f.openStart=f.openEnd),f.finish(f.openEnd),f}}function K$(s,e){for(let t of e)s=new R_(t,[s],s.length);return s}class Ice extends Sk{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const Fme=Ds.define(),Hme=Ds.define(),$me=Ds.define(),zme=Ds.define(),Vne=Ds.define(),Vme=Ds.define(),Ume=Ds.define(),Wme=Ds.define({combine:s=>s.some(e=>e)}),jme=Ds.define({combine:s=>s.some(e=>e)});class cV{constructor(e,t="nearest",r="nearest",a=5,u=5){this.range=e,this.y=t,this.x=r,this.yMargin=a,this.xMargin=u}map(e){return e.empty?this:new cV(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Bce=Pi.define({map:(s,e)=>s.map(e)});function R0(s,e,t){let r=s.facet(zme);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const GV=Ds.define({combine:s=>s.length?s[0]:!0});let rke=0;const pP=Ds.define();class gf{constructor(e,t,r,a,u){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=a,this.extension=u(this)}static define(e,t){const{eventHandlers:r,eventObservers:a,provide:u,decorations:f}=t||{};return new gf(rke++,e,r,a,h=>{let g=[pP.of(h)];return f&&g.push(UP.of(y=>{let C=y.plugin(h);return C?f(C):ti.none})),u&&g.push(u(h)),g})}static fromClass(e,t){return gf.define(r=>new e(r),t)}}class Tte{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(R0(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){R0(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){R0(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Zme=Ds.define(),zoe=Ds.define(),UP=Ds.define(),Voe=Ds.define(),qme=Ds.define();function Lce(s,e,t){let r=s.state.facet(qme);if(!r.length)return r;let a=r.map(f=>f instanceof Function?f(s):f),u=[];return Ya.spans(a,e,t,{point(){},span(f,h,g,y){let C=u;for(let A=g.length-1;A>=0;A--,y--){let O=g[A].spec.bidiIsolate,N;if(O!=null)if(y>0&&C.length&&(N=C[C.length-1]).to==f&&N.direction==O)N.to=h,C=N.inner;else{let L={from:f,to:h,direction:O,inner:[]};C.push(L),C=L.inner}}}}),u}const Gme=Ds.define();function Kme(s){let e=0,t=0,r=0,a=0;for(let u of s.state.facet(Gme)){let f=u(s);f&&(f.left!=null&&(e=Math.max(e,f.left)),f.right!=null&&(t=Math.max(t,f.right)),f.top!=null&&(r=Math.max(r,f.top)),f.bottom!=null&&(a=Math.max(a,f.bottom)))}return{left:e,right:t,top:r,bottom:a}}const bP=Ds.define();class N0{constructor(e,t,r,a){this.fromA=e,this.toA=t,this.fromB=r,this.toB=a}join(e){return new N0(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let a=e[t-1];if(!(a.fromA>r.toA)){if(a.toA<r.fromA)break;r=r.join(a),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let a=0,u=0,f=0,h=0;;a++){let g=a==e.length?null:e[a],y=f-h,C=g?g.fromB:1e9;for(;u<t.length&&t[u]<C;){let A=t[u],O=t[u+1],N=Math.max(h,A),L=Math.min(C,O);if(N<=L&&new N0(N+y,L+y,N,L).addToSet(r),O>C)break;u+=2}if(!g)return r;new N0(g.fromA,g.toA,g.fromB,g.toB).addToSet(r),f=g.toA,h=g.toB}}}class uV{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=fd.empty(this.startState.doc.length);for(let u of r)this.changes=this.changes.compose(u.changes);let a=[];this.changes.iterChangedRanges((u,f,h,g)=>a.push(new N0(u,f,h,g))),this.changedRanges=a}static create(e,t,r){return new uV(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var mu=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(mu||(mu={}));const WP=mu.LTR,Yme=mu.RTL;function Xme(s){let e=[];for(let t=0;t<s.length;t++)e.push(1<<+s[t]);return e}const ike=Xme("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ake=Xme("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Une=Object.create(null),Wy=[];for(let s of["()","[]","{}"]){let e=s.charCodeAt(0),t=s.charCodeAt(1);Une[e]=t,Une[t]=-e}function lke(s){return s<=247?ike[s]:1424<=s&&s<=1524?2:1536<=s&&s<=1785?ake[s-1536]:1774<=s&&s<=2220?4:8192<=s&&s<=8203?256:64336<=s&&s<=65023?4:s==8204?256:1}const cke=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class lk{get dir(){return this.level%2?Yme:WP}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}static find(e,t,r,a){let u=-1;for(let f=0;f<e.length;f++){let h=e[f];if(h.from<=t&&h.to>=t){if(h.level==r)return f;(u<0||(a!=0?a<0?h.from<t:h.to>t:e[u].level>h.level))&&(u=f)}}if(u<0)throw new RangeError("Index out of range");return u}}function Jme(s,e){if(s.length!=e.length)return!1;for(let t=0;t<s.length;t++){let r=s[t],a=e[t];if(r.from!=a.from||r.to!=a.to||r.direction!=a.direction||!Jme(r.inner,a.inner))return!1}return!0}const oc=[];function uke(s,e,t,r,a){for(let u=0;u<=r.length;u++){let f=u?r[u-1].to:e,h=u<r.length?r[u].from:t,g=u?256:a;for(let y=f,C=g,A=g;y<h;y++){let O=lke(s.charCodeAt(y));O==512?O=C:O==8&&A==4&&(O=16),oc[y]=O==4?2:O,O&7&&(A=O),C=O}for(let y=f,C=g,A=g;y<h;y++){let O=oc[y];if(O==128)y<h-1&&C==oc[y+1]&&C&24?O=oc[y]=C:oc[y]=256;else if(O==64){let N=y+1;for(;N<h&&oc[N]==64;)N++;let L=y&&C==8||N<t&&oc[N]==8?A==1?1:8:256;for(let j=y;j<N;j++)oc[j]=L;y=N-1}else O==8&&A==1&&(oc[y]=1);C=O,O&7&&(A=O)}}}function fke(s,e,t,r,a){let u=a==1?2:1;for(let f=0,h=0,g=0;f<=r.length;f++){let y=f?r[f-1].to:e,C=f<r.length?r[f].from:t;for(let A=y,O,N,L;A<C;A++)if(N=Une[O=s.charCodeAt(A)])if(N<0){for(let j=h-3;j>=0;j-=3)if(Wy[j+1]==-N){let z=Wy[j+2],q=z&2?a:z&4?z&1?u:a:0;q&&(oc[A]=oc[Wy[j]]=q),h=j;break}}else{if(Wy.length==189)break;Wy[h++]=A,Wy[h++]=O,Wy[h++]=g}else if((L=oc[A])==2||L==1){let j=L==a;g=j?0:1;for(let z=h-3;z>=0;z-=3){let q=Wy[z+2];if(q&2)break;if(j)Wy[z+2]|=2;else{if(q&4)break;Wy[z+2]|=4}}}}}function dke(s,e,t,r){for(let a=0,u=r;a<=t.length;a++){let f=a?t[a-1].to:s,h=a<t.length?t[a].from:e;for(let g=f;g<h;){let y=oc[g];if(y==256){let C=g+1;for(;;)if(C==h){if(a==t.length)break;C=t[a++].to,h=a<t.length?t[a].from:e}else if(oc[C]==256)C++;else break;let A=u==1,O=(C<e?oc[C]:r)==1,N=A==O?A?1:2:r;for(let L=C,j=a,z=j?t[j-1].to:s;L>g;)L==z&&(L=t[--j].from,z=j?t[j-1].to:s),oc[--L]=N;g=C}else u=y,g++}}}function Wne(s,e,t,r,a,u,f){let h=r%2?2:1;if(r%2==a%2)for(let g=e,y=0;g<t;){let C=!0,A=!1;if(y==u.length||g<u[y].from){let j=oc[g];j!=h&&(C=!1,A=j==16)}let O=!C&&h==1?[]:null,N=C?r:r+1,L=g;e:for(;;)if(y<u.length&&L==u[y].from){if(A)break e;let j=u[y];if(!C)for(let z=j.to,q=y+1;;){if(z==t)break e;if(q<u.length&&u[q].from==z)z=u[q++].to;else{if(oc[z]==h)break e;break}}if(y++,O)O.push(j);else{j.from>g&&f.push(new lk(g,j.from,N));let z=j.direction==WP!=!(N%2);jne(s,z?r+1:r,a,j.inner,j.from,j.to,f),g=j.to}L=j.to}else{if(L==t||(C?oc[L]!=h:oc[L]==h))break;L++}O?Wne(s,g,L,r+1,a,O,f):g<L&&f.push(new lk(g,L,N)),g=L}else for(let g=t,y=u.length;g>e;){let C=!0,A=!1;if(!y||g>u[y-1].to){let j=oc[g-1];j!=h&&(C=!1,A=j==16)}let O=!C&&h==1?[]:null,N=C?r:r+1,L=g;e:for(;;)if(y&&L==u[y-1].to){if(A)break e;let j=u[--y];if(!C)for(let z=j.from,q=y;;){if(z==e)break e;if(q&&u[q-1].to==z)z=u[--q].from;else{if(oc[z-1]==h)break e;break}}if(O)O.push(j);else{j.to<g&&f.push(new lk(j.to,g,N));let z=j.direction==WP!=!(N%2);jne(s,z?r+1:r,a,j.inner,j.from,j.to,f),g=j.from}L=j.from}else{if(L==e||(C?oc[L-1]!=h:oc[L-1]==h))break;L--}O?Wne(s,L,g,r+1,a,O,f):L<g&&f.push(new lk(L,g,N)),g=L}}function jne(s,e,t,r,a,u,f){let h=e%2?2:1;uke(s,a,u,r,h),fke(s,a,u,r,h),dke(a,u,r,h),Wne(s,a,u,e,t,r,f)}function hke(s,e,t){if(!s)return[new lk(0,0,e==Yme?1:0)];if(e==WP&&!t.length&&!cke.test(s))return Qme(s.length);if(t.length)for(;s.length>oc.length;)oc[oc.length]=256;let r=[],a=e==WP?0:1;return jne(s,a,a,t,0,s.length,r),r}function Qme(s){return[new lk(0,s,0)]}let ege="";function mke(s,e,t,r,a){var u;let f=r.head-s.from,h=-1;if(f==0){if(!a||!s.length)return null;e[0].level!=t&&(f=e[0].side(!1,t),h=0)}else if(f==s.length){if(a)return null;let O=e[e.length-1];O.level!=t&&(f=O.side(!0,t),h=e.length-1)}h<0&&(h=lk.find(e,f,(u=r.bidiLevel)!==null&&u!==void 0?u:-1,r.assoc));let g=e[h];f==g.side(a,t)&&(g=e[h+=a?1:-1],f=g.side(!a,t));let y=a==(g.dir==t),C=Tm(s.text,f,y);if(ege=s.text.slice(Math.min(f,C),Math.max(f,C)),C!=g.side(a,t))return qn.cursor(C+s.from,y?-1:1,g.level);let A=h==(a?e.length-1:0)?null:e[h+(a?1:-1)];return!A&&g.level!=t?qn.cursor(a?s.to:s.from,a?-1:1,t):A&&A.level<g.level?qn.cursor(A.side(!a,t)+s.from,a?1:-1,A.level):qn.cursor(C+s.from,a?-1:1,g.level)}class Fce extends Tc{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new cd],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new N0(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:y,toA:C})=>C<this.minWidthFrom||y>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let a=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?a=this.domChanged.newSel.head:!_ke(e.changes,this.hasComposition)&&!e.selectionSet&&(a=e.state.selection.main.head));let u=a>-1?pke(this.view,e.changes,a):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:y,to:C}=this.hasComposition;r=new N0(y,C,e.changes.mapPos(y,-1),e.changes.mapPos(C,1)).addToSet(r.slice())}this.hasComposition=u?{from:u.range.fromB,to:u.range.toB}:null,(Fs.ie||Fs.chrome)&&!u&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let f=this.decorations,h=this.updateDeco(),g=yke(f,h,e.changes);return r=N0.extendWithRanges(r,g),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,u),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:a}=this.view;a.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let f=Fs.chrome||Fs.ios?{node:a.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,f),this.flags&=-8,f&&(f.written||a.selectionRange.focusNode!=f.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(f=>f.flags&=-9);let u=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let f of this.children)f instanceof jA&&f.widget instanceof Hce&&u.push(f.dom);a.updateGaps(u)}updateChildren(e,t,r){let a=r?r.range.addToSet(e.slice()):e,u=this.childCursor(t);for(let f=a.length-1;;f--){let h=f>=0?a[f]:null;if(!h)break;let{fromA:g,toA:y,fromB:C,toB:A}=h,O,N,L,j;if(r&&r.range.fromB<A&&r.range.toB>C){let ne=OP.build(this.view.state.doc,C,r.range.fromB,this.decorations,this.dynamicDecorationMap),oe=OP.build(this.view.state.doc,r.range.toB,A,this.decorations,this.dynamicDecorationMap);N=ne.breakAtStart,L=ne.openStart,j=oe.openEnd;let re=this.compositionView(r);oe.breakAtStart?re.breakAfter=1:oe.content.length&&re.merge(re.length,re.length,oe.content[0],!1,oe.openStart,0)&&(re.breakAfter=oe.content[0].breakAfter,oe.content.shift()),ne.content.length&&re.merge(0,0,ne.content[ne.content.length-1],!0,0,ne.openEnd)&&ne.content.pop(),O=ne.content.concat(re).concat(oe.content)}else({content:O,breakAtStart:N,openStart:L,openEnd:j}=OP.build(this.view.state.doc,C,A,this.decorations,this.dynamicDecorationMap));let{i:z,off:q}=u.findPos(y,1),{i:ee,off:F}=u.findPos(g,-1);Ome(this,ee,F,z,q,O,N,L,j)}r&&this.fixCompositionDOM(r)}compositionView(e){let t=new M_(e.text.nodeValue);t.flags|=8;for(let{deco:a}of e.marks)t=new R_(a,[t],t.length);let r=new cd;return r.append(t,0),r}fixCompositionDOM(e){let t=(u,f)=>{f.flags|=8|(f.children.some(g=>g.flags&7)?1:0),this.markedForComposition.add(f);let h=Tc.get(u);h&&h!=f&&(h.dom=null),f.setDOM(u)},r=this.childPos(e.range.fromB,1),a=this.children[r.i];t(e.line,a);for(let u=e.marks.length-1;u>=-1;u--)r=a.childPos(r.off,1),a=a.children[r.i],t(u>=0?e.marks[u].node:e.text,a)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,a=r==this.dom,u=!a&&Iz(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(a||t||u))return;let f=this.forceSelection;this.forceSelection=!1;let h=this.view.state.selection.main,g=this.moveToLine(this.domAtPos(h.anchor)),y=h.empty?g:this.moveToLine(this.domAtPos(h.head));if(Fs.gecko&&h.empty&&!this.hasComposition&&gke(g)){let A=document.createTextNode("");this.view.observer.ignore(()=>g.node.insertBefore(A,g.node.childNodes[g.offset]||null)),g=y=new Am(A,0),f=!0}let C=this.view.observer.selectionRange;(f||!C.focusNode||!lV(g.node,g.offset,C.anchorNode,C.anchorOffset)||!lV(y.node,y.offset,C.focusNode,C.focusOffset))&&(this.view.observer.ignore(()=>{Fs.android&&Fs.chrome&&this.dom.contains(C.focusNode)&&wke(C.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let A=aV(this.view.root);if(A)if(h.empty){if(Fs.gecko){let O=bke(g.node,g.offset);if(O&&O!=3){let N=nge(g.node,g.offset,O==1?1:-1);N&&(g=new Am(N.node,N.offset))}}A.collapse(g.node,g.offset),h.bidiLevel!=null&&A.caretBidiLevel!==void 0&&(A.caretBidiLevel=h.bidiLevel)}else if(A.extend){A.collapse(g.node,g.offset);try{A.extend(y.node,y.offset)}catch{}}else{let O=document.createRange();h.anchor>h.head&&([g,y]=[y,g]),O.setEnd(y.node,y.offset),O.setStart(g.node,g.offset),A.removeAllRanges(),A.addRange(O)}u&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(g,y)),this.impreciseAnchor=g.precise?null:new Am(C.anchorNode,C.anchorOffset),this.impreciseHead=y.precise?null:new Am(C.focusNode,C.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=aV(e.root),{anchorNode:a,anchorOffset:u}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let f=cd.find(this,t.head);if(!f)return;let h=f.posAtStart;if(t.head==h||t.head==h+f.length)return;let g=this.coordsAt(t.head,-1),y=this.coordsAt(t.head,1);if(!g||!y||g.bottom>y.top)return;let C=this.domAtPos(t.head+t.assoc);r.collapse(C.node,C.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let A=e.observer.selectionRange;e.docView.posFromDOM(A.anchorNode,A.anchorOffset)!=t.from&&r.collapse(a,u)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let a=e.offset;!r&&a<t.childNodes.length;a++){let u=Tc.get(t.childNodes[a]);u instanceof cd&&(r=u.domAtPos(0))}for(let a=e.offset-1;!r&&a>=0;a--){let u=Tc.get(t.childNodes[a]);u instanceof cd&&(r=u.domAtPos(u.length))}return r?new Am(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=Tc.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let a=this.children[t];if(r<a.length||a instanceof cd)break;t++,r=0}return this.children[t].domAtPos(r)}coordsAt(e,t){let r=null,a=0;for(let u=this.length,f=this.children.length-1;f>=0;f--){let h=this.children[f],g=u-h.breakAfter,y=g-h.length;if(g<e)break;y<=e&&(y<e||h.covers(-1))&&(g>e||h.covers(1))&&(!r||h instanceof cd&&!(r instanceof cd&&t>=0))&&(r=h,a=y),u=y}return r?r.coordsAt(e-a,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),a=this.children[t];if(!(a instanceof cd))return null;for(;a.children.length;){let{i:h,off:g}=a.childPos(r,1);for(;;h++){if(h==a.children.length)return null;if((a=a.children[h]).length)break}r=g}if(!(a instanceof M_))return null;let u=Tm(a.text,r);if(u==r)return null;let f=KA(a.dom,r,u).getClientRects();return!f.length||f[0].top>=f[0].bottom?null:f[0]}measureVisibleLineHeights(e){let t=[],{from:r,to:a}=e,u=this.view.contentDOM.clientWidth,f=u>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,h=-1,g=this.view.textDirection==mu.LTR;for(let y=0,C=0;C<this.children.length;C++){let A=this.children[C],O=y+A.length;if(O>a)break;if(y>=r){let N=A.dom.getBoundingClientRect();if(t.push(N.height),f){let L=A.dom.lastChild,j=L?zP(L):[];if(j.length){let z=j[j.length-1],q=g?z.right-N.left:N.right-z.left;q>h&&(h=q,this.minWidth=u,this.minWidthFrom=y,this.minWidthTo=O)}}}y=O+A.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?mu.RTL:mu.LTR}measureTextSize(){for(let u of this.children)if(u instanceof cd){let f=u.measureTextSize();if(f)return f}let e=document.createElement("div"),t,r,a;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let u=zP(e.firstChild)[0];t=e.getBoundingClientRect().height,r=u?u.width/27:7,a=u?u.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:a}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Dme(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,a=0;;a++){let u=a==t.viewports.length?null:t.viewports[a],f=u?u.from-1:this.length;if(f>r){let h=(t.lineBlockAt(f).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(ti.replace({widget:new Hce(h),block:!0,inclusive:!0,isBlockGap:!0}).range(r,f))}if(!u)break;r=u.to+1}return ti.set(e)}updateDeco(){let e=this.view.state.facet(UP).map((t,r)=>(this.dynamicDecorationMap[r]=typeof t=="function")?t(this.view):t);for(let t=e.length;t<e.length+3;t++)this.dynamicDecorationMap[t]=!1;return this.decorations=[...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),a;if(!r)return;!t.empty&&(a=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,a.left),top:Math.min(r.top,a.top),right:Math.max(r.right,a.right),bottom:Math.max(r.bottom,a.bottom)});let u=Kme(this.view),f={left:r.left-u.left,top:r.top-u.top,right:r.right+u.right,bottom:r.bottom+u.bottom};KSe(this.view.scrollDOM,f,t.head<t.anchor?-1:1,e.x,e.y,e.xMargin,e.yMargin,this.view.textDirection==mu.LTR)}}function gke(s){return s.node.nodeType==1&&s.node.firstChild&&(s.offset==0||s.node.childNodes[s.offset-1].contentEditable=="false")&&(s.offset==s.node.childNodes.length||s.node.childNodes[s.offset].contentEditable=="false")}class Hce extends Sk{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}}function tge(s,e){let t=s.observer.selectionRange,r=t.focusNode&&nge(t.focusNode,t.focusOffset,0);if(!r)return null;let a=e-r.offset;return{from:a,to:a+r.node.nodeValue.length,node:r.node}}function pke(s,e,t){let r=tge(s,t);if(!r)return null;let{node:a,from:u,to:f}=r,h=a.nodeValue;if(/[\n\r]/.test(h)||s.state.doc.sliceString(r.from,r.to)!=h)return null;let g=e.invertedDesc,y=new N0(g.mapPos(u),g.mapPos(f),u,f),C=[];for(let A=a.parentNode;;A=A.parentNode){let O=Tc.get(A);if(O instanceof R_)C.push({node:A,deco:O.mark});else{if(O instanceof cd||A.nodeName=="DIV"&&A.parentNode==s.contentDOM)return{range:y,text:a,marks:C,line:A};if(A!=s.contentDOM)C.push({node:A,deco:new fI({inclusive:!0,attributes:oke(A),tagName:A.tagName.toLowerCase()})});else return null}}}function nge(s,e,t){if(t<=0)for(let r=s,a=e;;){if(r.nodeType==3)return{node:r,offset:a};if(r.nodeType==1&&a>0)r=r.childNodes[a-1],a=O_(r);else break}if(t>=0)for(let r=s,a=e;;){if(r.nodeType==3)return{node:r,offset:a};if(r.nodeType==1&&a<r.childNodes.length&&t>=0)r=r.childNodes[a],a=0;else break}return null}function bke(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e<s.childNodes.length&&s.childNodes[e].contentEditable=="false"?2:0)}let vke=class{constructor(){this.changes=[]}compareRange(e,t){zne(e,t,this.changes)}comparePoint(e,t){zne(e,t,this.changes)}};function yke(s,e,t){let r=new vke;return Ya.compare(s,e,t,r),r.changes}function wke(s,e){for(let t=s;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function _ke(s,e){let t=!1;return e&&s.iterChangedRanges((r,a)=>{r<e.to&&a>e.from&&(t=!0)}),t}function Cke(s,e,t=1){let r=s.charCategorizer(e),a=s.doc.lineAt(e),u=e-a.from;if(a.length==0)return qn.cursor(e);u==0?t=1:u==a.length&&(t=-1);let f=u,h=u;t<0?f=Tm(a.text,u,!1):h=Tm(a.text,u);let g=r(a.text.slice(f,h));for(;f>0;){let y=Tm(a.text,f,!1);if(r(a.text.slice(y,f))!=g)break;f=y}for(;h<a.length;){let y=Tm(a.text,h);if(r(a.text.slice(h,y))!=g)break;h=y}return qn.range(f+a.from,h+a.from)}function Ske(s,e){return e.left>s?e.left-s:Math.max(0,s-e.right)}function kke(s,e){return e.top>s?e.top-s:Math.max(0,s-e.bottom)}function Dte(s,e){return s.top<e.bottom-1&&s.bottom>e.top+1}function $ce(s,e){return e<s.top?{top:e,left:s.left,right:s.right,bottom:s.bottom}:s}function zce(s,e){return e>s.bottom?{top:s.top,left:s.left,right:s.right,bottom:e}:s}function Zne(s,e,t){let r,a,u,f,h=!1,g,y,C,A;for(let L=s.firstChild;L;L=L.nextSibling){let j=zP(L);for(let z=0;z<j.length;z++){let q=j[z];a&&Dte(a,q)&&(q=$ce(zce(q,a.bottom),a.top));let ee=Ske(e,q),F=kke(t,q);if(ee==0&&F==0)return L.nodeType==3?Vce(L,e,t):Zne(L,e,t);if(!r||f>F||f==F&&u>ee){r=L,a=q,u=ee,f=F;let ne=F?t<q.top?-1:1:ee?e<q.left?-1:1:0;h=!ne||(ne>0?z<j.length-1:z>0)}ee==0?t>q.bottom&&(!C||C.bottom<q.bottom)?(g=L,C=q):t<q.top&&(!A||A.top>q.top)&&(y=L,A=q):C&&Dte(C,q)?C=zce(C,q.bottom):A&&Dte(A,q)&&(A=$ce(A,q.top))}}if(C&&C.bottom>=t?(r=g,a=C):A&&A.top<=t&&(r=y,a=A),!r)return{node:s,offset:0};let O=Math.max(a.left,Math.min(a.right,e));if(r.nodeType==3)return Vce(r,O,t);if(h&&r.contentEditable!="false")return Zne(r,O,t);let N=Array.prototype.indexOf.call(s.childNodes,r)+(e>=(a.left+a.right)/2?1:0);return{node:s,offset:N}}function Vce(s,e,t){let r=s.nodeValue.length,a=-1,u=1e9,f=0;for(let h=0;h<r;h++){let g=KA(s,h,h+1).getClientRects();for(let y=0;y<g.length;y++){let C=g[y];if(C.top==C.bottom)continue;f||(f=e-C.left);let A=(C.top>t?C.top-t:t-C.bottom)-1;if(C.left-1<=e&&C.right+1>=e&&A<u){let O=e>=(C.left+C.right)/2,N=O;if((Fs.chrome||Fs.gecko)&&KA(s,h).getBoundingClientRect().left==C.right&&(N=!O),A<=0)return{node:s,offset:h+(N?1:0)};a=h+(N?1:0),u=A}}}return{node:s,offset:a>-1?a:f>0?s.nodeValue.length:0}}function oge(s,e,t,r=-1){var a,u;let f=s.contentDOM.getBoundingClientRect(),h=f.top+s.viewState.paddingTop,g,{docHeight:y}=s.viewState,{x:C,y:A}=e,O=A-h;if(O<0)return 0;if(O>y)return s.state.doc.length;for(let ne=s.viewState.heightOracle.textHeight/2,oe=!1;g=s.elementAtHeight(O),g.type!=Ag.Text;)for(;O=r>0?g.bottom+ne:g.top-ne,!(O>=0&&O<=y);){if(oe)return t?null:0;oe=!0,r=-r}A=h+O;let N=g.from;if(N<s.viewport.from)return s.viewport.from==0?0:t?null:Uce(s,f,g,C,A);if(N>s.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:t?null:Uce(s,f,g,C,A);let L=s.dom.ownerDocument,j=s.root.elementFromPoint?s.root:L,z=j.elementFromPoint(C,A);z&&!s.contentDOM.contains(z)&&(z=null),z||(C=Math.max(f.left+1,Math.min(f.right-1,C)),z=j.elementFromPoint(C,A),z&&!s.contentDOM.contains(z)&&(z=null));let q,ee=-1;if(z&&((a=s.docView.nearest(z))===null||a===void 0?void 0:a.isEditable)!=!1){if(L.caretPositionFromPoint){let ne=L.caretPositionFromPoint(C,A);ne&&({offsetNode:q,offset:ee}=ne)}else if(L.caretRangeFromPoint){let ne=L.caretRangeFromPoint(C,A);ne&&({startContainer:q,startOffset:ee}=ne,(!s.contentDOM.contains(q)||Fs.safari&&Eke(q,ee,C)||Fs.chrome&&xke(q,ee,C))&&(q=void 0))}}if(!q||!s.docView.dom.contains(q)){let ne=cd.find(s.docView,N);if(!ne)return O>g.top+g.height/2?g.to:g.from;({node:q,offset:ee}=Zne(ne.dom,C,A))}let F=s.docView.nearest(q);if(!F)return null;if(F.isWidget&&((u=F.dom)===null||u===void 0?void 0:u.nodeType)==1){let ne=F.dom.getBoundingClientRect();return e.y<ne.top||e.y<=ne.bottom&&e.x<=(ne.left+ne.right)/2?F.posAtStart:F.posAtEnd}else return F.localPosFromDOM(q,ee)+F.posAtStart}function Uce(s,e,t,r,a){let u=Math.round((r-e.left)*s.defaultCharacterWidth);if(s.lineWrapping&&t.height>s.defaultLineHeight*1.5){let h=s.viewState.heightOracle.textHeight,g=Math.floor((a-t.top-(s.defaultLineHeight-h)*.5)/h);u+=g*s.viewState.heightOracle.lineLength}let f=s.state.sliceDoc(t.from,t.to);return t.from+Rne(f,u,s.state.tabSize)}function Eke(s,e,t){let r;if(s.nodeType!=3||e!=(r=s.nodeValue.length))return!1;for(let a=s.nextSibling;a;a=a.nextSibling)if(a.nodeType!=1||a.nodeName!="BR")return!1;return KA(s,r-1,r).getBoundingClientRect().left>t}function xke(s,e,t){if(e!=0)return!1;for(let a=s;;){let u=a.parentNode;if(!u||u.nodeType!=1||u.firstChild!=a)return!1;if(u.classList.contains("cm-line"))break;a=u}let r=s.nodeType==1?s.getBoundingClientRect():KA(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function qne(s,e){let t=s.lineBlockAt(e);if(Array.isArray(t.type)){for(let r of t.type)if(r.to>e||r.to==e&&(r.to==t.to||r.type==Ag.Text))return r}return t}function Ake(s,e,t,r){let a=qne(s,e.head),u=!r||a.type!=Ag.Text||!(s.lineWrapping||a.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>a.from?e.head-1:e.head);if(u){let f=s.dom.getBoundingClientRect(),h=s.textDirectionAt(a.from),g=s.posAtCoords({x:t==(h==mu.LTR)?f.right-1:f.left+1,y:(u.top+u.bottom)/2});if(g!=null)return qn.cursor(g,t?-1:1)}return qn.cursor(t?a.to:a.from,t?-1:1)}function Wce(s,e,t,r){let a=s.state.doc.lineAt(e.head),u=s.bidiSpans(a),f=s.textDirectionAt(a.from);for(let h=e,g=null;;){let y=mke(a,u,f,h,t),C=ege;if(!y){if(a.number==(t?s.state.doc.lines:1))return h;C=`
`,a=s.state.doc.line(a.number+(t?1:-1)),u=s.bidiSpans(a),y=qn.cursor(t?a.from:a.to)}if(g){if(!g(C))return h}else{if(!r)return y;g=r(C)}h=y}}function Tke(s,e,t){let r=s.state.charCategorizer(e),a=r(t);return u=>{let f=r(u);return a==jc.Space&&(a=f),a==f}}function Dke(s,e,t,r){let a=e.head,u=t?1:-1;if(a==(t?s.state.doc.length:0))return qn.cursor(a,e.assoc);let f=e.goalColumn,h,g=s.contentDOM.getBoundingClientRect(),y=s.coordsAtPos(a,e.assoc||-1),C=s.documentTop;if(y)f==null&&(f=y.left-g.left),h=u<0?y.top:y.bottom;else{let N=s.viewState.lineBlockAt(a);f==null&&(f=Math.min(g.right-g.left,s.defaultCharacterWidth*(a-N.from))),h=(u<0?N.top:N.bottom)+C}let A=g.left+f,O=r!=null?r:s.viewState.heightOracle.textHeight>>1;for(let N=0;;N+=10){let L=h+(O+N)*u,j=oge(s,{x:A,y:L},!1,u);if(L<g.top||L>g.bottom||(u<0?j<a:j>a)){let z=s.docView.coordsForChar(j),q=!z||L<z.top?-1:1;return qn.cursor(j,q,void 0,f)}}}function Bz(s,e,t){for(;;){let r=0;for(let a of s)a.between(e-1,e+1,(u,f,h)=>{if(e>u&&e<f){let g=r||t||(e-u<f-e?-1:1);e=g<0?u:f,r=g}});if(!r)return e}}function Ote(s,e,t){let r=Bz(s.state.facet(Voe).map(a=>a(s)),t.from,e.head>t.from?-1:1);return r==t.from?t:qn.cursor(r,r<t.from?1:-1)}class Oke{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.handleEvent=this.handleEvent.bind(this),e.scrollDOM.addEventListener("mousedown",t=>{if(t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&(this.runHandlers("mousedown",t),!t.defaultPrevented&&t.button==2)){let r=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=r,200)}}),e.scrollDOM.addEventListener("drop",t=>{t.target==e.scrollDOM&&t.clientY>e.contentDOM.getBoundingClientRect().bottom&&this.runHandlers("drop",t)}),this.notifiedFocused=e.hasFocus,Fs.safari&&e.contentDOM.addEventListener("input",()=>null),Fs.gecko&&Zke(e.contentDOM.ownerDocument)}handleEvent(e){!Fke(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let r=this.handlers[e];if(r){for(let a of r.observers)a(this.view,t);for(let a of r.handlers){if(t.defaultPrevented)break;if(a(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Mke(e),r=this.handlers,a=this.view.contentDOM;for(let u in t)if(u!="scroll"){let f=!t[u].handlers.length,h=r[u];h&&f!=!h.handlers.length&&(a.removeEventListener(u,this.handleEvent),h=null),h||a.addEventListener(u,this.handleEvent,{passive:f})}for(let u in r)u!="scroll"&&!t[u]&&a.removeEventListener(u,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(e.keyCode!=27&&rge.indexOf(e.keyCode)<0&&(this.view.inputState.lastEscPress=0),Fs.android&&Fs.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Fs.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=sge.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Rke.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,QD(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:Fs.safari&&!Fs.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function jce(s,e){return(t,r)=>{try{return e.call(s,r,t)}catch(a){R0(t.state,a)}}}function Mke(s){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of s){let a=r.spec;if(a&&a.domEventHandlers)for(let u in a.domEventHandlers){let f=a.domEventHandlers[u];f&&t(u).handlers.push(jce(r.value,f))}if(a&&a.domEventObservers)for(let u in a.domEventObservers){let f=a.domEventObservers[u];f&&t(u).observers.push(jce(r.value,f))}}for(let r in a2)t(r).handlers.push(a2[r]);for(let r in mv)t(r).observers.push(mv[r]);return e}const sge=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Rke="dthko",rge=[16,17,18,20,91,92,224,225],Y$=6;function X$(s){return Math.max(0,s)*.7+8}function Nke(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class Pke{constructor(e,t,r,a){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=a,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=YSe(e.contentDOM),this.atoms=e.state.facet(Voe).map(f=>f(e));let u=e.contentDOM.ownerDocument;u.addEventListener("mousemove",this.move=this.move.bind(this)),u.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Ea.allowMultipleSelections)&&Ike(e,t),this.dragging=Lke(e,t)&&cge(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Nke(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,a=0,u=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},f=Kme(this.view);e.clientX-f.left<=u.left+Y$?r=-X$(u.left-e.clientX):e.clientX+f.right>=u.right-Y$&&(r=X$(e.clientX-u.right)),e.clientY-f.top<=u.top+Y$?a=-X$(u.top-e.clientY):e.clientY+f.bottom>=u.bottom-Y$&&(a=X$(e.clientY-u.bottom)),this.setScrollSpeed(r,a)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;r<e.ranges.length;r++){let a=e.ranges[r],u=null;if(a.empty){let f=Bz(this.atoms,a.from,0);f!=a.from&&(u=qn.cursor(f,-1))}else{let f=Bz(this.atoms,a.from,-1),h=Bz(this.atoms,a.to,1);(f!=a.from||h!=a.to)&&(u=qn.range(a.from==a.anchor?f:h,a.from==a.head?f:h))}u&&(t||(t=e.ranges.slice()),t[r]=u)}return t?qn.create(t,e.mainIndex):e}select(e){let{view:t}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection)||r.main.assoc!=t.state.selection.main.assoc&&this.dragging===!1)&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Ike(s,e){let t=s.state.facet(Fme);return t.length?t[0](e):Fs.mac?e.metaKey:e.ctrlKey}function Bke(s,e){let t=s.state.facet(Hme);return t.length?t[0](e):Fs.mac?!e.altKey:!e.ctrlKey}function Lke(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let r=aV(s.root);if(!r||r.rangeCount==0)return!0;let a=r.getRangeAt(0).getClientRects();for(let u=0;u<a.length;u++){let f=a[u];if(f.left<=e.clientX&&f.right>=e.clientX&&f.top<=e.clientY&&f.bottom>=e.clientY)return!0}return!1}function Fke(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=Tc.get(t))&&r.ignoreEvent(e))return!1;return!0}const a2=Object.create(null),mv=Object.create(null),ige=Fs.ie&&Fs.ie_version<15||Fs.ios&&Fs.webkit_version<604;function Hke(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),age(s,t.value)},50)}function age(s,e){let{state:t}=s,r,a=1,u=t.toText(e),f=u.lines==t.selection.ranges.length;if(Gne!=null&&t.selection.ranges.every(g=>g.empty)&&Gne==u.toString()){let g=-1;r=t.changeByRange(y=>{let C=t.doc.lineAt(y.from);if(C.from==g)return{range:y};g=C.from;let A=t.toText((f?u.line(a++).text:e)+t.lineBreak);return{changes:{from:C.from,insert:A},range:qn.cursor(y.from+A.length)}})}else f?r=t.changeByRange(g=>{let y=u.line(a++);return{changes:{from:g.from,to:g.to,insert:y.text},range:qn.cursor(g.from+y.length)}}):r=t.replaceSelection(u);s.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}mv.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};a2.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),e.keyCode==27&&(s.inputState.lastEscPress=Date.now()),!1);mv.touchstart=(s,e)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};mv.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};a2.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of s.state.facet($me))if(t=r(s,e),t)break;if(!t&&e.button==0&&(t=Vke(s,e)),t){let r=!s.hasFocus;s.inputState.startMouseSelection(new Pke(s,e,t,r)),r&&s.observer.ignore(()=>xme(s.contentDOM));let a=s.inputState.mouseSelection;if(a)return a.start(e),!a.dragging}return!1};function Zce(s,e,t,r){if(r==1)return qn.cursor(e,t);if(r==2)return Cke(s.state,e,t);{let a=cd.find(s.docView,e),u=s.state.doc.lineAt(a?a.posAtEnd:e),f=a?a.posAtStart:u.from,h=a?a.posAtEnd:u.to;return h<s.state.doc.length&&h==u.to&&h++,qn.range(f,h)}}let lge=(s,e)=>s>=e.top&&s<=e.bottom,qce=(s,e,t)=>lge(e,t)&&s>=t.left&&s<=t.right;function $ke(s,e,t,r){let a=cd.find(s.docView,e);if(!a)return 1;let u=e-a.posAtStart;if(u==0)return 1;if(u==a.length)return-1;let f=a.coordsAt(u,-1);if(f&&qce(t,r,f))return-1;let h=a.coordsAt(u,1);return h&&qce(t,r,h)?1:f&&lge(r,f)?-1:1}function Gce(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:$ke(s,t,e.clientX,e.clientY)}}const zke=Fs.ie&&Fs.ie_version<=11;let Kce=null,Yce=0,Xce=0;function cge(s){if(!zke)return s.detail;let e=Kce,t=Xce;return Kce=s,Xce=Date.now(),Yce=!e||t>Date.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(Yce+1)%3:1}function Vke(s,e){let t=Gce(s,e),r=cge(e),a=s.state.selection;return{update(u){u.docChanged&&(t.pos=u.changes.mapPos(t.pos),a=a.map(u.changes))},get(u,f,h){let g=Gce(s,u),y,C=Zce(s,g.pos,g.bias,r);if(t.pos!=g.pos&&!f){let A=Zce(s,t.pos,t.bias,r),O=Math.min(A.from,C.from),N=Math.max(A.to,C.to);C=O<C.from?qn.range(O,N):qn.range(N,O)}return f?a.replaceRange(a.main.extend(C.from,C.to)):h&&r==1&&a.ranges.length>1&&(y=Uke(a,g.pos))?y:h?a.addRange(C):qn.create([C])}}}function Uke(s,e){for(let t=0;t<s.ranges.length;t++){let{from:r,to:a}=s.ranges[t];if(r<=e&&a>=e)return qn.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}a2.dragstart=(s,e)=>{let{selection:{main:t}}=s.state,{mouseSelection:r}=s.inputState;return r&&(r.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",s.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function Jce(s,e,t,r){if(!t)return;let a=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:u}=s.inputState,f=r&&u&&u.dragging&&Bke(s,e)?{from:u.dragging.from,to:u.dragging.to}:null,h={from:a,insert:t},g=s.state.changes(f?[f,h]:h);s.focus(),s.dispatch({changes:g,selection:{anchor:g.mapPos(a,-1),head:g.mapPos(a,1)},userEvent:f?"move.drop":"input.drop"})}a2.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),a=0,u=()=>{++a==t.length&&Jce(s,e,r.filter(f=>f!=null).join(s.state.lineBreak),!1)};for(let f=0;f<t.length;f++){let h=new FileReader;h.onerror=u,h.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(h.result)||(r[f]=h.result),u()},h.readAsText(t[f])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Jce(s,e,r,!0),!0}return!1};a2.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=ige?null:e.clipboardData;return t?(age(s,t.getData("text/plain")||t.getData("text/uri-text")),!0):(Hke(s),!1)};function Wke(s,e){let t=s.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),s.focus()},50)}function jke(s){let e=[],t=[],r=!1;for(let a of s.selection.ranges)a.empty||(e.push(s.sliceDoc(a.from,a.to)),t.push(a));if(!e.length){let a=-1;for(let{from:u}of s.selection.ranges){let f=s.doc.lineAt(u);f.number>a&&(e.push(f.text),t.push({from:f.from,to:Math.min(s.doc.length,f.to+1)})),a=f.number}r=!0}return{text:e.join(s.lineBreak),ranges:t,linewise:r}}let Gne=null;a2.copy=a2.cut=(s,e)=>{let{text:t,ranges:r,linewise:a}=jke(s.state);if(!t&&!a)return!1;Gne=a?t:null,e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let u=ige?null:e.clipboardData;return u?(u.clearData(),u.setData("text/plain",t),!0):(Wke(s,t),!1)};const uge=B_.define();function fge(s,e){let t=[];for(let r of s.facet(Ume)){let a=r(s,e);a&&t.push(a)}return t?s.update({effects:t,annotations:uge.of(!0)}):null}function dge(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=fge(s.state,e);t?s.dispatch(t):s.update([])}},10)}mv.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),dge(s)};mv.blur=s=>{s.observer.clearSelectionRange(),dge(s)};mv.compositionstart=mv.compositionupdate=s=>{s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0)};mv.compositionend=s=>{s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,Fs.chrome&&Fs.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50)};mv.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};a2.beforeinput=(s,e)=>{var t;let r;if(Fs.chrome&&Fs.android&&(r=sge.find(a=>a.inputType==e.inputType))&&(s.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let a=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var u;(((u=window.visualViewport)===null||u===void 0?void 0:u.height)||0)>a+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return!1};const Qce=new Set;function Zke(s){Qce.has(s)||(Qce.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const eue=["pre-wrap","normal","pre-line","break-spaces"];class qke{constructor(e){this.lineWrapping=e,this.doc=cl.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return eue.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let a=e[r];a<0?r++:this.heightSamples[Math.floor(a*10)]||(t=!0,this.heightSamples[Math.floor(a*10)]=!0)}return t}refresh(e,t,r,a,u,f){let h=eue.indexOf(e)>-1,g=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=h;if(this.lineWrapping=h,this.lineHeight=t,this.charWidth=r,this.textHeight=a,this.lineLength=u,g){this.heightSamples={};for(let y=0;y<f.length;y++){let C=f[y];C<0?y++:this.heightSamples[Math.floor(C*10)]=!0}}return g}}class Gke{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Xy{constructor(e,t,r,a,u){this.from=e,this.length=t,this.top=r,this.height=a,this._content=u}get type(){return typeof this._content=="number"?Ag.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof bk?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Xy(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Ac=function(s){return s[s.ByPos=0]="ByPos",s[s.ByHeight=1]="ByHeight",s[s.ByPosNoHeight=2]="ByPosNoHeight",s}(Ac||(Ac={}));const Lz=.001;class Tg{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Lz&&(e.heightChanged=!0),this.height=t)}replace(e,t,r){return Tg.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,a){let u=this,f=r.doc;for(let h=a.length-1;h>=0;h--){let{fromA:g,toA:y,fromB:C,toB:A}=a[h],O=u.lineAt(g,Ac.ByPosNoHeight,r.setDoc(t),0,0),N=O.to>=y?O:u.lineAt(y,Ac.ByPosNoHeight,r,0,0);for(A+=N.to-y,y=N.to;h>0&&O.from<=a[h-1].toA;)g=a[h-1].fromA,C=a[h-1].fromB,h--,g<O.from&&(O=u.lineAt(g,Ac.ByPosNoHeight,r,0,0));C+=O.from-g,g=O.from;let L=Uoe.build(r.setDoc(f),e,C,A);u=u.replace(g,y,L)}return u.updateHeight(r,0)}static empty(){return new D1(0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,a=0,u=0;for(;;)if(t==r)if(a>u*2){let h=e[t-1];h.break?e.splice(--t,1,h.left,null,h.right):e.splice(--t,1,h.left,h.right),r+=1+h.break,a-=h.size}else if(u>a*2){let h=e[r];h.break?e.splice(r,1,h.left,null,h.right):e.splice(r,1,h.left,h.right),r+=2+h.break,u-=h.size}else break;else if(a<u){let h=e[t++];h&&(a+=h.size)}else{let h=e[--r];h&&(u+=h.size)}let f=0;return e[t-1]==null?(f=1,t--):e[t]==null&&(f=1,r++),new Kke(Tg.of(e.slice(0,t)),f,Tg.of(e.slice(r)))}}Tg.prototype.size=1;class hge extends Tg{constructor(e,t,r){super(e,t),this.deco=r}blockAt(e,t,r,a){return new Xy(a,this.length,r,this.height,this.deco||0)}lineAt(e,t,r,a,u){return this.blockAt(0,r,a,u)}forEachLine(e,t,r,a,u,f){e<=u+this.length&&t>=u&&f(this.blockAt(0,r,a,u))}updateHeight(e,t=0,r=!1,a){return a&&a.from<=t&&a.more&&this.setHeight(e,a.heights[a.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class D1 extends hge{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,a){return new Xy(a,this.length,r,this.height,this.breaks)}replace(e,t,r){let a=r[0];return r.length==1&&(a instanceof D1||a instanceof Bh&&a.flags&4)&&Math.abs(this.length-a.length)<10?(a instanceof Bh?a=new D1(a.length,this.height):a.height=this.height,this.outdated||(a.outdated=!1),a):Tg.of(r)}updateHeight(e,t=0,r=!1,a){return a&&a.from<=t&&a.more?this.setHeight(e,a.heights[a.index++]):(r||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Bh extends Tg{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,a=e.doc.lineAt(t+this.length).number,u=a-r+1,f,h=0;if(e.lineWrapping){let g=Math.min(this.height,e.lineHeight*u);f=g/u,this.length>u+1&&(h=(this.height-g)/(this.length-u-1))}else f=this.height/u;return{firstLine:r,lastLine:a,perLine:f,perChar:h}}blockAt(e,t,r,a){let{firstLine:u,lastLine:f,perLine:h,perChar:g}=this.heightMetrics(t,a);if(t.lineWrapping){let y=a+Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length),C=t.doc.lineAt(y),A=h+C.length*g,O=Math.max(r,e-A/2);return new Xy(C.from,C.length,O,A,0)}else{let y=Math.max(0,Math.min(f-u,Math.floor((e-r)/h))),{from:C,length:A}=t.doc.line(u+y);return new Xy(C,A,r+h*y,h,0)}}lineAt(e,t,r,a,u){if(t==Ac.ByHeight)return this.blockAt(e,r,a,u);if(t==Ac.ByPosNoHeight){let{from:N,to:L}=r.doc.lineAt(e);return new Xy(N,L-N,0,0,0)}let{firstLine:f,perLine:h,perChar:g}=this.heightMetrics(r,u),y=r.doc.lineAt(e),C=h+y.length*g,A=y.number-f,O=a+h*A+g*(y.from-u-A);return new Xy(y.from,y.length,Math.max(a,Math.min(O,a+this.height-C)),C,0)}forEachLine(e,t,r,a,u,f){e=Math.max(e,u),t=Math.min(t,u+this.length);let{firstLine:h,perLine:g,perChar:y}=this.heightMetrics(r,u);for(let C=e,A=a;C<=t;){let O=r.doc.lineAt(C);if(C==e){let L=O.number-h;A+=g*L+y*(e-u-L)}let N=g+y*O.length;f(new Xy(O.from,O.length,A,N,0)),A+=N,C=O.to+1}}replace(e,t,r){let a=this.length-t;if(a>0){let u=r[r.length-1];u instanceof Bh?r[r.length-1]=new Bh(u.length+a):r.push(null,new Bh(a-1))}if(e>0){let u=r[0];u instanceof Bh?r[0]=new Bh(e+u.length):r.unshift(new Bh(e-1),null)}return Tg.of(r)}decomposeLeft(e,t){t.push(new Bh(e-1),null)}decomposeRight(e,t){t.push(null,new Bh(this.length-e-1))}updateHeight(e,t=0,r=!1,a){let u=t+this.length;if(a&&a.from<=t+this.length&&a.more){let f=[],h=Math.max(t,a.from),g=-1;for(a.from>t&&f.push(new Bh(a.from-t-1).updateHeight(e,t));h<=u&&a.more;){let C=e.doc.lineAt(h).length;f.length&&f.push(null);let A=a.heights[a.index++];g==-1?g=A:Math.abs(A-g)>=Lz&&(g=-2);let O=new D1(C,A);O.outdated=!1,f.push(O),h+=C+1}h<=u&&f.push(null,new Bh(u-h).updateHeight(e,h));let y=Tg.of(f);return(g<0||Math.abs(y.height-this.height)>=Lz||Math.abs(g-this.heightMetrics(e,t).perLine)>=Lz)&&(e.heightChanged=!0),y}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Kke extends Tg{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,a){let u=r+this.left.height;return e<u?this.left.blockAt(e,t,r,a):this.right.blockAt(e,t,u,a+this.left.length+this.break)}lineAt(e,t,r,a,u){let f=a+this.left.height,h=u+this.left.length+this.break,g=t==Ac.ByHeight?e<f:e<h,y=g?this.left.lineAt(e,t,r,a,u):this.right.lineAt(e,t,r,f,h);if(this.break||(g?y.to<h:y.from>h))return y;let C=t==Ac.ByPosNoHeight?Ac.ByPosNoHeight:Ac.ByPos;return g?y.join(this.right.lineAt(h,C,r,f,h)):this.left.lineAt(h,C,r,a,u).join(y)}forEachLine(e,t,r,a,u,f){let h=a+this.left.height,g=u+this.left.length+this.break;if(this.break)e<g&&this.left.forEachLine(e,t,r,a,u,f),t>=g&&this.right.forEachLine(e,t,r,h,g,f);else{let y=this.lineAt(g,Ac.ByPos,r,a,u);e<y.from&&this.left.forEachLine(e,y.from-1,r,a,u,f),y.to>=e&&y.from<=t&&f(y),t>y.to&&this.right.forEachLine(y.to+1,t,r,h,g,f)}}replace(e,t,r){let a=this.left.length+this.break;if(t<a)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-a,t-a,r));let u=[];e>0&&this.decomposeLeft(e,u);let f=u.length;for(let h of r)u.push(h);if(e>0&&tue(u,f-1),t<this.length){let h=u.length;this.decomposeRight(t,u),tue(u,h)}return Tg.of(u)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,a=r+this.break;if(e>=a)return this.right.decomposeRight(e-a,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<a&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Tg.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,a){let{left:u,right:f}=this,h=t+u.length+this.break,g=null;return a&&a.from<=t+u.length&&a.more?g=u=u.updateHeight(e,t,r,a):u.updateHeight(e,t,r),a&&a.from<=h+f.length&&a.more?g=f=f.updateHeight(e,h,r,a):f.updateHeight(e,h,r),g?this.balanced(u,f):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tue(s,e){let t,r;s[e]==null&&(t=s[e-1])instanceof Bh&&(r=s[e+1])instanceof Bh&&s.splice(e-1,3,new Bh(t.length+1+r.length))}const Yke=5;class Uoe{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),a=this.nodes[this.nodes.length-1];a instanceof D1?a.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new D1(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let a=r.widget?r.widget.estimatedHeight:0,u=r.widget?r.widget.lineBreaks:0;a<0&&(a=this.oracle.lineHeight);let f=t-e;r.block?this.addBlock(new hge(f,a,r)):(f||u||a>=Yke)&&this.addLineDeco(a,u,f)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new D1(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new Bh(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof D1)return e;let t=new D1(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let a=this.ensureLine();a.length+=r,a.collapsed+=r,a.widgetHeight=Math.max(a.widgetHeight,e),a.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof D1)&&!this.isCovered?this.nodes.push(new D1(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let a of this.nodes)a instanceof D1&&a.updateHeight(this.oracle,r),r+=a?a.length:1;return this.nodes}static build(e,t,r,a){let u=new Uoe(r,e);return Ya.spans(t,r,a,u,0),u.finish(r)}}function Xke(s,e,t){let r=new Jke;return Ya.compare(s,e,t,r,0),r.changes}class Jke{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,a){(e<t||r&&r.heightRelevant||a&&a.heightRelevant)&&zne(e,t,this.changes,5)}}function Qke(s,e){let t=s.getBoundingClientRect(),r=s.ownerDocument,a=r.defaultView||window,u=Math.max(0,t.left),f=Math.min(a.innerWidth,t.right),h=Math.max(0,t.top),g=Math.min(a.innerHeight,t.bottom);for(let y=s.parentNode;y&&y!=r.body;)if(y.nodeType==1){let C=y,A=window.getComputedStyle(C);if((C.scrollHeight>C.clientHeight||C.scrollWidth>C.clientWidth)&&A.overflow!="visible"){let O=C.getBoundingClientRect();u=Math.max(u,O.left),f=Math.min(f,O.right),h=Math.max(h,O.top),g=y==s.parentNode?O.bottom:Math.min(g,O.bottom)}y=A.position=="absolute"||A.position=="fixed"?C.offsetParent:C.parentNode}else if(y.nodeType==11)y=y.host;else break;return{left:u-t.left,right:Math.max(u,f)-t.left,top:h-(t.top+e),bottom:Math.max(h,g)-(t.top+e)}}function eEe(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Mte{constructor(e,t,r){this.from=e,this.to=t,this.size=r}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let a=e[r],u=t[r];if(a.from!=u.from||a.to!=u.to||a.size!=u.size)return!1}return!0}draw(e,t){return ti.replace({widget:new tEe(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class tEe extends Sk{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class nue{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=oue,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mu.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(zoe).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new qke(t),this.stateDeco=e.facet(UP).filter(r=>typeof r!="function"),this.heightMap=Tg.empty().applyChanges(this.stateDeco,cl.empty,this.heightOracle.setDoc(e.doc),[new N0(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ti.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let a=r?t.head:t.anchor;if(!e.some(({from:u,to:f})=>a>=u&&a<=f)){let{from:u,to:f}=this.lineBlockAt(a);e.push(new J$(u,f))}}this.viewports=e.sort((r,a)=>r.from-a.from),this.scaler=this.heightMap.height<=7e6?oue:new sEe(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:vP(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(UP).filter(C=>typeof C!="function");let a=e.changedRanges,u=N0.extendWithRanges(a,Xke(r,this.stateDeco,e?e.changes:fd.empty(this.state.doc.length))),f=this.heightMap.height,h=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),u),this.heightMap.height!=f&&(e.flags|=2),h?(this.scrollAnchorPos=e.changes.mapPos(h.from,-1),this.scrollAnchorHeight=h.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let g=u.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<g.from||t.range.head>g.to)||!this.viewportIsAppropriate(g))&&(g=this.getViewport(0,t));let y=!e.changes.empty||e.flags&2||g.from!=this.viewport.from||g.to!=this.viewport.to;this.viewport=g,this.updateForViewport(),y&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(jme)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),a=this.heightOracle,u=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?mu.RTL:mu.LTR;let f=this.heightOracle.mustRefreshForWrapping(u),h=t.getBoundingClientRect(),g=f||this.mustMeasureContent||this.contentDOMHeight!=h.height;this.contentDOMHeight=h.height,this.mustMeasureContent=!1;let y=0,C=0;if(h.width&&h.height){let ne=h.width/t.offsetWidth,oe=h.height/t.offsetHeight;(ne>.995&&ne<1.005||!isFinite(ne)||Math.abs(h.width-t.offsetWidth)<1)&&(ne=1),(oe>.995&&oe<1.005||!isFinite(oe)||Math.abs(h.height-t.offsetHeight)<1)&&(oe=1),(this.scaleX!=ne||this.scaleY!=oe)&&(this.scaleX=ne,this.scaleY=oe,y|=8,f=g=!0)}let A=(parseInt(r.paddingTop)||0)*this.scaleY,O=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=A||this.paddingBottom!=O)&&(this.paddingTop=A,this.paddingBottom=O,y|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(a.lineWrapping&&(g=!0),this.editorWidth=e.scrollDOM.clientWidth,y|=8);let N=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=N&&(this.scrollAnchorHeight=-1,this.scrollTop=N),this.scrolledToBottom=Tme(e.scrollDOM);let L=(this.printing?eEe:Qke)(t,this.paddingTop),j=L.top-this.pixelViewport.top,z=L.bottom-this.pixelViewport.bottom;this.pixelViewport=L;let q=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(q!=this.inView&&(this.inView=q,q&&(g=!0)),!this.inView&&!this.scrollTarget)return 0;let ee=h.width;if((this.contentDOMWidth!=ee||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=h.width,this.editorHeight=e.scrollDOM.clientHeight,y|=8),g){let ne=e.docView.measureVisibleLineHeights(this.viewport);if(a.mustRefreshForHeights(ne)&&(f=!0),f||a.lineWrapping&&Math.abs(ee-this.contentDOMWidth)>a.charWidth){let{lineHeight:oe,charWidth:re,textHeight:J}=e.docView.measureTextSize();f=oe>0&&a.refresh(u,oe,re,J,ee/re,ne),f&&(e.docView.minWidth=0,y|=8)}j>0&&z>0?C=Math.max(j,z):j<0&&z<0&&(C=Math.min(j,z)),a.heightChanged=!1;for(let oe of this.viewports){let re=oe.from==this.viewport.from?ne:e.docView.measureVisibleLineHeights(oe);this.heightMap=(f?Tg.empty().applyChanges(this.stateDeco,cl.empty,this.heightOracle,[new N0(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(a,0,f,new Gke(oe.from,re))}a.heightChanged&&(y|=2)}let F=!this.viewportIsAppropriate(this.viewport,C)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return F&&(this.viewport=this.getViewport(C,this.scrollTarget)),this.updateForViewport(),(y&2||F)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(f?[]:this.lineGaps,e)),y|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),y}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),a=this.heightMap,u=this.heightOracle,{visibleTop:f,visibleBottom:h}=this,g=new J$(a.lineAt(f-r*1e3,Ac.ByHeight,u,0,0).from,a.lineAt(h+(1-r)*1e3,Ac.ByHeight,u,0,0).to);if(t){let{head:y}=t.range;if(y<g.from||y>g.to){let C=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),A=a.lineAt(y,Ac.ByPos,u,0,0),O;t.y=="center"?O=(A.top+A.bottom)/2-C/2:t.y=="start"||t.y=="nearest"&&y<g.from?O=A.top:O=A.bottom-C,g=new J$(a.lineAt(O-1e3/2,Ac.ByHeight,u,0,0).from,a.lineAt(O+C+1e3/2,Ac.ByHeight,u,0,0).to)}}return g}mapViewport(e,t){let r=t.mapPos(e.from,-1),a=t.mapPos(e.to,1);return new J$(this.heightMap.lineAt(r,Ac.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(a,Ac.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:a}=this.heightMap.lineAt(e,Ac.ByPos,this.heightOracle,0,0),{bottom:u}=this.heightMap.lineAt(t,Ac.ByPos,this.heightOracle,0,0),{visibleTop:f,visibleBottom:h}=this;return(e==0||a<=f-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||u>=h+Math.max(10,Math.min(r,250)))&&a>f-2*1e3&&u<h+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let a of e)t.touchesRange(a.from,a.to)||r.push(new Mte(t.mapPos(a.from),t.mapPos(a.to),a.size));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,a=r?1e4:2e3,u=a>>1,f=a<<1;if(this.defaultTextDirection!=mu.LTR&&!r)return[];let h=[],g=(y,C,A,O)=>{if(C-y<u)return;let N=this.state.selection.main,L=[N.from];N.empty||L.push(N.to);for(let z of L)if(z>y&&z<C){g(y,z-10,A,O),g(z+10,C,A,O);return}let j=oEe(e,z=>z.from>=A.from&&z.to<=A.to&&Math.abs(z.from-y)<u&&Math.abs(z.to-C)<u&&!L.some(q=>z.from<q&&z.to>q));if(!j){if(C<A.to&&t&&r&&t.visibleRanges.some(z=>z.from<=C&&z.to>=C)){let z=t.moveToLineBoundary(qn.cursor(C),!1,!0).head;z>y&&(C=z)}j=new Mte(y,C,this.gapSize(A,y,C,O))}h.push(j)};for(let y of this.viewportLines){if(y.length<f)continue;let C=nEe(y.from,y.to,this.stateDeco);if(C.total<f)continue;let A=this.scrollTarget?this.scrollTarget.range.head:null,O,N;if(r){let L=a/this.heightOracle.lineLength*this.heightOracle.lineHeight,j,z;if(A!=null){let q=ez(C,A),ee=((this.visibleBottom-this.visibleTop)/2+L)/y.height;j=q-ee,z=q+ee}else j=(this.visibleTop-y.top-L)/y.height,z=(this.visibleBottom-y.top+L)/y.height;O=Q$(C,j),N=Q$(C,z)}else{let L=C.total*this.heightOracle.charWidth,j=a*this.heightOracle.charWidth,z,q;if(A!=null){let ee=ez(C,A),F=((this.pixelViewport.right-this.pixelViewport.left)/2+j)/L;z=ee-F,q=ee+F}else z=(this.pixelViewport.left-j)/L,q=(this.pixelViewport.right+j)/L;O=Q$(C,z),N=Q$(C,q)}O>y.from&&g(y.from,O,y,C),N<y.to&&g(N,y.to,y,C)}return h}gapSize(e,t,r,a){let u=ez(a,r)-ez(a,t);return this.heightOracle.lineWrapping?e.height*u:a.total*this.heightOracle.charWidth*u}updateLineGaps(e){Mte.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ti.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Ya.spans(e,this.viewport.from,this.viewport.to,{span(a,u){t.push({from:a,to:u})},point(){}},20);let r=t.length!=this.visibleRanges.length||this.visibleRanges.some((a,u)=>a.from!=t[u].from||a.to!=t[u].to);return this.visibleRanges=t,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||vP(this.heightMap.lineAt(e,Ac.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return vP(this.heightMap.lineAt(this.scaler.fromDOM(e),Ac.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return vP(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class J${constructor(e,t){this.from=e,this.to=t}}function nEe(s,e,t){let r=[],a=s,u=0;return Ya.spans(t,s,e,{span(){},point(f,h){f>a&&(r.push({from:a,to:f}),u+=f-a),a=h}},20),a<e&&(r.push({from:a,to:e}),u+=e-a),{total:u,ranges:r}}function Q$({total:s,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(s*t);for(let a=0;;a++){let{from:u,to:f}=e[a],h=f-u;if(r<=h)return u+r;r-=h}}function ez(s,e){let t=0;for(let{from:r,to:a}of s.ranges){if(e<=a){t+=e-r;break}t+=a-r}return t/s.total}function oEe(s,e){for(let t of s)if(e(t))return t}const oue={toDOM(s){return s},fromDOM(s){return s},scale:1};class sEe{constructor(e,t,r){let a=0,u=0,f=0;this.viewports=r.map(({from:h,to:g})=>{let y=t.lineAt(h,Ac.ByPos,e,0,0).top,C=t.lineAt(g,Ac.ByPos,e,0,0).bottom;return a+=C-y,{from:h,to:g,top:y,bottom:C,domTop:0,domBottom:0}}),this.scale=(7e6-a)/(t.height-a);for(let h of this.viewports)h.domTop=f+(h.top-u)*this.scale,f=h.domBottom=h.domTop+(h.bottom-h.top),u=h.bottom}toDOM(e){for(let t=0,r=0,a=0;;t++){let u=t<this.viewports.length?this.viewports[t]:null;if(!u||e<u.top)return a+(e-r)*this.scale;if(e<=u.bottom)return u.domTop+(e-u.top);r=u.bottom,a=u.domBottom}}fromDOM(e){for(let t=0,r=0,a=0;;t++){let u=t<this.viewports.length?this.viewports[t]:null;if(!u||e<u.domTop)return r+(e-a)/this.scale;if(e<=u.domBottom)return u.top+(e-u.domTop);r=u.bottom,a=u.domBottom}}}function vP(s,e){if(e.scale==1)return s;let t=e.toDOM(s.top),r=e.toDOM(s.bottom);return new Xy(s.from,s.length,t,r-t,Array.isArray(s._content)?s._content.map(a=>vP(a,e)):s._content)}const tz=Ds.define({combine:s=>s.join(" ")}),Kne=Ds.define({combine:s=>s.indexOf(!0)>-1}),Yne=gk.newName(),mge=gk.newName(),gge=gk.newName(),pge={"&light":"."+mge,"&dark":"."+gge};function Xne(s,e,t){return new gk(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,a=>{if(a=="&")return s;if(!t||!t[a])throw new RangeError(`Unsupported selector: ${a}`);return t[a]}):s+" "+r}})}const rEe=Xne("."+Yne,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},pge),yP="\uFFFF";class iEe{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Ea.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=yP}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let a=e;;){this.findPointBefore(r,a);let u=this.text.length;this.readNode(a);let f=a.nextSibling;if(f==t)break;let h=Tc.get(a),g=Tc.get(f);(h&&g?h.breakAfter:(h?h.breakAfter:sue(a))||sue(f)&&(a.nodeName!="BR"||a.cmIgnore)&&this.text.length>u)&&this.lineBreak(),a=f}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,a=this.lineSeparator?null:/\r\n?|\n/g;;){let u=-1,f=1,h;if(this.lineSeparator?(u=t.indexOf(this.lineSeparator,r),f=this.lineSeparator.length):(h=a.exec(t))&&(u=h.index,f=h[0].length),this.append(t.slice(r,u<0?t.length:u)),u<0)break;if(this.lineBreak(),f>1)for(let g of this.points)g.node==e&&g.pos>this.text.length&&(g.pos-=f-1);r=u+f}}readNode(e){if(e.cmIgnore)return;let t=Tc.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let a=r.iter();!a.next().done;)a.lineBreak?this.lineBreak():this.append(a.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(aEe(e,r.node,r.offset)?t:0))}}function aEe(s,e,t){for(;;){if(!e||t<O_(e))return!1;if(e==s)return!0;t=VP(e)+1,e=e.parentNode}}function sue(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}class rue{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class lEe{constructor(e,t,r,a){this.typeOver=a,this.bounds=null,this.text="";let{impreciseHead:u,impreciseAnchor:f}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let h=u||f?[]:fEe(e),g=new iEe(h,e.state);g.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=g.text,this.newSel=dEe(h,this.bounds.from)}else{let h=e.observer.selectionRange,g=u&&u.node==h.focusNode&&u.offset==h.focusOffset||!Ine(e.contentDOM,h.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(h.focusNode,h.focusOffset),y=f&&f.node==h.anchorNode&&f.offset==h.anchorOffset||!Ine(e.contentDOM,h.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(h.anchorNode,h.anchorOffset);this.newSel=qn.single(y,g)}}}function bge(s,e){let t,{newSel:r}=e,a=s.state.selection.main,u=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:f,to:h}=e.bounds,g=a.from,y=null;(u===8||Fs.android&&e.text.length<h-f)&&(g=a.to,y="end");let C=uEe(s.state.doc.sliceString(f,h,yP),e.text,g-f,y);C&&(Fs.chrome&&u==13&&C.toB==C.from+2&&e.text.slice(C.from,C.toB)==yP+yP&&C.toB--,t={from:f+C.from,to:f+C.toA,insert:cl.of(e.text.slice(C.from,C.toB).split(yP))})}else r&&(!s.hasFocus&&s.state.facet(GV)||r.main.eq(a))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!a.empty&&r&&r.main.empty?t={from:a.from,to:a.to,insert:s.state.doc.slice(a.from,a.to)}:t&&t.from>=a.from&&t.to<=a.to&&(t.from!=a.from||t.to!=a.to)&&a.to-a.from-(t.to-t.from)<=4?t={from:a.from,to:a.to,insert:s.state.doc.slice(a.from,t.from).append(t.insert).append(s.state.doc.slice(t.to,a.to))}:(Fs.mac||Fs.android)&&t&&t.from==t.to&&t.from==a.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=qn.single(r.main.anchor-1,r.main.head-1)),t={from:a.from,to:a.to,insert:cl.of([" "])}):Fs.chrome&&t&&t.from==t.to&&t.from==a.head&&t.insert.toString()==`
`&&s.lineWrapping&&(r&&(r=qn.single(r.main.anchor-1,r.main.head-1)),t={from:a.from,to:a.to,insert:cl.of([" "])}),t){if(Fs.ios&&s.inputState.flushIOSKey()||Fs.android&&(t.from==a.from&&t.to==a.to&&t.insert.length==1&&t.insert.lines==2&&QD(s.contentDOM,"Enter",13)||(t.from==a.from-1&&t.to==a.to&&t.insert.length==0||u==8&&t.insert.length<t.to-t.from&&t.to>a.head)&&QD(s.contentDOM,"Backspace",8)||t.from==a.from&&t.to==a.to+1&&t.insert.length==0&&QD(s.contentDOM,"Delete",46)))return!0;let f=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let h,g=()=>h||(h=cEe(s,t,r));return s.state.facet(Vme).some(y=>y(s,t.from,t.to,f,g))||s.dispatch(g()),!0}else if(r&&!r.main.eq(a)){let f=!1,h="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(f=!0),h=s.inputState.lastSelectionOrigin),s.dispatch({selection:r,scrollIntoView:f,userEvent:h}),!0}else return!1}function cEe(s,e,t){let r,a=s.state,u=a.selection.main;if(e.from>=u.from&&e.to<=u.to&&e.to-e.from>=(u.to-u.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let h=u.from<e.from?a.sliceDoc(u.from,e.from):"",g=u.to>e.to?a.sliceDoc(e.to,u.to):"";r=a.replaceSelection(s.state.toText(h+e.insert.sliceString(0,void 0,s.state.lineBreak)+g))}else{let h=a.changes(e),g=t&&t.main.to<=h.newLength?t.main:void 0;if(a.selection.ranges.length>1&&s.inputState.composing>=0&&e.to<=u.to&&e.to>=u.to-10){let y=s.state.sliceDoc(e.from,e.to),C,A=t&&tge(s,t.main.head);if(A){let L=e.insert.length-(e.to-e.from);C={from:A.from,to:A.to-L}}else C=s.state.doc.lineAt(u.head);let O=u.to-e.to,N=u.to-u.from;r=a.changeByRange(L=>{if(L.from==u.from&&L.to==u.to)return{changes:h,range:g||L.map(h)};let j=L.to-O,z=j-y.length;if(L.to-L.from!=N||s.state.sliceDoc(z,j)!=y||L.to>=C.from&&L.from<=C.to)return{range:L};let q=a.changes({from:z,to:j,insert:e.insert}),ee=L.to-u.to;return{changes:q,range:g?qn.range(Math.max(0,g.anchor+ee),Math.max(0,g.head+ee)):L.map(q)}})}else r={changes:h,selection:g&&a.selection.replaceRange(g)}}let f="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,f+=".compose",s.inputState.compositionFirstChange&&(f+=".start",s.inputState.compositionFirstChange=!1)),a.update(r,{userEvent:f,scrollIntoView:!0})}function uEe(s,e,t,r){let a=Math.min(s.length,e.length),u=0;for(;u<a&&s.charCodeAt(u)==e.charCodeAt(u);)u++;if(u==a&&s.length==e.length)return null;let f=s.length,h=e.length;for(;f>0&&h>0&&s.charCodeAt(f-1)==e.charCodeAt(h-1);)f--,h--;if(r=="end"){let g=Math.max(0,u-Math.min(f,h));t-=f+g-u}if(f<u&&s.length<e.length){let g=t<=u&&t>=f?u-t:0;u-=g,h=u+(h-f),f=u}else if(h<u){let g=t<=u&&t>=h?u-t:0;u-=g,f=u+(f-h),h=u}return{from:u,toA:f,toB:h}}function fEe(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:a,focusOffset:u}=s.observer.selectionRange;return t&&(e.push(new rue(t,r)),(a!=t||u!=r)&&e.push(new rue(a,u))),e}function dEe(s,e){if(s.length==0)return null;let t=s[0].pos,r=s.length==2?s[1].pos:t;return t>-1&&r>-1?qn.single(t+e,r+e):null}const hEe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Rte=Fs.ie&&Fs.ie_version<=11;class mEe{constructor(e){this.view=e,this.active=!1,this.selectionRange=new XSe,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(Fs.ie&&Fs.ie_version<=11||Fs.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),Rte&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM),this.resizeContent=new ResizeObserver(()=>this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,a=this.selectionRange;if(r.state.facet(GV)?r.root.activeElement!=this.dom:!Iz(r.dom,a))return;let u=a.anchorNode&&r.docView.nearest(a.anchorNode);if(u&&u.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Fs.ie&&Fs.ie_version<=11||Fs.android&&Fs.chrome)&&!r.state.selection.main.empty&&a.focusNode&&lV(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Fs.safari&&e.root.nodeType==11&&qSe(this.dom.ownerDocument)==this.dom&&gEe(this.view)||aV(e.root);if(!t||this.selectionRange.eq(t))return!1;let r=Iz(this.dom,t);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&QSe(this.dom,t)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(t),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,hEe),Rte&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){!this.active||(this.active=!1,this.observer.disconnect(),Rte&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let a=()=>{let u=this.delayedAndroidKey;u&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=u.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&u.force&&QD(this.dom,u.key,u.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(a)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,a=!1;for(let u of e){let f=this.readMutation(u);!f||(f.typeOver&&(a=!0),t==-1?{from:t,to:r}=f:(t=Math.min(f.from,t),r=Math.max(f.to,r)))}return{from:t,to:r,typeOver:a}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),a=this.selectionChanged&&Iz(this.dom,this.selectionRange);if(e<0&&!a)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let u=new lEe(this.view,e,t,r);return this.view.docView.domChanged={newSel:u.newSel?u.newSel.main:null},u}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let r=this.view.state,a=bge(this.view,t);return this.view.state==r&&this.view.update([]),a}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=iue(t,e.previousSibling||e.target.previousSibling,-1),a=iue(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:a?t.posBefore(a):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,r,a;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect(),(a=this.resizeContent)===null||a===void 0||a.disconnect();for(let u of this.scrollTargets)u.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function iue(s,e,t){for(;e;){let r=Tc.get(e);if(r&&r.parent==s)return r;let a=e.parentNode;e=a!=s.dom?a:t>0?e.nextSibling:e.previousSibling}return null}function gEe(s){let e=null;function t(g){g.preventDefault(),g.stopImmediatePropagation(),e=g.getTargetRanges()[0]}if(s.contentDOM.addEventListener("beforeinput",t,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let r=e.startContainer,a=e.startOffset,u=e.endContainer,f=e.endOffset,h=s.docView.domAtPos(s.state.selection.main.anchor);return lV(h.node,h.offset,u,f)&&([r,a,u,f]=[u,f,r,a]),{anchorNode:r,anchorOffset:a,focusNode:u,focusOffset:f}}class As{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(r=>r.forEach(a=>t(a,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||JSe(e.parent)||document,this.viewState=new nue(e.state||Ea.create(e)),this.plugins=this.state.facet(pP).map(r=>new Tte(r));for(let r of this.plugins)r.update(this);this.observer=new mEe(this),this.inputState=new Oke(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Fce(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof hd?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,a,u=this.state;for(let O of e){if(O.startState!=u)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");u=O.state}if(this.destroyed){this.viewState.state=u;return}let f=this.hasFocus,h=0,g=null;e.some(O=>O.annotation(uge))?(this.inputState.notifiedFocused=f,h=1):f!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=f,g=fge(u,f),g||(h=1));let y=this.observer.delayedAndroidKey,C=null;if(y?(this.observer.clearDelayedAndroidKey(),C=this.observer.readChange(),(C&&!this.state.doc.eq(u.doc)||!this.state.selection.eq(u.selection))&&(C=null)):this.observer.clear(),u.facet(Ea.phrases)!=this.state.facet(Ea.phrases))return this.setState(u);a=uV.create(this,u,e),a.flags|=h;let A=this.viewState.scrollTarget;try{this.updateState=2;for(let O of e){if(A&&(A=A.map(O.changes)),O.scrollIntoView){let{main:N}=O.state.selection;A=new cV(N.empty?N:qn.cursor(N.head,N.head>N.anchor?-1:1))}for(let N of O.effects)N.is(Bce)&&(A=N.value)}this.viewState.update(a,A),this.bidiCache=fV.update(this.bidiCache,a.changes),a.empty||(this.updatePlugins(a),this.inputState.update(a)),t=this.docView.update(a),this.state.facet(bP)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(O=>O.isUserEvent("select.pointer")))}finally{this.updateState=0}if(a.startState.facet(tz)!=a.state.facet(tz)&&(this.viewState.mustMeasureContent=!0),(t||r||A||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!a.empty)for(let O of this.state.facet(Vne))O(a);(g||C)&&Promise.resolve().then(()=>{g&&this.state==g.startState&&this.dispatch(g),C&&!bge(this,C)&&y.force&&QD(this.contentDOM,y.key,y.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new nue(e),this.plugins=e.facet(pP).map(r=>new Tte(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView=new Fce(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(pP),r=e.state.facet(pP);if(t!=r){let a=[];for(let u of r){let f=t.indexOf(u);if(f<0)a.push(new Tte(u));else{let h=this.plugins[f];h.mustUpdate=e,a.push(h)}}for(let u of this.plugins)u.mustUpdate!=e&&u.destroy(this);this.plugins=a,this.pluginMap.clear()}else for(let a of this.plugins)a.mustUpdate=e;for(let a=0;a<this.plugins.length;a++)this.plugins[a].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,a=r.scrollTop*this.scaleY,{scrollAnchorPos:u,scrollAnchorHeight:f}=this.viewState;Math.abs(a-this.viewState.scrollTop)>1&&(f=-1),this.viewState.scrollAnchorHeight=-1;try{for(let h=0;;h++){if(f<0)if(Tme(r))u=-1,f=this.viewState.heightMap.height;else{let N=this.viewState.scrollAnchorAt(a);u=N.from,f=N.top}this.updateState=1;let g=this.viewState.measure(this);if(!g&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(h>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let y=[];g&4||([this.measureRequests,y]=[y,this.measureRequests]);let C=y.map(N=>{try{return N.read(this)}catch(L){return R0(this.state,L),aue}}),A=uV.create(this,this.state,[]),O=!1;A.flags|=g,t?t.flags|=g:t=A,this.updateState=2,A.empty||(this.updatePlugins(A),this.inputState.update(A),this.updateAttrs(),O=this.docView.update(A));for(let N=0;N<y.length;N++)if(C[N]!=aue)try{let L=y[N];L.write&&L.write(C[N],this)}catch(L){R0(this.state,L)}if(O&&this.docView.updateSelection(!0),!A.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null;continue}else{let L=(u<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(u).top)-f;if(L>1||L<-1){a=a+L,r.scrollTop=a/this.scaleY,f=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let h of this.state.facet(Vne))h(t)}get themeClasses(){return Yne+" "+(this.state.facet(Kne)?gge:mge)+" "+this.state.facet(tz)}updateAttrs(){let e=lue(this,Zme,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(GV)?"true":"false",class:"cm-content",style:`${Fs.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),lue(this,zoe,t);let r=this.observer.ignore(()=>{let a=$ne(this.contentDOM,this.contentAttrs,t),u=$ne(this.dom,this.editorAttrs,e);return a||u});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let a of r.effects)if(a.is(As.announce)){t&&(this.announceDOM.textContent=""),t=!1;let u=this.announceDOM.appendChild(document.createElement("div"));u.textContent=a.value}}mountStyles(){this.styleModules=this.state.facet(bP);let e=this.state.facet(As.cspNonce);gk.mount(this.root,this.styleModules.concat(rEe).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return Ote(this,e,Wce(this,e,t,r))}moveByGroup(e,t){return Ote(this,e,Wce(this,e,t,r=>Tke(this,e.head,r)))}moveToLineBoundary(e,t,r=!0){return Ake(this,e,t,r)}moveVertically(e,t,r){return Ote(this,e,Dke(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),oge(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let a=this.state.doc.lineAt(e),u=this.bidiSpans(a),f=u[lk.find(u,e-a.from,-1,t)];return Foe(r,f.dir==mu.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Wme)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>pEe)return Qme(e.length);let t=this.textDirectionAt(e.from),r;for(let u of this.bidiCache)if(u.from==e.from&&u.dir==t&&(u.fresh||Jme(u.isolates,r=Lce(this,e.from,e.to))))return u.order;r||(r=Lce(this,e.from,e.to));let a=hke(e.text,t,r);return this.bidiCache.push(new fV(e.from,e.to,t,r,!0,a)),a}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Fs.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{xme(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Bce.of(new cV(typeof e=="number"?qn.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return gf.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return gf.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=gk.newName(),a=[tz.of(r),bP.of(Xne(`.${r}`,e))];return t&&t.dark&&a.push(Kne.of(!0)),a}static baseTheme(e){return yO.lowest(bP.of(Xne("."+Yne,e,pge)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),a=r&&Tc.get(r)||Tc.get(e);return((t=a==null?void 0:a.rootView)===null||t===void 0?void 0:t.view)||null}}As.styleModule=bP;As.inputHandler=Vme;As.focusChangeEffect=Ume;As.perLineTextDirection=Wme;As.exceptionSink=zme;As.updateListener=Vne;As.editable=GV;As.mouseSelectionStyle=$me;As.dragMovesSelection=Hme;As.clickAddsSelectionRange=Fme;As.decorations=UP;As.atomicRanges=Voe;As.bidiIsolatedRanges=qme;As.scrollMargins=Gme;As.darkTheme=Kne;As.cspNonce=Ds.define({combine:s=>s.length?s[0]:""});As.contentAttributes=zoe;As.editorAttributes=Zme;As.lineWrapping=As.contentAttributes.of({class:"cm-lineWrapping"});As.announce=Pi.define();const pEe=4096,aue={};class fV{constructor(e,t,r,a,u,f){this.from=e,this.to=t,this.dir=r,this.isolates=a,this.fresh=u,this.order=f}static update(e,t){if(t.empty&&!e.some(u=>u.fresh))return e;let r=[],a=e.length?e[e.length-1].dir:mu.LTR;for(let u=Math.max(0,e.length-10);u<e.length;u++){let f=e[u];f.dir==a&&!t.touchesRange(f.from,f.to)&&r.push(new fV(t.mapPos(f.from,1),t.mapPos(f.to,-1),f.dir,f.isolates,!1,f.order))}return r}}function lue(s,e,t){for(let r=s.state.facet(e),a=r.length-1;a>=0;a--){let u=r[a],f=typeof u=="function"?u(s):u;f&&Hne(f,t)}return t}const bEe=Fs.mac?"mac":Fs.windows?"win":Fs.linux?"linux":"key";function vEe(s,e){const t=s.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let a,u,f,h;for(let g=0;g<t.length-1;++g){const y=t[g];if(/^(cmd|meta|m)$/i.test(y))h=!0;else if(/^a(lt)?$/i.test(y))a=!0;else if(/^(c|ctrl|control)$/i.test(y))u=!0;else if(/^s(hift)?$/i.test(y))f=!0;else if(/^mod$/i.test(y))e=="mac"?h=!0:u=!0;else throw new Error("Unrecognized modifier name: "+y)}return a&&(r="Alt-"+r),u&&(r="Ctrl-"+r),h&&(r="Meta-"+r),f&&(r="Shift-"+r),r}function nz(s,e,t){return e.altKey&&(s="Alt-"+s),e.ctrlKey&&(s="Ctrl-"+s),e.metaKey&&(s="Meta-"+s),t!==!1&&e.shiftKey&&(s="Shift-"+s),s}const yEe=yO.default(As.domEventHandlers({keydown(s,e){return yge(vge(e.state),s,e,"editor")}})),KV=Ds.define({enables:yEe}),cue=new WeakMap;function vge(s){let e=s.facet(KV),t=cue.get(e);return t||cue.set(e,t=CEe(e.reduce((r,a)=>r.concat(a),[]))),t}function wEe(s,e,t){return yge(vge(s.state),e,s,t)}let sk=null;const _Ee=4e3;function CEe(s,e=bEe){let t=Object.create(null),r=Object.create(null),a=(f,h)=>{let g=r[f];if(g==null)r[f]=h;else if(g!=h)throw new Error("Key binding "+f+" is used both as a regular binding and as a multi-stroke prefix")},u=(f,h,g,y,C)=>{var A,O;let N=t[f]||(t[f]=Object.create(null)),L=h.split(/ (?!$)/).map(q=>vEe(q,e));for(let q=1;q<L.length;q++){let ee=L.slice(0,q).join(" ");a(ee,!0),N[ee]||(N[ee]={preventDefault:!0,stopPropagation:!1,run:[F=>{let ne=sk={view:F,prefix:ee,scope:f};return setTimeout(()=>{sk==ne&&(sk=null)},_Ee),!0}]})}let j=L.join(" ");a(j,!1);let z=N[j]||(N[j]={preventDefault:!1,stopPropagation:!1,run:((O=(A=N._any)===null||A===void 0?void 0:A.run)===null||O===void 0?void 0:O.slice())||[]});g&&z.run.push(g),y&&(z.preventDefault=!0),C&&(z.stopPropagation=!0)};for(let f of s){let h=f.scope?f.scope.split(" "):["editor"];if(f.any)for(let y of h){let C=t[y]||(t[y]=Object.create(null));C._any||(C._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let A in C)C[A].run.push(f.any)}let g=f[e]||f.key;if(!!g)for(let y of h)u(y,g,f.run,f.preventDefault,f.stopPropagation),f.shift&&u(y,"Shift-"+g,f.shift,f.preventDefault,f.stopPropagation)}return t}function yge(s,e,t,r){let a=ZSe(e),u=Lh(a,0),f=O0(u)==a.length&&a!=" ",h="",g=!1,y=!1,C=!1;sk&&sk.view==t&&sk.scope==r&&(h=sk.prefix+" ",rge.indexOf(e.keyCode)<0&&(y=!0,sk=null));let A=new Set,O=z=>{if(z){for(let q of z.run)if(!A.has(q)&&(A.add(q),q(t,e)))return z.stopPropagation&&(C=!0),!0;z.preventDefault&&(z.stopPropagation&&(C=!0),y=!0)}return!1},N=s[r],L,j;return N&&(O(N[h+nz(a,e,!f)])?g=!0:f&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Fs.windows&&e.ctrlKey&&e.altKey)&&(L=pk[e.keyCode])&&L!=a?(O(N[h+nz(L,e,!0)])||e.shiftKey&&(j=$P[e.keyCode])!=a&&j!=L&&O(N[h+nz(j,e,!1)]))&&(g=!0):f&&e.shiftKey&&O(N[h+nz(a,e,!0)])&&(g=!0),!g&&O(N._any)&&(g=!0)),y&&(g=!0),g&&C&&e.stopPropagation(),g}class hI{constructor(e,t,r,a,u){this.className=e,this.left=t,this.top=r,this.width=a,this.height=u}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let a=e.coordsAtPos(r.head,r.assoc||1);if(!a)return[];let u=wge(e);return[new hI(t,a.left-u.left,a.top-u.top,null,a.bottom-a.top)]}else return SEe(e,t,r)}}function wge(s){let e=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==mu.LTR?e.left:e.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:e.top-s.scrollDOM.scrollTop*s.scaleY}}function uue(s,e,t){let r=qn.cursor(e);return{from:Math.max(t.from,s.moveToLineBoundary(r,!1,!0).from),to:Math.min(t.to,s.moveToLineBoundary(r,!0,!0).from),type:Ag.Text}}function SEe(s,e,t){if(t.to<=s.viewport.from||t.from>=s.viewport.to)return[];let r=Math.max(t.from,s.viewport.from),a=Math.min(t.to,s.viewport.to),u=s.textDirection==mu.LTR,f=s.contentDOM,h=f.getBoundingClientRect(),g=wge(s),y=f.querySelector(".cm-line"),C=y&&window.getComputedStyle(y),A=h.left+(C?parseInt(C.paddingLeft)+Math.min(0,parseInt(C.textIndent)):0),O=h.right-(C?parseInt(C.paddingRight):0),N=qne(s,r),L=qne(s,a),j=N.type==Ag.Text?N:null,z=L.type==Ag.Text?L:null;if(j&&(s.lineWrapping||N.widgetLineBreaks)&&(j=uue(s,r,j)),z&&(s.lineWrapping||L.widgetLineBreaks)&&(z=uue(s,a,z)),j&&z&&j.from==z.from)return ee(F(t.from,t.to,j));{let oe=j?F(t.from,null,j):ne(N,!1),re=z?F(null,t.to,z):ne(L,!0),J=[];return(j||N).to<(z||L).from-(j&&z?1:0)||N.widgetLineBreaks>1&&oe.bottom+s.defaultLineHeight/2<re.top?J.push(q(A,oe.bottom,O,re.top)):oe.bottom<re.top&&s.elementAtHeight((oe.bottom+re.top)/2).type==Ag.Text&&(oe.bottom=re.top=(oe.bottom+re.top)/2),ee(oe).concat(J).concat(ee(re))}function q(oe,re,J,we){return new hI(e,oe-g.left,re-g.top-.01,J-oe,we-re+.01)}function ee({top:oe,bottom:re,horizontal:J}){let we=[];for(let ye=0;ye<J.length;ye+=2)we.push(q(J[ye],oe,J[ye+1],re));return we}function F(oe,re,J){let we=1e9,ye=-1e9,De=[];function _e(Qe,ft,V,mt,nt){let Ot=s.coordsAtPos(Qe,Qe==J.to?-2:2),Tt=s.coordsAtPos(V,V==J.from?2:-2);!Ot||!Tt||(we=Math.min(Ot.top,Tt.top,we),ye=Math.max(Ot.bottom,Tt.bottom,ye),nt==mu.LTR?De.push(u&&ft?A:Ot.left,u&&mt?O:Tt.right):De.push(!u&&mt?A:Tt.left,!u&&ft?O:Ot.right))}let be=oe!=null?oe:J.from,tt=re!=null?re:J.to;for(let Qe of s.visibleRanges)if(Qe.to>be&&Qe.from<tt)for(let ft=Math.max(Qe.from,be),V=Math.min(Qe.to,tt);;){let mt=s.state.doc.lineAt(ft);for(let nt of s.bidiSpans(mt)){let Ot=nt.from+mt.from,Tt=nt.to+mt.from;if(Ot>=V)break;Tt>ft&&_e(Math.max(Ot,ft),oe==null&&Ot<=be,Math.min(Tt,V),re==null&&Tt>=tt,nt.dir)}if(ft=mt.to+1,ft>=V)break}return De.length==0&&_e(be,oe==null,tt,re==null,s.textDirection),{top:we,bottom:ye,horizontal:De}}function ne(oe,re){let J=h.top+(re?oe.top:oe.bottom);return{top:J,bottom:J,horizontal:[]}}}function kEe(s,e){return s.constructor==e.constructor&&s.eq(e)}class EEe{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Fz)!=e.state.facet(Fz)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,r=e.facet(Fz);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!kEe(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let a of e)a.update&&t&&a.constructor&&this.drawn[r].constructor&&a.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(a.draw(),t);for(;t;){let a=t.nextSibling;t.remove(),t=a}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Fz=Ds.define();function _ge(s){return[gf.define(e=>new EEe(e,s)),Fz.of(s)]}const Cge=!Fs.ios,jP=Ds.define({combine(s){return gv(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function xEe(s={}){return[jP.of(s),AEe,TEe,DEe,jme.of(!0)]}function Sge(s){return s.startState.facet(jP)!=s.state.facet(jP)}const AEe=_ge({above:!0,markers(s){let{state:e}=s,t=e.facet(jP),r=[];for(let a of e.selection.ranges){let u=a==e.selection.main;if(a.empty?!u||Cge:t.drawRangeCursor){let f=u?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",h=a.empty?a:qn.cursor(a.head,a.head>a.anchor?-1:1);for(let g of hI.forRange(s,f,h))r.push(g)}}return r},update(s,e){s.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Sge(s);return t&&fue(s.state,e),s.docChanged||s.selectionSet||t},mount(s,e){fue(e.state,s)},class:"cm-cursorLayer"});function fue(s,e){e.style.animationDuration=s.facet(jP).cursorBlinkRate+"ms"}const TEe=_ge({above:!1,markers(s){return s.state.selection.ranges.map(e=>e.empty?[]:hI.forRange(s,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(s,e){return s.docChanged||s.selectionSet||s.viewportChanged||Sge(s)},class:"cm-selectionLayer"}),kge={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Cge&&(kge[".cm-line"].caretColor="transparent !important");const DEe=yO.highest(As.theme(kge)),Ege=Pi.define({map(s,e){return s==null?null:e.mapPos(s)}}),wP=md.define({create(){return null},update(s,e){return s!=null&&(s=e.changes.mapPos(s)),e.effects.reduce((t,r)=>r.is(Ege)?r.value:t,s)}}),OEe=gf.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var e;let t=s.state.field(wP);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(wP)!=t||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,e=s.state.field(wP),t=e!=null&&s.coordsAtPos(e);if(!t)return null;let r=s.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+s.scrollDOM.scrollLeft*s.scaleX,top:t.top-r.top+s.scrollDOM.scrollTop*s.scaleY,height:t.bottom-t.top}}drawCursor(s){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;s?(this.cursor.style.left=s.left/e+"px",this.cursor.style.top=s.top/t+"px",this.cursor.style.height=s.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(wP)!=s&&this.view.dispatch({effects:Ege.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function MEe(){return[wP,OEe]}function due(s,e,t,r,a){e.lastIndex=0;for(let u=s.iterRange(t,r),f=t,h;!u.next().done;f+=u.value.length)if(!u.lineBreak)for(;h=e.exec(u.value);)a(f+h.index,h)}function REe(s,e){let t=s.visibleRanges;if(t.length==1&&t[0].from==s.viewport.from&&t[0].to==s.viewport.to)return t;let r=[];for(let{from:a,to:u}of t)a=Math.max(s.state.doc.lineAt(a).from,a-e),u=Math.min(s.state.doc.lineAt(u).to,u+e),r.length&&r[r.length-1].to>=a?r[r.length-1].to=u:r.push({from:a,to:u});return r}class NEe{constructor(e){const{regexp:t,decoration:r,decorate:a,boundary:u,maxLength:f=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,a)this.addMatch=(h,g,y,C)=>a(C,y,y+h[0].length,h,g);else if(typeof r=="function")this.addMatch=(h,g,y,C)=>{let A=r(h,g,y);A&&C(y,y+h[0].length,A)};else if(r)this.addMatch=(h,g,y,C)=>C(y,y+h[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=u,this.maxLength=f}createDeco(e){let t=new mk,r=t.add.bind(t);for(let{from:a,to:u}of REe(e,this.maxLength))due(e.state.doc,this.regexp,a,u,(f,h)=>this.addMatch(h,e,f,r));return t.finish()}updateDeco(e,t){let r=1e9,a=-1;return e.docChanged&&e.changes.iterChanges((u,f,h,g)=>{g>e.view.viewport.from&&h<e.view.viewport.to&&(r=Math.min(h,r),a=Math.max(g,a))}),e.viewportChanged||a-r>1e3?this.createDeco(e.view):a>-1?this.updateRange(e.view,t.map(e.changes),r,a):t}updateRange(e,t,r,a){for(let u of e.visibleRanges){let f=Math.max(u.from,r),h=Math.min(u.to,a);if(h>f){let g=e.state.doc.lineAt(f),y=g.to<h?e.state.doc.lineAt(h):g,C=Math.max(u.from,g.from),A=Math.min(u.to,y.to);if(this.boundary){for(;f>g.from;f--)if(this.boundary.test(g.text[f-1-g.from])){C=f;break}for(;h<y.to;h++)if(this.boundary.test(y.text[h-y.from])){A=h;break}}let O=[],N,L=(j,z,q)=>O.push(q.range(j,z));if(g==y)for(this.regexp.lastIndex=C-g.from;(N=this.regexp.exec(g.text))&&N.index<A-g.from;)this.addMatch(N,e,N.index+g.from,L);else due(e.state.doc,this.regexp,C,A,(j,z)=>this.addMatch(z,e,j,L));t=t.update({filterFrom:C,filterTo:A,filter:(j,z)=>j<C||z>A,add:O})}}return t}}const Jne=/x/.unicode!=null?"gu":"g",PEe=new RegExp(`[\0-\b
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Jne),IEe={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Nte=null;function BEe(){var s;if(Nte==null&&typeof document<"u"&&document.body){let e=document.body.style;Nte=((s=e.tabSize)!==null&&s!==void 0?s:e.MozTabSize)!=null}return Nte||!1}const Hz=Ds.define({combine(s){let e=gv(s,{render:null,specialChars:PEe,addSpecialChars:null});return(e.replaceTabs=!BEe())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Jne)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Jne)),e}});function LEe(s={}){return[Hz.of(s),FEe()]}let hue=null;function FEe(){return hue||(hue=gf.fromClass(class{constructor(s){this.view=s,this.decorations=ti.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(Hz)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new NEe({regexp:s.specialChars,decoration:(e,t,r)=>{let{doc:a}=t.state,u=Lh(e[0],0);if(u==9){let f=a.lineAt(r),h=t.state.tabSize,g=wO(f.text,h,r-f.from);return ti.replace({widget:new VEe((h-g%h)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[u]||(this.decorationCache[u]=ti.replace({widget:new zEe(s,u)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let e=s.state.facet(Hz);s.startState.facet(Hz)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const HEe="\u2022";function $Ee(s){return s>=32?HEe:s==10?"\u2424":String.fromCharCode(9216+s)}class zEe extends Sk{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=$Ee(this.code),r=e.state.phrase("Control character")+" "+(IEe[this.code]||"0x"+this.code.toString(16)),a=this.options.render&&this.options.render(this.code,r,t);if(a)return a;let u=document.createElement("span");return u.textContent=t,u.title=r,u.setAttribute("aria-label",r),u.className="cm-specialChar",u}ignoreEvent(){return!1}}class VEe extends Sk{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function UEe(){return jEe}const WEe=ti.line({class:"cm-activeLine"}),jEe=gf.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=-1,t=[];for(let r of s.state.selection.ranges){let a=s.lineBlockAt(r.head);a.from>e&&(t.push(WEe.range(a.from)),e=a.from)}return ti.set(t)}},{decorations:s=>s.decorations}),Qne=2e3;function ZEe(s,e,t){let r=Math.min(e.line,t.line),a=Math.max(e.line,t.line),u=[];if(e.off>Qne||t.off>Qne||e.col<0||t.col<0){let f=Math.min(e.off,t.off),h=Math.max(e.off,t.off);for(let g=r;g<=a;g++){let y=s.doc.line(g);y.length<=h&&u.push(qn.range(y.from+f,y.to+h))}}else{let f=Math.min(e.col,t.col),h=Math.max(e.col,t.col);for(let g=r;g<=a;g++){let y=s.doc.line(g),C=Rne(y.text,f,s.tabSize,!0);if(C<0)u.push(qn.cursor(y.to));else{let A=Rne(y.text,h,s.tabSize);u.push(qn.range(y.from+C,y.from+A))}}}return u}function qEe(s,e){let t=s.coordsAtPos(s.viewport.from);return t?Math.round(Math.abs((t.left-e)/s.defaultCharacterWidth)):-1}function mue(s,e){let t=s.posAtCoords({x:e.clientX,y:e.clientY},!1),r=s.state.doc.lineAt(t),a=t-r.from,u=a>Qne?-1:a==r.length?qEe(s,e.clientX):wO(r.text,s.state.tabSize,t-r.from);return{line:r.number,col:u,off:a}}function GEe(s,e){let t=mue(s,e),r=s.state.selection;return t?{update(a){if(a.docChanged){let u=a.changes.mapPos(a.startState.doc.line(t.line).from),f=a.state.doc.lineAt(u);t={line:f.number,col:t.col,off:Math.min(t.off,f.length)},r=r.map(a.changes)}},get(a,u,f){let h=mue(s,a);if(!h)return r;let g=ZEe(s.state,t,h);return g.length?f?qn.create(g.concat(r.ranges)):qn.create(g):r}}:null}function KEe(s){let e=(s==null?void 0:s.eventFilter)||(t=>t.altKey&&t.button==0);return As.mouseSelectionStyle.of((t,r)=>e(r)?GEe(t,r):null)}const YEe={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},XEe={style:"cursor: crosshair"};function JEe(s={}){let[e,t]=YEe[s.key||"Alt"],r=gf.fromClass(class{constructor(a){this.view=a,this.isDown=!1}set(a){this.isDown!=a&&(this.isDown=a,this.view.update([]))}},{eventObservers:{keydown(a){this.set(a.keyCode==e||t(a))},keyup(a){(a.keyCode==e||!t(a))&&this.set(!1)},mousemove(a){this.set(t(a))}}});return[r,As.contentAttributes.of(a=>{var u;return!((u=a.plugin(r))===null||u===void 0)&&u.isDown?XEe:null})]}const oz="-10000px";class xge{constructor(e,t,r){this.facet=t,this.createTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(a=>a),this.tooltipViews=this.tooltips.map(r)}update(e){var t;let r=e.state.facet(this.facet),a=r.filter(f=>f);if(r===this.input){for(let f of this.tooltipViews)f.update&&f.update(e);return!1}let u=[];for(let f=0;f<a.length;f++){let h=a[f],g=-1;if(!!h){for(let y=0;y<this.tooltips.length;y++){let C=this.tooltips[y];C&&C.create==h.create&&(g=y)}if(g<0)u[f]=this.createTooltipView(h);else{let y=u[f]=this.tooltipViews[g];y.update&&y.update(e)}}}for(let f of this.tooltipViews)u.indexOf(f)<0&&(f.dom.remove(),(t=f.destroy)===null||t===void 0||t.call(f));return this.input=r,this.tooltips=a,this.tooltipViews=u,!0}}function QEe(s){let{win:e}=s;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Pte=Ds.define({combine:s=>{var e,t,r;return{position:Fs.ios?"absolute":((e=s.find(a=>a.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=s.find(a=>a.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=s.find(a=>a.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||QEe}}}),gue=new WeakMap,Age=gf.fromClass(class{constructor(s){this.view=s,this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=s.state.facet(Pte);this.position=e.position,this.parent=e.parent,this.classes=s.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new xge(s,YV,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(s);e&&this.observeIntersection();let t=e||s.geometryChanged,r=s.state.facet(Pte);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let a of this.manager.tooltipViews)a.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let a of this.manager.tooltipViews)this.container.appendChild(a.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(s){let e=s.create(this.view);if(e.dom.classList.add("cm-tooltip"),s.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=oz,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var s,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(s=t.destroy)===null||s===void 0||s.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect(),e=1,t=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{offsetParent:a}=this.manager.tooltipViews[0].dom;r=!!(a&&a!=this.container.ownerDocument.body)}if(r||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(e=a.width/this.parent.offsetWidth,t=a.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((a,u)=>{let f=this.manager.tooltipViews[u];return f.getCoords?f.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(Pte).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:r}}writeMeasure(s){var e;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let h of this.manager.tooltipViews)h.dom.style.position="absolute"}let{editor:t,space:r,scaleX:a,scaleY:u}=s,f=[];for(let h=0;h<this.manager.tooltips.length;h++){let g=this.manager.tooltips[h],y=this.manager.tooltipViews[h],{dom:C}=y,A=s.pos[h],O=s.size[h];if(!A||A.bottom<=Math.max(t.top,r.top)||A.top>=Math.min(t.bottom,r.bottom)||A.right<Math.max(t.left,r.left)-.1||A.left>Math.min(t.right,r.right)+.1){C.style.top=oz;continue}let N=g.arrow?y.dom.querySelector(".cm-tooltip-arrow"):null,L=N?7:0,j=O.right-O.left,z=(e=gue.get(y))!==null&&e!==void 0?e:O.bottom-O.top,q=y.offset||txe,ee=this.view.textDirection==mu.LTR,F=O.width>r.right-r.left?ee?r.left:r.right-O.width:ee?Math.min(A.left-(N?14:0)+q.x,r.right-j):Math.max(r.left,A.left-j+(N?14:0)-q.x),ne=!!g.above;!g.strictSide&&(ne?A.top-(O.bottom-O.top)-q.y<r.top:A.bottom+(O.bottom-O.top)+q.y>r.bottom)&&ne==r.bottom-A.bottom>A.top-r.top&&(ne=!ne);let oe=(ne?A.top-r.top:r.bottom-A.bottom)-L;if(oe<z&&y.resize!==!1){if(oe<this.view.defaultLineHeight){C.style.top=oz;continue}gue.set(y,z),C.style.height=(z=oe)/u+"px"}else C.style.height&&(C.style.height="");let re=ne?A.top-z-L-q.y:A.bottom+L+q.y,J=F+j;if(y.overlap!==!0)for(let we of f)we.left<J&&we.right>F&&we.top<re+z&&we.bottom>re&&(re=ne?we.top-z-2-L:we.bottom+L+2);if(this.position=="absolute"?(C.style.top=(re-s.parent.top)/u+"px",C.style.left=(F-s.parent.left)/a+"px"):(C.style.top=re/u+"px",C.style.left=F/a+"px"),N){let we=A.left+(ee?q.x:-q.x)-(F+14-7);N.style.left=we/a+"px"}y.overlap!==!0&&f.push({left:F,top:re,right:J,bottom:re+z}),C.classList.toggle("cm-tooltip-above",ne),C.classList.toggle("cm-tooltip-below",!ne),y.positioned&&y.positioned(s.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let s of this.manager.tooltipViews)s.dom.style.top=oz}},{eventObservers:{scroll(){this.maybeMeasure()}}}),exe=As.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),txe={x:0,y:0},YV=Ds.define({enables:[Age,exe]}),dV=Ds.define();class Woe{static create(e){return new Woe(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new xge(e,dV,t=>this.createHostedView(t))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}}const nxe=YV.compute([dV],s=>{let e=s.facet(dV).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Woe.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class oxe{constructor(e,t,r,a,u){this.view=e,this.source=t,this.field=r,this.setHover=a,this.hoverTime=u,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,r=e.docView.nearest(t.target);if(!r)return;let a,u=1;if(r instanceof ak)a=r.posAtStart;else{if(a=e.posAtCoords(t),a==null)return;let h=e.coordsAtPos(a);if(!h||t.y<h.top||t.y>h.bottom||t.x<h.left-e.defaultCharacterWidth||t.x>h.right+e.defaultCharacterWidth)return;let g=e.bidiSpans(e.state.doc.lineAt(a)).find(C=>C.from<=a&&C.to>=a),y=g&&g.dir==mu.RTL?-1:1;u=t.x<h.left?-y:y}let f=this.source(e,a,u);if(f!=null&&f.then){let h=this.pending={pos:a};f.then(g=>{this.pending==h&&(this.pending=null,g&&e.dispatch({effects:this.setHover.of(g)}))},g=>R0(e.state,g,"hover tooltip"))}else f&&e.dispatch({effects:this.setHover.of(f)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let r=this.active;if(r&&!pue(this.lastMove.target)||this.pending){let{pos:a}=r||this.pending,u=(t=r==null?void 0:r.end)!==null&&t!==void 0?t:a;(a==u?this.view.posAtCoords(this.lastMove)!=a:!sxe(this.view,a,u,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!pue(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function pue(s){for(let e=s;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function sxe(s,e,t,r,a,u){let f=s.scrollDOM.getBoundingClientRect(),h=s.documentTop+s.documentPadding.top+s.contentHeight;if(f.left>r||f.right<r||f.top>a||Math.min(f.bottom,h)<a)return!1;let g=s.posAtCoords({x:r,y:a},!1);return g>=e&&g<=t}function rxe(s,e={}){let t=Pi.define(),r=md.define({create(){return null},update(a,u){if(a&&(e.hideOnChange&&(u.docChanged||u.selection)||e.hideOn&&e.hideOn(u,a)))return null;if(a&&u.docChanged){let f=u.changes.mapPos(a.pos,-1,xg.TrackDel);if(f==null)return null;let h=Object.assign(Object.create(null),a);h.pos=f,a.end!=null&&(h.end=u.changes.mapPos(a.end)),a=h}for(let f of u.effects)f.is(t)&&(a=f.value),f.is(ixe)&&(a=null);return a},provide:a=>dV.from(a)});return[r,gf.define(a=>new oxe(a,s,r,t,e.hoverTime||300)),nxe]}function Tge(s,e){let t=s.plugin(Age);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const ixe=Pi.define(),bue=Ds.define({combine(s){let e,t;for(let r of s)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ZP(s,e){let t=s.plugin(Dge),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const Dge=gf.fromClass(class{constructor(s){this.input=s.state.facet(qP),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(bue);this.top=new sz(s,!0,e.topContainer),this.bottom=new sz(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(bue);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new sz(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new sz(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(qP);if(t!=this.input){let r=t.filter(g=>g),a=[],u=[],f=[],h=[];for(let g of r){let y=this.specs.indexOf(g),C;y<0?(C=g(s.view),h.push(C)):(C=this.panels[y],C.update&&C.update(s)),a.push(C),(C.top?u:f).push(C)}this.specs=r,this.panels=a,this.top.sync(u),this.bottom.sync(f);for(let g of h)g.dom.classList.add("cm-panel"),g.mount&&g.mount()}else for(let r of this.panels)r.update&&r.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>As.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class sz{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=vue(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=vue(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function vue(s){let e=s.nextSibling;return s.remove(),e}const qP=Ds.define({enables:Dge});class l2 extends GA{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}l2.prototype.elementClass="";l2.prototype.toDOM=void 0;l2.prototype.mapMode=xg.TrackBefore;l2.prototype.startSide=l2.prototype.endSide=-1;l2.prototype.point=!0;const $z=Ds.define(),axe={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ya.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},MP=Ds.define();function Oge(s){return[Mge(),MP.of(Object.assign(Object.assign({},axe),s))]}const eoe=Ds.define({combine:s=>s.some(e=>e)});function Mge(s){let e=[lxe];return s&&s.fixed===!1&&e.push(eoe.of(!0)),e}const lxe=gf.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=s.state.facet(MP).map(e=>new wue(s,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!s.state.facet(eoe),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(eoe)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&this.dom.remove();let t=Ya.iter(this.view.state.facet($z),this.view.viewport.from),r=[],a=this.gutters.map(u=>new cxe(u,this.view.viewport,-this.view.documentPadding.top));for(let u of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(u.type)){let f=!0;for(let h of u.type)if(h.type==Ag.Text&&f){toe(t,r,h.from);for(let g of a)g.line(this.view,h,r);f=!1}else if(h.widget)for(let g of a)g.widget(this.view,h)}else if(u.type==Ag.Text){toe(t,r,u.from);for(let f of a)f.line(this.view,u,r)}else if(u.widget)for(let f of a)f.widget(this.view,u);for(let u of a)u.finish();s&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(s){let e=s.startState.facet(MP),t=s.state.facet(MP),r=s.docChanged||s.heightChanged||s.viewportChanged||!Ya.eq(s.startState.facet($z),s.state.facet($z),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let a of this.gutters)a.update(s)&&(r=!0);else{r=!0;let a=[];for(let u of t){let f=e.indexOf(u);f<0?a.push(new wue(this.view,u)):(this.gutters[f].update(s),a.push(this.gutters[f]))}for(let u of this.gutters)u.dom.remove(),a.indexOf(u)<0&&u.destroy();for(let u of a)this.dom.appendChild(u.dom);this.gutters=a}return r}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>As.scrollMargins.of(e=>{let t=e.plugin(s);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==mu.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function yue(s){return Array.isArray(s)?s:[s]}function toe(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class cxe{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Ya.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:a}=this,u=(t.top-this.height)/e.scaleY,f=t.height/e.scaleY;if(this.i==a.elements.length){let h=new Rge(e,f,u,r);a.elements.push(h),a.dom.appendChild(h.dom)}else a.elements[this.i].update(e,f,u,r);this.height=t.bottom,this.i++}line(e,t,r){let a=[];toe(this.cursor,a,t.from),r.length&&(a=a.concat(r));let u=this.gutter.config.lineMarker(e,t,a);u&&a.unshift(u);let f=this.gutter;a.length==0&&!f.config.renderEmptyElements||this.addElement(e,t,a)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t);r&&this.addElement(e,t,[r])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class wue{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,a=>{let u=a.target,f;if(u!=this.dom&&this.dom.contains(u)){for(;u.parentNode!=this.dom;)u=u.parentNode;let g=u.getBoundingClientRect();f=(g.top+g.bottom)/2}else f=a.clientY;let h=e.lineBlockAtHeight(f-e.documentTop);t.domEventHandlers[r](e,h,a)&&a.preventDefault()});this.markers=yue(t.markers(e)),t.initialSpacer&&(this.spacer=new Rge(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=yue(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let a=this.config.updateSpacer(this.spacer.markers[0],e);a!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[a])}let r=e.view.viewport;return!Ya.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Rge{constructor(e,t,r,a){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,a)}update(e,t,r,a){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),uxe(this.markers,a)||this.setMarkers(e,a)}setMarkers(e,t){let r="cm-gutterElement",a=this.dom.firstChild;for(let u=0,f=0;;){let h=f,g=u<t.length?t[u++]:null,y=!1;if(g){let C=g.elementClass;C&&(r+=" "+C);for(let A=f;A<this.markers.length;A++)if(this.markers[A].compare(g)){h=A,y=!0;break}}else h=this.markers.length;for(;f<h;){let C=this.markers[f++];if(C.toDOM){C.destroy(a);let A=a.nextSibling;a.remove(),a=A}}if(!g)break;g.toDOM&&(y?a=a.nextSibling:this.dom.insertBefore(g.toDOM(e),a)),y&&f++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function uxe(s,e){if(s.length!=e.length)return!1;for(let t=0;t<s.length;t++)if(!s[t].compare(e[t]))return!1;return!0}const fxe=Ds.define(),VD=Ds.define({combine(s){return gv(s,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let a in t){let u=r[a],f=t[a];r[a]=u?(h,g,y)=>u(h,g,y)||f(h,g,y):f}return r}})}});class Ite extends l2{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Bte(s,e){return s.state.facet(VD).formatNumber(e,s.state)}const dxe=MP.compute([VD],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(fxe)},lineMarker(e,t,r){return r.some(a=>a.toDOM)?null:new Ite(Bte(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(VD)!=e.state.facet(VD),initialSpacer(e){return new Ite(Bte(e,_ue(e.state.doc.lines)))},updateSpacer(e,t){let r=Bte(t.view,_ue(t.view.state.doc.lines));return r==e.number?e:new Ite(r)},domEventHandlers:s.facet(VD).domEventHandlers}));function hxe(s={}){return[VD.of(s),Mge(),dxe]}function _ue(s){let e=9;for(;e<s;)e=e*10+9;return e}const mxe=new class extends l2{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},gxe=$z.compute(["selection"],s=>{let e=[],t=-1;for(let r of s.selection.ranges){let a=s.doc.lineAt(r.head).from;a>t&&(t=a,e.push(mxe.range(a)))}return Ya.of(e)});function pxe(){return gxe}const Nge=1024;let bxe=0;class Lte{constructor(e,t){this.from=e,this.to=t}}class ca{constructor(e={}){this.id=bxe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Np.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}ca.closedBy=new ca({deserialize:s=>s.split(" ")});ca.openedBy=new ca({deserialize:s=>s.split(" ")});ca.group=new ca({deserialize:s=>s.split(" ")});ca.contextHash=new ca({perNode:!0});ca.lookAhead=new ca({perNode:!0});ca.mounted=new ca({perNode:!0});class hV{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[ca.mounted.id]}}const vxe=Object.create(null);class Np{constructor(e,t,r,a=0){this.name=e,this.props=t,this.id=r,this.flags=a}static define(e){let t=e.props&&e.props.length?Object.create(null):vxe,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),a=new Np(e.name||"",t,e.id,r);if(e.props){for(let u of e.props)if(Array.isArray(u)||(u=u(a)),u){if(u[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[u[0].id]=u[1]}}return a}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ca.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let a of r.split(" "))t[a]=e[r];return r=>{for(let a=r.prop(ca.group),u=-1;u<(a?a.length:0);u++){let f=t[u<0?r.name:a[u]];if(f)return f}}}}Np.none=new Np("",Object.create(null),0,8);class joe{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let a=null;for(let u of e){let f=u(r);f&&(a||(a=Object.assign({},r.props)),a[f[0].id]=f[1])}t.push(a?new Np(r.name,a,r.id,r.flags):r)}return new joe(t)}}const rz=new WeakMap,Cue=new WeakMap;var Wd;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays"})(Wd||(Wd={}));class Bf{constructor(e,t,r,a,u){if(this.type=e,this.children=t,this.positions=r,this.length=a,this.props=null,u&&u.length){this.props=Object.create(null);for(let[f,h]of u)this.props[typeof f=="number"?f:f.id]=h}}toString(){let e=hV.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let a=r.toString();a&&(t&&(t+=","),t+=a)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new ooe(this.topNode,e)}cursorAt(e,t=0,r=0){let a=rz.get(this)||this.topNode,u=new ooe(a);return u.moveTo(e,t),rz.set(this,u._tree),u}get topNode(){return new P0(this,0,0,null)}resolve(e,t=0){let r=GP(rz.get(this)||this.topNode,e,t,!1);return rz.set(this,r),r}resolveInner(e,t=0){let r=GP(Cue.get(this)||this.topNode,e,t,!0);return Cue.set(this,r),r}resolveStack(e,t=0){return _xe(this,e,t)}iterate(e){let{enter:t,leave:r,from:a=0,to:u=this.length}=e,f=e.mode||0,h=(f&Wd.IncludeAnonymous)>0;for(let g=this.cursor(f|Wd.IncludeAnonymous);;){let y=!1;if(g.from<=u&&g.to>=a&&(!h&&g.type.isAnonymous||t(g)!==!1)){if(g.firstChild())continue;y=!0}for(;y&&r&&(h||!g.type.isAnonymous)&&r(g),!g.nextSibling();){if(!g.parent())return;y=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Goe(Np.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,a)=>new Bf(this.type,t,r,a,this.propValues),e.makeTree||((t,r,a)=>new Bf(Np.none,t,r,a)))}static build(e){return Cxe(e)}}Bf.empty=new Bf(Np.none,[],[],0);class Zoe{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Zoe(this.buffer,this.index)}}class QA{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Np.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],a=this.set.types[t],u=a.name;if(/\W/.test(u)&&!a.isError&&(u=JSON.stringify(u)),e+=4,r==e)return u;let f=[];for(;e<r;)f.push(this.childString(e)),e=this.buffer[e+3];return u+"("+f.join(",")+")"}findChild(e,t,r,a,u){let{buffer:f}=this,h=-1;for(let g=e;g!=t&&!(Pge(u,a,f[g+1],f[g+2])&&(h=g,r>0));g=f[g+3]);return h}slice(e,t,r){let a=this.buffer,u=new Uint16Array(t-e),f=0;for(let h=e,g=0;h<t;){u[g++]=a[h++],u[g++]=a[h++]-r;let y=u[g++]=a[h++]-r;u[g++]=a[h++]-e,f=Math.max(f,y)}return new QA(u,f,this.set)}}function Pge(s,e,t,r){switch(s){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function GP(s,e,t,r){for(var a;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to<e);){let f=!r&&s instanceof P0&&s.index<0?null:s.parent;if(!f)return s;s=f}let u=r?0:Wd.IgnoreOverlays;if(r)for(let f=s,h=f.parent;h;f=h,h=f.parent)f instanceof P0&&f.index<0&&((a=h.enter(e,t,u))===null||a===void 0?void 0:a.from)!=f.from&&(s=h);for(;;){let f=s.enter(e,t,u);if(!f)return s;s=f}}class Ige{cursor(e=0){return new ooe(this,e)}getChild(e,t=null,r=null){let a=Sue(this,e,t,r);return a.length?a[0]:null}getChildren(e,t=null,r=null){return Sue(this,e,t,r)}resolve(e,t=0){return GP(this,e,t,!1)}resolveInner(e,t=0){return GP(this,e,t,!0)}matchContext(e){return noe(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let a=t.lastChild;if(!a||a.to!=t.to)break;a.type.isError&&a.from==a.to?(r=t,t=a.prevSibling):t=a}return r}get node(){return this}get next(){return this.parent}}class P0 extends Ige{constructor(e,t,r,a){super(),this._tree=e,this.from=t,this.index=r,this._parent=a}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,a,u=0){for(let f=this;;){for(let{children:h,positions:g}=f._tree,y=t>0?h.length:-1;e!=y;e+=t){let C=h[e],A=g[e]+f.from;if(!!Pge(a,r,A,A+C.length)){if(C instanceof QA){if(u&Wd.ExcludeBuffers)continue;let O=C.findChild(0,C.buffer.length,t,r-A,a);if(O>-1)return new ck(new yxe(f,C,e,A),null,O)}else if(u&Wd.IncludeAnonymous||!C.type.isAnonymous||qoe(C)){let O;if(!(u&Wd.IgnoreMounts)&&(O=hV.get(C))&&!O.overlay)return new P0(O.tree,A,e,f);let N=new P0(C,A,e,f);return u&Wd.IncludeAnonymous||!N.type.isAnonymous?N:N.nextChild(t<0?C.children.length-1:0,t,r,a)}}}if(u&Wd.IncludeAnonymous||!f.type.isAnonymous||(f.index>=0?e=f.index+t:e=t<0?-1:f._parent._tree.children.length,f=f._parent,!f))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let a;if(!(r&Wd.IgnoreOverlays)&&(a=hV.get(this._tree))&&a.overlay){let u=e-this.from;for(let{from:f,to:h}of a.overlay)if((t>0?f<=u:f<u)&&(t<0?h>=u:h>u))return new P0(a.tree,a.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Sue(s,e,t,r){let a=s.cursor(),u=[];if(!a.firstChild())return u;if(t!=null){for(;!a.type.is(t);)if(!a.nextSibling())return u}for(;;){if(r!=null&&a.type.is(r))return u;if(a.type.is(e)&&u.push(a.node),!a.nextSibling())return r==null?u:[]}}function noe(s,e,t=e.length-1){for(let r=s.parent;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class yxe{constructor(e,t,r,a){this.parent=e,this.buffer=t,this.index=r,this.start=a}}class ck extends Ige{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:a}=this.context,u=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.context.start,r);return u<0?null:new ck(this.context,this,u)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&Wd.ExcludeBuffers)return null;let{buffer:a}=this.context,u=a.findChild(this.index+4,a.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return u<0?null:new ck(this.context,this,u)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ck(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ck(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,a=this.index+4,u=r.buffer[this.index+3];if(u>a){let f=r.buffer[this.index+1];e.push(r.slice(a,u,f)),t.push(0)}return new Bf(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Bge(s){if(!s.length)return null;if(s.length==1)return s[0];let e=0,t=s[0];for(let u=1;u<s.length;u++){let f=s[u];(f.from>t.from||f.to<t.to)&&(t=f,e=u)}let r=t instanceof P0&&t.index<0?null:t.parent,a=s.slice();return r?a[e]=r:a.splice(e,1),new wxe(a,t)}class wxe{constructor(e,t){this.heads=e,this.node=t}get next(){return Bge(this.heads)}}function _xe(s,e,t){let r=s.resolveInner(e,t),a=null;for(let u=r instanceof P0?r:r.context.parent;u;u=u.parent)if(u.index<0){let f=u.parent;(a||(a=[r])).push(f.resolve(e,t)),u=f}else{let f=hV.get(u.tree);if(f&&f.overlay&&f.overlay[0].from<=e&&f.overlay[f.overlay.length-1].to>=e){let h=new P0(f.tree,f.overlay[0].from+u.from,0,null);(a||(a=[r])).push(GP(h,e,t,!1))}}return a?Bge(a):r}class ooe{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof P0)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:a}=this.buffer;return this.type=t||a.set.types[a.buffer[e]],this.from=r+a.buffer[e+1],this.to=r+a.buffer[e+2],!0}yield(e){return e?e instanceof P0?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:a}=this.buffer,u=a.findChild(this.index+4,a.buffer[this.index+3],e,t-this.buffer.start,r);return u<0?!1:(this.stack.push(this.index),this.yieldBuf(u))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&Wd.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Wd.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Wd.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let a=r<0?0:this.stack[r]+4;if(this.index!=a)return this.yieldBuf(t.findChild(a,this.index,-1,0,4))}else{let a=t.buffer[this.index+3];if(a<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(a)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:a}=this;if(a){if(e>0){if(this.index<a.buffer.buffer.length)return!1}else for(let u=0;u<this.index;u++)if(a.buffer.buffer[u+3]<this.index)return!1;({index:t,parent:r}=a)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let u=t+e,f=e<0?-1:r._tree.children.length;u!=f;u+=e){let h=r._tree.children[u];if(this.mode&Wd.IncludeAnonymous||h instanceof QA||!h.type.isAnonymous||qoe(h))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer){e:for(let a=this.index,u=this.stack.length;u>=0;){for(let f=e;f;f=f._parent)if(f.index==a){if(a==this.index)return f;t=f,r=u+1;break e}a=this.stack[--u]}}for(let a=r;a<this.stack.length;a++)t=new ck(this.buffer,t,this.stack[a]);return this.bufferNode=new ck(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let a=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(a=!0)}for(;a&&t&&t(this),a=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,a=!0}}}matchContext(e){if(!this.buffer)return noe(this.node,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let a=e.length-1,u=this.stack.length-1;a>=0;u--){if(u<0)return noe(this.node,e,a);let f=r[t.buffer[this.stack[u]]];if(!f.isAnonymous){if(e[a]&&e[a]!=f.name)return!1;a--}}return!0}}function qoe(s){return s.children.some(e=>e instanceof QA||!e.type.isAnonymous||qoe(e))}function Cxe(s){var e;let{buffer:t,nodeSet:r,maxBufferLength:a=Nge,reused:u=[],minRepeatType:f=r.types.length}=s,h=Array.isArray(t)?new Zoe(t,t.length):t,g=r.types,y=0,C=0;function A(ne,oe,re,J,we){let{id:ye,start:De,end:_e,size:be}=h,tt=C;for(;be<0;)if(h.next(),be==-1){let nt=u[ye];re.push(nt),J.push(De-ne);return}else if(be==-3){y=ye;return}else if(be==-4){C=ye;return}else throw new RangeError(`Unrecognized record size: ${be}`);let Qe=g[ye],ft,V,mt=De-ne;if(_e-De<=a&&(V=j(h.pos-oe,we))){let nt=new Uint16Array(V.size-V.skip),Ot=h.pos-V.size,Tt=nt.length;for(;h.pos>Ot;)Tt=z(V.start,nt,Tt);ft=new QA(nt,_e-V.start,r),mt=V.start-ne}else{let nt=h.pos-be;h.next();let Ot=[],Tt=[],He=ye>=f?ye:-1,ct=0,dn=_e;for(;h.pos>nt;)He>=0&&h.id==He&&h.size>=0?(h.end<=dn-a&&(N(Ot,Tt,De,ct,h.end,dn,He,tt),ct=Ot.length,dn=h.end),h.next()):A(De,nt,Ot,Tt,He);if(He>=0&&ct>0&&ct<Ot.length&&N(Ot,Tt,De,ct,De,dn,He,tt),Ot.reverse(),Tt.reverse(),He>-1&&ct>0){let kt=O(Qe);ft=Goe(Qe,Ot,Tt,0,Ot.length,0,_e-De,kt,kt)}else ft=L(Qe,Ot,Tt,_e-De,tt-_e)}re.push(ft),J.push(mt)}function O(ne){return(oe,re,J)=>{let we=0,ye=oe.length-1,De,_e;if(ye>=0&&(De=oe[ye])instanceof Bf){if(!ye&&De.type==ne&&De.length==J)return De;(_e=De.prop(ca.lookAhead))&&(we=re[ye]+De.length+_e)}return L(ne,oe,re,J,we)}}function N(ne,oe,re,J,we,ye,De,_e){let be=[],tt=[];for(;ne.length>J;)be.push(ne.pop()),tt.push(oe.pop()+re-we);ne.push(L(r.types[De],be,tt,ye-we,_e-ye)),oe.push(we-re)}function L(ne,oe,re,J,we=0,ye){if(y){let De=[ca.contextHash,y];ye=ye?[De].concat(ye):[De]}if(we>25){let De=[ca.lookAhead,we];ye=ye?[De].concat(ye):[De]}return new Bf(ne,oe,re,J,ye)}function j(ne,oe){let re=h.fork(),J=0,we=0,ye=0,De=re.end-a,_e={size:0,start:0,skip:0};e:for(let be=re.pos-ne;re.pos>be;){let tt=re.size;if(re.id==oe&&tt>=0){_e.size=J,_e.start=we,_e.skip=ye,ye+=4,J+=4,re.next();continue}let Qe=re.pos-tt;if(tt<0||Qe<be||re.start<De)break;let ft=re.id>=f?4:0,V=re.start;for(re.next();re.pos>Qe;){if(re.size<0)if(re.size==-3)ft+=4;else break e;else re.id>=f&&(ft+=4);re.next()}we=V,J+=tt,ye+=ft}return(oe<0||J==ne)&&(_e.size=J,_e.start=we,_e.skip=ye),_e.size>4?_e:void 0}function z(ne,oe,re){let{id:J,start:we,end:ye,size:De}=h;if(h.next(),De>=0&&J<f){let _e=re;if(De>4){let be=h.pos-(De-4);for(;h.pos>be;)re=z(ne,oe,re)}oe[--re]=_e,oe[--re]=ye-ne,oe[--re]=we-ne,oe[--re]=J}else De==-3?y=J:De==-4&&(C=J);return re}let q=[],ee=[];for(;h.pos>0;)A(s.start||0,s.bufferStart||0,q,ee,-1);let F=(e=s.length)!==null&&e!==void 0?e:q.length?ee[0]+q[0].length:0;return new Bf(g[s.topID],q.reverse(),ee.reverse(),F)}const kue=new WeakMap;function zz(s,e){if(!s.isAnonymous||e instanceof QA||e.type!=s)return 1;let t=kue.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=s||!(r instanceof Bf)){t=1;break}t+=zz(s,r)}kue.set(e,t)}return t}function Goe(s,e,t,r,a,u,f,h,g){let y=0;for(let L=r;L<a;L++)y+=zz(s,e[L]);let C=Math.ceil(y*1.5/8),A=[],O=[];function N(L,j,z,q,ee){for(let F=z;F<q;){let ne=F,oe=j[F],re=zz(s,L[F]);for(F++;F<q;F++){let J=zz(s,L[F]);if(re+J>=C)break;re+=J}if(F==ne+1){if(re>C){let J=L[ne];N(J.children,J.positions,0,J.children.length,j[ne]+ee);continue}A.push(L[ne])}else{let J=j[F-1]+L[F-1].length-oe;A.push(Goe(s,L,j,ne,F,oe,J,null,g))}O.push(oe+ee-u)}}return N(e,t,r,a,0),(h||g)(A,O,f)}class ZA{constructor(e,t,r,a,u=!1,f=!1){this.from=e,this.to=t,this.tree=r,this.offset=a,this.open=(u?1:0)|(f?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let a=[new ZA(0,e.length,e,0,!1,r)];for(let u of t)u.to>e.length&&a.push(u);return a}static applyChanges(e,t,r=128){if(!t.length)return e;let a=[],u=1,f=e.length?e[0]:null;for(let h=0,g=0,y=0;;h++){let C=h<t.length?t[h]:null,A=C?C.fromA:1e9;if(A-g>=r)for(;f&&f.from<A;){let O=f;if(g>=O.from||A<=O.to||y){let N=Math.max(O.from,g)-y,L=Math.min(O.to,A)-y;O=N>=L?null:new ZA(N,L,O.tree,O.offset+y,h>0,!!C)}if(O&&a.push(O),f.to>A)break;f=u<e.length?e[u++]:null}if(!C)break;g=C.toA,y=C.toA-C.toB}return a}}class Lge{startParse(e,t,r){return typeof e=="string"&&(e=new Sxe(e)),r=r?r.length?r.map(a=>new Lte(a.from,a.to)):[new Lte(0,0)]:[new Lte(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let a=this.startParse(e,t,r);for(;;){let u=a.advance();if(u)return u}}}class Sxe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new ca({perNode:!0});let kxe=0;class Ky{constructor(e,t,r){this.set=e,this.base=t,this.modified=r,this.id=kxe++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new Ky([],null,[]);if(t.set.push(t),e)for(let r of e.set)t.set.push(r);return t}static defineModifier(){let e=new mV;return t=>t.modified.indexOf(e)>-1?t:mV.get(t.base||t,t.modified.concat(e).sort((r,a)=>r.id-a.id))}}let Exe=0;class mV{constructor(){this.instances=[],this.id=Exe++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(h=>h.base==e&&xxe(t,h.modified));if(r)return r;let a=[],u=new Ky(a,e,t);for(let h of t)h.instances.push(u);let f=Axe(t);for(let h of e.set)if(!h.modified.length)for(let g of f)a.push(mV.get(h,g));return u}}function xxe(s,e){return s.length==e.length&&s.every((t,r)=>t==e[r])}function Axe(s){let e=[[]];for(let t=0;t<s.length;t++)for(let r=0,a=e.length;r<a;r++)e.push(e[r].concat(s[t]));return e.sort((t,r)=>r.length-t.length)}function Fge(s){let e=Object.create(null);for(let t in s){let r=s[t];Array.isArray(r)||(r=[r]);for(let a of t.split(" "))if(a){let u=[],f=2,h=a;for(let A=0;;){if(h=="..."&&A>0&&A+3==a.length){f=1;break}let O=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(h);if(!O)throw new RangeError("Invalid path: "+a);if(u.push(O[0]=="*"?"":O[0][0]=='"'?JSON.parse(O[0]):O[0]),A+=O[0].length,A==a.length)break;let N=a[A++];if(A==a.length&&N=="!"){f=0;break}if(N!="/")throw new RangeError("Invalid path: "+a);h=a.slice(A)}let g=u.length-1,y=u[g];if(!y)throw new RangeError("Invalid path: "+a);let C=new gV(r,f,g>0?u.slice(0,g):null);e[y]=C.sort(e[y])}}return Hge.add(e)}const Hge=new ca;class gV{constructor(e,t,r,a){this.tags=e,this.mode=t,this.context=r,this.next=a}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}gV.empty=new gV([],2,null);function $ge(s,e){let t=Object.create(null);for(let u of s)if(!Array.isArray(u.tag))t[u.tag.id]=u.class;else for(let f of u.tag)t[f.id]=u.class;let{scope:r,all:a=null}=e||{};return{style:u=>{let f=a;for(let h of u)for(let g of h.set){let y=t[g.id];if(y){f=f?f+" "+y:y;break}}return f},scope:r}}function Txe(s,e){let t=null;for(let r of s){let a=r.style(e);a&&(t=t?t+" "+a:a)}return t}function Dxe(s,e,t,r=0,a=s.length){let u=new Oxe(r,Array.isArray(e)?e:[e],t);u.highlightRange(s.cursor(),r,a,"",u.highlighters),u.flush(a)}class Oxe{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,a,u){let{type:f,from:h,to:g}=e;if(h>=r||g<=t)return;f.isTop&&(u=this.highlighters.filter(N=>!N.scope||N.scope(f)));let y=a,C=Mxe(e)||gV.empty,A=Txe(u,C.tags);if(A&&(y&&(y+=" "),y+=A,C.mode==1&&(a+=(a?" ":"")+A)),this.startSpan(Math.max(t,h),y),C.opaque)return;let O=e.tree&&e.tree.prop(ca.mounted);if(O&&O.overlay){let N=e.node.enter(O.overlay[0].from+h,1),L=this.highlighters.filter(z=>!z.scope||z.scope(O.tree.type)),j=e.firstChild();for(let z=0,q=h;;z++){let ee=z<O.overlay.length?O.overlay[z]:null,F=ee?ee.from+h:g,ne=Math.max(t,q),oe=Math.min(r,F);if(ne<oe&&j)for(;e.from<oe&&(this.highlightRange(e,ne,oe,a,u),this.startSpan(Math.min(oe,e.to),y),!(e.to>=F||!e.nextSibling())););if(!ee||F>r)break;q=ee.to+h,q>t&&(this.highlightRange(N.cursor(),Math.max(t,ee.from+h),Math.min(r,q),"",L),this.startSpan(Math.min(r,q),y))}j&&e.parent()}else if(e.firstChild()){O&&(a="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,a,u),this.startSpan(Math.min(r,e.to),y)}while(e.nextSibling());e.parent()}}}function Mxe(s){let e=s.type.prop(Hge);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const Zo=Ky.define,iz=Zo(),tk=Zo(),Eue=Zo(tk),xue=Zo(tk),nk=Zo(),az=Zo(nk),Fte=Zo(nk),qy=Zo(),IA=Zo(qy),jy=Zo(),Zy=Zo(),soe=Zo(),lP=Zo(soe),lz=Zo(),Vo={comment:iz,lineComment:Zo(iz),blockComment:Zo(iz),docComment:Zo(iz),name:tk,variableName:Zo(tk),typeName:Eue,tagName:Zo(Eue),propertyName:xue,attributeName:Zo(xue),className:Zo(tk),labelName:Zo(tk),namespace:Zo(tk),macroName:Zo(tk),literal:nk,string:az,docString:Zo(az),character:Zo(az),attributeValue:Zo(az),number:Fte,integer:Zo(Fte),float:Zo(Fte),bool:Zo(nk),regexp:Zo(nk),escape:Zo(nk),color:Zo(nk),url:Zo(nk),keyword:jy,self:Zo(jy),null:Zo(jy),atom:Zo(jy),unit:Zo(jy),modifier:Zo(jy),operatorKeyword:Zo(jy),controlKeyword:Zo(jy),definitionKeyword:Zo(jy),moduleKeyword:Zo(jy),operator:Zy,derefOperator:Zo(Zy),arithmeticOperator:Zo(Zy),logicOperator:Zo(Zy),bitwiseOperator:Zo(Zy),compareOperator:Zo(Zy),updateOperator:Zo(Zy),definitionOperator:Zo(Zy),typeOperator:Zo(Zy),controlOperator:Zo(Zy),punctuation:soe,separator:Zo(soe),bracket:lP,angleBracket:Zo(lP),squareBracket:Zo(lP),paren:Zo(lP),brace:Zo(lP),content:qy,heading:IA,heading1:Zo(IA),heading2:Zo(IA),heading3:Zo(IA),heading4:Zo(IA),heading5:Zo(IA),heading6:Zo(IA),contentSeparator:Zo(qy),list:Zo(qy),quote:Zo(qy),emphasis:Zo(qy),strong:Zo(qy),link:Zo(qy),monospace:Zo(qy),strikethrough:Zo(qy),inserted:Zo(),deleted:Zo(),changed:Zo(),invalid:Zo(),meta:lz,documentMeta:Zo(lz),annotation:Zo(lz),processingInstruction:Zo(lz),definition:Ky.defineModifier(),constant:Ky.defineModifier(),function:Ky.defineModifier(),standard:Ky.defineModifier(),local:Ky.defineModifier(),special:Ky.defineModifier()};$ge([{tag:Vo.link,class:"tok-link"},{tag:Vo.heading,class:"tok-heading"},{tag:Vo.emphasis,class:"tok-emphasis"},{tag:Vo.strong,class:"tok-strong"},{tag:Vo.keyword,class:"tok-keyword"},{tag:Vo.atom,class:"tok-atom"},{tag:Vo.bool,class:"tok-bool"},{tag:Vo.url,class:"tok-url"},{tag:Vo.labelName,class:"tok-labelName"},{tag:Vo.inserted,class:"tok-inserted"},{tag:Vo.deleted,class:"tok-deleted"},{tag:Vo.literal,class:"tok-literal"},{tag:Vo.string,class:"tok-string"},{tag:Vo.number,class:"tok-number"},{tag:[Vo.regexp,Vo.escape,Vo.special(Vo.string)],class:"tok-string2"},{tag:Vo.variableName,class:"tok-variableName"},{tag:Vo.local(Vo.variableName),class:"tok-variableName tok-local"},{tag:Vo.definition(Vo.variableName),class:"tok-variableName tok-definition"},{tag:Vo.special(Vo.variableName),class:"tok-variableName2"},{tag:Vo.definition(Vo.propertyName),class:"tok-propertyName tok-definition"},{tag:Vo.typeName,class:"tok-typeName"},{tag:Vo.namespace,class:"tok-namespace"},{tag:Vo.className,class:"tok-className"},{tag:Vo.macroName,class:"tok-macroName"},{tag:Vo.propertyName,class:"tok-propertyName"},{tag:Vo.operator,class:"tok-operator"},{tag:Vo.comment,class:"tok-comment"},{tag:Vo.meta,class:"tok-meta"},{tag:Vo.invalid,class:"tok-invalid"},{tag:Vo.punctuation,class:"tok-punctuation"}]);var Hte;const UD=new ca;function Rxe(s){return Ds.define({combine:s?e=>e.concat(s):void 0})}const Nxe=new ca;class hv{constructor(e,t,r=[],a=""){this.data=e,this.name=a,Ea.prototype.hasOwnProperty("tree")||Object.defineProperty(Ea.prototype,"tree",{get(){return Dm(this)}}),this.parser=t,this.extension=[vk.of(this),Ea.languageData.of((u,f,h)=>{let g=Aue(u,f,h),y=g.type.prop(UD);if(!y)return[];let C=u.facet(y),A=g.type.prop(Nxe);if(A){let O=g.resolve(f-g.from,h);for(let N of A)if(N.test(O,u)){let L=u.facet(N.facet);return N.type=="replace"?L:L.concat(C)}}return C})].concat(r)}isActiveAt(e,t,r=-1){return Aue(e,t,r).type.prop(UD)==this.data}findRegions(e){let t=e.facet(vk);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],a=(u,f)=>{if(u.prop(UD)==this.data){r.push({from:f,to:f+u.length});return}let h=u.prop(ca.mounted);if(h){if(h.tree.prop(UD)==this.data){if(h.overlay)for(let g of h.overlay)r.push({from:g.from+f,to:g.to+f});else r.push({from:f,to:f+u.length});return}else if(h.overlay){let g=r.length;if(a(h.tree,h.overlay[0].from+f),r.length>g)return}}for(let g=0;g<u.children.length;g++){let y=u.children[g];y instanceof Bf&&a(y,u.positions[g]+f)}};return a(Dm(e),0),r}get allowsNesting(){return!0}}hv.setState=Pi.define();function Aue(s,e,t){let r=s.facet(vk),a=Dm(s).topNode;if(!r||r.allowsNesting)for(let u=a;u;u=u.enter(e,t,Wd.ExcludeBuffers))u.type.isTop&&(a=u);return a}class pV extends hv{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=Rxe(e.languageData);return new pV(t,e.parser.configure({props:[UD.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new pV(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Dm(s){let e=s.field(hv.state,!1);return e?e.tree:Bf.empty}class Pxe{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let cP=null;class bV{constructor(e,t,r=[],a,u,f,h,g){this.parser=e,this.state=t,this.fragments=r,this.tree=a,this.treeLen=u,this.viewport=f,this.skipped=h,this.scheduleOn=g,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new bV(e,t,[],Bf.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Pxe(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Bf.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let a=Date.now()+e;e=()=>Date.now()>a}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let a=this.parse.advance();if(a)if(this.fragments=this.withoutTempSkipped(ZA.addTree(a,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=a,this.parse=null,this.treeLen<(t!=null?t:this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ZA.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=cP;cP=this;try{return e()}finally{cP=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Tue(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:a,treeLen:u,viewport:f,skipped:h}=this;if(this.takeTree(),!e.empty){let g=[];if(e.iterChangedRanges((y,C,A,O)=>g.push({fromA:y,toA:C,fromB:A,toB:O})),r=ZA.applyChanges(r,g),a=Bf.empty,u=0,f={from:e.mapPos(f.from,-1),to:e.mapPos(f.to,1)},this.skipped.length){h=[];for(let y of this.skipped){let C=e.mapPos(y.from,1),A=e.mapPos(y.to,-1);C<A&&h.push({from:C,to:A})}}}return new bV(this.parser,t,r,a,u,f,h,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:a,to:u}=this.skipped[r];a<e.to&&u>e.from&&(this.fragments=Tue(this.fragments,a,u),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Lge{createParse(t,r,a){let u=a[0].from,f=a[a.length-1].to;return{parsedPos:u,advance(){let g=cP;if(g){for(let y of a)g.tempSkipped.push(y);e&&(g.scheduleOn=g.scheduleOn?Promise.all([g.scheduleOn,e]):e)}return this.parsedPos=f,new Bf(Np.none,[],[],f-u)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return cP}}function Tue(s,e,t){return ZA.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class aO{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new aO(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=bV.create(e.facet(vk).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new aO(r)}}hv.state=md.define({create:aO.init,update(s,e){for(let t of e.effects)if(t.is(hv.setState))return t.value;return e.startState.facet(vk)!=e.state.facet(vk)?aO.init(e.state):s.apply(e)}});let zge=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(zge=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const $te=typeof navigator<"u"&&((Hte=navigator.scheduling)===null||Hte===void 0?void 0:Hte.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ixe=gf.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(hv.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(hv.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=zge(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:a}}=this.view,u=r.field(hv.state);if(u.tree==u.context.tree&&u.context.isDone(a+1e5))return;let f=Date.now()+Math.min(this.chunkBudget,100,e&&!$te?Math.max(25,e.timeRemaining()-5):1e9),h=u.context.treeLen<a&&r.doc.length>a+1e3,g=u.context.work(()=>$te&&$te()||Date.now()>f,a+(h?0:1e5));this.chunkBudget-=Date.now()-t,(g||this.chunkBudget<=0)&&(u.context.takeTree(),this.view.dispatch({effects:hv.setState.of(new aO(u.context))})),this.chunkBudget>0&&!(g&&!h)&&this.scheduleWork(),this.checkAsyncSchedule(u.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>R0(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),vk=Ds.define({combine(s){return s.length?s[0]:null},enables:s=>[hv.state,Ixe,As.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class Bxe{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Lxe=Ds.define(),Koe=Ds.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function vV(s){let e=s.facet(Koe);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function KP(s,e){let t="",r=s.tabSize,a=s.facet(Koe)[0];if(a==" "){for(;e>=r;)t+=" ",e-=r;a=" "}for(let u=0;u<e;u++)t+=a;return t}function Yoe(s,e){s instanceof Ea&&(s=new XV(s));for(let r of s.state.facet(Lxe)){let a=r(s,e);if(a!==void 0)return a}let t=Dm(s.state);return t.length>=e?Fxe(s,t,e):null}class XV{constructor(e,t={}){this.state=e,this.options=t,this.unit=vV(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:a,simulateDoubleBreak:u}=this.options;return a!=null&&a>=r.from&&a<=r.to?u&&a==e?{text:"",from:e}:(t<0?a<e:a<=e)?{text:r.text.slice(a-r.from),from:a}:{text:r.text.slice(0,a-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:a}=this.lineAt(e,t);return r.slice(e-a,Math.min(r.length,e+100-a))}column(e,t=1){let{text:r,from:a}=this.lineAt(e,t),u=this.countColumn(r,e-a),f=this.options.overrideIndentation?this.options.overrideIndentation(a):-1;return f>-1&&(u+=f-this.countColumn(r,r.search(/\S|$/))),u}countColumn(e,t=e.length){return wO(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:a}=this.lineAt(e,t),u=this.options.overrideIndentation;if(u){let f=u(a);if(f>-1)return f}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Vge=new ca;function Fxe(s,e,t){let r=e.resolveStack(t),a=r.node.enterUnfinishedNodesBefore(t);if(a!=r.node){let u=[];for(let f=a;f!=r.node;f=f.parent)u.push(f);for(let f=u.length-1;f>=0;f--)r={node:u[f],next:r}}return Uge(r,s,t)}function Uge(s,e,t){for(let r=s;r;r=r.next){let a=$xe(r.node);if(a)return a(Xoe.create(e,t,r))}return 0}function Hxe(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function $xe(s){let e=s.type.prop(Vge);if(e)return e;let t=s.firstChild,r;if(t&&(r=t.type.prop(ca.closedBy))){let a=s.lastChild,u=a&&r.indexOf(a.name)>-1;return f=>Wxe(f,!0,1,void 0,u&&!Hxe(f)?a.from:void 0)}return s.parent==null?zxe:null}function zxe(){return 0}class Xoe extends XV{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Xoe(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Vxe(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return Uge(this.context.next,this.base,this.pos)}}function Vxe(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function Uxe(s){let e=s.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let a=s.options.simulateBreak,u=s.state.doc.lineAt(t.from),f=a==null||a<=u.from?u.to:Math.min(u.to,a);for(let h=t.to;;){let g=e.childAfter(h);if(!g||g==r)return null;if(!g.type.isSkipped)return g.from<f?t:null;h=g.to}}function Wxe(s,e,t,r,a){let u=s.textAfter,f=u.match(/^\s*/)[0].length,h=r&&u.slice(f,f+r.length)==r||a==s.pos+f,g=e?Uxe(s):null;return g?h?s.column(g.from):s.column(g.to):s.baseIndent+(h?0:s.unit*t)}function Due({except:s,units:e=1}={}){return t=>{let r=s&&s.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const jxe=200;function Zxe(){return Ea.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:r}=s.newSelection.main,a=t.lineAt(r);if(r>a.from+jxe)return s;let u=t.sliceString(a.from,r);if(!e.some(y=>y.test(u)))return s;let{state:f}=s,h=-1,g=[];for(let{head:y}of f.selection.ranges){let C=f.doc.lineAt(y);if(C.from==h)continue;h=C.from;let A=Yoe(f,C.from);if(A==null)continue;let O=/^\s*/.exec(C.text)[0],N=KP(f,A);O!=N&&g.push({from:C.from,to:C.from+O.length,insert:N})}return g.length?[s,{changes:g,sequential:!0}]:s})}const qxe=Ds.define(),Wge=new ca;function Gxe(s){let e=s.firstChild,t=s.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?s.to:t.from}:null}function Kxe(s,e,t){let r=Dm(s);if(r.length<t)return null;let a=r.resolveStack(t,1),u=null;for(let f=a;f;f=f.next){let h=f.node;if(h.to<=t||h.from>t)continue;if(u&&h.from<e)break;let g=h.type.prop(Wge);if(g&&(h.to<r.length-50||r.length==s.doc.length||!Yxe(h))){let y=g(h,s);y&&y.from<=t&&y.from>=e&&y.to>t&&(u=y)}}return u}function Yxe(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function yV(s,e,t){for(let r of s.facet(qxe)){let a=r(s,e,t);if(a)return a}return Kxe(s,e,t)}function jge(s,e){let t=e.mapPos(s.from,1),r=e.mapPos(s.to,-1);return t>=r?void 0:{from:t,to:r}}const JV=Pi.define({map:jge}),mI=Pi.define({map:jge});function Zge(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(s.lineBlockAt(t));return e}const YA=md.define({create(){return ti.none},update(s,e){s=s.map(e.changes);for(let t of e.effects)if(t.is(JV)&&!Xxe(s,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(Joe),a=r?ti.replace({widget:new sAe(r(e.state,t.value))}):Oue;s=s.update({add:[a.range(t.value.from,t.value.to)]})}else t.is(mI)&&(s=s.update({filter:(r,a)=>t.value.from!=r||t.value.to!=a,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;s.between(r,r,(a,u)=>{a<r&&u>r&&(t=!0)}),t&&(s=s.update({filterFrom:r,filterTo:r,filter:(a,u)=>u<=r||a>=r}))}return s},provide:s=>As.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(r,a)=>{t.push(r,a)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<s.length;){let r=s[t++],a=s[t++];if(typeof r!="number"||typeof a!="number")throw new RangeError("Invalid JSON for fold state");e.push(Oue.range(r,a))}return ti.set(e,!0)}});function wV(s,e,t){var r;let a=null;return(r=s.field(YA,!1))===null||r===void 0||r.between(e,t,(u,f)=>{(!a||a.from>u)&&(a={from:u,to:f})}),a}function Xxe(s,e,t){let r=!1;return s.between(e,e,(a,u)=>{a==e&&u==t&&(r=!0)}),r}function qge(s,e){return s.field(YA,!1)?e:e.concat(Pi.appendConfig.of(Kge()))}const Jxe=s=>{for(let e of Zge(s)){let t=yV(s.state,e.from,e.to);if(t)return s.dispatch({effects:qge(s.state,[JV.of(t),Gge(s,t)])}),!0}return!1},Qxe=s=>{if(!s.state.field(YA,!1))return!1;let e=[];for(let t of Zge(s)){let r=wV(s.state,t.from,t.to);r&&e.push(mI.of(r),Gge(s,r,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function Gge(s,e,t=!0){let r=s.state.doc.lineAt(e.from).number,a=s.state.doc.lineAt(e.to).number;return As.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${s.state.phrase("to")} ${a}.`)}const eAe=s=>{let{state:e}=s,t=[];for(let r=0;r<e.doc.length;){let a=s.lineBlockAt(r),u=yV(e,a.from,a.to);u&&t.push(JV.of(u)),r=(u?s.lineBlockAt(u.to):a).to+1}return t.length&&s.dispatch({effects:qge(s.state,t)}),!!t.length},tAe=s=>{let e=s.state.field(YA,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(r,a)=>{t.push(mI.of({from:r,to:a}))}),s.dispatch({effects:t}),!0},nAe=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Jxe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Qxe},{key:"Ctrl-Alt-[",run:eAe},{key:"Ctrl-Alt-]",run:tAe}],oAe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Joe=Ds.define({combine(s){return gv(s,oAe)}});function Kge(s){let e=[YA,aAe];return s&&e.push(Joe.of(s)),e}function Yge(s,e){let{state:t}=s,r=t.facet(Joe),a=f=>{let h=s.lineBlockAt(s.posAtDOM(f.target)),g=wV(s.state,h.from,h.to);g&&s.dispatch({effects:mI.of(g)}),f.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(s,a,e);let u=document.createElement("span");return u.textContent=r.placeholderText,u.setAttribute("aria-label",t.phrase("folded code")),u.title=t.phrase("unfold"),u.className="cm-foldPlaceholder",u.onclick=a,u}const Oue=ti.replace({widget:new class extends Sk{toDOM(s){return Yge(s,null)}}});class sAe extends Sk{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Yge(e,this.value)}}const rAe={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zte extends l2{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function iAe(s={}){let e=Object.assign(Object.assign({},rAe),s),t=new zte(e,!0),r=new zte(e,!1),a=gf.fromClass(class{constructor(f){this.from=f.viewport.from,this.markers=this.buildMarkers(f)}update(f){(f.docChanged||f.viewportChanged||f.startState.facet(vk)!=f.state.facet(vk)||f.startState.field(YA,!1)!=f.state.field(YA,!1)||Dm(f.startState)!=Dm(f.state)||e.foldingChanged(f))&&(this.markers=this.buildMarkers(f.view))}buildMarkers(f){let h=new mk;for(let g of f.viewportLineBlocks){let y=wV(f.state,g.from,g.to)?r:yV(f.state,g.from,g.to)?t:null;y&&h.add(g.from,g.from,y)}return h.finish()}}),{domEventHandlers:u}=e;return[a,Oge({class:"cm-foldGutter",markers(f){var h;return((h=f.plugin(a))===null||h===void 0?void 0:h.markers)||Ya.empty},initialSpacer(){return new zte(e,!1)},domEventHandlers:Object.assign(Object.assign({},u),{click:(f,h,g)=>{if(u.click&&u.click(f,h,g))return!0;let y=wV(f.state,h.from,h.to);if(y)return f.dispatch({effects:mI.of(y)}),!0;let C=yV(f.state,h.from,h.to);return C?(f.dispatch({effects:JV.of(C)}),!0):!1}})}),Kge()]}const aAe=As.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class QV{constructor(e,t){this.specs=e;let r;function a(h){let g=gk.newName();return(r||(r=Object.create(null)))["."+g]=h,g}const u=typeof t.all=="string"?t.all:t.all?a(t.all):void 0,f=t.scope;this.scope=f instanceof hv?h=>h.prop(UD)==f.data:f?h=>h==f:void 0,this.style=$ge(e.map(h=>({tag:h.tag,class:h.class||a(Object.assign({},h,{tag:null}))})),{all:u}).style,this.module=r?new gk(r):null,this.themeType=t.themeType}static define(e,t){return new QV(e,t||{})}}const roe=Ds.define(),Xge=Ds.define({combine(s){return s.length?[s[0]]:null}});function Vte(s){let e=s.facet(roe);return e.length?e:s.facet(Xge)}function lAe(s,e){let t=[uAe],r;return s instanceof QV&&(s.module&&t.push(As.styleModule.of(s.module)),r=s.themeType),e!=null&&e.fallback?t.push(Xge.of(s)):r?t.push(roe.computeN([As.darkTheme],a=>a.facet(As.darkTheme)==(r=="dark")?[s]:[])):t.push(roe.of(s)),t}class cAe{constructor(e){this.markCache=Object.create(null),this.tree=Dm(e.state),this.decorations=this.buildDeco(e,Vte(e.state))}update(e){let t=Dm(e.state),r=Vte(e.state),a=r!=Vte(e.startState);t.length<e.view.viewport.to&&!a&&t.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(t!=this.tree||e.viewportChanged||a)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r))}buildDeco(e,t){if(!t||!this.tree.length)return ti.none;let r=new mk;for(let{from:a,to:u}of e.visibleRanges)Dxe(this.tree,t,(f,h,g)=>{r.add(f,h,this.markCache[g]||(this.markCache[g]=ti.mark({class:g})))},a,u);return r.finish()}}const uAe=yO.high(gf.fromClass(cAe,{decorations:s=>s.decorations})),fAe=QV.define([{tag:Vo.meta,color:"#404740"},{tag:Vo.link,textDecoration:"underline"},{tag:Vo.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Vo.emphasis,fontStyle:"italic"},{tag:Vo.strong,fontWeight:"bold"},{tag:Vo.strikethrough,textDecoration:"line-through"},{tag:Vo.keyword,color:"#708"},{tag:[Vo.atom,Vo.bool,Vo.url,Vo.contentSeparator,Vo.labelName],color:"#219"},{tag:[Vo.literal,Vo.inserted],color:"#164"},{tag:[Vo.string,Vo.deleted],color:"#a11"},{tag:[Vo.regexp,Vo.escape,Vo.special(Vo.string)],color:"#e40"},{tag:Vo.definition(Vo.variableName),color:"#00f"},{tag:Vo.local(Vo.variableName),color:"#30a"},{tag:[Vo.typeName,Vo.namespace],color:"#085"},{tag:Vo.className,color:"#167"},{tag:[Vo.special(Vo.variableName),Vo.macroName],color:"#256"},{tag:Vo.definition(Vo.propertyName),color:"#00c"},{tag:Vo.comment,color:"#940"},{tag:Vo.invalid,color:"#f00"}]),dAe=As.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Jge=1e4,Qge="()[]{}",epe=Ds.define({combine(s){return gv(s,{afterCursor:!0,brackets:Qge,maxScanDistance:Jge,renderMatch:gAe})}}),hAe=ti.mark({class:"cm-matchingBracket"}),mAe=ti.mark({class:"cm-nonmatchingBracket"});function gAe(s){let e=[],t=s.matched?hAe:mAe;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}const pAe=md.define({create(){return ti.none},update(s,e){if(!e.docChanged&&!e.selection)return s;let t=[],r=e.state.facet(epe);for(let a of e.state.selection.ranges){if(!a.empty)continue;let u=Qy(e.state,a.head,-1,r)||a.head>0&&Qy(e.state,a.head-1,1,r)||r.afterCursor&&(Qy(e.state,a.head,1,r)||a.head<e.state.doc.length&&Qy(e.state,a.head+1,-1,r));u&&(t=t.concat(r.renderMatch(u,e.state)))}return ti.set(t,!0)},provide:s=>As.decorations.from(s)}),bAe=[pAe,dAe];function vAe(s={}){return[epe.of(s),bAe]}const yAe=new ca;function ioe(s,e,t){let r=s.prop(e<0?ca.openedBy:ca.closedBy);if(r)return r;if(s.name.length==1){let a=t.indexOf(s.name);if(a>-1&&a%2==(e<0?1:0))return[t[a+e]]}return null}function aoe(s){let e=s.type.prop(yAe);return e?e(s.node):s}function Qy(s,e,t,r={}){let a=r.maxScanDistance||Jge,u=r.brackets||Qge,f=Dm(s),h=f.resolveInner(e,t);for(let g=h;g;g=g.parent){let y=ioe(g.type,t,u);if(y&&g.from<g.to){let C=aoe(g);if(C&&(t>0?e>=C.from&&e<C.to:e>C.from&&e<=C.to))return wAe(s,e,t,g,C,y,u)}}return _Ae(s,e,t,f,h.type,a,u)}function wAe(s,e,t,r,a,u,f){let h=r.parent,g={from:a.from,to:a.to},y=0,C=h==null?void 0:h.cursor();if(C&&(t<0?C.childBefore(r.from):C.childAfter(r.to)))do if(t<0?C.to<=r.from:C.from>=r.to){if(y==0&&u.indexOf(C.type.name)>-1&&C.from<C.to){let A=aoe(C);return{start:g,end:A?{from:A.from,to:A.to}:void 0,matched:!0}}else if(ioe(C.type,t,f))y++;else if(ioe(C.type,-t,f)){if(y==0){let A=aoe(C);return{start:g,end:A&&A.from<A.to?{from:A.from,to:A.to}:void 0,matched:!1}}y--}}while(t<0?C.prevSibling():C.nextSibling());return{start:g,matched:!1}}function _Ae(s,e,t,r,a,u,f){let h=t<0?s.sliceDoc(e-1,e):s.sliceDoc(e,e+1),g=f.indexOf(h);if(g<0||g%2==0!=t>0)return null;let y={from:t<0?e-1:e,to:t>0?e+1:e},C=s.doc.iterRange(e,t>0?s.doc.length:0),A=0;for(let O=0;!C.next().done&&O<=u;){let N=C.value;t<0&&(O+=N.length);let L=e+O*t;for(let j=t>0?0:N.length-1,z=t>0?N.length:-1;j!=z;j+=t){let q=f.indexOf(N[j]);if(!(q<0||r.resolveInner(L+j,1).type!=a))if(q%2==0==t>0)A++;else{if(A==1)return{start:y,end:{from:L+j,to:L+j+1},matched:q>>1==g>>1};A--}}t>0&&(O+=N.length)}return C.done?{start:y,matched:!1}:null}const CAe=Object.create(null),Mue=[Np.none],Rue=[],SAe=Object.create(null);for(let[s,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])SAe[s]=kAe(CAe,e);function Ute(s,e){Rue.indexOf(s)>-1||(Rue.push(s),console.warn(e))}function kAe(s,e){let t=null;for(let u of e.split(".")){let f=s[u]||Vo[u];f?typeof f=="function"?t?t=f(t):Ute(u,`Modifier ${u} used at start of tag`):t?Ute(u,`Tag ${u} used as modifier`):t=f:Ute(u,`Unknown highlighting tag ${u}`)}if(!t)return 0;let r=e.replace(/ /g,"_"),a=Np.define({id:Mue.length,name:r,props:[Fge({[r]:t})]});return Mue.push(a),a.id}const EAe=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),r=ese(s.state,t.from);return r.line?xAe(s):r.block?TAe(s):!1};function Qoe(s,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let a=s(e,t);return a?(r(t.update(a)),!0):!1}}const xAe=Qoe(MAe,0),AAe=Qoe(tpe,0),TAe=Qoe((s,e)=>tpe(s,e,OAe(e)),0);function ese(s,e){let t=s.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const uP=50;function DAe(s,{open:e,close:t},r,a){let u=s.sliceDoc(r-uP,r),f=s.sliceDoc(a,a+uP),h=/\s*$/.exec(u)[0].length,g=/^\s*/.exec(f)[0].length,y=u.length-h;if(u.slice(y-e.length,y)==e&&f.slice(g,g+t.length)==t)return{open:{pos:r-h,margin:h&&1},close:{pos:a+g,margin:g&&1}};let C,A;a-r<=2*uP?C=A=s.sliceDoc(r,a):(C=s.sliceDoc(r,r+uP),A=s.sliceDoc(a-uP,a));let O=/^\s*/.exec(C)[0].length,N=/\s*$/.exec(A)[0].length,L=A.length-N-t.length;return C.slice(O,O+e.length)==e&&A.slice(L,L+t.length)==t?{open:{pos:r+O+e.length,margin:/\s/.test(C.charAt(O+e.length))?1:0},close:{pos:a-N-t.length,margin:/\s/.test(A.charAt(L-1))?1:0}}:null}function OAe(s){let e=[];for(let t of s.selection.ranges){let r=s.doc.lineAt(t.from),a=t.to<=r.to?r:s.doc.lineAt(t.to),u=e.length-1;u>=0&&e[u].to>r.from?e[u].to=a.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:a.to})}return e}function tpe(s,e,t=e.selection.ranges){let r=t.map(u=>ese(e,u.from).block);if(!r.every(u=>u))return null;let a=t.map((u,f)=>DAe(e,r[f],u.from,u.to));if(s!=2&&!a.every(u=>u))return{changes:e.changes(t.map((u,f)=>a[f]?[]:[{from:u.from,insert:r[f].open+" "},{from:u.to,insert:" "+r[f].close}]))};if(s!=1&&a.some(u=>u)){let u=[];for(let f=0,h;f<a.length;f++)if(h=a[f]){let g=r[f],{open:y,close:C}=h;u.push({from:y.pos-g.open.length,to:y.pos+y.margin},{from:C.pos-C.margin,to:C.pos+g.close.length})}return{changes:u}}return null}function MAe(s,e,t=e.selection.ranges){let r=[],a=-1;for(let{from:u,to:f}of t){let h=r.length,g=1e9,y=ese(e,u).line;if(!!y){for(let C=u;C<=f;){let A=e.doc.lineAt(C);if(A.from>a&&(u==f||f>A.from)){a=A.from;let O=/^\s*/.exec(A.text)[0].length,N=O==A.length,L=A.text.slice(O,O+y.length)==y?O:-1;O<A.text.length&&O<g&&(g=O),r.push({line:A,comment:L,token:y,indent:O,empty:N,single:!1})}C=A.to+1}if(g<1e9)for(let C=h;C<r.length;C++)r[C].indent<r[C].line.text.length&&(r[C].indent=g);r.length==h+1&&(r[h].single=!0)}}if(s!=2&&r.some(u=>u.comment<0&&(!u.empty||u.single))){let u=[];for(let{line:h,token:g,indent:y,empty:C,single:A}of r)(A||!C)&&u.push({from:h.from+y,insert:g+" "});let f=e.changes(u);return{changes:f,selection:e.selection.map(f,1)}}else if(s!=1&&r.some(u=>u.comment>=0)){let u=[];for(let{line:f,comment:h,token:g}of r)if(h>=0){let y=f.from+h,C=y+g.length;f.text[C-f.from]==" "&&C++,u.push({from:y,to:C})}return{changes:u}}return null}const loe=B_.define(),RAe=B_.define(),NAe=Ds.define(),npe=Ds.define({combine(s){return gv(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,a)=>e(r,a)||t(r,a)})}});function PAe(s){let e=0;return s.iterChangedRanges((t,r)=>e=r),e}const ope=md.define({create(){return e2.empty},update(s,e){let t=e.state.facet(npe),r=e.annotation(loe);if(r){let g=e.docChanged?qn.single(PAe(e.changes)):void 0,y=Op.fromTransaction(e,g),C=r.side,A=C==0?s.undone:s.done;return y?A=_V(A,A.length,t.minDepth,y):A=ipe(A,e.startState.selection),new e2(C==0?r.rest:A,C==0?A:r.rest)}let a=e.annotation(RAe);if((a=="full"||a=="before")&&(s=s.isolate()),e.annotation(hd.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let u=Op.fromTransaction(e),f=e.annotation(hd.time),h=e.annotation(hd.userEvent);return u?s=s.addChanges(u,f,h,t,e):e.selection&&(s=s.addSelection(e.startState.selection,f,h,t.newGroupDelay)),(a=="full"||a=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new e2(s.done.map(Op.fromJSON),s.undone.map(Op.fromJSON))}});function IAe(s={}){return[ope,npe.of(s),As.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?spe:e.inputType=="historyRedo"?coe:null;return r?(e.preventDefault(),r(t)):!1}})]}function eU(s,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let a=t.field(ope,!1);if(!a)return!1;let u=a.pop(s,t,e);return u?(r(u),!0):!1}}const spe=eU(0,!1),coe=eU(1,!1),BAe=eU(0,!0),LAe=eU(1,!0);class Op{constructor(e,t,r,a,u){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=a,this.selectionsAfter=u}setSelAfter(e){return new Op(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(a=>a.toJSON())}}static fromJSON(e){return new Op(e.changes&&fd.fromJSON(e.changes),[],e.mapped&&n2.fromJSON(e.mapped),e.startSelection&&qn.fromJSON(e.startSelection),e.selectionsAfter.map(qn.fromJSON))}static fromTransaction(e,t){let r=M0;for(let a of e.startState.facet(NAe)){let u=a(e);u.length&&(r=r.concat(u))}return!r.length&&e.changes.empty?null:new Op(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,M0)}static selection(e){return new Op(void 0,M0,void 0,void 0,e)}}function _V(s,e,t,r){let a=e+1>t+20?e-t-1:0,u=s.slice(a,e);return u.push(r),u}function FAe(s,e){let t=[],r=!1;return s.iterChangedRanges((a,u)=>t.push(a,u)),e.iterChangedRanges((a,u,f,h)=>{for(let g=0;g<t.length;){let y=t[g++],C=t[g++];h>=y&&f<=C&&(r=!0)}}),r}function HAe(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function rpe(s,e){return s.length?e.length?s.concat(e):s:e}const M0=[],$Ae=200;function ipe(s,e){if(s.length){let t=s[s.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-$Ae));return r.length&&r[r.length-1].eq(e)?s:(r.push(e),_V(s,s.length-1,1e9,t.setSelAfter(r)))}else return[Op.selection([e])]}function zAe(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Wte(s,e){if(!s.length)return s;let t=s.length,r=M0;for(;t;){let a=VAe(s[t-1],e,r);if(a.changes&&!a.changes.empty||a.effects.length){let u=s.slice(0,t);return u[t-1]=a,u}else e=a.mapped,t--,r=a.selectionsAfter}return r.length?[Op.selection(r)]:M0}function VAe(s,e,t){let r=rpe(s.selectionsAfter.length?s.selectionsAfter.map(h=>h.map(e)):M0,t);if(!s.changes)return Op.selection(r);let a=s.changes.map(e),u=e.mapDesc(s.changes,!0),f=s.mapped?s.mapped.composeDesc(u):u;return new Op(a,Pi.mapEffects(s.effects,e),f,s.startSelection.map(u),r)}const UAe=/^(input\.type|delete)($|\.)/;class e2{constructor(e,t,r=0,a=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=a}isolate(){return this.prevTime?new e2(this.done,this.undone):this}addChanges(e,t,r,a,u){let f=this.done,h=f[f.length-1];return h&&h.changes&&!h.changes.empty&&e.changes&&(!r||UAe.test(r))&&(!h.selectionsAfter.length&&t-this.prevTime<a.newGroupDelay&&a.joinToEvent(u,FAe(h.changes,e.changes))||r=="input.type.compose")?f=_V(f,f.length-1,a.minDepth,new Op(e.changes.compose(h.changes),rpe(e.effects,h.effects),h.mapped,h.startSelection,M0)):f=_V(f,f.length,a.minDepth,e),new e2(f,M0,t,r)}addSelection(e,t,r,a){let u=this.done.length?this.done[this.done.length-1].selectionsAfter:M0;return u.length>0&&t-this.prevTime<a&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&HAe(u[u.length-1],e)?this:new e2(ipe(this.done,e),this.undone,t,r)}addMapping(e){return new e2(Wte(this.done,e),Wte(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let a=e==0?this.done:this.undone;if(a.length==0)return null;let u=a[a.length-1];if(r&&u.selectionsAfter.length)return t.update({selection:u.selectionsAfter[u.selectionsAfter.length-1],annotations:loe.of({side:e,rest:zAe(a)}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(u.changes){let f=a.length==1?M0:a.slice(0,a.length-1);return u.mapped&&(f=Wte(f,u.mapped)),t.update({changes:u.changes,selection:u.startSelection,effects:u.effects,annotations:loe.of({side:e,rest:f}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}e2.empty=new e2(M0,M0);const WAe=[{key:"Mod-z",run:spe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:coe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:coe,preventDefault:!0},{key:"Mod-u",run:BAe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:LAe,preventDefault:!0}];function _O(s,e){return qn.create(s.ranges.map(e),s.mainIndex)}function d2(s,e){return s.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function pv({state:s,dispatch:e},t){let r=_O(s.selection,t);return r.eq(s.selection)?!1:(e(d2(s,r)),!0)}function tU(s,e){return qn.cursor(e?s.to:s.from)}function ape(s,e){return pv(s,t=>t.empty?s.moveByChar(t,e):tU(t,e))}function Mm(s){return s.textDirectionAt(s.state.selection.main.head)==mu.LTR}const lpe=s=>ape(s,!Mm(s)),cpe=s=>ape(s,Mm(s));function upe(s,e){return pv(s,t=>t.empty?s.moveByGroup(t,e):tU(t,e))}const jAe=s=>upe(s,!Mm(s)),ZAe=s=>upe(s,Mm(s));function qAe(s,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function nU(s,e,t){let r=Dm(s).resolveInner(e.head),a=t?ca.closedBy:ca.openedBy;for(let g=e.head;;){let y=t?r.childAfter(g):r.childBefore(g);if(!y)break;qAe(s,y,a)?r=y:g=t?y.to:y.from}let u=r.type.prop(a),f,h;return u&&(f=t?Qy(s,r.from,1):Qy(s,r.to,-1))&&f.matched?h=t?f.end.to:f.end.from:h=t?r.to:r.from,qn.cursor(h,t?-1:1)}const GAe=s=>pv(s,e=>nU(s.state,e,!Mm(s))),KAe=s=>pv(s,e=>nU(s.state,e,Mm(s)));function fpe(s,e){return pv(s,t=>{if(!t.empty)return tU(t,e);let r=s.moveVertically(t,e);return r.head!=t.head?r:s.moveToLineBoundary(t,e)})}const dpe=s=>fpe(s,!1),hpe=s=>fpe(s,!0);function mpe(s){let e=s.scrollDOM.clientHeight<s.scrollDOM.scrollHeight-2,t=0,r=0,a;if(e){for(let u of s.state.facet(As.scrollMargins)){let f=u(s);f!=null&&f.top&&(t=Math.max(f==null?void 0:f.top,t)),f!=null&&f.bottom&&(r=Math.max(f==null?void 0:f.bottom,r))}a=s.scrollDOM.clientHeight-t-r}else a=(s.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(s.defaultLineHeight,a-5)}}function gpe(s,e){let t=mpe(s),{state:r}=s,a=_O(r.selection,f=>f.empty?s.moveVertically(f,e,t.height):tU(f,e));if(a.eq(r.selection))return!1;let u;if(t.selfScroll){let f=s.coordsAtPos(r.selection.main.head),h=s.scrollDOM.getBoundingClientRect(),g=h.top+t.marginTop,y=h.bottom-t.marginBottom;f&&f.top>g&&f.bottom<y&&(u=As.scrollIntoView(a.main.head,{y:"start",yMargin:f.top-g}))}return s.dispatch(d2(r,a),{effects:u}),!0}const Nue=s=>gpe(s,!1),uoe=s=>gpe(s,!0);function kk(s,e,t){let r=s.lineBlockAt(e.head),a=s.moveToLineBoundary(e,t);if(a.head==e.head&&a.head!=(t?r.to:r.from)&&(a=s.moveToLineBoundary(e,t,!1)),!t&&a.head==r.from&&r.length){let u=/^\s*/.exec(s.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;u&&e.head!=r.from+u&&(a=qn.cursor(r.from+u))}return a}const YAe=s=>pv(s,e=>kk(s,e,!0)),XAe=s=>pv(s,e=>kk(s,e,!1)),JAe=s=>pv(s,e=>kk(s,e,!Mm(s))),QAe=s=>pv(s,e=>kk(s,e,Mm(s))),e3e=s=>pv(s,e=>qn.cursor(s.lineBlockAt(e.head).from,1)),t3e=s=>pv(s,e=>qn.cursor(s.lineBlockAt(e.head).to,-1));function n3e(s,e,t){let r=!1,a=_O(s.selection,u=>{let f=Qy(s,u.head,-1)||Qy(s,u.head,1)||u.head>0&&Qy(s,u.head-1,1)||u.head<s.doc.length&&Qy(s,u.head+1,-1);if(!f||!f.end)return u;r=!0;let h=f.start.from==u.head?f.end.to:f.end.from;return t?qn.range(u.anchor,h):qn.cursor(h)});return r?(e(d2(s,a)),!0):!1}const o3e=({state:s,dispatch:e})=>n3e(s,e,!1);function z0(s,e){let t=_O(s.state.selection,r=>{let a=e(r);return qn.range(r.anchor,a.head,a.goalColumn,a.bidiLevel||void 0)});return t.eq(s.state.selection)?!1:(s.dispatch(d2(s.state,t)),!0)}function ppe(s,e){return z0(s,t=>s.moveByChar(t,e))}const bpe=s=>ppe(s,!Mm(s)),vpe=s=>ppe(s,Mm(s));function ype(s,e){return z0(s,t=>s.moveByGroup(t,e))}const s3e=s=>ype(s,!Mm(s)),r3e=s=>ype(s,Mm(s)),i3e=s=>z0(s,e=>nU(s.state,e,!Mm(s))),a3e=s=>z0(s,e=>nU(s.state,e,Mm(s)));function wpe(s,e){return z0(s,t=>s.moveVertically(t,e))}const _pe=s=>wpe(s,!1),Cpe=s=>wpe(s,!0);function Spe(s,e){return z0(s,t=>s.moveVertically(t,e,mpe(s).height))}const Pue=s=>Spe(s,!1),Iue=s=>Spe(s,!0),l3e=s=>z0(s,e=>kk(s,e,!0)),c3e=s=>z0(s,e=>kk(s,e,!1)),u3e=s=>z0(s,e=>kk(s,e,!Mm(s))),f3e=s=>z0(s,e=>kk(s,e,Mm(s))),d3e=s=>z0(s,e=>qn.cursor(s.lineBlockAt(e.head).from)),h3e=s=>z0(s,e=>qn.cursor(s.lineBlockAt(e.head).to)),Bue=({state:s,dispatch:e})=>(e(d2(s,{anchor:0})),!0),Lue=({state:s,dispatch:e})=>(e(d2(s,{anchor:s.doc.length})),!0),Fue=({state:s,dispatch:e})=>(e(d2(s,{anchor:s.selection.main.anchor,head:0})),!0),Hue=({state:s,dispatch:e})=>(e(d2(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),m3e=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),g3e=({state:s,dispatch:e})=>{let t=sU(s).map(({from:r,to:a})=>qn.range(r,Math.min(a+1,s.doc.length)));return e(s.update({selection:qn.create(t),userEvent:"select"})),!0},p3e=({state:s,dispatch:e})=>{let t=_O(s.selection,r=>{var a;let u=Dm(s).resolveInner(r.head,1);for(;!(u.from<r.from&&u.to>=r.to||u.to>r.to&&u.from<=r.from||!(!((a=u.parent)===null||a===void 0)&&a.parent));)u=u.parent;return qn.range(u.to,u.from)});return e(d2(s,t)),!0},b3e=({state:s,dispatch:e})=>{let t=s.selection,r=null;return t.ranges.length>1?r=qn.create([t.main]):t.main.empty||(r=qn.create([qn.cursor(t.main.head)])),r?(e(d2(s,r)),!0):!1};function oU(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:r}=s,a=r.changeByRange(u=>{let{from:f,to:h}=u;if(f==h){let g=e(f);g<f?(t="delete.backward",g=cz(s,g,!1)):g>f&&(t="delete.forward",g=cz(s,g,!0)),f=Math.min(f,g),h=Math.max(h,g)}else f=cz(s,f,!1),h=cz(s,h,!0);return f==h?{range:u}:{changes:{from:f,to:h},range:qn.cursor(f)}});return a.changes.empty?!1:(s.dispatch(r.update(a,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?As.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function cz(s,e,t){if(s instanceof As)for(let r of s.state.facet(As.atomicRanges).map(a=>a(s)))r.between(e,e,(a,u)=>{a<e&&u>e&&(e=t?u:a)});return e}const kpe=(s,e)=>oU(s,t=>{let{state:r}=s,a=r.doc.lineAt(t),u,f;if(!e&&t>a.from&&t<a.from+200&&!/[^ \t]/.test(u=a.text.slice(0,t-a.from))){if(u[u.length-1]==" ")return t-1;let h=wO(u,r.tabSize),g=h%vV(r)||vV(r);for(let y=0;y<g&&u[u.length-1-y]==" ";y++)t--;f=t}else f=Tm(a.text,t-a.from,e,e)+a.from,f==t&&a.number!=(e?r.doc.lines:1)&&(f+=e?1:-1);return f}),foe=s=>kpe(s,!1),Epe=s=>kpe(s,!0),xpe=(s,e)=>oU(s,t=>{let r=t,{state:a}=s,u=a.doc.lineAt(r),f=a.charCategorizer(r);for(let h=null;;){if(r==(e?u.to:u.from)){r==t&&u.number!=(e?a.doc.lines:1)&&(r+=e?1:-1);break}let g=Tm(u.text,r-u.from,e)+u.from,y=u.text.slice(Math.min(r,g)-u.from,Math.max(r,g)-u.from),C=f(y);if(h!=null&&C!=h)break;(y!=" "||r!=t)&&(h=C),r=g}return r}),Ape=s=>xpe(s,!1),v3e=s=>xpe(s,!0),Tpe=s=>oU(s,e=>{let t=s.lineBlockAt(e).to;return e<t?t:Math.min(s.state.doc.length,e+1)}),y3e=s=>oU(s,e=>{let t=s.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),w3e=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:cl.of(["",""])},range:qn.cursor(r.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},_3e=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(r=>{if(!r.empty||r.from==0||r.from==s.doc.length)return{range:r};let a=r.from,u=s.doc.lineAt(a),f=a==u.from?a-1:Tm(u.text,a-u.from,!1)+u.from,h=a==u.to?a+1:Tm(u.text,a-u.from,!0)+u.from;return{changes:{from:f,to:h,insert:s.doc.slice(a,h).append(s.doc.slice(f,a))},range:qn.cursor(h)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function sU(s){let e=[],t=-1;for(let r of s.selection.ranges){let a=s.doc.lineAt(r.from),u=s.doc.lineAt(r.to);if(!r.empty&&r.to==u.from&&(u=s.doc.lineAt(r.to-1)),t>=a.number){let f=e[e.length-1];f.to=u.to,f.ranges.push(r)}else e.push({from:a.from,to:u.to,ranges:[r]});t=u.number+1}return e}function Dpe(s,e,t){if(s.readOnly)return!1;let r=[],a=[];for(let u of sU(s)){if(t?u.to==s.doc.length:u.from==0)continue;let f=s.doc.lineAt(t?u.to+1:u.from-1),h=f.length+1;if(t){r.push({from:u.to,to:f.to},{from:u.from,insert:f.text+s.lineBreak});for(let g of u.ranges)a.push(qn.range(Math.min(s.doc.length,g.anchor+h),Math.min(s.doc.length,g.head+h)))}else{r.push({from:f.from,to:u.from},{from:u.to,insert:s.lineBreak+f.text});for(let g of u.ranges)a.push(qn.range(g.anchor-h,g.head-h))}}return r.length?(e(s.update({changes:r,scrollIntoView:!0,selection:qn.create(a,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const C3e=({state:s,dispatch:e})=>Dpe(s,e,!1),S3e=({state:s,dispatch:e})=>Dpe(s,e,!0);function Ope(s,e,t){if(s.readOnly)return!1;let r=[];for(let a of sU(s))t?r.push({from:a.from,insert:s.doc.slice(a.from,a.to)+s.lineBreak}):r.push({from:a.to,insert:s.lineBreak+s.doc.slice(a.from,a.to)});return e(s.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const k3e=({state:s,dispatch:e})=>Ope(s,e,!1),E3e=({state:s,dispatch:e})=>Ope(s,e,!0),x3e=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(sU(e).map(({from:a,to:u})=>(a>0?a--:u<e.doc.length&&u++,{from:a,to:u}))),r=_O(e.selection,a=>s.moveVertically(a,!0)).map(t);return s.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function A3e(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Dm(s).resolveInner(e),r=t.childBefore(e),a=t.childAfter(e),u;return r&&a&&r.to<=e&&a.from>=e&&(u=r.type.prop(ca.closedBy))&&u.indexOf(a.name)>-1&&s.doc.lineAt(r.to).from==s.doc.lineAt(a.from).from&&!/\S/.test(s.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}const T3e=Mpe(!1),D3e=Mpe(!0);function Mpe(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(a=>{let{from:u,to:f}=a,h=e.doc.lineAt(u),g=!s&&u==f&&A3e(e,u);s&&(u=f=(f<=h.to?h:e.doc.lineAt(f)).to);let y=new XV(e,{simulateBreak:u,simulateDoubleBreak:!!g}),C=Yoe(y,u);for(C==null&&(C=wO(/^\s*/.exec(e.doc.lineAt(u).text)[0],e.tabSize));f<h.to&&/\s/.test(h.text[f-h.from]);)f++;g?{from:u,to:f}=g:u>h.from&&u<h.from+100&&!/\S/.test(h.text.slice(0,u))&&(u=h.from);let A=["",KP(e,C)];return g&&A.push(KP(e,y.lineIndent(h.from,-1))),{changes:{from:u,to:f,insert:cl.of(A)},range:qn.cursor(u+1+A[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function tse(s,e){let t=-1;return s.changeByRange(r=>{let a=[];for(let f=r.from;f<=r.to;){let h=s.doc.lineAt(f);h.number>t&&(r.empty||r.to>h.from)&&(e(h,a,r),t=h.number),f=h.to+1}let u=s.changes(a);return{changes:a,range:qn.range(u.mapPos(r.anchor,1),u.mapPos(r.head,1))}})}const O3e=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),r=new XV(s,{overrideIndentation:u=>{let f=t[u];return f==null?-1:f}}),a=tse(s,(u,f,h)=>{let g=Yoe(r,u.from);if(g==null)return;/\S/.test(u.text)||(g=0);let y=/^\s*/.exec(u.text)[0],C=KP(s,g);(y!=C||h.from<u.from+y.length)&&(t[u.from]=g,f.push({from:u.from,to:u.from+y.length,insert:C}))});return a.changes.empty||e(s.update(a,{userEvent:"indent"})),!0},Rpe=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(tse(s,(t,r)=>{r.push({from:t.from,insert:s.facet(Koe)})}),{userEvent:"input.indent"})),!0),Npe=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(tse(s,(t,r)=>{let a=/^\s*/.exec(t.text)[0];if(!a)return;let u=wO(a,s.tabSize),f=0,h=KP(s,Math.max(0,u-vV(s)));for(;f<a.length&&f<h.length&&a.charCodeAt(f)==h.charCodeAt(f);)f++;r.push({from:t.from+f,to:t.from+a.length,insert:h.slice(f)})}),{userEvent:"delete.dedent"})),!0),M3e=[{key:"Ctrl-b",run:lpe,shift:bpe,preventDefault:!0},{key:"Ctrl-f",run:cpe,shift:vpe},{key:"Ctrl-p",run:dpe,shift:_pe},{key:"Ctrl-n",run:hpe,shift:Cpe},{key:"Ctrl-a",run:e3e,shift:d3e},{key:"Ctrl-e",run:t3e,shift:h3e},{key:"Ctrl-d",run:Epe},{key:"Ctrl-h",run:foe},{key:"Ctrl-k",run:Tpe},{key:"Ctrl-Alt-h",run:Ape},{key:"Ctrl-o",run:w3e},{key:"Ctrl-t",run:_3e},{key:"Ctrl-v",run:uoe}],R3e=[{key:"ArrowLeft",run:lpe,shift:bpe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:jAe,shift:s3e,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:JAe,shift:u3e,preventDefault:!0},{key:"ArrowRight",run:cpe,shift:vpe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ZAe,shift:r3e,preventDefault:!0},{mac:"Cmd-ArrowRight",run:QAe,shift:f3e,preventDefault:!0},{key:"ArrowUp",run:dpe,shift:_pe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Bue,shift:Fue},{mac:"Ctrl-ArrowUp",run:Nue,shift:Pue},{key:"ArrowDown",run:hpe,shift:Cpe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Lue,shift:Hue},{mac:"Ctrl-ArrowDown",run:uoe,shift:Iue},{key:"PageUp",run:Nue,shift:Pue},{key:"PageDown",run:uoe,shift:Iue},{key:"Home",run:XAe,shift:c3e,preventDefault:!0},{key:"Mod-Home",run:Bue,shift:Fue},{key:"End",run:YAe,shift:l3e,preventDefault:!0},{key:"Mod-End",run:Lue,shift:Hue},{key:"Enter",run:T3e},{key:"Mod-a",run:m3e},{key:"Backspace",run:foe,shift:foe},{key:"Delete",run:Epe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ape},{key:"Mod-Delete",mac:"Alt-Delete",run:v3e},{mac:"Mod-Backspace",run:y3e},{mac:"Mod-Delete",run:Tpe}].concat(M3e.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),N3e=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:GAe,shift:i3e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:KAe,shift:a3e},{key:"Alt-ArrowUp",run:C3e},{key:"Shift-Alt-ArrowUp",run:k3e},{key:"Alt-ArrowDown",run:S3e},{key:"Shift-Alt-ArrowDown",run:E3e},{key:"Escape",run:b3e},{key:"Mod-Enter",run:D3e},{key:"Alt-l",mac:"Ctrl-l",run:g3e},{key:"Mod-i",run:p3e,preventDefault:!0},{key:"Mod-[",run:Npe},{key:"Mod-]",run:Rpe},{key:"Mod-Alt-\\",run:O3e},{key:"Shift-Mod-k",run:x3e},{key:"Shift-Mod-\\",run:o3e},{key:"Mod-/",run:EAe},{key:"Alt-A",run:AAe}].concat(R3e),P3e={key:"Tab",run:Rpe,shift:Npe};function mc(){var s=arguments[0];typeof s=="string"&&(s=document.createElement(s));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var a=t[r];typeof a=="string"?s.setAttribute(r,a):a!=null&&(s[r]=a)}e++}for(;e<arguments.length;e++)Ppe(s,arguments[e]);return s}function Ppe(s,e){if(typeof e=="string")s.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)s.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)Ppe(s,e[t]);else throw new RangeError("Unsupported child node: "+e)}const $ue=typeof String.prototype.normalize=="function"?s=>s.normalize("NFKD"):s=>s;class lO{constructor(e,t,r=0,a=e.length,u,f){this.test=f,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,a),this.bufferStart=r,this.normalize=u?h=>u($ue(h)):$ue,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Lh(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Poe(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=O0(e);let a=this.normalize(t);for(let u=0,f=r;;u++){let h=a.charCodeAt(u),g=this.match(h,f);if(u==a.length-1){if(g)return this.value=g,this;break}f==r&&u<t.length&&t.charCodeAt(u)==h&&f++}}}match(e,t){let r=null;for(let a=0;a<this.matches.length;a+=2){let u=this.matches[a],f=!1;this.query.charCodeAt(u)==e&&(u==this.query.length-1?r={from:this.matches[a+1],to:t+1}:(this.matches[a]++,f=!0)),f||(this.matches.splice(a,2),a-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:t+1}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(lO.prototype[Symbol.iterator]=function(){return this});const Ipe={from:-1,to:-1,match:/.*/.exec("")},nse="gm"+(/x/.unicode==null?"":"u");class Bpe{constructor(e,t,r,a=0,u=e.length){if(this.text=e,this.to=u,this.curLine="",this.done=!1,this.value=Ipe,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Lpe(e,t,r,a,u);this.re=new RegExp(t,nse+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let f=e.lineAt(a);this.curLineStart=f.from,this.matchPos=CV(e,a),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,a=r+t[0].length;if(this.matchPos=CV(this.text,a+(r==a?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<a||r>this.value.to)&&(!this.test||this.test(r,a,t)))return this.value={from:r,to:a,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const jte=new WeakMap;class eO{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let a=jte.get(e);if(!a||a.from>=r||a.to<=t){let h=new eO(t,e.sliceString(t,r));return jte.set(e,h),h}if(a.from==t&&a.to==r)return a;let{text:u,from:f}=a;return f>t&&(u=e.sliceString(t,f)+u,f=t),a.to<r&&(u+=e.sliceString(a.to,r)),jte.set(e,new eO(f,u)),new eO(t,u.slice(t-f,r-f))}}class Lpe{constructor(e,t,r,a,u){this.text=e,this.to=u,this.done=!1,this.value=Ipe,this.matchPos=CV(e,a),this.re=new RegExp(t,nse+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=eO.get(e,a,this.chunkEnd(a+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,a=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,a,t)))return this.value={from:r,to:a,match:t},this.matchPos=CV(this.text,a+(r==a?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=eO.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Bpe.prototype[Symbol.iterator]=Lpe.prototype[Symbol.iterator]=function(){return this});function I3e(s){try{return new RegExp(s,nse),!0}catch{return!1}}function CV(s,e){if(e>=s.length)return e;let t=s.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}function doe(s){let e=String(s.state.doc.lineAt(s.state.selection.main.head).number),t=mc("input",{class:"cm-textfield",name:"line",value:e}),r=mc("form",{class:"cm-gotoLine",onkeydown:u=>{u.keyCode==27?(u.preventDefault(),s.dispatch({effects:SV.of(!1)}),s.focus()):u.keyCode==13&&(u.preventDefault(),a())},onsubmit:u=>{u.preventDefault(),a()}},mc("label",s.state.phrase("Go to line"),": ",t)," ",mc("button",{class:"cm-button",type:"submit"},s.state.phrase("go")));function a(){let u=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!u)return;let{state:f}=s,h=f.doc.lineAt(f.selection.main.head),[,g,y,C,A]=u,O=C?+C.slice(1):0,N=y?+y:h.number;if(y&&A){let z=N/100;g&&(z=z*(g=="-"?-1:1)+h.number/f.doc.lines),N=Math.round(f.doc.lines*z)}else y&&g&&(N=N*(g=="-"?-1:1)+h.number);let L=f.doc.line(Math.max(1,Math.min(f.doc.lines,N))),j=qn.cursor(L.from+Math.max(0,Math.min(O,L.length)));s.dispatch({effects:[SV.of(!1),As.scrollIntoView(j.from,{y:"center"})],selection:j}),s.focus()}return{dom:r}}const SV=Pi.define(),zue=md.define({create(){return!0},update(s,e){for(let t of e.effects)t.is(SV)&&(s=t.value);return s},provide:s=>qP.from(s,e=>e?doe:null)}),B3e=s=>{let e=ZP(s,doe);if(!e){let t=[SV.of(!0)];s.state.field(zue,!1)==null&&t.push(Pi.appendConfig.of([zue,L3e])),s.dispatch({effects:t}),e=ZP(s,doe)}return e&&e.dom.querySelector("input").select(),!0},L3e=As.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),F3e={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Fpe=Ds.define({combine(s){return gv(s,F3e,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function H3e(s){let e=[W3e,U3e];return s&&e.push(Fpe.of(s)),e}const $3e=ti.mark({class:"cm-selectionMatch"}),z3e=ti.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Vue(s,e,t,r){return(t==0||s(e.sliceDoc(t-1,t))!=jc.Word)&&(r==e.doc.length||s(e.sliceDoc(r,r+1))!=jc.Word)}function V3e(s,e,t,r){return s(e.sliceDoc(t,t+1))==jc.Word&&s(e.sliceDoc(r-1,r))==jc.Word}const U3e=gf.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.selectionSet||s.docChanged||s.viewportChanged)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let e=s.state.facet(Fpe),{state:t}=s,r=t.selection;if(r.ranges.length>1)return ti.none;let a=r.main,u,f=null;if(a.empty){if(!e.highlightWordAroundCursor)return ti.none;let g=t.wordAt(a.head);if(!g)return ti.none;f=t.charCategorizer(a.head),u=t.sliceDoc(g.from,g.to)}else{let g=a.to-a.from;if(g<e.minSelectionLength||g>200)return ti.none;if(e.wholeWords){if(u=t.sliceDoc(a.from,a.to),f=t.charCategorizer(a.head),!(Vue(f,t,a.from,a.to)&&V3e(f,t,a.from,a.to)))return ti.none}else if(u=t.sliceDoc(a.from,a.to).trim(),!u)return ti.none}let h=[];for(let g of s.visibleRanges){let y=new lO(t.doc,u,g.from,g.to);for(;!y.next().done;){let{from:C,to:A}=y.value;if((!f||Vue(f,t,C,A))&&(a.empty&&C<=a.from&&A>=a.to?h.push(z3e.range(C,A)):(C>=a.to||A<=a.from)&&h.push($3e.range(C,A)),h.length>e.maxMatches))return ti.none}}return ti.set(h)}},{decorations:s=>s.decorations}),W3e=As.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),j3e=({state:s,dispatch:e})=>{let{selection:t}=s,r=qn.create(t.ranges.map(a=>s.wordAt(a.head)||qn.cursor(a.head)),t.mainIndex);return r.eq(t)?!1:(e(s.update({selection:r})),!0)};function Z3e(s,e){let{main:t,ranges:r}=s.selection,a=s.wordAt(t.head),u=a&&a.from==t.from&&a.to==t.to;for(let f=!1,h=new lO(s.doc,e,r[r.length-1].to);;)if(h.next(),h.done){if(f)return null;h=new lO(s.doc,e,0,Math.max(0,r[r.length-1].from-1)),f=!0}else{if(f&&r.some(g=>g.from==h.value.from))continue;if(u){let g=s.wordAt(h.value.from);if(!g||g.from!=h.value.from||g.to!=h.value.to)continue}return h.value}}const q3e=({state:s,dispatch:e})=>{let{ranges:t}=s.selection;if(t.some(u=>u.from===u.to))return j3e({state:s,dispatch:e});let r=s.sliceDoc(t[0].from,t[0].to);if(s.selection.ranges.some(u=>s.sliceDoc(u.from,u.to)!=r))return!1;let a=Z3e(s,r);return a?(e(s.update({selection:s.selection.addRange(qn.range(a.from,a.to),!1),effects:As.scrollIntoView(a.to)})),!0):!1},CO=Ds.define({combine(s){return gv(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new rTe(e),scrollToMatch:e=>As.scrollIntoView(e)})}});class Hpe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||I3e(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?`
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new X3e(this):new K3e(this)}getCursor(e,t=0,r){let a=e.doc?e:Ea.create({doc:e});return r==null&&(r=a.doc.length),this.regexp?LD(this,a,t,r):BD(this,a,t,r)}}class $pe{constructor(e){this.spec=e}}function BD(s,e,t,r){return new lO(e.doc,s.unquoted,t,r,s.caseSensitive?void 0:a=>a.toLowerCase(),s.wholeWord?G3e(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function G3e(s,e){return(t,r,a,u)=>((u>t||u+a.length<r)&&(u=Math.max(0,t-2),a=s.sliceString(u,Math.min(s.length,r+2))),(e(kV(a,t-u))!=jc.Word||e(EV(a,t-u))!=jc.Word)&&(e(EV(a,r-u))!=jc.Word||e(kV(a,r-u))!=jc.Word))}class K3e extends $pe{constructor(e){super(e)}nextMatch(e,t,r){let a=BD(this.spec,e,r,e.doc.length).nextOverlapping();return a.done&&(a=BD(this.spec,e,0,t).nextOverlapping()),a.done?null:a.value}prevMatchInRange(e,t,r){for(let a=r;;){let u=Math.max(t,a-1e4-this.spec.unquoted.length),f=BD(this.spec,e,u,a),h=null;for(;!f.nextOverlapping().done;)h=f.value;if(h)return h;if(u==t)return null;a-=1e4}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=BD(this.spec,e,0,e.doc.length),a=[];for(;!r.next().done;){if(a.length>=t)return null;a.push(r.value)}return a}highlight(e,t,r,a){let u=BD(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!u.next().done;)a(u.value.from,u.value.to)}}function LD(s,e,t,r){return new Bpe(e.doc,s.search,{ignoreCase:!s.caseSensitive,test:s.wholeWord?Y3e(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function kV(s,e){return s.slice(Tm(s,e,!1),e)}function EV(s,e){return s.slice(e,Tm(s,e))}function Y3e(s){return(e,t,r)=>!r[0].length||(s(kV(r.input,r.index))!=jc.Word||s(EV(r.input,r.index))!=jc.Word)&&(s(EV(r.input,r.index+r[0].length))!=jc.Word||s(kV(r.input,r.index+r[0].length))!=jc.Word)}class X3e extends $pe{nextMatch(e,t,r){let a=LD(this.spec,e,r,e.doc.length).next();return a.done&&(a=LD(this.spec,e,0,t).next()),a.done?null:a.value}prevMatchInRange(e,t,r){for(let a=1;;a++){let u=Math.max(t,r-a*1e4),f=LD(this.spec,e,u,r),h=null;for(;!f.next().done;)h=f.value;if(h&&(u==t||h.from>u+10))return h;if(u==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r<e.match.length?e.match[r]:t))}matchAll(e,t){let r=LD(this.spec,e,0,e.doc.length),a=[];for(;!r.next().done;){if(a.length>=t)return null;a.push(r.value)}return a}highlight(e,t,r,a){let u=LD(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!u.next().done;)a(u.value.from,u.value.to)}}const YP=Pi.define(),ose=Pi.define(),uk=md.define({create(s){return new Zte(hoe(s).create(),null)},update(s,e){for(let t of e.effects)t.is(YP)?s=new Zte(t.value.create(),s.panel):t.is(ose)&&(s=new Zte(s.query,t.value?sse:null));return s},provide:s=>qP.from(s,e=>e.panel)});class Zte{constructor(e,t){this.query=e,this.panel=t}}const J3e=ti.mark({class:"cm-searchMatch"}),Q3e=ti.mark({class:"cm-searchMatch cm-searchMatch-selected"}),eTe=gf.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(uk))}update(s){let e=s.state.field(uk);(e!=s.startState.field(uk)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:s,panel:e}){if(!e||!s.spec.valid)return ti.none;let{view:t}=this,r=new mk;for(let a=0,u=t.visibleRanges,f=u.length;a<f;a++){let{from:h,to:g}=u[a];for(;a<f-1&&g>u[a+1].from-2*250;)g=u[++a].to;s.highlight(t.state,h,g,(y,C)=>{let A=t.state.selection.ranges.some(O=>O.from==y&&O.to==C);r.add(y,C,A?Q3e:J3e)})}return r.finish()}},{decorations:s=>s.decorations});function gI(s){return e=>{let t=e.state.field(uk,!1);return t&&t.query.spec.valid?s(e,t):Upe(e)}}const xV=gI((s,{query:e})=>{let{to:t}=s.state.selection.main,r=e.nextMatch(s.state,t,t);if(!r)return!1;let a=qn.single(r.from,r.to),u=s.state.facet(CO);return s.dispatch({selection:a,effects:[rse(s,r),u.scrollToMatch(a.main,s)],userEvent:"select.search"}),Vpe(s),!0}),AV=gI((s,{query:e})=>{let{state:t}=s,{from:r}=t.selection.main,a=e.prevMatch(t,r,r);if(!a)return!1;let u=qn.single(a.from,a.to),f=s.state.facet(CO);return s.dispatch({selection:u,effects:[rse(s,a),f.scrollToMatch(u.main,s)],userEvent:"select.search"}),Vpe(s),!0}),tTe=gI((s,{query:e})=>{let t=e.matchAll(s.state,1e3);return!t||!t.length?!1:(s.dispatch({selection:qn.create(t.map(r=>qn.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),nTe=({state:s,dispatch:e})=>{let t=s.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:a}=t.main,u=[],f=0;for(let h=new lO(s.doc,s.sliceDoc(r,a));!h.next().done;){if(u.length>1e3)return!1;h.value.from==r&&(f=u.length),u.push(qn.range(h.value.from,h.value.to))}return e(s.update({selection:qn.create(u,f),userEvent:"select.search.matches"})),!0},Uue=gI((s,{query:e})=>{let{state:t}=s,{from:r,to:a}=t.selection.main;if(t.readOnly)return!1;let u=e.nextMatch(t,r,r);if(!u)return!1;let f=[],h,g,y=[];if(u.from==r&&u.to==a&&(g=t.toText(e.getReplacement(u)),f.push({from:u.from,to:u.to,insert:g}),u=e.nextMatch(t,u.from,u.to),y.push(As.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),u){let C=f.length==0||f[0].from>=u.to?0:u.to-u.from-g.length;h=qn.single(u.from-C,u.to-C),y.push(rse(s,u)),y.push(t.facet(CO).scrollToMatch(h.main,s))}return s.dispatch({changes:f,selection:h,effects:y,userEvent:"input.replace"}),!0}),oTe=gI((s,{query:e})=>{if(s.state.readOnly)return!1;let t=e.matchAll(s.state,1e9).map(a=>{let{from:u,to:f}=a;return{from:u,to:f,insert:e.getReplacement(a)}});if(!t.length)return!1;let r=s.state.phrase("replaced $ matches",t.length)+".";return s.dispatch({changes:t,effects:As.announce.of(r),userEvent:"input.replace.all"}),!0});function sse(s){return s.state.facet(CO).createPanel(s)}function hoe(s,e){var t,r,a,u,f;let h=s.selection.main,g=h.empty||h.to>h.from+100?"":s.sliceDoc(h.from,h.to);if(e&&!g)return e;let y=s.facet(CO);return new Hpe({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:y.literal)?g:g.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:y.caseSensitive,literal:(a=e==null?void 0:e.literal)!==null&&a!==void 0?a:y.literal,regexp:(u=e==null?void 0:e.regexp)!==null&&u!==void 0?u:y.regexp,wholeWord:(f=e==null?void 0:e.wholeWord)!==null&&f!==void 0?f:y.wholeWord})}function zpe(s){let e=ZP(s,sse);return e&&e.dom.querySelector("[main-field]")}function Vpe(s){let e=zpe(s);e&&e==s.root.activeElement&&e.select()}const Upe=s=>{let e=s.state.field(uk,!1);if(e&&e.panel){let t=zpe(s);if(t&&t!=s.root.activeElement){let r=hoe(s.state,e.query.spec);r.valid&&s.dispatch({effects:YP.of(r)}),t.focus(),t.select()}}else s.dispatch({effects:[ose.of(!0),e?YP.of(hoe(s.state,e.query.spec)):Pi.appendConfig.of(aTe)]});return!0},Wpe=s=>{let e=s.state.field(uk,!1);if(!e||!e.panel)return!1;let t=ZP(s,sse);return t&&t.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:ose.of(!1)}),!0},sTe=[{key:"Mod-f",run:Upe,scope:"editor search-panel"},{key:"F3",run:xV,shift:AV,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:xV,shift:AV,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Wpe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:nTe},{key:"Alt-g",run:B3e},{key:"Mod-d",run:q3e,preventDefault:!0}];class rTe{constructor(e){this.view=e;let t=this.query=e.state.field(uk).query.spec;this.commit=this.commit.bind(this),this.searchField=mc("input",{value:t.search,placeholder:k1(e,"Find"),"aria-label":k1(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=mc("input",{value:t.replace,placeholder:k1(e,"Replace"),"aria-label":k1(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=mc("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=mc("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=mc("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(a,u,f){return mc("button",{class:"cm-button",name:a,onclick:u,type:"button"},f)}this.dom=mc("div",{onkeydown:a=>this.keydown(a),class:"cm-search"},[this.searchField,r("next",()=>xV(e),[k1(e,"next")]),r("prev",()=>AV(e),[k1(e,"previous")]),r("select",()=>tTe(e),[k1(e,"all")]),mc("label",null,[this.caseField,k1(e,"match case")]),mc("label",null,[this.reField,k1(e,"regexp")]),mc("label",null,[this.wordField,k1(e,"by word")]),...e.state.readOnly?[]:[mc("br"),this.replaceField,r("replace",()=>Uue(e),[k1(e,"replace")]),r("replaceAll",()=>oTe(e),[k1(e,"replace all")])],mc("button",{name:"close",onclick:()=>Wpe(e),"aria-label":k1(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new Hpe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:YP.of(e)}))}keydown(e){wEe(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?AV:xV)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Uue(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(YP)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(CO).top}}function k1(s,e){return s.state.phrase(e)}const uz=30,fz=/[\s\.,:;?!]/;function rse(s,{from:e,to:t}){let r=s.state.doc.lineAt(e),a=s.state.doc.lineAt(t).to,u=Math.max(r.from,e-uz),f=Math.min(a,t+uz),h=s.state.sliceDoc(u,f);if(u!=r.from){for(let g=0;g<uz;g++)if(!fz.test(h[g+1])&&fz.test(h[g])){h=h.slice(g);break}}if(f!=a){for(let g=h.length-1;g>h.length-uz;g--)if(!fz.test(h[g-1])&&fz.test(h[g])){h=h.slice(0,g);break}}return As.announce.of(`${s.state.phrase("current match")}. ${h} ${s.state.phrase("on line")} ${r.number}.`)}const iTe=As.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),aTe=[uk,yO.low(eTe),iTe];class jpe{constructor(e,t,r){this.state=e,this.pos=t,this.explicit=r,this.abortListeners=[]}tokenBefore(e){let t=Dm(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),a=t.text.slice(r-t.from,this.pos-t.from),u=a.search(Zpe(e,!1));return u<0?null:{from:r+u,to:this.pos,text:a.slice(u)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Wue(s){let e=Object.keys(s).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function lTe(s){let e=Object.create(null),t=Object.create(null);for(let{label:a}of s){e[a[0]]=!0;for(let u=1;u<a.length;u++)t[a[u]]=!0}let r=Wue(e)+Wue(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function cTe(s){let e=s.map(a=>typeof a=="string"?{label:a}:a),[t,r]=e.every(a=>/^\w+$/.test(a.label))?[/\w*$/,/\w+$/]:lTe(e);return a=>{let u=a.matchBefore(r);return u||a.explicit?{from:u?u.from:a.pos,options:e,validFor:t}:null}}class jue{constructor(e,t,r,a){this.completion=e,this.source=t,this.match=r,this.score=a}}function fk(s){return s.selection.main.from}function Zpe(s,e){var t;let{source:r}=s,a=e&&r[0]!="^",u=r[r.length-1]!="$";return!a&&!u?s:new RegExp(`${a?"^":""}(?:${r})${u?"$":""}`,(t=s.flags)!==null&&t!==void 0?t:s.ignoreCase?"i":"")}const uTe=B_.define();function fTe(s,e,t,r){let{main:a}=s.selection,u=t-a.from,f=r-a.from;return Object.assign(Object.assign({},s.changeByRange(h=>h!=a&&t!=r&&s.sliceDoc(h.from+u,h.from+f)!=s.sliceDoc(t,r)?{range:h}:{changes:{from:h.from+u,to:r==a.from?h.to:h.from+f,insert:e},range:qn.cursor(h.from+u+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const Zue=new WeakMap;function dTe(s){if(!Array.isArray(s))return s;let e=Zue.get(s);return e||Zue.set(s,e=cTe(s)),e}const ise=Pi.define(),XP=Pi.define();class hTe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=Lh(e,t),a=O0(r);this.chars.push(r);let u=e.slice(t,t+a),f=u.toUpperCase();this.folded.push(Lh(f==u?u.toLowerCase():f,0)),t+=a}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,!0}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return!1;let{chars:t,folded:r,any:a,precise:u,byWord:f}=this;if(t.length==1){let ee=Lh(e,0),F=O0(ee),ne=F==e.length?0:-100;if(ee!=t[0])if(ee==r[0])ne+=-200;else return!1;return this.ret(ne,[0,F])}let h=e.indexOf(this.pattern);if(h==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let g=t.length,y=0;if(h<0){for(let ee=0,F=Math.min(e.length,200);ee<F&&y<g;){let ne=Lh(e,ee);(ne==t[y]||ne==r[y])&&(a[y++]=ee),ee+=O0(ne)}if(y<g)return!1}let C=0,A=0,O=!1,N=0,L=-1,j=-1,z=/[a-z]/.test(e),q=!0;for(let ee=0,F=Math.min(e.length,200),ne=0;ee<F&&A<g;){let oe=Lh(e,ee);h<0&&(C<g&&oe==t[C]&&(u[C++]=ee),N<g&&(oe==t[N]||oe==r[N]?(N==0&&(L=ee),j=ee+1,N++):N=0));let re,J=oe<255?oe>=48&&oe<=57||oe>=97&&oe<=122?2:oe>=65&&oe<=90?1:0:(re=Poe(oe))!=re.toLowerCase()?1:re!=re.toUpperCase()?2:0;(!ee||J==1&&z||ne==0&&J!=0)&&(t[A]==oe||r[A]==oe&&(O=!0)?f[A++]=ee:f.length&&(q=!1)),ne=J,ee+=O0(oe)}return A==g&&f[0]==0&&q?this.result(-100+(O?-200:0),f,e):N==g&&L==0?this.ret(-200-e.length+(j==e.length?0:-100),[0,j]):h>-1?this.ret(-700-e.length,[h,h+this.pattern.length]):N==g?this.ret(-200+-700-e.length,[L,j]):A==g?this.result(-100+(O?-200:0)+-700+(q?0:-1100),f,e):t.length==2?!1:this.result((a[0]?-700:0)+-200+-1100,a,e)}result(e,t,r){let a=[],u=0;for(let f of t){let h=f+(this.astral?O0(Lh(r,f)):1);u&&a[u-1]==f?a[u-1]=h:(a[u++]=f,a[u++]=h)}return this.ret(e-r.length,a)}}const Mp=Ds.define({combine(s){return gv(s,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:mTe,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>que(e(r),t(r)),optionClass:(e,t)=>r=>que(e(r),t(r)),addToOptions:(e,t)=>e.concat(t)})}});function que(s,e){return s?e?s+" "+e:s:e}function mTe(s,e,t,r,a,u){let f=s.textDirection==mu.RTL,h=f,g=!1,y="top",C,A,O=e.left-a.left,N=a.right-e.right,L=r.right-r.left,j=r.bottom-r.top;if(h&&O<Math.min(L,N)?h=!1:!h&&N<Math.min(L,O)&&(h=!0),L<=(h?O:N))C=Math.max(a.top,Math.min(t.top,a.bottom-j))-e.top,A=Math.min(400,h?O:N);else{g=!0,A=Math.min(400,(f?e.right:a.right-e.left)-30);let ee=a.bottom-e.bottom;ee>=j||ee>e.top?C=t.bottom-e.top:(y="bottom",C=e.bottom-t.top)}let z=(e.bottom-e.top)/u.offsetHeight,q=(e.right-e.left)/u.offsetWidth;return{style:`${y}: ${C/z}px; max-width: ${A/q}px`,class:"cm-completionInfo-"+(g?f?"left-narrow":"right-narrow":h?"left":"right")}}function gTe(s){let e=s.addToOptions.slice();return s.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(a=>"cm-completionIcon-"+a)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,a){let u=document.createElement("span");u.className="cm-completionLabel";let f=t.displayLabel||t.label,h=0;for(let g=0;g<a.length;){let y=a[g++],C=a[g++];y>h&&u.appendChild(document.createTextNode(f.slice(h,y)));let A=u.appendChild(document.createElement("span"));A.appendChild(document.createTextNode(f.slice(y,C))),A.className="cm-completionMatchedText",h=C}return h<f.length&&u.appendChild(document.createTextNode(f.slice(h))),u},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function Gue(s,e,t){if(s<=t)return{from:0,to:s};if(e<0&&(e=0),e<=s>>1){let a=Math.floor(e/t);return{from:a*t,to:(a+1)*t}}let r=Math.floor((s-e)/t);return{from:s-(r+1)*t,to:s-r*t}}class pTe{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:g=>this.placeInfo(g),key:this},this.space=null,this.currentClass="";let a=e.state.field(t),{options:u,selected:f}=a.open,h=e.state.facet(Mp);this.optionContent=gTe(h),this.optionClass=h.optionClass,this.tooltipClass=h.tooltipClass,this.range=Gue(u.length,f,h.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",g=>{for(let y=g.target,C;y&&y!=this.dom;y=y.parentNode)if(y.nodeName=="LI"&&(C=/-(\d+)$/.exec(y.id))&&+C[1]<u.length){this.applyCompletion(e,u[+C[1]]),g.preventDefault();return}}),this.dom.addEventListener("focusout",g=>{let y=e.state.field(this.stateField,!1);y&&y.tooltip&&e.state.facet(Mp).closeOnBlur&&g.relatedTarget!=e.contentDOM&&e.dispatch({effects:XP.of(null)})}),this.list=this.dom.appendChild(this.createListBox(u,a.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,r,a;let u=e.state.field(this.stateField),f=e.startState.field(this.stateField);this.updateTooltipClass(e.state),u!=f&&(this.updateSel(),((t=u.open)===null||t===void 0?void 0:t.disabled)!=((r=f.open)===null||r===void 0?void 0:r.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((a=u.open)===null||a===void 0)&&a.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Gue(t.options.length,t.selected,this.view.state.facet(Mp).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:a}=r;if(!a)return;let u=typeof a=="string"?document.createTextNode(a):a(r);if(!u)return;"then"in u?u.then(f=>{f&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(f,r)}).catch(f=>R0(this.view.state,f,"completion info")):this.addInfoPane(u,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:a,destroy:u}=e;r.appendChild(a),this.infoDestroy=u||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,a=this.range.from;r;r=r.nextSibling,a++)r.nodeName!="LI"||!r.id?a--:a==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&vTe(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),a=e.getBoundingClientRect(),u=this.space;if(!u){let f=this.dom.ownerDocument.defaultView||window;u={left:0,top:0,right:f.innerWidth,bottom:f.innerHeight}}return a.top>Math.min(u.bottom,t.bottom)-10||a.bottom<Math.max(u.top,t.top)+10?null:this.view.state.facet(Mp).positionInfo(this.view,t,a,r,u,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const a=document.createElement("ul");a.id=t,a.setAttribute("role","listbox"),a.setAttribute("aria-expanded","true"),a.setAttribute("aria-label",this.view.state.phrase("Completions"));let u=null;for(let f=r.from;f<r.to;f++){let{completion:h,match:g}=e[f],{section:y}=h;if(y){let O=typeof y=="string"?y:y.name;if(O!=u&&(f>r.from||r.from==0))if(u=O,typeof y!="string"&&y.header)a.appendChild(y.header(y));else{let N=a.appendChild(document.createElement("completion-section"));N.textContent=O}}const C=a.appendChild(document.createElement("li"));C.id=t+"-"+f,C.setAttribute("role","option");let A=this.optionClass(h);A&&(C.className=A);for(let O of this.optionContent){let N=O(h,this.view.state,g);N&&C.appendChild(N)}}return r.from&&a.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&a.classList.add("cm-completionListIncompleteBottom"),a}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function bTe(s,e){return t=>new pTe(t,s,e)}function vTe(s,e){let t=s.getBoundingClientRect(),r=e.getBoundingClientRect(),a=t.height/s.offsetHeight;r.top<t.top?s.scrollTop-=(t.top-r.top)/a:r.bottom>t.bottom&&(s.scrollTop+=(r.bottom-t.bottom)/a)}function Kue(s){return(s.boost||0)*100+(s.apply?10:0)+(s.info?5:0)+(s.type?1:0)}function yTe(s,e){let t=[],r=null,a=g=>{t.push(g);let{section:y}=g.completion;if(y){r||(r=[]);let C=typeof y=="string"?y:y.name;r.some(A=>A.name==C)||r.push(typeof y=="string"?{name:C}:y)}};for(let g of s)if(g.hasResult()){let y=g.result.getMatch;if(g.result.filter===!1)for(let C of g.result.options)a(new jue(C,g.source,y?y(C):[],1e9-t.length));else{let C=new hTe(e.sliceDoc(g.from,g.to));for(let A of g.result.options)if(C.match(A.label)){let O=A.displayLabel?y?y(A,C.matched):[]:C.matched;a(new jue(A,g.source,O,C.score+(A.boost||0)))}}}if(r){let g=Object.create(null),y=0,C=(A,O)=>{var N,L;return((N=A.rank)!==null&&N!==void 0?N:1e9)-((L=O.rank)!==null&&L!==void 0?L:1e9)||(A.name<O.name?-1:1)};for(let A of r.sort(C))y-=1e5,g[A.name]=y;for(let A of t){let{section:O}=A.completion;O&&(A.score+=g[typeof O=="string"?O:O.name])}}let u=[],f=null,h=e.facet(Mp).compareCompletions;for(let g of t.sort((y,C)=>C.score-y.score||h(y.completion,C.completion))){let y=g.completion;!f||f.label!=y.label||f.detail!=y.detail||f.type!=null&&y.type!=null&&f.type!=y.type||f.apply!=y.apply||f.boost!=y.boost?u.push(g):Kue(g.completion)>Kue(f)&&(u[u.length-1]=g),f=g.completion}return u}class WD{constructor(e,t,r,a,u,f){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=a,this.selected=u,this.disabled=f}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new WD(this.options,Yue(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,a,u){let f=yTe(e,t);if(!f.length)return a&&e.some(g=>g.state==1)?new WD(a.options,a.attrs,a.tooltip,a.timestamp,a.selected,!0):null;let h=t.facet(Mp).selectOnOpen?0:-1;if(a&&a.selected!=h&&a.selected!=-1){let g=a.options[a.selected].completion;for(let y=0;y<f.length;y++)if(f[y].completion==g){h=y;break}}return new WD(f,Yue(r,h),{pos:e.reduce((g,y)=>y.hasResult()?Math.min(g,y.from):g,1e8),create:bTe(O1,Kpe),above:u.aboveCursor},a?a.timestamp:Date.now(),h,!1)}map(e){return new WD(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class TV{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new TV(CTe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Mp),u=(r.override||t.languageDataAt("autocomplete",fk(t)).map(dTe)).map(h=>(this.active.find(y=>y.source==h)||new Ap(h,this.active.some(y=>y.state!=0)?1:0)).update(e,r));u.length==this.active.length&&u.every((h,g)=>h==this.active[g])&&(u=this.active);let f=this.open;f&&e.docChanged&&(f=f.map(e.changes)),e.selection||u.some(h=>h.hasResult()&&e.changes.touchesRange(h.from,h.to))||!wTe(u,this.active)?f=WD.build(u,t,this.id,f,r):f&&f.disabled&&!u.some(h=>h.state==1)&&(f=null),!f&&u.every(h=>h.state!=1)&&u.some(h=>h.hasResult())&&(u=u.map(h=>h.hasResult()?new Ap(h.source,0):h));for(let h of e.effects)h.is(Gpe)&&(f=f&&f.setSelected(h.value,this.id));return u==this.active&&f==this.open?this:new TV(u,this.id,f)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:_Te}}function wTe(s,e){if(s==e)return!0;for(let t=0,r=0;;){for(;t<s.length&&!s[t].hasResult;)t++;for(;r<e.length&&!e[r].hasResult;)r++;let a=t==s.length,u=r==e.length;if(a||u)return a==u;if(s[t++].result!=e[r++].result)return!1}}const _Te={"aria-autocomplete":"list"};function Yue(s,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":s};return e>-1&&(t["aria-activedescendant"]=s+"-"+e),t}const CTe=[];function moe(s){return s.isUserEvent("input.type")?"input":s.isUserEvent("delete.backward")?"delete":null}class Ap{constructor(e,t,r=-1){this.source=e,this.state=t,this.explicitPos=r}hasResult(){return!1}update(e,t){let r=moe(e),a=this;r?a=a.handleUserEvent(e,r,t):e.docChanged?a=a.handleChange(e):e.selection&&a.state!=0&&(a=new Ap(a.source,0));for(let u of e.effects)if(u.is(ise))a=new Ap(a.source,1,u.value?fk(e.state):-1);else if(u.is(XP))a=new Ap(a.source,0);else if(u.is(qpe))for(let f of u.value)f.source==a.source&&(a=f);return a}handleUserEvent(e,t,r){return t=="delete"||!r.activateOnTyping?this.map(e.changes):new Ap(this.source,1)}handleChange(e){return e.changes.touchesRange(fk(e.startState))?new Ap(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ap(this.source,this.state,e.mapPos(this.explicitPos))}}class tO extends Ap{constructor(e,t,r,a,u){super(e,2,t),this.result=r,this.from=a,this.to=u}hasResult(){return!0}handleUserEvent(e,t,r){var a;let u=e.changes.mapPos(this.from),f=e.changes.mapPos(this.to,1),h=fk(e.state);if((this.explicitPos<0?h<=u:h<this.from)||h>f||t=="delete"&&fk(e.startState)==this.from)return new Ap(this.source,t=="input"&&r.activateOnTyping?1:0);let g=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),y;return STe(this.result.validFor,e.state,u,f)?new tO(this.source,g,this.result,u,f):this.result.update&&(y=this.result.update(this.result,u,f,new jpe(e.state,h,g>=0)))?new tO(this.source,g,y,y.from,(a=y.to)!==null&&a!==void 0?a:fk(e.state)):new Ap(this.source,1,g)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ap(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new tO(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function STe(s,e,t,r){if(!s)return!1;let a=e.sliceDoc(t,r);return typeof s=="function"?s(a,t,r,e):Zpe(s,!0).test(a)}const qpe=Pi.define({map(s,e){return s.map(t=>t.map(e))}}),Gpe=Pi.define(),O1=md.define({create(){return TV.start()},update(s,e){return s.update(e)},provide:s=>[YV.from(s,e=>e.tooltip),As.contentAttributes.from(s,e=>e.attrs)]});function Kpe(s,e){const t=e.completion.apply||e.completion.label;let r=s.state.field(O1).active.find(a=>a.source==e.source);return r instanceof tO?(typeof t=="string"?s.dispatch(Object.assign(Object.assign({},fTe(s.state,t,r.from,r.to)),{annotations:uTe.of(e.completion)})):t(s,e.completion,r.from,r.to),!0):!1}function dz(s,e="option"){return t=>{let r=t.state.field(O1,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(Mp).interactionDelay)return!1;let a=1,u;e=="page"&&(u=Tge(t,r.open.tooltip))&&(a=Math.max(2,Math.floor(u.dom.offsetHeight/u.dom.querySelector("li").offsetHeight)-1));let{length:f}=r.open.options,h=r.open.selected>-1?r.open.selected+a*(s?1:-1):s?0:f-1;return h<0?h=e=="page"?0:f-1:h>=f&&(h=e=="page"?f-1:0),t.dispatch({effects:Gpe.of(h)}),!0}}const kTe=s=>{let e=s.state.field(O1,!1);return s.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<s.state.facet(Mp).interactionDelay?!1:Kpe(s,e.open.options[e.open.selected])},ETe=s=>s.state.field(O1,!1)?(s.dispatch({effects:ise.of(!0)}),!0):!1,xTe=s=>{let e=s.state.field(O1,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(s.dispatch({effects:XP.of(null)}),!0)};class ATe{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Xue=50,TTe=50,DTe=1e3,OTe=gf.fromClass(class{constructor(s){this.view=s,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of s.state.field(O1).active)e.state==1&&this.startQuery(e)}update(s){let e=s.state.field(O1);if(!s.selectionSet&&!s.docChanged&&s.startState.field(O1)==e)return;let t=s.transactions.some(r=>(r.selection||r.docChanged)&&!moe(r));for(let r=0;r<this.running.length;r++){let a=this.running[r];if(t||a.updates.length+s.transactions.length>TTe&&Date.now()-a.time>DTe){for(let u of a.context.abortListeners)try{u()}catch(f){R0(this.view.state,f)}a.context.abortListeners=null,this.running.splice(r--,1)}else a.updates.push(...s.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(r=>r.state==1&&!this.running.some(a=>a.active.source==r.source))?setTimeout(()=>this.startUpdate(),Xue):-1,this.composing!=0)for(let r of s.transactions)moe(r)=="input"?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:s}=this.view,e=s.field(O1);for(let t of e.active)t.state==1&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t)}startQuery(s){let{state:e}=this.view,t=fk(e),r=new jpe(e,t,s.explicitPos==t),a=new ATe(s,r);this.running.push(a),Promise.resolve(s.source(r)).then(u=>{a.context.aborted||(a.done=u||null,this.scheduleAccept())},u=>{this.view.dispatch({effects:XP.of(null)}),R0(this.view.state,u)})}scheduleAccept(){this.running.every(s=>s.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),Xue))}accept(){var s;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Mp);for(let r=0;r<this.running.length;r++){let a=this.running[r];if(a.done===void 0)continue;if(this.running.splice(r--,1),a.done){let f=new tO(a.active.source,a.active.explicitPos,a.done,a.done.from,(s=a.done.to)!==null&&s!==void 0?s:fk(a.updates.length?a.updates[0].startState:this.view.state));for(let h of a.updates)f=f.update(h,t);if(f.hasResult()){e.push(f);continue}}let u=this.view.state.field(O1).active.find(f=>f.source==a.active.source);if(u&&u.state==1)if(a.done==null){let f=new Ap(a.active.source,0);for(let h of a.updates)f=f.update(h,t);f.state!=1&&e.push(f)}else this.startQuery(u)}e.length&&this.view.dispatch({effects:qpe.of(e)})}},{eventHandlers:{blur(s){let e=this.view.state.field(O1,!1);if(e&&e.tooltip&&this.view.state.facet(Mp).closeOnBlur){let t=e.open&&Tge(this.view,e.open.tooltip);(!t||!t.dom.contains(s.relatedTarget))&&this.view.dispatch({effects:XP.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ise.of(!1)}),20),this.composing=0}}}),MTe=As.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:`${400}px`,boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30}px`},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),JP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zA=Pi.define({map(s,e){let t=e.mapPos(s,-1,xg.TrackAfter);return t==null?void 0:t}}),ase=new class extends GA{};ase.startSide=1;ase.endSide=-1;const Ype=md.define({create(){return Ya.empty},update(s,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,r=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(r,-1)&&(s=Ya.empty)}s=s.map(e.changes);for(let t of e.effects)t.is(zA)&&(s=s.update({add:[ase.range(t.value,t.value+1)]}));return s}});function RTe(){return[PTe,Ype]}const qte="()[]{}<>";function Xpe(s){for(let e=0;e<qte.length;e+=2)if(qte.charCodeAt(e)==s)return qte.charAt(e+1);return Poe(s<128?s:s+1)}function Jpe(s,e){return s.languageDataAt("closeBrackets",e)[0]||JP}const NTe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),PTe=As.inputHandler.of((s,e,t,r)=>{if((NTe?s.composing:s.compositionStarted)||s.state.readOnly)return!1;let a=s.state.selection.main;if(r.length>2||r.length==2&&O0(Lh(r,0))==1||e!=a.from||t!=a.to)return!1;let u=LTe(s.state,r);return u?(s.dispatch(u),!0):!1}),ITe=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let r=Jpe(s,s.selection.main.head).brackets||JP.brackets,a=null,u=s.changeByRange(f=>{if(f.empty){let h=FTe(s.doc,f.head);for(let g of r)if(g==h&&rU(s.doc,f.head)==Xpe(Lh(g,0)))return{changes:{from:f.head-g.length,to:f.head+g.length},range:qn.cursor(f.head-g.length)}}return{range:a=f}});return a||e(s.update(u,{scrollIntoView:!0,userEvent:"delete.backward"})),!a},BTe=[{key:"Backspace",run:ITe}];function LTe(s,e){let t=Jpe(s,s.selection.main.head),r=t.brackets||JP.brackets;for(let a of r){let u=Xpe(Lh(a,0));if(e==a)return u==a?zTe(s,a,r.indexOf(a+a+a)>-1,t):HTe(s,a,u,t.before||JP.before);if(e==u&&Qpe(s,s.selection.main.from))return $Te(s,a,u)}return null}function Qpe(s,e){let t=!1;return s.field(Ype).between(0,s.doc.length,r=>{r==e&&(t=!0)}),t}function rU(s,e){let t=s.sliceString(e,e+2);return t.slice(0,O0(Lh(t,0)))}function FTe(s,e){let t=s.sliceString(e-2,e);return O0(Lh(t,0))==t.length?t:t.slice(1)}function HTe(s,e,t,r){let a=null,u=s.changeByRange(f=>{if(!f.empty)return{changes:[{insert:e,from:f.from},{insert:t,from:f.to}],effects:zA.of(f.to+e.length),range:qn.range(f.anchor+e.length,f.head+e.length)};let h=rU(s.doc,f.head);return!h||/\s/.test(h)||r.indexOf(h)>-1?{changes:{insert:e+t,from:f.head},effects:zA.of(f.head+e.length),range:qn.cursor(f.head+e.length)}:{range:a=f}});return a?null:s.update(u,{scrollIntoView:!0,userEvent:"input.type"})}function $Te(s,e,t){let r=null,a=s.changeByRange(u=>u.empty&&rU(s.doc,u.head)==t?{changes:{from:u.head,to:u.head+t.length,insert:t},range:qn.cursor(u.head+t.length)}:r={range:u});return r?null:s.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function zTe(s,e,t,r){let a=r.stringPrefixes||JP.stringPrefixes,u=null,f=s.changeByRange(h=>{if(!h.empty)return{changes:[{insert:e,from:h.from},{insert:e,from:h.to}],effects:zA.of(h.to+e.length),range:qn.range(h.anchor+e.length,h.head+e.length)};let g=h.head,y=rU(s.doc,g),C;if(y==e){if(Jue(s,g))return{changes:{insert:e+e,from:g},effects:zA.of(g+e.length),range:qn.cursor(g+e.length)};if(Qpe(s,g)){let O=t&&s.sliceDoc(g,g+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:g,to:g+O.length,insert:O},range:qn.cursor(g+O.length)}}}else{if(t&&s.sliceDoc(g-2*e.length,g)==e+e&&(C=Que(s,g-2*e.length,a))>-1&&Jue(s,C))return{changes:{insert:e+e+e+e,from:g},effects:zA.of(g+e.length),range:qn.cursor(g+e.length)};if(s.charCategorizer(g)(y)!=jc.Word&&Que(s,g,a)>-1&&!VTe(s,g,e,a))return{changes:{insert:e+e,from:g},effects:zA.of(g+e.length),range:qn.cursor(g+e.length)}}return{range:u=h}});return u?null:s.update(f,{scrollIntoView:!0,userEvent:"input.type"})}function Jue(s,e){let t=Dm(s).resolveInner(e+1);return t.parent&&t.from==e}function VTe(s,e,t,r){let a=Dm(s).resolveInner(e,-1),u=r.reduce((f,h)=>Math.max(f,h.length),0);for(let f=0;f<5;f++){let h=s.sliceDoc(a.from,Math.min(a.to,a.from+t.length+u)),g=h.indexOf(t);if(!g||g>-1&&r.indexOf(h.slice(0,g))>-1){let C=a.firstChild;for(;C&&C.from==a.from&&C.to-C.from>t.length+g;){if(s.sliceDoc(C.to-t.length,C.to)==t)return!1;C=C.firstChild}return!0}let y=a.to==e&&a.parent;if(!y)break;a=y}return!1}function Que(s,e,t){let r=s.charCategorizer(e);if(r(s.sliceDoc(e-1,e))!=jc.Word)return e;for(let a of t){let u=e-a.length;if(s.sliceDoc(u,e)==a&&r(s.sliceDoc(u-1,u))!=jc.Word)return u}return-1}function UTe(s={}){return[O1,Mp.of(s),OTe,WTe,MTe]}const e1e=[{key:"Ctrl-Space",run:ETe},{key:"Escape",run:xTe},{key:"ArrowDown",run:dz(!0)},{key:"ArrowUp",run:dz(!1)},{key:"PageDown",run:dz(!0,"page")},{key:"PageUp",run:dz(!1,"page")},{key:"Enter",run:kTe}],WTe=yO.highest(KV.computeN([Mp],s=>s.facet(Mp).defaultKeymap?[e1e]:[]));class jTe{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class HA{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let a=e,u=r.facet(VA).markerFilter;u&&(a=u(a));let f=ti.set(a.map(h=>h.from==h.to||h.from==h.to-1&&r.doc.lineAt(h.from).to==h.from?ti.widget({widget:new e4e(h),diagnostic:h}).range(h.from):ti.mark({attributes:{class:"cm-lintRange cm-lintRange-"+h.severity+(h.markClass?" "+h.markClass:"")},diagnostic:h}).range(h.from,h.to)),!0);return new HA(f,t,cO(f))}}function cO(s,e=null,t=0){let r=null;return s.between(t,1e9,(a,u,{spec:f})=>{if(!(e&&f.diagnostic!=e))return r=new jTe(a,u,f.diagnostic),!1}),r}function t1e(s,e){let t=s.startState.doc.lineAt(e.pos);return!!(s.effects.some(r=>r.is(iU))||s.changes.touchesRange(t.from,t.to))}function n1e(s,e){return s.field(N1,!1)?e:e.concat(Pi.appendConfig.of(c1e))}function ZTe(s,e){return{effects:n1e(s,[iU.of(e)])}}const iU=Pi.define(),lse=Pi.define(),o1e=Pi.define(),N1=md.define({create(){return new HA(ti.none,null,null)},update(s,e){if(e.docChanged){let t=s.diagnostics.map(e.changes),r=null;if(s.selected){let a=e.changes.mapPos(s.selected.from,1);r=cO(t,s.selected.diagnostic,a)||cO(t,null,a)}s=new HA(t,s.panel,r)}for(let t of e.effects)t.is(iU)?s=HA.init(t.value,s.panel,e.state):t.is(lse)?s=new HA(s.diagnostics,t.value?aU.open:null,s.selected):t.is(o1e)&&(s=new HA(s.diagnostics,s.panel,t.value));return s},provide:s=>[qP.from(s,e=>e.panel),As.decorations.from(s,e=>e.diagnostics)]}),qTe=ti.mark({class:"cm-lintRange cm-lintRange-active"});function GTe(s,e,t){let{diagnostics:r}=s.state.field(N1),a=[],u=2e8,f=0;r.between(e-(t<0?1:0),e+(t>0?1:0),(g,y,{spec:C})=>{e>=g&&e<=y&&(g==y||(e>g||t>0)&&(e<y||t<0))&&(a.push(C.diagnostic),u=Math.min(g,u),f=Math.max(y,f))});let h=s.state.facet(VA).tooltipFilter;return h&&(a=h(a)),a.length?{pos:u,end:f,above:s.state.doc.lineAt(u).to<f,create(){return{dom:s1e(s,a)}}}:null}function s1e(s,e){return mc("ul",{class:"cm-tooltip-lint"},e.map(t=>i1e(s,t,!1)))}const KTe=s=>{let e=s.state.field(N1,!1);(!e||!e.panel)&&s.dispatch({effects:n1e(s.state,[lse.of(!0)])});let t=ZP(s,aU.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},efe=s=>{let e=s.state.field(N1,!1);return!e||!e.panel?!1:(s.dispatch({effects:lse.of(!1)}),!0)},YTe=s=>{let e=s.state.field(N1,!1);if(!e)return!1;let t=s.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(s.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},XTe=[{key:"Mod-Shift-m",run:KTe,preventDefault:!0},{key:"F8",run:YTe}],JTe=gf.fromClass(class{constructor(s){this.view=s,this.timeout=-1,this.set=!0;let{delay:e}=s.state.facet(VA);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let s=Date.now();if(s<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-s);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(VA);Promise.all(t.map(r=>Promise.resolve(r(this.view)))).then(r=>{let a=r.reduce((u,f)=>u.concat(f));this.view.state.doc==e.doc&&this.view.dispatch(ZTe(this.view.state,a))},r=>{R0(this.view.state,r)})}}update(s){let e=s.state.facet(VA);(s.docChanged||e!=s.startState.facet(VA)||e.needsRefresh&&e.needsRefresh(s))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),VA=Ds.define({combine(s){return Object.assign({sources:s.map(e=>e.source)},gv(s.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function QTe(s,e={}){return[VA.of({source:s,config:e}),JTe,c1e]}function r1e(s){let e=[];if(s)e:for(let{name:t}of s){for(let r=0;r<t.length;r++){let a=t[r];if(/[a-zA-Z]/.test(a)&&!e.some(u=>u.toLowerCase()==a.toLowerCase())){e.push(a);continue e}}e.push("")}return e}function i1e(s,e,t){var r;let a=t?r1e(e.actions):[];return mc("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},mc("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(r=e.actions)===null||r===void 0?void 0:r.map((u,f)=>{let h=!1,g=O=>{if(O.preventDefault(),h)return;h=!0;let N=cO(s.state.field(N1).diagnostics,e);N&&u.apply(s,N.from,N.to)},{name:y}=u,C=a[f]?y.indexOf(a[f]):-1,A=C<0?y:[y.slice(0,C),mc("u",y.slice(C,C+1)),y.slice(C+1)];return mc("button",{type:"button",class:"cm-diagnosticAction",onclick:g,onmousedown:g,"aria-label":` Action: ${y}${C<0?"":` (access key "${a[f]})"`}.`},A)}),e.source&&mc("div",{class:"cm-diagnosticSource"},e.source))}class e4e extends Sk{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return mc("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class tfe{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=i1e(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class aU{constructor(e){this.view=e,this.items=[];let t=a=>{if(a.keyCode==27)efe(this.view),this.view.focus();else if(a.keyCode==38||a.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(a.keyCode==40||a.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(a.keyCode==36)this.moveSelection(0);else if(a.keyCode==35)this.moveSelection(this.items.length-1);else if(a.keyCode==13)this.view.focus();else if(a.keyCode>=65&&a.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:u}=this.items[this.selectedIndex],f=r1e(u.actions);for(let h=0;h<f.length;h++)if(f[h].toUpperCase().charCodeAt(0)==a.keyCode){let g=cO(this.view.state.field(N1).diagnostics,u);g&&u.actions[h].apply(e,g.from,g.to)}}else return;a.preventDefault()},r=a=>{for(let u=0;u<this.items.length;u++)this.items[u].dom.contains(a.target)&&this.moveSelection(u)};this.list=mc("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=mc("div",{class:"cm-panel-lint"},this.list,mc("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>efe(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(N1).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(N1),r=0,a=!1,u=null;for(e.between(0,this.view.state.doc.length,(f,h,{spec:g})=>{let y=-1,C;for(let A=r;A<this.items.length;A++)if(this.items[A].diagnostic==g.diagnostic){y=A;break}y<0?(C=new tfe(this.view,g.diagnostic),this.items.splice(r,0,C),a=!0):(C=this.items[y],y>r&&(this.items.splice(r,y-r),a=!0)),t&&C.diagnostic==t.diagnostic?C.dom.hasAttribute("aria-selected")||(C.dom.setAttribute("aria-selected","true"),u=C):C.dom.hasAttribute("aria-selected")&&C.dom.removeAttribute("aria-selected"),r++});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)a=!0,this.items.pop();this.items.length==0&&(this.items.push(new tfe(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),a=!0),u?(this.list.setAttribute("aria-activedescendant",u.id),this.view.requestMeasure({key:this,read:()=>({sel:u.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:f,panel:h})=>{let g=h.height/this.list.offsetHeight;f.top<h.top?this.list.scrollTop-=(h.top-f.top)/g:f.bottom>h.bottom&&(this.list.scrollTop+=(f.bottom-h.bottom)/g)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),a&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(N1),r=cO(t.diagnostics,this.items[e].diagnostic);!r||this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:o1e.of(r)})}static open(e){return new aU(e)}}function Vz(s,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(s)}</svg>')`}function hz(s){return Vz(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${s}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const t4e=As.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:hz("#d11")},".cm-lintRange-warning":{backgroundImage:hz("orange")},".cm-lintRange-info":{backgroundImage:hz("#999")},".cm-lintRange-hint":{backgroundImage:hz("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function nfe(s){return s=="error"?4:s=="warning"?3:s=="info"?2:1}class n4e extends l2{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,r)=>nfe(t)<nfe(r.severity)?r.severity:t,"hint")}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let r=this.diagnostics,a=e.state.facet(lU).tooltipFilter;return a&&(r=a(r)),r.length&&(t.onmouseover=()=>s4e(e,t,r)),t}}function o4e(s,e){let t=r=>{let a=e.getBoundingClientRect();if(!(r.clientX>a.left-10&&r.clientX<a.right+10&&r.clientY>a.top-10&&r.clientY<a.bottom+10)){for(let u=r.target;u;u=u.parentNode)if(u.nodeType==1&&u.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",t),s.state.field(l1e)&&s.dispatch({effects:cse.of(null)})}};window.addEventListener("mousemove",t)}function s4e(s,e,t){function r(){let f=s.elementAtHeight(e.getBoundingClientRect().top+5-s.documentTop);s.coordsAtPos(f.from)&&s.dispatch({effects:cse.of({pos:f.from,above:!1,create(){return{dom:s1e(s,t),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,o4e(s,e)}let{hoverTime:a}=s.state.facet(lU),u=setTimeout(r,a);e.onmouseout=()=>{clearTimeout(u),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(u),u=setTimeout(r,a)}}function r4e(s,e){let t=Object.create(null);for(let a of e){let u=s.lineAt(a.from);(t[u.from]||(t[u.from]=[])).push(a)}let r=[];for(let a in t)r.push(new n4e(t[a]).range(+a));return Ya.of(r,!0)}const i4e=Oge({class:"cm-gutter-lint",markers:s=>s.state.field(a1e)}),a1e=md.define({create(){return Ya.empty},update(s,e){s=s.map(e.changes);let t=e.state.facet(lU).markerFilter;for(let r of e.effects)if(r.is(iU)){let a=r.value;t&&(a=t(a||[])),s=r4e(e.state.doc,a.slice(0))}return s}}),cse=Pi.define(),l1e=md.define({create(){return null},update(s,e){return s&&e.docChanged&&(s=t1e(e,s)?null:Object.assign(Object.assign({},s),{pos:e.changes.mapPos(s.pos)})),e.effects.reduce((t,r)=>r.is(cse)?r.value:t,s)},provide:s=>YV.from(s)}),a4e=As.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Vz('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:Vz('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:Vz('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),c1e=[N1,As.decorations.compute([N1],s=>{let{selected:e,panel:t}=s.field(N1);return!e||!t||e.from==e.to?ti.none:ti.set([qTe.range(e.from,e.to)])}),rxe(GTe,{hideOn:t1e}),t4e],lU=Ds.define({combine(s){return gv(s,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function l4e(s={}){return[lU.of(s),a1e,i4e,a4e,l1e]}const ofe=(()=>[hxe(),pxe(),LEe(),IAe(),iAe(),xEe(),MEe(),Ea.allowMultipleSelections.of(!0),Zxe(),lAe(fAe,{fallback:!0}),vAe(),RTe(),UTe(),KEe(),JEe(),UEe(),H3e(),KV.of([...BTe,...N3e,...sTe,...WAe,...nAe,...e1e,...XTe])])();class DV{constructor(e,t,r,a,u,f,h,g,y,C=0,A){this.p=e,this.stack=t,this.state=r,this.reducePos=a,this.pos=u,this.score=f,this.buffer=h,this.bufferBase=g,this.curContext=y,this.lookAhead=C,this.parent=A}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let a=e.parser.context;return new DV(e,[],t,r,r,0,[],0,a?new sfe(a,a.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,a=e&65535,{parser:u}=this.p,f=u.dynamicPrecedence(a);if(f&&(this.score+=f),r==0){this.pushState(u.getGoto(this.state,a,!0),this.reducePos),a<u.minRepeatTerm&&this.storeNode(a,this.reducePos,this.reducePos,4,!0),this.reduceContext(a,this.reducePos);return}let h=this.stack.length-(r-1)*3-(e&262144?6:0),g=h?this.stack[h-2]:this.p.ranges[0].from,y=this.reducePos-g;y>=2e3&&!(!((t=this.p.parser.nodeSet.types[a])===null||t===void 0)&&t.isAnonymous)&&(g==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=y):this.p.lastBigReductionSize<y&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=g,this.p.lastBigReductionSize=y));let C=h?this.stack[h-1]:0,A=this.bufferBase+this.buffer.length-C;if(a<u.minRepeatTerm||e&131072){let O=u.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(a,g,O,A+4,!0)}if(e&262144)this.state=this.stack[h];else{let O=this.stack[h-3];this.state=u.getGoto(O,a,!0)}for(;this.stack.length>h;)this.stack.pop();this.reduceContext(a,g)}storeNode(e,t,r,a=4,u=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let f=this,h=this.buffer.length;if(h==0&&f.parent&&(h=f.bufferBase-f.parent.bufferBase,f=f.parent),h>0&&f.buffer[h-4]==0&&f.buffer[h-1]>-1){if(t==r)return;if(f.buffer[h-2]>=t){f.buffer[h-2]=r;return}}}if(!u||this.pos==r)this.buffer.push(e,t,r,a);else{let f=this.buffer.length;if(f>0&&this.buffer[f-4]!=0)for(;f>0&&this.buffer[f-2]>r;)this.buffer[f]=this.buffer[f-4],this.buffer[f+1]=this.buffer[f-3],this.buffer[f+2]=this.buffer[f-2],this.buffer[f+3]=this.buffer[f-1],f-=4,a>4&&(a-=4);this.buffer[f]=e,this.buffer[f+1]=t,this.buffer[f+2]=r,this.buffer[f+3]=a}}shift(e,t,r,a){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let u=e,{parser:f}=this.p;(a>this.pos||t<=f.maxNode)&&(this.pos=a,f.stateFlag(u,1)||(this.reducePos=a)),this.pushState(u,r),this.shiftContext(t,r),t<=f.maxNode&&this.buffer.push(t,r,a,4)}else this.pos=a,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,a,4)}apply(e,t,r,a){e&65536?this.reduce(e):this.shift(e,t,r,a)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let a=this.pos;this.reducePos=this.pos=a+e.length,this.pushState(t,a),this.buffer.push(r,a,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),a=e.bufferBase+t;for(;e&&a==e.bufferBase;)e=e.parent;return new DV(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,a,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new c4e(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>4<<1||this.stack.length>=120){let a=[];for(let u=0,f;u<t.length;u+=2)(f=t[u+1])!=this.state&&this.p.parser.hasAction(f,e)&&a.push(t[u],f);if(this.stack.length<120)for(let u=0;a.length<4<<1&&u<t.length;u+=2){let f=t[u+1];a.some((h,g)=>g&1&&h==f)||a.push(t[u],f)}t=a}let r=[];for(let a=0;a<t.length&&r.length<4;a+=2){let u=t[a+1];if(u==this.state)continue;let f=this.split();f.pushState(u,this.pos),f.storeNode(0,f.pos,f.pos,4,!0),f.shiftContext(t[a],this.pos),f.score-=200,r.push(f)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,a=t&65535,u=this.stack.length-r*3;if(u<0||e.getGoto(this.stack[u],a,!1)<0){let f=this.findForcedReduction();if(f==null)return!1;t=f}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(a,u)=>{if(!t.includes(a))return t.push(a),e.allActions(a,f=>{if(!(f&393216))if(f&65536){let h=(f>>19)-u;if(h>1){let g=f&65535,y=this.stack.length-h*3;if(y>=0&&e.getGoto(this.stack[y],g,!1)>=0)return h<<19|65536|g}}else{let h=r(f,u+1);if(h!=null)return h}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new sfe(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class sfe{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class c4e{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let a=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=a}}class OV{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new OV(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new OV(this.stack,this.pos,this.index)}}function mz(s,e=Uint16Array){if(typeof s!="string")return s;let t=null;for(let r=0,a=0;r<s.length;){let u=0;for(;;){let f=s.charCodeAt(r++),h=!1;if(f==126){u=65535;break}f>=92&&f--,f>=34&&f--;let g=f-32;if(g>=46&&(g-=46,h=!0),u+=g,h)break;u*=46}t?t[a++]=u:t=new e(u)}return t}class Uz{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const rfe=new Uz;class u4e{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=rfe,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,a=this.rangeIndex,u=this.pos+e;for(;u<r.from;){if(!a)return null;let f=this.ranges[--a];u-=r.from-f.to,r=f}for(;t<0?u>r.to:u>=r.to;){if(a==this.ranges.length-1)return null;let f=this.ranges[++a];u+=f.from-r.to,r=f}return u}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,a;if(t>=0&&t<this.chunk.length)r=this.pos+e,a=this.chunk.charCodeAt(t);else{let u=this.resolveOffset(e,1);if(u==null)return-1;if(r=u,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)a=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let f=this.rangeIndex,h=this.range;for(;h.to<=r;)h=this.ranges[++f];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>h.to&&(this.chunk2=this.chunk2.slice(0,h.to-r)),a=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),a}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=rfe,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let a of this.ranges){if(a.from>=t)break;a.to>e&&(r+=this.input.read(Math.max(a.from,e),Math.min(a.to,t)))}return r}}class nO{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;f4e(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}nO.prototype.contextual=nO.prototype.fallback=nO.prototype.extend=!1;nO.prototype.fallback=nO.prototype.extend=!1;function f4e(s,e,t,r,a,u){let f=0,h=1<<r,{dialect:g}=t.p.parser;e:for(;(h&s[f])!=0;){let y=s[f+1];for(let N=f+3;N<y;N+=2)if((s[N+1]&h)>0){let L=s[N];if(g.allows(L)&&(e.token.value==-1||e.token.value==L||d4e(L,e.token.value,a,u))){e.acceptToken(L);break}}let C=e.next,A=0,O=s[f+2];if(e.next<0&&O>A&&s[y+O*3-3]==65535&&s[y+O*3-3]==65535){f=s[y+O*3-1];continue e}for(;A<O;){let N=A+O>>1,L=y+N+(N<<1),j=s[L],z=s[L+1]||65536;if(C<j)O=N;else if(C>=z)A=N+1;else{f=s[L+2],e.advance();continue e}}break}}function ife(s,e,t){for(let r=e,a;(a=s[r])!=65535;r++)if(a==t)return r-e;return-1}function d4e(s,e,t,r){let a=ife(t,r,e);return a<0||ife(t,r,s)<a}const E1=typeof process<"u"&&process.env&&/\bparse\b/.test({}.LOG);let Gte=null;function afe(s,e,t){let r=s.cursor(Wd.IncludeAnonymous);for(r.moveTo(e);;)if(!(t<0?r.childBefore(e):r.childAfter(e)))for(;;){if((t<0?r.to<e:r.from>e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(s.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:s.length}}class h4e{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?afe(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?afe(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],a=this.index[t];if(a==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let u=r.children[a],f=this.start[t]+r.positions[a];if(f>e)return this.nextStart=f,null;if(u instanceof Bf){if(f==e){if(f<this.safeFrom)return null;let h=f+u.length;if(h<=this.safeTo){let g=u.prop(ca.lookAhead);if(!g||h+g<this.fragment.to)return u}}this.index[t]++,f+u.length>=Math.max(this.safeFrom,e)&&(this.trees.push(u),this.start.push(f),this.index.push(0))}else this.index[t]++,this.nextStart=f+u.length}}}class m4e{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Uz)}getActions(e){let t=0,r=null,{parser:a}=e.p,{tokenizers:u}=a,f=a.stateSlot(e.state,3),h=e.curContext?e.curContext.hash:0,g=0;for(let y=0;y<u.length;y++){if((1<<y&f)==0)continue;let C=u[y],A=this.tokens[y];if(!(r&&!C.fallback)&&((C.contextual||A.start!=e.pos||A.mask!=f||A.context!=h)&&(this.updateCachedToken(A,C,e),A.mask=f,A.context=h),A.lookAhead>A.end+25&&(g=Math.max(A.lookAhead,g)),A.value!=0)){let O=t;if(A.extended>-1&&(t=this.addActions(e,A.extended,A.end,t)),t=this.addActions(e,A.value,A.end,t),!C.extend&&(r=A,t>O))break}}for(;this.actions.length>t;)this.actions.pop();return g&&e.setLookAhead(g),!r&&e.pos==this.stream.end&&(r=new Uz,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Uz,{pos:r,p:a}=e;return t.start=r,t.end=Math.min(r+1,a.stream.end),t.value=r==a.stream.end?a.parser.eofTerm:0,t}updateCachedToken(e,t,r){let a=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(a,e),r),e.value>-1){let{parser:u}=r.p;for(let f=0;f<u.specialized.length;f++)if(u.specialized[f]==e.value){let h=u.specializers[f](this.stream.read(e.start,e.end),r);if(h>=0&&r.p.parser.dialect.allows(h>>1)){(h&1)==0?e.value=h>>1:e.extended=h>>1;break}}}else e.value=0,e.end=this.stream.clipPos(a+1)}putAction(e,t,r,a){for(let u=0;u<a;u+=3)if(this.actions[u]==e)return a;return this.actions[a++]=e,this.actions[a++]=t,this.actions[a++]=r,a}addActions(e,t,r,a){let{state:u}=e,{parser:f}=e.p,{data:h}=f;for(let g=0;g<2;g++)for(let y=f.stateSlot(u,g?2:1);;y+=3){if(h[y]==65535)if(h[y+1]==1)y=k_(h,y+2);else{a==0&&h[y+1]==2&&(a=this.putAction(k_(h,y+2),t,r,a));break}h[y]==t&&(a=this.putAction(k_(h,y+1),t,r,a))}return a}}class g4e{constructor(e,t,r,a){this.parser=e,this.input=t,this.ranges=a,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new u4e(t,a),this.tokens=new m4e(e,this.stream),this.topTerm=e.top[1];let{from:u}=a[0];this.stacks=[DV.start(this,e.top[0],u)],this.fragments=r.length&&this.stream.end-u>e.bufferLength*4?new h4e(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],a,u;if(this.bigReductionCount>300&&e.length==1){let[f]=e;for(;f.forceReduce()&&f.stack.length&&f.stack[f.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let f=0;f<e.length;f++){let h=e[f];for(;;){if(this.tokens.mainToken=null,h.pos>t)r.push(h);else{if(this.advanceStack(h,r,e))continue;{a||(a=[],u=[]),a.push(h);let g=this.tokens.getMainToken(h);u.push(g.value,g.end)}}break}}if(!r.length){let f=a&&b4e(a);if(f)return E1&&console.log("Finish with "+this.stackID(f)),this.stackToTree(f);if(this.parser.strict)throw E1&&a&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&a){let f=this.stoppedAt!=null&&a[0].pos>this.stoppedAt?a[0]:this.runRecovery(a,u,r);if(f)return E1&&console.log("Force-finish "+this.stackID(f)),this.stackToTree(f.forceAll())}if(this.recovering){let f=this.recovering==1?1:this.recovering*3;if(r.length>f)for(r.sort((h,g)=>g.score-h.score);r.length>f;)r.pop();r.some(h=>h.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let f=0;f<r.length-1;f++){let h=r[f];for(let g=f+1;g<r.length;g++){let y=r[g];if(h.sameState(y)||h.buffer.length>500&&y.buffer.length>500)if((h.score-y.score||h.buffer.length-y.buffer.length)>0)r.splice(g--,1);else{r.splice(f--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let f=1;f<r.length;f++)r[f].pos<this.minStackPos&&(this.minStackPos=r[f].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,r){let a=e.pos,{parser:u}=this,f=E1?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&a>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let y=e.curContext&&e.curContext.tracker.strict,C=y?e.curContext.hash:0;for(let A=this.fragments.nodeAt(a);A;){let O=this.parser.nodeSet.types[A.type.id]==A.type?u.getGoto(e.state,A.type.id):-1;if(O>-1&&A.length&&(!y||(A.prop(ca.contextHash)||0)==C))return e.useNode(A,O),E1&&console.log(f+this.stackID(e)+` (via reuse of ${u.getName(A.type.id)})`),!0;if(!(A instanceof Bf)||A.children.length==0||A.positions[0]>0)break;let N=A.children[0];if(N instanceof Bf&&A.positions[0]==0)A=N;else break}}let h=u.stateSlot(e.state,4);if(h>0)return e.reduce(h),E1&&console.log(f+this.stackID(e)+` (via always-reduce ${u.getName(h&65535)})`),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let g=this.tokens.getActions(e);for(let y=0;y<g.length;){let C=g[y++],A=g[y++],O=g[y++],N=y==g.length||!r,L=N?e:e.split(),j=this.tokens.mainToken;if(L.apply(C,A,j?j.start:L.pos,O),E1&&console.log(f+this.stackID(L)+` (via ${(C&65536)==0?"shift":`reduce of ${u.getName(C&65535)}`} for ${u.getName(A)} @ ${a}${L==e?"":", split"})`),N)return!0;L.pos>a?t.push(L):r.push(L)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return lfe(e,t),!0}}runRecovery(e,t,r){let a=null,u=!1;for(let f=0;f<e.length;f++){let h=e[f],g=t[f<<1],y=t[(f<<1)+1],C=E1?this.stackID(h)+" -> ":"";if(h.deadEnd&&(u||(u=!0,h.restart(),E1&&console.log(C+this.stackID(h)+" (restarted)"),this.advanceFully(h,r))))continue;let A=h.split(),O=C;for(let N=0;A.forceReduce()&&N<10&&(E1&&console.log(O+this.stackID(A)+" (via force-reduce)"),!this.advanceFully(A,r));N++)E1&&(O=this.stackID(A)+" -> ");for(let N of h.recoverByInsert(g))E1&&console.log(C+this.stackID(N)+" (via recover-insert)"),this.advanceFully(N,r);this.stream.end>h.pos?(y==h.pos&&(y++,g=0),h.recoverByDelete(g,y),E1&&console.log(C+this.stackID(h)+` (via recover-delete ${this.parser.getName(g)})`),lfe(h,r)):(!a||a.score<h.score)&&(a=h)}return a}stackToTree(e){return e.close(),Bf.build({buffer:OV.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Gte||(Gte=new WeakMap)).get(e);return t||Gte.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function lfe(s,e){for(let t=0;t<e.length;t++){let r=e[t];if(r.pos==s.pos&&r.sameState(s)){e[t].score<s.score&&(e[t]=s);return}}e.push(s)}class p4e{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class MV extends Lge{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (${14})`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let h=0;h<e.repeatNodeCount;h++)t.push("");let r=Object.keys(e.topRules).map(h=>e.topRules[h][1]),a=[];for(let h=0;h<t.length;h++)a.push([]);function u(h,g,y){a[h].push([g,g.deserialize(String(y))])}if(e.nodeProps)for(let h of e.nodeProps){let g=h[0];typeof g=="string"&&(g=ca[g]);for(let y=1;y<h.length;){let C=h[y++];if(C>=0)u(C,g,h[y++]);else{let A=h[y+-C];for(let O=-C;O>0;O--)u(h[y++],g,A);y++}}}this.nodeSet=new joe(t.map((h,g)=>Np.define({name:g>=this.minRepeatTerm?void 0:h,id:g,props:a[g],top:r.indexOf(g)>-1,error:g==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(g)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Nge;let f=mz(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let h=0;h<this.specializerSpecs.length;h++)this.specialized[h]=this.specializerSpecs[h].term;this.specializers=this.specializerSpecs.map(cfe),this.states=mz(e.states,Uint32Array),this.data=mz(e.stateData),this.goto=mz(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(h=>typeof h=="number"?new nO(f,h):h),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let a=new g4e(this,e,t,r);for(let u of this.wrappers)a=u(a,e,t,r);return a}getGoto(e,t,r=!1){let a=this.goto;if(t>=a[0])return-1;for(let u=a[t+1];;){let f=a[u++],h=f&1,g=a[u++];if(h&&r)return g;for(let y=u+(f>>1);u<y;u++)if(a[u]==e)return g;if(h)return-1}}hasAction(e,t){let r=this.data;for(let a=0;a<2;a++)for(let u=this.stateSlot(e,a?2:1),f;;u+=3){if((f=r[u])==65535)if(r[u+1]==1)f=r[u=k_(r,u+2)];else{if(r[u+1]==2)return k_(r,u+2);break}if(f==t||f==0)return k_(r,u+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),a=r?t(r):void 0;for(let u=this.stateSlot(e,1);a==null;u+=3){if(this.data[u]==65535)if(this.data[u+1]==1)u=k_(this.data,u+2);else break;a=t(k_(this.data,u+1))}return a}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=k_(this.data,r+2);else break;if((this.data[r+2]&1)==0){let a=this.data[r+1];t.some((u,f)=>f&1&&u==a)||t.push(this.data[r],a)}}return t}configure(e){let t=Object.assign(Object.create(MV.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let a=e.tokenizers.find(u=>u.from==r);return a?a.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,a)=>{let u=e.specializers.find(h=>h.from==r.external);if(!u)return r;let f=Object.assign(Object.assign({},r),{external:u.to});return t.specializers[a]=cfe(f),f})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let u of e.split(" ")){let f=t.indexOf(u);f>=0&&(r[f]=!0)}let a=null;for(let u=0;u<t.length;u++)if(!r[u])for(let f=this.dialects[t[u]],h;(h=this.data[f++])!=65535;)(a||(a=new Uint8Array(this.maxTerm+1)))[h]=1;return new p4e(e,r,a)}static deserialize(e){return new MV(e)}}function k_(s,e){return s[e]|s[e+1]<<16}function b4e(s){let e=null;for(let t of s){let r=t.p.stoppedAt;(t.pos==t.p.stream.end||r!=null&&t.pos>r)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function cfe(s){if(s.external){let e=s.extend?1:0;return(t,r)=>s.external(t,r)<<1|e}return s.get}const v4e=Fge({String:Vo.string,Number:Vo.number,"True False":Vo.bool,PropertyName:Vo.propertyName,Null:Vo.null,",":Vo.separator,"[ ]":Vo.squareBracket,"{ }":Vo.brace}),y4e=MV.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[v4e],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),w4e=()=>s=>{try{JSON.parse(s.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=_4e(e,s.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function _4e(s,e){let t;return(t=s.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=s.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const C4e=pV.define({name:"json",parser:y4e.configure({props:[Vge.add({Object:Due({except:/^\s*\}/}),Array:Due({except:/^\s*\]/})}),Wge.add({"Object Array":Gxe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function ufe(){return new Bxe(C4e)}function S4e(s){let e,t;return{c(){e=ce("div"),W(e,"class",t="is-editable-"+s[0])},m(r,a){Le(r,e,a),s[3](e)},p(r,[a]){a&1&&t!==(t="is-editable-"+r[0])&&W(e,"class",t)},i:Sn,o:Sn,d(r){r&&Ie(e),s[3](null)}}}function k4e(s,e,t){let r,a,{value:u}=e,{editable:f=!0}=e;H0(()=>{let g=new rO,y=new rO,C=Ea.create({doc:JSON.stringify(u,null,4),extensions:[ofe,KV.of([P3e]),g.of(ufe()),ufe(),y.of(Ea.tabSize.of(4)),l4e(),ofe,As.editable.of(f),As.updateListener.of(function(A){A.docChanged&&t(2,u=A.state.doc.toString())}),QTe(w4e())]});a=new As({state:C,parent:r})}),yhe(()=>{a&&a.destroy()});function h(g){ss[g?"unshift":"push"](()=>{r=g,t(1,r)})}return s.$$set=g=>{"value"in g&&t(2,u=g.value),"editable"in g&&t(0,f=g.editable)},[f,r,u,h]}class E4e extends ko{constructor(e){super(),So(this,e,k4e,S4e,Co,{value:2,editable:0})}}function ffe(s){let e,t;return{c(){e=ce("div"),t=Kt(s[3]),W(e,"class","invalid-feedback d-block")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&8&&Gn(t,r[3])},d(r){r&&Ie(e)}}}function x4e(s){let e,t,r,a,u;function f(y){s[5](y)}let h={editable:!s[1].readonly||s[2]};s[0]!==void 0&&(h.value=s[0]),t=new E4e({props:h}),ss.push(()=>Er(t,"value",f));let g=s[3]&&ffe(s);return{c(){e=ce("div"),rn(t.$$.fragment),a=Xe(),g&&g.c(),W(e,"class","mb-3")},m(y,C){Le(y,e,C),on(t,e,null),Q(e,a),g&&g.m(e,null),u=!0},p(y,[C]){const A={};C&6&&(A.editable=!y[1].readonly||y[2]),!r&&C&1&&(r=!0,A.value=y[0],Dr(()=>r=!1)),t.$set(A),y[3]?g?g.p(y,C):(g=ffe(y),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i(y){u||(Re(t.$$.fragment,y),u=!0)},o(y){Ue(t.$$.fragment,y),u=!1},d(y){y&&Ie(e),sn(t),g&&g.d()}}}function A4e(s,e,t){let r,{value:a}=e,{field:u}=e,{isCreateMode:f}=e,{validationErrors:h}=e;function g(y){a=y,t(0,a)}return s.$$set=y=>{"value"in y&&t(0,a=y.value),"field"in y&&t(1,u=y.field),"isCreateMode"in y&&t(2,f=y.isCreateMode),"validationErrors"in y&&t(4,h=y.validationErrors)},s.$$.update=()=>{s.$$.dirty&18&&t(3,r=Rg(h,u.name))},[a,u,f,r,h,g]}class T4e extends ko{constructor(e){super(),So(this,e,A4e,x4e,Co,{value:0,field:1,isCreateMode:2,validationErrors:4})}}function dfe(s){let e,t=s[0].help+"",r;return{c(){e=ce("small"),r=Kt(t),W(e,"class","text-primary opacity-50")},m(a,u){Le(a,e,u),Q(e,r)},p(a,u){u&1&&t!==(t=a[0].help+"")&&Gn(r,t)},d(a){a&&Ie(e)}}}function D4e(s){let e,t,r,a,u=s[0].label+"",f,h,g,y,C,A=s[0].name+"",O,N,L=s[0].help&&dfe(s);return{c(){e=ce("div"),t=ce("div"),r=ce("div"),a=ce("label"),f=Kt(u),h=Xe(),L&&L.c(),g=Xe(),y=ce("a"),C=ce("code"),O=Kt(A),W(a,"for",s[2]),W(a,"class","form-label"),W(C,"class","text-primary opacity-50"),W(y,"tabindex","-1"),W(y,"class","text-decoration-none"),W(y,"href",N=s[3].lucentUrl+"/schemas/"+s[1].name+"/fields/edit/"+s[0].name),W(t,"class","d-flex justify-content-between"),W(e,"class","mb-1")},m(j,z){Le(j,e,z),Q(e,t),Q(t,r),Q(r,a),Q(a,f),Q(r,h),L&&L.m(r,null),Q(t,g),Q(t,y),Q(y,C),Q(C,O)},p(j,[z]){z&1&&u!==(u=j[0].label+"")&&Gn(f,u),z&4&&W(a,"for",j[2]),j[0].help?L?L.p(j,z):(L=dfe(j),L.c(),L.m(r,null)):L&&(L.d(1),L=null),z&1&&A!==(A=j[0].name+"")&&Gn(O,A),z&3&&N!==(N=j[3].lucentUrl+"/schemas/"+j[1].name+"/fields/edit/"+j[0].name)&&W(y,"href",N)},i:Sn,o:Sn,d(j){j&&Ie(e),L&&L.d()}}}function O4e(s,e,t){const r=ji("channel");let{field:a}=e,{schema:u}=e,{id:f}=e;return s.$$set=h=>{"field"in h&&t(0,a=h.field),"schema"in h&&t(1,u=h.schema),"id"in h&&t(2,f=h.id)},[a,u,f,r]}class M4e extends ko{constructor(e){super(),So(this,e,O4e,D4e,Co,{field:0,schema:1,id:2})}}function hfe(s,e,t){const r=s.slice();return r[2]=e[t],r}function mfe(s,e,t){const r=s.slice();return r[1]=e[t],r[17]=t,r}function gfe(s,e,t){const r=s.slice();return r[1]=e[t],r}function pfe(s){let e,t;return{c(){e=ce("div"),t=Kt(s[5]),W(e,"class","invalid-feedback d-block mb-3")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&32&&Gn(t,r[5])},d(r){r&&Ie(e)}}}function bfe(s){let e,t,r,a,u,f,h,g,y,C,A,O=s[3],N=[];for(let L=0;L<O.length;L+=1)N[L]=vfe(gfe(s,O,L));return C=new ZV({props:{isTable:!0,$$slots:{default:[R4e]},$$scope:{ctx:s}}}),C.$on("update",s[10]),{c(){e=ce("div"),t=ce("table"),r=ce("thead"),a=ce("tr"),u=ce("th"),f=Xe();for(let L=0;L<N.length;L+=1)N[L].c();h=Xe(),g=ce("th"),y=Xe(),rn(C.$$.fragment),W(r,"class","table-light"),W(t,"class",""),W(e,"class","lx-table rounded")},m(L,j){Le(L,e,j),Q(e,t),Q(t,r),Q(r,a),Q(a,u),Q(a,f);for(let z=0;z<N.length;z+=1)N[z]&&N[z].m(a,null);Q(a,h),Q(a,g),Q(t,y),on(C,t,null),A=!0},p(L,j){if(j&8){O=L[3];let q;for(q=0;q<O.length;q+=1){const ee=gfe(L,O,q);N[q]?N[q].p(ee,j):(N[q]=vfe(ee),N[q].c(),N[q].m(a,h))}for(;q<N.length;q+=1)N[q].d(1);N.length=O.length}const z={};j&1048601&&(z.$$scope={dirty:j,ctx:L}),C.$set(z)},i(L){A||(Re(C.$$.fragment,L),A=!0)},o(L){Ue(C.$$.fragment,L),A=!1},d(L){L&&Ie(e),ul(N,L),sn(C)}}}function vfe(s){let e,t=s[1].label+"",r,a,u;return{c(){e=ce("th"),r=Kt(t),W(e,"class",a="field-ui-"+s[1].ui),W(e,"scope","col"),W(e,"title",u=s[1].help),W(e,"data-bs-toggle","tooltip"),W(e,"data-bs-placement","top")},m(f,h){Le(f,e,h),Q(e,r)},p(f,h){h&8&&t!==(t=f[1].label+"")&&Gn(r,t),h&8&&a!==(a="field-ui-"+f[1].ui)&&W(e,"class",a),h&8&&u!==(u=f[1].help)&&W(e,"title",u)},d(f){f&&Ie(e)}}}function yfe(s){let e,t,r,a;return t=new Fhe({props:{record:s[2],graph:s[0],schema:s[8],field:s[1]}}),{c(){e=ce("td"),rn(t.$$.fragment),W(e,"class",r="field-ui-"+s[1].ui)},m(u,f){Le(u,e,f),on(t,e,null),a=!0},p(u,f){const h={};f&16&&(h.record=u[2]),f&1&&(h.graph=u[0]),f&8&&(h.field=u[1]),t.$set(h),(!a||f&8&&r!==(r="field-ui-"+u[1].ui))&&W(e,"class",r)},i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function wfe(s,e){let t,r,a,u,f,h=dd(e[6].schemas,e[2])+"",g,y,C,A,O,N,L,j,z,q,ee,F=e[3],ne=[];for(let J=0;J<F.length;J+=1)ne[J]=yfe(mfe(e,F,J));const oe=J=>Ue(ne[J],1,1,()=>{ne[J]=null});L=new wl({props:{icon:"trash-can"}});function re(...J){return e[13](e[2],...J)}return{key:s,first:null,c(){t=ce("tr"),r=ce("td"),a=ce("div"),u=ce("div"),f=ce("a"),g=Kt(h),C=Xe();for(let J=0;J<ne.length;J+=1)ne[J].c();A=Xe(),O=ce("td"),N=ce("button"),rn(L.$$.fragment),j=Xe(),W(f,"class","me-2 text-decoration-none text-dark fs-6"),W(f,"href",y=e[6].lucentUrl+"/records/"+e[2].id),W(f,"target","_blank"),W(u,"class","d-flex align-items-center"),W(a,"class",""),W(r,"class",""),W(N,"class","trash-button text-dark btn btn-sm btn-link"),this.first=t},m(J,we){Le(J,t,we),Q(t,r),Q(r,a),Q(a,u),Q(u,f),Q(f,g),Q(t,C);for(let ye=0;ye<ne.length;ye+=1)ne[ye]&&ne[ye].m(t,null);Q(t,A),Q(t,O),Q(O,N),on(L,N,null),Q(t,j),z=!0,q||(ee=Dn(N,"click",re),q=!0)},p(J,we){if(e=J,(!z||we&16)&&h!==(h=dd(e[6].schemas,e[2])+"")&&Gn(g,h),(!z||we&16&&y!==(y=e[6].lucentUrl+"/records/"+e[2].id))&&W(f,"href",y),we&281){F=e[3];let ye;for(ye=0;ye<F.length;ye+=1){const De=mfe(e,F,ye);ne[ye]?(ne[ye].p(De,we),Re(ne[ye],1)):(ne[ye]=yfe(De),ne[ye].c(),Re(ne[ye],1),ne[ye].m(t,A))}for(To(),ye=F.length;ye<ne.length;ye+=1)oe(ye);Do()}},i(J){if(!z){for(let we=0;we<F.length;we+=1)Re(ne[we]);Re(L.$$.fragment,J),z=!0}},o(J){ne=ne.filter(Boolean);for(let we=0;we<ne.length;we+=1)Ue(ne[we]);Ue(L.$$.fragment,J),z=!1},d(J){J&&Ie(t),ul(ne,J),sn(L),q=!1,ee()}}}function R4e(s){let e=[],t=new Map,r,a,u=s[4];const f=h=>h[2].id;for(let h=0;h<u.length;h+=1){let g=hfe(s,u,h),y=f(g);t.set(y,e[h]=wfe(y,g))}return{c(){for(let h=0;h<e.length;h+=1)e[h].c();r=Rs()},m(h,g){for(let y=0;y<e.length;y+=1)e[y]&&e[y].m(h,g);Le(h,r,g),a=!0},p(h,g){g&857&&(u=h[4],To(),e=Om(e,g,f,1,h,u,t,r.parentNode,f2,wfe,r,hfe),Do())},i(h){if(!a){for(let g=0;g<u.length;g+=1)Re(e[g]);a=!0}},o(h){for(let g=0;g<e.length;g+=1)Ue(e[g]);a=!1},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Ie(r)}}}function N4e(s){let e,t,r,a,u,f,h=s[5]&&pfe(s);r=new lI({props:{field:s[1],buttonClass:"mt-2",recordId:null,schemas:s[7]}}),r.$on("insert",s[11]),r.$on("save",s[11]);let g=s[4].length>0&&bfe(s);return{c(){h&&h.c(),e=Xe(),t=ce("div"),rn(r.$$.fragment),a=Xe(),g&&g.c(),u=Rs(),W(t,"class","inline-card-wrapper")},m(y,C){h&&h.m(y,C),Le(y,e,C),Le(y,t,C),on(r,t,null),Le(y,a,C),g&&g.m(y,C),Le(y,u,C),f=!0},p(y,[C]){y[5]?h?h.p(y,C):(h=pfe(y),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null);const A={};C&2&&(A.field=y[1]),r.$set(A),y[4].length>0?g?(g.p(y,C),C&16&&Re(g,1)):(g=bfe(y),g.c(),Re(g,1),g.m(u.parentNode,u)):g&&(To(),Ue(g,1,1,()=>{g=null}),Do())},i(y){f||(Re(r.$$.fragment,y),Re(g),f=!0)},o(y){Ue(r.$$.fragment,y),Ue(g),f=!1},d(y){h&&h.d(y),y&&Ie(e),y&&Ie(t),sn(r),y&&Ie(a),g&&g.d(y),y&&Ie(u)}}}function P4e(s,e,t){let r,a,u;const f=ji("channel");let{field:h}=e,{record:g}=e,{graph:y}=e,{validationErrors:C}=e,A=f.schemas.filter(q=>h.collections.includes(q.name)),O=f.schemas.filter(q=>h.collections.includes(q.name))[0];function N(q,ee){q.preventDefault(),t(0,y.edges=y.edges.filter(F=>!(F.target===ee&&F.field===h.name)),y)}function L(q){t(0,y.edges=aI(q.detail.source,q.detail.target,y.edges,h.name),y)}function j(q){q.preventDefault(),t(0,y=Ooe(y,g,q.detail.records,h.name,q.detail.action)),console.log(y)}const z=(q,ee)=>N(ee,q.id);return s.$$set=q=>{"field"in q&&t(1,h=q.field),"record"in q&&t(2,g=q.record),"graph"in q&&t(0,y=q.graph),"validationErrors"in q&&t(12,C=q.validationErrors)},s.$$.update=()=>{var q;s.$$.dirty&4098&&t(5,r=Rg(C,h.name)),s.$$.dirty&7&&t(4,a=(q=y.edges.filter(ee=>ee.field===h.name).map(ee=>y.records.find(F=>F.id==ee.target&&g.id==ee.source)).filter(ee=>!!(ee!=null&&ee.id)))!=null?q:[])},t(3,u=[]),[y,h,g,u,a,r,f,A,O,N,L,j,C,z]}class I4e extends ko{constructor(e){super(),So(this,e,P4e,N4e,Co,{field:1,record:2,graph:0,validationErrors:12})}}function _fe(s,e,t){const r=s.slice();return r[2]=e[t],r}function Cfe(s,e,t){const r=s.slice();return r[22]=e[t],r}function Sfe(s){let e,t;return{c(){e=ce("div"),t=Kt(s[6]),W(e,"class","invalid-feedback d-block mb-3")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&64&&Gn(t,r[6])},d(r){r&&Ie(e)}}}function kfe(s){let e=[],t=new Map,r,a=s[4];const u=h=>h[22].id;for(let h=0;h<a.length;h+=1){let g=Cfe(s,a,h),y=u(g);t.set(y,e[h]=xfe(y,g))}let f=null;return a.length||(f=Efe()),{c(){for(let h=0;h<e.length;h+=1)e[h].c();r=Rs(),f&&f.c()},m(h,g){for(let y=0;y<e.length;y+=1)e[y]&&e[y].m(h,g);Le(h,r,g),f&&f.m(h,g)},p(h,g){g&1168&&(a=h[4],e=Om(e,g,u,1,h,a,t,r.parentNode,nI,xfe,r,Cfe),a.length?f&&(f.d(1),f=null):f||(f=Efe(),f.c(),f.m(r.parentNode,r)))},d(h){for(let g=0;g<e.length;g+=1)e[g].d(h);h&&Ie(r),f&&f.d(h)}}}function Efe(s){let e;return{c(){e=Kt("Start typing...")},m(t,r){Le(t,e,r)},d(t){t&&Ie(e)}}}function xfe(s,e){let t,r,a=dd(e[7].schemas,e[22])+"",u,f,h,g;function y(...A){return e[15](e[22],...A)}function C(...A){return e[16](e[22],...A)}return{key:s,first:null,c(){t=ce("div"),r=ce("span"),u=Kt(a),f=Xe(),W(r,"class","dropdown-item"),this.first=t},m(A,O){Le(A,t,O),Q(t,r),Q(r,u),Q(t,f),h||(g=[Dn(t,"click",y),Dn(t,"keypress",C)],h=!0)},p(A,O){e=A,O&16&&a!==(a=dd(e[7].schemas,e[22])+"")&&Gn(u,a)},d(A){A&&Ie(t),h=!1,Zi(g)}}}function Afe(s){let e,t,r,a,u,f,h;return{c(){e=ce("div"),t=ce("span"),r=Kt('Add "'),a=Kt(s[3]),u=Kt('"'),W(t,"class","dropdown-item")},m(g,y){Le(g,e,y),Q(e,t),Q(t,r),Q(t,a),Q(t,u),f||(h=[Dn(e,"click",s[17]),Dn(e,"keypress",s[18])],f=!0)},p(g,y){y&8&&Gn(a,g[3])},d(g){g&&Ie(e),f=!1,Zi(h)}}}function Tfe(s){let e,t=[],r=new Map,a=s[5];const u=f=>f[2].id;for(let f=0;f<a.length;f+=1){let h=_fe(s,a,f),g=u(h);r.set(g,t[f]=Dfe(g,h))}return{c(){e=ce("div");for(let f=0;f<t.length;f+=1)t[f].c();W(e,"class","d-flex")},m(f,h){Le(f,e,h);for(let g=0;g<t.length;g+=1)t[g]&&t[g].m(e,null)},p(f,h){h&416&&(a=f[5],t=Om(t,h,u,1,f,a,r,e,nI,Dfe,null,_fe))},d(f){f&&Ie(e);for(let h=0;h<t.length;h+=1)t[h].d()}}}function Dfe(s,e){let t,r,a=dd(e[7].schemas,e[2])+"",u,f,h,g,y,C;function A(...O){return e[19](e[2],...O)}return{key:s,first:null,c(){t=ce("span"),r=ce("div"),u=Kt(a),f=Xe(),h=ce("button"),g=Xe(),W(h,"type","button"),W(h,"class","btn-close btn-sm ms-1"),os(h,"font-size","10px"),W(h,"aria-label","Close"),W(r,"class","d-flex align-items-center "),W(t,"class","badge rounded-pill bg-light text-dark fs-6 mt-3"),this.first=t},m(O,N){Le(O,t,N),Q(t,r),Q(r,u),Q(r,f),Q(r,h),Q(t,g),y||(C=Dn(h,"click",$u(A)),y=!0)},p(O,N){e=O,N&32&&a!==(a=dd(e[7].schemas,e[2])+"")&&Gn(u,a)},d(O){O&&Ie(t),y=!1,C()}}}function B4e(s){let e,t,r,a,u,f,h,g,y,C,A,O=s[6]&&Sfe(s),N=s[4]&&kfe(s),L=s[3]&&Afe(s),j=s[5].length>0&&Tfe(s);return{c(){O&&O.c(),e=Xe(),t=ce("input"),u=Xe(),f=ce("div"),N&&N.c(),h=Xe(),L&&L.c(),g=Xe(),j&&j.c(),y=Rs(),W(t,"type","search"),W(t,"id",s[1]),W(t,"class","form-control dropdown-toggle"),W(t,"placeholder",r="Search for "+s[0].label),W(t,"data-bs-toggle","dropdown"),W(t,"autocomplete","off"),t.readOnly=a=s[0].readonly&&!isCreateMode,_s(t,"is-invalid",s[6]),W(f,"class","dropdown-menu w-100")},m(z,q){O&&O.m(z,q),Le(z,e,q),Le(z,t,q),wr(t,s[3]),Le(z,u,q),Le(z,f,q),N&&N.m(f,null),Q(f,h),L&&L.m(f,null),Le(z,g,q),j&&j.m(z,q),Le(z,y,q),C||(A=[Dn(t,"keyup",s[11]),Dn(t,"input",s[14])],C=!0)},p(z,[q]){z[6]?O?O.p(z,q):(O=Sfe(z),O.c(),O.m(e.parentNode,e)):O&&(O.d(1),O=null),q&2&&W(t,"id",z[1]),q&1&&r!==(r="Search for "+z[0].label)&&W(t,"placeholder",r),q&1&&a!==(a=z[0].readonly&&!isCreateMode)&&(t.readOnly=a),q&8&&t.value!==z[3]&&wr(t,z[3]),q&64&&_s(t,"is-invalid",z[6]),z[4]?N?N.p(z,q):(N=kfe(z),N.c(),N.m(f,h)):N&&(N.d(1),N=null),z[3]?L?L.p(z,q):(L=Afe(z),L.c(),L.m(f,null)):L&&(L.d(1),L=null),z[5].length>0?j?j.p(z,q):(j=Tfe(z),j.c(),j.m(y.parentNode,y)):j&&(j.d(1),j=null)},i:Sn,o:Sn,d(z){O&&O.d(z),z&&Ie(e),z&&Ie(t),z&&Ie(u),z&&Ie(f),N&&N.d(),L&&L.d(),z&&Ie(g),j&&j.d(z),z&&Ie(y),C=!1,Zi(A)}}}function L4e(s,e,t){let r,a,u;const f=ji("channel");let{field:h}=e,{id:g}=e,{record:y}=e,{graph:C}=e,{validationErrors:A}=e,O="";function N(J,we){J.preventDefault(),t(12,C.edges=C.edges.filter(ye=>!(ye.target===we&&ye.field===h.name)),C)}function L(J,we){J.preventDefault(),axios.post(f.lucentUrl+"/records",{isCreateMode:!0,record:{schema:h.collections[0],status:"published",data:{[h.searchField]:we}}}).then(ye=>{t(4,u=[]),j(J,ye.data.records[0]),console.log(ye)}).catch(ye=>{t(4,u=[]),console.log(ye)})}function j(J,we){J.preventDefault(),t(12,C=Ooe(C,y,[we],h.name,J.detail.action))}const z=Hu.exports.debounce(J=>{axios.get(f.lucentUrl+"/records/suggestions",{params:{schema:h.collections[0],field:h.searchField,value:O,ui:"text"}}).then(we=>{t(4,u=we.data)}).catch(we=>{t(4,u=[]),console.log(we)})},500);function q(){O=this.value,t(3,O)}const ee=(J,we)=>j(we,J),F=(J,we)=>j(we,J),ne=J=>L(J,O),oe=J=>L(J,O),re=(J,we)=>N(we,J.id);return s.$$set=J=>{"field"in J&&t(0,h=J.field),"id"in J&&t(1,g=J.id),"record"in J&&t(2,y=J.record),"graph"in J&&t(12,C=J.graph),"validationErrors"in J&&t(13,A=J.validationErrors)},s.$$.update=()=>{var J;s.$$.dirty&8193&&t(6,r=Rg(A,h.name)),s.$$.dirty&4101&&t(5,a=(J=C.edges.filter(we=>we.field===h.name).map(we=>C.records.find(ye=>ye.id==we.target&&y.id==we.source)).filter(we=>!!(we!=null&&we.id)))!=null?J:[])},t(4,u=[]),[h,g,y,O,u,a,r,f,N,L,j,z,C,A,q,ee,F,ne,oe,re]}class F4e extends ko{constructor(e){super(),So(this,e,L4e,B4e,Co,{field:0,id:1,record:2,graph:12,validationErrors:13})}}function H4e(s){let e,t,r,a;function u(g){s[19](g)}var f=s[7];function h(g){let y={schema:g[3],field:g[2],validationErrors:g[5],isCreateMode:g[6],id:g[8]};return g[0][g[2].name]!==void 0&&(y.value=g[0][g[2].name]),{props:y}}return f&&(e=dk(f,h(s)),ss.push(()=>Er(e,"value",u))),{c(){e&&rn(e.$$.fragment),r=Rs()},m(g,y){e&&on(e,g,y),Le(g,r,y),a=!0},p(g,y){const C={};if(y&8&&(C.schema=g[3]),y&4&&(C.field=g[2]),y&32&&(C.validationErrors=g[5]),y&64&&(C.isCreateMode=g[6]),!t&&y&5&&(t=!0,C.value=g[0][g[2].name],Dr(()=>t=!1)),f!==(f=g[7])){if(e){To();const A=e;Ue(A.$$.fragment,1,0,()=>{sn(A,1)}),Do()}f?(e=dk(f,h(g)),ss.push(()=>Er(e,"value",u)),rn(e.$$.fragment),Re(e.$$.fragment,1),on(e,r.parentNode,r)):e=null}else f&&e.$set(C)},i(g){a||(e&&Re(e.$$.fragment,g),a=!0)},o(g){e&&Ue(e.$$.fragment,g),a=!1},d(g){g&&Ie(r),e&&sn(e,g)}}}function $4e(s){let e,t,r;function a(f){s[18](f)}let u={field:s[2],validationErrors:s[5],isCreateMode:s[6],id:s[8]};return s[0][s[2].name]!==void 0&&(u.value=s[0][s[2].name]),e=new ame({props:u}),ss.push(()=>Er(e,"value",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),h&64&&(g.isCreateMode=f[6]),!t&&h&5&&(t=!0,g.value=f[0][f[2].name],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function z4e(s){let e,t,r;function a(f){s[17](f)}let u={field:s[2],id:s[8],validationErrors:s[5],isCreateMode:s[6]};return s[0][s[2].name]!==void 0&&(u.value=s[0][s[2].name]),e=new Phe({props:u}),ss.push(()=>Er(e,"value",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),h&64&&(g.isCreateMode=f[6]),!t&&h&5&&(t=!0,g.value=f[0][f[2].name],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function V4e(s){let e,t,r;function a(f){s[16](f)}let u={field:s[2],id:s[8],validationErrors:s[5],isCreateMode:s[6]};return s[0][s[2].name]!==void 0&&(u.value=s[0][s[2].name]),e=new Nhe({props:u}),ss.push(()=>Er(e,"value",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),h&64&&(g.isCreateMode=f[6]),!t&&h&5&&(t=!0,g.value=f[0][f[2].name],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function U4e(s){let e,t,r,a;function u(g){s[14](g)}function f(g){s[15](g)}let h={record:s[4],id:s[8],field:s[2],validationErrors:s[5]};return s[1]!==void 0&&(h.graph=s[1]),s[0][s[2].name]!==void 0&&(h.value=s[0][s[2].name]),e=new DCe({props:h}),ss.push(()=>Er(e,"graph",u)),ss.push(()=>Er(e,"value",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&16&&(C.record=g[4]),y&4&&(C.field=g[2]),y&32&&(C.validationErrors=g[5]),!t&&y&2&&(t=!0,C.graph=g[1],Dr(()=>t=!1)),!r&&y&5&&(r=!0,C.value=g[0][g[2].name],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){sn(e,g)}}}function W4e(s){let e,t,r;function a(f){s[13](f)}let u={record:s[4],field:s[2],validationErrors:s[5]};return s[1]!==void 0&&(u.graph=s[1]),e=new pSe({props:u}),ss.push(()=>Er(e,"graph",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function j4e(s){let e,t,r;function a(f){s[12](f)}let u={id:s[8],record:s[4],field:s[2],validationErrors:s[5]};return s[1]!==void 0&&(u.graph=s[1]),e=new F_e({props:u}),ss.push(()=>Er(e,"graph",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function Z4e(s){let e,t,r;function a(f){s[11](f)}let u={id:s[8],record:s[4],field:s[2],validationErrors:s[5]};return s[1]!==void 0&&(u.graph=s[1]),e=new F4e({props:u}),ss.push(()=>Er(e,"graph",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function q4e(s){let e,t,r;function a(f){s[10](f)}let u={id:s[8],record:s[4],field:s[2],validationErrors:s[5]};return s[1]!==void 0&&(u.graph=s[1]),e=new I4e({props:u}),ss.push(()=>Er(e,"graph",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function G4e(s){let e,t,r;function a(f){s[9](f)}let u={record:s[4],field:s[2],validationErrors:s[5]};return s[1]!==void 0&&(u.graph=s[1]),e=new Q_e({props:u}),ss.push(()=>Er(e,"graph",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&16&&(g.record=f[4]),h&4&&(g.field=f[2]),h&32&&(g.validationErrors=f[5]),!t&&h&2&&(t=!0,g.graph=f[1],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function K4e(s){let e,t,r,a,u,f;t=new M4e({props:{schema:s[3],field:s[2],id:s[8]}});const h=[G4e,q4e,Z4e,j4e,W4e,U4e,V4e,z4e,$4e,H4e],g=[];function y(C,A){return C[2].info.name==="reference"&&C[2].layout==="inline"?0:C[2].info.name==="reference"&&C[2].layout==="table"?1:C[2].info.name==="reference"&&C[2].layout==="tags"?2:C[2].info.name==="reference"?3:C[2].info.name==="file"?4:C[2].info.name==="block"?5:C[2].info.name==="text"?6:C[2].info.name==="slug"?7:C[2].info.name==="textarea"?8:9}return a=y(s),u=g[a]=h[a](s),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),u.c(),W(e,"class","card editor-field")},m(C,A){Le(C,e,A),on(t,e,null),Q(e,r),g[a].m(e,null),f=!0},p(C,[A]){const O={};A&8&&(O.schema=C[3]),A&4&&(O.field=C[2]),t.$set(O);let N=a;a=y(C),a===N?g[a].p(C,A):(To(),Ue(g[N],1,1,()=>{g[N]=null}),Do(),u=g[a],u?u.p(C,A):(u=g[a]=h[a](C),u.c()),Re(u,1),u.m(e,null))},i(C){f||(Re(t.$$.fragment,C),Re(u),f=!0)},o(C){Ue(t.$$.fragment,C),Ue(u),f=!1},d(C){C&&Ie(e),sn(t),g[a].d()}}}function Y4e(s,e,t){const r={text:Nhe,slug:Phe,textarea:ame,rich:xSe,color:RCe,checkbox:ICe,number:$Ce,url:UCe,date:eSe,datetime:SSe,uuid:uSe,json:T4e};let{field:a}=e,{data:u}=e,{schema:f}=e,{record:h}=e,{graph:g}=e,{validationErrors:y}=e,{isCreateMode:C}=e,A=r[a.info.name];const O=`field-${a.name}-${h.id}`;function N(we){g=we,t(1,g)}function L(we){g=we,t(1,g)}function j(we){g=we,t(1,g)}function z(we){g=we,t(1,g)}function q(we){g=we,t(1,g)}function ee(we){g=we,t(1,g)}function F(we){s.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function ne(we){s.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function oe(we){s.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function re(we){s.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}function J(we){s.$$.not_equal(u[a.name],we)&&(u[a.name]=we,t(0,u))}return s.$$set=we=>{"field"in we&&t(2,a=we.field),"data"in we&&t(0,u=we.data),"schema"in we&&t(3,f=we.schema),"record"in we&&t(4,h=we.record),"graph"in we&&t(1,g=we.graph),"validationErrors"in we&&t(5,y=we.validationErrors),"isCreateMode"in we&&t(6,C=we.isCreateMode)},[u,g,a,f,h,y,C,A,O,N,L,j,z,q,ee,F,ne,oe,re,J]}class u1e extends ko{constructor(e){super(),So(this,e,Y4e,K4e,Co,{field:2,data:0,schema:3,record:4,graph:1,validationErrors:5,isCreateMode:6})}}function Ofe(s,e,t){const r=s.slice();return r[5]=e[t][0],r[6]=e[t][1],r}function Mfe(s,e,t){const r=s.slice();return r[9]=e[t],r}function Rfe(s,e,t){const r=s.slice();return r[5]=e[t][0],r[6]=e[t][1],r}function Nfe(s,e,t){const r=s.slice();return r[9]=e[t],r}function X4e(s){let e,t,r;return t=new iI({props:{graph:s[0],record:s[9]}}),{c(){e=ce("div"),rn(t.$$.fragment),W(e,"class","ms-2 mb-2")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},p(a,u){const f={};u&1&&(f.graph=a[0]),t.$set(f)},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function J4e(s){let e,t,r;return t=new P_({props:{record:s[9],size:"small"}}),{c(){e=ce("div"),rn(t.$$.fragment),W(e,"class","ms-2 mb-2"),os(e,"max-height","64px")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},p:Sn,i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function Pfe(s){let e,t,r,a;const u=[J4e,X4e],f=[];function h(g,y){var C;return(C=g[9]._file)!=null&&C.path?0:1}return e=h(s),t=f[e]=u[e](s),{c(){t.c(),r=Rs()},m(g,y){f[e].m(g,y),Le(g,r,y),a=!0},p(g,y){t.p(g,y)},i(g){a||(Re(t),a=!0)},o(g){Ue(t),a=!1},d(g){f[e].d(g),g&&Ie(r)}}}function Ife(s){let e,t,r,a=s[6].schema.label+"",u,f,h,g,y,C=s[6].field.label+"",A,O,N,L;h=new wl({props:{icon:"angle-right",width:"12",height:"12"}});let j=s[6].nodes,z=[];for(let ee=0;ee<j.length;ee+=1)z[ee]=Pfe(Nfe(s,j,ee));const q=ee=>Ue(z[ee],1,1,()=>{z[ee]=null});return{c(){e=ce("div"),t=ce("div"),r=ce("span"),u=Kt(a),f=Xe(),rn(h.$$.fragment),g=Xe(),y=ce("span"),A=Kt(C),O=Xe(),N=ce("div");for(let ee=0;ee<z.length;ee+=1)z[ee].c();W(t,"class","text-center mb-3 d-flex justify-content-center align-items-center text-uppercase "),W(N,"class","d-flex justify-content-center text-center flex-wrap"),W(e,"class","lx-card mt-3")},m(ee,F){Le(ee,e,F),Q(e,t),Q(t,r),Q(r,u),Q(t,f),on(h,t,null),Q(t,g),Q(t,y),Q(y,A),Q(e,O),Q(e,N);for(let ne=0;ne<z.length;ne+=1)z[ne]&&z[ne].m(N,null);L=!0},p(ee,F){if(F&5){j=ee[6].nodes;let ne;for(ne=0;ne<j.length;ne+=1){const oe=Nfe(ee,j,ne);z[ne]?(z[ne].p(oe,F),Re(z[ne],1)):(z[ne]=Pfe(oe),z[ne].c(),Re(z[ne],1),z[ne].m(N,null))}for(To(),ne=j.length;ne<z.length;ne+=1)q(ne);Do()}},i(ee){if(!L){Re(h.$$.fragment,ee);for(let F=0;F<j.length;F+=1)Re(z[F]);L=!0}},o(ee){Ue(h.$$.fragment,ee),z=z.filter(Boolean);for(let F=0;F<z.length;F+=1)Ue(z[F]);L=!1},d(ee){ee&&Ie(e),sn(h),ul(z,ee)}}}function Q4e(s){let e,t,r;return t=new wl({props:{icon:"angles-down",width:"32",height:"32"}}),{c(){e=ce("div"),rn(t.$$.fragment),W(e,"class","text-center my-4")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function eDe(s){let e,t,r;return t=new wl({props:{icon:"angles-down",width:"32",height:"32"}}),{c(){e=ce("div"),rn(t.$$.fragment),W(e,"class","text-center my-4")},m(a,u){Le(a,e,u),on(t,e,null),r=!0},i(a){r||(Re(t.$$.fragment,a),r=!0)},o(a){Ue(t.$$.fragment,a),r=!1},d(a){a&&Ie(e),sn(t)}}}function tDe(s){let e,t,r,a;return t=new iI({props:{graph:s[0],record:s[9]}}),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),W(e,"class","ms-2 mb-2")},m(u,f){Le(u,e,f),on(t,e,null),Q(e,r),a=!0},p(u,f){const h={};f&1&&(h.graph=u[0]),t.$set(h)},i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function nDe(s){let e,t,r,a;return t=new P_({props:{record:s[9],size:"small",showFilename:!0}}),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),W(e,"class","ms-2 mb-2"),os(e,"max-width","64px"),os(e,"overflow","hidden"),os(e,"white-space","nowrap"),os(e,"text-overflow","ellipsis")},m(u,f){Le(u,e,f),on(t,e,null),Q(e,r),a=!0},p:Sn,i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function Bfe(s){let e,t,r,a;const u=[nDe,tDe],f=[];function h(g,y){return g[6].field.info.ui==="file"?0:1}return e=h(s),t=f[e]=u[e](s),{c(){t.c(),r=Rs()},m(g,y){f[e].m(g,y),Le(g,r,y),a=!0},p(g,y){t.p(g,y)},i(g){a||(Re(t),a=!0)},o(g){Ue(t),a=!1},d(g){f[e].d(g),g&&Ie(r)}}}function Lfe(s){let e,t,r=s[6].field.label+"",a,u,f,h,g,y=s[6].nodes,C=[];for(let O=0;O<y.length;O+=1)C[O]=Bfe(Mfe(s,y,O));const A=O=>Ue(C[O],1,1,()=>{C[O]=null});return{c(){e=ce("div"),t=ce("div"),a=Kt(r),u=Xe(),f=ce("div");for(let O=0;O<C.length;O+=1)C[O].c();h=Xe(),W(t,"class","text-center mb-5 d-block"),W(f,"class","d-flex justify-content-center text-center flex-wrap"),W(e,"class","lx-card mt-3")},m(O,N){Le(O,e,N),Q(e,t),Q(t,a),Q(e,u),Q(e,f);for(let L=0;L<C.length;L+=1)C[L]&&C[L].m(f,null);Q(e,h),g=!0},p(O,N){if(N&9){y=O[6].nodes;let L;for(L=0;L<y.length;L+=1){const j=Mfe(O,y,L);C[L]?(C[L].p(j,N),Re(C[L],1)):(C[L]=Bfe(j),C[L].c(),Re(C[L],1),C[L].m(f,null))}for(To(),L=y.length;L<C.length;L+=1)A(L);Do()}},i(O){if(!g){for(let N=0;N<y.length;N+=1)Re(C[N]);g=!0}},o(O){C=C.filter(Boolean);for(let N=0;N<C.length;N+=1)Ue(C[N]);g=!1},d(O){O&&Ie(e),ul(C,O)}}}function oDe(s){let e,t=Object.entries(s[2]).length>0,r,a,u,f,h=Object.entries(s[3]).length>0,g,y,C,A=Object.entries(s[2]),O=[];for(let F=0;F<A.length;F+=1)O[F]=Ife(Rfe(s,A,F));const N=F=>Ue(O[F],1,1,()=>{O[F]=null});let L=t&&Q4e();u=new WV({props:{graph:s[0],record:s[1]}});let j=h&&eDe(),z=Object.entries(s[3]),q=[];for(let F=0;F<z.length;F+=1)q[F]=Lfe(Ofe(s,z,F));const ee=F=>Ue(q[F],1,1,()=>{q[F]=null});return{c(){for(let F=0;F<O.length;F+=1)O[F].c();e=Xe(),L&&L.c(),r=Xe(),a=ce("div"),rn(u.$$.fragment),f=Xe(),j&&j.c(),g=Xe();for(let F=0;F<q.length;F+=1)q[F].c();y=Rs(),os(a,"max-width","400px"),os(a,"margin","0 auto")},m(F,ne){for(let oe=0;oe<O.length;oe+=1)O[oe]&&O[oe].m(F,ne);Le(F,e,ne),L&&L.m(F,ne),Le(F,r,ne),Le(F,a,ne),on(u,a,null),Le(F,f,ne),j&&j.m(F,ne),Le(F,g,ne);for(let oe=0;oe<q.length;oe+=1)q[oe]&&q[oe].m(F,ne);Le(F,y,ne),C=!0},p(F,[ne]){if(ne&5){A=Object.entries(F[2]);let re;for(re=0;re<A.length;re+=1){const J=Rfe(F,A,re);O[re]?(O[re].p(J,ne),Re(O[re],1)):(O[re]=Ife(J),O[re].c(),Re(O[re],1),O[re].m(e.parentNode,e))}for(To(),re=A.length;re<O.length;re+=1)N(re);Do()}const oe={};if(ne&1&&(oe.graph=F[0]),ne&2&&(oe.record=F[1]),u.$set(oe),ne&9){z=Object.entries(F[3]);let re;for(re=0;re<z.length;re+=1){const J=Ofe(F,z,re);q[re]?(q[re].p(J,ne),Re(q[re],1)):(q[re]=Lfe(J),q[re].c(),Re(q[re],1),q[re].m(y.parentNode,y))}for(To(),re=z.length;re<q.length;re+=1)ee(re);Do()}},i(F){if(!C){for(let ne=0;ne<A.length;ne+=1)Re(O[ne]);Re(L),Re(u.$$.fragment,F),Re(j);for(let ne=0;ne<z.length;ne+=1)Re(q[ne]);C=!0}},o(F){O=O.filter(Boolean);for(let ne=0;ne<O.length;ne+=1)Ue(O[ne]);Ue(L),Ue(u.$$.fragment,F),Ue(j),q=q.filter(Boolean);for(let ne=0;ne<q.length;ne+=1)Ue(q[ne]);C=!1},d(F){ul(O,F),F&&Ie(e),L&&L.d(F),F&&Ie(r),F&&Ie(a),sn(u),F&&Ie(f),j&&j.d(F),F&&Ie(g),ul(q,F),F&&Ie(y)}}}function sDe(s,e,t){const r=ji("channel");let{graph:a}=e,{record:u}=e,f=a.parentEdges.filter(g=>g.source!==u.id&&g.depth===1).reduce((g,y)=>{let C=y.sourceSchema+y.field,A=a.records.find(O=>O.id===y.source);if(!g[C]){let O=r.schemas.find(N=>N.name===y.sourceSchema);g[C]={field:O.fields.find(N=>N.name===y.field),schema:O,nodes:[]}}return A&&g[C].nodes.push(A),g},{});console.log(f);let h=a.edges.filter(g=>g.source===u.id&&g.depth===0).reduce((g,y)=>{let C=y.targetSchema+y.field;g[C]||(g[C]={field:r.schemas.find(O=>O.name===u.schema).fields.find(O=>O.name===y.field),nodes:[]});let A=a.records.find(O=>O.id===y.target);return A&&g[C].nodes.push(A),g},{});return s.$$set=g=>{"graph"in g&&t(0,a=g.graph),"record"in g&&t(1,u=g.record)},[a,u,f,h]}class rDe extends ko{constructor(e){super(),So(this,e,sDe,oDe,Co,{graph:0,record:1})}}function Ffe(s,e,t){const r=s.slice();return r[4]=e[t],r}function iDe(s){var u;let e,t=((u=JSON.stringify(s[1]))!=null?u:"")+"",r,a;return{c(){e=ce("div"),r=Kt(t),W(e,"class",a=s[3]+" field-content svelte-md34ba")},m(f,h){Le(f,e,h),Q(e,r)},p(f,h){var g;h&2&&t!==(t=((g=JSON.stringify(f[1]))!=null?g:"")+"")&&Gn(r,t),h&8&&a!==(a=f[3]+" field-content svelte-md34ba")&&W(e,"class",a)},i:Sn,o:Sn,d(f){f&&Ie(e)}}}function aDe(s){var a;let e,t=((a=s[1])!=null?a:"")+"",r;return{c(){e=ce("div"),W(e,"class",r=s[3]+" field-content svelte-md34ba")},m(u,f){Le(u,e,f),e.innerHTML=t},p(u,f){var h;f&2&&t!==(t=((h=u[1])!=null?h:"")+"")&&(e.innerHTML=t),f&8&&r!==(r=u[3]+" field-content svelte-md34ba")&&W(e,"class",r)},i:Sn,o:Sn,d(u){u&&Ie(e)}}}function lDe(s){var u;let e,t=((u=JSON.stringify(s[1],null,2))!=null?u:"")+"",r,a;return{c(){e=ce("div"),r=Kt(t),W(e,"class",a=s[3]+" field-content svelte-md34ba"),os(e,"white-space","break-spaces")},m(f,h){Le(f,e,h),Q(e,r)},p(f,h){var g;h&2&&t!==(t=((g=JSON.stringify(f[1],null,2))!=null?g:"")+"")&&Gn(r,t),h&8&&a!==(a=f[3]+" field-content svelte-md34ba")&&W(e,"class",a)},i:Sn,o:Sn,d(f){f&&Ie(e)}}}function cDe(s){let e,t,r,a,u=s[2][s[0].name],f=[];for(let g=0;g<u.length;g+=1)f[g]=Hfe(Ffe(s,u,g));const h=g=>Ue(f[g],1,1,()=>{f[g]=null});return{c(){e=ce("div"),t=ce("div");for(let g=0;g<f.length;g+=1)f[g].c();W(t,"class","d-flex align-items-center text-center flex-wrap"),W(e,"class",r=s[3]+" field-content svelte-md34ba")},m(g,y){Le(g,e,y),Q(e,t);for(let C=0;C<f.length;C+=1)f[C]&&f[C].m(t,null);a=!0},p(g,y){if(y&5){u=g[2][g[0].name];let C;for(C=0;C<u.length;C+=1){const A=Ffe(g,u,C);f[C]?(f[C].p(A,y),Re(f[C],1)):(f[C]=Hfe(A),f[C].c(),Re(f[C],1),f[C].m(t,null))}for(To(),C=u.length;C<f.length;C+=1)h(C);Do()}(!a||y&8&&r!==(r=g[3]+" field-content svelte-md34ba"))&&W(e,"class",r)},i(g){if(!a){for(let y=0;y<u.length;y+=1)Re(f[y]);a=!0}},o(g){f=f.filter(Boolean);for(let y=0;y<f.length;y+=1)Ue(f[y]);a=!1},d(g){g&&Ie(e),ul(f,g)}}}function uDe(s){let e,t,r,a;return t=new iI({props:{record:s[4]}}),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),W(e,"class","ms-2 ")},m(u,f){Le(u,e,f),on(t,e,null),Q(e,r),a=!0},p(u,f){const h={};f&5&&(h.record=u[4]),t.$set(h)},i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function fDe(s){let e,t,r,a;return t=new P_({props:{record:s[4],size:"small",showFilename:!0}}),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),W(e,"class","ms-2 "),os(e,"max-width","64px"),os(e,"overflow","hidden"),os(e,"white-space","nowrap"),os(e,"text-overflow","ellipsis")},m(u,f){Le(u,e,f),on(t,e,null),Q(e,r),a=!0},p(u,f){const h={};f&5&&(h.record=u[4]),t.$set(h)},i(u){a||(Re(t.$$.fragment,u),a=!0)},o(u){Ue(t.$$.fragment,u),a=!1},d(u){u&&Ie(e),sn(t)}}}function Hfe(s){let e,t,r,a;const u=[fDe,uDe],f=[];function h(g,y){var C;return(C=g[4]._file)!=null&&C.path?0:1}return e=h(s),t=f[e]=u[e](s),{c(){t.c(),r=Rs()},m(g,y){f[e].m(g,y),Le(g,r,y),a=!0},p(g,y){let C=e;e=h(g),e===C?f[e].p(g,y):(To(),Ue(f[C],1,1,()=>{f[C]=null}),Do(),t=f[e],t?t.p(g,y):(t=f[e]=u[e](g),t.c()),Re(t,1),t.m(r.parentNode,r))},i(g){a||(Re(t),a=!0)},o(g){Ue(t),a=!1},d(g){f[e].d(g),g&&Ie(r)}}}function dDe(s){let e,t,r,a,u;const f=[cDe,lDe,aDe,iDe],h=[];function g(y,C){return C&1&&(e=null),e==null&&(e=!!["reference","file"].includes(y[0].ui)),e?0:y[0].ui==="json"?1:y[0].ui==="rich"?2:3}return t=g(s,-1),r=h[t]=f[t](s),{c(){r.c(),a=Rs()},m(y,C){h[t].m(y,C),Le(y,a,C),u=!0},p(y,[C]){let A=t;t=g(y,C),t===A?h[t].p(y,C):(To(),Ue(h[A],1,1,()=>{h[A]=null}),Do(),r=h[t],r?r.p(y,C):(r=h[t]=f[t](y),r.c()),Re(r,1),r.m(a.parentNode,a))},i(y){u||(Re(r),u=!0)},o(y){Ue(r),u=!1},d(y){h[t].d(y),y&&Ie(a)}}}function hDe(s,e,t){let{field:r}=e,{side:a}=e,{edges:u}=e,{colorClass:f}=e;return s.$$set=h=>{"field"in h&&t(0,r=h.field),"side"in h&&t(1,a=h.side),"edges"in h&&t(2,u=h.edges),"colorClass"in h&&t(3,f=h.colorClass)},[r,a,u,f]}class $fe extends ko{constructor(e){super(),So(this,e,hDe,dDe,Co,{field:0,side:1,edges:2,colorClass:3})}}function zfe(s,e,t){const r=s.slice();return r[13]=e[t],r}function Vfe(s,e,t){const r=s.slice();return r[16]=e[t],r}function mDe(s){let e;return{c(){e=ce("div"),e.innerHTML="<span>Revisions are not enabled for this Schema</span>",W(e,"class","card-body")},m(t,r){Le(t,e,r)},p:Sn,i:Sn,o:Sn,d(t){t&&Ie(e)}}}function gDe(s){let e,t,r,a,u=s[6],f=[];for(let g=0;g<u.length;g+=1)f[g]=Wfe(Vfe(s,u,g));const h=g=>Ue(f[g],1,1,()=>{f[g]=null});return{c(){e=ce("div"),e.textContent="Revisions",t=Xe();for(let g=0;g<f.length;g+=1)f[g].c();r=Rs(),W(e,"class","header-small mb-3")},m(g,y){Le(g,e,y),Le(g,t,y);for(let C=0;C<f.length;C+=1)f[C]&&f[C].m(g,y);Le(g,r,y),a=!0},p(g,y){if(y&595){u=g[6];let C;for(C=0;C<u.length;C+=1){const A=Vfe(g,u,C);f[C]?(f[C].p(A,y),Re(f[C],1)):(f[C]=Wfe(A),f[C].c(),Re(f[C],1),f[C].m(r.parentNode,r))}for(To(),C=u.length;C<f.length;C+=1)h(C);Do()}},i(g){if(!a){for(let y=0;y<u.length;y+=1)Re(f[y]);a=!0}},o(g){f=f.filter(Boolean);for(let y=0;y<f.length;y+=1)Ue(f[y]);a=!1},d(g){g&&Ie(e),g&&Ie(t),ul(f,g),g&&Ie(r)}}}function Ufe(s){let e,t,r,a,u,f,h=s[16]._sys.version+"",g,y,C,A,O,N=Jy(s[16]._sys.updatedAt)+"",L,j,z,q,ee,F,ne,oe,re,J;r=new VV({props:{status:s[16].status}}),A=new r2({props:{name:Dp(s[1],s[16]._sys.updatedBy),side:24}});function we(...ye){return s[11](s[16],...ye)}return{c(){var ye,De;e=ce("div"),t=ce("div"),rn(r.$$.fragment),a=Xe(),u=ce("div"),f=Kt("version "),g=Kt(h),y=Xe(),C=ce("div"),rn(A.$$.fragment),O=Xe(),L=Kt(N),j=Xe(),z=ce("div"),q=ce("button"),ee=Kt("Compare"),ne=Xe(),W(t,"class","col-2"),W(u,"class","col-2"),W(C,"class","col-5"),q.disabled=F=s[16]._sys.version===((ye=s[4])==null?void 0:ye._sys.version),W(q,"class","btn btn-sm btn-outline-primary"),W(z,"class","col-3 text-center"),W(e,"class","row p-2 rounded svelte-4o2asb"),_s(e,"active",s[16]._sys.version===((De=s[4])==null?void 0:De._sys.version))},m(ye,De){Le(ye,e,De),Q(e,t),on(r,t,null),Q(e,a),Q(e,u),Q(u,f),Q(u,g),Q(e,y),Q(e,C),on(A,C,null),Q(C,O),Q(C,L),Q(e,j),Q(e,z),Q(z,q),Q(q,ee),Q(e,ne),oe=!0,re||(J=Dn(q,"click",we),re=!0)},p(ye,De){var tt,Qe;s=ye;const _e={};De&64&&(_e.status=s[16].status),r.$set(_e),(!oe||De&64)&&h!==(h=s[16]._sys.version+"")&&Gn(g,h);const be={};De&66&&(be.name=Dp(s[1],s[16]._sys.updatedBy)),A.$set(be),(!oe||De&64)&&N!==(N=Jy(s[16]._sys.updatedAt)+"")&&Gn(L,N),(!oe||De&80&&F!==(F=s[16]._sys.version===((tt=s[4])==null?void 0:tt._sys.version)))&&(q.disabled=F),(!oe||De&80)&&_s(e,"active",s[16]._sys.version===((Qe=s[4])==null?void 0:Qe._sys.version))},i(ye){oe||(Re(r.$$.fragment,ye),Re(A.$$.fragment,ye),oe=!0)},o(ye){Ue(r.$$.fragment,ye),Ue(A.$$.fragment,ye),oe=!1},d(ye){ye&&Ie(e),sn(r),sn(A),re=!1,J()}}}function Wfe(s){let e,t,r=s[16]._sys.version!=s[0]._sys.version&&Ufe(s);return{c(){r&&r.c(),e=Rs()},m(a,u){r&&r.m(a,u),Le(a,e,u),t=!0},p(a,u){a[16]._sys.version!=a[0]._sys.version?r?(r.p(a,u),u&65&&Re(r,1)):(r=Ufe(a),r.c(),Re(r,1),r.m(e.parentNode,e)):r&&(To(),Ue(r,1,1,()=>{r=null}),Do())},i(a){t||(Re(r),t=!0)},o(a){Ue(r),t=!1},d(a){r&&r.d(a),a&&Ie(e)}}}function jfe(s){let e,t,r,a;const u=[bDe,pDe],f=[];function h(g,y){return g[5].length>0?0:1}return t=h(s),r=f[t]=u[t](s),{c(){e=ce("div"),r.c(),W(e,"class","mt-4")},m(g,y){Le(g,e,y),f[t].m(e,null),a=!0},p(g,y){let C=t;t=h(g),t===C?f[t].p(g,y):(To(),Ue(f[C],1,1,()=>{f[C]=null}),Do(),r=f[t],r?r.p(g,y):(r=f[t]=u[t](g),r.c()),Re(r,1),r.m(e,null))},i(g){a||(Re(r),a=!0)},o(g){Ue(r),a=!1},d(g){g&&Ie(e),f[t].d()}}}function pDe(s){let e;return{c(){e=ce("div"),e.innerHTML="<span>Nothing will change</span>",W(e,"class","lx-card text-center")},m(t,r){Le(t,e,r)},p:Sn,i:Sn,o:Sn,d(t){t&&Ie(e)}}}function bDe(s){let e,t,r,a,u=s[4]._sys.version+"",f,h,g,y,C,A,O,N=s[3]&&Zfe(s),L=s[5],j=[];for(let q=0;q<L.length;q+=1)j[q]=qfe(zfe(s,L,q));const z=q=>Ue(j[q],1,1,()=>{j[q]=null});return{c(){e=ce("p"),e.textContent="If you choose to rollback to this revision",t=Xe(),r=ce("button"),a=Kt("Rollback to version "),f=Kt(u),h=Xe(),N&&N.c(),g=Xe(),y=ce("div");for(let q=0;q<j.length;q+=1)j[q].c();W(e,"class","text-center fw-bold mb-3 mt-5"),W(r,"class","btn btn-primary mb-5 d-block mx-auto"),W(y,"class","mt-3")},m(q,ee){Le(q,e,ee),Le(q,t,ee),Le(q,r,ee),Q(r,a),Q(r,f),Le(q,h,ee),N&&N.m(q,ee),Le(q,g,ee),Le(q,y,ee);for(let F=0;F<j.length;F+=1)j[F]&&j[F].m(y,null);C=!0,A||(O=Dn(r,"click",s[10]),A=!0)},p(q,ee){if((!C||ee&16)&&u!==(u=q[4]._sys.version+"")&&Gn(f,u),q[3]?N?N.p(q,ee):(N=Zfe(q),N.c(),N.m(g.parentNode,g)):N&&(N.d(1),N=null),ee&433){L=q[5];let F;for(F=0;F<L.length;F+=1){const ne=zfe(q,L,F);j[F]?(j[F].p(ne,ee),Re(j[F],1)):(j[F]=qfe(ne),j[F].c(),Re(j[F],1),j[F].m(y,null))}for(To(),F=L.length;F<j.length;F+=1)z(F);Do()}},i(q){if(!C){for(let ee=0;ee<L.length;ee+=1)Re(j[ee]);C=!0}},o(q){j=j.filter(Boolean);for(let ee=0;ee<j.length;ee+=1)Ue(j[ee]);C=!1},d(q){q&&Ie(e),q&&Ie(t),q&&Ie(r),q&&Ie(h),N&&N.d(q),q&&Ie(g),q&&Ie(y),ul(j,q),A=!1,O()}}}function Zfe(s){let e,t;return{c(){e=ce("span"),t=Kt(s[3]),W(e,"class","d-block text-danger mt-3")},m(r,a){Le(r,e,a),Q(e,t)},p(r,a){a&8&&Gn(t,r[3])},d(r){r&&Ie(e)}}}function qfe(s){let e,t,r,a,u,f,h,g=s[13].label+"",y,C,A,O,N,L,j,z;return r=new $fe({props:{edges:s[8],field:s[13],side:s[0].data[s[13].name],colorClass:"text-danger"}}),A=new wl({props:{icon:"angle-right",width:"12",height:"12"}}),L=new $fe({props:{edges:s[7],field:s[13],side:s[4].data[s[13].name],colorClass:"text-success"}}),{c(){e=ce("div"),t=ce("div"),rn(r.$$.fragment),a=Xe(),u=ce("div"),f=ce("div"),h=ce("span"),y=Kt(g),C=Xe(),rn(A.$$.fragment),O=Xe(),N=ce("div"),rn(L.$$.fragment),j=Xe(),W(t,"class","col-5"),W(h,"class","me-1"),W(f,"class","h-100 d-flex align-items-center justify-content-center text-secondary"),W(u,"class","col-2"),W(N,"class","col-5"),W(e,"class","lx-card row p-4 mb-4 w-100"),os(e,"overflow","hidden")},m(q,ee){Le(q,e,ee),Q(e,t),on(r,t,null),Q(e,a),Q(e,u),Q(u,f),Q(f,h),Q(h,y),Q(f,C),on(A,f,null),Q(e,O),Q(e,N),on(L,N,null),Le(q,j,ee),z=!0},p(q,ee){const F={};ee&256&&(F.edges=q[8]),ee&32&&(F.field=q[13]),ee&33&&(F.side=q[0].data[q[13].name]),r.$set(F),(!z||ee&32)&&g!==(g=q[13].label+"")&&Gn(y,g);const ne={};ee&128&&(ne.edges=q[7]),ee&32&&(ne.field=q[13]),ee&48&&(ne.side=q[4].data[q[13].name]),L.$set(ne)},i(q){z||(Re(r.$$.fragment,q),Re(A.$$.fragment,q),Re(L.$$.fragment,q),z=!0)},o(q){Ue(r.$$.fragment,q),Ue(A.$$.fragment,q),Ue(L.$$.fragment,q),z=!1},d(q){q&&Ie(e),sn(r),sn(A),sn(L),q&&Ie(j)}}}function vDe(s){let e,t,r,a,u,f,h,g=s[0].id+"",y,C,A,O,N,L=s[0]._sys.version+"",j,z,q,ee,F,ne,oe,re=Jy(s[0]._sys.createdAt)+"",J,we,ye,De,_e,be,tt,Qe=Jy(s[0]._sys.updatedAt)+"",ft,V,mt,nt,Ot,Tt,He,ct=s[2].revisionRetentionDays+"",dn,kt,xn,We,xt=s[2].revisionRetentionNumber+"",he,es,ho,ao,xo,Yo,Ct,Jt,Et;ne=new r2({props:{name:Dp(s[1],s[0]._sys.createdBy),side:24}}),be=new r2({props:{name:Dp(s[1],s[0]._sys.updatedBy),side:24}});const Pe=[gDe,mDe],Ut=[];function gn(Yt,bn){return Yt[2].revisionRetentionDays>0?0:1}xo=gn(s),Yo=Ut[xo]=Pe[xo](s);let yt=s[4]&&jfe(s);return{c(){e=ce("div"),t=ce("div"),r=ce("div"),a=ce("div"),u=ce("span"),u.textContent="record id",f=Xe(),h=ce("small"),y=Kt(g),C=Xe(),A=ce("div"),O=ce("span"),O.textContent="current version",N=Xe(),j=Kt(L),z=Xe(),q=ce("div"),ee=ce("span"),ee.textContent="created",F=Xe(),rn(ne.$$.fragment),oe=Xe(),J=Kt(re),we=Xe(),ye=ce("div"),De=ce("span"),De.textContent="updated",_e=Xe(),rn(be.$$.fragment),tt=Xe(),ft=Kt(Qe),V=Xe(),mt=ce("div"),nt=ce("span"),nt.textContent="Rules for this schema",Ot=Xe(),Tt=ce("small"),He=Kt("Revisions are retained for "),dn=Kt(ct),kt=Kt(` days
`),xn=ce("br"),We=Kt(`
Each record maintains the last `),he=Kt(xt),es=Kt(`
versions`),ho=Xe(),ao=ce("div"),Yo.c(),Ct=Xe(),yt&&yt.c(),Jt=Rs(),W(u,"class","label text-end text-muted svelte-4o2asb"),W(O,"class","label text-end text-muted svelte-4o2asb"),W(ee,"class","label text-end text-muted svelte-4o2asb"),W(De,"class","label text-end text-muted svelte-4o2asb"),W(r,"class","col-8"),W(nt,"class","label d-block text-muted svelte-4o2asb"),W(mt,"class","col-4"),W(t,"class","row"),W(e,"class","lx-card "),W(ao,"class","lx-card mt-4")},m(Yt,bn){Le(Yt,e,bn),Q(e,t),Q(t,r),Q(r,a),Q(a,u),Q(a,f),Q(a,h),Q(h,y),Q(r,C),Q(r,A),Q(A,O),Q(A,N),Q(A,j),Q(r,z),Q(r,q),Q(q,ee),Q(q,F),on(ne,q,null),Q(q,oe),Q(q,J),Q(r,we),Q(r,ye),Q(ye,De),Q(ye,_e),on(be,ye,null),Q(ye,tt),Q(ye,ft),Q(t,V),Q(t,mt),Q(mt,nt),Q(mt,Ot),Q(mt,Tt),Q(Tt,He),Q(Tt,dn),Q(Tt,kt),Q(Tt,xn),Q(Tt,We),Q(Tt,he),Q(Tt,es),Le(Yt,ho,bn),Le(Yt,ao,bn),Ut[xo].m(ao,null),Le(Yt,Ct,bn),yt&&yt.m(Yt,bn),Le(Yt,Jt,bn),Et=!0},p(Yt,[bn]){(!Et||bn&1)&&g!==(g=Yt[0].id+"")&&Gn(y,g),(!Et||bn&1)&&L!==(L=Yt[0]._sys.version+"")&&Gn(j,L);const rs={};bn&3&&(rs.name=Dp(Yt[1],Yt[0]._sys.createdBy)),ne.$set(rs),(!Et||bn&1)&&re!==(re=Jy(Yt[0]._sys.createdAt)+"")&&Gn(J,re);const Jn={};bn&3&&(Jn.name=Dp(Yt[1],Yt[0]._sys.updatedBy)),be.$set(Jn),(!Et||bn&1)&&Qe!==(Qe=Jy(Yt[0]._sys.updatedAt)+"")&&Gn(ft,Qe),(!Et||bn&4)&&ct!==(ct=Yt[2].revisionRetentionDays+"")&&Gn(dn,ct),(!Et||bn&4)&&xt!==(xt=Yt[2].revisionRetentionNumber+"")&&Gn(he,xt);let ds=xo;xo=gn(Yt),xo===ds?Ut[xo].p(Yt,bn):(To(),Ue(Ut[ds],1,1,()=>{Ut[ds]=null}),Do(),Yo=Ut[xo],Yo?Yo.p(Yt,bn):(Yo=Ut[xo]=Pe[xo](Yt),Yo.c()),Re(Yo,1),Yo.m(ao,null)),Yt[4]?yt?(yt.p(Yt,bn),bn&16&&Re(yt,1)):(yt=jfe(Yt),yt.c(),Re(yt,1),yt.m(Jt.parentNode,Jt)):yt&&(To(),Ue(yt,1,1,()=>{yt=null}),Do())},i(Yt){Et||(Re(ne.$$.fragment,Yt),Re(be.$$.fragment,Yt),Re(Yo),Re(yt),Et=!0)},o(Yt){Ue(ne.$$.fragment,Yt),Ue(be.$$.fragment,Yt),Ue(Yo),Ue(yt),Et=!1},d(Yt){Yt&&Ie(e),sn(ne),sn(be),Yt&&Ie(ho),Yt&&Ie(ao),Ut[xo].d(),Yt&&Ie(Ct),yt&&yt.d(Yt),Yt&&Ie(Jt)}}}function yDe(s,e,t){let r,a,u,f,h,{record:g}=e,{users:y}=e,{schema:C}=e,A="";axios.get(`/records/${g.id}/revisions`).then(j=>{t(6,r=j.data)}).catch(j=>{console.log(j)});function O(j,z){j.preventDefault(),t(4,u=z),t(5,a=C.fields.filter(q=>!Hu.exports.isEqual(u.data[q.name],g.data[q.name])))}function N(j){j.preventDefault(),t(3,A=""),axios.post(`/records/${g.id}/rollback/${u._sys.version}`).then(z=>{window.location.reload()}).catch(z=>{const q=z.response.data.error;t(3,A=q.fieldLabel+": "+q.message)})}const L=(j,z)=>O(z,j);return s.$$set=j=>{"record"in j&&t(0,g=j.record),"users"in j&&t(1,y=j.users),"schema"in j&&t(2,C=j.schema)},t(6,r=[]),t(5,a=[]),t(4,u=null),t(8,f={}),t(7,h={}),[g,y,C,A,u,a,r,h,f,O,N,L]}class wDe extends ko{constructor(e){super(),So(this,e,yDe,vDe,Co,{record:0,users:1,schema:2})}}const{window:_De}=Cbe;function Gfe(s,e,t){const r=s.slice();return r[23]=e[t],r}function Kfe(s){let e,t,r,a,u,f;function h(O){s[14](O)}let g={record:s[0],schema:s[2]};s[0].status!==void 0&&(g.status=s[0].status),r=new Ohe({props:g}),ss.push(()=>Er(r,"status",h));function y(O,N){if(O[4])return SDe;if(O[9])return CDe}let C=y(s),A=C&&C(s);return{c(){e=ce("div"),t=ce("div"),rn(r.$$.fragment),u=Xe(),A&&A.c(),W(t,"class","d-flex mt-4 mb-3 align-items-center justify-content-center"),W(e,"class","shadow-lg "),os(e,"position","fixed"),os(e,"bottom","0"),os(e,"left","0px"),os(e,"width","100%"),os(e,"background","rgba(255,255,255,1)"),os(e,"z-index","1050")},m(O,N){Le(O,e,N),Q(e,t),on(r,t,null),Q(t,u),A&&A.m(t,null),f=!0},p(O,N){const L={};N&1&&(L.record=O[0]),N&4&&(L.schema=O[2]),!a&&N&1&&(a=!0,L.status=O[0].status,Dr(()=>a=!1)),r.$set(L),C===(C=y(O))&&A?A.p(O,N):(A&&A.d(1),A=C&&C(O),A&&(A.c(),A.m(t,null)))},i(O){f||(Re(r.$$.fragment,O),f=!0)},o(O){Ue(r.$$.fragment,O),f=!1},d(O){O&&Ie(e),sn(r),A&&A.d()}}}function CDe(s){let e,t,r;return{c(){e=ce("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Save`,W(e,"type","button"),W(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,u){Le(a,e,u),t||(r=Dn(e,"click",s[12]),t=!0)},p:Sn,d(a){a&&Ie(e),t=!1,r()}}}function SDe(s){let e,t,r;return{c(){e=ce("button"),e.innerHTML=`<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Create`,W(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,u){Le(a,e,u),t||(r=Dn(e,"click",s[12]),t=!0)},p:Sn,d(a){a&&Ie(e),t=!1,r()}}}function kDe(s){let e,t,r;function a(f){s[18](f)}let u={users:s[5],schema:s[2]};return s[0]!==void 0&&(u.record=s[0]),e=new wDe({props:u}),ss.push(()=>Er(e,"record",a)),{c(){rn(e.$$.fragment)},m(f,h){on(e,f,h),r=!0},p(f,h){const g={};h&32&&(g.users=f[5]),h&4&&(g.schema=f[2]),!t&&h&1&&(t=!0,g.record=f[0],Dr(()=>t=!1)),e.$set(g)},i(f){r||(Re(e.$$.fragment,f),r=!0)},o(f){Ue(e.$$.fragment,f),r=!1},d(f){sn(e,f)}}}function EDe(s){let e,t;return e=new rDe({props:{graph:s[1],record:s[0]}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&2&&(u.graph=r[1]),a&1&&(u.record=r[0]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function xDe(s){let e,t,r=[],a=new Map,u,f;e=new Mhe({props:{record:s[0],schema:s[2]}});let h=s[10];const g=y=>y[23].name;for(let y=0;y<h.length;y+=1){let C=Gfe(s,h,y),A=g(C);a.set(A,r[y]=Xfe(A,C))}return{c(){rn(e.$$.fragment),t=Xe();for(let y=0;y<r.length;y+=1)r[y].c();u=Rs()},m(y,C){on(e,y,C),Le(y,t,C);for(let A=0;A<r.length;A+=1)r[A]&&r[A].m(y,C);Le(y,u,C),f=!0},p(y,C){const A={};C&1&&(A.record=y[0]),C&4&&(A.schema=y[2]),e.$set(A),C&1239&&(h=y[10],To(),r=Om(r,C,g,1,y,h,a,u.parentNode,f2,Xfe,u,Gfe),Do())},i(y){if(!f){Re(e.$$.fragment,y);for(let C=0;C<h.length;C+=1)Re(r[C]);f=!0}},o(y){Ue(e.$$.fragment,y);for(let C=0;C<r.length;C+=1)Ue(r[C]);f=!1},d(y){sn(e,y),y&&Ie(t);for(let C=0;C<r.length;C+=1)r[C].d(y);y&&Ie(u)}}}function Yfe(s){let e,t,r,a;function u(g){s[16](g)}function f(g){s[17](g)}let h={field:s[23],schema:s[2],record:s[0],validationErrors:s[6],isCreateMode:s[4]};return s[0].data!==void 0&&(h.data=s[0].data),s[1]!==void 0&&(h.graph=s[1]),e=new u1e({props:h}),ss.push(()=>Er(e,"data",u)),ss.push(()=>Er(e,"graph",f)),{c(){rn(e.$$.fragment)},m(g,y){on(e,g,y),a=!0},p(g,y){const C={};y&4&&(C.schema=g[2]),y&1&&(C.record=g[0]),y&64&&(C.validationErrors=g[6]),y&16&&(C.isCreateMode=g[4]),!t&&y&1&&(t=!0,C.data=g[0].data,Dr(()=>t=!1)),!r&&y&2&&(r=!0,C.graph=g[1],Dr(()=>r=!1)),e.$set(C)},i(g){a||(Re(e.$$.fragment,g),a=!0)},o(g){Ue(e.$$.fragment,g),a=!1},d(g){sn(e,g)}}}function Xfe(s,e){let t,r,a,u=e[7]===e[23].group&&Yfe(e);return{key:s,first:null,c(){t=Rs(),u&&u.c(),r=Rs(),this.first=t},m(f,h){Le(f,t,h),u&&u.m(f,h),Le(f,r,h),a=!0},p(f,h){e=f,e[7]===e[23].group?u?(u.p(e,h),h&128&&Re(u,1)):(u=Yfe(e),u.c(),Re(u,1),u.m(r.parentNode,r)):u&&(To(),Ue(u,1,1,()=>{u=null}),Do())},i(f){a||(Re(u),a=!0)},o(f){Ue(u),a=!1},d(f){f&&Ie(t),u&&u.d(f),f&&Ie(r)}}}function ADe(s){let e,t,r,a,u,f,h=!["_graph","_info"].includes(s[7]),g,y,C,A,O,N,L,j,z,q,ee,F,ne;t=new Vye({props:{managerRecords:s[3],graph:s[1]}});function oe(tt){s[13](tt)}let re={schema:s[2],record:s[0],isCreateMode:s[4],graph:s[1]};s[7]!==void 0&&(re.activeContentTab=s[7]),a=new qye({props:re}),ss.push(()=>Er(a,"activeContentTab",oe));let J=h&&Kfe(s);y=new oI({props:{message:s[8]}});function we(tt){s[15](tt)}let ye={schema:s[2],isCreateMode:s[4]};s[7]!==void 0&&(ye.active=s[7]),O=new Rhe({props:ye}),ss.push(()=>Er(O,"active",we));const De=[xDe,EDe,kDe],_e=[];function be(tt,Qe){return Qe&128&&(j=null),j==null&&(j=!["_graph","_info"].includes(tt[7])),j?0:tt[7]==="_graph"?1:tt[7]==="_info"?2:-1}return~(z=be(s,-1))&&(q=_e[z]=De[z](s)),{c(){e=ce("div"),rn(t.$$.fragment),r=Xe(),rn(a.$$.fragment),f=Xe(),J&&J.c(),g=Xe(),rn(y.$$.fragment),C=Xe(),A=ce("div"),rn(O.$$.fragment),L=Xe(),q&&q.c(),W(A,"class","mt-4"),os(A,"margin-bottom","150px"),W(e,"class","wrapper-normal transparent")},m(tt,Qe){Le(tt,e,Qe),on(t,e,null),Q(e,r),on(a,e,null),Q(e,f),J&&J.m(e,null),Q(e,g),on(y,e,null),Q(e,C),Q(e,A),on(O,A,null),Q(A,L),~z&&_e[z].m(A,null),ee=!0,F||(ne=Dn(_De,"beforeunload",s[11]),F=!0)},p(tt,[Qe]){const ft={};Qe&8&&(ft.managerRecords=tt[3]),Qe&2&&(ft.graph=tt[1]),t.$set(ft);const V={};Qe&4&&(V.schema=tt[2]),Qe&1&&(V.record=tt[0]),Qe&16&&(V.isCreateMode=tt[4]),Qe&2&&(V.graph=tt[1]),!u&&Qe&128&&(u=!0,V.activeContentTab=tt[7],Dr(()=>u=!1)),a.$set(V),Qe&128&&(h=!["_graph","_info"].includes(tt[7])),h?J?(J.p(tt,Qe),Qe&128&&Re(J,1)):(J=Kfe(tt),J.c(),Re(J,1),J.m(e,g)):J&&(To(),Ue(J,1,1,()=>{J=null}),Do());const mt={};Qe&256&&(mt.message=tt[8]),y.$set(mt);const nt={};Qe&4&&(nt.schema=tt[2]),Qe&16&&(nt.isCreateMode=tt[4]),!N&&Qe&128&&(N=!0,nt.active=tt[7],Dr(()=>N=!1)),O.$set(nt);let Ot=z;z=be(tt,Qe),z===Ot?~z&&_e[z].p(tt,Qe):(q&&(To(),Ue(_e[Ot],1,1,()=>{_e[Ot]=null}),Do()),~z?(q=_e[z],q?q.p(tt,Qe):(q=_e[z]=De[z](tt),q.c()),Re(q,1),q.m(A,null)):q=null)},i(tt){ee||(Re(t.$$.fragment,tt),Re(a.$$.fragment,tt),Re(J),Re(y.$$.fragment,tt),Re(O.$$.fragment,tt),Re(q),ee=!0)},o(tt){Ue(t.$$.fragment,tt),Ue(a.$$.fragment,tt),Ue(J),Ue(y.$$.fragment,tt),Ue(O.$$.fragment,tt),Ue(q),ee=!1},d(tt){tt&&Ie(e),sn(t),sn(a),J&&J.d(),sn(y),sn(O),~z&&_e[z].d(),F=!1,ne()}}}function TDe(s,e,t){let r,a,u;const f=ji("channel");let{schema:h}=e,{record:g}=e,{graph:y={records:[],edges:[]}}=e,{recordHistory:C}=e,{isCreateMode:A}=e,{users:O}=e,N,L="",j=h.fields.filter(De=>De.name!=="id");H0(()=>{z()});function z(){N={data:JSON.parse(JSON.stringify(g.data)),schema:g.schema,status:g.status,_sys:JSON.parse(JSON.stringify(g._sys)),_file:JSON.parse(JSON.stringify(g._file)),edges:JSON.parse(JSON.stringify(y.edges))}}vhe(()=>{t(9,r=ee())});function q(De){return r?De.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete De.returnValue,"...")}function ee(){return A?!1:!Hu.exports.isEqual(N,{data:g.data,schema:g.schema,status:g.status,_sys:g._sys,_file:g._file,edges:y.edges})}function F(De){return De.preventDefault(),console.log("SAVE: Attempt"),t(6,a=null),t(8,u=""),new Promise(function(_e,be){var tt,Qe;if(!r&&!A){_e(null);return}if(!g){_e(null);return}t(1,y.edges=(Qe=(tt=y.edges)==null?void 0:tt.filter(ft=>!ft._isTrashed&&ft.source===g.id))!=null?Qe:null,y),axios.post(f.lucentUrl+"/records",{record:g,edges:y.edges,isCreateMode:A}).then(function(ft){var V;if(console.log("SAVE: SAVED"),A)window.location=f.lucentUrl+"/records/"+g.id;else{if(t(0,g=(V=ft.data.records[0])!=null?V:null),!g){t(9,r=!1),window.location=f.lucentUrl;return}t(1,y=ft.data),z()}_e(null)}).catch(function(ft){ft.response&&(typeof ft.response.data.error=="string"?t(8,u=ft.response.data.error):(t(6,a=ft.response.data.error),console.log(a))),_e(null)})})}function ne(De){L=De,t(7,L)}function oe(De){s.$$.not_equal(g.status,De)&&(g.status=De,t(0,g))}function re(De){L=De,t(7,L)}function J(De){s.$$.not_equal(g.data,De)&&(g.data=De,t(0,g))}function we(De){y=De,t(1,y)}function ye(De){g=De,t(0,g)}return s.$$set=De=>{"schema"in De&&t(2,h=De.schema),"record"in De&&t(0,g=De.record),"graph"in De&&t(1,y=De.graph),"recordHistory"in De&&t(3,C=De.recordHistory),"isCreateMode"in De&&t(4,A=De.isCreateMode),"users"in De&&t(5,O=De.users)},s.$$.update=()=>{s.$$.dirty&64&&t(8,u=a?`Record submission failed. ${Object.entries(a).length} error(s)`:null)},t(9,r=!1),t(6,a=null),[g,y,h,C,A,O,a,L,u,r,j,q,F,ne,oe,re,J,we,ye]}class DDe extends ko{constructor(e){super(),So(this,e,TDe,ADe,Co,{schema:2,record:0,graph:1,recordHistory:3,isCreateMode:4,users:5})}}function Jfe(s,e,t){const r=s.slice();return r[3]=e[t],r}function Qfe(s){let e,t=s[3].label+"",r,a;return{c(){var u;e=ce("a"),r=Kt(t),W(e,"class","list-group-item list-group-item-action"),W(e,"aria-current","page"),W(e,"href",a=s[2].lucentUrl+"/content/"+s[3].name),_s(e,"active",s[3].name===((u=s[1])==null?void 0:u.name))},m(u,f){Le(u,e,f),Q(e,r)},p(u,f){var h;f&1&&t!==(t=u[3].label+"")&&Gn(r,t),f&1&&a!==(a=u[2].lucentUrl+"/content/"+u[3].name)&&W(e,"href",a),f&3&&_s(e,"active",u[3].name===((h=u[1])==null?void 0:h.name))},d(u){u&&Ie(e)}}}function ODe(s){let e,t=s[0],r=[];for(let a=0;a<t.length;a+=1)r[a]=Qfe(Jfe(s,t,a));return{c(){e=ce("div");for(let a=0;a<r.length;a+=1)r[a].c();W(e,"class","list-group list-group-flush")},m(a,u){Le(a,e,u);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(e,null)},p(a,[u]){if(u&7){t=a[0];let f;for(f=0;f<t.length;f+=1){const h=Jfe(a,t,f);r[f]?r[f].p(h,u):(r[f]=Qfe(h),r[f].c(),r[f].m(e,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=t.length}},i:Sn,o:Sn,d(a){a&&Ie(e),ul(r,a)}}}function MDe(s,e,t){const r=ji("channel");let{schemas:a}=e,{schema:u}=e;return s.$$set=f=>{"schemas"in f&&t(0,a=f.schemas),"schema"in f&&t(1,u=f.schema)},[a,u,r]}class Kte extends ko{constructor(e){super(),So(this,e,MDe,ODe,Co,{schemas:0,schema:1})}}function RDe(s){let e,t;return{c(){e=ce("a"),t=Kt("Build website"),W(e,"href",s[1].lucentUrl+"/build-report"),W(e,"class","btn btn-outline-primary btn-sm")},m(r,a){Le(r,e,a),Q(e,t)},p:Sn,d(r){r&&Ie(e)}}}function NDe(s){let e,t,r,a,u,f=s[1].name+"",h,g,y,C,A,O,N,L,j,z,q,ee,F,ne,oe,re,J,we,ye,De,_e,be,tt,Qe,ft,V,mt,nt,Ot,Tt,He,ct,dn,kt,xn=s[1].generateCommand&&RDe(s);return j=new r2({props:{side:"28",name:s[2].name}}),ye=new Kte({props:{schemas:s[1].schemas.filter(PDe),schema:s[0]}}),V=new Kte({props:{schemas:s[1].schemas.filter(IDe),schema:s[0]}}),dn=new Kte({props:{schemas:s[1].schemas.filter(BDe),schema:s[0]}}),{c(){e=ce("nav"),t=ce("div"),r=Xe(),a=ce("div"),u=ce("a"),h=Kt(f),g=Xe(),y=ce("a"),C=Kt("Members"),A=Xe(),xn&&xn.c(),O=Xe(),N=ce("div"),L=ce("a"),rn(j.$$.fragment),z=Xe(),q=ce("div"),ee=ce("div"),F=ce("div"),ne=ce("div"),oe=ce("h2"),oe.innerHTML='<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseMain" aria-expanded="true" aria-controls="panelsStayOpen-collapseMain">Main</button>',re=Xe(),J=ce("div"),we=ce("div"),rn(ye.$$.fragment),De=Xe(),_e=ce("div"),be=ce("h2"),be.innerHTML='<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseOther" aria-expanded="false" aria-controls="panelsStayOpen-collapseOther">Other</button>',tt=Xe(),Qe=ce("div"),ft=ce("div"),rn(V.$$.fragment),mt=Xe(),nt=ce("div"),Ot=ce("h2"),Ot.innerHTML='<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseFS" aria-expanded="false" aria-controls="panelsStayOpen-collapseFS">Filesystem</button>',Tt=Xe(),He=ce("div"),ct=ce("div"),rn(dn.$$.fragment),W(u,"class","nav-item"),W(u,"href",s[1].lucentUrl),W(y,"class","nav-item"),W(y,"href",s[1].lucentUrl+"/members"),W(L,"class","nav-item"),W(L,"href",s[1].lucentUrl+"/profile"),W(e,"class","lx-nav"),W(oe,"class","accordion-header"),W(oe,"id","panelsStayOpen-headingMain"),W(we,"class","accordion-body"),W(J,"id","panelsStayOpen-collapseMain"),W(J,"class","accordion-collapse collapse show"),W(J,"aria-labelledby","panelsStayOpen-headingMain"),W(ne,"class","accordion-item"),W(be,"class","accordion-header"),W(be,"id","panelsStayOpen-headingOther"),W(ft,"class","accordion-body"),W(Qe,"id","panelsStayOpen-collapseOther"),W(Qe,"class","accordion-collapse collapse"),W(Qe,"aria-labelledby","panelsStayOpen-headingOther"),W(_e,"class","accordion-item"),W(Ot,"class","accordion-header"),W(Ot,"id","panelsStayOpen-headingFS"),W(ct,"class","accordion-body"),W(He,"id","panelsStayOpen-collapseFS"),W(He,"class","accordion-collapse collapse"),W(He,"aria-labelledby","panelsStayOpen-headingFS"),W(nt,"class","accordion-item"),W(F,"class","accordion"),W(ee,"class","offcanvas-body"),W(q,"class","offcanvas offcanvas-start show border-0 bg-light-subtle"),os(q,"padding-top","36px "),W(q,"data-bs-scroll","true"),W(q,"data-bs-backdrop","false"),W(q,"tabindex","-1"),W(q,"aria-labelledby","offcanvasScrollingLabel")},m(We,xt){Le(We,e,xt),Q(e,t),Q(e,r),Q(e,a),Q(a,u),Q(u,h),Q(a,g),Q(a,y),Q(y,C),Q(a,A),xn&&xn.m(a,null),Q(e,O),Q(e,N),Q(N,L),on(j,L,null),Le(We,z,xt),Le(We,q,xt),Q(q,ee),Q(ee,F),Q(F,ne),Q(ne,oe),Q(ne,re),Q(ne,J),Q(J,we),on(ye,we,null),Q(F,De),Q(F,_e),Q(_e,be),Q(_e,tt),Q(_e,Qe),Q(Qe,ft),on(V,ft,null),Q(F,mt),Q(F,nt),Q(nt,Ot),Q(nt,Tt),Q(nt,He),Q(He,ct),on(dn,ct,null),kt=!0},p(We,[xt]){We[1].generateCommand&&xn.p(We,xt);const he={};xt&1&&(he.schema=We[0]),ye.$set(he);const es={};xt&1&&(es.schema=We[0]),V.$set(es);const ho={};xt&1&&(ho.schema=We[0]),dn.$set(ho)},i(We){kt||(Re(j.$$.fragment,We),Re(ye.$$.fragment,We),Re(V.$$.fragment,We),Re(dn.$$.fragment,We),kt=!0)},o(We){Ue(j.$$.fragment,We),Ue(ye.$$.fragment,We),Ue(V.$$.fragment,We),Ue(dn.$$.fragment,We),kt=!1},d(We){We&&Ie(e),xn&&xn.d(),sn(j),We&&Ie(z),We&&Ie(q),sn(ye),sn(V),sn(dn)}}}const PDe=s=>s.isEntry,IDe=s=>!s.isEntry&&s.type!=="files",BDe=s=>s.type==="files";function LDe(s,e,t){let{schema:r}=e;const a=ji("channel"),u=ji("user");return s.$$set=f=>{"schema"in f&&t(0,r=f.schema)},[r,a,u]}class FDe extends ko{constructor(e){super(),So(this,e,LDe,NDe,Co,{schema:0})}}function HDe(s){let e,t=dd(s[3].schemas,s[2],s[1])+"",r,a;return{c(){e=ce("a"),r=Kt(t),W(e,"href",a=s[3].lucentUrl+"/records/"+s[2].id),W(e,"class","text-decoration-none text-dark d-block")},m(u,f){Le(u,e,f),Q(e,r)},p(u,f){f&6&&t!==(t=dd(u[3].schemas,u[2],u[1])+"")&&Gn(r,t),f&4&&a!==(a=u[3].lucentUrl+"/records/"+u[2].id)&&W(e,"href",a)},i:Sn,o:Sn,d(u){u&&Ie(e)}}}function $De(s){let e,t;return e=new P_({props:{record:s[2],size:"tiny"}}),{c(){rn(e.$$.fragment)},m(r,a){on(e,r,a),t=!0},p(r,a){const u={};a&4&&(u.record=r[2]),e.$set(u)},i(r){t||(Re(e.$$.fragment,r),t=!0)},o(r){Ue(e.$$.fragment,r),t=!1},d(r){sn(e,r)}}}function zDe(s){let e,t,r,a,u,f,h=s[4].label+"",g,y,C,A,O,N,L,j,z,q,ee;const F=[$De,HDe],ne=[];function oe(re,J){return re[4].type==="files"?0:1}return t=oe(s),r=ne[t]=F[t](s),A=new VV({props:{status:s[2].status}}),j=new r2({props:{name:Dp(s[0],s[2]._sys.updatedBy),side:24}}),{c(){e=ce("td"),r.c(),a=Xe(),u=ce("td"),f=ce("a"),g=Kt(h),y=Xe(),C=ce("td"),rn(A.$$.fragment),O=Xe(),N=ce("td"),L=ce("div"),rn(j.$$.fragment),z=Xe(),q=ce("div"),q.textContent=`${s[5]}`,W(f,"class","text-decoration-none lx-small-text"),W(f,"href",s[3].lucentUrl+"/content/"+s[4].name),W(C,"class","text-center"),W(q,"class","ms-2"),W(L,"class","d-flex")},m(re,J){Le(re,e,J),ne[t].m(e,null),Le(re,a,J),Le(re,u,J),Q(u,f),Q(f,g),Le(re,y,J),Le(re,C,J),on(A,C,null),Le(re,O,J),Le(re,N,J),Q(N,L),on(j,L,null),Q(L,z),Q(L,q),ee=!0},p(re,[J]){r.p(re,J);const we={};J&4&&(we.status=re[2].status),A.$set(we);const ye={};J&5&&(ye.name=Dp(re[0],re[2]._sys.updatedBy)),j.$set(ye)},i(re){ee||(Re(r),Re(A.$$.fragment,re),Re(j.$$.fragment,re),ee=!0)},o(re){Ue(r),Ue(A.$$.fragment,re),Ue(j.$$.fragment,re),ee=!1},d(re){re&&Ie(e),ne[t].d(),re&&Ie(a),re&&Ie(u),re&&Ie(y),re&&Ie(C),sn(A),re&&Ie(O),re&&Ie(N),sn(j)}}}function VDe(s,e,t){const r=ji("channel");let{users:a}=e,{graph:u}=e,{record:f}=e,h=r.schemas.find(y=>y.name===f.schema),g=Ehe(xhe(f._sys.updatedAt),{addSuffix:!0});return s.$$set=y=>{"users"in y&&t(0,a=y.users),"graph"in y&&t(1,u=y.graph),"record"in y&&t(2,f=y.record)},[a,u,f,r,h,g]}class UDe extends ko{constructor(e){super(),So(this,e,VDe,zDe,Co,{users:0,graph:1,record:2})}}function ede(s,e,t){const r=s.slice();return r[4]=e[t],r}function tde(s){let e,t,r,a,u=[],f=new Map,h,g=s[0];const y=C=>C[4].id;for(let C=0;C<g.length;C+=1){let A=ede(s,g,C),O=y(A);f.set(O,u[C]=nde(O,A))}return{c(){e=ce("div"),t=ce("div"),r=ce("table"),a=ce("tbody");for(let C=0;C<u.length;C+=1)u[C].c();W(r,"class",""),W(t,"class","lx-table p-0"),W(e,"class","lx-card mb-4")},m(C,A){Le(C,e,A),Q(e,t),Q(t,r),Q(r,a);for(let O=0;O<u.length;O+=1)u[O]&&u[O].m(a,null);h=!0},p(C,A){A&7&&(g=C[0],To(),u=Om(u,A,y,1,C,g,f,a,f2,nde,null,ede),Do())},i(C){if(!h){for(let A=0;A<g.length;A+=1)Re(u[A]);h=!0}},o(C){for(let A=0;A<u.length;A+=1)Ue(u[A]);h=!1},d(C){C&&Ie(e);for(let A=0;A<u.length;A+=1)u[A].d()}}}function nde(s,e){let t,r,a,u;return r=new UDe({props:{graph:e[1],record:e[4],users:e[2]}}),{key:s,first:null,c(){t=ce("tr"),rn(r.$$.fragment),a=Xe(),this.first=t},m(f,h){Le(f,t,h),on(r,t,null),Q(t,a),u=!0},p(f,h){e=f;const g={};h&2&&(g.graph=e[1]),h&1&&(g.record=e[4]),h&4&&(g.users=e[2]),r.$set(g)},i(f){u||(Re(r.$$.fragment,f),u=!0)},o(f){Ue(r.$$.fragment,f),u=!1},d(f){f&&Ie(t),sn(r)}}}function WDe(s){let e,t,r,a,u=s[0].length>0&&tde(s);return{c(){e=ce("div"),t=ce("h3"),t.textContent="Latest Content changes",r=Xe(),u&&u.c(),W(t,"class","header-small mb-4 mt-5"),W(e,"class","wrapper-normal transparent")},m(f,h){Le(f,e,h),Q(e,t),Q(e,r),u&&u.m(e,null),a=!0},p(f,[h]){f[0].length>0?u?(u.p(f,h),h&1&&Re(u,1)):(u=tde(f),u.c(),Re(u,1),u.m(e,null)):u&&(To(),Ue(u,1,1,()=>{u=null}),Do())},i(f){a||(Re(u),a=!0)},o(f){Ue(u),a=!1},d(f){f&&Ie(e),u&&u.d()}}}function jDe(s,e,t){const r=ji("channel");let a=[],u=null,f=[];return H0(()=>{axios.get(r.lucentUrl+"/home/records").then(h=>{t(0,a=h.data.records),t(1,u=h.data.graph),t(2,f=h.data.users)}).catch(h=>{console.log(h)})}),[a,u,f]}class ZDe extends ko{constructor(e){super(),So(this,e,jDe,WDe,Co,{})}}function ode(s){let e;return{c(){e=ce("span"),e.textContent="Build in progress",W(e,"class","badge text-bg-warning")},m(t,r){Le(t,e,r)},d(t){t&&Ie(e)}}}function sde(s){let e;return{c(){e=ce("span"),e.textContent="Build completed at",W(e,"class","badge text-bg-info")},m(t,r){Le(t,e,r)},d(t){t&&Ie(e)}}}function qDe(s){let e,t,r,a,u,f,h,g,y,C,A,O,N,L,j,z,q,ee,F=s[1]&&ode(),ne=!s[1]&&s[2]&&sde();return{c(){e=ce("div"),t=ce("div"),r=ce("h3"),a=Kt(s[0]),u=Xe(),f=ce("button"),h=Kt("Start Build"),g=Xe(),y=ce("div"),F&&F.c(),C=Xe(),ne&&ne.c(),A=Xe(),O=ce("span"),N=Kt(s[3]),L=Xe(),j=ce("pre"),z=Kt(s[2]),W(r,"class","header-small mb-5"),W(f,"class","btn btn-outline-primary btn-sm mb-3"),f.disabled=s[1],W(O,"class","badge text-bg-light"),W(y,"class","mb-3"),W(t,"class","lx-card mt-5"),W(e,"class","wrapper-tiny transparent mb-5")},m(oe,re){Le(oe,e,re),Q(e,t),Q(t,r),Q(r,a),Q(t,u),Q(t,f),Q(f,h),Q(t,g),Q(t,y),F&&F.m(y,null),Q(y,C),ne&&ne.m(y,null),Q(y,A),Q(y,O),Q(O,N),Q(t,L),Q(t,j),Q(j,z),q||(ee=Dn(f,"click",s[4]),q=!0)},p(oe,[re]){re&1&&Gn(a,oe[0]),re&2&&(f.disabled=oe[1]),oe[1]?F||(F=ode(),F.c(),F.m(y,C)):F&&(F.d(1),F=null),!oe[1]&&oe[2]?ne||(ne=sde(),ne.c(),ne.m(y,A)):ne&&(ne.d(1),ne=null),re&8&&Gn(N,oe[3]),re&4&&Gn(z,oe[2])},i:Sn,o:Sn,d(oe){oe&&Ie(e),F&&F.d(),ne&&ne.d(),q=!1,ee()}}}function GDe(s,e,t){let r,a;const u=ji("channel");let{title:f}=e,h=!1;function g(){const C=new EventSource(u.lucentUrl+"/build-report-source");C.onmessage=function(A){t(1,h=!0);const O=JSON.parse(A.data);t(3,r=O.date),t(2,a=O.logs)},C.onerror=A=>{console.log(A),C.close(),t(1,h=!1)}}function y(C){C.preventDefault(),t(1,h=!0),axios.post(u.lucentUrl+"/build").then(A=>{g()})}return H0(()=>{g()}),s.$$set=C=>{"title"in C&&t(0,f=C.title)},t(3,r=""),t(2,a=""),[f,h,a,r,y]}class KDe extends ko{constructor(e){super(),So(this,e,GDe,qDe,Co,{title:0})}}function YDe(s){let e,t,r,a,u;e=new FDe({props:{schema:s[2].schema}});const f=[{title:s[0]},s[2]];var h=s[3][s[1]];function g(y){let C={};for(let A=0;A<f.length;A+=1)C=tI(C,f[A]);return{props:C}}return h&&(r=dk(h,g())),{c(){rn(e.$$.fragment),t=Xe(),r&&rn(r.$$.fragment),a=Rs()},m(y,C){on(e,y,C),Le(y,t,C),r&&on(r,y,C),Le(y,a,C),u=!0},p(y,[C]){const A={};C&4&&(A.schema=y[2].schema),e.$set(A);const O=C&5?$V(f,[C&1&&{title:y[0]},C&4&&zV(y[2])]):{};if(C&2&&h!==(h=y[3][y[1]])){if(r){To();const N=r;Ue(N.$$.fragment,1,0,()=>{sn(N,1)}),Do()}h?(r=dk(h,g()),rn(r.$$.fragment),Re(r.$$.fragment,1),on(r,a.parentNode,a)):r=null}else h&&r.$set(O)},i(y){u||(Re(e.$$.fragment,y),r&&Re(r.$$.fragment,y),u=!0)},o(y){Ue(e.$$.fragment,y),r&&Ue(r.$$.fragment,y),u=!1},d(y){sn(e,y),y&&Ie(t),y&&Ie(a),r&&sn(r,y)}}}function XDe(s,e,t){const r={members:gve,recordEdit:DDe,recordNotFound:bve,contentIndex:Hhe,homeIndex:ZDe,buildReport:KDe};let{title:a}=e,{view:u}=e,{user:f}=e,{data:h}=e,{channel:g}=e;return Yz("channel",g),Yz("user",f),s.$$set=y=>{"title"in y&&t(0,a=y.title),"view"in y&&t(1,u=y.view),"user"in y&&t(4,f=y.user),"data"in y&&t(2,h=y.data),"channel"in y&&t(5,g=y.channel)},[a,u,h,r,f,g]}class JDe extends ko{constructor(e){super(),So(this,e,XDe,YDe,Co,{title:0,view:1,user:4,data:2,channel:5})}}var Dg="top",P1="bottom",I1="right",Og="left",cU="auto",SO=[Dg,P1,I1,Og],XA="start",uO="end",f1e="clippingParents",use="viewport",FD="popper",d1e="reference",goe=SO.reduce(function(s,e){return s.concat([e+"-"+XA,e+"-"+uO])},[]),fse=[].concat(SO,[cU]).reduce(function(s,e){return s.concat([e,e+"-"+XA,e+"-"+uO])},[]),h1e="beforeRead",m1e="read",g1e="afterRead",p1e="beforeMain",b1e="main",v1e="afterMain",y1e="beforeWrite",w1e="write",_1e="afterWrite",C1e=[h1e,m1e,g1e,p1e,b1e,v1e,y1e,w1e,_1e];function c2(s){return s?(s.nodeName||"").toLowerCase():null}function B1(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function JA(s){var e=B1(s).Element;return s instanceof e||s instanceof Element}function I0(s){var e=B1(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function dse(s){if(typeof ShadowRoot>"u")return!1;var e=B1(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function QDe(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},a=e.attributes[t]||{},u=e.elements[t];!I0(u)||!c2(u)||(Object.assign(u.style,r),Object.keys(a).forEach(function(f){var h=a[f];h===!1?u.removeAttribute(f):u.setAttribute(f,h===!0?"":h)}))})}function eOe(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],u=e.attributes[r]||{},f=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),h=f.reduce(function(g,y){return g[y]="",g},{});!I0(a)||!c2(a)||(Object.assign(a.style,h),Object.keys(u).forEach(function(g){a.removeAttribute(g)}))})}}const hse={name:"applyStyles",enabled:!0,phase:"write",fn:QDe,effect:eOe,requires:["computeStyles"]};function o2(s){return s.split("-")[0]}var qA=Math.max,RV=Math.min,fO=Math.round;function poe(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function S1e(){return!/^((?!chrome|android).)*safari/i.test(poe())}function dO(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=s.getBoundingClientRect(),a=1,u=1;e&&I0(s)&&(a=s.offsetWidth>0&&fO(r.width)/s.offsetWidth||1,u=s.offsetHeight>0&&fO(r.height)/s.offsetHeight||1);var f=JA(s)?B1(s):window,h=f.visualViewport,g=!S1e()&&t,y=(r.left+(g&&h?h.offsetLeft:0))/a,C=(r.top+(g&&h?h.offsetTop:0))/u,A=r.width/a,O=r.height/u;return{width:A,height:O,top:C,right:y+A,bottom:C+O,left:y,x:y,y:C}}function mse(s){var e=dO(s),t=s.offsetWidth,r=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:r}}function k1e(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&dse(t)){var r=e;do{if(r&&s.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function N_(s){return B1(s).getComputedStyle(s)}function tOe(s){return["table","td","th"].indexOf(c2(s))>=0}function Ek(s){return((JA(s)?s.ownerDocument:s.document)||window.document).documentElement}function uU(s){return c2(s)==="html"?s:s.assignedSlot||s.parentNode||(dse(s)?s.host:null)||Ek(s)}function rde(s){return!I0(s)||N_(s).position==="fixed"?null:s.offsetParent}function nOe(s){var e=/firefox/i.test(poe()),t=/Trident/i.test(poe());if(t&&I0(s)){var r=N_(s);if(r.position==="fixed")return null}var a=uU(s);for(dse(a)&&(a=a.host);I0(a)&&["html","body"].indexOf(c2(a))<0;){var u=N_(a);if(u.transform!=="none"||u.perspective!=="none"||u.contain==="paint"||["transform","perspective"].indexOf(u.willChange)!==-1||e&&u.willChange==="filter"||e&&u.filter&&u.filter!=="none")return a;a=a.parentNode}return null}function pI(s){for(var e=B1(s),t=rde(s);t&&tOe(t)&&N_(t).position==="static";)t=rde(t);return t&&(c2(t)==="html"||c2(t)==="body"&&N_(t).position==="static")?e:t||nOe(s)||e}function gse(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function RP(s,e,t){return qA(s,RV(e,t))}function oOe(s,e,t){var r=RP(s,e,t);return r>t?t:r}function E1e(){return{top:0,right:0,bottom:0,left:0}}function x1e(s){return Object.assign({},E1e(),s)}function A1e(s,e){return e.reduce(function(t,r){return t[r]=s,t},{})}var sOe=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,x1e(typeof e!="number"?e:A1e(e,SO))};function rOe(s){var e,t=s.state,r=s.name,a=s.options,u=t.elements.arrow,f=t.modifiersData.popperOffsets,h=o2(t.placement),g=gse(h),y=[Og,I1].indexOf(h)>=0,C=y?"height":"width";if(!(!u||!f)){var A=sOe(a.padding,t),O=mse(u),N=g==="y"?Dg:Og,L=g==="y"?P1:I1,j=t.rects.reference[C]+t.rects.reference[g]-f[g]-t.rects.popper[C],z=f[g]-t.rects.reference[g],q=pI(u),ee=q?g==="y"?q.clientHeight||0:q.clientWidth||0:0,F=j/2-z/2,ne=A[N],oe=ee-O[C]-A[L],re=ee/2-O[C]/2+F,J=RP(ne,re,oe),we=g;t.modifiersData[r]=(e={},e[we]=J,e.centerOffset=J-re,e)}}function iOe(s){var e=s.state,t=s.options,r=t.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!k1e(e.elements.popper,a)||(e.elements.arrow=a))}const T1e={name:"arrow",enabled:!0,phase:"main",fn:rOe,effect:iOe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hO(s){return s.split("-")[1]}var aOe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lOe(s,e){var t=s.x,r=s.y,a=e.devicePixelRatio||1;return{x:fO(t*a)/a||0,y:fO(r*a)/a||0}}function ide(s){var e,t=s.popper,r=s.popperRect,a=s.placement,u=s.variation,f=s.offsets,h=s.position,g=s.gpuAcceleration,y=s.adaptive,C=s.roundOffsets,A=s.isFixed,O=f.x,N=O===void 0?0:O,L=f.y,j=L===void 0?0:L,z=typeof C=="function"?C({x:N,y:j}):{x:N,y:j};N=z.x,j=z.y;var q=f.hasOwnProperty("x"),ee=f.hasOwnProperty("y"),F=Og,ne=Dg,oe=window;if(y){var re=pI(t),J="clientHeight",we="clientWidth";if(re===B1(t)&&(re=Ek(t),N_(re).position!=="static"&&h==="absolute"&&(J="scrollHeight",we="scrollWidth")),re=re,a===Dg||(a===Og||a===I1)&&u===uO){ne=P1;var ye=A&&re===oe&&oe.visualViewport?oe.visualViewport.height:re[J];j-=ye-r.height,j*=g?1:-1}if(a===Og||(a===Dg||a===P1)&&u===uO){F=I1;var De=A&&re===oe&&oe.visualViewport?oe.visualViewport.width:re[we];N-=De-r.width,N*=g?1:-1}}var _e=Object.assign({position:h},y&&aOe),be=C===!0?lOe({x:N,y:j},B1(t)):{x:N,y:j};if(N=be.x,j=be.y,g){var tt;return Object.assign({},_e,(tt={},tt[ne]=ee?"0":"",tt[F]=q?"0":"",tt.transform=(oe.devicePixelRatio||1)<=1?"translate("+N+"px, "+j+"px)":"translate3d("+N+"px, "+j+"px, 0)",tt))}return Object.assign({},_e,(e={},e[ne]=ee?j+"px":"",e[F]=q?N+"px":"",e.transform="",e))}function cOe(s){var e=s.state,t=s.options,r=t.gpuAcceleration,a=r===void 0?!0:r,u=t.adaptive,f=u===void 0?!0:u,h=t.roundOffsets,g=h===void 0?!0:h,y={placement:o2(e.placement),variation:hO(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ide(Object.assign({},y,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:f,roundOffsets:g})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ide(Object.assign({},y,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:g})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const pse={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cOe,data:{}};var gz={passive:!0};function uOe(s){var e=s.state,t=s.instance,r=s.options,a=r.scroll,u=a===void 0?!0:a,f=r.resize,h=f===void 0?!0:f,g=B1(e.elements.popper),y=[].concat(e.scrollParents.reference,e.scrollParents.popper);return u&&y.forEach(function(C){C.addEventListener("scroll",t.update,gz)}),h&&g.addEventListener("resize",t.update,gz),function(){u&&y.forEach(function(C){C.removeEventListener("scroll",t.update,gz)}),h&&g.removeEventListener("resize",t.update,gz)}}const bse={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uOe,data:{}};var fOe={left:"right",right:"left",bottom:"top",top:"bottom"};function Wz(s){return s.replace(/left|right|bottom|top/g,function(e){return fOe[e]})}var dOe={start:"end",end:"start"};function ade(s){return s.replace(/start|end/g,function(e){return dOe[e]})}function vse(s){var e=B1(s),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function yse(s){return dO(Ek(s)).left+vse(s).scrollLeft}function hOe(s,e){var t=B1(s),r=Ek(s),a=t.visualViewport,u=r.clientWidth,f=r.clientHeight,h=0,g=0;if(a){u=a.width,f=a.height;var y=S1e();(y||!y&&e==="fixed")&&(h=a.offsetLeft,g=a.offsetTop)}return{width:u,height:f,x:h+yse(s),y:g}}function mOe(s){var e,t=Ek(s),r=vse(s),a=(e=s.ownerDocument)==null?void 0:e.body,u=qA(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),f=qA(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),h=-r.scrollLeft+yse(s),g=-r.scrollTop;return N_(a||t).direction==="rtl"&&(h+=qA(t.clientWidth,a?a.clientWidth:0)-u),{width:u,height:f,x:h,y:g}}function wse(s){var e=N_(s),t=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+a+r)}function D1e(s){return["html","body","#document"].indexOf(c2(s))>=0?s.ownerDocument.body:I0(s)&&wse(s)?s:D1e(uU(s))}function NP(s,e){var t;e===void 0&&(e=[]);var r=D1e(s),a=r===((t=s.ownerDocument)==null?void 0:t.body),u=B1(r),f=a?[u].concat(u.visualViewport||[],wse(r)?r:[]):r,h=e.concat(f);return a?h:h.concat(NP(uU(f)))}function boe(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function gOe(s,e){var t=dO(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function lde(s,e,t){return e===use?boe(hOe(s,t)):JA(e)?gOe(e,t):boe(mOe(Ek(s)))}function pOe(s){var e=NP(uU(s)),t=["absolute","fixed"].indexOf(N_(s).position)>=0,r=t&&I0(s)?pI(s):s;return JA(r)?e.filter(function(a){return JA(a)&&k1e(a,r)&&c2(a)!=="body"}):[]}function bOe(s,e,t,r){var a=e==="clippingParents"?pOe(s):[].concat(e),u=[].concat(a,[t]),f=u[0],h=u.reduce(function(g,y){var C=lde(s,y,r);return g.top=qA(C.top,g.top),g.right=RV(C.right,g.right),g.bottom=RV(C.bottom,g.bottom),g.left=qA(C.left,g.left),g},lde(s,f,r));return h.width=h.right-h.left,h.height=h.bottom-h.top,h.x=h.left,h.y=h.top,h}function O1e(s){var e=s.reference,t=s.element,r=s.placement,a=r?o2(r):null,u=r?hO(r):null,f=e.x+e.width/2-t.width/2,h=e.y+e.height/2-t.height/2,g;switch(a){case Dg:g={x:f,y:e.y-t.height};break;case P1:g={x:f,y:e.y+e.height};break;case I1:g={x:e.x+e.width,y:h};break;case Og:g={x:e.x-t.width,y:h};break;default:g={x:e.x,y:e.y}}var y=a?gse(a):null;if(y!=null){var C=y==="y"?"height":"width";switch(u){case XA:g[y]=g[y]-(e[C]/2-t[C]/2);break;case uO:g[y]=g[y]+(e[C]/2-t[C]/2);break}}return g}function mO(s,e){e===void 0&&(e={});var t=e,r=t.placement,a=r===void 0?s.placement:r,u=t.strategy,f=u===void 0?s.strategy:u,h=t.boundary,g=h===void 0?f1e:h,y=t.rootBoundary,C=y===void 0?use:y,A=t.elementContext,O=A===void 0?FD:A,N=t.altBoundary,L=N===void 0?!1:N,j=t.padding,z=j===void 0?0:j,q=x1e(typeof z!="number"?z:A1e(z,SO)),ee=O===FD?d1e:FD,F=s.rects.popper,ne=s.elements[L?ee:O],oe=bOe(JA(ne)?ne:ne.contextElement||Ek(s.elements.popper),g,C,f),re=dO(s.elements.reference),J=O1e({reference:re,element:F,strategy:"absolute",placement:a}),we=boe(Object.assign({},F,J)),ye=O===FD?we:re,De={top:oe.top-ye.top+q.top,bottom:ye.bottom-oe.bottom+q.bottom,left:oe.left-ye.left+q.left,right:ye.right-oe.right+q.right},_e=s.modifiersData.offset;if(O===FD&&_e){var be=_e[a];Object.keys(De).forEach(function(tt){var Qe=[I1,P1].indexOf(tt)>=0?1:-1,ft=[Dg,P1].indexOf(tt)>=0?"y":"x";De[tt]+=be[ft]*Qe})}return De}function vOe(s,e){e===void 0&&(e={});var t=e,r=t.placement,a=t.boundary,u=t.rootBoundary,f=t.padding,h=t.flipVariations,g=t.allowedAutoPlacements,y=g===void 0?fse:g,C=hO(r),A=C?h?goe:goe.filter(function(L){return hO(L)===C}):SO,O=A.filter(function(L){return y.indexOf(L)>=0});O.length===0&&(O=A);var N=O.reduce(function(L,j){return L[j]=mO(s,{placement:j,boundary:a,rootBoundary:u,padding:f})[o2(j)],L},{});return Object.keys(N).sort(function(L,j){return N[L]-N[j]})}function yOe(s){if(o2(s)===cU)return[];var e=Wz(s);return[ade(s),e,ade(e)]}function wOe(s){var e=s.state,t=s.options,r=s.name;if(!e.modifiersData[r]._skip){for(var a=t.mainAxis,u=a===void 0?!0:a,f=t.altAxis,h=f===void 0?!0:f,g=t.fallbackPlacements,y=t.padding,C=t.boundary,A=t.rootBoundary,O=t.altBoundary,N=t.flipVariations,L=N===void 0?!0:N,j=t.allowedAutoPlacements,z=e.options.placement,q=o2(z),ee=q===z,F=g||(ee||!L?[Wz(z)]:yOe(z)),ne=[z].concat(F).reduce(function(kt,xn){return kt.concat(o2(xn)===cU?vOe(e,{placement:xn,boundary:C,rootBoundary:A,padding:y,flipVariations:L,allowedAutoPlacements:j}):xn)},[]),oe=e.rects.reference,re=e.rects.popper,J=new Map,we=!0,ye=ne[0],De=0;De<ne.length;De++){var _e=ne[De],be=o2(_e),tt=hO(_e)===XA,Qe=[Dg,P1].indexOf(be)>=0,ft=Qe?"width":"height",V=mO(e,{placement:_e,boundary:C,rootBoundary:A,altBoundary:O,padding:y}),mt=Qe?tt?I1:Og:tt?P1:Dg;oe[ft]>re[ft]&&(mt=Wz(mt));var nt=Wz(mt),Ot=[];if(u&&Ot.push(V[be]<=0),h&&Ot.push(V[mt]<=0,V[nt]<=0),Ot.every(function(kt){return kt})){ye=_e,we=!1;break}J.set(_e,Ot)}if(we)for(var Tt=L?3:1,He=function(xn){var We=ne.find(function(xt){var he=J.get(xt);if(he)return he.slice(0,xn).every(function(es){return es})});if(We)return ye=We,"break"},ct=Tt;ct>0;ct--){var dn=He(ct);if(dn==="break")break}e.placement!==ye&&(e.modifiersData[r]._skip=!0,e.placement=ye,e.reset=!0)}}const M1e={name:"flip",enabled:!0,phase:"main",fn:wOe,requiresIfExists:["offset"],data:{_skip:!1}};function cde(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function ude(s){return[Dg,I1,P1,Og].some(function(e){return s[e]>=0})}function _Oe(s){var e=s.state,t=s.name,r=e.rects.reference,a=e.rects.popper,u=e.modifiersData.preventOverflow,f=mO(e,{elementContext:"reference"}),h=mO(e,{altBoundary:!0}),g=cde(f,r),y=cde(h,a,u),C=ude(g),A=ude(y);e.modifiersData[t]={referenceClippingOffsets:g,popperEscapeOffsets:y,isReferenceHidden:C,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":C,"data-popper-escaped":A})}const R1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_Oe};function COe(s,e,t){var r=o2(s),a=[Og,Dg].indexOf(r)>=0?-1:1,u=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,f=u[0],h=u[1];return f=f||0,h=(h||0)*a,[Og,I1].indexOf(r)>=0?{x:h,y:f}:{x:f,y:h}}function SOe(s){var e=s.state,t=s.options,r=s.name,a=t.offset,u=a===void 0?[0,0]:a,f=fse.reduce(function(C,A){return C[A]=COe(A,e.rects,u),C},{}),h=f[e.placement],g=h.x,y=h.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=g,e.modifiersData.popperOffsets.y+=y),e.modifiersData[r]=f}const N1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:SOe};function kOe(s){var e=s.state,t=s.name;e.modifiersData[t]=O1e({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const _se={name:"popperOffsets",enabled:!0,phase:"read",fn:kOe,data:{}};function EOe(s){return s==="x"?"y":"x"}function xOe(s){var e=s.state,t=s.options,r=s.name,a=t.mainAxis,u=a===void 0?!0:a,f=t.altAxis,h=f===void 0?!1:f,g=t.boundary,y=t.rootBoundary,C=t.altBoundary,A=t.padding,O=t.tether,N=O===void 0?!0:O,L=t.tetherOffset,j=L===void 0?0:L,z=mO(e,{boundary:g,rootBoundary:y,padding:A,altBoundary:C}),q=o2(e.placement),ee=hO(e.placement),F=!ee,ne=gse(q),oe=EOe(ne),re=e.modifiersData.popperOffsets,J=e.rects.reference,we=e.rects.popper,ye=typeof j=="function"?j(Object.assign({},e.rects,{placement:e.placement})):j,De=typeof ye=="number"?{mainAxis:ye,altAxis:ye}:Object.assign({mainAxis:0,altAxis:0},ye),_e=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,be={x:0,y:0};if(!!re){if(u){var tt,Qe=ne==="y"?Dg:Og,ft=ne==="y"?P1:I1,V=ne==="y"?"height":"width",mt=re[ne],nt=mt+z[Qe],Ot=mt-z[ft],Tt=N?-we[V]/2:0,He=ee===XA?J[V]:we[V],ct=ee===XA?-we[V]:-J[V],dn=e.elements.arrow,kt=N&&dn?mse(dn):{width:0,height:0},xn=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:E1e(),We=xn[Qe],xt=xn[ft],he=RP(0,J[V],kt[V]),es=F?J[V]/2-Tt-he-We-De.mainAxis:He-he-We-De.mainAxis,ho=F?-J[V]/2+Tt+he+xt+De.mainAxis:ct+he+xt+De.mainAxis,ao=e.elements.arrow&&pI(e.elements.arrow),xo=ao?ne==="y"?ao.clientTop||0:ao.clientLeft||0:0,Yo=(tt=_e==null?void 0:_e[ne])!=null?tt:0,Ct=mt+es-Yo-xo,Jt=mt+ho-Yo,Et=RP(N?RV(nt,Ct):nt,mt,N?qA(Ot,Jt):Ot);re[ne]=Et,be[ne]=Et-mt}if(h){var Pe,Ut=ne==="x"?Dg:Og,gn=ne==="x"?P1:I1,yt=re[oe],Yt=oe==="y"?"height":"width",bn=yt+z[Ut],rs=yt-z[gn],Jn=[Dg,Og].indexOf(q)!==-1,ds=(Pe=_e==null?void 0:_e[oe])!=null?Pe:0,Or=Jn?bn:yt-J[Yt]-we[Yt]-ds+De.altAxis,Ns=Jn?yt+J[Yt]+we[Yt]-ds-De.altAxis:rs,Js=N&&Jn?oOe(Or,yt,Ns):RP(N?Or:bn,yt,N?Ns:rs);re[oe]=Js,be[oe]=Js-yt}e.modifiersData[r]=be}}const P1e={name:"preventOverflow",enabled:!0,phase:"main",fn:xOe,requiresIfExists:["offset"]};function AOe(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function TOe(s){return s===B1(s)||!I0(s)?vse(s):AOe(s)}function DOe(s){var e=s.getBoundingClientRect(),t=fO(e.width)/s.offsetWidth||1,r=fO(e.height)/s.offsetHeight||1;return t!==1||r!==1}function OOe(s,e,t){t===void 0&&(t=!1);var r=I0(e),a=I0(e)&&DOe(e),u=Ek(e),f=dO(s,a,t),h={scrollLeft:0,scrollTop:0},g={x:0,y:0};return(r||!r&&!t)&&((c2(e)!=="body"||wse(u))&&(h=TOe(e)),I0(e)?(g=dO(e,!0),g.x+=e.clientLeft,g.y+=e.clientTop):u&&(g.x=yse(u))),{x:f.left+h.scrollLeft-g.x,y:f.top+h.scrollTop-g.y,width:f.width,height:f.height}}function MOe(s){var e=new Map,t=new Set,r=[];s.forEach(function(u){e.set(u.name,u)});function a(u){t.add(u.name);var f=[].concat(u.requires||[],u.requiresIfExists||[]);f.forEach(function(h){if(!t.has(h)){var g=e.get(h);g&&a(g)}}),r.push(u)}return s.forEach(function(u){t.has(u.name)||a(u)}),r}function ROe(s){var e=MOe(s);return C1e.reduce(function(t,r){return t.concat(e.filter(function(a){return a.phase===r}))},[])}function NOe(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function POe(s){var e=s.reduce(function(t,r){var a=t[r.name];return t[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var fde={placement:"bottom",modifiers:[],strategy:"absolute"};function dde(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function fU(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,r=t===void 0?[]:t,a=e.defaultOptions,u=a===void 0?fde:a;return function(h,g,y){y===void 0&&(y=u);var C={placement:"bottom",orderedModifiers:[],options:Object.assign({},fde,u),modifiersData:{},elements:{reference:h,popper:g},attributes:{},styles:{}},A=[],O=!1,N={state:C,setOptions:function(q){var ee=typeof q=="function"?q(C.options):q;j(),C.options=Object.assign({},u,C.options,ee),C.scrollParents={reference:JA(h)?NP(h):h.contextElement?NP(h.contextElement):[],popper:NP(g)};var F=ROe(POe([].concat(r,C.options.modifiers)));return C.orderedModifiers=F.filter(function(ne){return ne.enabled}),L(),N.update()},forceUpdate:function(){if(!O){var q=C.elements,ee=q.reference,F=q.popper;if(!!dde(ee,F)){C.rects={reference:OOe(ee,pI(F),C.options.strategy==="fixed"),popper:mse(F)},C.reset=!1,C.placement=C.options.placement,C.orderedModifiers.forEach(function(De){return C.modifiersData[De.name]=Object.assign({},De.data)});for(var ne=0;ne<C.orderedModifiers.length;ne++){if(C.reset===!0){C.reset=!1,ne=-1;continue}var oe=C.orderedModifiers[ne],re=oe.fn,J=oe.options,we=J===void 0?{}:J,ye=oe.name;typeof re=="function"&&(C=re({state:C,options:we,name:ye,instance:N})||C)}}}},update:NOe(function(){return new Promise(function(z){N.forceUpdate(),z(C)})}),destroy:function(){j(),O=!0}};if(!dde(h,g))return N;N.setOptions(y).then(function(z){!O&&y.onFirstUpdate&&y.onFirstUpdate(z)});function L(){C.orderedModifiers.forEach(function(z){var q=z.name,ee=z.options,F=ee===void 0?{}:ee,ne=z.effect;if(typeof ne=="function"){var oe=ne({state:C,name:q,instance:N,options:F}),re=function(){};A.push(oe||re)}})}function j(){A.forEach(function(z){return z()}),A=[]}return N}}var IOe=fU(),BOe=[bse,_se,pse,hse],LOe=fU({defaultModifiers:BOe}),FOe=[bse,_se,pse,hse,N1e,M1e,P1e,T1e,R1e],Cse=fU({defaultModifiers:FOe});const I1e=Object.freeze(Object.defineProperty({__proto__:null,popperGenerator:fU,detectOverflow:mO,createPopperBase:IOe,createPopper:Cse,createPopperLite:LOe,top:Dg,bottom:P1,right:I1,left:Og,auto:cU,basePlacements:SO,start:XA,end:uO,clippingParents:f1e,viewport:use,popper:FD,reference:d1e,variationPlacements:goe,placements:fse,beforeRead:h1e,read:m1e,afterRead:g1e,beforeMain:p1e,main:b1e,afterMain:v1e,beforeWrite:y1e,write:w1e,afterWrite:_1e,modifierPhases:C1e,applyStyles:hse,arrow:T1e,computeStyles:pse,eventListeners:bse,flip:M1e,hide:R1e,offset:N1e,popperOffsets:_se,preventOverflow:P1e},Symbol.toStringTag,{value:"Module"}));/*!
* Bootstrap v5.3.2 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/const QS=new Map,Yte={set(s,e,t){QS.has(s)||QS.set(s,new Map);const r=QS.get(s);if(!r.has(e)&&r.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(r.keys())[0]}.`);return}r.set(e,t)},get(s,e){return QS.has(s)&&QS.get(s).get(e)||null},remove(s,e){if(!QS.has(s))return;const t=QS.get(s);t.delete(e),t.size===0&&QS.delete(s)}},HOe=1e6,$Oe=1e3,voe="transitionend",B1e=s=>(s&&window.CSS&&window.CSS.escape&&(s=s.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),s),zOe=s=>s==null?`${s}`:Object.prototype.toString.call(s).match(/\s([a-z]+)/i)[1].toLowerCase(),VOe=s=>{do s+=Math.floor(Math.random()*HOe);while(document.getElementById(s));return s},UOe=s=>{if(!s)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(s);const r=Number.parseFloat(e),a=Number.parseFloat(t);return!r&&!a?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*$Oe)},L1e=s=>{s.dispatchEvent(new Event(voe))},A_=s=>!s||typeof s!="object"?!1:(typeof s.jquery<"u"&&(s=s[0]),typeof s.nodeType<"u"),yk=s=>A_(s)?s.jquery?s[0]:s:typeof s=="string"&&s.length>0?document.querySelector(B1e(s)):null,kO=s=>{if(!A_(s)||s.getClientRects().length===0)return!1;const e=getComputedStyle(s).getPropertyValue("visibility")==="visible",t=s.closest("details:not([open])");if(!t)return e;if(t!==s){const r=s.closest("summary");if(r&&r.parentNode!==t||r===null)return!1}return e},wk=s=>!s||s.nodeType!==Node.ELEMENT_NODE||s.classList.contains("disabled")?!0:typeof s.disabled<"u"?s.disabled:s.hasAttribute("disabled")&&s.getAttribute("disabled")!=="false",F1e=s=>{if(!document.documentElement.attachShadow)return null;if(typeof s.getRootNode=="function"){const e=s.getRootNode();return e instanceof ShadowRoot?e:null}return s instanceof ShadowRoot?s:s.parentNode?F1e(s.parentNode):null},NV=()=>{},bI=s=>{s.offsetHeight},H1e=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Xte=[],WOe=s=>{document.readyState==="loading"?(Xte.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of Xte)e()}),Xte.push(s)):s()},L0=()=>document.documentElement.dir==="rtl",V0=s=>{WOe(()=>{const e=H1e();if(e){const t=s.NAME,r=e.fn[t];e.fn[t]=s.jQueryInterface,e.fn[t].Constructor=s,e.fn[t].noConflict=()=>(e.fn[t]=r,s.jQueryInterface)}})},Tp=(s,e=[],t=s)=>typeof s=="function"?s(...e):t,$1e=(s,e,t=!0)=>{if(!t){Tp(s);return}const r=5,a=UOe(e)+r;let u=!1;const f=({target:h})=>{h===e&&(u=!0,e.removeEventListener(voe,f),Tp(s))};e.addEventListener(voe,f),setTimeout(()=>{u||L1e(e)},a)},Sse=(s,e,t,r)=>{const a=s.length;let u=s.indexOf(e);return u===-1?!t&&r?s[a-1]:s[0]:(u+=t?1:-1,r&&(u=(u+a)%a),s[Math.max(0,Math.min(u,a-1))])},jOe=/[^.]*(?=\..*)\.|.*/,ZOe=/\..*/,qOe=/::\d+$/,Jte={};let hde=1;const z1e={mouseenter:"mouseover",mouseleave:"mouseout"},GOe=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function V1e(s,e){return e&&`${e}::${hde++}`||s.uidEvent||hde++}function U1e(s){const e=V1e(s);return s.uidEvent=e,Jte[e]=Jte[e]||{},Jte[e]}function KOe(s,e){return function t(r){return kse(r,{delegateTarget:s}),t.oneOff&&so.off(s,r.type,e),e.apply(s,[r])}}function YOe(s,e,t){return function r(a){const u=s.querySelectorAll(e);for(let{target:f}=a;f&&f!==this;f=f.parentNode)for(const h of u)if(h===f)return kse(a,{delegateTarget:f}),r.oneOff&&so.off(s,a.type,e,t),t.apply(f,[a])}}function W1e(s,e,t=null){return Object.values(s).find(r=>r.callable===e&&r.delegationSelector===t)}function j1e(s,e,t){const r=typeof e=="string",a=r?t:e||t;let u=Z1e(s);return GOe.has(u)||(u=s),[r,a,u]}function mde(s,e,t,r,a){if(typeof e!="string"||!s)return;let[u,f,h]=j1e(e,t,r);e in z1e&&(f=(L=>function(j){if(!j.relatedTarget||j.relatedTarget!==j.delegateTarget&&!j.delegateTarget.contains(j.relatedTarget))return L.call(this,j)})(f));const g=U1e(s),y=g[h]||(g[h]={}),C=W1e(y,f,u?t:null);if(C){C.oneOff=C.oneOff&&a;return}const A=V1e(f,e.replace(jOe,"")),O=u?YOe(s,t,f):KOe(s,f);O.delegationSelector=u?t:null,O.callable=f,O.oneOff=a,O.uidEvent=A,y[A]=O,s.addEventListener(h,O,u)}function yoe(s,e,t,r,a){const u=W1e(e[t],r,a);!u||(s.removeEventListener(t,u,Boolean(a)),delete e[t][u.uidEvent])}function XOe(s,e,t,r){const a=e[t]||{};for(const[u,f]of Object.entries(a))u.includes(r)&&yoe(s,e,t,f.callable,f.delegationSelector)}function Z1e(s){return s=s.replace(ZOe,""),z1e[s]||s}const so={on(s,e,t,r){mde(s,e,t,r,!1)},one(s,e,t,r){mde(s,e,t,r,!0)},off(s,e,t,r){if(typeof e!="string"||!s)return;const[a,u,f]=j1e(e,t,r),h=f!==e,g=U1e(s),y=g[f]||{},C=e.startsWith(".");if(typeof u<"u"){if(!Object.keys(y).length)return;yoe(s,g,f,u,a?t:null);return}if(C)for(const A of Object.keys(g))XOe(s,g,A,e.slice(1));for(const[A,O]of Object.entries(y)){const N=A.replace(qOe,"");(!h||e.includes(N))&&yoe(s,g,f,O.callable,O.delegationSelector)}},trigger(s,e,t){if(typeof e!="string"||!s)return null;const r=H1e(),a=Z1e(e),u=e!==a;let f=null,h=!0,g=!0,y=!1;u&&r&&(f=r.Event(e,t),r(s).trigger(f),h=!f.isPropagationStopped(),g=!f.isImmediatePropagationStopped(),y=f.isDefaultPrevented());const C=kse(new Event(e,{bubbles:h,cancelable:!0}),t);return y&&C.preventDefault(),g&&s.dispatchEvent(C),C.defaultPrevented&&f&&f.preventDefault(),C}};function kse(s,e={}){for(const[t,r]of Object.entries(e))try{s[t]=r}catch{Object.defineProperty(s,t,{configurable:!0,get(){return r}})}return s}function gde(s){if(s==="true")return!0;if(s==="false")return!1;if(s===Number(s).toString())return Number(s);if(s===""||s==="null")return null;if(typeof s!="string")return s;try{return JSON.parse(decodeURIComponent(s))}catch{return s}}function Qte(s){return s.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const T_={setDataAttribute(s,e,t){s.setAttribute(`data-bs-${Qte(e)}`,t)},removeDataAttribute(s,e){s.removeAttribute(`data-bs-${Qte(e)}`)},getDataAttributes(s){if(!s)return{};const e={},t=Object.keys(s.dataset).filter(r=>r.startsWith("bs")&&!r.startsWith("bsConfig"));for(const r of t){let a=r.replace(/^bs/,"");a=a.charAt(0).toLowerCase()+a.slice(1,a.length),e[a]=gde(s.dataset[r])}return e},getDataAttribute(s,e){return gde(s.getAttribute(`data-bs-${Qte(e)}`))}};class vI{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const r=A_(t)?T_.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof r=="object"?r:{},...A_(t)?T_.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[r,a]of Object.entries(t)){const u=e[r],f=A_(u)?"element":zOe(u);if(!new RegExp(a).test(f))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${f}" but expected type "${a}".`)}}}const JOe="5.3.2";class bv extends vI{constructor(e,t){super(),e=yk(e),e&&(this._element=e,this._config=this._getConfig(t),Yte.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Yte.remove(this._element,this.constructor.DATA_KEY),so.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,r=!0){$1e(e,t,r)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Yte.get(yk(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return JOe}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const ene=s=>{let e=s.getAttribute("data-bs-target");if(!e||e==="#"){let t=s.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?B1e(t.trim()):null}return e},mr={find(s,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,s))},findOne(s,e=document.documentElement){return Element.prototype.querySelector.call(e,s)},children(s,e){return[].concat(...s.children).filter(t=>t.matches(e))},parents(s,e){const t=[];let r=s.parentNode.closest(e);for(;r;)t.push(r),r=r.parentNode.closest(e);return t},prev(s,e){let t=s.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(s,e){let t=s.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(s){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,s).filter(t=>!wk(t)&&kO(t))},getSelectorFromElement(s){const e=ene(s);return e&&mr.findOne(e)?e:null},getElementFromSelector(s){const e=ene(s);return e?mr.findOne(e):null},getMultipleElementsFromSelector(s){const e=ene(s);return e?mr.find(e):[]}},dU=(s,e="hide")=>{const t=`click.dismiss${s.EVENT_KEY}`,r=s.NAME;so.on(document,t,`[data-bs-dismiss="${r}"]`,function(a){if(["A","AREA"].includes(this.tagName)&&a.preventDefault(),wk(this))return;const u=mr.getElementFromSelector(this)||this.closest(`.${r}`);s.getOrCreateInstance(u)[e]()})},QOe="alert",eMe="bs.alert",q1e=`.${eMe}`,tMe=`close${q1e}`,nMe=`closed${q1e}`,oMe="fade",sMe="show";class hU extends bv{static get NAME(){return QOe}close(){if(so.trigger(this._element,tMe).defaultPrevented)return;this._element.classList.remove(sMe);const t=this._element.classList.contains(oMe);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),so.trigger(this._element,nMe),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=hU.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}dU(hU,"close");V0(hU);const rMe="button",iMe="bs.button",aMe=`.${iMe}`,lMe=".data-api",cMe="active",pde='[data-bs-toggle="button"]',uMe=`click${aMe}${lMe}`;class mU extends bv{static get NAME(){return rMe}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(cMe))}static jQueryInterface(e){return this.each(function(){const t=mU.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}so.on(document,uMe,pde,s=>{s.preventDefault();const e=s.target.closest(pde);mU.getOrCreateInstance(e).toggle()});V0(mU);const fMe="swipe",EO=".bs.swipe",dMe=`touchstart${EO}`,hMe=`touchmove${EO}`,mMe=`touchend${EO}`,gMe=`pointerdown${EO}`,pMe=`pointerup${EO}`,bMe="touch",vMe="pen",yMe="pointer-event",wMe=40,_Me={endCallback:null,leftCallback:null,rightCallback:null},CMe={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class PV extends vI{constructor(e,t){super(),this._element=e,!(!e||!PV.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return _Me}static get DefaultType(){return CMe}static get NAME(){return fMe}dispose(){so.off(this._element,EO)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Tp(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=wMe)return;const t=e/this._deltaX;this._deltaX=0,t&&Tp(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(so.on(this._element,gMe,e=>this._start(e)),so.on(this._element,pMe,e=>this._end(e)),this._element.classList.add(yMe)):(so.on(this._element,dMe,e=>this._start(e)),so.on(this._element,hMe,e=>this._move(e)),so.on(this._element,mMe,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===vMe||e.pointerType===bMe)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const SMe="carousel",kMe="bs.carousel",xk=`.${kMe}`,G1e=".data-api",EMe="ArrowLeft",xMe="ArrowRight",AMe=500,fP="next",RD="prev",HD="left",jz="right",TMe=`slide${xk}`,tne=`slid${xk}`,DMe=`keydown${xk}`,OMe=`mouseenter${xk}`,MMe=`mouseleave${xk}`,RMe=`dragstart${xk}`,NMe=`load${xk}${G1e}`,PMe=`click${xk}${G1e}`,K1e="carousel",pz="active",IMe="slide",BMe="carousel-item-end",LMe="carousel-item-start",FMe="carousel-item-next",HMe="carousel-item-prev",Y1e=".active",X1e=".carousel-item",$Me=Y1e+X1e,zMe=".carousel-item img",VMe=".carousel-indicators",UMe="[data-bs-slide], [data-bs-slide-to]",WMe='[data-bs-ride="carousel"]',jMe={[EMe]:jz,[xMe]:HD},ZMe={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},qMe={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class yI extends bv{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=mr.findOne(VMe,this._element),this._addEventListeners(),this._config.ride===K1e&&this.cycle()}static get Default(){return ZMe}static get DefaultType(){return qMe}static get NAME(){return SMe}next(){this._slide(fP)}nextWhenVisible(){!document.hidden&&kO(this._element)&&this.next()}prev(){this._slide(RD)}pause(){this._isSliding&&L1e(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(!!this._config.ride){if(this._isSliding){so.one(this._element,tne,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){so.one(this._element,tne,()=>this.to(e));return}const r=this._getItemIndex(this._getActive());if(r===e)return;const a=e>r?fP:RD;this._slide(a,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&so.on(this._element,DMe,e=>this._keydown(e)),this._config.pause==="hover"&&(so.on(this._element,OMe,()=>this.pause()),so.on(this._element,MMe,()=>this._maybeEnableCycle())),this._config.touch&&PV.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const r of mr.find(zMe,this._element))so.on(r,RMe,a=>a.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(HD)),rightCallback:()=>this._slide(this._directionToOrder(jz)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),AMe+this._config.interval))}};this._swipeHelper=new PV(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=jMe[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=mr.findOne(Y1e,this._indicatorsElement);t.classList.remove(pz),t.removeAttribute("aria-current");const r=mr.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);r&&(r.classList.add(pz),r.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const r=this._getActive(),a=e===fP,u=t||Sse(this._getItems(),r,a,this._config.wrap);if(u===r)return;const f=this._getItemIndex(u),h=N=>so.trigger(this._element,N,{relatedTarget:u,direction:this._orderToDirection(e),from:this._getItemIndex(r),to:f});if(h(TMe).defaultPrevented||!r||!u)return;const y=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(f),this._activeElement=u;const C=a?LMe:BMe,A=a?FMe:HMe;u.classList.add(A),bI(u),r.classList.add(C),u.classList.add(C);const O=()=>{u.classList.remove(C,A),u.classList.add(pz),r.classList.remove(pz,A,C),this._isSliding=!1,h(tne)};this._queueCallback(O,r,this._isAnimated()),y&&this.cycle()}_isAnimated(){return this._element.classList.contains(IMe)}_getActive(){return mr.findOne($Me,this._element)}_getItems(){return mr.find(X1e,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return L0()?e===HD?RD:fP:e===HD?fP:RD}_orderToDirection(e){return L0()?e===RD?HD:jz:e===RD?jz:HD}static jQueryInterface(e){return this.each(function(){const t=yI.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}so.on(document,PMe,UMe,function(s){const e=mr.getElementFromSelector(this);if(!e||!e.classList.contains(K1e))return;s.preventDefault();const t=yI.getOrCreateInstance(e),r=this.getAttribute("data-bs-slide-to");if(r){t.to(r),t._maybeEnableCycle();return}if(T_.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});so.on(window,NMe,()=>{const s=mr.find(WMe);for(const e of s)yI.getOrCreateInstance(e)});V0(yI);const GMe="collapse",KMe="bs.collapse",wI=`.${KMe}`,YMe=".data-api",XMe=`show${wI}`,JMe=`shown${wI}`,QMe=`hide${wI}`,eRe=`hidden${wI}`,tRe=`click${wI}${YMe}`,nne="show",jD="collapse",bz="collapsing",nRe="collapsed",oRe=`:scope .${jD} .${jD}`,sRe="collapse-horizontal",rRe="width",iRe="height",aRe=".collapse.show, .collapse.collapsing",woe='[data-bs-toggle="collapse"]',lRe={parent:null,toggle:!0},cRe={parent:"(null|element)",toggle:"boolean"};class QP extends bv{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const r=mr.find(woe);for(const a of r){const u=mr.getSelectorFromElement(a),f=mr.find(u).filter(h=>h===this._element);u!==null&&f.length&&this._triggerArray.push(a)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return lRe}static get DefaultType(){return cRe}static get NAME(){return GMe}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(aRe).filter(h=>h!==this._element).map(h=>QP.getOrCreateInstance(h,{toggle:!1}))),e.length&&e[0]._isTransitioning||so.trigger(this._element,XMe).defaultPrevented)return;for(const h of e)h.hide();const r=this._getDimension();this._element.classList.remove(jD),this._element.classList.add(bz),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const a=()=>{this._isTransitioning=!1,this._element.classList.remove(bz),this._element.classList.add(jD,nne),this._element.style[r]="",so.trigger(this._element,JMe)},f=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(a,this._element,!0),this._element.style[r]=`${this._element[f]}px`}hide(){if(this._isTransitioning||!this._isShown()||so.trigger(this._element,QMe).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,bI(this._element),this._element.classList.add(bz),this._element.classList.remove(jD,nne);for(const a of this._triggerArray){const u=mr.getElementFromSelector(a);u&&!this._isShown(u)&&this._addAriaAndCollapsedClass([a],!1)}this._isTransitioning=!0;const r=()=>{this._isTransitioning=!1,this._element.classList.remove(bz),this._element.classList.add(jD),so.trigger(this._element,eRe)};this._element.style[t]="",this._queueCallback(r,this._element,!0)}_isShown(e=this._element){return e.classList.contains(nne)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=yk(e.parent),e}_getDimension(){return this._element.classList.contains(sRe)?rRe:iRe}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(woe);for(const t of e){const r=mr.getElementFromSelector(t);r&&this._addAriaAndCollapsedClass([t],this._isShown(r))}}_getFirstLevelChildren(e){const t=mr.find(oRe,this._config.parent);return mr.find(e,this._config.parent).filter(r=>!t.includes(r))}_addAriaAndCollapsedClass(e,t){if(!!e.length)for(const r of e)r.classList.toggle(nRe,!t),r.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const r=QP.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof r[e]>"u")throw new TypeError(`No method named "${e}"`);r[e]()}})}}so.on(document,tRe,woe,function(s){(s.target.tagName==="A"||s.delegateTarget&&s.delegateTarget.tagName==="A")&&s.preventDefault();for(const e of mr.getMultipleElementsFromSelector(this))QP.getOrCreateInstance(e,{toggle:!1}).toggle()});V0(QP);const bde="dropdown",uRe="bs.dropdown",e3=`.${uRe}`,Ese=".data-api",fRe="Escape",vde="Tab",dRe="ArrowUp",yde="ArrowDown",hRe=2,mRe=`hide${e3}`,gRe=`hidden${e3}`,pRe=`show${e3}`,bRe=`shown${e3}`,J1e=`click${e3}${Ese}`,Q1e=`keydown${e3}${Ese}`,vRe=`keyup${e3}${Ese}`,$D="show",yRe="dropup",wRe="dropend",_Re="dropstart",CRe="dropup-center",SRe="dropdown-center",UA='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',kRe=`${UA}.${$D}`,Zz=".dropdown-menu",ERe=".navbar",xRe=".navbar-nav",ARe=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",TRe=L0()?"top-end":"top-start",DRe=L0()?"top-start":"top-end",ORe=L0()?"bottom-end":"bottom-start",MRe=L0()?"bottom-start":"bottom-end",RRe=L0()?"left-start":"right-start",NRe=L0()?"right-start":"left-start",PRe="top",IRe="bottom",BRe={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},LRe={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class s2 extends bv{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=mr.next(this._element,Zz)[0]||mr.prev(this._element,Zz)[0]||mr.findOne(Zz,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return BRe}static get DefaultType(){return LRe}static get NAME(){return bde}toggle(){return this._isShown()?this.hide():this.show()}show(){if(wk(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!so.trigger(this._element,pRe,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(xRe))for(const r of[].concat(...document.body.children))so.on(r,"mouseover",NV);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add($D),this._element.classList.add($D),so.trigger(this._element,bRe,e)}}hide(){if(wk(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!so.trigger(this._element,mRe,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))so.off(r,"mouseover",NV);this._popper&&this._popper.destroy(),this._menu.classList.remove($D),this._element.classList.remove($D),this._element.setAttribute("aria-expanded","false"),T_.removeDataAttribute(this._menu,"popper"),so.trigger(this._element,gRe,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!A_(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${bde.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof I1e>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:A_(this._config.reference)?e=yk(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Cse(e,this._menu,t)}_isShown(){return this._menu.classList.contains($D)}_getPlacement(){const e=this._parent;if(e.classList.contains(wRe))return RRe;if(e.classList.contains(_Re))return NRe;if(e.classList.contains(CRe))return PRe;if(e.classList.contains(SRe))return IRe;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(yRe)?t?DRe:TRe:t?MRe:ORe}_detectNavbar(){return this._element.closest(ERe)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(T_.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...Tp(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const r=mr.find(ARe,this._menu).filter(a=>kO(a));!r.length||Sse(r,t,e===yde,!r.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=s2.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===hRe||e.type==="keyup"&&e.key!==vde)return;const t=mr.find(kRe);for(const r of t){const a=s2.getInstance(r);if(!a||a._config.autoClose===!1)continue;const u=e.composedPath(),f=u.includes(a._menu);if(u.includes(a._element)||a._config.autoClose==="inside"&&!f||a._config.autoClose==="outside"&&f||a._menu.contains(e.target)&&(e.type==="keyup"&&e.key===vde||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const h={relatedTarget:a._element};e.type==="click"&&(h.clickEvent=e),a._completeHide(h)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),r=e.key===fRe,a=[dRe,yde].includes(e.key);if(!a&&!r||t&&!r)return;e.preventDefault();const u=this.matches(UA)?this:mr.prev(this,UA)[0]||mr.next(this,UA)[0]||mr.findOne(UA,e.delegateTarget.parentNode),f=s2.getOrCreateInstance(u);if(a){e.stopPropagation(),f.show(),f._selectMenuItem(e);return}f._isShown()&&(e.stopPropagation(),f.hide(),u.focus())}}so.on(document,Q1e,UA,s2.dataApiKeydownHandler);so.on(document,Q1e,Zz,s2.dataApiKeydownHandler);so.on(document,J1e,s2.clearMenus);so.on(document,vRe,s2.clearMenus);so.on(document,J1e,UA,function(s){s.preventDefault(),s2.getOrCreateInstance(this).toggle()});V0(s2);const e0e="backdrop",FRe="fade",wde="show",_de=`mousedown.bs.${e0e}`,HRe={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},$Re={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class t0e extends vI{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return HRe}static get DefaultType(){return $Re}static get NAME(){return e0e}show(e){if(!this._config.isVisible){Tp(e);return}this._append();const t=this._getElement();this._config.isAnimated&&bI(t),t.classList.add(wde),this._emulateAnimation(()=>{Tp(e)})}hide(e){if(!this._config.isVisible){Tp(e);return}this._getElement().classList.remove(wde),this._emulateAnimation(()=>{this.dispose(),Tp(e)})}dispose(){!this._isAppended||(so.off(this._element,_de),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(FRe),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=yk(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),so.on(e,_de,()=>{Tp(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){$1e(e,this._getElement(),this._config.isAnimated)}}const zRe="focustrap",VRe="bs.focustrap",IV=`.${VRe}`,URe=`focusin${IV}`,WRe=`keydown.tab${IV}`,jRe="Tab",ZRe="forward",Cde="backward",qRe={autofocus:!0,trapElement:null},GRe={autofocus:"boolean",trapElement:"element"};class n0e extends vI{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return qRe}static get DefaultType(){return GRe}static get NAME(){return zRe}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),so.off(document,IV),so.on(document,URe,e=>this._handleFocusin(e)),so.on(document,WRe,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){!this._isActive||(this._isActive=!1,so.off(document,IV))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const r=mr.focusableChildren(t);r.length===0?t.focus():this._lastTabNavDirection===Cde?r[r.length-1].focus():r[0].focus()}_handleKeydown(e){e.key===jRe&&(this._lastTabNavDirection=e.shiftKey?Cde:ZRe)}}const Sde=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",kde=".sticky-top",vz="padding-right",Ede="margin-right";class _oe{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,vz,t=>t+e),this._setElementAttributes(Sde,vz,t=>t+e),this._setElementAttributes(kde,Ede,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,vz),this._resetElementAttributes(Sde,vz),this._resetElementAttributes(kde,Ede)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,r){const a=this.getWidth(),u=f=>{if(f!==this._element&&window.innerWidth>f.clientWidth+a)return;this._saveInitialAttribute(f,t);const h=window.getComputedStyle(f).getPropertyValue(t);f.style.setProperty(t,`${r(Number.parseFloat(h))}px`)};this._applyManipulationCallback(e,u)}_saveInitialAttribute(e,t){const r=e.style.getPropertyValue(t);r&&T_.setDataAttribute(e,t,r)}_resetElementAttributes(e,t){const r=a=>{const u=T_.getDataAttribute(a,t);if(u===null){a.style.removeProperty(t);return}T_.removeDataAttribute(a,t),a.style.setProperty(t,u)};this._applyManipulationCallback(e,r)}_applyManipulationCallback(e,t){if(A_(e)){t(e);return}for(const r of mr.find(e,this._element))t(r)}}const KRe="modal",YRe="bs.modal",F0=`.${YRe}`,XRe=".data-api",JRe="Escape",QRe=`hide${F0}`,e5e=`hidePrevented${F0}`,o0e=`hidden${F0}`,s0e=`show${F0}`,t5e=`shown${F0}`,n5e=`resize${F0}`,o5e=`click.dismiss${F0}`,s5e=`mousedown.dismiss${F0}`,r5e=`keydown.dismiss${F0}`,i5e=`click${F0}${XRe}`,xde="modal-open",a5e="fade",Ade="show",one="modal-static",l5e=".modal.show",c5e=".modal-dialog",u5e=".modal-body",f5e='[data-bs-toggle="modal"]',d5e={backdrop:!0,focus:!0,keyboard:!0},h5e={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class gO extends bv{constructor(e,t){super(e,t),this._dialog=mr.findOne(c5e,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new _oe,this._addEventListeners()}static get Default(){return d5e}static get DefaultType(){return h5e}static get NAME(){return KRe}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||so.trigger(this._element,s0e,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(xde),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||so.trigger(this._element,QRe).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Ade),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){so.off(window,F0),so.off(this._dialog,F0),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new t0e({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new n0e({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=mr.findOne(u5e,this._dialog);t&&(t.scrollTop=0),bI(this._element),this._element.classList.add(Ade);const r=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,so.trigger(this._element,t5e,{relatedTarget:e})};this._queueCallback(r,this._dialog,this._isAnimated())}_addEventListeners(){so.on(this._element,r5e,e=>{if(e.key===JRe){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),so.on(window,n5e,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),so.on(this._element,s5e,e=>{so.one(this._element,o5e,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(xde),this._resetAdjustments(),this._scrollBar.reset(),so.trigger(this._element,o0e)})}_isAnimated(){return this._element.classList.contains(a5e)}_triggerBackdropTransition(){if(so.trigger(this._element,e5e).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,r=this._element.style.overflowY;r==="hidden"||this._element.classList.contains(one)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(one),this._queueCallback(()=>{this._element.classList.remove(one),this._queueCallback(()=>{this._element.style.overflowY=r},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),r=t>0;if(r&&!e){const a=L0()?"paddingLeft":"paddingRight";this._element.style[a]=`${t}px`}if(!r&&e){const a=L0()?"paddingRight":"paddingLeft";this._element.style[a]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const r=gO.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof r[e]>"u")throw new TypeError(`No method named "${e}"`);r[e](t)}})}}so.on(document,i5e,f5e,function(s){const e=mr.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&s.preventDefault(),so.one(e,s0e,a=>{a.defaultPrevented||so.one(e,o0e,()=>{kO(this)&&this.focus()})});const t=mr.findOne(l5e);t&&gO.getInstance(t).hide(),gO.getOrCreateInstance(e).toggle(this)});dU(gO);V0(gO);const m5e="offcanvas",g5e="bs.offcanvas",L_=`.${g5e}`,r0e=".data-api",p5e=`load${L_}${r0e}`,b5e="Escape",Tde="show",Dde="showing",Ode="hiding",v5e="offcanvas-backdrop",i0e=".offcanvas.show",y5e=`show${L_}`,w5e=`shown${L_}`,_5e=`hide${L_}`,Mde=`hidePrevented${L_}`,a0e=`hidden${L_}`,C5e=`resize${L_}`,S5e=`click${L_}${r0e}`,k5e=`keydown.dismiss${L_}`,E5e='[data-bs-toggle="offcanvas"]',x5e={backdrop:!0,keyboard:!0,scroll:!1},A5e={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class _k extends bv{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return x5e}static get DefaultType(){return A5e}static get NAME(){return m5e}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||so.trigger(this._element,y5e,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new _oe().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Dde);const r=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(Tde),this._element.classList.remove(Dde),so.trigger(this._element,w5e,{relatedTarget:e})};this._queueCallback(r,this._element,!0)}hide(){if(!this._isShown||so.trigger(this._element,_5e).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ode),this._backdrop.hide();const t=()=>{this._element.classList.remove(Tde,Ode),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new _oe().reset(),so.trigger(this._element,a0e)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){so.trigger(this._element,Mde);return}this.hide()},t=Boolean(this._config.backdrop);return new t0e({className:v5e,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new n0e({trapElement:this._element})}_addEventListeners(){so.on(this._element,k5e,e=>{if(e.key===b5e){if(this._config.keyboard){this.hide();return}so.trigger(this._element,Mde)}})}static jQueryInterface(e){return this.each(function(){const t=_k.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}so.on(document,S5e,E5e,function(s){const e=mr.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),wk(this))return;so.one(e,a0e,()=>{kO(this)&&this.focus()});const t=mr.findOne(i0e);t&&t!==e&&_k.getInstance(t).hide(),_k.getOrCreateInstance(e).toggle(this)});so.on(window,p5e,()=>{for(const s of mr.find(i0e))_k.getOrCreateInstance(s).show()});so.on(window,C5e,()=>{for(const s of mr.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(s).position!=="fixed"&&_k.getOrCreateInstance(s).hide()});dU(_k);V0(_k);const T5e=/^aria-[\w-]*$/i,l0e={"*":["class","dir","id","lang","role",T5e],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},D5e=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),O5e=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,M5e=(s,e)=>{const t=s.nodeName.toLowerCase();return e.includes(t)?D5e.has(t)?Boolean(O5e.test(s.nodeValue)):!0:e.filter(r=>r instanceof RegExp).some(r=>r.test(t))};function R5e(s,e,t){if(!s.length)return s;if(t&&typeof t=="function")return t(s);const a=new window.DOMParser().parseFromString(s,"text/html"),u=[].concat(...a.body.querySelectorAll("*"));for(const f of u){const h=f.nodeName.toLowerCase();if(!Object.keys(e).includes(h)){f.remove();continue}const g=[].concat(...f.attributes),y=[].concat(e["*"]||[],e[h]||[]);for(const C of g)M5e(C,y)||f.removeAttribute(C.nodeName)}return a.body.innerHTML}const N5e="TemplateFactory",P5e={allowList:l0e,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},I5e={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},B5e={entry:"(string|element|function|null)",selector:"(string|element)"};class L5e extends vI{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return P5e}static get DefaultType(){return I5e}static get NAME(){return N5e}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[a,u]of Object.entries(this._config.content))this._setContent(e,u,a);const t=e.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&t.classList.add(...r.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,r]of Object.entries(e))super._typeCheckConfig({selector:t,entry:r},B5e)}_setContent(e,t,r){const a=mr.findOne(r,e);if(!!a){if(t=this._resolvePossibleFunction(t),!t){a.remove();return}if(A_(t)){this._putElementInTemplate(yk(t),a);return}if(this._config.html){a.innerHTML=this._maybeSanitize(t);return}a.textContent=t}}_maybeSanitize(e){return this._config.sanitize?R5e(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Tp(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const F5e="tooltip",H5e=new Set(["sanitize","allowList","sanitizeFn"]),sne="fade",$5e="modal",yz="show",z5e=".tooltip-inner",Rde=`.${$5e}`,Nde="hide.bs.modal",dP="hover",rne="focus",V5e="click",U5e="manual",W5e="hide",j5e="hidden",Z5e="show",q5e="shown",G5e="inserted",K5e="click",Y5e="focusin",X5e="focusout",J5e="mouseenter",Q5e="mouseleave",eNe={AUTO:"auto",TOP:"top",RIGHT:L0()?"left":"right",BOTTOM:"bottom",LEFT:L0()?"right":"left"},tNe={allowList:l0e,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},nNe={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class t3 extends bv{constructor(e,t){if(typeof I1e>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return tNe}static get DefaultType(){return nNe}static get NAME(){return F5e}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(!!this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),so.off(this._element.closest(Rde),Nde,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=so.trigger(this._element,this.constructor.eventName(Z5e)),r=(F1e(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!r)return;this._disposePopper();const a=this._getTipElement();this._element.setAttribute("aria-describedby",a.getAttribute("id"));const{container:u}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(u.append(a),so.trigger(this._element,this.constructor.eventName(G5e))),this._popper=this._createPopper(a),a.classList.add(yz),"ontouchstart"in document.documentElement)for(const h of[].concat(...document.body.children))so.on(h,"mouseover",NV);const f=()=>{so.trigger(this._element,this.constructor.eventName(q5e)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(f,this.tip,this._isAnimated())}hide(){if(!this._isShown()||so.trigger(this._element,this.constructor.eventName(W5e)).defaultPrevented)return;if(this._getTipElement().classList.remove(yz),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))so.off(a,"mouseover",NV);this._activeTrigger[V5e]=!1,this._activeTrigger[rne]=!1,this._activeTrigger[dP]=!1,this._isHovered=null;const r=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),so.trigger(this._element,this.constructor.eventName(j5e)))};this._queueCallback(r,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(sne,yz),t.classList.add(`bs-${this.constructor.NAME}-auto`);const r=VOe(this.constructor.NAME).toString();return t.setAttribute("id",r),this._isAnimated()&&t.classList.add(sne),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new L5e({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[z5e]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(sne)}_isShown(){return this.tip&&this.tip.classList.contains(yz)}_createPopper(e){const t=Tp(this._config.placement,[this,e,this._element]),r=eNe[t.toUpperCase()];return Cse(this._element,e,this._getPopperConfig(r))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Tp(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:r=>{this._getTipElement().setAttribute("data-popper-placement",r.state.placement)}}]};return{...t,...Tp(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")so.on(this._element,this.constructor.eventName(K5e),this._config.selector,r=>{this._initializeOnDelegatedTarget(r).toggle()});else if(t!==U5e){const r=t===dP?this.constructor.eventName(J5e):this.constructor.eventName(Y5e),a=t===dP?this.constructor.eventName(Q5e):this.constructor.eventName(X5e);so.on(this._element,r,this._config.selector,u=>{const f=this._initializeOnDelegatedTarget(u);f._activeTrigger[u.type==="focusin"?rne:dP]=!0,f._enter()}),so.on(this._element,a,this._config.selector,u=>{const f=this._initializeOnDelegatedTarget(u);f._activeTrigger[u.type==="focusout"?rne:dP]=f._element.contains(u.relatedTarget),f._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},so.on(this._element.closest(Rde),Nde,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");!e||(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=T_.getDataAttributes(this._element);for(const r of Object.keys(t))H5e.has(r)&&delete t[r];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:yk(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,r]of Object.entries(this._config))this.constructor.Default[t]!==r&&(e[t]=r);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=t3.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}V0(t3);const oNe="popover",sNe=".popover-header",rNe=".popover-body",iNe={...t3.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},aNe={...t3.DefaultType,content:"(null|string|element|function)"};class xse extends t3{static get Default(){return iNe}static get DefaultType(){return aNe}static get NAME(){return oNe}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[sNe]:this._getTitle(),[rNe]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=xse.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}V0(xse);const lNe="scrollspy",cNe="bs.scrollspy",Ase=`.${cNe}`,uNe=".data-api",fNe=`activate${Ase}`,Pde=`click${Ase}`,dNe=`load${Ase}${uNe}`,hNe="dropdown-item",ND="active",mNe='[data-bs-spy="scroll"]',ine="[href]",gNe=".nav, .list-group",Ide=".nav-link",pNe=".nav-item",bNe=".list-group-item",vNe=`${Ide}, ${pNe} > ${Ide}, ${bNe}`,yNe=".dropdown",wNe=".dropdown-toggle",_Ne={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},CNe={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class gU extends bv{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return _Ne}static get DefaultType(){return CNe}static get NAME(){return lNe}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=yk(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){!this._config.smoothScroll||(so.off(this._config.target,Pde),so.on(this._config.target,Pde,ine,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const r=this._rootElement||window,a=t.offsetTop-this._element.offsetTop;if(r.scrollTo){r.scrollTo({top:a,behavior:"smooth"});return}r.scrollTop=a}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=f=>this._targetLinks.get(`#${f.target.id}`),r=f=>{this._previousScrollData.visibleEntryTop=f.target.offsetTop,this._process(t(f))},a=(this._rootElement||document.documentElement).scrollTop,u=a>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=a;for(const f of e){if(!f.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(f));continue}const h=f.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(u&&h){if(r(f),!a)return;continue}!u&&!h&&r(f)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=mr.find(ine,this._config.target);for(const t of e){if(!t.hash||wk(t))continue;const r=mr.findOne(decodeURI(t.hash),this._element);kO(r)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,r))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(ND),this._activateParents(e),so.trigger(this._element,fNe,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(hNe)){mr.findOne(wNe,e.closest(yNe)).classList.add(ND);return}for(const t of mr.parents(e,gNe))for(const r of mr.prev(t,vNe))r.classList.add(ND)}_clearActiveClass(e){e.classList.remove(ND);const t=mr.find(`${ine}.${ND}`,e);for(const r of t)r.classList.remove(ND)}static jQueryInterface(e){return this.each(function(){const t=gU.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}so.on(window,dNe,()=>{for(const s of mr.find(mNe))gU.getOrCreateInstance(s)});V0(gU);const SNe="tab",kNe="bs.tab",n3=`.${kNe}`,ENe=`hide${n3}`,xNe=`hidden${n3}`,ANe=`show${n3}`,TNe=`shown${n3}`,DNe=`click${n3}`,ONe=`keydown${n3}`,MNe=`load${n3}`,RNe="ArrowLeft",Bde="ArrowRight",NNe="ArrowUp",Lde="ArrowDown",ane="Home",Fde="End",WA="active",Hde="fade",lne="show",PNe="dropdown",c0e=".dropdown-toggle",INe=".dropdown-menu",cne=`:not(${c0e})`,BNe='.list-group, .nav, [role="tablist"]',LNe=".nav-item, .list-group-item",FNe=`.nav-link${cne}, .list-group-item${cne}, [role="tab"]${cne}`,u0e='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',une=`${FNe}, ${u0e}`,HNe=`.${WA}[data-bs-toggle="tab"], .${WA}[data-bs-toggle="pill"], .${WA}[data-bs-toggle="list"]`;class pO extends bv{constructor(e){super(e),this._parent=this._element.closest(BNe),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),so.on(this._element,ONe,t=>this._keydown(t)))}static get NAME(){return SNe}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),r=t?so.trigger(t,ENe,{relatedTarget:e}):null;so.trigger(e,ANe,{relatedTarget:t}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(WA),this._activate(mr.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(lne);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),so.trigger(e,TNe,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(Hde))}_deactivate(e,t){if(!e)return;e.classList.remove(WA),e.blur(),this._deactivate(mr.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(lne);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),so.trigger(e,xNe,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(Hde))}_keydown(e){if(![RNe,Bde,NNe,Lde,ane,Fde].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(a=>!wk(a));let r;if([ane,Fde].includes(e.key))r=t[e.key===ane?0:t.length-1];else{const a=[Bde,Lde].includes(e.key);r=Sse(t,e.target,a,!0)}r&&(r.focus({preventScroll:!0}),pO.getOrCreateInstance(r).show())}_getChildren(){return mr.find(une,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const r of t)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),r=this._getOuterElement(e);e.setAttribute("aria-selected",t),r!==e&&this._setAttributeIfNotExists(r,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=mr.getElementFromSelector(e);!t||(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const r=this._getOuterElement(e);if(!r.classList.contains(PNe))return;const a=(u,f)=>{const h=mr.findOne(u,r);h&&h.classList.toggle(f,t)};a(c0e,WA),a(INe,lne),r.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,r){e.hasAttribute(t)||e.setAttribute(t,r)}_elemIsActive(e){return e.classList.contains(WA)}_getInnerElement(e){return e.matches(une)?e:mr.findOne(une,e)}_getOuterElement(e){return e.closest(LNe)||e}static jQueryInterface(e){return this.each(function(){const t=pO.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}so.on(document,DNe,u0e,function(s){["A","AREA"].includes(this.tagName)&&s.preventDefault(),!wk(this)&&pO.getOrCreateInstance(this).show()});so.on(window,MNe,()=>{for(const s of mr.find(HNe))pO.getOrCreateInstance(s)});V0(pO);const $Ne="toast",zNe="bs.toast",Ak=`.${zNe}`,VNe=`mouseover${Ak}`,UNe=`mouseout${Ak}`,WNe=`focusin${Ak}`,jNe=`focusout${Ak}`,ZNe=`hide${Ak}`,qNe=`hidden${Ak}`,GNe=`show${Ak}`,KNe=`shown${Ak}`,YNe="fade",$de="hide",wz="show",_z="showing",XNe={animation:"boolean",autohide:"boolean",delay:"number"},JNe={animation:!0,autohide:!0,delay:5e3};class pU extends bv{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return JNe}static get DefaultType(){return XNe}static get NAME(){return $Ne}show(){if(so.trigger(this._element,GNe).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(YNe);const t=()=>{this._element.classList.remove(_z),so.trigger(this._element,KNe),this._maybeScheduleHide()};this._element.classList.remove($de),bI(this._element),this._element.classList.add(wz,_z),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||so.trigger(this._element,ZNe).defaultPrevented)return;const t=()=>{this._element.classList.add($de),this._element.classList.remove(_z,wz),so.trigger(this._element,qNe)};this._element.classList.add(_z),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(wz),super.dispose()}isShown(){return this._element.classList.contains(wz)}_maybeScheduleHide(){!this._config.autohide||this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const r=e.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){so.on(this._element,VNe,e=>this._onInteraction(e,!0)),so.on(this._element,UNe,e=>this._onInteraction(e,!1)),so.on(this._element,WNe,e=>this._onInteraction(e,!0)),so.on(this._element,jNe,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=pU.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}dU(pU);V0(pU);Rp.escape=function(s){return s};function QNe(){var s=[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));s.map(function(e){return new t3(e)})}const e6e={account:ive,channel:JDe};let Cz=[],t6e=function(){Cz.map(t=>t.$destroy()),Cz=[];const s=document.body.querySelectorAll(".lucent-component");if(s.length===0)return;const e=function(t){const r=t.attributes["data-layout"].value,[a,u]=Object.entries(e6e).find(([y,C])=>r==y);if(!u)return[];const f=document.getElementById("json-"+r).innerHTML,h=JSON.parse(f),g={target:t,props:h};Cz=[...Cz,new u(g)]};Array.from(s).map(e)};document.addEventListener("DOMContentLoaded",t6e);document.addEventListener("DOMContentLoaded",QNe);