61 lines
368 KiB
Java
61 lines
368 KiB
Java
import{L as Tu,U as mn,D as Ru}from"./NodeContainer-D9PNfjwh-CawrgSrv.js";import{o as Ou}from"./index-Crt100Db-CDbHzweT.js";import{P as ku}from"./propStore-Cl0CojEU-BjnqDV4W.js";import{e as rs,f as Qt,g as Mu,m as or,h as Pu,j as Lu,l as Du,n as Ge,r as Iu,o as Bu,p as Fu,q as ju,t as Xi,v as Hu,w as Wu,x as Ar,y as $u,_ as is,z as zu,i as ie,D as Gu,N as Oi,L as gn,T as os,E as pr,P as Uu,b as qu,F as Ur,O as ar,M as Ku,G as as,H as ss,I as Yi,J as Vi,K as ls,S as us,Q as gr,R as cs,U as Ve,V as ds,W as qr,X as Xu,Y as Yu,Z as Vu,$ as Zu,a0 as Ju,a1 as Qu,a2 as ec,a3 as ft,a4 as tc,a5 as Io,a6 as Bo,a7 as nc,a8 as rc,a9 as ic,aa as oc,ab as ac,ac as sc,ad as hs}from"./NodeStyle-Bo2gmgjj-CM4kHPNz.js";import{n as fs}from"./_commonjsHelpers-B52_cu2H-BG14nIm9.js";import lc from"./LoopIcon-BnGR9e2Y-QnRawAik.js";import{k as uc}from"./useNode-DryF6TH6-6dWLb65C.js";import{l as cc}from"./runStore-Oe6fP2qb-CrdxkpS7.js";import{j8 as Jt,j9 as It,ih as Ce,ja as Fo,ia as Gt,jb as sr,a3 as rn,jc as yn,is as ps,jd as Ot,ij as Ut,cD as We,je as dc,ib as qt,cO as hc,jf as fc,jg as lr,jh as kt,i4 as Kr,i7 as Zi,ji as en,i8 as Kt,bZ as Ji,jj as bn,ik as Bn,fO as Qi,cR as Re,jk as Xr,im as ur,ar as eo,jl as Fe,jm as Zt,jn as St,jo as Wt,jp as wn,jq as cr,cT as Et,cL as ot,aa as Ae,jr as to,js as pc,jt as Fn,ju as gs,iq as Bt,cS as at,jv as gc,jw as mc,ic as Yr,jx as xn,il as sn,jy as ms,jz as vc,jA as yc,io as jn,jB as Pn,i6 as dr,ii as Vr,jC as vs,jD as ys,jE as bs,jF as ws,jG as bc,cM as on,jH as Dn,jI as wc,jJ as xs,jK as Es,jL as Cs,jM as _s,jN as xc,jO as Ec,id as no,jP as Cc,jQ as _c,jR as Ac,jS as Sc,jT as $t,ie as Nc,jU as Tc,jV as Sr,jW as Rc,jX as Oc,jY as ro,jZ as As,j_ as Ss,j$ as Zr,k0 as En,k1 as Ns,k2 as Ts,k3 as io,k4 as kc,k5 as Rs,k6 as Mc,k7 as Os,k8 as ks,k9 as Pc,ka as Lc,kb as Dc,a9 as In,i9 as Ic,kc as Bc,kd as Fc,cY as jc,ke as Ms,j7 as Hc,ip as Wc,kf as $c,a4 as zc,kg as Gc,kh as Uc,aQ as ki,ki as qc,ir as Kc,i as Xc,kj as Yc,kk as Vc,kl as Zc,aL as Jc,dz as Mi,b2 as Qc,at as ed,bW as td,km as nd,kn as rd,ko as id}from"./index-X7Y8jykP.js";import{t as od}from"./throttle-De_jAmBh.js";import{b as Jr,d as ad}from"./difference-CGvbIcA7.js";import{f as sd}from"./fromPairs-Dx9PT-t0.js";import{u as ld}from"./uniqBy--vsL0WVB.js";import{e as ud,y as cd,w as dd,o as hd,z as fd,A as pd,Q as gd,T as md,r as yi,B as vd,u as jo,c as yd}from"./vue-vendor-DNhG1Cve.js";var bd=NaN;function Ho(t){return typeof t=="number"?t:Jt(t)?bd:+t}function Qr(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=It(n),r=It(r)):(n=Ho(n),r=Ho(r)),i=t(n,r)}return i}}var wd=Qr(function(t,e){return t+e},0),xd="Expected a function";function Ed(t,e){if(typeof e!="function")throw new TypeError(xd);return t=Ce(t),function(){if(--t<1)return e.apply(this,arguments)}}var Nr=Fo&&new Fo,Ps=Nr?function(t,e){return Nr.set(t,e),t}:Gt;function ir(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=sr(t.prototype),r=t.apply(n,e);return rn(r)?r:n}}var Cd=1;function _d(t,e,n){var r=e&Cd,i=ir(t);function o(){var s=this&&this!==yn&&this instanceof o?i:t;return s.apply(r?n:this,arguments)}return o}var Ad=Math.max;function Ls(t,e,n,r){for(var i=-1,o=t.length,s=n.length,l=-1,a=e.length,u=Ad(o-s,0),c=Array(a+u),d=!r;++l<a;)c[l]=e[l];for(;++i<s;)(d||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[l++]=t[i++];return c}var Sd=Math.max;function Ds(t,e,n,r){for(var i=-1,o=t.length,s=-1,l=n.length,a=-1,u=e.length,c=Sd(o-l,0),d=Array(c+u),h=!r;++i<c;)d[i]=t[i];for(var f=i;++a<u;)d[f+a]=e[a];for(;++s<l;)(h||i<o)&&(d[f+n[s]]=t[i++]);return d}function Nd(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}function ei(){}var Td=4294967295;function Te(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Td,this.__views__=[]}Te.prototype=sr(ei.prototype);Te.prototype.constructor=Te;var oo=Nr?function(t){return Nr.get(t)}:ps,Ln={},Rd=Object.prototype,Od=Rd.hasOwnProperty;function xr(t){for(var e=t.name+"",n=Ln[e],r=Od.call(Ln,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Mt(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Mt.prototype=sr(ei.prototype);Mt.prototype.constructor=Mt;function Is(t){if(t instanceof Te)return t.clone();var e=new Mt(t.__wrapped__,t.__chain__);return e.__actions__=Ot(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var kd=Object.prototype,Md=kd.hasOwnProperty;function p(t){if(Ut(t)&&!We(t)&&!(t instanceof Te)){if(t instanceof Mt)return t;if(Md.call(t,"__wrapped__"))return Is(t)}return new Mt(t)}p.prototype=ei.prototype;p.prototype.constructor=p;function Pi(t){var e=xr(t),n=p[e];if(typeof n!="function"||!(e in Te.prototype))return!1;if(t===n)return!0;var r=oo(n);return!!r&&t===r[0]}var Bs=dc(Ps),Pd=/\{\n\/\* \[wrapped with (.+)\] \*/,Ld=/,? & /;function Dd(t){var e=t.match(Pd);return e?e[1].split(Ld):[]}var Id=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Bd(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Id,`{
|
||
/* [wrapped with `+e+`] */
|
||
`)}var Fd=1,jd=2,Hd=8,Wd=16,$d=32,zd=64,Gd=128,Ud=256,qd=512,Kd=[["ary",Gd],["bind",Fd],["bindKey",jd],["curry",Hd],["curryRight",Wd],["flip",qd],["partial",$d],["partialRight",zd],["rearg",Ud]];function Xd(t,e){return qt(Kd,function(n){var r="_."+n[0];e&n[1]&&!hc(t,r)&&t.push(r)}),t.sort()}function Fs(t,e,n){var r=e+"";return fc(t,Bd(r,Xd(Dd(r),n)))}var Yd=4,Vd=8,Wo=32,$o=64;function js(t,e,n,r,i,o,s,l,a,u){var c=e&Vd,d=c?s:void 0,h=c?void 0:s,f=c?o:void 0,v=c?void 0:o;e|=c?Wo:$o,e&=~(c?$o:Wo),e&Yd||(e&=-4);var b=[t,e,i,f,d,v,h,l,a,u],w=n.apply(void 0,b);return Pi(t)&&Bs(w,b),w.placeholder=r,Fs(w,t,e)}function Hn(t){var e=t;return e.placeholder}var Zd=Math.min;function Jd(t,e){for(var n=t.length,r=Zd(e.length,n),i=Ot(t);r--;){var o=e[r];t[r]=lr(o,n)?i[o]:void 0}return t}var zo="__lodash_placeholder__";function an(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n];(s===e||s===zo)&&(t[n]=zo,o[i++]=n)}return o}var Qd=1,eh=2,th=8,nh=16,rh=128,ih=512;function ti(t,e,n,r,i,o,s,l,a,u){var c=e&rh,d=e&Qd,h=e&eh,f=e&(th|nh),v=e&ih,b=h?void 0:ir(t);function w(){for(var T=arguments.length,P=Array(T),H=T;H--;)P[H]=arguments[H];if(f)var G=Hn(w),se=Nd(P,G);if(r&&(P=Ls(P,r,i,f)),o&&(P=Ds(P,o,s,f)),T-=se,f&&T<u){var U=an(P,G);return js(t,e,ti,w.placeholder,n,P,U,l,a,u-T)}var D=d?n:this,he=h?D[t]:t;return T=P.length,l?P=Jd(P,l):v&&T>1&&P.reverse(),c&&a<T&&(P.length=a),this&&this!==yn&&this instanceof w&&(he=b||ir(he)),he.apply(D,P)}return w}function oh(t,e,n){var r=ir(t);function i(){for(var o=arguments.length,s=Array(o),l=o,a=Hn(i);l--;)s[l]=arguments[l];var u=o<3&&s[0]!==a&&s[o-1]!==a?[]:an(s,a);if(o-=u.length,o<n)return js(t,e,ti,i.placeholder,void 0,s,u,void 0,void 0,n-o);var c=this&&this!==yn&&this instanceof i?r:t;return kt(c,this,s)}return i}var ah=1;function sh(t,e,n,r){var i=e&ah,o=ir(t);function s(){for(var l=-1,a=arguments.length,u=-1,c=r.length,d=Array(c+a),h=this&&this!==yn&&this instanceof s?o:t;++u<c;)d[u]=r[u];for(;a--;)d[u++]=arguments[++l];return kt(h,i?n:this,d)}return s}var Go="__lodash_placeholder__",bi=1,lh=2,uh=4,Uo=8,Vn=128,qo=256,ch=Math.min;function dh(t,e){var n=t[1],r=e[1],i=n|r,o=i<(bi|lh|Vn),s=r==Vn&&n==Uo||r==Vn&&n==qo&&t[7].length<=e[8]||r==(Vn|qo)&&e[7].length<=e[8]&&n==Uo;if(!(o||s))return t;r&bi&&(t[2]=e[2],i|=n&bi?0:uh);var l=e[3];if(l){var a=t[3];t[3]=a?Ls(a,l,e[4]):l,t[4]=a?an(t[3],Go):e[4]}return l=e[5],l&&(a=t[5],t[5]=a?Ds(a,l,e[6]):l,t[6]=a?an(t[5],Go):e[6]),l=e[7],l&&(t[7]=l),r&Vn&&(t[8]=t[8]==null?e[8]:ch(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}var hh="Expected a function",Ko=1,fh=2,Xo=8,Yo=16,Vo=32,ph=64,Zo=Math.max;function tn(t,e,n,r,i,o,s,l){var a=e&fh;if(!a&&typeof t!="function")throw new TypeError(hh);var u=r?r.length:0;if(u||(e&=-97,r=i=void 0),s=s===void 0?s:Zo(Ce(s),0),l=l===void 0?l:Ce(l),u-=i?i.length:0,e&ph){var c=r,d=i;r=i=void 0}var h=a?void 0:oo(t),f=[t,e,n,r,i,c,d,o,s,l];if(h&&dh(f,h),t=f[0],e=f[1],n=f[2],r=f[3],i=f[4],l=f[9]=f[9]===void 0?a?0:t.length:Zo(f[9]-u,0),!l&&e&(Xo|Yo)&&(e&=-25),!e||e==Ko)var v=_d(t,e,n);else e==Xo||e==Yo?v=oh(t,e,l):(e==Vo||e==(Ko|Vo))&&!i.length?v=sh(t,e,n,r):v=ti.apply(void 0,f);var b=h?Ps:Bs;return Fs(b(v,f),t,e)}var gh=128;function Hs(t,e,n){return e=n?void 0:e,e=t&&e==null?t.length:e,tn(t,gh,void 0,void 0,void 0,void 0,e)}var mh=Kr(function(t,e){Zi(e,en(e),t)}),Li=Kr(function(t,e,n,r){Zi(e,en(e),t,r)}),vh=Kr(function(t,e,n,r){Zi(e,Kt(e),t,r)});function ao(t,e){for(var n=-1,r=e.length,i=Array(r),o=t==null;++n<r;)i[n]=o?void 0:Ji(t,e[n]);return i}var yh=bn(ao),bh="[object DOMException]",wh="[object Error]";function so(t){if(!Ut(t))return!1;var e=Bn(t);return e==wh||e==bh||typeof t.message=="string"&&typeof t.name=="string"&&!Qi(t)}var Ws=Re(function(t,e){try{return kt(t,void 0,e)}catch(n){return so(n)?n:new Error(n)}}),xh="Expected a function";function $s(t,e){var n;if(typeof e!="function")throw new TypeError(xh);return t=Ce(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Eh=1,Ch=32,ni=Re(function(t,e,n){var r=Eh;if(n.length){var i=an(n,Hn(ni));r|=Ch}return tn(t,r,e,n,i)});ni.placeholder={};var _h=bn(function(t,e){return qt(e,function(n){n=Xr(n),ur(t,n,ni(t[n],t))}),t}),Ah=1,Sh=2,Nh=32,lo=Re(function(t,e,n){var r=Ah|Sh;if(n.length){var i=an(n,Hn(lo));r|=Nh}return tn(e,r,t,n,i)});lo.placeholder={};function zs(t){return eo(Fe(t).toLowerCase())}function uo(t){return function(e){return t==null?void 0:t[e]}}var Th={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Rh=uo(Th),Oh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kh="\\u0300-\\u036f",Mh="\\ufe20-\\ufe2f",Ph="\\u20d0-\\u20ff",Lh=kh+Mh+Ph,Dh="["+Lh+"]",Ih=RegExp(Dh,"g");function Gs(t){return t=Fe(t),t&&t.replace(Oh,Rh).replace(Ih,"")}var Bh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Fh(t){return t.match(Bh)||[]}var jh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Hh(t){return jh.test(t)}var Us="\\ud800-\\udfff",Wh="\\u0300-\\u036f",$h="\\ufe20-\\ufe2f",zh="\\u20d0-\\u20ff",Gh=Wh+$h+zh,qs="\\u2700-\\u27bf",Ks="a-z\\xdf-\\xf6\\xf8-\\xff",Uh="\\xac\\xb1\\xd7\\xf7",qh="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kh="\\u2000-\\u206f",Xh=" \\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",Xs="A-Z\\xc0-\\xd6\\xd8-\\xde",Yh="\\ufe0e\\ufe0f",Ys=Uh+qh+Kh+Xh,Vs="['’]",Jo="["+Ys+"]",Vh="["+Gh+"]",Zs="\\d+",Zh="["+qs+"]",Js="["+Ks+"]",Qs="[^"+Us+Ys+Zs+qs+Ks+Xs+"]",Jh="\\ud83c[\\udffb-\\udfff]",Qh="(?:"+Vh+"|"+Jh+")",ef="[^"+Us+"]",el="(?:\\ud83c[\\udde6-\\uddff]){2}",tl="[\\ud800-\\udbff][\\udc00-\\udfff]",kn="["+Xs+"]",tf="\\u200d",Qo="(?:"+Js+"|"+Qs+")",nf="(?:"+kn+"|"+Qs+")",ea="(?:"+Vs+"(?:d|ll|m|re|s|t|ve))?",ta="(?:"+Vs+"(?:D|LL|M|RE|S|T|VE))?",nl=Qh+"?",rl="["+Yh+"]?",rf="(?:"+tf+"(?:"+[ef,el,tl].join("|")+")"+rl+nl+")*",of="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",af="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sf=rl+nl+rf,lf="(?:"+[Zh,el,tl].join("|")+")"+sf,uf=RegExp([kn+"?"+Js+"+"+ea+"(?="+[Jo,kn,"$"].join("|")+")",nf+"+"+ta+"(?="+[Jo,kn+Qo,"$"].join("|")+")",kn+"?"+Qo+"+"+ea,kn+"+"+ta,af,of,Zs,lf].join("|"),"g");function cf(t){return t.match(uf)||[]}function il(t,e,n){return t=Fe(t),e=n?void 0:e,e===void 0?Hh(t)?cf(t):Fh(t):t.match(e)||[]}var df="['’]",hf=RegExp(df,"g");function Wn(t){return function(e){return rs(il(Gs(e).replace(hf,"")),t,"")}}var ff=Wn(function(t,e,n){return e=e.toLowerCase(),t+(n?zs(e):e)});function pf(){if(!arguments.length)return[];var t=arguments[0];return We(t)?t:[t]}var gf=yn.isFinite,mf=Math.min;function co(t){var e=Math[t];return function(n,r){if(n=Zt(n),r=r==null?0:mf(Ce(r),292),r&&gf(n)){var i=(Fe(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(Fe(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var vf=co("ceil");function ol(t){var e=p(t);return e.__chain__=!0,e}var yf=Math.ceil,bf=Math.max;function wf(t,e,n){(n?St(t,e,n):e===void 0)?e=1:e=bf(Ce(e),0);var r=t==null?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,s=Array(yf(r/e));i<r;)s[o++]=Wt(t,i,i+=e);return s}function Cn(t,e,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),e!==void 0&&(t=t>=e?t:e)),t}function xf(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=Zt(n),n=n===n?n:0),e!==void 0&&(e=Zt(e),e=e===e?e:0),Cn(Zt(t),e,n)}var Ef=4;function Cf(t){return wn(t,Ef)}var _f=1,Af=4;function Sf(t,e){return e=typeof e=="function"?e:void 0,wn(t,_f|Af,e)}var Nf=4;function Tf(t,e){return e=typeof e=="function"?e:void 0,wn(t,Nf,e)}function Rf(){return new Mt(this.value(),this.__chain__)}function Of(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i}function kf(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return cr(We(n)?Ot(n):[n],Et(e,1))}var Mf="Expected a function";function Pf(t){var e=t==null?0:t.length,n=Ae;return t=e?ot(t,function(r){if(typeof r[1]!="function")throw new TypeError(Mf);return[n(r[0]),r[1]]}):[],Re(function(r){for(var i=-1;++i<e;){var o=t[i];if(kt(o[0],this,r))return kt(o[1],this,r)}})}function al(t,e,n){var r=n.length;if(t==null)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],s=t[i];if(s===void 0&&!(i in t)||!o(s))return!1}return!0}function Lf(t){var e=Kt(t);return function(n){return al(n,t,e)}}var Df=1;function If(t){return Lf(wn(t,Df))}function Bf(t,e){return e==null||al(t,e,Kt(e))}var Ff=Object.prototype,jf=Ff.hasOwnProperty,Hf=to(function(t,e,n){jf.call(t,n)?++t[n]:ur(t,n,1)});function Wf(t,e){var n=sr(t);return e==null?n:pc(n,e)}var $f=8;function ho(t,e,n){e=n?void 0:e;var r=tn(t,$f,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=ho.placeholder,r}ho.placeholder={};var zf=16;function fo(t,e,n){e=n?void 0:e;var r=tn(t,zf,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=fo.placeholder,r}fo.placeholder={};function Gf(t,e){return t==null||t!==t?e:t}var sl=Object.prototype,Uf=sl.hasOwnProperty,qf=Re(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&St(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=en(o),l=-1,a=s.length;++l<a;){var u=s[l],c=t[u];(c===void 0||Fn(c,sl[u])&&!Uf.call(t,u))&&(t[u]=o[u])}return t});function ll(t,e,n,r,i,o){return rn(t)&&rn(e)&&(o.set(e,t),gs(t,e,void 0,ll,o),o.delete(e)),t}var ul=Kr(function(t,e,n,r){gs(t,e,n,r)}),Kf=Re(function(t){return t.push(void 0,ll),kt(ul,void 0,t)}),Xf="Expected a function";function cl(t,e,n){if(typeof t!="function")throw new TypeError(Xf);return setTimeout(function(){t.apply(void 0,n)},e)}var Yf=Re(function(t,e){return cl(t,1,e)}),Vf=Re(function(t,e,n){return cl(t,Zt(e)||0,n)}),Zf=Re(function(t,e){var n=Bt(e);return at(n)&&(n=void 0),at(t)?Jr(t,Et(e,1,at,!0),Ae(n)):[]}),Jf=Re(function(t,e){var n=Bt(e);return at(n)&&(n=void 0),at(t)?Jr(t,Et(e,1,at,!0),void 0,n):[]}),Qf=Qr(function(t,e){return t/e},1);function ep(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ce(e),Wt(t,e<0?0:e,r)):[]}function tp(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ce(e),e=r-e,Wt(t,0,e<0?0:e)):[]}function ri(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Wt(t,r?0:o,r?o+1:i):Wt(t,r?o+1:0,r?i:o)}function np(t,e){return t&&t.length?ri(t,Ae(e),!0,!0):[]}function rp(t,e){return t&&t.length?ri(t,Ae(e),!0):[]}function ip(t,e){for(var n=t==null?0:t.length;n--&&e(t[n],n,t)!==!1;);return t}var dl=gc(!0);function po(t,e){return t&&dl(t,e,Kt)}var hl=mc(po,!0);function op(t,e){var n=We(t)?ip:hl;return n(t,Qt(e))}function ap(t,e,n){t=Fe(t),e=It(e);var r=t.length;n=n===void 0?r:Cn(Ce(n),0,r);var i=n;return n-=e.length,n>=0&&t.slice(n,i)==e}var sp=Mu(en),lp={"&":"&","<":"<",">":">",'"':""","'":"'"},up=uo(lp),fl=/[&<>"']/g,cp=RegExp(fl.source);function pl(t){return t=Fe(t),t&&cp.test(t)?t.replace(fl,up):t}var gl=/[\\^$.*+?()[\]{}|]/g,dp=RegExp(gl.source);function hp(t){return t=Fe(t),t&&dp.test(t)?t.replace(gl,"\\$&"):t}function ml(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function fp(t,e){var n=!0;return Yr(t,function(r,i,o){return n=!!e(r,i,o),n}),n}function pp(t,e,n){var r=We(t)?ml:fp;return n&&St(t,e,n)&&(e=void 0),r(t,Ae(e))}var gp=4294967295;function vl(t){return t?Cn(Ce(t),0,gp):0}function mp(t,e,n,r){var i=t.length;for(n=Ce(n),n<0&&(n=-n>i?0:i+n),r=r===void 0||r>i?i:Ce(r),r<0&&(r+=i),r=n>r?0:vl(r);n<r;)t[n++]=e;return t}function vp(t,e,n,r){var i=t==null?0:t.length;return i?(n&&typeof n!="number"&&St(t,e,n)&&(n=0,r=i),mp(t,e,n,r)):[]}function yl(t,e){var n=[];return Yr(t,function(r,i,o){e(r,i,o)&&n.push(r)}),n}function Qn(t,e){var n=We(t)?xn:yl;return n(t,Ae(e))}function bl(t,e,n){var r;return n(t,function(i,o,s){if(e(i,o,s))return r=o,!1}),r}function yp(t,e){return bl(t,Ae(e),sn)}var bp=Math.max,wp=Math.min;function wl(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r-1;return n!==void 0&&(i=Ce(n),i=n<0?bp(r+i,0):wp(i,r-1)),ms(t,Ae(e),i,!0)}var xp=vc(wl);function Ep(t,e){return bl(t,Ae(e),po)}function Cp(t){return t&&t.length?t[0]:void 0}function _p(t,e){return Et(or(t,e),1)}var Ap=1/0;function Sp(t,e){return Et(or(t,e),Ap)}function Np(t,e,n){return n=n===void 0?1:Ce(n),Et(or(t,e),n)}var Tp=1/0;function Rp(t){var e=t==null?0:t.length;return e?Et(t,Tp):[]}function Op(t,e){var n=t==null?0:t.length;return n?(e=e===void 0?1:Ce(e),Et(t,e)):[]}var kp=512;function Mp(t){return tn(t,kp)}var Pp=co("floor"),Lp="Expected a function",Dp=8,Ip=32,Bp=128,Fp=256;function xl(t){return bn(function(e){var n=e.length,r=n,i=Mt.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(Lp);if(i&&!s&&xr(o)=="wrapper")var s=new Mt([],!0)}for(r=s?r:n;++r<n;){o=e[r];var l=xr(o),a=l=="wrapper"?oo(o):void 0;a&&Pi(a[0])&&a[1]==(Bp|Dp|Ip|Fp)&&!a[4].length&&a[9]==1?s=s[xr(a[0])].apply(s,a[3]):s=o.length==1&&Pi(o)?s[l]():s.thru(o)}return function(){var u=arguments,c=u[0];if(s&&u.length==1&&We(c))return s.plant(c).value();for(var d=0,h=n?e[d].apply(this,u):c;++d<n;)h=e[d].call(this,h);return h}})}var jp=xl(),Hp=xl(!0);function Wp(t,e){return t==null?t:yc(t,Qt(e),en)}function $p(t,e){return t==null?t:dl(t,Qt(e),en)}function zp(t,e){return t&&sn(t,Qt(e))}function Gp(t,e){return t&&po(t,Qt(e))}function ii(t,e){return xn(e,function(n){return jn(t[n])})}function Up(t){return t==null?[]:ii(t,Kt(t))}function qp(t){return t==null?[]:ii(t,en(t))}var Kp=Object.prototype,Xp=Kp.hasOwnProperty,Yp=to(function(t,e,n){Xp.call(t,n)?t[n].push(e):ur(t,n,[e])});function go(t,e){return t>e}function oi(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=Zt(e),n=Zt(n)),t(e,n)}}var Vp=oi(go),Zp=oi(function(t,e){return t>=e}),Jp=Math.max,Qp=Math.min;function eg(t,e,n){return t>=Qp(e,n)&&t<Jp(e,n)}function tg(t,e,n){return e=Pn(e),n===void 0?(n=e,e=0):n=Pn(n),t=Zt(t),eg(t,e,n)}var ng="[object String]";function ai(t){return typeof t=="string"||!We(t)&&Ut(t)&&Bn(t)==ng}function mo(t,e){return ot(e,function(n){return t[n]})}function $n(t){return t==null?[]:mo(t,Kt(t))}var rg=Math.max;function ig(t,e,n,r){t=dr(t)?t:$n(t),n=n&&!r?Ce(n):0;var i=t.length;return n<0&&(n=rg(i+n,0)),ai(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Vr(t,e,n)>-1}function og(t){var e=t==null?0:t.length;return e?Wt(t,0,-1):[]}var ag=Re(function(t){var e=Bt(t),n=ot(t,vs);return e===Bt(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?ys(n,Ae(e)):[]}),sg=Re(function(t){var e=Bt(t),n=ot(t,vs);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?ys(n,void 0,e):[]});function lg(t,e,n,r){return sn(t,function(i,o,s){e(r,n(i),o,s)}),r}function El(t,e){return function(n,r){return lg(n,t,e(r),{})}}var ug=Object.prototype,cg=ug.toString,dg=El(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=cg.call(e)),t[e]=n},bs(Gt)),Cl=Object.prototype,hg=Cl.hasOwnProperty,fg=Cl.toString,pg=El(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=fg.call(e)),hg.call(t,e)?t[e].push(n):t[e]=[n]},Ae);function hr(t,e,n){e=ws(e,t),t=bc(t,e);var r=t==null?t:t[Xr(Bt(e))];return r==null?void 0:kt(r,t,n)}var gg=Re(hr),mg=Re(function(t,e,n){var r=-1,i=typeof e=="function",o=dr(t)?Array(t.length):[];return Yr(t,function(s){o[++r]=i?kt(e,s,n):hr(s,e,n)}),o}),vg="[object ArrayBuffer]";function yg(t){return Ut(t)&&Bn(t)==vg}var na=Dn&&Dn.isArrayBuffer,bg=na?on(na):yg,wg="[object Date]";function xg(t){return Ut(t)&&Bn(t)==wg}var ra=Dn&&Dn.isDate,Eg=ra?on(ra):xg;function Cg(t){return Ut(t)&&t.nodeType===1&&!Qi(t)}function _g(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?wc(t,e,void 0,n):!!r}var Ag=yn.isFinite;function Sg(t){return typeof t=="number"&&Ag(t)}function _l(t){return typeof t=="number"&&t==Ce(t)}function Ng(t,e){return t===e||xs(t,e,Es(e))}function Tg(t,e,n){return n=typeof n=="function"?n:void 0,xs(t,e,Es(e),n)}function Rg(t){return Cs(t)&&t!=+t}var Og=xc?jn:_s,kg="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function Mg(t){if(Og(t))throw new Error(kg);return Ec(t)}function Pg(t){return t===null}var Lg="[object RegExp]";function Dg(t){return Ut(t)&&Bn(t)==Lg}var ia=Dn&&Dn.isRegExp,vo=ia?on(ia):Dg,oa=9007199254740991;function Ig(t){return _l(t)&&t>=-oa&&t<=oa}var Bg="[object WeakMap]";function Fg(t){return Ut(t)&&no(t)==Bg}var jg="[object WeakSet]";function Hg(t){return Ut(t)&&Bn(t)==jg}var Wg=1;function $g(t){return Ae(typeof t=="function"?t:wn(t,Wg))}var zg=Array.prototype,Gg=zg.join;function Ug(t,e){return t==null?"":Gg.call(t,e)}var qg=Wn(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Kg=to(function(t,e,n){ur(t,n,e)});function Xg(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}var Yg=Math.max,Vg=Math.min;function Zg(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r;return n!==void 0&&(i=Ce(n),i=i<0?Yg(r+i,0):Vg(i,r-1)),e===e?Xg(t,e,i):ms(t,Cc,i,!0)}var Jg=Wn(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),Qg=_c("toLowerCase");function yo(t,e){return t<e}var em=oi(yo),tm=oi(function(t,e){return t<=e});function nm(t,e){var n={};return e=Ae(e),sn(t,function(r,i,o){ur(n,i,e(r,i,o))}),n}var rm=1;function im(t){return Ac(wn(t,rm))}var om=1;function am(t,e){return Sc(t,wn(e,om))}function si(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],s=e(o);if(s!=null&&(l===void 0?s===s&&!Jt(s):n(s,l)))var l=s,a=o}return a}function sm(t){return t&&t.length?si(t,Gt,go):void 0}function lm(t,e){return t&&t.length?si(t,Ae(e),go):void 0}function bo(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);o!==void 0&&(n=n===void 0?o:n+o)}return n}var um=NaN;function Al(t,e){var n=t==null?0:t.length;return n?bo(t,e)/n:um}function cm(t){return Al(t,Gt)}function dm(t,e){return Al(t,Ae(e))}var hm=Re(function(t,e){return function(n){return hr(n,t,e)}}),fm=Re(function(t,e){return function(n){return hr(t,n,e)}});function pm(t){return t&&t.length?si(t,Gt,yo):void 0}function gm(t,e){return t&&t.length?si(t,Ae(e),yo):void 0}function mm(t,e,n){var r=Kt(e),i=ii(e,r),o=!(rn(n)&&"chain"in n)||!!n.chain,s=jn(t);return qt(i,function(l){var a=e[l];t[l]=a,s&&(t.prototype[l]=function(){var u=this.__chain__;if(o||u){var c=t(this.__wrapped__),d=c.__actions__=Ot(this.__actions__);return d.push({func:a,args:arguments,thisArg:t}),c.__chain__=u,c}return a.apply(t,cr([this.value()],arguments))})}),t}var vm=Qr(function(t,e){return t*e},1),ym="Expected a function";function li(t){if(typeof t!="function")throw new TypeError(ym);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function bm(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}var wm="[object Map]",xm="[object Set]",wi=Sr?Sr.iterator:void 0;function Sl(t){if(!t)return[];if(dr(t))return ai(t)?$t(t):Ot(t);if(wi&&t[wi])return bm(t[wi]());var e=no(t),n=e==wm?Nc:e==xm?Tc:$n;return n(t)}function Em(){this.__values__===void 0&&(this.__values__=Sl(this.value()));var t=this.__index__>=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function Nl(t,e){var n=t.length;if(n)return e+=e<0?n:0,lr(e,n)?t[e]:void 0}function Cm(t,e){return t&&t.length?Nl(t,Ce(e)):void 0}function _m(t){return t=Ce(t),Re(function(e){return Nl(e,t)})}function Tl(t,e){if(t==null)return{};var n=ot(Rc(t),function(r){return[r]});return e=Ae(e),Oc(t,n,function(r,i){return e(r,i[0])})}function Am(t,e){return Tl(t,li(Ae(e)))}function Sm(t){return $s(2,t)}function Nm(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}function Rl(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,o=Jt(t),s=e!==void 0,l=e===null,a=e===e,u=Jt(e);if(!l&&!u&&!o&&t>e||o&&s&&a&&!l&&!u||r&&s&&a||!n&&a||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||l&&n&&i||!s&&i||!a)return-1}return 0}function Tm(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,s=i.length,l=n.length;++r<s;){var a=Rl(i[r],o[r]);if(a){if(r>=l)return a;var u=n[r];return a*(u=="desc"?-1:1)}}return t.index-e.index}function Ol(t,e,n){e.length?e=ot(e,function(o){return We(o)?function(s){return ro(s,o.length===1?o[0]:o)}:o}):e=[Gt];var r=-1;e=ot(e,on(Ae));var i=Pu(t,function(o,s,l){var a=ot(e,function(u){return u(o)});return{criteria:a,index:++r,value:o}});return Nm(i,function(o,s){return Tm(o,s,n)})}function Rm(t,e,n,r){return t==null?[]:(We(e)||(e=e==null?[]:[e]),n=r?void 0:n,We(n)||(n=n==null?[]:[n]),Ol(t,e,n))}function wo(t){return bn(function(e){return e=ot(e,on(Ae)),Re(function(n){var r=this;return t(e,function(i){return kt(i,r,n)})})})}var Om=wo(ot),km=Re,Mm=Math.min,Pm=km(function(t,e){e=e.length==1&&We(e[0])?ot(e[0],on(Ae)):ot(Et(e,1),on(Ae));var n=e.length;return Re(function(r){for(var i=-1,o=Mm(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return kt(t,this,r)})}),Lm=wo(ml),Dm=wo(As),Im=9007199254740991,Bm=Math.floor;function Di(t,e){var n="";if(!t||e<1||e>Im)return n;do e%2&&(n+=t),e=Bm(e/2),e&&(t+=t);while(e);return n}var Fm=Ss("length"),kl="\\ud800-\\udfff",jm="\\u0300-\\u036f",Hm="\\ufe20-\\ufe2f",Wm="\\u20d0-\\u20ff",$m=jm+Hm+Wm,zm="\\ufe0e\\ufe0f",Gm="["+kl+"]",Ii="["+$m+"]",Bi="\\ud83c[\\udffb-\\udfff]",Um="(?:"+Ii+"|"+Bi+")",Ml="[^"+kl+"]",Pl="(?:\\ud83c[\\udde6-\\uddff]){2}",Ll="[\\ud800-\\udbff][\\udc00-\\udfff]",qm="\\u200d",Dl=Um+"?",Il="["+zm+"]?",Km="(?:"+qm+"(?:"+[Ml,Pl,Ll].join("|")+")"+Il+Dl+")*",Xm=Il+Dl+Km,Ym="(?:"+[Ml+Ii+"?",Ii,Pl,Ll,Gm].join("|")+")",aa=RegExp(Bi+"(?="+Bi+")|"+Ym+Xm,"g");function Vm(t){for(var e=aa.lastIndex=0;aa.test(t);)++e;return e}function zn(t){return Zr(t)?Vm(t):Fm(t)}var Zm=Math.ceil;function Tr(t,e){e=e===void 0?" ":It(e);var n=e.length;if(n<2)return n?Di(e,t):e;var r=Di(e,Zm(t/zn(e)));return Zr(e)?En($t(r),0,t).join(""):r.slice(0,t)}var Jm=Math.ceil,Qm=Math.floor;function ev(t,e,n){t=Fe(t),e=Ce(e);var r=e?zn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Tr(Qm(i),n)+t+Tr(Jm(i),n)}function tv(t,e,n){t=Fe(t),e=Ce(e);var r=e?zn(t):0;return e&&r<e?t+Tr(e-r,n):t}function nv(t,e,n){t=Fe(t),e=Ce(e);var r=e?zn(t):0;return e&&r<e?Tr(e-r,n)+t:t}var rv=/^\s+/,iv=yn.parseInt;function ov(t,e,n){return n||e==null?e=0:e&&(e=+e),iv(Fe(t).replace(rv,""),e||0)}var av=32,ui=Re(function(t,e){var n=an(e,Hn(ui));return tn(t,av,void 0,e,n)});ui.placeholder={};var sv=64,xo=Re(function(t,e){var n=an(e,Hn(xo));return tn(t,sv,void 0,e,n)});xo.placeholder={};function lv(t){for(var e,n=this;n instanceof ei;){var r=Is(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e}function uv(t){return function(e){return t==null?void 0:ro(t,e)}}function cv(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}var dv=Array.prototype,sa=dv.splice;function Eo(t,e,n,r){var i=r?cv:Vr,o=-1,s=e.length,l=t;for(t===e&&(e=Ot(e)),n&&(l=ot(t,on(n)));++o<s;)for(var a=0,u=e[o],c=n?n(u):u;(a=i(l,c,a,r))>-1;)l!==t&&sa.call(l,a,1),sa.call(t,a,1);return t}function Bl(t,e){return t&&t.length&&e&&e.length?Eo(t,e):t}var hv=Re(Bl);function fv(t,e,n){return t&&t.length&&e&&e.length?Eo(t,e,Ae(n)):t}function pv(t,e,n){return t&&t.length&&e&&e.length?Eo(t,e,void 0,n):t}var gv=Array.prototype,mv=gv.splice;function Fl(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;lr(i)?mv.call(t,i,1):Ns(t,i)}}return t}var vv=bn(function(t,e){var n=t==null?0:t.length,r=ao(t,e);return Fl(t,ot(e,function(i){return lr(i,n)?+i:i}).sort(Rl)),r}),yv=Math.ceil,bv=Math.max;function wv(t,e,n,r){for(var i=-1,o=bv(yv((e-t)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=t,t+=n;return s}function jl(t){return function(e,n,r){return r&&typeof r!="number"&&St(e,n,r)&&(n=r=void 0),e=Pn(e),n===void 0?(n=e,e=0):n=Pn(n),r=r===void 0?e<n?1:-1:Pn(r),wv(e,n,r,t)}}var xv=jl(),Ev=jl(!0),Cv=256,_v=bn(function(t,e){return tn(t,Cv,void 0,void 0,void 0,e)});function Av(t,e,n,r){var i=t==null?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Sv(t,e,n){var r=We(t)?Av:Lu,i=arguments.length<3;return r(t,Ae(e),n,i,hl)}function Nv(t,e){var n=We(t)?xn:yl;return n(t,li(Ae(e)))}function Tv(t,e){var n=[];if(!(t&&t.length))return n;var r=-1,i=[],o=t.length;for(e=Ae(e);++r<o;){var s=t[r];e(s,r,t)&&(n.push(s),i.push(r))}return Fl(t,i),n}function Rv(t,e,n){return(n?St(t,e,n):e===void 0)?e=1:e=Ce(e),Di(Fe(t),e)}function Ov(){var t=arguments,e=Fe(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var kv="Expected a function";function Mv(t,e){if(typeof t!="function")throw new TypeError(kv);return e=e===void 0?e:Ce(e),Re(t,e)}function Pv(t,e,n){e=ws(e,t);var r=-1,i=e.length;for(i||(i=1,t=void 0);++r<i;){var o=t==null?void 0:t[Xr(e[r])];o===void 0&&(r=i,o=n),t=jn(o)?o.call(t):o}return t}var Lv=Array.prototype,Dv=Lv.reverse;function Fi(t){return t==null?t:Dv.call(t)}var Iv=co("round");function Hl(t){var e=t.length;return e?t[Ts(0,e-1)]:void 0}function Bv(t){return Hl($n(t))}function Fv(t){var e=We(t)?Hl:Bv;return e(t)}function ci(t,e){var n=-1,r=t.length,i=r-1;for(e=e===void 0?r:e;++n<e;){var o=Ts(n,i),s=t[o];t[o]=t[n],t[n]=s}return t.length=e,t}function jv(t,e){return ci(Ot(t),Cn(e,0,t.length))}function Hv(t,e){var n=$n(t);return ci(n,Cn(e,0,n.length))}function Wv(t,e,n){(n?St(t,e,n):e===void 0)?e=1:e=Ce(e);var r=We(t)?jv:Hv;return r(t,e)}function $v(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:io(t,e,n,r)}function zv(t){return ci(Ot(t))}function Gv(t){return ci($n(t))}function Uv(t){var e=We(t)?zv:Gv;return e(t)}var qv="[object Map]",Kv="[object Set]";function Xv(t){if(t==null)return 0;if(dr(t))return ai(t)?zn(t):t.length;var e=no(t);return e==qv||e==Kv?t.size:kc(t).length}function Yv(t,e,n){var r=t==null?0:t.length;return r?(n&&typeof n!="number"&&St(t,e,n)?(e=0,n=r):(e=e==null?0:Ce(e),n=n===void 0?r:Ce(n)),Wt(t,e,n)):[]}var Vv=Wn(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});function Zv(t,e){var n;return Yr(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}function Jv(t,e,n){var r=We(t)?As:Zv;return n&&St(t,e,n)&&(e=void 0),r(t,Ae(e))}var Wl=Re(function(t,e){if(t==null)return[];var n=e.length;return n>1&&St(t,e[0],e[1])?e=[]:n>2&&St(e[0],e[1],e[2])&&(e=[e[0]]),Ol(t,Et(e,1),[])}),Qv=4294967295,ey=Qv-1,ty=Math.floor,ny=Math.min;function Co(t,e,n,r){var i=0,o=t==null?0:t.length;if(o===0)return 0;e=n(e);for(var s=e!==e,l=e===null,a=Jt(e),u=e===void 0;i<o;){var c=ty((i+o)/2),d=n(t[c]),h=d!==void 0,f=d===null,v=d===d,b=Jt(d);if(s)var w=r||v;else u?w=v&&(r||h):l?w=v&&h&&(r||!f):a?w=v&&h&&!f&&(r||!b):f||b?w=!1:w=r?d<=e:d<e;w?i=c+1:o=c}return ny(o,ey)}var ry=4294967295,iy=ry>>>1;function di(t,e,n){var r=0,i=t==null?r:t.length;if(typeof e=="number"&&e===e&&i<=iy){for(;r<i;){var o=r+i>>>1,s=t[o];s!==null&&!Jt(s)&&(n?s<=e:s<e)?r=o+1:i=o}return i}return Co(t,e,Gt,n)}function oy(t,e){return di(t,e)}function ay(t,e,n){return Co(t,e,Ae(n))}function sy(t,e){var n=t==null?0:t.length;if(n){var r=di(t,e);if(r<n&&Fn(t[r],e))return r}return-1}function ly(t,e){return di(t,e,!0)}function uy(t,e,n){return Co(t,e,Ae(n),!0)}function cy(t,e){var n=t==null?0:t.length;if(n){var r=di(t,e,!0)-1;if(Fn(t[r],e))return r}return-1}function $l(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var s=t[n],l=e?e(s):s;if(!n||!Fn(l,a)){var a=l;o[i++]=s===0?0:s}}return o}function dy(t){return t&&t.length?$l(t):[]}function hy(t,e){return t&&t.length?$l(t,Ae(e)):[]}var fy=4294967295;function py(t,e,n){return n&&typeof n!="number"&&St(t,e,n)&&(e=n=void 0),n=n===void 0?fy:n>>>0,n?(t=Fe(t),t&&(typeof e=="string"||e!=null&&!vo(e))&&(e=It(e),!e&&Zr(t))?En($t(t),0,n):t.split(e,n)):[]}var gy="Expected a function",my=Math.max;function vy(t,e){if(typeof t!="function")throw new TypeError(gy);return e=e==null?0:my(Ce(e),0),Re(function(n){var r=n[e],i=En(n,0,e);return r&&cr(i,r),kt(t,this,i)})}var yy=Wn(function(t,e,n){return t+(n?" ":"")+eo(e)});function by(t,e,n){return t=Fe(t),n=n==null?0:Cn(Ce(n),0,t.length),e=It(e),t.slice(n,n+e.length)==e}function wy(){return{}}function xy(){return""}function Ey(){return!0}var Cy=Qr(function(t,e){return t-e},0);function _y(t){return t&&t.length?bo(t,Gt):0}function Ay(t,e){return t&&t.length?bo(t,Ae(e)):0}function Sy(t){var e=t==null?0:t.length;return e?Wt(t,1,e):[]}function Ny(t,e,n){return t&&t.length?(e=n||e===void 0?1:Ce(e),Wt(t,0,e<0?0:e)):[]}function Ty(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ce(e),e=r-e,Wt(t,e<0?0:e,r)):[]}function Ry(t,e){return t&&t.length?ri(t,Ae(e),!1,!0):[]}function Oy(t,e){return t&&t.length?ri(t,Ae(e)):[]}function ky(t,e){return e(t),t}var zl=Object.prototype,My=zl.hasOwnProperty;function la(t,e,n,r){return t===void 0||Fn(t,zl[n])&&!My.call(r,n)?e:t}var Py={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Ly(t){return"\\"+Py[t]}var Gl=/<%=([\s\S]+?)%>/g,Dy=/<%-([\s\S]+?)%>/g,Iy=/<%([\s\S]+?)%>/g,ji={escape:Dy,evaluate:Iy,interpolate:Gl,variable:"",imports:{_:{escape:pl}}},By="Invalid `variable` option passed into `_.template`",Fy=/\b__p \+= '';/g,jy=/\b(__p \+=) '' \+/g,Hy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wy=/[()=,{}\[\]\/\s]/,$y=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mr=/($^)/,zy=/['\n\r\u2028\u2029\\]/g,Gy=Object.prototype,ua=Gy.hasOwnProperty;function Uy(t,e,n){var r=ji.imports._.templateSettings||ji;n&&St(t,e,n)&&(e=void 0),t=Fe(t),e=Li({},e,r,la);var i=Li({},e.imports,r.imports,la),o=Kt(i),s=mo(i,o),l,a,u=0,c=e.interpolate||mr,d="__p += '",h=RegExp((e.escape||mr).source+"|"+c.source+"|"+(c===Gl?$y:mr).source+"|"+(e.evaluate||mr).source+"|$","g"),f=ua.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
|
||
`:"";t.replace(h,function(w,T,P,H,G,se){return P||(P=H),d+=t.slice(u,se).replace(zy,Ly),T&&(l=!0,d+=`' +
|
||
__e(`+T+`) +
|
||
'`),G&&(a=!0,d+=`';
|
||
`+G+`;
|
||
__p += '`),P&&(d+=`' +
|
||
((__t = (`+P+`)) == null ? '' : __t) +
|
||
'`),u=se+w.length,w}),d+=`';
|
||
`;var v=ua.call(e,"variable")&&e.variable;if(!v)d=`with (obj) {
|
||
`+d+`
|
||
}
|
||
`;else if(Wy.test(v))throw new Error(By);d=(a?d.replace(Fy,""):d).replace(jy,"$1").replace(Hy,"$1;"),d="function("+(v||"obj")+`) {
|
||
`+(v?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(a?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+d+`return __p
|
||
}`;var b=Ws(function(){return Function(o,f+"return "+d).apply(void 0,s)});if(b.source=d,so(b))throw b;return b}function hi(t,e){return e(t)}var qy=9007199254740991,xi=4294967295,Ky=Math.min;function Xy(t,e){if(t=Ce(t),t<1||t>qy)return[];var n=xi,r=Ky(t,xi);e=Qt(e),t-=xi;for(var i=Rs(r,e);++n<t;)e(n);return i}function Yy(){return this}function Ul(t,e){var n=t;return n instanceof Te&&(n=n.value()),rs(e,function(r,i){return i.func.apply(i.thisArg,cr([r],i.args))},n)}function Vy(){return Ul(this.__wrapped__,this.__actions__)}function Zy(t){return Fe(t).toLowerCase()}function Jy(t){return We(t)?ot(t,Xr):Jt(t)?[t]:Ot(Mc(Fe(t)))}var ca=9007199254740991;function Qy(t){return t?Cn(Ce(t),-ca,ca):t===0?t:0}function e0(t){return Fe(t).toUpperCase()}function t0(t,e,n){var r=We(t),i=r||Os(t)||ks(t);if(e=Ae(e),n==null){var o=t&&t.constructor;i?n=r?new o:[]:rn(t)?n=jn(o)?sr(Pc(t)):{}:n={}}return(i?qt:sn)(t,function(s,l,a){return e(n,s,l,a)}),n}function ql(t,e){for(var n=t.length;n--&&Vr(e,t[n],0)>-1;);return n}function Kl(t,e){for(var n=-1,r=t.length;++n<r&&Vr(e,t[n],0)>-1;);return n}function n0(t,e,n){if(t=Fe(t),t&&(n||e===void 0))return Lc(t);if(!t||!(e=It(e)))return t;var r=$t(t),i=$t(e),o=Kl(r,i),s=ql(r,i)+1;return En(r,o,s).join("")}function r0(t,e,n){if(t=Fe(t),t&&(n||e===void 0))return t.slice(0,Dc(t)+1);if(!t||!(e=It(e)))return t;var r=$t(t),i=ql(r,$t(e))+1;return En(r,0,i).join("")}var i0=/^\s+/;function o0(t,e,n){if(t=Fe(t),t&&(n||e===void 0))return t.replace(i0,"");if(!t||!(e=It(e)))return t;var r=$t(t),i=Kl(r,$t(e));return En(r,i).join("")}var a0=30,s0="...",l0=/\w*$/;function u0(t,e){var n=a0,r=s0;if(rn(e)){var i="separator"in e?e.separator:i;n="length"in e?Ce(e.length):n,r="omission"in e?It(e.omission):r}t=Fe(t);var o=t.length;if(Zr(t)){var s=$t(t);o=s.length}if(n>=o)return t;var l=n-zn(r);if(l<1)return r;var a=s?En(s,0,l).join(""):t.slice(0,l);if(i===void 0)return a+r;if(s&&(l+=a.length-l),vo(i)){if(t.slice(l).search(i)){var u,c=a;for(i.global||(i=RegExp(i.source,Fe(l0.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;a=a.slice(0,d===void 0?l:d)}}else if(t.indexOf(It(i),l)!=l){var h=a.lastIndexOf(i);h>-1&&(a=a.slice(0,h))}return a+r}function c0(t){return Hs(t,1)}var d0={"&":"&","<":"<",">":">",""":'"',"'":"'"},h0=uo(d0),Xl=/&(?:amp|lt|gt|quot|#39);/g,f0=RegExp(Xl.source);function p0(t){return t=Fe(t),t&&f0.test(t)?t.replace(Xl,h0):t}var g0=Re(function(t){return In(Et(t,1,at,!0))}),m0=Re(function(t){var e=Bt(t);return at(e)&&(e=void 0),In(Et(t,1,at,!0),Ae(e))}),v0=Re(function(t){var e=Bt(t);return e=typeof e=="function"?e:void 0,In(Et(t,1,at,!0),void 0,e)});function y0(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?In(t,void 0,e):[]}var b0=0;function w0(t){var e=++b0;return Fe(t)+e}function x0(t,e){return t==null?!0:Ns(t,e)}var E0=Math.max;function _o(t){if(!(t&&t.length))return[];var e=0;return t=xn(t,function(n){if(at(n))return e=E0(n.length,e),!0}),Rs(e,function(n){return ot(t,Ss(n))})}function Yl(t,e){if(!(t&&t.length))return[];var n=_o(t);return e==null?n:ot(n,function(r){return kt(e,void 0,r)})}function Vl(t,e,n,r){return io(t,e,n(ro(t,e)),r)}function C0(t,e,n){return t==null?t:Vl(t,e,Qt(n))}function _0(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:Vl(t,e,Qt(n),r)}var A0=Wn(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function S0(t){return t==null?[]:mo(t,en(t))}var N0=Re(function(t,e){return at(t)?Jr(t,e):[]});function T0(t,e){return ui(Qt(e),t)}var R0=bn(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(o){return ao(o,t)};return e>1||this.__actions__.length||!(r instanceof Te)||!lr(n)?this.thru(i):(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:hi,args:[i],thisArg:void 0}),new Mt(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(void 0),o}))});function O0(){return ol(this)}function k0(){var t=this.__wrapped__;if(t instanceof Te){var e=t;return this.__actions__.length&&(e=new Te(this)),e=e.reverse(),e.__actions__.push({func:hi,args:[Fi],thisArg:void 0}),new Mt(e,this.__chain__)}return this.thru(Fi)}function Ao(t,e,n){var r=t.length;if(r<2)return r?In(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var s=t[i],l=-1;++l<r;)l!=i&&(o[i]=Jr(o[i]||s,t[l],e,n));return In(Et(o,1),e,n)}var M0=Re(function(t){return Ao(xn(t,at))}),P0=Re(function(t){var e=Bt(t);return at(e)&&(e=void 0),Ao(xn(t,at),Ae(e))}),L0=Re(function(t){var e=Bt(t);return e=typeof e=="function"?e:void 0,Ao(xn(t,at),void 0,e)}),D0=Re(_o);function Zl(t,e,n){for(var r=-1,i=t.length,o=e.length,s={};++r<i;){var l=r<o?e[r]:void 0;n(s,t[r],l)}return s}function I0(t,e){return Zl(t||[],e||[],Ic)}function B0(t,e){return Zl(t||[],e||[],io)}var F0=Re(function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,Yl(t,n)});const ee={chunk:wf,compact:Of,concat:kf,difference:ad,differenceBy:Zf,differenceWith:Jf,drop:ep,dropRight:tp,dropRightWhile:np,dropWhile:rp,fill:vp,findIndex:Ms,findLastIndex:wl,flatten:Bc,flattenDeep:Rp,flattenDepth:Op,fromPairs:sd,head:Cp,indexOf:Du,initial:og,intersection:Fc,intersectionBy:ag,intersectionWith:sg,join:Ug,lastIndexOf:Zg,nth:Cm,pull:hv,pullAll:Bl,pullAllBy:fv,pullAllWith:pv,pullAt:vv,remove:Tv,reverse:Fi,slice:Yv,sortedIndex:oy,sortedIndexBy:ay,sortedIndexOf:sy,sortedLastIndex:ly,sortedLastIndexBy:uy,sortedLastIndexOf:cy,sortedUniq:dy,sortedUniqBy:hy,tail:Sy,take:Ny,takeRight:Ty,takeRightWhile:Ry,takeWhile:Oy,union:g0,unionBy:m0,unionWith:v0,uniq:jc,uniqBy:ld,uniqWith:y0,unzip:_o,unzipWith:Yl,without:N0,xor:M0,xorBy:P0,xorWith:L0,zip:D0,zipObject:I0,zipObjectDeep:B0,zipWith:F0},je={countBy:Hf,every:pp,filter:Qn,find:Wc,findLast:xp,flatMap:_p,flatMapDeep:Sp,flatMapDepth:Np,forEach:Ge,forEachRight:op,groupBy:Yp,includes:ig,invokeMap:mg,keyBy:Kg,map:or,orderBy:Rm,partition:Hc,reduce:Iu,reduceRight:Sv,reject:Nv,sample:Fv,sampleSize:Wv,shuffle:Uv,size:Xv,some:Jv,sortBy:Wl},j0={now:$c},Ue={after:Ed,ary:Hs,before:$s,bind:ni,bindKey:lo,curry:ho,curryRight:fo,debounce:zc,defer:Yf,delay:Vf,flip:Mp,memoize:Gc,once:Sm,overArgs:Pm,partial:ui,partialRight:xo,rearg:_v,rest:Mv,spread:vy,throttle:od,unary:c0,wrap:T0},ue={castArray:pf,clone:Cf,cloneDeep:ki,cloneDeepWith:Sf,cloneWith:Tf,conformsTo:Bf,eq:Fn,gt:Vp,gte:Zp,isArguments:qc,isArrayBuffer:bg,isArrayLike:dr,isArrayLikeObject:at,isBoolean:Bu,isBuffer:Os,isDate:Eg,isElement:Cg,isEmpty:Kc,isEqual:Xc,isEqualWith:_g,isError:so,isFinite:Sg,isFunction:jn,isInteger:_l,isLength:Yc,isMap:Vc,isMatch:Ng,isMatchWith:Tg,isNaN:Rg,isNative:Mg,isNil:Fu,isNull:Pg,isNumber:Cs,isObjectLike:Ut,isPlainObject:Qi,isRegExp:vo,isSafeInteger:Ig,isSet:Zc,isString:ai,isSymbol:Jt,isTypedArray:ks,isUndefined:ju,isWeakMap:Fg,isWeakSet:Hg,lt:em,lte:tm,toArray:Sl,toFinite:Pn,toLength:vl,toNumber:Zt,toPlainObject:Uc,toSafeInteger:Qy,toString:Fe},gt={add:wd,ceil:vf,divide:Qf,floor:Pp,max:sm,maxBy:lm,mean:cm,meanBy:dm,min:pm,minBy:gm,multiply:vm,round:Iv,subtract:Cy,sum:_y,sumBy:Ay},So={clamp:xf,inRange:tg,random:Jc},ve={assign:Xi,assignIn:mh,assignInWith:Li,assignWith:vh,at:yh,create:Wf,defaults:qf,defaultsDeep:Kf,findKey:yp,findLastKey:Ep,forIn:Wp,forInRight:$p,forOwn:zp,forOwnRight:Gp,functions:Up,functionsIn:qp,get:Ji,has:Ar,hasIn:nd,invert:dg,invertBy:pg,invoke:gg,keysIn:en,mapKeys:Hu,mapValues:nm,merge:Mi,mergeWith:ul,omit:Qc,omitBy:Am,pick:ed,pickBy:Tl,result:Pv,set:td,setWith:$v,toPairs:Wu,toPairsIn:sp,transform:t0,unset:x0,update:C0,updateWith:_0,values:$n,valuesIn:S0},Xt={at:R0,chain:ol,commit:Rf,next:Em,plant:lv,reverse:k0,tap:ky,toIterator:Yy,value:Vy,wrapperChain:O0},Le={camelCase:ff,capitalize:zs,deburr:Gs,endsWith:ap,escape:pl,escapeRegExp:hp,kebabCase:qg,lowerCase:Jg,lowerFirst:Qg,pad:ev,padEnd:tv,padStart:nv,parseInt:ov,repeat:Rv,replace:Ov,snakeCase:Vv,split:py,startCase:yy,startsWith:by,template:Uy,templateSettings:ji,toLower:Zy,toUpper:e0,trim:n0,trimEnd:r0,trimStart:o0,truncate:u0,unescape:p0,upperCase:A0,upperFirst:eo,words:il},Ie={attempt:Ws,bindAll:_h,cond:Pf,conforms:If,constant:bs,defaultTo:Gf,flow:jp,flowRight:Hp,iteratee:$g,matches:im,matchesProperty:am,method:hm,methodOf:fm,noop:ps,nthArg:_m,over:Om,overEvery:Lm,overSome:Dm,property:rd,propertyOf:uv,range:xv,rangeRight:Ev,stubArray:id,stubFalse:_s,stubObject:wy,stubString:xy,stubTrue:Ey,times:Xy,toPath:Jy,uniqueId:w0};function H0(){var t=new Te(this.__wrapped__);return t.__actions__=Ot(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ot(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ot(this.__views__),t}function W0(){if(this.__filtered__){var t=new Te(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var $0=Math.max,z0=Math.min;function G0(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=z0(e,t+s);break;case"takeRight":t=$0(t,e-s);break}}return{start:t,end:e}}var U0=1,q0=2,K0=Math.min;function X0(){var t=this.__wrapped__.value(),e=this.__dir__,n=We(t),r=e<0,i=n?t.length:0,o=G0(0,i,this.__views__),s=o.start,l=o.end,a=l-s,u=r?l:s-1,c=this.__iteratees__,d=c.length,h=0,f=K0(a,this.__takeCount__);if(!n||!r&&i==a&&f==a)return Ul(t,this.__actions__);var v=[];e:for(;a--&&h<f;){u+=e;for(var b=-1,w=t[u];++b<d;){var T=c[b],P=T.iteratee,H=T.type,G=P(w);if(H==q0)w=G;else if(!G){if(H==U0)continue e;break e}}v[h++]=w}return v}/**
|
||
* @license
|
||
* Lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="es" -o ./`
|
||
* 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
|
||
*/var Y0="4.17.22",V0=2,Z0=1,J0=3,Jl=4294967295,Q0=Array.prototype,eb=Object.prototype,Ql=eb.hasOwnProperty,da=Sr?Sr.iterator:void 0,tb=Math.max,ha=Math.min,No=(function(t){return function(e,n,r){if(r==null){var i=rn(n),o=i&&Kt(n),s=o&&o.length&&ii(n,o);(s?s.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}})(mm);p.after=Ue.after;p.ary=Ue.ary;p.assign=ve.assign;p.assignIn=ve.assignIn;p.assignInWith=ve.assignInWith;p.assignWith=ve.assignWith;p.at=ve.at;p.before=Ue.before;p.bind=Ue.bind;p.bindAll=Ie.bindAll;p.bindKey=Ue.bindKey;p.castArray=ue.castArray;p.chain=Xt.chain;p.chunk=ee.chunk;p.compact=ee.compact;p.concat=ee.concat;p.cond=Ie.cond;p.conforms=Ie.conforms;p.constant=Ie.constant;p.countBy=je.countBy;p.create=ve.create;p.curry=Ue.curry;p.curryRight=Ue.curryRight;p.debounce=Ue.debounce;p.defaults=ve.defaults;p.defaultsDeep=ve.defaultsDeep;p.defer=Ue.defer;p.delay=Ue.delay;p.difference=ee.difference;p.differenceBy=ee.differenceBy;p.differenceWith=ee.differenceWith;p.drop=ee.drop;p.dropRight=ee.dropRight;p.dropRightWhile=ee.dropRightWhile;p.dropWhile=ee.dropWhile;p.fill=ee.fill;p.filter=je.filter;p.flatMap=je.flatMap;p.flatMapDeep=je.flatMapDeep;p.flatMapDepth=je.flatMapDepth;p.flatten=ee.flatten;p.flattenDeep=ee.flattenDeep;p.flattenDepth=ee.flattenDepth;p.flip=Ue.flip;p.flow=Ie.flow;p.flowRight=Ie.flowRight;p.fromPairs=ee.fromPairs;p.functions=ve.functions;p.functionsIn=ve.functionsIn;p.groupBy=je.groupBy;p.initial=ee.initial;p.intersection=ee.intersection;p.intersectionBy=ee.intersectionBy;p.intersectionWith=ee.intersectionWith;p.invert=ve.invert;p.invertBy=ve.invertBy;p.invokeMap=je.invokeMap;p.iteratee=Ie.iteratee;p.keyBy=je.keyBy;p.keys=Kt;p.keysIn=ve.keysIn;p.map=je.map;p.mapKeys=ve.mapKeys;p.mapValues=ve.mapValues;p.matches=Ie.matches;p.matchesProperty=Ie.matchesProperty;p.memoize=Ue.memoize;p.merge=ve.merge;p.mergeWith=ve.mergeWith;p.method=Ie.method;p.methodOf=Ie.methodOf;p.mixin=No;p.negate=li;p.nthArg=Ie.nthArg;p.omit=ve.omit;p.omitBy=ve.omitBy;p.once=Ue.once;p.orderBy=je.orderBy;p.over=Ie.over;p.overArgs=Ue.overArgs;p.overEvery=Ie.overEvery;p.overSome=Ie.overSome;p.partial=Ue.partial;p.partialRight=Ue.partialRight;p.partition=je.partition;p.pick=ve.pick;p.pickBy=ve.pickBy;p.property=Ie.property;p.propertyOf=Ie.propertyOf;p.pull=ee.pull;p.pullAll=ee.pullAll;p.pullAllBy=ee.pullAllBy;p.pullAllWith=ee.pullAllWith;p.pullAt=ee.pullAt;p.range=Ie.range;p.rangeRight=Ie.rangeRight;p.rearg=Ue.rearg;p.reject=je.reject;p.remove=ee.remove;p.rest=Ue.rest;p.reverse=ee.reverse;p.sampleSize=je.sampleSize;p.set=ve.set;p.setWith=ve.setWith;p.shuffle=je.shuffle;p.slice=ee.slice;p.sortBy=je.sortBy;p.sortedUniq=ee.sortedUniq;p.sortedUniqBy=ee.sortedUniqBy;p.split=Le.split;p.spread=Ue.spread;p.tail=ee.tail;p.take=ee.take;p.takeRight=ee.takeRight;p.takeRightWhile=ee.takeRightWhile;p.takeWhile=ee.takeWhile;p.tap=Xt.tap;p.throttle=Ue.throttle;p.thru=hi;p.toArray=ue.toArray;p.toPairs=ve.toPairs;p.toPairsIn=ve.toPairsIn;p.toPath=Ie.toPath;p.toPlainObject=ue.toPlainObject;p.transform=ve.transform;p.unary=Ue.unary;p.union=ee.union;p.unionBy=ee.unionBy;p.unionWith=ee.unionWith;p.uniq=ee.uniq;p.uniqBy=ee.uniqBy;p.uniqWith=ee.uniqWith;p.unset=ve.unset;p.unzip=ee.unzip;p.unzipWith=ee.unzipWith;p.update=ve.update;p.updateWith=ve.updateWith;p.values=ve.values;p.valuesIn=ve.valuesIn;p.without=ee.without;p.words=Le.words;p.wrap=Ue.wrap;p.xor=ee.xor;p.xorBy=ee.xorBy;p.xorWith=ee.xorWith;p.zip=ee.zip;p.zipObject=ee.zipObject;p.zipObjectDeep=ee.zipObjectDeep;p.zipWith=ee.zipWith;p.entries=ve.toPairs;p.entriesIn=ve.toPairsIn;p.extend=ve.assignIn;p.extendWith=ve.assignInWith;No(p,p);p.add=gt.add;p.attempt=Ie.attempt;p.camelCase=Le.camelCase;p.capitalize=Le.capitalize;p.ceil=gt.ceil;p.clamp=So.clamp;p.clone=ue.clone;p.cloneDeep=ue.cloneDeep;p.cloneDeepWith=ue.cloneDeepWith;p.cloneWith=ue.cloneWith;p.conformsTo=ue.conformsTo;p.deburr=Le.deburr;p.defaultTo=Ie.defaultTo;p.divide=gt.divide;p.endsWith=Le.endsWith;p.eq=ue.eq;p.escape=Le.escape;p.escapeRegExp=Le.escapeRegExp;p.every=je.every;p.find=je.find;p.findIndex=ee.findIndex;p.findKey=ve.findKey;p.findLast=je.findLast;p.findLastIndex=ee.findLastIndex;p.findLastKey=ve.findLastKey;p.floor=gt.floor;p.forEach=je.forEach;p.forEachRight=je.forEachRight;p.forIn=ve.forIn;p.forInRight=ve.forInRight;p.forOwn=ve.forOwn;p.forOwnRight=ve.forOwnRight;p.get=ve.get;p.gt=ue.gt;p.gte=ue.gte;p.has=ve.has;p.hasIn=ve.hasIn;p.head=ee.head;p.identity=Gt;p.includes=je.includes;p.indexOf=ee.indexOf;p.inRange=So.inRange;p.invoke=ve.invoke;p.isArguments=ue.isArguments;p.isArray=We;p.isArrayBuffer=ue.isArrayBuffer;p.isArrayLike=ue.isArrayLike;p.isArrayLikeObject=ue.isArrayLikeObject;p.isBoolean=ue.isBoolean;p.isBuffer=ue.isBuffer;p.isDate=ue.isDate;p.isElement=ue.isElement;p.isEmpty=ue.isEmpty;p.isEqual=ue.isEqual;p.isEqualWith=ue.isEqualWith;p.isError=ue.isError;p.isFinite=ue.isFinite;p.isFunction=ue.isFunction;p.isInteger=ue.isInteger;p.isLength=ue.isLength;p.isMap=ue.isMap;p.isMatch=ue.isMatch;p.isMatchWith=ue.isMatchWith;p.isNaN=ue.isNaN;p.isNative=ue.isNative;p.isNil=ue.isNil;p.isNull=ue.isNull;p.isNumber=ue.isNumber;p.isObject=rn;p.isObjectLike=ue.isObjectLike;p.isPlainObject=ue.isPlainObject;p.isRegExp=ue.isRegExp;p.isSafeInteger=ue.isSafeInteger;p.isSet=ue.isSet;p.isString=ue.isString;p.isSymbol=ue.isSymbol;p.isTypedArray=ue.isTypedArray;p.isUndefined=ue.isUndefined;p.isWeakMap=ue.isWeakMap;p.isWeakSet=ue.isWeakSet;p.join=ee.join;p.kebabCase=Le.kebabCase;p.last=Bt;p.lastIndexOf=ee.lastIndexOf;p.lowerCase=Le.lowerCase;p.lowerFirst=Le.lowerFirst;p.lt=ue.lt;p.lte=ue.lte;p.max=gt.max;p.maxBy=gt.maxBy;p.mean=gt.mean;p.meanBy=gt.meanBy;p.min=gt.min;p.minBy=gt.minBy;p.stubArray=Ie.stubArray;p.stubFalse=Ie.stubFalse;p.stubObject=Ie.stubObject;p.stubString=Ie.stubString;p.stubTrue=Ie.stubTrue;p.multiply=gt.multiply;p.nth=ee.nth;p.noop=Ie.noop;p.now=j0.now;p.pad=Le.pad;p.padEnd=Le.padEnd;p.padStart=Le.padStart;p.parseInt=Le.parseInt;p.random=So.random;p.reduce=je.reduce;p.reduceRight=je.reduceRight;p.repeat=Le.repeat;p.replace=Le.replace;p.result=ve.result;p.round=gt.round;p.sample=je.sample;p.size=je.size;p.snakeCase=Le.snakeCase;p.some=je.some;p.sortedIndex=ee.sortedIndex;p.sortedIndexBy=ee.sortedIndexBy;p.sortedIndexOf=ee.sortedIndexOf;p.sortedLastIndex=ee.sortedLastIndex;p.sortedLastIndexBy=ee.sortedLastIndexBy;p.sortedLastIndexOf=ee.sortedLastIndexOf;p.startCase=Le.startCase;p.startsWith=Le.startsWith;p.subtract=gt.subtract;p.sum=gt.sum;p.sumBy=gt.sumBy;p.template=Le.template;p.times=Ie.times;p.toFinite=ue.toFinite;p.toInteger=Ce;p.toLength=ue.toLength;p.toLower=Le.toLower;p.toNumber=ue.toNumber;p.toSafeInteger=ue.toSafeInteger;p.toString=ue.toString;p.toUpper=Le.toUpper;p.trim=Le.trim;p.trimEnd=Le.trimEnd;p.trimStart=Le.trimStart;p.truncate=Le.truncate;p.unescape=Le.unescape;p.uniqueId=Ie.uniqueId;p.upperCase=Le.upperCase;p.upperFirst=Le.upperFirst;p.each=je.forEach;p.eachRight=je.forEachRight;p.first=ee.head;No(p,(function(){var t={};return sn(p,function(e,n){Ql.call(p.prototype,n)||(t[n]=e)}),t})(),{chain:!1});p.VERSION=Y0;(p.templateSettings=Le.templateSettings).imports._=p;qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){p[t].placeholder=p});qt(["drop","take"],function(t,e){Te.prototype[t]=function(n){n=n===void 0?1:tb(Ce(n),0);var r=this.__filtered__&&!e?new Te(this):this.clone();return r.__filtered__?r.__takeCount__=ha(n,r.__takeCount__):r.__views__.push({size:ha(n,Jl),type:t+(r.__dir__<0?"Right":"")}),r},Te.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}});qt(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==Z0||n==J0;Te.prototype[t]=function(i){var o=this.clone();return o.__iteratees__.push({iteratee:Ae(i),type:n}),o.__filtered__=o.__filtered__||r,o}});qt(["head","last"],function(t,e){var n="take"+(e?"Right":"");Te.prototype[t]=function(){return this[n](1).value()[0]}});qt(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Te.prototype[t]=function(){return this.__filtered__?new Te(this):this[n](1)}});Te.prototype.compact=function(){return this.filter(Gt)};Te.prototype.find=function(t){return this.filter(t).head()};Te.prototype.findLast=function(t){return this.reverse().find(t)};Te.prototype.invokeMap=Re(function(t,e){return typeof t=="function"?new Te(this):this.map(function(n){return hr(n,t,e)})});Te.prototype.reject=function(t){return this.filter(li(Ae(t)))};Te.prototype.slice=function(t,e){t=Ce(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Te(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=Ce(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)};Te.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};Te.prototype.toArray=function(){return this.take(Jl)};sn(Te.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=p[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(p.prototype[e]=function(){var s=this.__wrapped__,l=r?[1]:arguments,a=s instanceof Te,u=l[0],c=a||We(s),d=function(T){var P=i.apply(p,cr([T],l));return r&&h?P[0]:P};c&&n&&typeof u=="function"&&u.length!=1&&(a=c=!1);var h=this.__chain__,f=!!this.__actions__.length,v=o&&!h,b=a&&!f;if(!o&&c){s=b?s:new Te(this);var w=t.apply(s,l);return w.__actions__.push({func:hi,args:[d],thisArg:void 0}),new Mt(w,h)}return v&&b?t.apply(this,l):(w=this.thru(d),v?r?w.value()[0]:w.value():w)})});qt(["pop","push","shift","sort","splice","unshift"],function(t){var e=Q0[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);p.prototype[t]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(We(o)?o:[],i)}return this[n](function(s){return e.apply(We(s)?s:[],i)})}});sn(Te.prototype,function(t,e){var n=p[e];if(n){var r=n.name+"";Ql.call(Ln,r)||(Ln[r]=[]),Ln[r].push({name:e,func:n})}});Ln[ti(void 0,V0).name]=[{name:"wrapper",func:void 0}];Te.prototype.clone=H0;Te.prototype.reverse=W0;Te.prototype.value=X0;p.prototype.at=Xt.at;p.prototype.chain=Xt.wrapperChain;p.prototype.commit=Xt.commit;p.prototype.next=Xt.next;p.prototype.plant=Xt.plant;p.prototype.reverse=Xt.reverse;p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Xt.value;p.prototype.first=p.prototype.head;da&&(p.prototype[da]=Xt.toIterator);var nb=Object.defineProperty,rb=Object.defineProperties,ib=Object.getOwnPropertyDescriptors,fa=Object.getOwnPropertySymbols,ob=Object.prototype.hasOwnProperty,ab=Object.prototype.propertyIsEnumerable,pa=(t,e,n)=>e in t?nb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,To=(t,e)=>{for(var n in e||(e={}))ob.call(e,n)&&pa(t,n,e[n]);if(fa)for(var n of fa(e))ab.call(e,n)&&pa(t,n,e[n]);return t},Ro=(t,e)=>rb(t,ib(e)),ga={width:40,height:40},ma={width:40,height:40},va={width:40,height:40},ya={width:100,height:80},ba={width:100,height:80},sb=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),lb=(globalThis==null?void 0:globalThis._ids)||new sb;function Gn(){return lb.next()}var eu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){eu(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Gn())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var n=t.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(r),n},e.extendKey="StartEventModel",e})(as);(function(t){eu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e})(ss);var tu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rr=function(){return Rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Rr.apply(this,arguments)};(function(t){tu(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Gn())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var n=t.prototype.getConnectedSourceRules.call(this),r={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(r),n},e.extendKey="EndEventModel",e})(as);(function(t){tu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle(),i=n,o=i.x,s=i.y,l=i.r,a=t.prototype.getShape.call(this);return ie("g",{},a,ie("circle",Rr(Rr({},r),{cx:o,cy:s,r:l-5})))},e.extendKey="EndEventView",e})(ss);var nu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){nu(e,t);function e(n,r){return n.id||(n.id="Flow_".concat(Gn())),t.call(this,n,r)||this}return e.extendKey="SequenceFlowModel",e})(Yi);(function(t){nu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e})(Vi);var ru=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),er=function(){return er=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},er.apply(this,arguments)};(function(t){ru(e,t);function e(n,r){var i=this;return n.id||(n.id="Gateway_".concat(Gn())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),i=t.call(this,n,r)||this,i.points=[[25,0],[50,25],[25,50],[0,25]],i}return e.extendKey="ExclusiveGatewayModel",e})(ls);(function(t){ru(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n,i=r.x,o=r.y,s=r.width,l=r.height,a=r.points,u=n.getNodeStyle();return ie("g",{transform:"matrix(1 0 0 1 ".concat(i-s/2," ").concat(o-l/2,")")},ie("polygon",er(er({},u),{x:i,y:o,points:a})),ie("path",er({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},u)))},e.extendKey="ExclusiveGatewayNode",e})(us);var iu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Hi=function(){return Hi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Hi.apply(this,arguments)};(function(t){iu(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Gn())),t.call(this,n,r)||this}return e.extendKey="ServiceTaskModel",e})(Ur);(function(t){iu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=n.getNodeStyle();return ie("svg",{x:r-o/2+5,y:i-s/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},ie("path",{fill:l.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=n.radius,a=n.getNodeStyle();return ie("g",{},[ie("rect",Hi({x:r-o/2,y:i-s/2,rx:l,ry:l,width:o,height:s},a)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e})(ar);var ou=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Or=function(){return Or=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Or.apply(this,arguments)};(function(t){ou(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Gn())),t.call(this,n,r)||this}return e.extendKey="UserTaskModel",e})(Ur);(function(t){ou(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=n.getNodeStyle();return ie("svg",{x:r-o/2+5,y:i-s/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},ie("path",{fill:l.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=n.radius,a=n.getNodeStyle();return ie("g",{},[ie("rect",Or(Or({},a),{x:r-o/2,y:i-s/2,rx:l,ry:l,width:o,height:s})),this.getLabelShape()])},e.extendKey="UserTaskNode",e})(ar);var ub=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),cb=(globalThis==null?void 0:globalThis._ids)||new ub;function wa(){return cb.next()}function au(t){return Object.prototype.toString.call(t)}function db(t){return" ".repeat(t)}function kr(t){var e=t;return au(t)==="[object Object]"?(e={},Object.keys(t).forEach(function(n){var r=n;n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=kr(t[n])})):Array.isArray(t)&&(e=[],t.forEach(function(n,r){e[r]=kr(n)})),e}function Mr(t){return t==null?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function hb(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(kr(t)).replace(/"/g,"'")}return Mr(String(e))}var hn=`
|
||
`;function Er(t,e,n){var r=db(n);if(t!==0&&t!==!1&&!t)return hn+r+"<".concat(e," />");var i="";if(e==="#text")return hn+r+Mr(String(t));if(e==="#cdata-section")return hn+r+"<![CDATA["+t+"]]>";if(e==="#comment")return hn+r+"<!--"+t+"-->";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+hb(t)+'"';if(Array.isArray(t))t.forEach(function(a){i+=Er(a,e,n+1)});else if(au(t)==="[object Object]"){var o=Object.keys(t),s="",l="";i+=(n===0?"":hn+r)+"<"+e,o.forEach(function(a){a.charAt(0)==="-"?s+=Er(t[a],a,n+1):l+=Er(t[a],a,n+1)}),i+=s+(l!==""?">".concat(l).concat(hn+r,"</").concat(e,">"):" />")}else i+=hn+r+"<".concat(e,">").concat(Mr(String(t)),"</").concat(e,">");return i}function fb(t){var e="";for(var n in t)e+=Er(t[n],n,0);return e}var mt=function(){};mt.ObjTree=function(){return this};mt.ObjTree.VERSION="0.23";mt.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;mt.ObjTree.prototype.attr_prefix="-";mt.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)};mt.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody=="undefined"&&typeof r.postbody=="undefined"&&typeof r.parameters=="undefined"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,s=n,l=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),s(d,c),l&&l(c)}}else r.asynchronous=!1;var a;if(typeof HTTP!="undefined"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(a=u.transport)}else if(typeof Ajax!="undefined"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(a=u.transport)}if(n)return a;if(a&&a.responseXML&&a.responseXML.documentElement)return this.parseDOM(a.responseXML.documentElement)};mt.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!=11){var r={};r[t.nodeName]=n,n=r}return n}};mt.ObjTree.prototype.parseElement=function(t){if(t.nodeType!=7){if(t.nodeType==3||t.nodeType==4||t.nodeType==8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,r={};if(t.attributes&&t.attributes.length){n={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes[i].nodeName;if(typeof o=="string"){var s=t.attributes[i].nodeValue;try{s=JSON.parse(t.attributes[i].nodeValue.replace(/'/g,'"'))}catch(u){s=t.attributes[i].nodeValue}s&&(o=this.attr_prefix+o,typeof r[o]=="undefined"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],s))}}}if(t.childNodes&&t.childNodes.length){var l=!0;n&&(l=!1);for(var i=0;i<t.childNodes.length&&l;i++){var a=t.childNodes[i].nodeType;a==3||a==4||a==8||(l=!1)}if(l){n||(n="");for(var i=0;i<t.childNodes.length;i++)n+=t.childNodes[i].nodeValue}else{n||(n={});for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes[i].nodeName;if(typeof o=="string"){var s=this.parseElement(t.childNodes[i]);s&&(typeof r[o]=="undefined"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],s))}}}}else n===null&&(n={});return n}};mt.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(n==1&&(t[e]=[]),t[e][t[e].length]=r):n==1?t[e]=r:n==2?t[e]=[t[e],r]:t[e][t[e].length]=r};mt.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};mt.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];i.charAt(0)!=this.attr_prefix?typeof o=="undefined"||o==null?n[n.length]="<"+i+" />":typeof o=="object"&&o.constructor==Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" "+i.substring(1)+'="'+this.xml_escape(o)+'"'}var s=r.join(""),l=n.join("");return typeof t=="undefined"||t==null||(n.length>0?l.match(/\n/)?l="<"+t+s+`>
|
||
`+l+"</"+t+`>
|
||
`:l="<"+t+s+">"+l+"</"+t+`>
|
||
`:l="<"+t+s+` />
|
||
`),l};mt.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];typeof i=="undefined"||i==null?n[n.length]="<"+t+" />":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")};mt.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+`>
|
||
`};mt.ObjTree.prototype.xml_escape=Mr;var pb=function(t){return new mt.ObjTree().parseXML(t)},gb=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wi=function(){return Wi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Wi.apply(this,arguments)},fi=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},zt;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(zt||(zt={}));var su=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],xa=["properties","startPoint","endPoint","pointsList"],lu=function(t){return String(t||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function Ea(t){var e=t?xa.concat(t):xa;return function(n){function r(i){var o={};return typeof i=="string"?i:Array.isArray(i)?i.map(function(s){return r(s)}):(Object.entries(i).forEach(function(s){var l=fi(s,2),a=l[0],u=l[1];typeof u!="object"?a.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(a)?o[a]=u:o["-".concat(a)]=u:e.includes(a)?o["-".concat(a)]=r(u):o[a]=r(u)}),o)}return r(n)}}function Pr(t){var e={};return Object.entries(t).forEach(function(n){var r=fi(n,2),i=r[0],o=r[1];i.indexOf("-")===0?e[i.substring(1)]=kr(o):typeof o=="string"?e[i]=o:Object.prototype.toString.call(o)==="[object Object]"?e[i]=Pr(o):Array.isArray(o)?e[i]=o.map(function(s){return Pr(s)}):e[i]=o}),e}function mb(t,e,n){var r=new Map;e.nodes.forEach(function(o){var s,l={"-id":o.id};if(!((s=o.text)===null||s===void 0)&&s.value&&(l["-name"]=o.text.value),o.properties){var a=Ea(n)(o.properties);Object.assign(l,a)}r.set(o.id,l),t[o.type]?Array.isArray(t[o.type])?t[o.type].push(l):t[o.type]=[t[o.type],l]:t[o.type]=l});var i=e.edges.map(function(o){var s,l,a=r.get(o.targetNodeId);a["bpmn:incoming"]?Array.isArray(a["bpmn:incoming"])?a["bpmn:incoming"].push(o.id):a["bpmn:incoming"]=[a["bpmn:incoming"],o.id]:a["bpmn:incoming"]=o.id;var u={"-id":o.id,"-sourceRef":o.sourceNodeId,"-targetRef":o.targetNodeId};if(!((s=o.text)===null||s===void 0)&&s.value&&(u["-name"]=(l=o.text)===null||l===void 0?void 0:l.value),o.properties){var c=Ea(n)(o.properties);Object.assign(u,c)}return u});e.edges.forEach(function(o){var s=r.get(o.sourceNodeId);s["bpmn:outgoing"]?Array.isArray(s["bpmn:outgoing"])?s["bpmn:outgoing"].push(o.id):s["bpmn:outgoing"]=[s["bpmn:outgoing"],o.id]:s["bpmn:outgoing"]=o.id}),t[zt.FLOW]=i}function vb(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(l){var a=l.x,u=l.y;return{"-x":a,"-y":u}}),s={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),s}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,s=80,l=n.x,a=n.y,u=ln.shapeConfigMap.get(n.type);u&&(o=u.width,s=u.height),l-=o/2,a-=s/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":l,"-y":a,"-width":o,"-height":s}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}function yb(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var i=r["bpmn:process"],o=r["bpmndi:BPMNDiagram"],s=o==null?void 0:o["bpmndi:BPMNPlane"];if(!i||!s)return{nodes:e,edges:n};Object.keys(i).forEach(function(l){if(l.indexOf("bpmn:")===0){var a=i[l];if(l===zt.FLOW){var u=s["bpmndi:BPMNEdge"],c=u;n=wb(a,c)}else{var d=s["bpmndi:BPMNShape"],h=d;e=e.concat(bb(a,h,l))}}})}return{nodes:e,edges:n}}function bb(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(s){var l;Array.isArray(e)?l=e.find(function(u){return u["-bpmnElement"]===s["-id"]}):l=e;var a=Ca(l,n,s);r.push(a)});else{var i=void 0;Array.isArray(e)?i=e.find(function(s){return s["-bpmnElement"]===t["-id"]}):i=e;var o=Ca(i,n,t);r.push(o)}return r}function Ca(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=lu(n["-name"]),s=ln.shapeConfigMap.get(e);s&&(r+=s.width/2,i+=s.height/2);var l;Object.entries(n).forEach(function(d){var h=fi(d,2),f=h[0],v=h[1];su.indexOf(f)===-1&&(l||(l={}),l[f]=v)}),l&&(l=Pr(l));var a;if(o&&(a={x:r,y:i,value:o},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];a.x=Number(u["-x"])+Number(u["-width"])/2,a.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return a&&(c.text=a),c}function wb(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(s){return s["-bpmnElement"]===i["-id"]}):o=e,n.push(_a(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(_a(r,t))}return n}function _a(t,e){var n,r=e["-name"]?lu("".concat(e["-name"])):"";if(r){var i=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(i=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var o=0;if(r.split(`
|
||
`).forEach(function(f){o<f.length&&(o=f.length)}),i)n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7};else{var s=t["di:waypoint"]||[],l=s[0],a=s[s.length-1]||l,u=(Number((l==null?void 0:l["-x"])||0)+Number((a==null?void 0:a["-x"])||0))/2,c=(Number((l==null?void 0:l["-y"])||0)+Number((a==null?void 0:a["-y"])||0))/2;n={value:r,x:u,y:c}}}var d;Object.entries(e).forEach(function(f){var v=fi(f,2),b=v[0],w=v[1];su.indexOf(b)===-1&&(d||(d={}),d[b]=w)}),d&&(d=Pr(d));var h={id:e["-id"],type:zt.FLOW,pointsList:t["di:waypoint"].map(function(f){return{x:Number(f["-x"]),y:Number(f["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:d};return n&&(h.text=n),h}var ln=(function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var s=Wi({},r.processAttributes);mb(s,i,o);var l={"-id":"BPMNPlane_1","-bpmnElement":s["-id"]};vb(l,i);var a=r.definitionAttributes;a["bpmn:process"]=s,a["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":l};var u={"bpmn:definitions":a};return u},this.adapterIn=function(i){if(i)return yb(i)},n.adapterIn=function(i){return r.adapterIn(i)},n.adapterOut=function(i,o){return r.adapterOut(i,o)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(wa())},this.definitionAttributes={"-id":"Definitions_".concat(wa()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t})();ln.shapeConfigMap.set(zt.START,{width:ga.width,height:ga.height});ln.shapeConfigMap.set(zt.END,{width:ma.width,height:ma.height});ln.shapeConfigMap.set(zt.GATEWAY,{width:va.width,height:va.height});ln.shapeConfigMap.set(zt.SYSTEM,{width:ya.width,height:ya.height});ln.shapeConfigMap.set(zt.USER,{width:ba.width,height:ba.height});(function(t){gb(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(o){var s=typeof o=="string"?r.sanitizeNameAttributes(o):o,l=pb(s);return r.adapterIn(l)},r.adapterXmlOut=function(o,s){var l=r.adapterOut(o,s);return fb(l)};var i=n.lf;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r}return e.prototype.sanitizeNameAttributes=function(n){return n.replace(/name="([^"]*)"/g,function(r,i){var o=i.replace(/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">");return'name="'.concat(o,'"')})},e.pluginName="bpmnXmlAdapter",e})(ln);var xb=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var r=Math.random()*16|0,i=n==="x"?r:r&3|8;return i.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),Eb=(globalThis==null?void 0:globalThis._ids)||new xb;function Cb(){return Eb.next()}ie("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),ie("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),ie("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});ie("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"});ie("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var _b=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),vn=function(){return vn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vn.apply(this,arguments)},Ab=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Sb=cs,Nb=(function(t){_b(e,t);function e(n){var r=t.call(this)||this;return r.updatePosition=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.x,u=l.y;r.nodeModel.x=a+o/2,r.nodeModel.y=u+s/2,r.nodeModel.moveText(o/2,s/2)},r.getResize=function(i){var o=i.index,s=i.deltaX,l=i.deltaY,a=i.width,u=i.height,c=i.PCTResizeInfo,d=i.pct,h=d===void 0?1:d,f=i.freezeWidth,v=f===void 0?!1:f,b=i.freezeHeight,w=b===void 0?!1:b,T={width:a,height:u,deltaX:s,deltaY:l};if(c){var P=4,H=0,G=0;switch(o){case 0:G=(s*-1-l)/P;break;case 1:G=(s-l)/P;break;case 2:G=(s+l)/P;break;case 3:G=(s*-1+l)/P;break}G!==0&&(H=Math.round(G/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+H,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+H,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var se=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),U=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(o){case 0:s=a-se,l=u-U;break;case 1:s=se-a,l=u-U;break;case 2:s=se-a,l=U-u;break;case 3:s=a-se,l=U-u;break}return T.width=se,T.height=U,T.deltaX=s/h,T.deltaY=l/h,T}switch(o){case 0:T.width=v?a:a-s*h,T.height=w?u:u-l*h;break;case 1:T.width=v?a:a+s*h,T.height=w?u:u-l*h;break;case 2:T.width=v?a:a+s*h,T.height=w?u:u+l*h;break;case 3:T.width=v?a:a-s*h,T.height=w?u:u+l*h;break}return T},r.updateEdgePointByAnchors=function(){var i=r.nodeModel,o=i.id,s=i.anchors,l=r.getNodeEdges(o);l.sourceEdges.forEach(function(a){var u=s.find(function(c){return c.id===a.sourceAnchorId});u&&a.updateStartPoint({x:u.x,y:u.y})}),l.targetEdges.forEach(function(a){var u=s.find(function(c){return c.id===a.targetAnchorId});u&&a.updateEndPoint({x:u.x,y:u.y})})},r.updateRect=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.x,u=l.y,c=l.width,d=l.height,h=l.radius,f=l.PCTResizeInfo,v=r.nodeModel,b=v.minWidth,w=v.minHeight,T=v.maxWidth,P=v.maxHeight,H=r.index,G=b===T,se=w===P,U=r.getResize({index:H,deltaX:o,deltaY:s,width:c,height:d,PCTResizeInfo:f,pct:1,freezeWidth:G,freezeHeight:se});if(U.width<b||U.width>T||U.height<w||U.height>P){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:G?0:U.deltaX,deltaY:se?0:U.deltaY}),r.nodeModel.width=U.width,r.nodeModel.height=U.height,r.nodeModel.setProperties({nodeSize:{width:U.width,height:U.height}});var D={x:a,y:u,width:c,height:d,radius:h},he={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:h};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:s,beforeNode:D,afterNode:he})},r.updateEllipse=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.rx,u=l.ry,c=l.x,d=l.y,h=l.PCTResizeInfo,f=r.index,v=r.nodeModel,b=v.minWidth,w=v.minHeight,T=v.maxWidth,P=v.maxHeight,H=b===T,G=w===P,se=a,U=u,D=r.getResize({index:f,deltaX:o,deltaY:s,width:se,height:U,PCTResizeInfo:h,pct:1/2,freezeWidth:H,freezeHeight:G});if(D.width<b/2||D.width>T/2||D.height<w/2||D.height>P/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:H?0:D.deltaX,deltaY:G?0:D.deltaY}),r.nodeModel.rx=D.width,r.nodeModel.ry=D.height,r.nodeModel.setProperties({nodeSize:{rx:D.width,ry:D.height}});var he={x:c,y:d},Q={rx:D.width,ry:D.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:s,beforeNode:vn(vn({},he),{rx:a,ry:u}),afterNode:Q})},r.updateDiamond=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.rx,u=l.ry,c=l.x,d=l.y,h=l.PCTResizeInfo,f=r.index,v=r.nodeModel,b=v.minWidth,w=v.minHeight,T=v.maxWidth,P=v.maxHeight,H=b===T,G=w===P,se=a,U=u,D=r.getResize({index:f,deltaX:o,deltaY:s,width:se,height:U,PCTResizeInfo:h,pct:1/2,freezeWidth:H,freezeHeight:G});if(D.width<b/2||D.width>T/2||D.height<w/2||D.height>P/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:H?0:D.deltaX,deltaY:G?0:D.deltaY}),r.nodeModel.rx=D.width,r.nodeModel.ry=D.height,r.nodeModel.setProperties({nodeSize:{rx:D.width,ry:D.height}});var he={x:c,y:d,rx:a,ry:u},Q={rx:D.width,ry:D.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:s,beforeNode:he,afterNode:Q})},r.eventEmit=function(i){var o=i.deltaX,s=i.deltaY,l=i.beforeNode,a=i.afterNode,u=r.nodeModel,c=u.id,d=u.modelType,h=u.type,f=vn({id:c,modelType:d,type:h},l),v=vn({id:c,modelType:d,type:h},a);r.graphModel.eventCenter.emit("node:resize",{preData:f,data:v,deltaX:o,deltaY:s,index:r.index,model:r.nodeModel})},r.onDragging=function(i){var o,s=i.deltaX,l=i.deltaY,a=r.graphModel.transformModel,u=r.nodeModel.modelType;o=Ab(a.fixDeltaXY(s,l),2),s=o[0],l=o[1],u===gr.RECT_NODE||u===gr.HTML_NODE?r.updateRect({deltaX:s,deltaY:l}):u===gr.ELLIPSE_NODE?r.updateEllipse({deltaX:s,deltaY:l}):u===gr.DIAMOND_NODE&&r.updateDiamond({deltaX:s,deltaY:l})},r.onDragEnd=function(){var i=r.graphModel.gridSize,o=i===void 0?1:i,s=o*Math.round(r.nodeModel.x/o),l=o*Math.round(r.nodeModel.y/o);r.nodeModel.moveTo(s,l),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new Sb({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return e.prototype.getNodeEdges=function(n){for(var r=this.graphModel,i=r.edges,o=[],s=[],l=0;l<i.length;l++){var a=i[l];a.sourceNodeId===n?o.push(a):i[l].targetNodeId===n&&s.push(a)}return{sourceEdges:o,targetEdges:s}},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.index,s=n.model,l=s.getControlPointStyle();return Ve("g",{className:"lf-resize-control-".concat(o),children:Ve(ds,vn({className:"lf-node-control",x:r,y:i},l,{onMouseDown:this.dragHandler.handleMouseDown}))})},e})(qr),Tb=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Lr=function(){return Lr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Lr.apply(this,arguments)},pi=(function(t){Tb(e,t);function e(){var n=t.call(this)||this;return n.state={},n}return e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=r.x,s=r.y,l=r.width,a=r.height,u={minX:o-l/2,minY:s-a/2,maxX:o+l/2,maxY:s+a/2},c=u.minX,d=u.minY,h=u.maxX,f=u.maxY,v=[{x:c,y:d},{x:h,y:d},{x:h,y:f},{x:c,y:f}];return v.map(function(b,w){return Ve(Nb,Lr({index:w},b,{model:r,graphModel:i}))})},e.prototype.getGroupSolid=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=n.getResizeOutlineStyle();return Ve(ds,Lr({},l,{x:r,y:i,width:o,height:s}))},e.prototype.render=function(){return Ve("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e})(qr),uu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){uu(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(Xu);(function(t){uu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return Ve(pi,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model,i=n.graphModel.editConfigModel.isSilentMode;return Ve("g",{children:[this.getResizeShape(),r.isSelected&&!i?this.getControlGroup():""]})},e})(Yu);var cu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$i=function(){return $i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$i.apply(this,arguments)};(function(t){cu(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(Vu);(function(t){cu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return Ve(pi,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){var n=this.props.model,r=n.points,i=n.getNodeStyle();return Ve("g",{children:Ve(Zu,$i({},i,{points:r}))})},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return Ve("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e})(Ju);var du=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){du(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(Qu);(function(t){du(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return Ve(pi,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return Ve("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e})(ec);var hu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rb=(function(t){hu(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(Ur),Ob=(function(t){hu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return Ve(pi,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return Ve("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e})(ar),fu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Dr=function(){return Dr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Dr.apply(this,arguments)},fn=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},pn=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Aa=500,Sa=300,kb=-1e4;(function(t){fu(e,t);function e(){var n=t.apply(this,pn([],fn(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=Aa,n.unfoldedHeight=Sa,n.childrenLastFoldStatus={},n}return e.prototype.initNodeData=function(n){var r=this;t.prototype.initNodeData.call(this,n);var i=[];We(n.children)&&(i=n.children),this.children=new Set(i),this.width=Aa,this.height=Sa,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=kb,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){r.isFolded&&r.foldGroup(r.isFolded)})},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.foldGroup=function(n){var r=this;if(n!==this.isFolded){this.setProperty("isFolded",n),this.isFolded=n,n?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var i=pn(pn([],fn(this.incoming.edges),!1),fn(this.outgoing.edges),!1);this.children.forEach(function(o){var s=r.graphModel.getElement(o);if(s){var l=s.isFolded;if(s.isGroup&&!s.isFolded&&s.foldGroup(n),s.isGroup&&!n){var a=r.childrenLastFoldStatus[o];a!==void 0&&a!==s.isFolded&&s.foldGroup(a)}r.childrenLastFoldStatus[o]=!!l,s.visible=!n;var u=s.incoming.edges,c=s.outgoing.edges;i=pn(pn(pn([],fn(i),!1),fn(u),!1),fn(c),!1)}}),this.foldEdge(n,i)}},e.prototype.getAnchorStyle=function(n){var r=t.prototype.getAnchorStyle.call(this,n);return r.stroke="transparent",r.fill="transparent",r.hover.fill="transparent",r.hover.stroke="transparent",r},e.prototype.foldEdge=function(n,r){var i=this;r.forEach(function(o,s){var l=o.id,a=o.sourceNodeId,u=o.targetNodeId,c=o.startPoint,d=o.endPoint,h=o.type,f=o.text,v=o.getProperties(),b={id:"".concat(l,"__").concat(s),sourceNodeId:a,targetNodeId:u,startPoint:c,endPoint:d,type:h,properties:v,text:f==null?void 0:f.value};o.virtual&&i.graphModel.deleteEdgeById(o.id);var w=i.graphModel.group.getNodeGroup(u);w||(w=i.graphModel.getNodeModelById(u));var T=i.graphModel.group.getNodeGroup(a);T||(T=i.graphModel.getNodeModelById(a)),n&&o.visible!==!1&&(i.children.has(a)||i.id===a?(b.startPoint=void 0,b.sourceNodeId=i.id):(b.endPoint=void 0,b.targetNodeId=i.id),(w.id!==i.id||T.id!==i.id)&&i.createVirtualEdge(b),o.visible=!1),!n&&o.visible===!1&&(w&&w.isGroup&&w.isFolded?(b.targetNodeId=w.id,b.endPoint=void 0,i.createVirtualEdge(b)):T&&T.isGroup&&T.isFolded?(b.sourceNodeId=T.id,b.startPoint=void 0,i.createVirtualEdge(b)):o.visible=!0)})},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isFoldedEdge=!0},e.prototype.isInRange=function(n){var r=n.minX,i=n.minY,o=n.maxX,s=n.maxY;return r>=this.x-this.width/2&&o<=this.x+this.width/2&&i>=this.y-this.height/2&&s<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var r=n.minX,i=n.minY,o=n.maxX,s=n.maxY;return{x:r>=this.x-this.width/2&&o<=this.x+this.width/2,y:i>=this.y-this.height/2&&s<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this);r.children=[],this.children.forEach(function(o){var s=n.graphModel.getNodeModelById(o);s&&!s.virtual&&r.children.push(o)});var i=r.properties;return i==null||delete i.groupAddable,i==null||delete i.isFolded,r},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=pn([],fn(this.children),!1),n.isGroup=!0;var r=n.properties;return r==null||delete r.groupAddable,r!=null&&r.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return!0},e.prototype.toBack=function(){this.zIndex--},e})(Rb);(function(t){fu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,r=n.resizable,i=n.properties;return r&&!i.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,s=n.y,l=n.radius,a=n.properties,u=n.getAddableOutlineStyle;if(!a.groupAddable)return null;var c=this.props.model.getNodeStyle().strokeWidth,d=c===void 0?0:c,h=u(),f=r+d+8,v=i+d+8;return ie("rect",Dr(Dr({},h),{width:f,height:v,x:o-f/2,y:s-v/2,rx:l,ry:l}))},e.prototype.getFoldIcon=function(){var n=this.props.model,r=n.x-n.width/2+5,i=n.y-n.height/2+5;if(!n.foldable)return null;var o=ie("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," M").concat(r+7,",").concat(i+2," ").concat(r+7,",").concat(i+10):"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," ")});return ie("g",{},[ie("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),o])},e.prototype.getResizeShape=function(){return ie("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e})(Ob);var Na=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),tr=function(){return tr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},tr.apply(this,arguments)};function Mb(t){var e=(function(r){Na(i,r);function i(o,s){o.id||(o.id="Flow_".concat(Cb()));var l=tr(tr(tr({},{}),o.properties),{isDefaultFlow:!1});return o.properties=l,r.call(this,o,s)||this}return i.extendKey="SequenceFlowModel",i})(Yi),n=(function(r){Na(i,r);function i(){return r!==null&&r.apply(this,arguments)||this}return i.prototype.getStartArrow=function(){var o=this.props.model,s=o.properties.isDefaultFlow;return s?ie("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):ie("path",{d:""})},i.extendKey="SequenceFlowEdge",i})(Vi);return{type:"bpmn:sequenceFlow",view:n,model:e}}Mb();var Ta={width:40,height:40},Ra={width:40,height:40},Oa={width:100,height:80},Ir={width:100,height:80},ka={width:100,height:80},Ma={width:100,height:80},Pa={width:100,height:80},La={width:100,height:80},Da={width:100,height:80},Ia={width:100,height:80},vt=function(){};vt.ObjTree=function(){return this};vt.ObjTree.VERSION="0.23";vt.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;vt.ObjTree.prototype.attr_prefix="-";vt.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var i=this.parseDOM(e);return i}};vt.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody=="undefined"&&typeof r.postbody=="undefined"&&typeof r.parameters=="undefined"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,s=n,l=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),s(d,c),l&&l(c)}}else r.asynchronous=!1;var a;if(typeof HTTP!="undefined"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(a=u.transport)}else if(typeof Ajax!="undefined"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(a=u.transport)}if(n)return a;if(a&&a.responseXML&&a.responseXML.documentElement)return this.parseDOM(a.responseXML.documentElement)};vt.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!==11){var r={};r[t.nodeName]=n,n=r}return n}};vt.ObjTree.prototype.parseElement=function(t){if(t.nodeType!==7){if(t.nodeType===3||t.nodeType===4||t.nodeType===8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,r={};if(t.attributes&&t.attributes.length){n={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes[i].nodeName;if(typeof o=="string"){var s=t.attributes[i].nodeValue;try{s=JSON.parse(t.attributes[i].nodeValue.replace(/'/g,'"'))}catch(u){s=t.attributes[i].nodeValue}s!=null&&(o=this.attr_prefix+o,typeof r[o]=="undefined"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],s))}}}if(t.childNodes&&t.childNodes.length){var l=!0;n&&(l=!1);for(var i=0;i<t.childNodes.length&&l;i++){var a=t.childNodes[i].nodeType;a===3||a===4||a===8||(l=!1)}if(l){n||(n="");for(var i=0;i<t.childNodes.length;i++)n+=t.childNodes[i].nodeValue}else{n||(n={});for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes[i].nodeName;if(typeof o=="string"){var s=this.parseElement(t.childNodes[i]);s&&(typeof r[o]=="undefined"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],s))}}}}else n===null&&(n={});return n}};vt.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=r):n===1?t[e]=r:n===2?t[e]=[t[e],r]:t[e][t[e].length]=r};vt.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};vt.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(Ar(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?typeof o=="undefined"||o==null?n[n.length]="<".concat(i," />"):typeof o=="object"&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var s=r.join(""),l=n.join("");return typeof t=="undefined"||t==null||(n.length>0?l.match(/\n/)?l="<".concat(t).concat(s,`>
|
||
`).concat(l,"</").concat(t,`>
|
||
`):l="<".concat(t).concat(s,">").concat(l,"</").concat(t,`>
|
||
`):l="<".concat(t).concat(s,` />
|
||
`)),l};vt.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];typeof i=="undefined"||i==null?n[n.length]="<".concat(t," />"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")};vt.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,`>
|
||
`)};vt.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var Pb=function(t){return new vt.ObjTree().parseXML(t)};function pu(t){return Object.prototype.toString.call(t)}function Ba(t){return" ".repeat(t)}function Br(t){return pu(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var r=n;return n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=Br(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return Br(e)}):t}function Lb(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(Br(t)).replace(/"/g,"'")}return e}var Fa=`
|
||
`;function Cr(t,e,n){var r=Ba(n),i="",o=Fa+r;if(e==="-json")return"";if(e==="#text")return o+t;if(e==="#cdata-section")return"".concat(o,"<![CDATA[").concat(t,"]]>");if(e==="#comment")return"".concat(o,"<!--").concat(t,"-->");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(Lb(t),'"');if(Array.isArray(t))i+=t.map(function(u){return Cr(u,e,n+1)}).join("");else if(pu(t)==="[object Object]"){var s=Object.keys(t),l="",a=t["-json"]?Fa+Ba(n+1)+t["-json"]:"";i+="".concat(n===0?"":o,"<").concat(e),s.forEach(function(u){u.charAt(0)==="-"?l+=Cr(t[u],u,n+1):a+=Cr(t[u],u,n+1)}),i+=l+(a!==""?">".concat(a).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function Db(t){var e="";for(var n in t)e+=Cr(t[n],n,0);return e}var Ib=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zi=function(){return zi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zi.apply(this,arguments)},ja=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Oo=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lt=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Dt=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},pt;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"})(pt||(pt={}));var gu=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],Bb=["properties","startPoint","endPoint","pointsList"],Fr={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},mu=function(t,e){var n=Object.keys(e||{});return n.forEach(function(r){if(t[r]){var i=e[r],o=i.in,s=i.out;o&&(t[r].in=o),s&&(t[r].out=s)}else t[r]=e[r]}),t},Rt={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=Rt[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=Rt[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=Rt[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=Rt[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId,o=function(){return"<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat(o(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o,s=t,l=e["-id"],a="",u="";try{for(var c=Oo(Object.keys(e)),d=c.next();!d.done;d=c.next()){var h=d.value;h.includes("bpmn:")&&(i=lt(h.split(":"),2),a=i[1],u=(o=e[h])===null||o===void 0?void 0:o["#text"])}}catch(f){n={error:f}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return{"-definitionId":l,"-definitionType":s,"-timerType":a,"-timerValue":u}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function Fb(t){var e=t!=null?t:{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(Dt(Dt([],lt(Bb),!1),lt(n||[]),!1)),s={in:new Set(Dt(Dt([],lt(Fr.in),!1),lt((r==null?void 0:r.in)||[]),!1)),out:new Set(Dt(Dt([],lt(Fr.out),!1),lt((r==null?void 0:r.out)||[]),!1))};return Rt=mu(Rt,i),function(l){var a=l.nodes,u=l.edges;function c(d,h){var f,v;if((d==null?void 0:d.flag)!==1){var b;if((b=Rt[d.type])&&b.out){var w=b.out(d),T=Object.keys(w);T.length>0&&T.forEach(function(Q){d[Q]=w[Q]})}d!=null&&d.children&&(d.children=d.children.map(function(Q){var Ze=a.find(function(Xe){return Xe.id===Q})||u.find(function(Xe){return Xe.id===Q});return Ze||{}}));var P={};if(typeof d=="string")return d;if(Array.isArray(d))return d.map(function(Q){return c(Q,"")}).filter(function(Q){return Q!=null});try{for(var H=Oo(Object.entries(d)),G=H.next();!G.done;G=H.next()){var se=lt(G.value,2),U=se[0],D=se[1];if((D==null?void 0:D.flag)===1)return;var he=[h,U].filter(function(Q){return Q}).join(".");s.out.has(he)||(typeof D!="object"?U.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(U)?P[U]=D:P["-".concat(U)]=D:o.has(he)?P["-".concat(U)]=c(D,he):P[U]=c(D,he))}}catch(Q){f={error:Q}}finally{try{G&&!G.done&&(v=H.return)&&v.call(H)}finally{if(f)throw f.error}}return P}}return c(l,"")}}function jr(t){var e,n,r={};try{for(var i=Oo(Object.entries(t)),o=i.next();!o.done;o=i.next()){var s=lt(o.value,2),l=s[0],a=s[1];l.indexOf("-")===0?r[l.substring(1)]=Br(a):typeof a=="string"?r[l]=a:Object.prototype.toString.call(a)==="[object Object]"?r[l]=jr(a):Array.isArray(a)?r[l]=a.map(function(u){return jr(u)}):r[l]=a}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function jb(t,e,n){var r,i=new Map,o=Fb(n)(e);o.nodes.forEach(function(l){var a=l["-id"],u=l["-type"],c=l.text,d=l.children,h=ja(l,["-id","-type","text","children"]),f={"-id":a};c!=null&&c["-value"]&&(f["-name"]=c["-value"]),h["-json"]&&(f["-json"]=h["-json"]),h["-properties"]&&Object.assign(f,h["-properties"]),d&&(f.children=d),t[u]||(t[u]=[]),t[u].push(f),i.set(a,f)});var s=o.edges.map(function(l){var a=l["-id"],u=l["-sourceNodeId"],c=l["-targetNodeId"],d=l.text,h=ja(l,["-id","-sourceNodeId","-targetNodeId","text"]),f=i.get(c);f["bpmn:incoming"]||(f["bpmn:incoming"]=[]),f["bpmn:incoming"].push(a);var v={"-id":a,"-sourceRef":u,"-targetRef":c};return d!=null&&d["-value"]&&(v["-name"]=d["-value"]),h["-json"]&&(v["-json"]=h["-json"]),h["-properties"]&&Object.assign(v,h["-properties"]),v});return e.edges.forEach(function(l){var a=l.sourceNodeId,u=l.id,c=i.get(a);c["bpmn:outgoing"]||(c["bpmn:outgoing"]=[]),c["bpmn:outgoing"].push(u)}),(r=t["bpmn:subProcess"])===null||r===void 0||r.forEach(function(l){var a={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},u=[];l.children.forEach(function(b){var w,T=i.get(b["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(H){T[H]&&T[H].forEach(function(G){a[H].add(G)})});var P=(w=t[b["-type"]])===null||w===void 0?void 0:w.findIndex(function(H){return H["-id"]===b["-id"]});P>=0&&t[b["-type"]].splice(P,1),i.delete(b["-id"]),l[b["-type"]]||(l[b["-type"]]=[]),l[b["-type"]].push(T)});var c=a["bpmn:incoming"],d=a["bpmn:outgoing"];d.forEach(function(b){c.has(b)&&u.push(b)});for(var h=function(b){var w=s.findIndex(function(T){return T["-id"]===u[b]});w>=0?(l["bpmn:sequenceFlow"]||(l["bpmn:sequenceFlow"]=[]),l["bpmn:sequenceFlow"].push(s[w]),s.splice(w,1)):b++,f=b},f,v=0;v<u.length;)h(v),v=f;delete l.children}),t[pt.FLOW]=s,t}function Hb(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(l){var a=l.x,u=l.y;return{"-x":a,"-y":u}}),s={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),s}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,s=80,l=n.x,a=n.y,u=Ct.shapeConfigMap.get(n.type);u&&(o=u.width,s=u.height),l-=o/2,a-=s/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":l,"-y":a,"-width":o,"-height":s}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}var Wb=["bpmn:incoming","bpmn:outgoing"];function $b(t,e){var n=[],r=[],i=new Map,o=e!=null?e:{},s=o.transformer,l=o.excludeFields,a={in:new Set(Dt(Dt([],lt(Fr.in),!1),lt((l==null?void 0:l.in)||[]),!1)),out:new Set(Dt(Dt([],lt(Fr.out),!1),lt((l==null?void 0:l.out)||[]),!1))};Rt=mu(Rt,s);var u=t["bpmn:definitions"];if(u){var c=u["bpmn:process"];(function(h,f){f.forEach(function(v){try{Object.keys(h).forEach(function(b){try{v(b)}catch(w){}})}catch(b){}})})(c,[function(h){function f(b){b["-children"]||(b["-children"]=[]),Object.keys(b).forEach(function(w){var T;w.indexOf("bpmn:")===0&&!Wb.includes(w)&&(c[w]||(c[w]=[]),!Array.isArray(c[w])&&(c[w]=[c[w]]),Array.isArray(b[w])?(T=c[w]).push.apply(T,Dt([],lt(b[w]),!1)):c[w].push(b[w]),Array.isArray(b[w])?b[w].forEach(function(P){!w.includes("Flow")&&b["-children"].push(P["-id"])}):!w.includes("Flow")&&b["-children"].push(b[w]["-id"]),delete b[w])})}if(h==="bpmn:subProcess"){var v=c[h];Array.isArray(v)?v.forEach(function(b){h==="bpmn:subProcess"&&f(b)}):f(v)}},function(h){var f=function(b){Object.keys(b).forEach(function(w){var T,P;if(w.includes("bpmn:")){var H={};Rt[w]&&Rt[w].in?(H=(P=(T=Rt[w]).in)===null||P===void 0?void 0:P.call(T,w,p.cloneDeep(b[w])),delete b[w]):v(b[w]);var G=void 0;(G=Reflect.ownKeys(H)).length>0&&G.forEach(function(se){Reflect.set(b,se,H[se])})}})};function v(b){i.set(b["-id"],b),Array.isArray(b)?b.forEach(function(w){v(w)}):typeof b=="object"&&f(b)}v(c[h])},function(h){if(h.indexOf("bpmn:")===0){var f=c[h];if(h==="bpmn:sequenceFlow"){var v=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=Gb(f,v)}else{var b=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(h==="bpmn:boundaryEvent"){var w=c[h],T=function(P){var H=P["-attachedToRef"],G=i.get(H);G["-boundaryEvents"]||(G["-boundaryEvents"]=[]),G["-boundaryEvents"].push(P["-id"])};Array.isArray(w)?w.forEach(function(P){T(P)}):T(w)}n=n.concat(zb(f,b,h))}}}])}var d=function(h,f,v){Object.keys(h).forEach(function(b){var w=v?"".concat(v,".").concat(b):b;f.has(w)?delete h[b]:typeof h[b]=="object"&&d(h[b],f,w)})};return n.forEach(function(h){var f,v;if(!((f=e==null?void 0:e.mapping)===null||f===void 0)&&f.in){var b=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,w=h.type;b[w]&&(h.type=b[w])}d(h,a.in,"")}),r.forEach(function(h){var f,v;if(!((f=e==null?void 0:e.mapping)===null||f===void 0)&&f.in){var b=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,w=h.type;b[w]&&(h.type=b[w])}d(h,a.in,"")}),{nodes:n,edges:r}}function zb(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(s){var l;Array.isArray(e)?l=e.find(function(u){return u["-bpmnElement"]===s["-id"]}):l=e;var a=Ha(l,n,s);r.push(a)});else{var i=void 0;Array.isArray(e)?i=e.find(function(s){return s["-bpmnElement"]===t["-id"]}):i=e;var o=Ha(i,n,t);r.push(o)}return r}function Ha(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],s=n["-name"],l=Ct.shapeConfigMap.get(e);l&&(r+=l.width/2,i+=l.height/2);var a={};Object.entries(n).forEach(function(h){var f=lt(h,2),v=f[0],b=f[1];gu.includes(v)||(a[v]=b)}),a=jr(a);var u;if(s&&(u={x:r,y:i,value:s},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];u.x=Number(c["-x"])+Number(c["-width"])/2,u.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:a};return o&&(d.children=o),u&&(d.text=u),d}function Gb(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(s){return s["-bpmnElement"]===i["-id"]}):o=e,n.push(Wa(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(Wa(r,t))}return n}function Wa(t,e){var n,r=e["-name"]?"".concat(e["-name"]):"";if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split(`
|
||
`).forEach(function(u){o<u.length&&(o=u.length)}),n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7}}var s={};Object.entries(e).forEach(function(u){var c=lt(u,2),d=c[0],h=c[1];gu.includes(d)||(s[d]=h)}),s=jr(s);var l=t["di:waypoint"].map(function(u){return{x:Number(u["-x"]),y:Number(u["-y"])}}),a={id:e["-id"],type:pt.FLOW,pointsList:l,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:s};return n&&(a.text=n),a}var Ct=(function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var s,l,a=zi({},r.processAttributes);jb(a,i,o);var u={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};Hb(u,i);var c=r.definitionAttributes;c["bpmn:process"]=a,c["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":u};var d={"bpmn:definitions":c};if(!((s=o==null?void 0:o.mapping)===null||s===void 0)&&s.out){var h=(l=o==null?void 0:o.mapping)===null||l===void 0?void 0:l.out,f=function(v){Array.isArray(v)&&v.forEach(function(b){return f(b)}),typeof v=="object"&&Object.keys(v).forEach(function(b){var w;(w=h[b])?(v[w]=p.cloneDeep(v[b]),delete v[b],f(v[w])):f(v[b])})};f(d)}return d},this.adapterIn=function(i,o){if(i)return $b(i,o)},n.adapterIn=this.adapterIn,n.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t})();Ct.shapeConfigMap.set(pt.START,{width:Ta.width,height:Ta.height});Ct.shapeConfigMap.set(pt.END,{width:Ra.width,height:Ra.height});Ct.shapeConfigMap.set(pt.INTERMEDIATE_CATCH,{width:Ir.width,height:Ir.height});Ct.shapeConfigMap.set(pt.INTERMEDIATE_THROW,{width:Ir.width,height:Ir.height});Ct.shapeConfigMap.set(pt.BOUNDARY,{width:Oa.width,height:Oa.height});Ct.shapeConfigMap.set(pt.PARALLEL_GATEWAY,{width:ka.width,height:ka.height});Ct.shapeConfigMap.set(pt.INCLUSIVE_GATEWAY,{width:Ma.width,height:Ma.height});Ct.shapeConfigMap.set(pt.EXCLUSIVE_GATEWAY,{width:Pa.width,height:Pa.height});Ct.shapeConfigMap.set(pt.SYSTEM,{width:La.width,height:La.height});Ct.shapeConfigMap.set(pt.USER,{width:Da.width,height:Da.height});Ct.shapeConfigMap.set(pt.SUBPROCESS,{width:Ia.width,height:Ia.height});(function(t){Ib(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(s){var l=Pb(s);return r.adapterIn(l,r.props)},r.adapterXmlOut=function(s){var l=r.adapterOut(s,r.props);return Db(l)};var i=n.lf,o=n.props;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r.props=o,r}return e.pluginName="BPMNAdapter",e})(Ct);function Ub(t,e,n){var r=e.x,i=e.y,o=t.x,s=t.y,l=o-r,a=s-i,u=l*Math.cos(n)-a*Math.sin(n),c=l*Math.sin(n)+a*Math.cos(n),d=u+r,h=c+i;return{x:d,y:h}}var qb=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Hr=function(){return Hr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Hr.apply(this,arguments)},Kb=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Xb=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Yb=(function(t){qb(e,t);function e(){var n=t.apply(this,Xb([],Kb(arguments),!1))||this;return n.childrenPositionMap=new Map,n.onNodeRotate=function(r){var i=r.model,o=n.props,s=o.model,l=o.graphModel,a=s.transformWithContainer,u=s.isRestrict,c=n.childrenPositionMap;if(!(!a||u)&&i.id===s.id){var d={x:s.x,y:s.y};Ge(Array.from(s.children),function(h){var f=l.getNodeModelById(h);if(f){var v={x:f.x,y:f.y};c.has(f.id)?v=c.get(f.id):c.set(f.id,v);var b=i.rotate*(180/Math.PI);b<0&&(b+=360);var w=b*(Math.PI/180),T=Ub(v,d,w);f.moveTo(T.x,T.y),f.rotate=i.rotate}})}},n.onNodeResize=function(r){var i=r.deltaX,o=r.deltaY,s=r.index,l=r.model,a=r.preData,u=n.props,c=u.model,d=u.graphModel,h=c.transformWithContainer,f=c.isRestrict;if(!(!h||f)&&l.id===c.id){var v=a.properties,b=v||{},w=b.width,T=b.height;Ge(Array.from(c.children),function(P){var H=d.getNodeModelById(P);if(H){var G=H.width/w*i,se=H.height/T*o;ic({deltaX:G,deltaY:se,index:s,nodeModel:H,graphModel:d,cancelCallback:function(){}})}})}},n.onNodeMouseMove=function(){},n.graphRendered=function(){var r=n.props.model;r.isCollapsed&&r.toggleCollapse(!0)},n}return e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var n=this.props.graphModel.eventCenter;n.on("node:rotate",this.onNodeRotate),n.on("node:resize",this.onNodeResize),n.on("node:mousemove",this.onNodeMouseMove),n.on("graph:rendered",this.graphRendered)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this);var n=this.props.graphModel.eventCenter;n.off("node:rotate",this.onNodeRotate),n.off("node:resize",this.onNodeResize),n.off("node:mousemove",this.onNodeMouseMove),n.off("graph:rendered",this.graphRendered)},e.prototype.getNodesInGroup=function(n,r){var i=this,o=[];return n.isGroup&&Ge(Array.from(n.children),function(s){o.push(s);var l=r.getNodeModelById(s);l!=null&&l.isGroup&&(o=o.concat(i.getNodesInGroup(l,r)))}),o},e.prototype.getResizeControl=function(){var n=this.props.model,r=n.resizable,i=n.isCollapsed,o=r&&!i;return o?t.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,s=n.y,l=n.radius,a=n.groupAddable;if(!a)return null;var u=n.getNodeStyle().strokeWidth,c=u===void 0?0:u,d=n.getAddableOutlineStyle(),h=r+c+8,f=i+c+8;return ie("rect",Hr(Hr({},d),{width:h,height:f,x:o-h/2,y:s-f/2,rx:l,ry:l}))},e.prototype.getCollapseIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10)},e.prototype.getExpandIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")},e.prototype.getOperateIcon=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=r-o/2+10,a=i-s/2+10;if(!n.collapsible)return null;var u=n!=null&&n.isCollapsed?this.getCollapseIcon(l,a):this.getExpandIcon(l,a),c=ie("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u});return ie("g",{},[ie("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:l,y:a,onClick:function(){n.toggleCollapse(!n.isCollapsed)}}),c])},e.prototype.getShape=function(){return ie("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},e})(ar),Vb=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wr=function(){return Wr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Wr.apply(this,arguments)},Ei=function(t,e,n,r){var i=arguments.length,o=i<3?e:r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Tn=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Zn=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Zb=400,Jb=230,Qb=80,e1=60,t1=-1e4,n1=(function(t){Vb(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.isGroup=!0,i.isRestrict=!1,i.autoResize=!1,i.collapsible=!0,i.isCollapsed=!1,i.groupAddable=!1,i.transformWithContainer=!1,i.childrenLastCollapseStateDict=new Map,i.childrenLastCollapseStateDict=new Map,i.initNodeData(n),i.setAttributes(),i}return e.prototype.initNodeData=function(n){var r;t.prototype.initNodeData.call(this,n);var i=(r=n.properties)!==null&&r!==void 0?r:{},o=i.children,s=i.width,l=i.height,a=i.collapsedWidth,u=i.collapsedHeight,c=i.collapsible,d=i.isCollapsed,h=i.zIndex,f=i.isRestrict,v=i.autoResize,b=i.autoToFront,w=i.transformWithContainer;this.children=o?new Set(o):new Set,this.zIndex=h!=null?h:t1,this.isCollapsed=d!=null?d:!1,this.setProperties({isCollapsed:d!=null?d:!1});var T=s!=null?s:Zb,P=l!=null?l:Jb;this.width=T,this.height=P,this.expandWidth=T,this.expandHeight=P,this.collapsedWidth=a!=null?a:Qb,this.collapsedHeight=u!=null?u:e1,this.isRestrict=f!=null?f:!1,this.transformWithContainer=w!=null?w:!1,this.autoResize=v!=null?v:!1,this.collapsible=c!=null?c:!0,this.autoToFront=b!=null?b:!1,this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this)},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this),i=[];return Ge(Array.from(this.children),function(o){var s=n.graphModel.getNodeModelById(o);s&&!s.virtual&&i.push(o)}),r.children=i,r.properties&&(r.properties.children=i,r.properties.isCollapsed=this.isCollapsed),r},e.prototype.getNodesInGroup=function(n){var r=[];return n.isGroup&&Ge(Array.from(n.children),function(i){r.push(i)}),r},e.prototype.getMoveDistance=function(n,r,i){i===void 0&&(i=!1);var o=Tn(t.prototype.getMoveDistance.call(this,n,r,i),2),s=o[0],l=o[1],a=this.getNodesInGroup(this);return this.graphModel.moveNodes(a,n,r,i),[s,l]},e.prototype.getHistoryData=function(){var n=t.prototype.getHistoryData.call(this);n.children=Array.from(this.children),n.isGroup=!0;var r=this,i=r.x,o=r.y,s=r.collapsedWidth,l=r.collapsedHeight,a=r.expandWidth,u=r.expandHeight,c=r.isCollapsed;return c&&(n.x=i+a/2-s/2,n.y=o+u/2-l/2,n.text&&(n.text.x=n.text.x+a/2-s/2,n.text.y=n.text.y+u/2-l/2)),n},e.prototype.toggleCollapse=function(n){var r=this,i=this.graphModel,o=!!n;this.isCollapsed=o,this.setProperties({isCollapsed:o}),i.eventCenter.emit("dynamicGroup:collapse",{collapse:o,nodeModel:this}),o?this.collapse():this.expand();var s=Zn(Zn([],Tn(this.incoming.edges),!1),Tn(this.outgoing.edges),!1),l=Array.from(this.children);Ge(l,function(a){var u,c,d=r.graphModel.elementsModelMap.get(a);if(d){var h=d.isCollapsed;if(d.isGroup){var f=d;if(f.isCollapsed||f.toggleCollapse(n),!n){var v=(u=r.childrenLastCollapseStateDict)===null||u===void 0?void 0:u.get(a);v!==void 0&&v!==d.isCollapsed&&f.toggleCollapse(v)}}if((c=r.childrenLastCollapseStateDict)===null||c===void 0||c.set(a,!!h),d.visible=!n,d.BaseType===oc.NODE){var b=d.incoming.edges,w=d.outgoing.edges;s=Zn(Zn(Zn([],Tn(s),!1),Tn(b),!1),Tn(w),!1)}}}),this.collapseEdge(o,s)},e.prototype.collapse=function(){var n=this,r=n.x,i=n.y,o=n.text,s=n.width,l=n.height,a=n.collapsedWidth,u=n.collapsedHeight;this.x=r-s/2+a/2,this.y=i-l/2+u/2,this.text.x=o.x-s/2+a/2,this.text.y=o.y-l/2+u/2,this.expandWidth=s,this.expandHeight=l,this.width=a,this.height=u},e.prototype.expand=function(){var n=this,r=n.x,i=n.y,o=n.text,s=n.expandWidth,l=n.expandHeight,a=n.collapsedWidth,u=n.collapsedHeight;this.width=s,this.height=l,this.x=r+this.width/2-a/2,this.y=i+this.height/2-u/2,this.text.x=o.x+this.width/2-a/2,this.text.y=o.y+this.height/2-u/2},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isCollapsedEdge=!0},e.prototype.collapseEdge=function(n,r){var i=this,o=this.graphModel;Ge(r,function(s,l){var a,u=s.getData(),c=u.targetNodeId,d=u.sourceNodeId,h=Wr(Wr({},u),{id:"".concat(u.id,"__").concat(l),text:(a=u.text)===null||a===void 0?void 0:a.value});s.virtual&&o.deleteEdgeById(s.id);var f=o.dynamicGroup.getGroupByNodeId(c);f||(f=o.getNodeModelById(c));var v=o.dynamicGroup.getGroupByNodeId(d);v||(v=o.getNodeModelById(d)),n&&s.visible&&(i.children.has(d)||i.id===d?(h.startPoint=void 0,h.sourceNodeId=i.id):(h.endPoint=void 0,h.targetNodeId=i.id),(f.id!==i.id||v.id!==i.id)&&i.createVirtualEdge(h),s.visible=!1),!n&&!s.visible&&(f&&f.isGroup&&f.isCollapsed?(h.targetNodeId=f.id,h.endPoint=void 0,i.createVirtualEdge(h)):v&&v.isGroup&&v.isCollapsed?(h.sourceNodeId=v.id,h.startPoint=void 0,i.createVirtualEdge(h)):s.visible=!0)})},e.prototype.isAllowAppendIn=function(n){return!0},e.prototype.setAllowAppendChild=function(n){this.groupAddable=n},e.prototype.addChild=function(n){this.children.add(n);var r=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:r,childId:n})},e.prototype.removeChild=function(n){this.children.delete(n);var r=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:r})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.getAnchorStyle=function(){var n=t.prototype.getAnchorStyle.call(this);return n.stroke="transparent",n.fill="transparent",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},Ei([ft],e.prototype,"isCollapsed",void 0),Ei([ft],e.prototype,"groupAddable",void 0),Ei([ft],e.prototype,"transformWithContainer",void 0),e})(Ur);function r1(t,e){var n=t.minX,r=t.minY,i=t.maxX,o=t.maxY,s=e.x,l=e.y,a=e.width,u=e.height;return n>=s-a/2&&i<=s+a/2&&r>=l-u/2&&o<=l+u/2}function i1(t,e,n,r){var i=t.minX,o=t.minY,s=t.maxX,l=t.maxY,a=e.x,u=e.y,c=e.width,d=e.height,h=i+c/2,f=o+d/2,v=s-c/2,b=l-d/2;return{x:a+n>=h&&a+n<=v,y:u+r>=f&&u+r<=b}}var $r=function(){return $r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$r.apply(this,arguments)},Rn=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},On=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},ko={type:"dynamic-group",view:Yb,model:n1},o1=-1e3,vr=-1e4,lw=(function(){function t(e){var n=e.lf,r=e.options,i=this;this.topGroupZIndex=vr,this.nodeGroupMap=new Map,this.onSelectionDrop=function(){var o=i.lf.graphModel.getSelectElements().nodes;o.forEach(function(s){i.addNodeToGroup(s)})},this.onNodeAddOrDrop=function(o){var s=o.data;i.addNodeToGroup(s)},this.addNodeToGroup=function(o){var s=i.nodeGroupMap.get(o.id);if(s){var l=i.lf.getNodeModelById(s);l.removeChild(o.id),i.nodeGroupMap.delete(o.id),l.setAllowAppendChild(!1)}var a=i.lf.getNodeModelById(o.id),u=a==null?void 0:a.getBounds();if(a&&u){if(a.isGroup){var c=a;Ge(Array.from(c.children),function(f){i.nodeGroupMap.set(f,o.id)}),i.calibrateTopGroupZIndex([o]),i.onNodeSelect({data:o,isSelected:!1,isMultiple:!1})}var l=i.getGroupByBounds(u,o);if(l){var d=l.isAllowAppendIn(o);d?(l.addChild(o.id),l.setAllowAppendChild(!1)):i.lf.emit("group:not-allowed",{group:l.getData(),node:o})}}},this.onGroupAddNode=function(o){var s=o.data,l=o.childId;i.nodeGroupMap.set(l,s.id)},this.removeNodeFromGroup=function(o){var s=o.data,l=o.model;l.isGroup&&s.children&&Ge(Array.from(s.children),function(c){i.nodeGroupMap.delete(c),i.lf.deleteNode(c)});var a=i.nodeGroupMap.get(s.id);if(a){var u=i.lf.getNodeModelById(a);u&&u.removeChild(s.id),i.nodeGroupMap.delete(s.id)}},this.onSelectionDrag=function(){var o=i.lf.graphModel.getSelectElements().nodes;o.forEach(function(s){i.setActiveGroup(s)})},this.onNodeDrag=function(o){var s=o.data;i.setActiveGroup(s)},this.setActiveGroup=function(o){var s=i.lf.getNodeModelById(o.id),l=s==null?void 0:s.getBounds();if(s&&l){var a=i.getGroupByBounds(l,o);if(i.activeGroup&&i.activeGroup.setAllowAppendChild(!1),!a||s.isGroup&&a.id===o.id)return;var u=a.isAllowAppendIn(o);if(!u)return;i.activeGroup=a,i.activeGroup.setAllowAppendChild(!0)}},this.onNodeSelect=function(o){var s=o.data,l=o.isMultiple,a=o.isSelected,u=i.lf.getNodeModelById(s.id);if(i.sendNodeToFront(u),i.topGroupZIndex>o1){var c=i.lf.graphModel.nodes;i.topGroupZIndex=vr;var d=Wl(Qn(c,function(w){return!!w.isGroup}),"zIndex"),h=0;Ge(d,function(w){w.zIndex!==h&&(i.topGroupZIndex++,h=w.zIndex),w.setZIndex(i.topGroupZIndex)})}if(l&&a)if(u!=null&&u.isGroup){var f=u.children;Ge(Array.from(f),function(w){var T=i.lf.getNodeModelById(w);T==null||T.setSelected(!1)})}else{var v=i.nodeGroupMap.get(s.id);if(v){var b=i.lf.getNodeModelById(v);b!=null&&b.isSelected&&(u==null||u.setSelected(!1))}}},this.onNodeMove=function(o){var s=o.deltaX,l=o.deltaY,a=o.data,u=a.id,c=a.x,d=a.y,h=a.properties;if(h){var f=h.width,v=h.height,b=i.nodeGroupMap.get(u);if(b){var w=i.lf.getNodeModelById(b);if(!(!w||!w.isRestrict||!w.autoResize)){var T=c+s/2,P=d+l/2,H=T-f/2,G=P-v/2,se=T+f/2,U=P+v/2,D=!1,he=w.getBounds(),Q=Object.assign({},he);if(H<Q.minX&&(Q.minX=H,D=!0),G<Q.minY&&(Q.minY=G,D=!0),se>Q.maxX&&(Q.maxX=se,D=!0),U>Q.maxY&&(Q.maxY=U,D=!0),!!D){var Ze=Q.minX+(Q.maxX-Q.minX)/2,Xe=Q.minY+(Q.maxY-Q.minY)/2,yt=Q.maxX-Q.minX,x=Q.maxY-Q.minY;w.moveTo(Ze,Xe),w.width=yt,w.height=x}}}}},this.onGraphRendered=function(o){var s=o.data;Ge(s.nodes,function(l){l.children&&Ge(l.children,function(a){i.nodeGroupMap.set(a,l.id)})}),i.calibrateTopGroupZIndex(s.nodes)},n.register(ko),this.lf=n,Xi(this,r),this.init()}return t.prototype.getGroupByNodeId=function(e){var n=this.nodeGroupMap.get(e);if(n)return this.lf.getNodeModelById(n)},t.prototype.getGroupByBounds=function(e,n){var r=this.lf.graphModel.nodes,i=Qn(r,function(a){return!!a.isGroup&&r1(e,a)&&a.id!==n.id}),o=i.length;if(o<=1)return i[0];for(var s=i[o-1],l=o-2;l>=0;l--)i[l].zIndex>s.zIndex&&(s=i[l]);return s},t.prototype.sendNodeToFront=function(e){var n=this;if(!(!e||!e.isGroup)&&(this.topGroupZIndex++,e.setZIndex(this.topGroupZIndex),e.children)){var r=e.children;Ge(Array.from(r),function(i){var o=n.lf.getNodeModelById(i);n.sendNodeToFront(o)})}},t.prototype.getMaxZIndex=function(e){var n=this,r=vr;if(e.isGroup&&(r=Math.max(r,e.zIndex)),e.children){var i=e.children;Ge(Array.from(i),function(o){var s=n.lf.getNodeModelById(o);if(s!=null&&s.isGroup){var l=n.getMaxZIndex(s);r=Math.max(r,l)}})}return r},t.prototype.calibrateTopGroupZIndex=function(e){var n=this,r=vr;if(Ge(e,function(l){var a=n.lf.getNodeModelById(l.id);if(a){var u=n.getMaxZIndex(a);u>r&&(r=u)}}),!(this.topGroupZIndex>=r)){var i=this.lf.graphModel.nodes,o=Qn(i,function(l){return!!l.isGroup}),s=this.topGroupZIndex;Ge(o,function(l){l.zIndex>s&&(s=l.zIndex)}),this.topGroupZIndex=s}},t.prototype.removeChildrenInGroupNodeData=function(e){var n,r=ki(e);return delete r.children,!((n=r.properties)===null||n===void 0)&&n.children&&delete r.properties.children,r},t.prototype.initGroupChildNodes=function(e,n,r,i){var o=this,s=[],l=[],a=[];Ge(Array.from(n),function(d){var h=o.lf.getNodeModelById(d);if(h){var f=h.children,v=h.getData(),b=ac.NODE_GROUP_COPY||"node:group-copy-add",w=sc(o.removeChildrenInGroupNodeData(v),i),T=o.lf.addNode(w,b);if(r.addChild(T.id),e[d]=T.id,s.push(T),a.push.apply(a,On([],Rn(On(On([],Rn(T.incoming.edges),!1),Rn(T.outgoing.edges),!1)),!1)),f instanceof Set){var P=o.initGroupChildNodes(e,f,T,i),H=P.childNodes,G=P.edgesData;s.push.apply(s,On([],Rn(H),!1)),l.push.apply(l,On([],Rn(G),!1))}}});var u=Qn(a,function(d){return Ar(e,d.sourceNodeId)&&Ar(e,d.targetNodeId)}),c=or(u,function(d){return d.getData()});return{childNodes:s,edgesData:l.concat(c)}},t.prototype.createEdge=function(e,n,r){var i,o,s=e.sourceNodeId,l=e.targetNodeId,a=(i=n[s])!==null&&i!==void 0?i:s,u=(o=n[l])!==null&&o!==void 0?o:l,c=ki(e);return e.id&&typeof e.text=="object"&&e.text!==null&&(c=Ku(e,r)),this.lf.graphModel.addEdge($r($r({},c),{sourceNodeId:a,targetNodeId:u}))},t.prototype.checkGroupBoundsWithChildren=function(e,n,r,i,o){if(e.children)for(var s=e.children,l=e.x,a=e.y,u=l+n/2,c=a+r/2,d=u-i/2,h=c-o/2,f=u+i/2,v=c+o/2,b=Array.from(s),w=0;w<b.length;w++){var T=b[w],P=this.lf.getNodeModelById(T);if(P){var H=P.getBounds(),G=H.minX,se=H.minY,U=H.maxX,D=H.maxY,he=d<=G&&h<=se&&f>=U&&v>=D;if(!he)return!1}}return!0},t.prototype.init=function(){var e=this,n=this.lf,r=n.graphModel;r.addNodeMoveRules(function(i,o,s){if(i.isGroup)return!0;var l=e.nodeGroupMap.get(i.id),a=e.lf.getNodeModelById(l);if(a&&a.isRestrict){if(a.autoResize)return!0;var u=a.getBounds();return i1(u,i,o,s)}return!0}),r.addNodeResizeRules(function(i,o,s,l,a){return i.isGroup&&i.isRestrict?e.checkGroupBoundsWithChildren(i,o,s,l,a):!0}),r.dynamicGroup=this,n.on("node:add,node:drop,node:dnd-add",this.onNodeAddOrDrop),n.on("selection:drop",this.onSelectionDrop),n.on("node:delete",this.removeNodeFromGroup),n.on("node:drag,node:dnd-drag",this.onNodeDrag),n.on("selection:drag",this.onSelectionDrag),n.on("node:click",this.onNodeSelect),n.on("node:mousemove",this.onNodeMove),n.on("graph:rendered",this.onGraphRendered),n.on("group:add-node",this.onGroupAddNode),n.addElements=function(i,o){var s=i.nodes,l=i.edges;o===void 0&&(o=40);var a={},u={nodes:[],edges:[]},c=[];return Ge(s,function(d){var h,f,v=d.id,b=(f=(h=d.properties)===null||h===void 0?void 0:h.children)!==null&&f!==void 0?f:d.children,w=n.addNode(e.removeChildrenInGroupNodeData(d));if(v&&(a[v]=w.id),u.nodes.push(w),w.isGroup){var T=e.initGroupChildNodes(a,b,w,o).edgesData;c.push.apply(c,On([],Rn(T),!1))}}),Ge(c,function(d){e.createEdge(d,a,o)}),Ge(l,function(d){u.edges.push(e.createEdge(d,a,o))}),u},this.render()},t.prototype.render=function(){},t.prototype.destroy=function(){this.lf.off("node:add,node:drop,node:dnd-add",this.onNodeAddOrDrop),this.lf.off("selection:drop",this.onSelectionDrop),this.lf.off("node:delete",this.removeNodeFromGroup),this.lf.off("node:drag,node:dnd-drag",this.onNodeDrag),this.lf.off("selection:drag",this.onSelectionDrag),this.lf.off("node:click",this.onNodeSelect),this.lf.off("node:mousemove",this.onNodeMove),this.lf.off("graph:rendered",this.onGraphRendered),this.lf.off("group:add-node",this.onGroupAddNode)},t.pluginName="dynamicGroup",t})(),$a;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})($a||($a={}));var a1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),nr=function(){return nr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},nr.apply(this,arguments)},s1=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},l1=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},u1=(function(t){a1(e,t);function e(n){var r=t.call(this,n)||this;r.textRef=tc(),r.setHoverOn=function(){var a=r.props.element;a.isDragging||r.state.isHovered||(r.setState({isHovered:!0}),a.setHovered(!0))},r.setHoverOff=function(){var a=r.props.element;r.state.isHovered&&(r.setState({isHovered:!1}),a.setHovered(!1))},r.handleMouseDown=function(a){var u,c=r.props,d=c.label,h=c.graphModel,f=h.editConfigModel.nodeTextDraggable;((u=d.draggable)!==null&&u!==void 0?u:f)&&!r.state.isDragging&&!r.state.isEditing&&r.stepDrag.handleMouseDown(a)},r.handleMouseUp=function(a){r.state.isDragging&&r.stepDrag.handleMouseUp(a)},r.handleDragging=function(a){var u=a.deltaX,c=a.deltaY;r.state.isDragging||r.setState({isDragging:!0});var d=r.props,h=d.label,f=d.graphModel,v=f.transformModel,b=l1(v.fixDeltaXY(u,c),2),w=b[0],T=b[1];r.setElementModelLabelInfo({x:h.x+w,y:h.y+T}),f.eventCenter.emit("label:drag",{data:h.getData(),model:h})},r.handleDragEnd=function(){r.setState({isDragging:!1})},r.handleClick=function(a){var u=r.props,c=u.label,d=u.element,h=u.graphModel;d.setSelected(!r.state.isSelected),r.setState({isSelected:!r.state.isSelected}),r.setElementModelLabelInfo({isSelected:!0}),h.eventCenter.emit("label:click",{data:c.getData(),e:a,model:d})},r.handleDbClick=function(a){var u=r.props,c=u.label,d=u.element,h=u.graphModel;if(h.eventCenter.emit("label:dblclick",{data:c.getData(),e:a,model:d}),!c.editable){d.setSelected(!0);return}if(d.setSelected(),d.setElementState(Io.TEXT_EDIT),r.setState({isEditing:!0}),r.textRef.current){r.textRef.current.contentEditable="true",r.textRef.current.focus();var f=document.createRange(),v=window.getSelection();f.selectNodeContents(r.textRef.current),f.collapse(!1),v==null||v.removeAllRanges(),v==null||v.addRange(f)}},r.handleBlur=function(a){var u=r.props,c=u.label,d=u.element,h=u.graphModel.eventCenter;h.emit("label:blur",{e:a,model:d,data:c.getData(),element:r.textRef.current}),r.setState({isDragging:!1,isHovered:!1,isSelected:!1})},r.handleInput=function(a){var u=r.props,c=u.label,d=u.graphModel;d.eventCenter.emit("label:input",{e:a,data:c.getData()})},r.reCalcLabelSize=function(){};var i=n.label,o=n.graphModel,s=o.gridSize,l=o.eventCenter;return r.stepDrag=new cs({onDragging:r.handleDragging,onDragEnd:r.handleDragEnd,step:s,eventType:"LABEL",model:i,eventCenter:l}),r.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},r}return e.prototype.setElementModelLabelInfo=function(n){var r=this.props,i=r.label,o=r.element,s=r.graphModel,l=o.properties._label,a=l,u=Ms(a,function(h){return h.id===i.id}),c=a[u];a[u]=nr(nr({},c),n);var d=s.getElement(o.id);d==null||d.setProperty("_label",a)},e.prototype.componentDidMount=function(){var n=this,r=this.props,i=r.label,o=r.element,s=r.graphModel;s.eventCenter.on("blank:click,node:click,edge:click,label:click",function(l){var a,u,c,d,h=l.data;if(((h==null?void 0:h.type)!=="label"||h.type==="label"&&h.id!==i.id||n.state.isSelected)&&n.setState({isSelected:!1}),((h==null?void 0:h.type)!=="label"||h.type=="label"&&h.id!==i.id)&&n.state.isEditing){n.setState({isEditing:!1});var f=(u=(a=n.textRef.current)===null||a===void 0?void 0:a.innerText)!==null&&u!==void 0?u:"",v=(d=(c=n.textRef.current)===null||c===void 0?void 0:c.innerHTML)!==null&&d!==void 0?d:"";n.setElementModelLabelInfo({value:f,content:v,isSelected:!1}),o.setElementState(Io.DEFAULT)}((h==null?void 0:h.type)!=="label"||h.type=="label"&&h.id!==i.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,r=this.props,i=r.label,o=r.element,s=r.graphModel,l=this.state,a=l.isDragging,u=l.isHovered,c=l.isSelected,d=l.isEditing,h=s.transformModel,f=h.getTransformStyle().transform,v=i.id,b=i.x,w=i.y,T=i.zIndex,P=i.vertical,H=i.style,G=i.rotate,se=i.content,U=i.labelWidth,D=i.textOverflowMode,he=U!=null?U:o.BaseType==="node"?o.width-20:80,Q={left:"".concat(b-he/2,"px"),top:"".concat(w-10,"px"),width:"".concat(he,"px"),height:"20px",zIndex:T!=null?T:1,transform:G?"".concat(f," rotate(").concat(G,"deg)"):"".concat(f," rotate(").concat(P?-.25:0,"turn)")};return Ve("div",{id:"element-container-".concat(v),className:Bo("lf-label-editor-container"),style:Q,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:Ve("div",{ref:this.textRef,id:"editor-container-".concat(v),className:Bo("lf-label-editor",(n={"lf-label-editor-dragging":a,"lf-label-editor-editing":d,"lf-label-editor-hover":!d&&(u||c)},n["lf-label-editor-".concat(D)]=!d,n)),onInput:this.handleInput,style:nr({maxWidth:"".concat(he,"px"),boxSizing:"border-box",display:"inline-block",background:d||o.BaseType==="edge"?"#fff":"transparent"},H),dangerouslySetInnerHTML:{__html:se}})})},e=s1([hs],e),e})(qr),Tt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},c1=rc,d1=(function(){function t(e,n,r){var i;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=r,this.id=(i=e.id)!==null&&i!==void 0?i:c1(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){Xi(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:nc(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},Tt([ft],t.prototype,"x",void 0),Tt([ft],t.prototype,"y",void 0),Tt([ft],t.prototype,"content",void 0),Tt([ft],t.prototype,"value",void 0),Tt([ft],t.prototype,"rotate",void 0),Tt([ft],t.prototype,"style",void 0),Tt([ft],t.prototype,"zIndex",void 0),Tt([ft],t.prototype,"vertical",void 0),Tt([ft],t.prototype,"editable",void 0),Tt([ft],t.prototype,"draggable",void 0),Tt([ft],t.prototype,"labelWidth",void 0),Tt([ft],t.prototype,"textOverflowMode",void 0),t})(),Gi={exports:{}},Ci=Gi.exports,za;function h1(){return za||(za=1,(function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||(function(e){if("Element"in e){var n="classList",r="prototype",i=e.Element[r],o=Object,s=String[r].trim||function(){return this.replace(/^\s+|\s+$/g,"")},l=Array[r].indexOf||function(v){for(var b=0,w=this.length;b<w;b++)if(b in this&&this[b]===v)return b;return-1},a=function(v,b){this.name=v,this.code=DOMException[v],this.message=b},u=function(v,b){if(b==="")throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return l.call(v,b)},c=function(v){for(var b=s.call(v.getAttribute("class")||""),w=b?b.split(/\s+/):[],T=0,P=w.length;T<P;T++)this.push(w[T]);this._updateClassName=function(){v.setAttribute("class",this.toString())}},d=c[r]=[],h=function(){return new c(this)};if(a[r]=Error[r],d.item=function(v){return this[v]||null},d.contains=function(v){return v+="",u(this,v)!==-1},d.add=function(){var v=arguments,b=0,w=v.length,T,P=!1;do T=v[b]+"",u(this,T)===-1&&(this.push(T),P=!0);while(++b<w);P&&this._updateClassName()},d.remove=function(){var v=arguments,b=0,w=v.length,T,P=!1,H;do for(T=v[b]+"",H=u(this,T);H!==-1;)this.splice(H,1),P=!0,H=u(this,T);while(++b<w);P&&this._updateClassName()},d.toggle=function(v,b){v+="";var w=this.contains(v),T=w?b!==!0&&"remove":b!==!1&&"add";return T&&this[T](v),b===!0||b===!1?b:!w},d.toString=function(){return this.join(" ")},o.defineProperty){var f={get:h,enumerable:!0,configurable:!0};try{o.defineProperty(i,n,f)}catch(v){v.number===-2146823252&&(f.enumerable=!1,o.defineProperty(i,n,f))}}else o[r].__defineGetter__&&i.__defineGetter__(n,h)}})(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{new Blob;return}catch(i){}var n=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||(function(i){var o=function(D){return Object.prototype.toString.call(D).match(/^\[object\s(.*)\]$/)[1]},s=function(){this.data=[]},l=function(D,he,Q){this.data=D,this.size=D.length,this.type=he,this.encoding=Q},a=s.prototype,u=l.prototype,c=i.FileReaderSync,d=function(D){this.code=this[this.name=D]},h="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),f=h.length,v=i.URL||i.webkitURL||i,b=v.createObjectURL,w=v.revokeObjectURL,T=v,P=i.btoa,H=i.atob,G=i.ArrayBuffer,se=i.Uint8Array,U=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(l.fake=u.fake=!0;f--;)d.prototype[h[f]]=f+1;return v.createObjectURL||(T=i.URL=function(D){var he=document.createElementNS("http://www.w3.org/1999/xhtml","a"),Q;return he.href=D,"origin"in he||(he.protocol.toLowerCase()==="data:"?he.origin=null:(Q=D.match(U),he.origin=Q&&Q[1])),he}),T.createObjectURL=function(D){var he=D.type,Q;if(he===null&&(he="application/octet-stream"),D instanceof l)return Q="data:"+he,D.encoding==="base64"?Q+";base64,"+D.data:D.encoding==="URI"?Q+","+decodeURIComponent(D.data):P?Q+";base64,"+P(D.data):Q+","+encodeURIComponent(D.data);if(b)return b.call(v,D)},T.revokeObjectURL=function(D){D.substring(0,5)!=="data:"&&w&&w.call(v,D)},a.append=function(D){var he=this.data;if(se&&(D instanceof G||D instanceof se)){for(var Q="",Ze=new se(D),Xe=0,yt=Ze.length;Xe<yt;Xe++)Q+=String.fromCharCode(Ze[Xe]);he.push(Q)}else if(o(D)==="Blob"||o(D)==="File")if(c){var x=new c;he.push(x.readAsBinaryString(D))}else throw new d("NOT_READABLE_ERR");else D instanceof l?D.encoding==="base64"&&H?he.push(H(D.data)):D.encoding==="URI"?he.push(decodeURIComponent(D.data)):D.encoding==="raw"&&he.push(D.data):(typeof D!="string"&&(D+=""),he.push(unescape(encodeURIComponent(D))))},a.getBlob=function(D){return arguments.length||(D=null),new l(this.data.join(""),D,"raw")},a.toString=function(){return"[object BlobBuilder]"},u.slice=function(D,he,Q){var Ze=arguments.length;return Ze<3&&(Q=null),new l(this.data.slice(D,Ze>1?he:this.data.length),Q,this.encoding)},u.toString=function(){return"[object Blob]"},u.close=function(){this.size=0,delete this.data},s})(e);e.Blob=function(i,o){var s=o&&o.type||"",l=new n;if(i)for(var a=0,u=i.length;a<u;a++)Uint8Array&&i[a]instanceof Uint8Array?l.append(i[a].buffer):l.append(i[a]);var c=l.getBlob(s);return!c.slice&&c.webkitSlice&&(c.slice=c.webkitSlice),c};var r=Object.getPrototypeOf||function(i){return i.__proto__};e.Blob.prototype=r(new e.Blob)})(typeof self!="undefined"&&self||typeof window!="undefined"&&window||Ci.content||Ci),(function(e,n){var r=typeof process!="undefined"&&process&&process.versions&&process.versions.electron;r?e.MediumEditor=n:t.exports=n})(Ci,(function(){function e(n,r){return this.init(n,r)}return e.extensions={},(function(n){function r(a,u){var c,d=Array.prototype.slice.call(arguments,2);u=u||{};for(var h=0;h<d.length;h++){var f=d[h];if(f)for(c in f)f.hasOwnProperty(c)&&typeof f[c]!="undefined"&&(a||u.hasOwnProperty(c)===!1)&&(u[c]=f[c])}return u}var i=!1;try{var o=document.createElement("div"),s=document.createTextNode(" ");o.appendChild(s),i=o.contains(s)}catch(a){}var l={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(a){return!!(l.isMac&&a.metaKey||!l.isMac&&a.ctrlKey)},isKey:function(a,u){var c=l.getKeyCode(a);return Array.isArray(u)===!1?c===u:u.indexOf(c)!==-1},getKeyCode:function(a){var u=a.which;return u===null&&(u=a.charCode!==null?a.charCode:a.keyCode),u},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var a=[!0].concat(Array.prototype.slice.call(arguments));return r.apply(this,a)},defaults:function(){var a=[!1].concat(Array.prototype.slice.call(arguments));return r.apply(this,a)},createLink:function(a,u,c,d){var h=a.createElement("a");return l.moveTextRangeIntoElement(u[0],u[u.length-1],h),h.setAttribute("href",c),d&&(d==="_blank"&&h.setAttribute("rel","noopener noreferrer"),h.setAttribute("target",d)),h},findOrCreateMatchingTextNodes:function(a,u,c){for(var d=a.createTreeWalker(u,NodeFilter.SHOW_ALL,null,!1),h=[],f=0,v=!1,b=null,w=null;(b=d.nextNode())!==null;)if(!(b.nodeType>3))if(b.nodeType===3){if(!v&&c.start<f+b.nodeValue.length&&(v=!0,w=l.splitStartNodeIfNeeded(b,c.start,f)),v&&l.splitEndNodeIfNeeded(b,w,c.end,f),v&&f===c.end)break;if(v&&f>c.end+1)throw new Error("PerformLinking overshot the target!");v&&h.push(w||b),f+=b.nodeValue.length,w!==null&&(f+=w.nodeValue.length,d.nextNode()),w=null}else b.tagName.toLowerCase()==="img"&&(!v&&c.start<=f&&(v=!0),v&&h.push(b));return h},splitStartNodeIfNeeded:function(a,u,c){return u!==c?a.splitText(u-c):null},splitEndNodeIfNeeded:function(a,u,c,d){var h,f;h=d+a.nodeValue.length+(u?u.nodeValue.length:0)-1,f=c-d-(u?a.nodeValue.length:0),h>=c&&d!==h&&f!==0&&(u||a).splitText(f)},splitByBlockElements:function(a){if(a.nodeType!==3&&a.nodeType!==1)return[];var u=[],c=e.util.blockContainerElementNames.join(",");if(a.nodeType===3||a.querySelectorAll(c).length===0)return[a];for(var d=0;d<a.childNodes.length;d++){var h=a.childNodes[d];if(h.nodeType===3)u.push(h);else if(h.nodeType===1){var f=h.querySelectorAll(c);f.length===0?u.push(h):u=u.concat(e.util.splitByBlockElements(h))}}return u},findAdjacentTextNodeWithContent:function(a,u,c){var d=!1,h,f=c.createNodeIterator(a,NodeFilter.SHOW_TEXT,null,!1);for(h=f.nextNode();h;){if(h===u)d=!0;else if(d&&h.nodeType===3&&h.nodeValue&&h.nodeValue.trim().length>0)break;h=f.nextNode()}return h},findPreviousSibling:function(a){if(!a||l.isMediumEditorElement(a))return!1;for(var u=a.previousSibling;!u&&!l.isMediumEditorElement(a.parentNode);)a=a.parentNode,u=a.previousSibling;return u},isDescendant:function(a,u,c){if(!a||!u)return!1;if(a===u)return!!c;if(a.nodeType!==1)return!1;if(i||u.nodeType!==3)return a.contains(u);for(var d=u.parentNode;d!==null;){if(d===a)return!0;d=d.parentNode}return!1},isElement:function(a){return!!(a&&a.nodeType===1)},throttle:function(a,u){var c=50,d,h,f,v=null,b=0,w=function(){b=Date.now(),v=null,f=a.apply(d,h),v||(d=h=null)};return!u&&u!==0&&(u=c),function(){var T=Date.now(),P=u-(T-b);return d=this,h=arguments,P<=0||P>u?(v&&(clearTimeout(v),v=null),b=T,f=a.apply(d,h),v||(d=h=null)):v||(v=setTimeout(w,P)),f}},traverseUp:function(a,u){if(!a)return!1;do{if(a.nodeType===1){if(u(a))return a;if(l.isMediumEditorElement(a))return!1}a=a.parentNode}while(a);return!1},htmlEntities:function(a){return String(a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(a,u){var c,d,h,f,v,b,w,T=!1,P=["insertHTML",!1,u];if(!e.util.isEdge&&a.queryCommandSupported("insertHTML"))try{return a.execCommand.apply(a,P)}catch(H){}if(c=a.getSelection(),c.rangeCount){if(d=c.getRangeAt(0),w=d.commonAncestorContainer,l.isMediumEditorElement(w)&&!w.firstChild)d.selectNode(w.appendChild(a.createTextNode("")));else if(w.nodeType===3&&d.startOffset===0&&d.endOffset===w.nodeValue.length||w.nodeType!==3&&w.innerHTML===d.toString()){for(;!l.isMediumEditorElement(w)&&w.parentNode&&w.parentNode.childNodes.length===1&&!l.isMediumEditorElement(w.parentNode);)w=w.parentNode;d.selectNode(w)}for(d.deleteContents(),h=a.createElement("div"),h.innerHTML=u,f=a.createDocumentFragment();h.firstChild;)v=h.firstChild,b=f.appendChild(v);d.insertNode(f),b&&(d=d.cloneRange(),d.setStartAfter(b),d.collapse(!0),e.selection.selectRange(a,d)),T=!0}return a.execCommand.callListeners&&a.execCommand.callListeners(P,T),T},execFormatBlock:function(a,u){var c=l.getTopBlockContainer(e.selection.getSelectionStart(a)),d;if(u==="blockquote"){if(c&&(d=Array.prototype.slice.call(c.childNodes),d.some(function(h){return l.isBlockContainer(h)})))return a.execCommand("outdent",!1,null);if(l.isIE)return a.execCommand("indent",!1,u)}if(c&&u===c.nodeName.toLowerCase()&&(u="p"),l.isIE&&(u="<"+u+">"),c&&c.nodeName.toLowerCase()==="blockquote"){if(l.isIE&&u==="<p>")return a.execCommand("outdent",!1,u);if((l.isFF||l.isEdge)&&u==="p")return d=Array.prototype.slice.call(c.childNodes),d.some(function(h){return!l.isBlockContainer(h)})&&a.execCommand("formatBlock",!1,u),a.execCommand("outdent",!1,u)}return a.execCommand("formatBlock",!1,u)},setTargetBlank:function(a,u){var c,d=u||!1;if(a.nodeName.toLowerCase()==="a")a.target="_blank",a.rel="noopener noreferrer";else for(a=a.getElementsByTagName("a"),c=0;c<a.length;c+=1)(d===!1||d===a[c].attributes.href.value)&&(a[c].target="_blank",a[c].rel="noopener noreferrer")},removeTargetBlank:function(a,u){var c;if(a.nodeName.toLowerCase()==="a")a.removeAttribute("target"),a.removeAttribute("rel");else for(a=a.getElementsByTagName("a"),c=0;c<a.length;c+=1)u===a[c].attributes.href.value&&(a[c].removeAttribute("target"),a[c].removeAttribute("rel"))},addClassToAnchors:function(a,u){var c=u.split(" "),d,h;if(a.nodeName.toLowerCase()==="a")for(h=0;h<c.length;h+=1)a.classList.add(c[h]);else{var f=a.getElementsByTagName("a");if(f.length===0){var v=l.getClosestTag(a,"a");a=v?[v]:[]}else a=f;for(d=0;d<a.length;d+=1)for(h=0;h<c.length;h+=1)a[d].classList.add(c[h])}},isListItem:function(a){if(!a)return!1;if(a.nodeName.toLowerCase()==="li")return!0;for(var u=a.parentNode,c=u.nodeName.toLowerCase();c==="li"||!l.isBlockContainer(u)&&c!=="div";){if(c==="li")return!0;if(u=u.parentNode,u)c=u.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(a,u){if(u.nodeName.toLowerCase()==="li"){var c=u.parentElement;c.parentElement.nodeName.toLowerCase()==="p"&&(l.unwrap(c.parentElement,a),e.selection.moveCursor(a,u.firstChild,u.firstChild.textContent.length))}},splitOffDOMTree:function(a,u,c){for(var d=u,h=null,f=!c;d!==a;){var v=d.parentNode,b=v.cloneNode(!1),w=f?d:v.firstChild,T;for(h&&(f?b.appendChild(h):T=h),h=b;w;){var P=w.nextSibling;w===d?(w.hasChildNodes()?w=w.cloneNode(!1):w.parentNode.removeChild(w),w.textContent&&h.appendChild(w),w=f?P:null):(w.parentNode.removeChild(w),(w.hasChildNodes()||w.textContent)&&h.appendChild(w),w=P)}T&&h.appendChild(T),d=v}return h},moveTextRangeIntoElement:function(a,u,c){if(!a||!u)return!1;var d=l.findCommonRoot(a,u);if(!d)return!1;if(u===a){var h=a.parentNode,f=a.nextSibling;return h.removeChild(a),c.appendChild(a),f?h.insertBefore(c,f):h.appendChild(c),c.hasChildNodes()}for(var v=[],b,w,T,P=0;P<d.childNodes.length;P++)if(T=d.childNodes[P],!b)l.isDescendant(T,a,!0)&&(b=T);else if(l.isDescendant(T,u,!0)){w=T;break}else v.push(T);var H=w.nextSibling,G=d.ownerDocument.createDocumentFragment();return b===a?(b.parentNode.removeChild(b),G.appendChild(b)):G.appendChild(l.splitOffDOMTree(b,a)),v.forEach(function(se){se.parentNode.removeChild(se),G.appendChild(se)}),w===u?(w.parentNode.removeChild(w),G.appendChild(w)):G.appendChild(l.splitOffDOMTree(w,u,!0)),c.appendChild(G),w.parentNode===d?d.insertBefore(c,w):H?d.insertBefore(c,H):d.appendChild(c),c.hasChildNodes()},depthOfNode:function(a){for(var u=0,c=a;c.parentNode!==null;)c=c.parentNode,u++;return u},findCommonRoot:function(a,u){for(var c=l.depthOfNode(a),d=l.depthOfNode(u),h=a,f=u;c!==d;)c>d?(h=h.parentNode,c-=1):(f=f.parentNode,d-=1);for(;h!==f;)h=h.parentNode,f=f.parentNode;return h},isElementAtBeginningOfBlock:function(a){for(var u,c;!l.isBlockContainer(a)&&!l.isMediumEditorElement(a);){for(c=a;c=c.previousSibling;)if(u=c.nodeType===3?c.nodeValue:c.textContent,u.length>0)return!1;a=a.parentNode}return!0},isMediumEditorElement:function(a){return a&&a.getAttribute&&!!a.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(a){return l.traverseUp(a,function(u){return l.isMediumEditorElement(u)})},isBlockContainer:function(a){return a&&a.nodeType!==3&&l.blockContainerElementNames.indexOf(a.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(a){return l.traverseUp(a,function(u){return l.isBlockContainer(u)||l.isMediumEditorElement(u)})},getTopBlockContainer:function(a){var u=l.isBlockContainer(a)?a:!1;return l.traverseUp(a,function(c){return l.isBlockContainer(c)&&(u=c),!u&&l.isMediumEditorElement(c)?(u=c,!0):!1}),u},getFirstSelectableLeafNode:function(a){for(;a&&a.firstChild;)a=a.firstChild;if(a=l.traverseUp(a,function(c){return l.emptyElementNames.indexOf(c.nodeName.toLowerCase())===-1}),a.nodeName.toLowerCase()==="table"){var u=a.querySelector("th, td");u&&(a=u)}return a},getFirstTextNode:function(a){return l.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),l._getFirstTextNode(a)},_getFirstTextNode:function(a){if(a.nodeType===3)return a;for(var u=0;u<a.childNodes.length;u++){var c=l._getFirstTextNode(a.childNodes[u]);if(c!==null)return c}return null},ensureUrlHasProtocol:function(a){return a.indexOf("://")===-1?"http://"+a:a},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(a,u,c){var d=a+" is deprecated, please use "+u+" instead.";c&&(d+=" Will be removed in "+c),l.warn(d)},deprecatedMethod:function(a,u,c,d){l.deprecated(a,u,d),typeof this[u]=="function"&&this[u].apply(this,c)},cleanupAttrs:function(a,u){u.forEach(function(c){a.removeAttribute(c)})},cleanupTags:function(a,u){u.indexOf(a.nodeName.toLowerCase())!==-1&&a.parentNode.removeChild(a)},unwrapTags:function(a,u){u.indexOf(a.nodeName.toLowerCase())!==-1&&e.util.unwrap(a,document)},getClosestTag:function(a,u){return l.traverseUp(a,function(c){return c.nodeName.toLowerCase()===u.toLowerCase()})},unwrap:function(a,u){for(var c=u.createDocumentFragment(),d=Array.prototype.slice.call(a.childNodes),h=0;h<d.length;h++)c.appendChild(d[h]);c.childNodes.length?a.parentNode.replaceChild(c,a):a.parentNode.removeChild(a)},guid:function(){function a(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()}};e.util=l})(window),(function(){var n=function(r){e.util.extend(this,r)};n.extend=function(r){var i=this,o;r&&r.hasOwnProperty("constructor")?o=r.constructor:o=function(){return i.apply(this,arguments)},e.util.extend(o,i);var s=function(){this.constructor=o};return s.prototype=i.prototype,o.prototype=new s,r&&e.util.extend(o.prototype,r),o},n.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(r){return this.base.options[r]}},["execAction","on","off","subscribe","trigger"].forEach(function(r){n.prototype[r]=function(){return this.base[r].apply(this.base,arguments)}}),e.Extension=n})(),(function(){function n(i){return e.util.isBlockContainer(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var r={findMatchingSelectionParent:function(i,o){var s=o.getSelection(),l,a;return s.rangeCount===0?!1:(l=s.getRangeAt(0),a=l.commonAncestorContainer,e.util.traverseUp(a,i))},getSelectionElement:function(i){return this.findMatchingSelectionParent(function(o){return e.util.isMediumEditorElement(o)},i)},exportSelection:function(i,o){if(!i)return null;var s=null,l=o.getSelection();if(l.rangeCount>0){var a=l.getRangeAt(0),u=a.cloneRange(),c;u.selectNodeContents(i),u.setEnd(a.startContainer,a.startOffset),c=u.toString().length,s={start:c,end:c+a.toString().length},this.doesRangeStartWithImages(a,o)&&(s.startsWithImage=!0);var d=this.getTrailingImageCount(i,s,a.endContainer,a.endOffset);if(d&&(s.trailingImageCount=d),c!==0){var h=this.getIndexRelativeToAdjacentEmptyBlocks(o,i,a.startContainer,a.startOffset);h!==-1&&(s.emptyBlocksIndex=h)}}return s},importSelection:function(i,o,s,l){if(!(!i||!o)){var a=s.createRange();a.setStart(o,0),a.collapse(!0);var u=o,c=[],d=0,h=!1,f=!1,v=0,b=!1,w,T=!1,P=null;for((l||i.startsWithImage||typeof i.emptyBlocksIndex!="undefined")&&(T=!0);!b&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!f)w=d+u.length,!h&&i.start>=d&&i.start<=w&&(T||i.start<w?(a.setStart(u,i.start-d),h=!0):P=u),h&&i.end>=d&&i.end<=w&&(i.trailingImageCount?f=!0:(a.setEnd(u,i.end-d),b=!0)),d=w;else{if(i.trailingImageCount&&f&&(u.nodeName.toLowerCase()==="img"&&v++,v===i.trailingImageCount)){for(var H=0;u.parentNode.childNodes[H]!==u;)H++;a.setEnd(u.parentNode,H+1),b=!0}if(!b&&u.nodeType===1)for(var G=u.childNodes.length-1;G>=0;)c.push(u.childNodes[G]),G-=1}b||(u=c.pop())}!h&&P&&(a.setStart(P,P.length),a.setEnd(P,P.length)),typeof i.emptyBlocksIndex!="undefined"&&(a=this.importSelectionMoveCursorPastBlocks(s,o,i.emptyBlocksIndex,a)),l&&(a=this.importSelectionMoveCursorPastAnchor(i,a)),this.selectRange(s,a)}},importSelectionMoveCursorPastAnchor:function(i,o){var s=function(d){return d.nodeName.toLowerCase()==="a"};if(i.start===i.end&&o.startContainer.nodeType===3&&o.startOffset===o.startContainer.nodeValue.length&&e.util.traverseUp(o.startContainer,s)){for(var l=o.startContainer,a=o.startContainer.parentNode;a!==null&&a.nodeName.toLowerCase()!=="a";)a.childNodes[a.childNodes.length-1]!==l?a=null:(l=a,a=a.parentNode);if(a!==null&&a.nodeName.toLowerCase()==="a"){for(var u=null,c=0;u===null&&c<a.parentNode.childNodes.length;c++)a.parentNode.childNodes[c]===a&&(u=c);o.setStart(a.parentNode,u+1),o.collapse(!0)}}return o},importSelectionMoveCursorPastBlocks:function(i,o,s,l){var a=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),u=l.startContainer,c,d,h=0;for(s=s||1,u.nodeType===3&&e.util.isBlockContainer(u.previousSibling)?c=u.previousSibling:c=e.util.getClosestBlockContainer(u);a.nextNode();)if(!d)c===a.currentNode&&(d=a.currentNode);else if(d=a.currentNode,h++,h===s||d.textContent.length>0)break;return d||(d=c),l.setStart(e.util.getFirstSelectableLeafNode(d),0),l},getIndexRelativeToAdjacentEmptyBlocks:function(i,o,s,l){if(s.textContent.length>0&&l>0)return-1;var a=s;if(a.nodeType!==3&&(a=s.childNodes[l]),a){if(!e.util.isElementAtBeginningOfBlock(a))return-1;var u=e.util.findPreviousSibling(a);if(u){if(u.nodeValue)return-1}else return-1}for(var c=e.util.getClosestBlockContainer(s),d=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),h=0;d.nextNode();){var f=d.currentNode.textContent==="";if((f||h>0)&&(h+=1),d.currentNode===c)return h;f||(h=0)}return h},doesRangeStartWithImages:function(i,o){if(i.startOffset!==0||i.startContainer.nodeType!==1)return!1;if(i.startContainer.nodeName.toLowerCase()==="img")return!0;var s=i.startContainer.querySelector("img");if(!s)return!1;for(var l=o.createTreeWalker(i.startContainer,NodeFilter.SHOW_ALL,null,!1);l.nextNode();){var a=l.currentNode;if(a===s)break;if(a.nodeValue)return!1}return!0},getTrailingImageCount:function(i,o,s,l){if(l===0||s.nodeType!==1||s.nodeName.toLowerCase()!=="img"&&!s.querySelector("img"))return 0;for(var a=s.childNodes[l-1];a.hasChildNodes();)a=a.lastChild;for(var u=i,c=[],d=0,h=!1,f=!1,v=!1,b,w=0;!v&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!f)w=0,b=d+u.length,!h&&o.start>=d&&o.start<=b&&(h=!0),h&&o.end>=d&&o.end<=b&&(f=!0),d=b;else if(u.nodeName.toLowerCase()==="img"&&w++,u===a)v=!0;else if(u.nodeType===1)for(var T=u.childNodes.length-1;T>=0;)c.push(u.childNodes[T]),T-=1;v||(u=c.pop())}return w},selectionContainsContent:function(i){var o=i.getSelection();if(!o||o.isCollapsed||!o.rangeCount)return!1;if(o.toString().trim()!=="")return!0;var s=this.getSelectedParentElement(o.getRangeAt(0));return!!(s&&(s.nodeName.toLowerCase()==="img"||s.nodeType===1&&s.querySelector("img")))},selectionInContentEditableFalse:function(i){var o,s=this.findMatchingSelectionParent(function(l){var a=l&&l.getAttribute("contenteditable");return a==="true"&&(o=!0),l.nodeName!=="#text"&&a==="false"},i);return!o&&s},getSelectionHtml:function(i){var o,s="",l=i.getSelection(),a,u;if(l.rangeCount){for(u=i.createElement("div"),o=0,a=l.rangeCount;o<a;o+=1)u.appendChild(l.getRangeAt(o).cloneContents());s=u.innerHTML}return s},getCaretOffsets:function(i,o){var s,l;return o||(o=window.getSelection().getRangeAt(0)),s=o.cloneRange(),l=o.cloneRange(),s.selectNodeContents(i),s.setEnd(o.endContainer,o.endOffset),l.selectNodeContents(i),l.setStart(o.endContainer,o.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(i){var o=i.startContainer;return o===i.endContainer&&o.hasChildNodes()&&i.endOffset===i.startOffset+1},getSelectedParentElement:function(i){return i?this.rangeSelectsSingleNode(i)&&i.startContainer.childNodes[i.startOffset].nodeType!==3?i.startContainer.childNodes[i.startOffset]:i.startContainer.nodeType===3?i.startContainer.parentNode:i.startContainer:null},getSelectedElements:function(i){var o=i.getSelection(),s,l,a;if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(s=o.getRangeAt(0),s.commonAncestorContainer.nodeType===3){for(l=[],a=s.commonAncestorContainer;a.parentNode&&a.parentNode.childNodes.length===1;)l.push(a.parentNode),a=a.parentNode;return l}return[].filter.call(s.commonAncestorContainer.getElementsByTagName("*"),function(u){return typeof o.containsNode=="function"?o.containsNode(u,!0):!0})},selectNode:function(i,o){var s=o.createRange();s.selectNodeContents(i),this.selectRange(o,s)},select:function(i,o,s,l,a){var u=i.createRange();return u.setStart(o,s),l?u.setEnd(l,a):u.collapse(!0),this.selectRange(i,u),u},clearSelection:function(i,o){o?i.getSelection().collapseToStart():i.getSelection().collapseToEnd()},moveCursor:function(i,o,s){this.select(i,o,s)},getSelectionRange:function(i){var o=i.getSelection();return o.rangeCount===0?null:o.getRangeAt(0)},selectRange:function(i,o){var s=i.getSelection();s.removeAllRanges(),s.addRange(o)},getSelectionStart:function(i){var o=i.getSelection().anchorNode,s=o&&o.nodeType===3?o.parentNode:o;return s}};e.selection=r})(),(function(){function n(i,o){return i?i.some(function(s){if(typeof s.getInteractionElements!="function")return!1;var l=s.getInteractionElements();return l?(Array.isArray(l)||(l=[l]),l.some(function(a){return e.util.isDescendant(a,o,!0)})):!1}):!1}var r=function(i){this.base=i,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};r.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(i,o,s,l){var a=this.base.options.contentWindow,u=this.base.options.ownerDocument;i=e.util.isElement(i)||[a,u].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,function(c){c.addEventListener(o,s,l),this.events.push([c,o,s,l])}.bind(this))},detachDOMEvent:function(i,o,s,l){var a,u,c=this.base.options.contentWindow,d=this.base.options.ownerDocument;i&&(i=e.util.isElement(i)||[c,d].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,function(h){a=this.indexOfListener(h,o,s,l),a!==-1&&(u=this.events.splice(a,1)[0],u[0].removeEventListener(u[1],u[2],u[3]))}.bind(this)))},indexOfListener:function(i,o,s,l){var a,u,c;for(a=0,u=this.events.length;a<u;a=a+1)if(c=this.events[a],c[0]===i&&c[1]===o&&c[2]===s&&c[3]===l)return a;return-1},detachAllDOMEvents:function(){for(var i=this.events.pop();i;)i[0].removeEventListener(i[1],i[2],i[3]),i=this.events.pop()},detachAllEventsFromElement:function(i){for(var o=this.events.filter(function(u){return u&&u[0].getAttribute&&u[0].getAttribute("medium-editor-index")===i.getAttribute("medium-editor-index")}),s=0,l=o.length;s<l;s++){var a=o[s];this.detachDOMEvent(a[0],a[1],a[2],a[3])}},attachAllEventsToElement:function(i){this.listeners.editableInput&&(this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(o){this.attachDOMEvent(i,o.name,o.handler.bind(this))},this)},enableCustomEvent:function(i){this.disabledEvents[i]!==void 0&&delete this.disabledEvents[i]},disableCustomEvent:function(i){this.disabledEvents[i]=!0},attachCustomEvent:function(i,o){this.setupListener(i),this.customEvents[i]||(this.customEvents[i]=[]),this.customEvents[i].push(o)},detachCustomEvent:function(i,o){var s=this.indexOfCustomListener(i,o);s!==-1&&this.customEvents[i].splice(s,1)},indexOfCustomListener:function(i,o){return!this.customEvents[i]||!this.customEvents[i].length?-1:this.customEvents[i].indexOf(o)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(i,o,s){this.customEvents[i]&&!this.disabledEvents[i]&&this.customEvents[i].forEach(function(l){l(o,s)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(i){i.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(i){this.handleDocumentExecCommand(i)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var i=this.options.ownerDocument;if(!(!this.execCommandListener||!i.execCommand.listeners)){var o=i.execCommand.listeners.indexOf(this.execCommandListener);o!==-1&&i.execCommand.listeners.splice(o,1),i.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var i=this.options.ownerDocument;if(!i.execCommand.listeners){var o=function(l,a){i.execCommand.listeners&&i.execCommand.listeners.forEach(function(u){u({command:l[0],value:l[2],args:l,result:a})})},s=function(){var l=i.execCommand.orig.apply(this,arguments);if(!i.execCommand.listeners)return l;var a=Array.prototype.slice.call(arguments);return o(a,l),l};s.orig=i.execCommand,s.listeners=[],s.callListeners=o,i.execCommand=s}},unwrapExecCommand:function(){var i=this.options.ownerDocument;i.execCommand.orig&&(i.execCommand=i.execCommand.orig)},setupListener:function(i){if(!this.listeners[i]){switch(i){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(o){this.contentCache[o.getAttribute("medium-editor-index")]=o.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[i]=!0}},attachToEachElement:function(i,o){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(s){this.attachDOMEvent(s,i,o.bind(this))},this),this.eventsCache.push({name:i,handler:o})},cleanupElement:function(i){var o=i.getAttribute("medium-editor-index");o&&(this.detachAllEventsFromElement(i),this.contentCache&&delete this.contentCache[o])},focusElement:function(i){i.focus(),this.updateFocus(i,{target:i,type:"focus"})},updateFocus:function(i,o){var s=this.base.getFocusedElement(),l;s&&o.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(s,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(l=s),l||this.base.elements.some(function(u){return!l&&e.util.isDescendant(u,i,!0)&&(l=u),!!l},this);var a=!e.util.isDescendant(s,i,!0)&&!n(this.base.extensions,i);l!==s&&(s&&a&&(s.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,s)),l&&(l.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,l))),a&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(i,o){if(this.contentCache){var s=i.getAttribute("medium-editor-index"),l=i.innerHTML;l!==this.contentCache[s]&&this.triggerCustomEvent("editableInput",o,i),this.contentCache[s]=l}},handleDocumentSelectionChange:function(i){if(i.currentTarget&&i.currentTarget.activeElement){var o=i.currentTarget.activeElement,s;this.base.elements.some(function(l){return e.util.isDescendant(l,o,!0)?(s=l,!0):!1},this),s&&this.updateInput(s,{target:o,currentTarget:s})}},handleDocumentExecCommand:function(){var i=this.base.getFocusedElement();i&&this.updateInput(i,{target:i,currentTarget:i})},handleBodyClick:function(i){this.updateFocus(i.target,i)},handleBodyFocus:function(i){this.updateFocus(i.target,i)},handleBodyMousedown:function(i){this.lastMousedownTarget=i.target},handleInput:function(i){this.updateInput(i.currentTarget,i)},handleClick:function(i){this.triggerCustomEvent("editableClick",i,i.currentTarget)},handleBlur:function(i){this.triggerCustomEvent("editableBlur",i,i.currentTarget)},handleKeypress:function(i){if(this.triggerCustomEvent("editableKeypress",i,i.currentTarget),this.keypressUpdateInput){var o={target:i.target,currentTarget:i.currentTarget};setTimeout(function(){this.updateInput(o.currentTarget,o)}.bind(this),0)}},handleKeyup:function(i){this.triggerCustomEvent("editableKeyup",i,i.currentTarget)},handleMouseover:function(i){this.triggerCustomEvent("editableMouseover",i,i.currentTarget)},handleDragging:function(i){this.triggerCustomEvent("editableDrag",i,i.currentTarget)},handleDrop:function(i){this.triggerCustomEvent("editableDrop",i,i.currentTarget)},handlePaste:function(i){this.triggerCustomEvent("editablePaste",i,i.currentTarget)},handleKeydown:function(i){if(this.triggerCustomEvent("editableKeydown",i,i.currentTarget),e.util.isKey(i,e.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.ENTER)||i.ctrlKey&&e.util.isKey(i,e.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",i,i.currentTarget);if(e.util.isKey(i,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",i,i.currentTarget)}},e.Events=r})(),(function(){var n=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(r){n.isBuiltInButton(r)?e.Extension.call(this,this.defaults[r]):e.Extension.call(this,r)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var r=this.document.createElement("button"),i=this.contentDefault,o=this.getAria(),s=this.getEditorOption("buttonLabels");return r.classList.add("medium-editor-action"),r.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(l){r.classList.add(l)}),r.setAttribute("data-action",this.getAction()),o&&(r.setAttribute("title",o),r.setAttribute("aria-label",o)),this.attrs&&Object.keys(this.attrs).forEach(function(l){r.setAttribute(l,this.attrs[l])},this),s==="fontawesome"&&this.contentFA&&(i=this.contentFA),r.innerHTML=i,r},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=this.getAction();i&&this.execAction(i)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var r=null;return this.useQueryState&&(r=this.base.queryCommandState(this.getAction())),r},isAlreadyApplied:function(r){var i=!1,o=this.getTagNames(),s,l;return this.knownState===!1||this.knownState===!0?this.knownState:(o&&o.length>0&&(i=o.indexOf(r.nodeName.toLowerCase())!==-1),!i&&this.style&&(s=this.style.value.split("|"),l=this.window.getComputedStyle(r,null).getPropertyValue(this.style.prop),s.forEach(function(a){this.knownState||(i=l.indexOf(a)!==-1,(i||this.style.prop!=="text-decoration")&&(this.knownState=i))},this)),i)}});n.isBuiltInButton=function(r){return typeof r=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(r)},e.extensions.button=n})(),(function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}})(),(function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.hideToolbarDefaultActions()},setToolbarPosition:function(){var r=this.base.getExtensionByName("toolbar");r&&r.setToolbarPosition()}});e.extensions.form=n})(),(function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=e.selection.getSelectionRange(this.document);return i.startContainer.nodeName.toLowerCase()==="a"||i.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(i),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(r){e.util.isKey(r,e.util.keyCode.K)&&e.util.isMetaCtrlKey(r)&&!r.shiftKey&&this.handleClick(r)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var r=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return r.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),r.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),r.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(r){var i=this.getInput(),o=this.getAnchorTargetCheckbox(),s=this.getAnchorButtonCheckbox();if(r=r||{value:""},typeof r=="string"&&(r={value:r}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),i.value=r.value,i.focus(),o&&(o.checked=r.target==="_blank"),s){var l=r.buttonClass?r.buttonClass.split(" "):[];s.checked=l.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var r=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox(),o={value:this.getInput().value.trim()};return this.linkValidation&&(o.value=this.checkLinkFormat(o.value)),o.target="_self",r&&r.checked&&(o.target="_blank"),i&&i.checked&&(o.buttonClass=this.customClassOption),o},doFormSave:function(){var r=this.getFormOpts();this.completeFormSave(r)},completeFormSave:function(r){this.base.restoreSelection(),this.execAction(this.action,r),this.base.checkSelection()},ensureEncodedUri:function(r){return r===decodeURI(r)?encodeURI(r):r},ensureEncodedUriComponent:function(r){return r===decodeURIComponent(r)?encodeURIComponent(r):r},ensureEncodedParam:function(r){var i=r.split("="),o=i[0],s=i[1];return o+(s===void 0?"":"="+this.ensureEncodedUriComponent(s))},ensureEncodedQuery:function(r){return r.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(r){var i=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,o=i.test(r),s="",l=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,a=r.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),u=a[1],c=a[2],d=a[3];if(l.test(r))return"tel:"+r;if(!o){var h=u.split("/")[0];(h.match(/.+(\.|:).+/)||h==="localhost")&&(s="http://")}return s+this.ensureEncodedUri(u)+(c===void 0?"":"?"+this.ensureEncodedQuery(c))+(d===void 0?"":"#"+d)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(r){var i=r.querySelector(".medium-editor-toolbar-close"),o=r.querySelector(".medium-editor-toolbar-save"),s=r.querySelector(".medium-editor-toolbar-input");this.on(r,"click",this.handleFormClick.bind(this)),this.on(s,"keyup",this.handleTextboxKeyup.bind(this)),this.on(i,"click",this.handleCloseClick.bind(this)),this.on(o,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var r=this.document,i=r.createElement("div");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),i.innerHTML=this.getTemplate(),this.attachFormEvents(i),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(r){if(r.keyCode===e.util.keyCode.ENTER){r.preventDefault(),this.doFormSave();return}r.keyCode===e.util.keyCode.ESCAPE&&(r.preventDefault(),this.doFormCancel())},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n})(),(function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var r=this.document.createElement("div");return r.id="medium-editor-anchor-preview-"+this.getEditorId(),r.className="medium-editor-anchor-preview",r.innerHTML=this.getTemplate(),this.on(r,"click",this.handleClick.bind(this)),r},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(r){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||r.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=r.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=r.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=r,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(r){r=r||this.activeAnchor;var i=this.window.innerWidth,o=this.anchorPreview.offsetHeight,s=r.getBoundingClientRect(),l=this.diffLeft,a=this.diffTop,u=this.getEditorOption("elementsContainer"),c=["absolute","fixed"].indexOf(window.getComputedStyle(u).getPropertyValue("position"))>-1,d={},h,f,v,b,w;h=this.anchorPreview.offsetWidth/2;var T=this.base.getExtensionByName("toolbar");T&&(l=T.diffLeft,a=T.diffTop),f=l-h,c?(b=u.getBoundingClientRect(),["top","left"].forEach(function(P){d[P]=s[P]-b[P]}),d.width=s.width,d.height=s.height,s=d,i=b.width,w=u.scrollTop):w=this.window.pageYOffset,v=s.left+s.width/2,w+=o+s.top+s.height-a-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(w)+"px",this.anchorPreview.style.right="initial",v<h?(this.anchorPreview.style.left=f+h+"px",this.anchorPreview.style.right="initial"):i-v<h?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=f+v+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(r){var i=this.base.getExtensionByName("anchor"),o=this.activeAnchor;i&&o&&(r.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(o){var s={value:o.attributes.href.value,target:o.getAttribute("target"),buttonClass:o.getAttribute("class")};i.showForm(s),o=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(r){var i=e.util.getClosestTag(r.target,"a");if(i!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(i.outerHTML)||/href=["']#\S+["']/.test(i.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==i&&this.detachPreviewHandlers(),this.anchorToPreview=i,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(r){(!r.relatedTarget||!/anchor-preview/.test(r.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var r=new Date().getTime()-this.lastOver;r>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n})(),(function(){var n,r,i,o,s;n=[" "," ",`
|
||
`,"\r"," "," "," "," "," ","\u2028","\u2029"],r="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",o=new RegExp("^("+r+")$","i"),s=new RegExp(i,"gi");function l(u){return!e.util.getClosestTag(u,"a")}var a=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var u=0,c=0;c<this.window._mediumEditors.length;c++){var d=this.window._mediumEditors[c];d!==null&&d.getExtensionByName("autoLink")!==void 0&&u++}return u===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(u,c){this.performLinking(c)},onKeypress:function(u){this.disableEventHandling||e.util.isKey(u,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var c=this.base.exportSelection();this.performLinking(u.target)&&this.base.importSelection(c,!0)}catch(d){window.console&&window.console.error("Failed to perform linking",d),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(u){var c=e.util.splitByBlockElements(u),d=!1;c.length===0&&(c=[u]);for(var h=0;h<c.length;h++)d=this.removeObsoleteAutoLinkSpans(c[h])||d,d=this.performLinkingWithinElement(c[h])||d;return this.base.events.updateInput(u,{target:u,currentTarget:u}),d},removeObsoleteAutoLinkSpans:function(u){if(!u||u.nodeType===3)return!1;for(var c=u.querySelectorAll('span[data-auto-link="true"]'),d=!1,h=0;h<c.length;h++){var f=c[h].textContent;if(f.indexOf("://")===-1&&(f=e.util.ensureUrlHasProtocol(f)),c[h].getAttribute("data-href")!==f&&l(c[h])){d=!0;var v=f.replace(/\s+$/,"");if(c[h].getAttribute("data-href")===v){var b=f.length-v.length,w=e.util.splitOffDOMTree(c[h],this.splitTextBeforeEnd(c[h],b));c[h].parentNode.insertBefore(w,c[h].nextSibling)}else e.util.unwrap(c[h],this.document)}}return d},splitTextBeforeEnd:function(u,c){for(var d=this.document.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,!1),h=!0;h;)h=d.lastChild()!==null;for(var f,v,b;c>0&&b!==null;)f=d.currentNode,v=f.nodeValue,v.length>c?(b=f.splitText(v.length-c),c=0):(b=d.previousNode(),c-=v.length);return b},performLinkingWithinElement:function(u){for(var c=this.findLinkableText(u),d=!1,h=0;h<c.length;h++){var f=e.util.findOrCreateMatchingTextNodes(this.document,u,c[h]);this.shouldNotLink(f)||this.createAutoLink(f,c[h].href)}return d},shouldNotLink:function(u){for(var c=!1,d=0;d<u.length&&c===!1;d++)c=!!e.util.traverseUp(u[d],function(h){return h.nodeName.toLowerCase()==="a"||h.getAttribute&&h.getAttribute("data-auto-link")==="true"});return c},findLinkableText:function(u){for(var c=u.textContent,d=null,h=[];(d=s.exec(c))!==null;){var f=!0,v=d.index+d[0].length;f=(d.index===0||n.indexOf(c[d.index-1])!==-1)&&(v===c.length||n.indexOf(c[v])!==-1),f=f&&(d[0].indexOf("/")!==-1||o.test(d[0].split(".").pop().split("?").shift())),f&&h.push({href:d[0],start:d.index,end:v})}return h},createAutoLink:function(u,c){c=e.util.ensureUrlHasProtocol(c);var d=e.util.createLink(this.document,u,c,this.getEditorOption("targetBlank")?"_blank":null),h=this.document.createElement("span");for(h.setAttribute("data-auto-link","true"),h.setAttribute("data-href",c),d.insertBefore(h,d.firstChild);d.childNodes.length>1;)h.appendChild(d.childNodes[1])}});e.extensions.autoLink=a})(),(function(){var n="medium-editor-dragover";function r(o){var s=e.util.getContainerEditorElement(o),l=Array.prototype.slice.call(s.parentElement.querySelectorAll("."+n));l.forEach(function(a){a.classList.remove(n)})}var i=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){o.preventDefault(),o.dataTransfer.dropEffect="copy";var s=o.target.classList?o.target:o.target.parentElement;r(s),o.type==="dragover"&&s.classList.add(n)},handleDrop:function(o){o.preventDefault(),o.stopPropagation(),this.base.selectElement(o.target);var s=this.base.exportSelection();s.start=s.end,this.base.importSelection(s),o.dataTransfer.files&&Array.prototype.slice.call(o.dataTransfer.files).forEach(function(l){this.isAllowedFile(l)&&l.type.match("image")&&this.insertImageFile(l)},this),r(o.target)},isAllowedFile:function(o){return this.allowedTypes.some(function(s){return!!o.type.match(s)})},insertImageFile:function(o){if(typeof FileReader=="function"){var s=new FileReader;s.readAsDataURL(o),s.addEventListener("load",function(l){var a=this.document.createElement("img");a.src=l.target.result,e.util.insertHTMLCommand(this.document,a.outerHTML)}.bind(this))}}});e.extensions.fileDragging=i})(),(function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(r){var i=r.key.charCodeAt(0);this.keys[i]||(this.keys[i]=[]),this.keys[i].push(r)},this)},handleKeydown:function(r){var i=e.util.getKeyCode(r);if(this.keys[i]){var o=e.util.isMetaCtrlKey(r),s=!!r.shiftKey,l=!!r.altKey;this.keys[i].forEach(function(a){a.meta===o&&a.shift===s&&(a.alt===l||a.alt===void 0)&&(r.preventDefault(),r.stopPropagation(),typeof a.command=="function"?a.command.apply(this):a.command!==!1&&this.execAction(a.command))},this)}}});e.extensions.keyboardCommands=n})(),(function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontName")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(r){var i=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("select"),s=r.createElement("a"),l=r.createElement("a"),a;i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this));for(var u=0;u<this.fonts.length;u++)a=r.createElement("option"),a.innerHTML=this.fonts[u],a.value=this.fonts[u],o.appendChild(a);return o.className="medium-editor-toolbar-select",i.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),l.setAttribute("href","#"),l.className="medium-editor-toobar-save",l.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",i.appendChild(l),this.on(l,"click",this.handleSaveClick.bind(this),!0),s.setAttribute("href","#"),s.className="medium-editor-toobar-close",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",i.appendChild(s),this.on(s,"click",this.handleCloseClick.bind(this)),i},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("face")&&r.removeAttribute("face")})},handleFontChange:function(){var r=this.getSelect().value;r===""?this.clearFontName():this.execAction("fontName",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n})(),(function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontSize")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(r){var i=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("input"),s=r.createElement("a"),l=r.createElement("a");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this)),o.setAttribute("type","range"),o.setAttribute("min","1"),o.setAttribute("max","7"),o.className="medium-editor-toolbar-input",i.appendChild(o),this.on(o,"change",this.handleSliderChange.bind(this)),l.setAttribute("href","#"),l.className="medium-editor-toobar-save",l.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",i.appendChild(l),this.on(l,"click",this.handleSaveClick.bind(this),!0),s.setAttribute("href","#"),s.className="medium-editor-toobar-close",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",i.appendChild(s),this.on(s,"click",this.handleCloseClick.bind(this)),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("size")&&r.removeAttribute("size")})},handleSliderChange:function(){var r=this.getInput().value;r==="4"?this.clearFontSize():this.execAction("fontSize",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n})(),(function(){var n="%ME_PASTEBIN%",r=null,i=null,o=function(u){u.stopPropagation()};function s(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function l(u,c,d){var h=u.clipboardData||c.clipboardData||d.dataTransfer,f={};if(!h)return f;if(h.getData){var v=h.getData("Text");v&&v.length>0&&(f["text/plain"]=v)}if(h.types)for(var b=0;b<h.types.length;b++){var w=h.types[b];f[w]=h.getData(w)}return f}var a=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(u){this.on(u,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(u,c){this.on(c,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(u,c){if(!u.defaultPrevented){var d=l(u,this.window,this.document),h=d["text/html"],f=d["text/plain"];this.window.clipboardData&&u.clipboardData===void 0&&!h&&(h=f),(h||f)&&(u.preventDefault(),this.doPaste(h,f,c))}},doPaste:function(u,c,d){var h,f="",v;if(this.cleanPastedHTML&&u)return this.cleanPaste(u);if(c){if(this.getEditorOption("disableReturn")||d&&d.getAttribute("data-disable-return"))f=e.util.htmlEntities(c);else if(h=c.split(/[\r\n]+/g),h.length>1)for(v=0;v<h.length;v+=1)h[v]!==""&&(f+="<p>"+e.util.htmlEntities(h[v])+"</p>");else f=e.util.htmlEntities(h[0]);e.util.insertHTMLCommand(this.document,f)}},handlePasteBinPaste:function(u){if(u.defaultPrevented){this.removePasteBin();return}var c=l(u,this.window,this.document),d=c["text/html"],h=c["text/plain"],f=i;if(!this.cleanPastedHTML||d){u.preventDefault(),this.removePasteBin(),this.doPaste(d,h,f),this.trigger("editablePaste",{currentTarget:f,target:f},f);return}setTimeout(function(){this.cleanPastedHTML&&(d=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(d,h,f),this.trigger("editablePaste",{currentTarget:f,target:f},f)}.bind(this),0)},handleKeydown:function(u,c){e.util.isKey(u,e.util.keyCode.V)&&e.util.isMetaCtrlKey(u)&&(u.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(c))},createPasteBin:function(u){var c,d=e.selection.getSelectionRange(this.document),h=this.window.pageYOffset;i=u,d&&(c=d.getClientRects(),c.length?h+=c[0].top:d.startContainer.getBoundingClientRect!==void 0?h+=d.startContainer.getBoundingClientRect().top:h+=d.getBoundingClientRect().top),r=d;var f=this.document.createElement("div");f.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),f.setAttribute("style","border: 1px red solid; position: absolute; top: "+h+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),f.setAttribute("contentEditable",!0),f.innerHTML=n,this.document.body.appendChild(f),this.on(f,"focus",o),this.on(f,"focusin",o),this.on(f,"focusout",o),f.focus(),e.selection.selectNode(f,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(f,"paste",this.boundHandlePaste)},removePasteBin:function(){r!==null&&(e.selection.selectRange(this.document,r),r=null),i!==null&&(i=null);var u=this.getPasteBin();u&&u&&(this.off(u,"focus",o),this.off(u,"focusin",o),this.off(u,"focusout",o),this.off(u,"paste",this.boundHandlePaste),u.parentElement.removeChild(u))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var u=this.getPasteBin();if(!u||u.firstChild&&u.firstChild.id==="mcepastebin")return!1;var c=u.innerHTML;return!c||c===n?!1:c},cleanPaste:function(u){var c,d,h,f,v=/<p|<br|<div/.test(u),b=[].concat(this.preCleanReplacements||[],s(),this.cleanReplacements||[]);for(c=0;c<b.length;c+=1)u=u.replace(b[c][0],b[c][1]);if(!v)return this.pasteHTML(u);for(h=this.document.createElement("div"),h.innerHTML="<p>"+u.split("<br><br>").join("</p><p>")+"</p>",d=h.querySelectorAll("a,p,div,br"),c=0;c<d.length;c+=1)switch(f=d[c],f.innerHTML=f.innerHTML.replace(/\n/gi," "),f.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(f);break;case"br":this.filterLineBreak(f);break}this.pasteHTML(h.innerHTML)},pasteHTML:function(u,c){c=e.util.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var d,h,f,v,b=this.document.createDocumentFragment();for(b.appendChild(this.document.createElement("body")),v=b.querySelector("body"),v.innerHTML=u,this.cleanupSpans(v),d=v.querySelectorAll("*"),f=0;f<d.length;f+=1)h=d[f],h.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(h),e.util.cleanupAttrs(h,c.cleanAttrs),e.util.cleanupTags(h,c.cleanTags),e.util.unwrapTags(h,c.unwrapTags);e.util.insertHTMLCommand(this.document,v.innerHTML.replace(/ /g," "))},isCommonBlock:function(u){return u&&(u.nodeName.toLowerCase()==="p"||u.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(u){/^\s*$/.test(u.textContent)&&u.parentNode&&u.parentNode.removeChild(u)},filterLineBreak:function(u){this.isCommonBlock(u.previousElementSibling)?this.removeWithParent(u):this.isCommonBlock(u.parentNode)&&(u.parentNode.firstChild===u||u.parentNode.lastChild===u)?this.removeWithParent(u):u.parentNode&&u.parentNode.childElementCount===1&&u.parentNode.textContent===""&&this.removeWithParent(u)},removeWithParent:function(u){u&&u.parentNode&&(u.parentNode.parentNode&&u.parentNode.childElementCount===1?u.parentNode.parentNode.removeChild(u.parentNode):u.parentNode.removeChild(u))},cleanupSpans:function(u){var c,d,h,f=u.querySelectorAll(".replace-with"),v=function(b){return b&&b.nodeName!=="#text"&&b.getAttribute("contenteditable")==="false"};for(c=0;c<f.length;c+=1)d=f[c],h=this.document.createElement(d.classList.contains("bold")?"b":"i"),d.classList.contains("bold")&&d.classList.contains("italic")?h.innerHTML="<i>"+d.innerHTML+"</i>":h.innerHTML=d.innerHTML,d.parentNode.replaceChild(h,d);for(f=u.querySelectorAll("span"),c=0;c<f.length;c+=1){if(d=f[c],e.util.traverseUp(d,v))return!1;e.util.unwrap(d,this.document)}}});e.extensions.paste=a})(),(function(){var n=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(r,i){this.initElement(i)},initElement:function(r){r.getAttribute("data-placeholder")||r.setAttribute("data-placeholder",this.text),this.updatePlaceholder(r)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(r,i){this.cleanupElement(i)},cleanupElement:function(r){r.getAttribute("data-placeholder")===this.text&&r.removeAttribute("data-placeholder")},showPlaceholder:function(r){r&&(e.util.isFF&&r.childNodes.length===0?(r.classList.add("medium-editor-placeholder-relative"),r.classList.remove("medium-editor-placeholder")):(r.classList.add("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(r){r&&(r.classList.remove("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(r,i){if(r.querySelector("img, blockquote, ul, ol, table")||r.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(r);i||this.showPlaceholder(r)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(r,i){var o=this.hideOnClick&&i===this.base.getFocusedElement();this.updatePlaceholder(i,o)},handleFocus:function(r,i){this.hidePlaceholder(i)},handleBlur:function(r,i){this.updatePlaceholder(i)}});e.extensions.placeholder=n})(),(function(){var n=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(r,i){return this.base.extensions.forEach(function(o){if(o!==this)return r.apply(i||this,arguments)},this)},createToolbar:function(){var r=this.document.createElement("div");return r.id="medium-editor-toolbar-"+this.getEditorId(),r.className="medium-editor-toolbar",this.static?r.className+=" static-toolbar":this.relativeContainer?r.className+=" medium-editor-relative-toolbar":r.className+=" medium-editor-stalker-toolbar",r.appendChild(this.createToolbarButtons()),this.forEachExtension(function(i){i.hasForm&&r.appendChild(i.getForm())}),this.attachEventHandlers(),r},createToolbarButtons:function(){var r=this.document.createElement("ul"),i,o,s,l,a,u;return r.id="medium-editor-toolbar-actions"+this.getEditorId(),r.className="medium-editor-toolbar-actions",r.style.display="block",this.buttons.forEach(function(c){typeof c=="string"?(a=c,u=null):(a=c.name,u=c),l=this.base.addBuiltInExtension(a,u),l&&typeof l.getButton=="function"&&(o=l.getButton(this.base),i=this.document.createElement("li"),e.util.isElement(o)?i.appendChild(o):i.innerHTML=o,r.appendChild(i))},this),s=r.querySelectorAll("button"),s.length>0&&(s[0].classList.add(this.firstButtonClass),s[s.length-1].classList.add(this.lastButtonClass)),r},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(r){if(r&&r.target&&e.util.isDescendant(this.getToolbarElement(),r.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension(function(r){r.hasForm&&r.isDisplayed()&&r.hideForm()})},multipleBlockElementsSelected:function(){var r=/<[^\/>][^>]*><\/[^>]+>/gim,i=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),o=e.selection.getSelectionHtml(this.document).replace(r,""),s=o.match(i);return!!s&&s.length>1},modifySelection:function(){var r=this.window.getSelection(),i=r.getRangeAt(0);if(this.standardizeSelectionStart&&i.startContainer.nodeValue&&i.startOffset===i.startContainer.nodeValue.length){var o=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),i.startContainer,this.document);if(o){for(var s=0;o.nodeValue.substr(s,1).trim().length===0;)s=s+1;i=e.selection.select(this.document,o,s,i.endContainer,i.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var r=e.selection.getSelectionElement(this.window);if(!r||this.getEditorElements().indexOf(r)===-1||r.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(r){typeof r.isActive=="function"&&typeof r.setInactive=="function"&&r.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var r=[],i=null,o=e.selection.getSelectionRange(this.document),s,l=function(a){typeof a.checkState=="function"?a.checkState(s):typeof a.isActive=="function"&&typeof a.isAlreadyApplied=="function"&&typeof a.setActive=="function"&&!a.isActive()&&a.isAlreadyApplied(s)&&a.setActive()};if(o&&(this.forEachExtension(function(a){if(typeof a.queryCommandState=="function"&&(i=a.queryCommandState(),i!==null)){i&&typeof a.setActive=="function"&&a.setActive();return}r.push(a)}),s=e.selection.getSelectedParentElement(o),!!this.getEditorElements().some(function(a){return e.util.isDescendant(a,s,!0)})))for(;s&&(r.forEach(l),!e.util.isMediumEditorElement(s));)s=s.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var r=this.base.getFocusedElement(),i=this.window.getSelection();if(!r)return this;(this.static||!i.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(r):this.positionToolbar(i)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(r){this.getToolbarElement().style.left="0";var i=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,s=this.getToolbarElement(),l=r.getBoundingClientRect(),a=l.top+i,u=l.left+l.width/2,c=s.offsetHeight,d=s.offsetWidth,h=d/2,f;switch(this.sticky?i>a+r.offsetHeight-c-this.stickyTopOffset?(s.style.top=a+r.offsetHeight-c+"px",s.classList.remove("medium-editor-sticky-toolbar")):i>a-c-this.stickyTopOffset?(s.classList.add("medium-editor-sticky-toolbar"),s.style.top=this.stickyTopOffset+"px"):(s.classList.remove("medium-editor-sticky-toolbar"),s.style.top=a-c+"px"):s.style.top=a-c+"px",this.align){case"left":f=l.left;break;case"right":f=l.right-d;break;case"center":f=u-h;break}f<0?f=0:f+d>o&&(f=o-Math.ceil(d)-1),s.style.left=f+"px"},positionToolbar:function(r){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var i=r.getRangeAt(0),o=i.getBoundingClientRect();(!o||o.height===0&&o.width===0&&i.startContainer===i.endContainer)&&(i.startContainer.nodeType===1&&i.startContainer.querySelector("img")?o=i.startContainer.querySelector("img").getBoundingClientRect():o=i.startContainer.getBoundingClientRect());var s=this.window.innerWidth,l=this.getToolbarElement(),a=l.offsetHeight,u=l.offsetWidth,c=u/2,d=50,h=this.diffLeft-c,f=this.getEditorOption("elementsContainer"),v=["absolute","fixed"].indexOf(window.getComputedStyle(f).getPropertyValue("position"))>-1,b={},w={},T,P;v?(P=f.getBoundingClientRect(),["top","left"].forEach(function(H){w[H]=o[H]-P[H]}),w.width=o.width,w.height=o.height,o=w,s=P.width,b.top=f.scrollTop):b.top=this.window.pageYOffset,T=o.left+o.width/2,b.top+=o.top-a,o.top<d?(l.classList.add("medium-toolbar-arrow-over"),l.classList.remove("medium-toolbar-arrow-under"),b.top+=d+o.height-this.diffTop):(l.classList.add("medium-toolbar-arrow-under"),l.classList.remove("medium-toolbar-arrow-over"),b.top+=this.diffTop),T<c?(b.left=h+c,b.right="initial"):s-T<c?(b.left="auto",b.right=0):(b.left=h+T,b.right="initial"),["top","left","right"].forEach(function(H){l.style[H]=b[H]+(isNaN(b[H])?"":"px")})}});e.extensions.toolbar=n})(),(function(){var n=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(r){var i="medium-editor-dragover";r.preventDefault(),r.dataTransfer.dropEffect="copy",r.type==="dragover"?r.target.classList.add(i):r.type==="dragleave"&&r.target.classList.remove(i)},handleDrop:function(r){var i="medium-editor-dragover",o;r.preventDefault(),r.stopPropagation(),r.dataTransfer.files&&(o=Array.prototype.slice.call(r.dataTransfer.files,0),o.some(function(s){if(s.type.match("image")){var l,a;l=new FileReader,l.readAsDataURL(s),a="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+a+'" />'),l.onload=function(){var u=this.document.getElementById(a);u&&(u.removeAttribute("id"),u.removeAttribute("class"),u.src=l.result)}.bind(this)}}.bind(this))),r.target.classList.remove(i)}});e.extensions.imageDragging=n})(),(function(){function n(x){var O=e.selection.getSelectionStart(this.options.ownerDocument),R=O.textContent,q=e.selection.getCaretOffsets(O);(R[q.left-1]===void 0||R[q.left-1].trim()===""||R[q.left]!==void 0&&R[q.left].trim()==="")&&x.preventDefault()}function r(x,O){if(this.options.disableReturn||O.getAttribute("data-disable-return"))x.preventDefault();else if(this.options.disableDoubleReturn||O.getAttribute("data-disable-double-return")){var R=e.selection.getSelectionStart(this.options.ownerDocument);(R&&R.textContent.trim()===""&&R.nodeName.toLowerCase()!=="li"||R.previousElementSibling&&R.previousElementSibling.nodeName.toLowerCase()!=="br"&&R.previousElementSibling.textContent.trim()==="")&&x.preventDefault()}}function i(x){var O=e.selection.getSelectionStart(this.options.ownerDocument),R=O&&O.nodeName.toLowerCase();R==="pre"&&(x.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(O)&&(x.preventDefault(),x.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(x){var O,R=e.selection.getSelectionStart(this.options.ownerDocument),q=R.nodeName.toLowerCase(),me=/^(\s+|<br\/?>)?$/i,we=/h\d/i;e.util.isKey(x,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&R.previousElementSibling&&we.test(q)&&e.selection.getCaretOffsets(R).left===0?e.util.isKey(x,e.util.keyCode.BACKSPACE)&&me.test(R.previousElementSibling.innerHTML)?(R.previousElementSibling.parentNode.removeChild(R.previousElementSibling),x.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(x,e.util.keyCode.ENTER)&&(O=this.options.ownerDocument.createElement("p"),O.innerHTML="<br>",R.previousElementSibling.parentNode.insertBefore(O,R),x.preventDefault()):e.util.isKey(x,e.util.keyCode.DELETE)&&R.nextElementSibling&&R.previousElementSibling&&!we.test(q)&&me.test(R.innerHTML)&&we.test(R.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,R.nextElementSibling),R.previousElementSibling.parentNode.removeChild(R),x.preventDefault()):e.util.isKey(x,e.util.keyCode.BACKSPACE)&&q==="li"&&me.test(R.innerHTML)&&!R.previousElementSibling&&!R.parentElement.previousElementSibling&&R.nextElementSibling&&R.nextElementSibling.nodeName.toLowerCase()==="li"?(O=this.options.ownerDocument.createElement("p"),O.innerHTML="<br>",R.parentElement.parentElement.insertBefore(O,R.parentElement),e.selection.moveCursor(this.options.ownerDocument,O),R.parentElement.removeChild(R),x.preventDefault()):e.util.isKey(x,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(R,"blockquote")!==!1&&e.selection.getCaretOffsets(R).left===0?(x.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(x,e.util.keyCode.ENTER)&&e.util.getClosestTag(R,"blockquote")!==!1&&e.selection.getCaretOffsets(R).right===0?(O=this.options.ownerDocument.createElement("p"),O.innerHTML="<br>",R.parentElement.insertBefore(O,R.nextSibling),e.selection.moveCursor(this.options.ownerDocument,O),x.preventDefault()):e.util.isKey(x,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(R.parentElement)&&!R.previousElementSibling&&R.nextElementSibling&&me.test(R.innerHTML)&&(x.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,R.nextSibling),R.parentElement.removeChild(R))}function s(x){var O=e.selection.getSelectionStart(this.options.ownerDocument),R;O&&(e.util.isMediumEditorElement(O)&&O.children.length===0&&!e.util.isBlockContainer(O)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(x,e.util.keyCode.ENTER)&&!e.util.isListItem(O)&&!e.util.isBlockContainer(O)&&(R=O.nodeName.toLowerCase(),R==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!x.shiftKey&&!x.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function l(x,O){var R=O.parentNode.querySelector('textarea[medium-editor-textarea-id="'+O.getAttribute("medium-editor-textarea-id")+'"]');R&&(R.value=O.innerHTML.trim())}function a(x){x._mediumEditors||(x._mediumEditors=[null]),this.id||(this.id=x._mediumEditors.length),x._mediumEditors[this.id]=this}function u(x){!x._mediumEditors||!x._mediumEditors[this.id]||(x._mediumEditors[this.id]=null)}function c(x,O,R){var q=[];if(x||(x=[]),typeof x=="string"&&(x=O.querySelectorAll(x)),e.util.isElement(x)&&(x=[x]),R)for(var me=0;me<x.length;me++){var we=x[me];e.util.isElement(we)&&!we.getAttribute("data-medium-editor-element")&&!we.getAttribute("medium-editor-textarea-id")&&q.push(we)}else q=Array.prototype.slice.apply(x);return q}function d(x){var O=x.parentNode.querySelector('textarea[medium-editor-textarea-id="'+x.getAttribute("medium-editor-textarea-id")+'"]');O&&(O.classList.remove("medium-editor-hidden"),O.removeAttribute("medium-editor-textarea-id")),x.parentNode&&x.parentNode.removeChild(x)}function h(x,O){return Object.keys(O).forEach(function(R){x[R]===void 0&&(x[R]=O[R])}),x}function f(x,O,R){var q={window:R.options.contentWindow,document:R.options.ownerDocument,base:R};return x=h(x,q),typeof x.init=="function"&&x.init(),x.name||(x.name=O),x}function v(){return this.elements.every(function(x){return!!x.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function b(){return v.call(this)?this.options.anchorPreview!==!1:!1}function w(){return this.options.placeholder!==!1}function T(){return this.options.autoLink!==!1}function P(){return this.options.imageDragging!==!1}function H(){return this.options.keyboardCommands!==!1}function G(){return!this.options.extensions.imageDragging}function se(x){for(var O=this.options.ownerDocument.createElement("div"),R=Date.now(),q="medium-editor-"+R,me=x.attributes;this.options.ownerDocument.getElementById(q);)R++,q="medium-editor-"+R;O.className=x.className,O.id=q,O.innerHTML=x.value,x.setAttribute("medium-editor-textarea-id",q);for(var we=0,et=me.length;we<et;we++)O.hasAttribute(me[we].nodeName)||O.setAttribute(me[we].nodeName,me[we].value);return x.form&&this.on(x.form,"reset",function(Ye){Ye.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(q))}.bind(this)),x.classList.add("medium-editor-hidden"),x.parentNode.insertBefore(O,x),O}function U(x,O){if(!x.getAttribute("data-medium-editor-element")){x.nodeName.toLowerCase()==="textarea"&&(x=se.call(this,x),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=l.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!x.getAttribute("data-disable-editing")&&(x.setAttribute("contentEditable",!0),x.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(x.getAttribute("data-disable-return")||x.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!x.getAttribute("data-disable-return")&&this.on(x,"keyup",s.bind(this));var R=e.util.guid();x.setAttribute("data-medium-editor-element",!0),x.classList.add("medium-editor-element"),x.setAttribute("role","textbox"),x.setAttribute("aria-multiline",!0),x.setAttribute("data-medium-editor-editor-index",O),x.setAttribute("medium-editor-index",R),yt[R]=x.innerHTML,this.events.attachAllEventsToElement(x)}return x}function D(){this.subscribe("editableKeydownTab",i.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",n.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function he(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(me){me!=="toolbar"&&this.options.extensions[me]&&this.extensions.push(f(this.options.extensions[me],me,this))},this),G.call(this)){var x=this.options.fileDragging;x||(x={},P.call(this)||(x.allowedTypes=[])),this.addBuiltInExtension("fileDragging",x)}var O={paste:!0,"anchor-preview":b.call(this),autoLink:T.call(this),keyboardCommands:H.call(this),placeholder:w.call(this)};Object.keys(O).forEach(function(me){O[me]&&this.addBuiltInExtension(me)},this);var R=this.options.extensions.toolbar;if(!R&&v.call(this)){var q=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});R=new e.extensions.toolbar(q)}R&&this.extensions.push(f(R,"toolbar",this))}function Q(x,O){var R=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return O&&R.forEach(function(q){O.hasOwnProperty(q[0])&&O[q[0]]!==void 0&&e.util.deprecated(q[0],q[1],"v6.0.0")}),e.util.defaults({},O,x)}function Ze(x,O){var R=/^append-(.+)$/gi,q=/justify([A-Za-z]*)$/g,me,we;if(me=R.exec(x),me)return e.util.execFormatBlock(this.options.ownerDocument,me[1]);if(x==="fontSize")return O.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),we=O.value||O.size,this.options.ownerDocument.execCommand("fontSize",!1,we);if(x==="fontName")return O.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),we=O.value||O.name,this.options.ownerDocument.execCommand("fontName",!1,we);if(x==="createLink")return this.createLink(O);if(x==="image"){var et=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,et)}if(x==="html"){var Ye=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,Ye)}if(q.exec(x)){var Pt=this.options.ownerDocument.execCommand(x,!1,null),Ft=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return Ft&&Xe.call(this,e.util.getTopBlockContainer(Ft)),Pt}return we=O&&O.value,this.options.ownerDocument.execCommand(x,!1,we)}function Xe(x){if(x){var O,R=Array.prototype.slice.call(x.childNodes).filter(function(q){var me=q.nodeName.toLowerCase()==="div";return me&&!O&&(O=q.style.textAlign),me});R.length&&(this.saveSelection(),R.forEach(function(q){if(q.style.textAlign===O){var me=q.lastChild;if(me){e.util.unwrap(q,this.options.ownerDocument);var we=this.options.ownerDocument.createElement("BR");me.parentNode.insertBefore(we,me.nextSibling)}}},this),x.style.textAlign=O,this.restoreSelection())}}var yt={};e.prototype={init:function(x,O){return this.options=Q.call(this,this.defaults,O),this.origElements=x,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(a.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,he.call(this),D.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(x){typeof x.destroy=="function"&&x.destroy()},this),this.events.destroy(),this.elements.forEach(function(x){this.options.spellcheck&&(x.innerHTML=x.innerHTML),x.removeAttribute("contentEditable"),x.removeAttribute("spellcheck"),x.removeAttribute("data-medium-editor-element"),x.classList.remove("medium-editor-element"),x.removeAttribute("role"),x.removeAttribute("aria-multiline"),x.removeAttribute("medium-editor-index"),x.removeAttribute("data-medium-editor-editor-index"),x.getAttribute("medium-editor-textarea-id")&&d(x)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,u.call(this,this.options.contentWindow))},on:function(x,O,R,q){return this.events.attachDOMEvent(x,O,R,q),this},off:function(x,O,R,q){return this.events.detachDOMEvent(x,O,R,q),this},subscribe:function(x,O){return this.events.attachCustomEvent(x,O),this},unsubscribe:function(x,O){return this.events.detachCustomEvent(x,O),this},trigger:function(x,O,R){return this.events.triggerCustomEvent(x,O,R),this},delay:function(x){var O=this;return setTimeout(function(){O.isActive&&x()},this.options.delay)},serialize:function(){var x,O,R={},q=this.elements.length;for(x=0;x<q;x+=1)O=this.elements[x].id!==""?this.elements[x].id:"element-"+x,R[O]={value:this.elements[x].innerHTML.trim()};return R},getExtensionByName:function(x){var O;return this.extensions&&this.extensions.length&&this.extensions.some(function(R){return R.name===x?(O=R,!0):!1}),O},addBuiltInExtension:function(x,O){var R=this.getExtensionByName(x),q;if(R)return R;switch(x){case"anchor":q=e.util.extend({},this.options.anchor,O),R=new e.extensions.anchor(q);break;case"anchor-preview":R=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":R=new e.extensions.autoLink;break;case"fileDragging":R=new e.extensions.fileDragging(O);break;case"fontname":R=new e.extensions.fontName(this.options.fontName);break;case"fontsize":R=new e.extensions.fontSize(O);break;case"keyboardCommands":R=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":R=new e.extensions.paste(this.options.paste);break;case"placeholder":R=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(x)&&(O?(q=e.util.defaults({},O,e.extensions.button.prototype.defaults[x]),R=new e.extensions.button(q)):R=new e.extensions.button(x))}return R&&this.extensions.push(f(R,x,this)),R},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var x=this.getExtensionByName("toolbar");return x&&x.checkState(),this},queryCommandState:function(x){var O=/^full-(.+)$/gi,R,q=null;R=O.exec(x),R&&(x=R[1]);try{q=this.options.ownerDocument.queryCommandState(x)}catch(me){q=null}return q},execAction:function(x,O){var R=/^full-(.+)$/gi,q,me;return q=R.exec(x),q?(this.saveSelection(),this.selectAllContents(),me=Ze.call(this,q[1],O),this.restoreSelection()):me=Ze.call(this,x,O),(x==="insertunorderedlist"||x==="insertorderedlist")&&e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),me},getSelectedParentElement:function(x){return x===void 0&&(x=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(x)},selectAllContents:function(){var x=e.selection.getSelectionElement(this.options.contentWindow);if(x){for(;x.children.length===1;)x=x.children[0];this.selectElement(x)}},selectElement:function(x){e.selection.selectNode(x,this.options.ownerDocument);var O=e.selection.getSelectionElement(this.options.contentWindow);O&&this.events.focusElement(O)},getFocusedElement:function(){var x;return this.elements.some(function(O){return!x&&O.getAttribute("data-medium-focused")&&(x=O),!!x},this),x},exportSelection:function(){var x=e.selection.getSelectionElement(this.options.contentWindow),O=this.elements.indexOf(x),R=null;return O>=0&&(R=e.selection.exportSelection(x,this.options.ownerDocument)),R!==null&&O!==0&&(R.editableElementIndex=O),R},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(x,O){if(x){var R=this.elements[x.editableElementIndex||0];e.selection.importSelection(x,R,this.options.ownerDocument,O)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(x){var O=e.selection.getSelectionElement(this.options.contentWindow),R={},q;if(this.elements.indexOf(O)!==-1){try{if(this.events.disableCustomEvent("editableInput"),x.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),q=x.url||x.value,q&&q.trim().length>0){var me=this.options.contentWindow.getSelection();if(me){var we=me.getRangeAt(0),et=we.commonAncestorContainer,Ye,Pt,Ft,Yt;if(we.endContainer.nodeType===3&&we.startContainer.nodeType!==3&&we.startOffset===0&&we.startContainer.firstChild===we.endContainer&&(et=we.endContainer),Pt=e.util.getClosestBlockContainer(we.startContainer),Ft=e.util.getClosestBlockContainer(we.endContainer),et.nodeType!==3&&et.textContent.length!==0&&Pt===Ft){var ut=Pt||O,bt=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),Ye=this.exportSelection(),bt.appendChild(ut.cloneNode(!0)),O===ut?e.selection.select(this.options.ownerDocument,ut.firstChild,0,ut.lastChild,ut.lastChild.nodeType===3?ut.lastChild.nodeValue.length:ut.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,ut,0,ut,ut.childNodes.length);var N=this.exportSelection();Yt=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,bt,{start:Ye.start-N.start,end:Ye.end-N.start,editableElementIndex:Ye.editableElementIndex}),Yt.length===0&&(bt=this.options.ownerDocument.createDocumentFragment(),bt.appendChild(et.cloneNode(!0)),Yt=[bt.firstChild.firstChild,bt.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,Yt,q.trim());var W=(bt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,bt.firstChild.innerHTML.replace(/^\s+/,"")),Ye.start-=W,Ye.end-=W,this.importSelection(Ye)}else this.options.ownerDocument.execCommand("createLink",!1,q);this.options.targetBlank||x.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),q):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),q),x.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),x.buttonClass)}}if(this.options.targetBlank||x.target==="_blank"||x.buttonClass){R=this.options.ownerDocument.createEvent("HTMLEvents"),R.initEvent("input",!0,!0,this.options.contentWindow);for(var F=0,V=this.elements.length;F<V;F+=1)this.elements[F].dispatchEvent(R)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",R,O)}},cleanPaste:function(x){this.getExtensionByName("paste").cleanPaste(x)},pasteHTML:function(x,O){this.getExtensionByName("paste").pasteHTML(x,O)},setContent:function(x,O){if(O=O||0,this.elements[O]){var R=this.elements[O];R.innerHTML=x,this.checkContentChanged(R)}},getContent:function(x){return x=x||0,this.elements[x]?this.elements[x].innerHTML.trim():null},checkContentChanged:function(x){x=x||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(x,{target:x,currentTarget:x})},resetContent:function(x){if(x){var O=this.elements.indexOf(x);O!==-1&&this.setContent(yt[x.getAttribute("medium-editor-index")],O);return}this.elements.forEach(function(R,q){this.setContent(yt[R.getAttribute("medium-editor-index")],q)},this)},addElements:function(x){var O=c(x,this.options.ownerDocument,!0);if(O.length===0)return!1;O.forEach(function(R){R=U.call(this,R,this.id),this.elements.push(R),this.trigger("addElement",{target:R,currentTarget:R},R)},this)},removeElements:function(x){var O=c(x,this.options.ownerDocument),R=O.map(function(q){return q.getAttribute("medium-editor-textarea-id")&&q.parentNode?q.parentNode.querySelector('div[medium-editor-textarea-id="'+q.getAttribute("medium-editor-textarea-id")+'"]'):q});this.elements=this.elements.filter(function(q){return R.indexOf(q)!==-1?(this.events.cleanupElement(q),q.getAttribute("medium-editor-textarea-id")&&d(q),this.trigger("removeElement",{target:q,currentTarget:q},q),!1):!0},this)}},e.getEditorFromElement=function(x){var O=x.getAttribute("data-medium-editor-editor-index"),R=x&&x.ownerDocument&&(x.ownerDocument.defaultView||x.ownerDocument.parentWindow);return R&&R._mediumEditors&&R._mediumEditors[O]?R._mediumEditors[O]:null}})(),(function(){e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}})(),e.parseVersionString=function(n){var r=n.split("-"),i=r[0].split("."),o=r.length>1?r[1]:"";return{major:parseInt(i[0],10),minor:parseInt(i[1],10),revision:parseInt(i[2],10),preRelease:o,toString:function(){return[i[0],i[1],i[2]].join(".")+(o?"-"+o:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e})())})(Gi)),Gi.exports}var f1=h1();const yr=fs(f1);/*!
|
||
* vanilla-picker v2.12.3
|
||
* https://vanilla-picker.js.org
|
||
*
|
||
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
||
* Released under the ISC license.
|
||
*/var Mo=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Po=(function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}})(),br=(function(){function t(e,n){var r=[],i=!0,o=!1,s=void 0;try{for(var l=e[Symbol.iterator](),a;!(i=(a=l.next()).done)&&(r.push(a.value),!(n&&r.length===n));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&l.return&&l.return()}finally{if(o)throw s}}return r}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0};String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var p1={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function Ga(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var g1=(function(){function t(e,n,r,i){Mo(this,t);var o=this;function s(a){if(a.startsWith("hsl")){var u=a.match(/([\-\d\.e]+)/g).map(Number),c=br(u,4),d=c[0],h=c[1],f=c[2],v=c[3];v===void 0&&(v=1),d/=360,h/=100,f/=100,o.hsla=[d,h,f,v]}else if(a.startsWith("rgb")){var b=a.match(/([\-\d\.e]+)/g).map(Number),w=br(b,4),T=w[0],P=w[1],H=w[2],G=w[3];G===void 0&&(G=1),o.rgba=[T,P,H,G]}else a.startsWith("#")?o.rgba=t.hexToRgb(a):o.rgba=t.nameToRgb(a)||t.hexToRgb(a)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(r===void 0){var l=e&&""+e;l&&s(l.toLowerCase())}else this.rgba=[e,n,r,i===void 0?1:i]}return Po(t,[{key:"printRGB",value:function(e){var n=e?this.rgba:this.rgba.slice(0,3),r=n.map(function(i,o){return Ga(i,o===3?3:0)});return e?"rgba("+r+")":"rgb("+r+")"}},{key:"printHSL",value:function(e){var n=[360,100,100,1],r=["","%","%",""],i=e?this.hsla:this.hsla.slice(0,3),o=i.map(function(s,l){return Ga(s*n[l],l===3?3:1)+r[l]});return e?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function(e){var n=this.hex;return e?n:n.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(e){e.length===3&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(e){e.length===3&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var e=this.rgba,n=e.map(function(r,i){return i<3?r.toString(16):Math.round(r*255).toString(16)});return"#"+n.map(function(r){return r.padStart(2,"0")}).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(e){var n=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!n.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var r=n.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(i){return parseInt(i,16)});return r[3]=r[3]/255,r}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=p1[n];return r===void 0?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var n=br(e,4),r=n[0],i=n[1],o=n[2],s=n[3];r/=255,i/=255,o/=255;var l=Math.max(r,i,o),a=Math.min(r,i,o),u=void 0,c=void 0,d=(l+a)/2;if(l===a)u=c=0;else{var h=l-a;switch(c=d>.5?h/(2-l-a):h/(l+a),l){case r:u=(i-o)/h+(i<o?6:0);break;case i:u=(o-r)/h+2;break;case o:u=(r-i)/h+4;break}u/=6}return[u,c,d,s]}},{key:"hslToRgb",value:function(e){var n=br(e,4),r=n[0],i=n[1],o=n[2],s=n[3],l=void 0,a=void 0,u=void 0;if(i===0)l=a=u=o;else{var c=function(v,b,w){return w<0&&(w+=1),w>1&&(w-=1),w<.16666666666666666?v+(b-v)*6*w:w<.5?b:w<.6666666666666666?v+(b-v)*(.6666666666666666-w)*6:v},d=o<.5?o*(1+i):o+i-o*i,h=2*o-d;l=c(h,d,r+1/3),a=c(h,d,r),u=c(h,d,r-1/3)}var f=[l*255,a*255,u*255].map(Math.round);return f[3]=s,f}}]),t})(),m1=(function(){function t(){Mo(this,t),this._events=[]}return Po(t,[{key:"add",value:function(e,n,r){e.addEventListener(n,r,!1),this._events.push({target:e,type:n,handler:r})}},{key:"remove",value:function(e,n,r){this._events=this._events.filter(function(i){var o=!0;return e&&e!==i.target&&(o=!1),n&&n!==i.type&&(o=!1),r&&r!==i.handler&&(o=!1),o&&t._doRemove(i.target,i.type,i.handler),!o})}},{key:"destroy",value:function(){this._events.forEach(function(e){return t._doRemove(e.target,e.type,e.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(e,n,r){e.removeEventListener(n,r,!1)}}]),t})();function v1(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function _i(t,e,n){var r=!1;function i(a,u,c){return Math.max(u,Math.min(a,c))}function o(a,u,c){if(c&&(r=!0),!!r){a.preventDefault();var d=e.getBoundingClientRect(),h=d.width,f=d.height,v=u.clientX,b=u.clientY,w=i(v-d.left,0,h),T=i(b-d.top,0,f);n(w/h,T/f)}}function s(a,u){var c=a.buttons===void 0?a.which:a.buttons;c===1?o(a,a,u):r=!1}function l(a,u){a.touches.length===1?o(a,a.touches[0],u):r=!1}t.add(e,"mousedown",function(a){s(a,!0)}),t.add(e,"touchstart",function(a){l(a,!0)}),t.add(window,"mousemove",s),t.add(e,"touchmove",l),t.add(window,"mouseup",function(a){r=!1}),t.add(e,"touchend",function(a){r=!1}),t.add(e,"touchcancel",function(a){r=!1})}var y1=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
|
||
linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,b1=360,vu="keydown",wr="mousedown",Ai="focusin";function Ht(t,e){return(e||document).querySelector(t)}function w1(t){t.preventDefault(),t.stopPropagation()}function Si(t,e,n,r,i){t.add(e,vu,function(o){n.indexOf(o.key)>=0&&r(o)})}var yu=(function(){function t(e){Mo(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new m1,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return Po(t,[{key:"setOptions",value:function(e){var n=this;if(!e)return;var r=this.settings;function i(a,u,c){for(var d in a)u[d]=a[d]}if(e instanceof HTMLElement)r.parent=e;else{r.parent&&e.parent&&r.parent!==e.parent&&(this._events.remove(r.parent),this._popupInited=!1),i(e,r),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var o=e.color||e.colour;o&&this._setColor(o)}var s=r.parent;if(s&&r.popup&&!this._popupInited){var l=function(a){return n.openHandler(a)};this._events.add(s,"click",l),Si(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else e.parent&&!r.popup&&this.show()}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var n=e&&e.type===vu?this._domEdit:this.domElement;setTimeout(function(){return n.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var n=e&&e.type,r=!1;if(!e)r=!0;else if(n===wr||n===Ai){var i=(this.__containedEvent||0)+100;e.timeStamp>i&&(r=!0)}else w1(e),r=!0;r&&this.hide()&&(this.settings.parent.style.pointerEvents="",n!==wr&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,n){this.closeHandler(),this.setOptions(e),n&&this.openHandler()}},{key:"setColor",value:function(e,n){this._setColor(e,{silent:n})}},{key:"_setColor",value:function(e,n){if(typeof e=="string"&&(e=e.trim()),!!e){n=n||{};var r=void 0;try{r=new g1(e)}catch(o){if(n.failSilently)return;throw o}if(!this.settings.alpha){var i=r.hsla;i[3]=1,r.hsla=i}this.colour=this.color=r,this._setHSLA(null,null,null,null,n)}}},{key:"setColour",value:function(e,n){this.setColor(e,n)}},{key:"show",value:function(){var e=this.settings.parent;if(!e)return!1;if(this.domElement){var n=this._toggleDOM(!0);return this._setPosition(),n}var r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',i=v1(r);return this.domElement=i,this._domH=Ht(".picker_hue",i),this._domSL=Ht(".picker_sl",i),this._domA=Ht(".picker_alpha",i),this._domEdit=Ht(".picker_editor input",i),this._domSample=Ht(".picker_sample",i),this._domOkay=Ht(".picker_done button",i),this._domCancel=Ht(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup(function(){return i.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,n=this,r=this.domElement,i=this._events;function o(a,u,c){i.add(a,u,c)}o(r,"click",function(a){return a.preventDefault()}),_i(i,this._domH,function(a,u){return n._setHSLA(a)}),_i(i,this._domSL,function(a,u){return n._setHSLA(null,a,1-u)}),this.settings.alpha&&_i(i,this._domA,function(a,u){return n._setHSLA(null,null,null,1-u)});var s=this._domEdit;o(s,"input",function(a){n._setColor(this.value,{fromEditor:!0,failSilently:!0})}),o(s,"focus",function(a){var u=this;u.selectionStart===u.selectionEnd&&u.select()}),this._ifPopup(function(){var a=function(c){return e.closeHandler(c)};o(window,wr,a),o(window,Ai,a),Si(i,r,["Esc","Escape"],a);var u=function(c){e.__containedEvent=c.timeStamp};o(r,wr,u),o(r,Ai,u),o(e._domCancel,"click",a)});var l=function(a){e._ifPopup(function(){return e.closeHandler(a)}),e.onDone&&e.onDone(e.colour)};o(this._domOkay,"click",l),Si(i,r,["Enter"],l)}},{key:"_setPosition",value:function(){var e=this.settings.parent,n=this.domElement;e!==n.parentNode&&e.appendChild(n),this._ifPopup(function(r){getComputedStyle(e).position==="static"&&(e.style.position="relative");var i=r===!0?"popup_right":"popup_"+r;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(o){o===i?n.classList.add(o):n.classList.remove(o)}),n.classList.add(i)})}},{key:"_setHSLA",value:function(e,n,r,i,o){o=o||{};var s=this.colour,l=s.hsla;[e,n,r,i].forEach(function(a,u){(a||a===0)&&(l[u]=a)}),s.hsla=l,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(s)}},{key:"_updateUI",value:function(e){if(!this.domElement)return;e=e||{};var n=this.colour,r=n.hsla,i="hsl("+r[0]*b1+", 100%, 50%)",o=n.hslString,s=n.hslaString,l=this._domH,a=this._domSL,u=this._domA,c=Ht(".picker_selector",l),d=Ht(".picker_selector",a),h=Ht(".picker_selector",u);function f(se,U,D){U.style.left=D*100+"%"}function v(se,U,D){U.style.top=D*100+"%"}f(l,c,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,f(a,d,r[1]),v(a,d,1-r[2]),a.style.color=o,v(u,h,1-r[3]);var b=o,w=b.replace("hsl","hsla").replace(")",", 0)"),T="linear-gradient("+[b,w]+")";if(this._domA.style.background=T+", "+y1,!e.fromEditor){var P=this.settings.editorFormat,H=this.settings.alpha,G=void 0;switch(P){case"rgb":G=n.printRGB(H);break;case"hsl":G=n.printHSL(H);break;default:G=n.printHex(H)}this._domEdit.value=G}this._domSample.style.color=s}},{key:"_ifPopup",value:function(e,n){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):n&&n()}},{key:"_toggleDOM",value:function(e){var n=this.domElement;if(!n)return!1;var r=e?"":"none",i=n.style.display!==r;return i&&(n.style.display=r),i}}]),t})();{var Ni=document.createElement("style");Ni.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(Ni),yu.StyleElement=Ni}var Ua={exports:{}},qa;function bu(){return qa||(qa=1,(function(t,e){(function(n,r){t.exports=n()})(function(){var n="object",r="function",i="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],s=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],l=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u(N,W){var F=typeof N[W];return F==r||!!(F==n&&N[W])||F=="unknown"}function c(N,W){return!!(typeof N[W]==n&&N[W])}function d(N,W){return typeof N[W]!=i}function h(N){return function(W,F){for(var V=F.length;V--;)if(!N(W,F[V]))return!1;return!0}}var f=h(u),v=h(c),b=h(d);function w(N){return N&&f(N,a)&&b(N,l)}function T(N){return c(N,"body")?N.body:N.getElementsByTagName("body")[0]}var P=[].forEach?function(N,W){N.forEach(W)}:function(N,W){for(var F=0,V=N.length;F<V;++F)W(N[F],F)},H={},G=typeof window!=i&&typeof document!=i,se={isHostMethod:u,isHostObject:c,isHostProperty:d,areHostMethods:f,areHostObjects:v,areHostProperties:b,isTextRange:w,getBody:T,forEach:P},U={version:"1.3.2",initialized:!1,isBrowser:G,supported:!0,util:se,features:{},modules:H,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==i?!0:rangyAutoInitialize}};function D(N){typeof console!=i&&u(console,"log")}function he(N,W){G&&W?alert(N):D()}function Q(N){U.initialized=!0,U.supported=!1,he("Rangy is not supported in this environment. Reason: "+N,U.config.alertOnFail)}U.fail=Q;function Ze(N){he("Rangy warning: "+N,U.config.alertOnWarn)}U.warn=Ze;var Xe;({}).hasOwnProperty?(se.extend=Xe=function(N,W,F){var V,ne;for(var fe in W)fe==="__proto__"||fe==="constructor"||fe==="prototype"||W.hasOwnProperty(fe)&&(V=N[fe],ne=W[fe],F&&V!==null&&typeof V=="object"&&ne!==null&&typeof ne=="object"&&Xe(V,ne,!0),N[fe]=ne);return W.hasOwnProperty("toString")&&(N.toString=W.toString),N},se.createOptions=function(N,W){var F={};return Xe(F,W),N&&Xe(F,N),F}):Q("hasOwnProperty not supported"),G||Q("Rangy can only run in a browser"),(function(){var N;if(G){var W=document.createElement("div");W.appendChild(document.createElement("span"));var F=[].slice;try{F.call(W.childNodes,0)[0].nodeType==1&&(N=function(V){return F.call(V,0)})}catch(V){}}N||(N=function(V){for(var ne=[],fe=0,pe=V.length;fe<pe;++fe)ne[fe]=V[fe];return ne}),se.toArray=N})();var yt;G&&(u(document,"addEventListener")?yt=function(N,W,F){N.addEventListener(W,F,!1)}:u(document,"attachEvent")?yt=function(N,W,F){N.attachEvent("on"+W,F)}:Q("Document does not have required addEventListener or attachEvent method"),se.addListener=yt);var x=[];function O(N){return N.message||N.description||String(N)}function R(){if(!(!G||U.initialized)){var N,W=!1,F=!1;u(document,"createRange")&&(N=document.createRange(),f(N,s)&&b(N,o)&&(W=!0));var V=T(document);if(!V||V.nodeName.toLowerCase()!="body"){Q("No body element found");return}if(V&&u(V,"createTextRange")&&(N=V.createTextRange(),w(N)&&(F=!0)),!W&&!F){Q("Neither Range nor TextRange are available");return}U.initialized=!0,U.features={implementsDomRange:W,implementsTextRange:F};var ne;for(var fe in H)(ne=H[fe])instanceof Ye&&ne.init(ne,U);for(var pe=0,He=x.length;pe<He;++pe)try{x[pe](U)}catch(ze){""+O(ze),D()}}}function q(N,W,F){F&&(N+=" in module "+F.name),U.warn("DEPRECATED: "+N+" is deprecated. Please use "+W+" instead.")}function me(N,W,F,V){N[W]=function(){return q(W,F,V),N[F].apply(N,se.toArray(arguments))}}se.deprecationNotice=q,se.createAliasForDeprecatedMethod=me,U.init=R,U.addInitListener=function(N){U.initialized?N(U):x.push(N)};var we=[];U.addShimListener=function(N){we.push(N)};function et(N){N=N||window,R();for(var W=0,F=we.length;W<F;++W)we[W](N)}G&&(U.shim=U.createMissingNativeApi=et,me(U,"createMissingNativeApi","shim"));function Ye(N,W,F){this.name=N,this.dependencies=W,this.initialized=!1,this.supported=!1,this.initializer=F}Ye.prototype={init:function(){for(var N=this.dependencies||[],W=0,F=N.length,V,ne;W<F;++W){if(ne=N[W],V=H[ne],!V||!(V instanceof Ye))throw new Error("required module '"+ne+"' not found");if(V.init(),!V.supported)throw new Error("required module '"+ne+"' not supported")}this.initializer(this)},fail:function(N){throw this.initialized=!0,this.supported=!1,new Error(N)},warn:function(N){U.warn("Module "+this.name+": "+N)},deprecationNotice:function(N,W){U.warn("DEPRECATED: "+N+" in module "+this.name+" is deprecated. Please use "+W+" instead")},createError:function(N){return new Error("Error in Rangy "+this.name+" module: "+N)}};function Pt(N,W,F){var V=new Ye(N,W,function(ne){if(!ne.initialized){ne.initialized=!0;try{F(U,ne),ne.supported=!0}catch(fe){""+N+O(fe),D(),fe.stack&&D(fe.stack)}}});return H[N]=V,V}U.createModule=function(N){var W,F;arguments.length==2?(W=arguments[1],F=[]):(W=arguments[2],F=arguments[1]);var V=Pt(N,F,W);U.initialized&&U.supported&&V.init()},U.createCoreModule=function(N,W,F){Pt(N,W,F)};function Ft(){}U.RangePrototype=Ft,U.rangePrototype=new Ft;function Yt(){}U.selectionPrototype=new Yt,U.createCoreModule("DomUtil",[],function(N,W){var F="undefined",V=N.util,ne=V.getBody;V.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||W.fail("document missing a Node creation method"),V.isHostMethod(document,"getElementsByTagName")||W.fail("document missing getElementsByTagName method");var fe=document.createElement("div");V.areHostMethods(fe,["insertBefore","appendChild","cloneNode"])||W.fail("Incomplete Element implementation"),V.isHostProperty(fe,"innerHTML")||W.fail("Element is missing innerHTML property");var pe=document.createTextNode("test");V.areHostMethods(pe,["splitText","deleteData","insertData","appendData","cloneNode"])||W.fail("Incomplete Text Node implementation");var He=(function(k,X){for(var ye=k.length;ye--;)if(k[ye]===X)return!0;return!1});function ze(k){var X;return typeof k.namespaceURI==F||(X=k.namespaceURI)===null||X=="http://www.w3.org/1999/xhtml"}function Je(k){var X=k.parentNode;return X.nodeType==1?X:null}function Me(k){for(var X=0;k=k.previousSibling;)++X;return X}function Qe(k){switch(k.nodeType){case 7:case 10:return 0;case 3:case 8:return k.length;default:return k.childNodes.length}}function tt(k,X){var ye=[],le;for(le=k;le;le=le.parentNode)ye.push(le);for(le=X;le;le=le.parentNode)if(He(ye,le))return le;return null}function y(k,X,ye){for(var le=ye?X:X.parentNode;le;){if(le===k)return!0;le=le.parentNode}return!1}function E(k,X){return y(k,X,!0)}function C(k,X,ye){for(var le,$e=ye?k:k.parentNode;$e;){if(le=$e.parentNode,le===X)return $e;$e=le}return null}function M(k){var X=k.nodeType;return X==3||X==4||X==8}function _(k){if(!k)return!1;var X=k.nodeType;return X==3||X==8}function j(k,X){var ye=X.nextSibling,le=X.parentNode;return ye?le.insertBefore(k,ye):le.appendChild(k),k}function I(k,X,ye){var le=k.cloneNode(!1);if(le.deleteData(0,X),k.deleteData(X,k.length-X),j(le,k),ye)for(var $e=0,Pe;Pe=ye[$e++];)Pe.node==k&&Pe.offset>X?(Pe.node=le,Pe.offset-=X):Pe.node==k.parentNode&&Pe.offset>Me(k)&&++Pe.offset;return le}function $(k){if(k.nodeType==9)return k;if(typeof k.ownerDocument!=F)return k.ownerDocument;if(typeof k.document!=F)return k.document;if(k.parentNode)return $(k.parentNode);throw W.createError("getDocument: no document found for node")}function ce(k){var X=$(k);if(typeof X.defaultView!=F)return X.defaultView;if(typeof X.parentWindow!=F)return X.parentWindow;throw W.createError("Cannot get a window object for node")}function re(k){if(typeof k.contentDocument!=F)return k.contentDocument;if(typeof k.contentWindow!=F)return k.contentWindow.document;throw W.createError("getIframeDocument: No Document object found for iframe element")}function Y(k){if(typeof k.contentWindow!=F)return k.contentWindow;if(typeof k.contentDocument!=F)return k.contentDocument.defaultView;throw W.createError("getIframeWindow: No Window object found for iframe element")}function Ne(k){return k&&V.isHostMethod(k,"setTimeout")&&V.isHostObject(k,"document")}function xe(k,X,ye){var le;if(k?V.isHostProperty(k,"nodeType")?le=k.nodeType==1&&k.tagName.toLowerCase()=="iframe"?re(k):$(k):Ne(k)&&(le=k.document):le=document,!le)throw X.createError(ye+"(): Parameter must be a Window object or DOM node");return le}function _e(k){for(var X;X=k.parentNode;)k=X;return k}function nt(k,X,ye,le){var $e,Pe,Lt,At,dt;if(k==ye)return X===le?0:X<le?-1:1;if($e=C(ye,k,!0))return X<=Me($e)?-1:1;if($e=C(k,ye,!0))return Me($e)<le?-1:1;if(Pe=tt(k,ye),!Pe)throw new Error("comparePoints error: nodes have no common ancestor");if(Lt=k===Pe?Pe:C(k,Pe,!0),At=ye===Pe?Pe:C(ye,Pe,!0),Lt===At)throw W.createError("comparePoints got to case 4 and childA and childB are the same!");for(dt=Pe.firstChild;dt;){if(dt===Lt)return-1;if(dt===At)return 1;dt=dt.nextSibling}}var Z=!1;function oe(k){var X;try{return X=k.parentNode,!1}catch(ye){return!0}}(function(){var k=document.createElement("b");k.innerHTML="1";var X=k.firstChild;k.innerHTML="<br />",Z=oe(X),N.features.crashyTextNodes=Z})();function Oe(k){if(!k)return"[No node]";if(Z&&oe(k))return"[Broken node]";if(M(k))return'"'+k.data+'"';if(k.nodeType==1){var X=k.id?' id="'+k.id+'"':"";return"<"+k.nodeName+X+">[index:"+Me(k)+",length:"+k.childNodes.length+"]["+(k.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return k.nodeName}function Be(k){for(var X=$(k).createDocumentFragment(),ye;ye=k.firstChild;)X.appendChild(ye);return X}var qe;typeof window.getComputedStyle!=F?qe=function(k,X){return ce(k).getComputedStyle(k,null)[X]}:typeof document.documentElement.currentStyle!=F?qe=function(k,X){return k.currentStyle?k.currentStyle[X]:""}:W.fail("No means of obtaining computed style properties found");function _t(k,X,ye){var le=ne(k),$e=k.createElement("div");$e.contentEditable=""+!!ye,X&&($e.innerHTML=X);var Pe=le.firstChild;return Pe?le.insertBefore($e,Pe):le.appendChild($e),$e}function ct(k){return k.parentNode.removeChild(k)}function rt(k){this.root=k,this._next=k}rt.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var k=this._current=this._next,X,ye;if(this._current)if(X=k.firstChild,X)this._next=X;else{for(ye=null;k!==this.root&&!(ye=k.nextSibling);)k=k.parentNode;this._next=ye}return this._current},detach:function(){this._current=this._next=this.root=null}};function it(k){return new rt(k)}function st(k,X){this.node=k,this.offset=X}st.prototype={equals:function(k){return!!k&&this.node===k.node&&this.offset==k.offset},inspect:function(){return"[DomPosition("+Oe(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function wt(k){this.code=this[k],this.codeName=k,this.message="DOMException: "+this.codeName}wt.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},wt.prototype.toString=function(){return this.message},N.dom={arrayContains:He,isHtmlNamespace:ze,parentElement:Je,getNodeIndex:Me,getNodeLength:Qe,getCommonAncestor:tt,isAncestorOf:y,isOrIsAncestorOf:E,getClosestAncestorIn:C,isCharacterDataNode:M,isTextOrCommentNode:_,insertAfter:j,splitDataNode:I,getDocument:$,getWindow:ce,getIframeWindow:Y,getIframeDocument:re,getBody:ne,isWindow:Ne,getContentDocument:xe,getRootContainer:_e,comparePoints:nt,isBrokenNode:oe,inspectNode:Oe,getComputedStyleProperty:qe,createTestElement:_t,removeNode:ct,fragmentFromNodeChildren:Be,createIterator:it,DomPosition:st},N.DOMException=wt}),U.createCoreModule("DomRange",["DomUtil"],function(N,W){var F=N.dom,V=N.util,ne=F.DomPosition,fe=N.DOMException,pe=F.isCharacterDataNode,He=F.getNodeIndex,ze=F.isOrIsAncestorOf,Je=F.getDocument,Me=F.comparePoints,Qe=F.splitDataNode,tt=F.getClosestAncestorIn,y=F.getNodeLength,E=F.arrayContains,C=F.getRootContainer,M=N.features.crashyTextNodes,_=F.removeNode;function j(m,A){return m.nodeType!=3&&(ze(m,A.startContainer)||ze(m,A.endContainer))}function I(m){return m.document||Je(m.startContainer)}function $(m){return C(m.startContainer)}function ce(m){return new ne(m.parentNode,He(m))}function re(m){return new ne(m.parentNode,He(m)+1)}function Y(m,A,L){var K=m.nodeType==11?m.firstChild:m;return pe(A)?L==A.length?F.insertAfter(m,A):A.parentNode.insertBefore(m,L==0?A:Qe(A,L)):L>=A.childNodes.length?A.appendChild(m):A.insertBefore(m,A.childNodes[L]),K}function Ne(m,A,L){if(De(m),De(A),I(A)!=I(m))throw new fe("WRONG_DOCUMENT_ERR");var K=Me(m.startContainer,m.startOffset,A.endContainer,A.endOffset),ae=Me(m.endContainer,m.endOffset,A.startContainer,A.startOffset);return L?K<=0&&ae>=0:K<0&&ae>0}function xe(m){for(var A,L,K=I(m.range).createDocumentFragment(),ae;L=m.next();){if(A=m.isPartiallySelectedSubtree(),L=L.cloneNode(!A),A&&(ae=m.getSubtreeIterator(),L.appendChild(xe(ae)),ae.detach()),L.nodeType==10)throw new fe("HIERARCHY_REQUEST_ERR");K.appendChild(L)}return K}function _e(m,A,L){var K,ae;L=L||{stop:!1};for(var Se,z;Se=m.next();)if(m.isPartiallySelectedSubtree()){if(A(Se)===!1){L.stop=!0;return}else if(z=m.getSubtreeIterator(),_e(z,A,L),z.detach(),L.stop)return}else for(K=F.createIterator(Se);ae=K.next();)if(A(ae)===!1){L.stop=!0;return}}function nt(m){for(var A;m.next();)m.isPartiallySelectedSubtree()?(A=m.getSubtreeIterator(),nt(A),A.detach()):m.remove()}function Z(m){for(var A,L=I(m.range).createDocumentFragment(),K;A=m.next();){if(m.isPartiallySelectedSubtree()?(A=A.cloneNode(!1),K=m.getSubtreeIterator(),A.appendChild(Z(K)),K.detach()):m.remove(),A.nodeType==10)throw new fe("HIERARCHY_REQUEST_ERR");L.appendChild(A)}return L}function oe(m,A,L){var K=!!(A&&A.length),ae,Se=!!L;K&&(ae=new RegExp("^("+A.join("|")+")$"));var z=[];return _e(new Be(m,!1),function(te){if(!(K&&!ae.test(te.nodeType))&&!(Se&&!L(te))){var de=m.startContainer;if(!(te==de&&pe(de)&&m.startOffset==de.length)){var Ee=m.endContainer;te==Ee&&pe(Ee)&&m.endOffset==0||z.push(te)}}}),z}function Oe(m){var A=typeof m.getName=="undefined"?"Range":m.getName();return"["+A+"("+F.inspectNode(m.startContainer)+":"+m.startOffset+", "+F.inspectNode(m.endContainer)+":"+m.endOffset+")]"}function Be(m,A){if(this.range=m,this.clonePartiallySelectedTextNodes=A,!m.collapsed){this.sc=m.startContainer,this.so=m.startOffset,this.ec=m.endContainer,this.eo=m.endOffset;var L=m.commonAncestorContainer;this.sc===this.ec&&pe(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===L&&!pe(this.sc)?this.sc.childNodes[this.so]:tt(this.sc,L,!0),this._last=this.ec===L&&!pe(this.ec)?this.ec.childNodes[this.eo-1]:tt(this.ec,L,!0))}}Be.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var m=this._current=this._next;return m&&(this._next=m!==this._last?m.nextSibling:null,pe(m)&&this.clonePartiallySelectedTextNodes&&(m===this.ec&&(m=m.cloneNode(!0)).deleteData(this.eo,m.length-this.eo),this._current===this.sc&&(m=m.cloneNode(!0)).deleteData(0,this.so))),m},remove:function(){var m=this._current,A,L;pe(m)&&(m===this.sc||m===this.ec)?(A=m===this.sc?this.so:0,L=m===this.ec?this.eo:m.length,A!=L&&m.deleteData(A,L-A)):m.parentNode&&_(m)},isPartiallySelectedSubtree:function(){var m=this._current;return j(m,this.range)},getSubtreeIterator:function(){var m;if(this.isSingleCharacterDataNode)m=this.range.cloneRange(),m.collapse(!1);else{m=new Ke(I(this.range));var A=this._current,L=A,K=0,ae=A,Se=y(A);ze(A,this.sc)&&(L=this.sc,K=this.so),ze(A,this.ec)&&(ae=this.ec,Se=this.eo),ke(m,L,K,ae,Se)}return new Be(m,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var qe=[1,3,4,5,7,8,10],_t=[2,9,11],ct=[5,6,10,12],rt=[1,3,4,5,7,8,10,11],it=[1,3,4,5,7,8];function st(m){return function(A,L){for(var K,ae=L?A:A.parentNode;ae;){if(K=ae.nodeType,E(m,K))return ae;ae=ae.parentNode}return null}}var wt=st([9,11]),k=st(ct),X=st([6,10,12]),ye=st([1]);function le(m,A){if(X(m,A))throw new fe("INVALID_NODE_TYPE_ERR")}function $e(m,A){if(!E(A,m.nodeType))throw new fe("INVALID_NODE_TYPE_ERR")}function Pe(m,A){if(A<0||A>(pe(m)?m.length:m.childNodes.length))throw new fe("INDEX_SIZE_ERR")}function Lt(m,A){if(wt(m,!0)!==wt(A,!0))throw new fe("WRONG_DOCUMENT_ERR")}function At(m){if(k(m,!0))throw new fe("NO_MODIFICATION_ALLOWED_ERR")}function dt(m,A){if(!m)throw new fe(A)}function Un(m,A){return A<=(pe(m)?m.length:m.childNodes.length)}function un(m){return!!m.startContainer&&!!m.endContainer&&!(M&&(F.isBrokenNode(m.startContainer)||F.isBrokenNode(m.endContainer)))&&C(m.startContainer)==C(m.endContainer)&&Un(m.startContainer,m.startOffset)&&Un(m.endContainer,m.endOffset)}function De(m){if(!un(m))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+m.inspect()+")")}var qn=document.createElement("style"),Vt=!1;try{qn.innerHTML="<b>x</b>",Vt=qn.firstChild.nodeType==3}catch(m){}N.features.htmlParsingConforms=Vt;var Kn=Vt?(function(m){var A=this.startContainer,L=Je(A);if(!A)throw new fe("INVALID_STATE_ERR");var K=null;return A.nodeType==1?K=A:pe(A)&&(K=F.parentElement(A)),K===null||K.nodeName=="HTML"&&F.isHtmlNamespace(Je(K).documentElement)&&F.isHtmlNamespace(K)?K=L.createElement("body"):K=K.cloneNode(!1),K.innerHTML=m,F.fragmentFromNodeChildren(K)}):(function(m){var A=I(this),L=A.createElement("body");return L.innerHTML=m,F.fragmentFromNodeChildren(L)});function _n(m,A){De(m);var L=m.startContainer,K=m.startOffset,ae=m.endContainer,Se=m.endOffset,z=L===ae;pe(ae)&&Se>0&&Se<ae.length&&Qe(ae,Se,A),pe(L)&&K>0&&K<L.length&&(L=Qe(L,K,A),z?(Se-=K,ae=L):ae==L.parentNode&&Se>=He(L)&&Se++,K=0),m.setStartAndEnd(L,K,ae,Se)}function be(m){De(m);var A=m.commonAncestorContainer.parentNode.cloneNode(!1);return A.appendChild(m.cloneContents()),A.innerHTML}var An=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],Sn=0,cn=1,fr=2,nn=3,dn=0,Xn=1,Yn=2,Nn=3;V.extend(N.rangePrototype,{compareBoundaryPoints:function(m,A){De(this),Lt(this.startContainer,A.startContainer);var L,K,ae,Se,z=m==nn||m==Sn?"start":"end",te=m==cn||m==Sn?"start":"end";return L=this[z+"Container"],K=this[z+"Offset"],ae=A[te+"Container"],Se=A[te+"Offset"],Me(L,K,ae,Se)},insertNode:function(m){if(De(this),$e(m,rt),At(this.startContainer),ze(m,this.startContainer))throw new fe("HIERARCHY_REQUEST_ERR");var A=Y(m,this.startContainer,this.startOffset);this.setStartBefore(A)},cloneContents:function(){De(this);var m,A;if(this.collapsed)return I(this).createDocumentFragment();if(this.startContainer===this.endContainer&&pe(this.startContainer))return m=this.startContainer.cloneNode(!0),m.data=m.data.slice(this.startOffset,this.endOffset),A=I(this).createDocumentFragment(),A.appendChild(m),A;var L=new Be(this,!0);return m=xe(L),L.detach(),m},canSurroundContents:function(){De(this),At(this.startContainer),At(this.endContainer);var m=new Be(this,!0),A=m._first&&j(m._first,this)||m._last&&j(m._last,this);return m.detach(),!A},surroundContents:function(m){if($e(m,it),!this.canSurroundContents())throw new fe("INVALID_STATE_ERR");var A=this.extractContents();if(m.hasChildNodes())for(;m.lastChild;)m.removeChild(m.lastChild);Y(m,this.startContainer,this.startOffset),m.appendChild(A),this.selectNode(m)},cloneRange:function(){De(this);for(var m=new Ke(I(this)),A=An.length,L;A--;)L=An[A],m[L]=this[L];return m},toString:function(){De(this);var m=this.startContainer;if(m===this.endContainer&&pe(m))return m.nodeType==3||m.nodeType==4?m.data.slice(this.startOffset,this.endOffset):"";var A=[],L=new Be(this,!0);return _e(L,function(K){(K.nodeType==3||K.nodeType==4)&&A.push(K.data)}),L.detach(),A.join("")},compareNode:function(m){De(this);var A=m.parentNode,L=He(m);if(!A)throw new fe("NOT_FOUND_ERR");var K=this.comparePoint(A,L),ae=this.comparePoint(A,L+1);return K<0?ae>0?Yn:dn:ae>0?Xn:Nn},comparePoint:function(m,A){return De(this),dt(m,"HIERARCHY_REQUEST_ERR"),Lt(m,this.startContainer),Me(m,A,this.startContainer,this.startOffset)<0?-1:Me(m,A,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Kn,toHtml:function(){return be(this)},intersectsNode:function(m,A){if(De(this),C(m)!=$(this))return!1;var L=m.parentNode,K=He(m);if(!L)return!0;var ae=Me(L,K,this.endContainer,this.endOffset),Se=Me(L,K+1,this.startContainer,this.startOffset);return A?ae<=0&&Se>=0:ae<0&&Se>0},isPointInRange:function(m,A){return De(this),dt(m,"HIERARCHY_REQUEST_ERR"),Lt(m,this.startContainer),Me(m,A,this.startContainer,this.startOffset)>=0&&Me(m,A,this.endContainer,this.endOffset)<=0},intersectsRange:function(m){return Ne(this,m,!1)},intersectsOrTouchesRange:function(m){return Ne(this,m,!0)},intersection:function(m){if(this.intersectsRange(m)){var A=Me(this.startContainer,this.startOffset,m.startContainer,m.startOffset),L=Me(this.endContainer,this.endOffset,m.endContainer,m.endOffset),K=this.cloneRange();return A==-1&&K.setStart(m.startContainer,m.startOffset),L==1&&K.setEnd(m.endContainer,m.endOffset),K}return null},union:function(m){if(this.intersectsOrTouchesRange(m)){var A=this.cloneRange();return Me(m.startContainer,m.startOffset,this.startContainer,this.startOffset)==-1&&A.setStart(m.startContainer,m.startOffset),Me(m.endContainer,m.endOffset,this.endContainer,this.endOffset)==1&&A.setEnd(m.endContainer,m.endOffset),A}else throw new fe("Ranges do not intersect")},containsNode:function(m,A){return A?this.intersectsNode(m,!1):this.compareNode(m)==Nn},containsNodeContents:function(m){return this.comparePoint(m,0)>=0&&this.comparePoint(m,y(m))<=0},containsRange:function(m){var A=this.intersection(m);return A!==null&&m.equals(A)},containsNodeText:function(m){var A=this.cloneRange();A.selectNode(m);var L=A.getNodes([3]);if(L.length>0){A.setStart(L[0],0);var K=L.pop();return A.setEnd(K,K.length),this.containsRange(A)}else return this.containsNodeContents(m)},getNodes:function(m,A){return De(this),oe(this,m,A)},getDocument:function(){return I(this)},collapseBefore:function(m){this.setEndBefore(m),this.collapse(!1)},collapseAfter:function(m){this.setStartAfter(m),this.collapse(!0)},getBookmark:function(m){var A=I(this),L=N.createRange(A);m=m||F.getBody(A),L.selectNodeContents(m);var K=this.intersection(L),ae=0,Se=0;return K&&(L.setEnd(K.startContainer,K.startOffset),ae=L.toString().length,Se=ae+K.toString().length),{start:ae,end:Se,containerNode:m}},moveToBookmark:function(m){var A=m.containerNode,L=0;this.setStart(A,0),this.collapse(!0);for(var K=[A],ae,Se=!1,z=!1,te,de,Ee;!z&&(ae=K.pop());)if(ae.nodeType==3)te=L+ae.length,!Se&&m.start>=L&&m.start<=te&&(this.setStart(ae,m.start-L),Se=!0),Se&&m.end>=L&&m.end<=te&&(this.setEnd(ae,m.end-L),z=!0),L=te;else for(Ee=ae.childNodes,de=Ee.length;de--;)K.push(Ee[de])},getName:function(){return"DomRange"},equals:function(m){return Ke.rangesEqual(this,m)},isValid:function(){return un(this)},inspect:function(){return Oe(this)},detach:function(){}});function g(m){m.START_TO_START=Sn,m.START_TO_END=cn,m.END_TO_END=fr,m.END_TO_START=nn,m.NODE_BEFORE=dn,m.NODE_AFTER=Xn,m.NODE_BEFORE_AND_AFTER=Yn,m.NODE_INSIDE=Nn}function S(m){g(m),g(m.prototype)}function B(m,A){return function(){De(this);var L=this.startContainer,K=this.startOffset,ae=this.commonAncestorContainer,Se=new Be(this,!0),z,te;L!==ae&&(z=tt(L,ae,!0),te=re(z),L=te.node,K=te.offset),_e(Se,At),Se.reset();var de=m(Se);return Se.detach(),A(this,L,K,L,K),de}}function J(m,A){function L(z,te){return function(de){$e(de,qe),$e(C(de),_t);var Ee=(z?ce:re)(de);(te?K:ae)(this,Ee.node,Ee.offset)}}function K(z,te,de){var Ee=z.endContainer,ht=z.endOffset;(te!==z.startContainer||de!==z.startOffset)&&((C(te)!=C(Ee)||Me(te,de,Ee,ht)==1)&&(Ee=te,ht=de),A(z,te,de,Ee,ht))}function ae(z,te,de){var Ee=z.startContainer,ht=z.startOffset;(te!==z.endContainer||de!==z.endOffset)&&((C(te)!=C(Ee)||Me(te,de,Ee,ht)==-1)&&(Ee=te,ht=de),A(z,Ee,ht,te,de))}var Se=function(){};Se.prototype=N.rangePrototype,m.prototype=new Se,V.extend(m.prototype,{setStart:function(z,te){le(z,!0),Pe(z,te),K(this,z,te)},setEnd:function(z,te){le(z,!0),Pe(z,te),ae(this,z,te)},setStartAndEnd:function(){var z=arguments,te=z[0],de=z[1],Ee=te,ht=de;switch(z.length){case 3:ht=z[2];break;case 4:Ee=z[2],ht=z[3];break}le(te,!0),Pe(te,de),le(Ee,!0),Pe(Ee,ht),A(this,te,de,Ee,ht)},setBoundary:function(z,te,de){this["set"+(de?"Start":"End")](z,te)},setStartBefore:L(!0,!0),setStartAfter:L(!1,!0),setEndBefore:L(!0,!1),setEndAfter:L(!1,!1),collapse:function(z){De(this),z?A(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):A(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(z){le(z,!0),A(this,z,0,z,y(z))},selectNode:function(z){le(z,!1),$e(z,qe);var te=ce(z),de=re(z);A(this,te.node,te.offset,de.node,de.offset)},extractContents:B(Z,A),deleteContents:B(nt,A),canSurroundContents:function(){De(this),At(this.startContainer),At(this.endContainer);var z=new Be(this,!0),te=z._first&&j(z._first,this)||z._last&&j(z._last,this);return z.detach(),!te},splitBoundaries:function(){_n(this)},splitBoundariesPreservingPositions:function(z){_n(this,z)},normalizeBoundaries:function(){De(this);var z=this.startContainer,te=this.startOffset,de=this.endContainer,Ee=this.endOffset,ht=function(xt){var jt=xt.nextSibling;jt&&jt.nodeType==xt.nodeType&&(de=xt,Ee=xt.length,xt.appendData(jt.data),_(jt))},Lo=function(xt){var jt=xt.previousSibling;if(jt&&jt.nodeType==xt.nodeType){z=xt;var Nu=xt.length;if(te=jt.length,xt.insertData(0,jt.data),_(jt),z==de)Ee+=te,de=z;else if(de==xt.parentNode){var Do=He(xt);Ee==Do?(de=xt,Ee=Nu):Ee>Do&&Ee--}}},gi=!0,Nt;if(pe(de))Ee==de.length?ht(de):Ee==0&&(Nt=de.previousSibling,Nt&&Nt.nodeType==de.nodeType&&(Ee=Nt.length,z==de&&(gi=!1),Nt.appendData(de.data),_(de),de=Nt));else{if(Ee>0){var mi=de.childNodes[Ee-1];mi&&pe(mi)&&ht(mi)}gi=!this.collapsed}if(gi){if(pe(z))te==0?Lo(z):te==z.length&&(Nt=z.nextSibling,Nt&&Nt.nodeType==z.nodeType&&(de==Nt&&(de=z,Ee+=z.length),z.appendData(Nt.data),_(Nt)));else if(te<z.childNodes.length){var vi=z.childNodes[te];vi&&pe(vi)&&Lo(vi)}}else z=de,te=Ee;A(this,z,te,de,Ee)},collapseToPoint:function(z,te){le(z,!0),Pe(z,te),this.setStartAndEnd(z,te)},parentElement:function(){De(this);var z=this.commonAncestorContainer;return z?ye(this.commonAncestorContainer,!0):null}}),S(m)}function ge(m){m.collapsed=m.startContainer===m.endContainer&&m.startOffset===m.endOffset,m.commonAncestorContainer=m.collapsed?m.startContainer:F.getCommonAncestor(m.startContainer,m.endContainer)}function ke(m,A,L,K,ae){m.startContainer=A,m.startOffset=L,m.endContainer=K,m.endOffset=ae,m.document=F.getDocument(A),ge(m)}function Ke(m){ke(this,m,0,m,0)}J(Ke,ke),V.extend(Ke,{rangeProperties:An,RangeIterator:Be,copyComparisonConstants:S,createPrototypeRange:J,inspect:Oe,toHtml:be,getRangeDocument:I,rangesEqual:function(m,A){return m.startContainer===A.startContainer&&m.startOffset===A.startOffset&&m.endContainer===A.endContainer&&m.endOffset===A.endOffset}}),N.DomRange=Ke}),U.createCoreModule("WrappedRange",["DomRange"],function(N,W){var F,V,ne=N.dom,fe=N.util,pe=ne.DomPosition,He=N.DomRange,ze=ne.getBody,Je=ne.getContentDocument,Me=ne.isCharacterDataNode;if(N.features.implementsDomRange&&(function(){var _,j=He.rangeProperties;function I(Z){for(var oe=j.length,Oe;oe--;)Oe=j[oe],Z[Oe]=Z.nativeRange[Oe];Z.collapsed=Z.startContainer===Z.endContainer&&Z.startOffset===Z.endOffset}function $(Z,oe,Oe,Be,qe){var _t=Z.startContainer!==oe||Z.startOffset!=Oe,ct=Z.endContainer!==Be||Z.endOffset!=qe,rt=!Z.equals(Z.nativeRange);(_t||ct||rt)&&(Z.setEnd(Be,qe),Z.setStart(oe,Oe))}var ce;F=function(Z){if(!Z)throw W.createError("WrappedRange: Range must be specified");this.nativeRange=Z,I(this)},He.createPrototypeRange(F,$),_=F.prototype,_.selectNode=function(Z){this.nativeRange.selectNode(Z),I(this)},_.cloneContents=function(){return this.nativeRange.cloneContents()},_.surroundContents=function(Z){this.nativeRange.surroundContents(Z),I(this)},_.collapse=function(Z){this.nativeRange.collapse(Z),I(this)},_.cloneRange=function(){return new F(this.nativeRange.cloneRange())},_.refresh=function(){I(this)},_.toString=function(){return this.nativeRange.toString()};var re=document.createTextNode("test");ze(document).appendChild(re);var Y=document.createRange();Y.setStart(re,0),Y.setEnd(re,0);try{Y.setStart(re,1),_.setStart=function(Z,oe){this.nativeRange.setStart(Z,oe),I(this)},_.setEnd=function(Z,oe){this.nativeRange.setEnd(Z,oe),I(this)},ce=function(Z){return function(oe){this.nativeRange[Z](oe),I(this)}}}catch(Z){_.setStart=function(oe,Oe){try{this.nativeRange.setStart(oe,Oe)}catch(Be){this.nativeRange.setEnd(oe,Oe),this.nativeRange.setStart(oe,Oe)}I(this)},_.setEnd=function(oe,Oe){try{this.nativeRange.setEnd(oe,Oe)}catch(Be){this.nativeRange.setStart(oe,Oe),this.nativeRange.setEnd(oe,Oe)}I(this)},ce=function(oe,Oe){return function(Be){try{this.nativeRange[oe](Be)}catch(qe){this.nativeRange[Oe](Be),this.nativeRange[oe](Be)}I(this)}}}_.setStartBefore=ce("setStartBefore","setEndBefore"),_.setStartAfter=ce("setStartAfter","setEndAfter"),_.setEndBefore=ce("setEndBefore","setStartBefore"),_.setEndAfter=ce("setEndAfter","setStartAfter"),_.selectNodeContents=function(Z){this.setStartAndEnd(Z,0,ne.getNodeLength(Z))},Y.selectNodeContents(re),Y.setEnd(re,3);var Ne=document.createRange();Ne.selectNodeContents(re),Ne.setEnd(re,4),Ne.setStart(re,2),Y.compareBoundaryPoints(Y.START_TO_END,Ne)==-1&&Y.compareBoundaryPoints(Y.END_TO_START,Ne)==1?_.compareBoundaryPoints=function(Z,oe){return oe=oe.nativeRange||oe,Z==oe.START_TO_END?Z=oe.END_TO_START:Z==oe.END_TO_START&&(Z=oe.START_TO_END),this.nativeRange.compareBoundaryPoints(Z,oe)}:_.compareBoundaryPoints=function(Z,oe){return this.nativeRange.compareBoundaryPoints(Z,oe.nativeRange||oe)};var xe=document.createElement("div");xe.innerHTML="123";var _e=xe.firstChild,nt=ze(document);nt.appendChild(xe),Y.setStart(_e,1),Y.setEnd(_e,2),Y.deleteContents(),_e.data=="13"&&(_.deleteContents=function(){this.nativeRange.deleteContents(),I(this)},_.extractContents=function(){var Z=this.nativeRange.extractContents();return I(this),Z}),nt.removeChild(xe),nt=null,fe.isHostMethod(Y,"createContextualFragment")&&(_.createContextualFragment=function(Z){return this.nativeRange.createContextualFragment(Z)}),ze(document).removeChild(re),_.getName=function(){return"WrappedRange"},N.WrappedRange=F,N.createNativeRange=function(Z){return Z=Je(Z,W,"createNativeRange"),Z.createRange()}})(),N.features.implementsTextRange){var Qe=function(_){var j=_.parentElement(),I=_.duplicate();I.collapse(!0);var $=I.parentElement();I=_.duplicate(),I.collapse(!1);var ce=I.parentElement(),re=$==ce?$:ne.getCommonAncestor($,ce);return re==j?re:ne.getCommonAncestor(j,re)},tt=function(_){return _.compareEndPoints("StartToEnd",_)==0},y=function(_,j,I,$,ce){var re=_.duplicate();re.collapse(I);var Y=re.parentElement();if(ne.isOrIsAncestorOf(j,Y)||(Y=j),!Y.canHaveHTML){var Ne=new pe(Y.parentNode,ne.getNodeIndex(Y));return{boundaryPosition:Ne,nodeInfo:{nodeIndex:Ne.offset,containerElement:Ne.node}}}var xe=ne.getDocument(Y).createElement("span");xe.parentNode&&ne.removeNode(xe);for(var _e,nt=I?"StartToStart":"StartToEnd",Z,oe,Oe,Be,qe=ce&&ce.containerElement==Y?ce.nodeIndex:0,_t=Y.childNodes.length,ct=_t,rt=ct;rt==_t?Y.appendChild(xe):Y.insertBefore(xe,Y.childNodes[rt]),re.moveToElementText(xe),_e=re.compareEndPoints(nt,_),!(_e==0||qe==ct);){if(_e==-1){if(ct==qe+1)break;qe=rt}else ct=ct==qe+1?qe:rt;rt=Math.floor((qe+ct)/2),Y.removeChild(xe)}if(Be=xe.nextSibling,_e==-1&&Be&&Me(Be)){re.setEndPoint(I?"EndToStart":"EndToEnd",_);var it;if(/[\r\n]/.test(Be.data)){var st=re.duplicate(),wt=st.text.replace(/\r\n/g,"\r").length;for(it=st.moveStart("character",wt);(_e=st.compareEndPoints("StartToEnd",st))==-1;)it++,st.moveStart("character",1)}else it=re.text.length;Oe=new pe(Be,it)}else Z=($||!I)&&xe.previousSibling,oe=($||I)&&xe.nextSibling,oe&&Me(oe)?Oe=new pe(oe,0):Z&&Me(Z)?Oe=new pe(Z,Z.data.length):Oe=new pe(Y,ne.getNodeIndex(xe));return ne.removeNode(xe),{boundaryPosition:Oe,nodeInfo:{nodeIndex:rt,containerElement:Y}}},E=function(_,j){var I,$,ce=_.offset,re=ne.getDocument(_.node),Y,Ne,xe=ze(re).createTextRange(),_e=Me(_.node);return _e?(I=_.node,$=I.parentNode):(Ne=_.node.childNodes,I=ce<Ne.length?Ne[ce]:null,$=_.node),Y=re.createElement("span"),Y.innerHTML="&#feff;",I?$.insertBefore(Y,I):$.appendChild(Y),xe.moveToElementText(Y),xe.collapse(!j),$.removeChild(Y),_e&&xe[j?"moveStart":"moveEnd"]("character",ce),xe};V=function(_){this.textRange=_,this.refresh()},V.prototype=new He(document),V.prototype.refresh=function(){var _,j,I,$=Qe(this.textRange);tt(this.textRange)?j=_=y(this.textRange,$,!0,!0).boundaryPosition:(I=y(this.textRange,$,!0,!1),_=I.boundaryPosition,j=y(this.textRange,$,!1,!1,I.nodeInfo).boundaryPosition),this.setStart(_.node,_.offset),this.setEnd(j.node,j.offset)},V.prototype.getName=function(){return"WrappedTextRange"},He.copyComparisonConstants(V);var C=function(_){if(_.collapsed)return E(new pe(_.startContainer,_.startOffset),!0);var j=E(new pe(_.startContainer,_.startOffset),!0),I=E(new pe(_.endContainer,_.endOffset),!1),$=ze(He.getRangeDocument(_)).createTextRange();return $.setEndPoint("StartToStart",j),$.setEndPoint("EndToEnd",I),$};if(V.rangeToTextRange=C,V.prototype.toTextRange=function(){return C(this)},N.WrappedTextRange=V,!N.features.implementsDomRange||N.config.preferTextRange){var M=(function(_){return _("return this;")()})(Function);typeof M.Range=="undefined"&&(M.Range=V),N.createNativeRange=function(_){return _=Je(_,W,"createNativeRange"),ze(_).createTextRange()},N.WrappedRange=V}}N.createRange=function(_){return _=Je(_,W,"createRange"),new N.WrappedRange(N.createNativeRange(_))},N.createRangyRange=function(_){return _=Je(_,W,"createRangyRange"),new He(_)},fe.createAliasForDeprecatedMethod(N,"createIframeRange","createRange"),fe.createAliasForDeprecatedMethod(N,"createIframeRangyRange","createRangyRange"),N.addShimListener(function(_){var j=_.document;typeof j.createRange=="undefined"&&(j.createRange=function(){return N.createRange(j)}),j=_=null})}),U.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(N,W){N.config.checkSelectionRanges=!0;var F="boolean",V="number",ne=N.dom,fe=N.util,pe=fe.isHostMethod,He=N.DomRange,ze=N.WrappedRange,Je=N.DOMException,Me=ne.DomPosition,Qe,tt,y=N.features,E="Control",C=ne.getDocument,M=ne.getBody,_=He.rangesEqual;function j(g){return typeof g=="string"?/^backward(s)?$/i.test(g):!!g}function I(g,S){if(g){if(ne.isWindow(g))return g;if(g instanceof De)return g.win;var B=ne.getContentDocument(g,W,S);return ne.getWindow(B)}else return window}function $(g){return I(g,"getWinSelection").getSelection()}function ce(g){return I(g,"getDocSelection").document.selection}function re(g){var S=!1;return g.anchorNode&&(S=ne.comparePoints(g.anchorNode,g.anchorOffset,g.focusNode,g.focusOffset)==1),S}var Y=pe(window,"getSelection"),Ne=fe.isHostObject(document,"selection");y.implementsWinGetSelection=Y,y.implementsDocSelection=Ne;var xe=Ne&&(!Y||N.config.preferTextRange);if(xe)Qe=ce,N.isSelectionValid=function(g){var S=I(g,"isSelectionValid").document,B=S.selection;return B.type!="None"||C(B.createRange().parentElement())==S};else if(Y)Qe=$,N.isSelectionValid=function(){return!0};else return W.fail("Neither document.selection or window.getSelection() detected."),!1;N.getNativeSelection=Qe;var _e=Qe();if(!_e)return W.fail("Native selection was null (possibly issue 138?)"),!1;var nt=N.createNativeRange(document),Z=M(document),oe=fe.areHostProperties(_e,["anchorNode","focusNode","anchorOffset","focusOffset"]);y.selectionHasAnchorAndFocus=oe;var Oe=pe(_e,"extend");y.selectionHasExtend=Oe;var Be=pe(_e,"setBaseAndExtent");y.selectionHasSetBaseAndExtent=Be;var qe=typeof _e.rangeCount==V;y.selectionHasRangeCount=qe;var _t=!1,ct=!0,rt=Oe?function(g,S){var B=He.getRangeDocument(S),J=N.createRange(B);J.collapseToPoint(S.endContainer,S.endOffset),g.addRange(le(J)),g.extend(S.startContainer,S.startOffset)}:null;fe.areHostMethods(_e,["addRange","getRangeAt","removeAllRanges"])&&typeof _e.rangeCount==V&&y.implementsDomRange&&(function(){var g=window.getSelection();if(g){for(var S=g.rangeCount,B=S>1,J=[],ge=re(g),ke=0;ke<S;++ke)J[ke]=g.getRangeAt(ke);var Ke=ne.createTestElement(document,"",!1),m=Ke.appendChild(document.createTextNode(" ")),A=document.createRange();if(A.setStart(m,1),A.collapse(!0),g.removeAllRanges(),g.addRange(A),ct=g.rangeCount==1,g.removeAllRanges(),!B){var L=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(L&&parseInt(L[1])>=36)_t=!1;else{var K=A.cloneRange();A.setStart(m,0),K.setEnd(m,3),K.setStart(m,2),g.addRange(A),g.addRange(K),_t=g.rangeCount==2}}for(ne.removeNode(Ke),g.removeAllRanges(),ke=0;ke<S;++ke)ke==0&&ge?rt?rt(g,J[ke]):(N.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),g.addRange(J[ke])):g.addRange(J[ke])}})(),y.selectionSupportsMultipleRanges=_t,y.collapsedNonEditableSelectionsSupported=ct;var it=!1,st;Z&&pe(Z,"createControlRange")&&(st=Z.createControlRange(),fe.areHostProperties(st,["item","add"])&&(it=!0)),y.implementsControlRange=it,oe?tt=function(g){return g.anchorNode===g.focusNode&&g.anchorOffset===g.focusOffset}:tt=function(g){return g.rangeCount?g.getRangeAt(g.rangeCount-1).collapsed:!1};function wt(g,S,B){var J=B?"end":"start",ge=B?"start":"end";g.anchorNode=S[J+"Container"],g.anchorOffset=S[J+"Offset"],g.focusNode=S[ge+"Container"],g.focusOffset=S[ge+"Offset"]}function k(g){var S=g.nativeSelection;g.anchorNode=S.anchorNode,g.anchorOffset=S.anchorOffset,g.focusNode=S.focusNode,g.focusOffset=S.focusOffset}function X(g){g.anchorNode=g.focusNode=null,g.anchorOffset=g.focusOffset=0,g.rangeCount=0,g.isCollapsed=!0,g._ranges.length=0,ye(g)}function ye(g){g.type=g.rangeCount==0?"None":tt(g)?"Caret":"Range"}function le(g){var S;return g instanceof He?(S=N.createNativeRange(g.getDocument()),S.setEnd(g.endContainer,g.endOffset),S.setStart(g.startContainer,g.startOffset)):g instanceof ze?S=g.nativeRange:y.implementsDomRange&&g instanceof ne.getWindow(g.startContainer).Range&&(S=g),S}function $e(g){if(!g.length||g[0].nodeType!=1)return!1;for(var S=1,B=g.length;S<B;++S)if(!ne.isAncestorOf(g[0],g[S]))return!1;return!0}function Pe(g){var S=g.getNodes();if(!$e(S))throw W.createError("getSingleElementFromRange: range "+g.inspect()+" did not consist of a single element");return S[0]}function Lt(g){return!!g&&typeof g.text!="undefined"}function At(g,S){var B=new ze(S);g._ranges=[B],wt(g,B,!1),g.rangeCount=1,g.isCollapsed=B.collapsed,ye(g)}function dt(g){if(g._ranges.length=0,g.docSelection.type=="None")X(g);else{var S=g.docSelection.createRange();if(Lt(S))At(g,S);else{g.rangeCount=S.length;for(var B,J=C(S.item(0)),ge=0;ge<g.rangeCount;++ge)B=N.createRange(J),B.selectNode(S.item(ge)),g._ranges.push(B);g.isCollapsed=g.rangeCount==1&&g._ranges[0].collapsed,wt(g,g._ranges[g.rangeCount-1],!1),ye(g)}}}function Un(g,S){for(var B=g.docSelection.createRange(),J=Pe(S),ge=C(B.item(0)),ke=M(ge).createControlRange(),Ke=0,m=B.length;Ke<m;++Ke)ke.add(B.item(Ke));try{ke.add(J)}catch(A){throw W.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}ke.select(),dt(g)}var un;pe(_e,"getRangeAt")?un=function(g,S){try{return g.getRangeAt(S)}catch(B){return null}}:oe&&(un=function(g){var S=C(g.anchorNode),B=N.createRange(S);return B.setStartAndEnd(g.anchorNode,g.anchorOffset,g.focusNode,g.focusOffset),B.collapsed!==this.isCollapsed&&B.setStartAndEnd(g.focusNode,g.focusOffset,g.anchorNode,g.anchorOffset),B});function De(g,S,B){this.nativeSelection=g,this.docSelection=S,this._ranges=[],this.win=B,this.refresh()}De.prototype=N.selectionPrototype;function qn(g){g.win=g.anchorNode=g.focusNode=g._ranges=null,g.rangeCount=g.anchorOffset=g.focusOffset=0,g.detached=!0,ye(g)}var Vt=[];function Kn(g,S){for(var B=Vt.length,J,ge;B--;)if(J=Vt[B],ge=J.selection,S=="deleteAll")qn(ge);else if(J.win==g)return S=="delete"?(Vt.splice(B,1),!0):ge;return S=="deleteAll"&&(Vt.length=0),null}var _n=function(g){if(g&&g instanceof De)return g.refresh(),g;g=I(g,"getNativeSelection");var S=Kn(g),B=Qe(g),J=Ne?ce(g):null;return S?(S.nativeSelection=B,S.docSelection=J,S.refresh()):(S=new De(B,J,g),Vt.push({win:g,selection:S})),S};N.getSelection=_n,fe.createAliasForDeprecatedMethod(N,"getIframeSelection","getSelection");var be=De.prototype;function An(g,S){for(var B=C(S[0].startContainer),J=M(B).createControlRange(),ge=0,ke,Ke=S.length;ge<Ke;++ge){ke=Pe(S[ge]);try{J.add(ke)}catch(m){throw W.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}J.select(),dt(g)}if(!xe&&oe&&fe.areHostMethods(_e,["removeAllRanges","addRange"])){be.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),X(this)};var Sn=function(g,S){rt(g.nativeSelection,S),g.refresh()};qe?be.addRange=function(g,S){if(it&&Ne&&this.docSelection.type==E)Un(this,g);else if(j(S)&&Oe)Sn(this,g);else{var B;_t?B=this.rangeCount:(this.removeAllRanges(),B=0);var J=le(g).cloneRange();try{this.nativeSelection.addRange(J)}catch(ke){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==B+1){if(N.config.checkSelectionRanges){var ge=un(this.nativeSelection,this.rangeCount-1);ge&&!_(ge,g)&&(g=new ze(ge))}this._ranges[this.rangeCount-1]=g,wt(this,g,nn(this.nativeSelection)),this.isCollapsed=tt(this),ye(this)}else this.refresh()}}:be.addRange=function(g,S){j(S)&&Oe?Sn(this,g):(this.nativeSelection.addRange(le(g)),this.refresh())},be.setRanges=function(g){if(it&&Ne&&g.length>1)An(this,g);else{this.removeAllRanges();for(var S=0,B=g.length;S<B;++S)this.addRange(g[S])}}}else if(pe(_e,"empty")&&pe(nt,"select")&&it&&xe)be.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var g;if(this.anchorNode)g=C(this.anchorNode);else if(this.docSelection.type==E){var S=this.docSelection.createRange();S.length&&(g=C(S.item(0)))}if(g){var B=M(g).createTextRange();B.select(),this.docSelection.empty()}}}catch(J){}X(this)},be.addRange=function(g){this.docSelection.type==E?Un(this,g):(N.WrappedTextRange.rangeToTextRange(g).select(),this._ranges[0]=g,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,wt(this,g,!1),ye(this))},be.setRanges=function(g){this.removeAllRanges();var S=g.length;S>1?An(this,g):S&&this.addRange(g[0])};else return W.fail("No means of selecting a Range or TextRange was found"),!1;be.getRangeAt=function(g){if(g<0||g>=this.rangeCount)throw new Je("INDEX_SIZE_ERR");return this._ranges[g].cloneRange()};var cn;if(xe)cn=function(g){var S;N.isSelectionValid(g.win)?S=g.docSelection.createRange():(S=M(g.win.document).createTextRange(),S.collapse(!0)),g.docSelection.type==E?dt(g):Lt(S)?At(g,S):X(g)};else if(pe(_e,"getRangeAt")&&typeof _e.rangeCount==V)cn=function(g){if(it&&Ne&&g.docSelection.type==E)dt(g);else if(g._ranges.length=g.rangeCount=g.nativeSelection.rangeCount,g.rangeCount){for(var S=0,B=g.rangeCount;S<B;++S)g._ranges[S]=new N.WrappedRange(g.nativeSelection.getRangeAt(S));wt(g,g._ranges[g.rangeCount-1],nn(g.nativeSelection)),g.isCollapsed=tt(g),ye(g)}else X(g)};else if(oe&&typeof _e.isCollapsed==F&&typeof nt.collapsed==F&&y.implementsDomRange)cn=function(g){var S,B=g.nativeSelection;B.anchorNode?(S=un(B,0),g._ranges=[S],g.rangeCount=1,k(g),g.isCollapsed=tt(g),ye(g)):X(g)};else return W.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;be.refresh=function(g){var S=g?this._ranges.slice(0):null,B=this.anchorNode,J=this.anchorOffset;if(cn(this),g){var ge=S.length;if(ge!=this._ranges.length||this.anchorNode!=B||this.anchorOffset!=J)return!0;for(;ge--;)if(!_(S[ge],this._ranges[ge]))return!0;return!1}};var fr=function(g,S){var B=g.getAllRanges();g.removeAllRanges();for(var J=0,ge=B.length;J<ge;++J)_(S,B[J])||g.addRange(B[J]);g.rangeCount||X(g)};it&&Ne?be.removeRange=function(g){if(this.docSelection.type==E){for(var S=this.docSelection.createRange(),B=Pe(g),J=C(S.item(0)),ge=M(J).createControlRange(),ke,Ke=!1,m=0,A=S.length;m<A;++m)ke=S.item(m),ke!==B||Ke?ge.add(S.item(m)):Ke=!0;ge.select(),dt(this)}else fr(this,g)}:be.removeRange=function(g){fr(this,g)};var nn;!xe&&oe&&y.implementsDomRange?(nn=re,be.isBackward=function(){return nn(this)}):nn=be.isBackward=function(){return!1},be.isBackwards=be.isBackward,be.toString=function(){for(var g=[],S=0,B=this.rangeCount;S<B;++S)g[S]=""+this._ranges[S];return g.join("")};function dn(g,S){if(g.win.document!=C(S))throw new Je("WRONG_DOCUMENT_ERR")}function Xn(g,S){if(S<0||S>(ne.isCharacterDataNode(g)?g.length:g.childNodes.length))throw new Je("INDEX_SIZE_ERR")}be.collapse=function(g,S){dn(this,g);var B=N.createRange(g);B.collapseToPoint(g,S),this.setSingleRange(B),this.isCollapsed=!0},be.collapseToStart=function(){if(this.rangeCount){var g=this._ranges[0];this.collapse(g.startContainer,g.startOffset)}else throw new Je("INVALID_STATE_ERR")},be.collapseToEnd=function(){if(this.rangeCount){var g=this._ranges[this.rangeCount-1];this.collapse(g.endContainer,g.endOffset)}else throw new Je("INVALID_STATE_ERR")},be.selectAllChildren=function(g){dn(this,g);var S=N.createRange(g);S.selectNodeContents(g),this.setSingleRange(S)},Be?be.setBaseAndExtent=function(g,S,B,J){this.nativeSelection.setBaseAndExtent(g,S,B,J),this.refresh()}:Oe&&(be.setBaseAndExtent=function(g,S,B,J){Xn(g,S),Xn(B,J),dn(this,g),dn(this,B);var ge=N.createRange(node),ke=ne.comparePoints(g,S,B,J)==-1;ke?ge.setStartAndEnd(B,J,g,S):ge.setStartAndEnd(g,S,B,J),this.setSingleRange(ge,ke)}),be.deleteFromDocument=function(){if(it&&Ne&&this.docSelection.type==E){for(var g=this.docSelection.createRange(),S;g.length;)S=g.item(0),g.remove(S),ne.removeNode(S);this.refresh()}else if(this.rangeCount){var B=this.getAllRanges();if(B.length){this.removeAllRanges();for(var J=0,ge=B.length;J<ge;++J)B[J].deleteContents();this.addRange(B[ge-1])}}},be.eachRange=function(g,S){for(var B=0,J=this._ranges.length;B<J;++B)if(g(this.getRangeAt(B)))return S},be.getAllRanges=function(){var g=[];return this.eachRange(function(S){g.push(S)}),g},be.setSingleRange=function(g,S){this.removeAllRanges(),this.addRange(g,S)},be.callMethodOnEachRange=function(g,S){var B=[];return this.eachRange(function(J){B.push(J[g].apply(J,S||[]))}),B};function Yn(g){return function(S,B){var J;this.rangeCount?(J=this.getRangeAt(0),J["set"+(g?"Start":"End")](S,B)):(J=N.createRange(this.win.document),J.setStartAndEnd(S,B)),this.setSingleRange(J,this.isBackward())}}be.setStart=Yn(!0),be.setEnd=Yn(!1),N.rangePrototype.select=function(g){_n(this.getDocument()).setSingleRange(this,g)},be.changeEachRange=function(g){var S=[],B=this.isBackward();this.eachRange(function(J){g(J),S.push(J)}),this.removeAllRanges(),B&&S.length==1?this.addRange(S[0],"backward"):this.setRanges(S)},be.containsNode=function(g,S){return this.eachRange(function(B){return B.containsNode(g,S)},!0)||!1},be.getBookmark=function(g){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[g])}},be.moveToBookmark=function(g){for(var S=[],B=0,J,ge;J=g.rangeBookmarks[B++];)ge=N.createRange(this.win),ge.moveToBookmark(J),S.push(ge);g.backward?this.setSingleRange(S[0],"backward"):this.setRanges(S)},be.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},be.restoreRanges=function(g){this.removeAllRanges();for(var S=0,B;B=g.ranges[S];++S)this.addRange(B,g.backward&&S==0)},be.toHtml=function(){var g=[];return this.eachRange(function(S){g.push(He.toHtml(S))}),g.join("")},y.implementsTextRange&&(be.getNativeTextRange=function(){var g;if(g=this.docSelection){var S=g.createRange();if(Lt(S))return S;throw W.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return N.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw W.createError("getNativeTextRange: selection contains no range")}});function Nn(g){var S=[],B=new Me(g.anchorNode,g.anchorOffset),J=new Me(g.focusNode,g.focusOffset),ge=typeof g.getName=="function"?g.getName():"Selection";if(typeof g.rangeCount!="undefined")for(var ke=0,Ke=g.rangeCount;ke<Ke;++ke)S[ke]=He.inspect(g.getRangeAt(ke));return"["+ge+"(Ranges: "+S.join(", ")+")(anchor: "+B.inspect()+", focus: "+J.inspect()+"]"}be.getName=function(){return"WrappedSelection"},be.inspect=function(){return Nn(this)},be.detach=function(){Kn(this.win,"delete"),qn(this)},De.detachAll=function(){Kn(null,"deleteAll")},De.inspect=Nn,De.isDirectionBackward=j,N.Selection=De,N.selectionPrototype=be,N.addShimListener(function(g){typeof g.getSelection=="undefined"&&(g.getSelection=function(){return _n(g)}),g=null})});var ut=!1,bt=function(N){ut||(ut=!0,!U.initialized&&U.config.autoInitialize&&R())};return G&&(document.readyState=="complete"?bt():(u(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",bt,!1),yt(window,"load",bt))),U})})(Ua)),Ua.exports}var x1=bu();const Ka=fs(x1);var Xa={exports:{}},Ya;function E1(){return Ya||(Ya=1,(function(t,e){(function(n,r){t.exports=n(bu())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(r,i){var o=r.dom,s=o.DomPosition,l=o.arrayContains,a=r.util,u=a.forEach,c="span",d=a.isHostMethod(document,"createElementNS");function h(y,E){for(var C in y)if(y.hasOwnProperty(C)&&E(C,y[C])===!1)return!1;return!0}function f(y){return y.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function v(y,E){return!!y&&new RegExp("(?:^|\\s)"+E+"(?:\\s|$)").test(y)}function b(y,E){if(typeof y.classList=="object")return y.classList.contains(E);var C=typeof y.className=="string",M=C?y.className:y.getAttribute("class");return v(M,E)}function w(y,E){if(typeof y.classList=="object")y.classList.add(E);else{var C=typeof y.className=="string",M=C?y.className:y.getAttribute("class");M?v(M,E)||(M+=" "+E):M=E,C?y.className=M:y.setAttribute("class",M)}}var T=(function(){function y(E,C,M){return C&&M?" ":""}return function(E,C){if(typeof E.classList=="object")E.classList.remove(C);else{var M=typeof E.className=="string",_=M?E.className:E.getAttribute("class");_=_.replace(new RegExp("(^|\\s)"+C+"(\\s|$)"),y),M?E.className=_:E.setAttribute("class",_)}}})();function P(y){var E=typeof y.className=="string";return E?y.className:y.getAttribute("class")}function H(y){return y&&y.split(/\s+/).sort().join(" ")}function G(y){return H(P(y))}function se(y,E){return G(y)==G(E)}function U(y,E){for(var C=E.split(/\s+/),M=0,_=C.length;M<_;++M)if(!b(y,f(C[M])))return!1;return!0}function D(y){var E=y.parentNode;return E&&E.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(E.nodeName)}function he(y,E,C,M,_){var j=y.node,I=y.offset,$=j,ce=I;j==M&&I>_&&++ce,j==E&&(I==C||I==C+1)&&($=M,ce+=_-C),j==E&&I>C+1&&--ce,y.node=$,y.offset=ce}function Q(y,E,C){y.node==E&&y.offset>C&&--y.offset}function Ze(y,E,C,M){C==-1&&(C=E.childNodes.length);var _=y.parentNode,j=o.getNodeIndex(y);u(M,function(I){he(I,_,j,E,C)}),E.childNodes.length==C?E.appendChild(y):E.insertBefore(y,E.childNodes[C])}function Xe(y,E){var C=y.parentNode,M=o.getNodeIndex(y);u(E,function(_){Q(_,C,M)}),o.removeNode(y)}function yt(y,E,C,M,_){for(var j,I=[];j=y.firstChild;)Ze(j,E,C++,_),I.push(j);return Xe(y,_),I}function x(y,E){return yt(y,y.parentNode,o.getNodeIndex(y),!0,E)}function O(y,E){var C=y.cloneRange();C.selectNodeContents(E);var M=C.intersection(y),_=M?M.toString():"";return _!=""}function R(y){for(var E=y.getNodes([3]),C=0,M;(M=E[C])&&!O(y,M);)++C;for(var _=E.length-1;(M=E[_])&&!O(y,M);)--_;return E.slice(C,_+1)}function q(y,E){if(y.attributes.length!=E.attributes.length)return!1;for(var C=0,M=y.attributes.length,_,j,I;C<M;++C)if(_=y.attributes[C],I=_.name,I!="class"&&(j=E.attributes.getNamedItem(I),_===null!=(j===null)||_.specified!=j.specified||_.specified&&_.nodeValue!==j.nodeValue))return!1;return!0}function me(y,E){for(var C=0,M=y.attributes.length,_;C<M;++C)if(_=y.attributes[C].name,!(E&&l(E,_))&&y.attributes[C].specified&&_!="class")return!0;return!1}var we=o.getComputedStyleProperty,et=(function(){var y=document.createElement("div");return typeof y.isContentEditable=="boolean"?function(E){return E&&E.nodeType==1&&E.isContentEditable}:function(E){return!E||E.nodeType!=1||E.contentEditable=="false"?!1:E.contentEditable=="true"||et(E.parentNode)}})();function Ye(y){var E;return y&&y.nodeType==1&&((E=y.parentNode)&&E.nodeType==9&&E.designMode=="on"||et(y)&&!et(y.parentNode))}function Pt(y){return(et(y)||y.nodeType!=1&&et(y.parentNode))&&!Ye(y)}var Ft=/^inline(-block|-table)?$/i;function Yt(y){return y&&y.nodeType==1&&!Ft.test(we(y,"display"))}var ut=/[^\r\n\t\f \u200B]/;function bt(y){if(y.data.length==0)return!0;if(ut.test(y.data))return!1;var E=we(y.parentNode,"whiteSpace");switch(E){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(y.data))return!1}return Yt(y.previousSibling)||Yt(y.nextSibling)}function N(y){var E=[],C,M;for(C=0;M=y[C++];)E.push(new s(M.startContainer,M.startOffset),new s(M.endContainer,M.endOffset));return E}function W(y,E){for(var C=0,M,_,j,I=y.length;C<I;++C)M=y[C],_=E[C*2],j=E[C*2+1],M.setStartAndEnd(_.node,_.offset,j.node,j.offset)}function F(y,E){return o.isCharacterDataNode(y)?E==0?!!y.previousSibling:E==y.length?!!y.nextSibling:!0:E>0&&E<y.childNodes.length}function V(y,E,C,M){var _,j,I=C==0;if(o.isAncestorOf(E,y))return y;if(o.isCharacterDataNode(E)){var $=o.getNodeIndex(E);if(C==0)C=$;else if(C==E.length)C=$+1;else throw i.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+C+" in "+E.data);E=E.parentNode}if(F(E,C)){_=E.cloneNode(!1),j=E.parentNode,_.id&&_.removeAttribute("id");for(var ce,re=0;ce=E.childNodes[C];)Ze(ce,_,re++,M);return Ze(_,j,o.getNodeIndex(E)+1,M),E==y?_:V(y,j,o.getNodeIndex(_),M)}else if(y!=E){_=E.parentNode;var Y=o.getNodeIndex(E);return I||Y++,V(y,_,Y,M)}return y}function ne(y,E){return y.namespaceURI==E.namespaceURI&&y.tagName.toLowerCase()==E.tagName.toLowerCase()&&se(y,E)&&q(y,E)&&we(y,"display")=="inline"&&we(E,"display")=="inline"}function fe(y){var E=y?"nextSibling":"previousSibling";return function(C,M){var _=C.parentNode,j=C[E];if(j){if(j&&j.nodeType==3)return j}else if(M&&(j=_[E],j&&j.nodeType==1&&ne(_,j))){var I=j[y?"firstChild":"lastChild"];if(I&&I.nodeType==3)return I}return null}}var pe=fe(!1),He=fe(!0);function ze(y){this.isElementMerge=y.nodeType==1,this.textNodes=[];var E=this.isElementMerge?y.lastChild:y;E&&(this.textNodes[0]=E)}ze.prototype={doMerge:function(y){var E=this.textNodes,C=E[0];if(E.length>1){var M=o.getNodeIndex(C),_=[],j=0,I;u(E,function($,ce){I=$.parentNode,ce>0&&(I.removeChild($),I.hasChildNodes()||o.removeNode(I),y&&u(y,function(re){re.node==$&&(re.node=C,re.offset+=j),re.node==I&&re.offset>M&&(--re.offset,re.offset==M+1&&ce<E.length-1&&(re.node=C,re.offset=j))})),_[ce]=$.data,j+=$.data.length}),C.data=_.join("")}return C.data},getLength:function(){for(var y=this.textNodes.length,E=0;y--;)E+=this.textNodes[y].length;return E},toString:function(){var y=[];return u(this.textNodes,function(E,C){y[C]="'"+E.data+"'"}),"[Merge("+y.join(",")+")]"}};var Je=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],Me={};function Qe(y,E,C){var M,_,j,I,$=this;$.cssClass=$.className=y;var ce=null,re={};if(typeof E=="object"&&E!==null){for(typeof E.elementTagName!="undefined"&&(E.elementTagName=E.elementTagName.toLowerCase()),C=E.tagNames,ce=E.elementProperties,re=E.elementAttributes,_=0;I=Je[_++];)E.hasOwnProperty(I)&&($[I]=E[I]);M=E.normalize}else M=E;$.normalize=typeof M=="undefined"?!0:M,$.attrExceptions=[];var Y=document.createElement($.elementTagName);$.elementProperties=$.copyPropertiesToElement(ce,Y,!0),h(re,function(xe,_e){$.attrExceptions.push(xe),re[xe]=""+_e}),$.elementAttributes=re,$.elementSortedClassName=$.elementProperties.hasOwnProperty("className")?H($.elementProperties.className+" "+y):y,$.applyToAnyTagName=!1;var Ne=typeof C;if(Ne=="string")C=="*"?$.applyToAnyTagName=!0:$.tagNames=f(C.toLowerCase()).split(/\s*,\s*/);else if(Ne=="object"&&typeof C.length=="number")for($.tagNames=[],_=0,j=C.length;_<j;++_)C[_]=="*"?$.applyToAnyTagName=!0:$.tagNames.push(C[_].toLowerCase());else $.tagNames=[$.elementTagName]}Qe.prototype={elementTagName:c,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(y,E,C){var M,_,j={},I,$,ce,re;for(var Y in y)if(y.hasOwnProperty(Y))if($=y[Y],ce=E[Y],Y=="className")w(E,$),w(E,this.className),E[Y]=H(E[Y]),C&&(j[Y]=$);else if(Y=="style"){_=ce,C&&(j[Y]=I={});for(M in y[Y])y[Y].hasOwnProperty(M)&&(_[M]=$[M],C&&(I[M]=_[M]));this.attrExceptions.push(Y)}else E[Y]=$,C&&(j[Y]=E[Y],re=Me.hasOwnProperty(Y)?Me[Y]:Y,this.attrExceptions.push(re));return C?j:""},copyAttributesToElement:function(y,E){for(var C in y)y.hasOwnProperty(C)&&!/^class(?:Name)?$/i.test(C)&&E.setAttribute(C,y[C])},appliesToElement:function(y){return l(this.tagNames,y.tagName.toLowerCase())},getEmptyElements:function(y){var E=this;return y.getNodes([1],function(C){return E.appliesToElement(C)&&!C.hasChildNodes()})},hasClass:function(y){return y.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(y))&&b(y,this.className)},getSelfOrAncestorWithClass:function(y){for(;y;){if(this.hasClass(y))return y;y=y.parentNode}return null},isModifiable:function(y){return!this.applyToEditableOnly||Pt(y)},isIgnorableWhiteSpaceNode:function(y){return this.ignoreWhiteSpace&&y&&y.nodeType==3&&bt(y)},postApply:function(y,E,C,M){var _=y[0],j=y[y.length-1],I=[],$,ce=_,re=j,Y=0,Ne=j.length,xe;u(y,function(oe){xe=pe(oe,!M),xe?($||($=new ze(xe),I.push($)),$.textNodes.push(oe),oe===_&&(ce=$.textNodes[0],Y=ce.length),oe===j&&(re=$.textNodes[0],Ne=$.getLength())):$=null});var _e=He(j,!M);if(_e&&($||($=new ze(j),I.push($)),$.textNodes.push(_e)),I.length){for(var nt=0,Z=I.length;nt<Z;++nt)I[nt].doMerge(C);E.setStartAndEnd(ce,Y,re,Ne)}},createContainer:function(y){var E=o.getDocument(y),C=d&&!o.isHtmlNamespace(y)&&y.namespaceURI?E.createElementNS(y.namespaceURI,this.elementTagName):E.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,C,!1),this.copyAttributesToElement(this.elementAttributes,C),w(C,this.className),this.onElementCreate&&this.onElementCreate(C,this),C},elementHasProperties:function(y,E){var C=this;return h(E,function(M,_){if(M=="className")return U(y,_);if(typeof _=="object"){if(!C.elementHasProperties(y[M],_))return!1}else if(y[M]!==_)return!1})},elementHasAttributes:function(y,E){return h(E,function(C,M){if(y.getAttribute(C)!==M)return!1})},applyToTextNode:function(y,E){if(D(y)){var C=y.parentNode;if(C.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(C)&&this.elementHasProperties(C,this.elementProperties)&&this.elementHasAttributes(C,this.elementAttributes))w(C,this.className);else{var M=y.parentNode,_=this.createContainer(M);M.insertBefore(_,y),_.appendChild(y)}}},isRemovable:function(y){return y.tagName.toLowerCase()==this.elementTagName&&G(y)==this.elementSortedClassName&&this.elementHasProperties(y,this.elementProperties)&&!me(y,this.attrExceptions)&&this.elementHasAttributes(y,this.elementAttributes)&&this.isModifiable(y)},isEmptyContainer:function(y){var E=y.childNodes.length;return y.nodeType==1&&this.isRemovable(y)&&(E==0||E==1&&this.isEmptyContainer(y.firstChild))},removeEmptyContainers:function(y){var E=this,C=y.getNodes([1],function(j){return E.isEmptyContainer(j)}),M=[y],_=N(M);u(C,function(j){Xe(j,_)}),W(M,_)},undoToTextNode:function(y,E,C,M){if(!E.containsNode(C)){var _=E.cloneRange();_.selectNode(C),_.isPointInRange(E.endContainer,E.endOffset)&&(V(C,E.endContainer,E.endOffset,M),E.setEndAfter(C)),_.isPointInRange(E.startContainer,E.startOffset)&&(C=V(C,E.startContainer,E.startOffset,M))}this.isRemovable(C)?x(C,M):T(C,this.className)},splitAncestorWithClass:function(y,E,C){var M=this.getSelfOrAncestorWithClass(y);M&&V(M,y,E,C)},undoToAncestor:function(y,E){this.isRemovable(y)?x(y,E):T(y,this.className)},applyToRange:function(y,E){var C=this;E=E||[];var M=N(E||[]);y.splitBoundariesPreservingPositions(M),C.removeEmptyElements&&C.removeEmptyContainers(y);var _=R(y);if(_.length){u(_,function($){!C.isIgnorableWhiteSpaceNode($)&&!C.getSelfOrAncestorWithClass($)&&C.isModifiable($)&&C.applyToTextNode($,M)});var j=_[_.length-1];y.setStartAndEnd(_[0],0,j,j.length),C.normalize&&C.postApply(_,y,M,!1),W(E,M)}var I=C.getEmptyElements(y);u(I,function($){w($,C.className)})},applyToRanges:function(y){for(var E=y.length;E--;)this.applyToRange(y[E],y);return y},applyToSelection:function(y){var E=r.getSelection(y);E.setRanges(this.applyToRanges(E.getAllRanges()))},undoToRange:function(y,E){var C=this;E=E||[];var M=N(E);y.splitBoundariesPreservingPositions(M),C.removeEmptyElements&&C.removeEmptyContainers(y,M);var _=R(y),j,I,$=_[_.length-1];if(_.length){C.splitAncestorWithClass(y.endContainer,y.endOffset,M),C.splitAncestorWithClass(y.startContainer,y.startOffset,M);for(var ce=0,re=_.length;ce<re;++ce)j=_[ce],I=C.getSelfOrAncestorWithClass(j),I&&C.isModifiable(j)&&C.undoToAncestor(I,M);y.setStartAndEnd(_[0],0,$,$.length),C.normalize&&C.postApply(_,y,M,!0),W(E,M)}var Y=C.getEmptyElements(y);u(Y,function(Ne){T(Ne,C.className)})},undoToRanges:function(y){for(var E=y.length;E--;)this.undoToRange(y[E],y);return y},undoToSelection:function(y){var E=r.getSelection(y),C=r.getSelection(y).getAllRanges();this.undoToRanges(C),E.setRanges(C)},isAppliedToRange:function(y){if(y.collapsed||y.toString()=="")return!!this.getSelfOrAncestorWithClass(y.commonAncestorContainer);var E=y.getNodes([3]);if(E.length){for(var C=0,M;M=E[C++];)if(!this.isIgnorableWhiteSpaceNode(M)&&O(y,M)&&this.isModifiable(M)&&!this.getSelfOrAncestorWithClass(M))return!1}return!0},isAppliedToRanges:function(y){var E=y.length;if(E==0)return!1;for(;E--;)if(!this.isAppliedToRange(y[E]))return!1;return!0},isAppliedToSelection:function(y){var E=r.getSelection(y);return this.isAppliedToRanges(E.getAllRanges())},toggleRange:function(y){this.isAppliedToRange(y)?this.undoToRange(y):this.applyToRange(y)},toggleSelection:function(y){this.isAppliedToSelection(y)?this.undoToSelection(y):this.applyToSelection(y)},getElementsWithClassIntersectingRange:function(y){var E=[],C=this;return y.getNodes([3],function(M){var _=C.getSelfOrAncestorWithClass(M);_&&!l(E,_)&&E.push(_)}),E},detach:function(){}};function tt(y,E,C){return new Qe(y,E,C)}Qe.util={hasClass:b,addClass:w,removeClass:T,getClass:P,hasSameClasses:se,hasAllClasses:U,replaceWithOwnChildren:x,elementsHaveSameNonClassAttributes:q,elementHasNonClassAttributes:me,splitNodeAt:V,isEditableElement:et,isEditingHost:Ye,isEditable:Pt},r.CssClassApplier=r.ClassApplier=Qe,r.createClassApplier=tt,a.createAliasForDeprecatedMethod(r,"createCssClassApplier","createClassApplier",i)}),n})})(Xa)),Xa.exports}E1();var Va={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function Za(t){var e,n,r=((e=t==null?void 0:t.extensions)===null||e===void 0?void 0:e.button)||((n=t==null?void 0:t.extensions)===null||n===void 0?void 0:n.button),i=(t==null?void 0:t.Extension)||(t==null?void 0:t.Extension),o=r||i;return o?o.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var s=this,l,a;try{Ka.init()}catch(u){}try{(a=(l=r==null?void 0:r.prototype)===null||l===void 0?void 0:l.init)===null||a===void 0||a.call(this)}catch(u){}this.colorPicker=new yu({parent:this.button||void 0,color:"#000",onDone:function(u){var c,d,h,f,v;try{s.coloredText&&!((d=(c=s.coloredText).isAppliedToSelection)===null||d===void 0)&&d.call(c)&&s.coloredText.undoToSelection(),s.coloredText=Ka.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:u.hex}},normalize:!0}),s.coloredText.toggleSelection(),(f=(h=s.base)===null||h===void 0?void 0:h.checkContentChanged)===null||f===void 0||f.call(h),(v=s.setInactive)===null||v===void 0||v.call(s)}catch(b){}}})},getButton:function(){return this.button},handleClick:function(){var s,l,a;(s=this.setActive)===null||s===void 0||s.call(this),(a=(l=this.colorPicker)===null||l===void 0?void 0:l.show)===null||a===void 0||a.call(l)},isAlreadyApplied:function(s){var l,a;return((a=(l=s==null?void 0:s.nodeName)===null||l===void 0?void 0:l.toLowerCase)===null||a===void 0?void 0:a.call(l))==="mark"},isActive:function(){var s,l;return(l=(s=this.button)===null||s===void 0?void 0:s.classList)===null||l===void 0?void 0:l.contains("medium-editor-button-active")},setInactive:function(){var s,l;(l=(s=this.button)===null||s===void 0?void 0:s.classList)===null||l===void 0||l.remove("medium-editor-button-active")},setActive:function(){var s,l;(l=(s=this.button)===null||s===void 0?void 0:s.classList)===null||l===void 0||l.add("medium-editor-button-active")}}):(function(){function s(){}return s})()}var C1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_1=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Ja=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Qa=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(function(t){C1(e,t);function e(n){var r=t.call(this,n)||this;r.labelMap=new Map;var i=n.lf,o=n.graphModel;return r.lf=i,r.graphModel=o,r.state={tick:0},r}return e.prototype.componentDidMount=function(){var n=this,r=this.props.graphModel;this.editor=new yr(".lf-label-editor",Mi(Va,{autoLink:!0,extensions:{colorPicker:new(Za(yr))}})),r.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),r.eventCenter.on("node:properties-change,node:properties-delete",function(){n.setState({tick:n.state.tick+1})})},e.prototype.componentDidUpdate=function(){var n;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new yr(".lf-label-editor",Mi(Va,{autoLink:!0,extensions:{colorPicker:new(Za(yr))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,r=this.props,i=r.lf.extension,o=r.graphModel,s=Qa(Qa([],Ja(o.nodes),!1),Ja(o.edges),!1),l=i.label;if(l){var a=[];return Ge(s,function(u){var c,d,h=u.getData(),f=(d=(c=h.properties)===null||c===void 0?void 0:c._label)!==null&&d!==void 0?d:[];Ge(f,function(v){var b=n.labelMap,w=new d1(v,u,o);b.set(w.id,w),a.push(Ve(u1,{label:w,element:u,graphModel:o},w.id))})}),a}return null},e.prototype.render=function(){return Ve("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=_1([hs],e),e})(qr);var wu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Mn=function(){return Mn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Mn.apply(this,arguments)},rr=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},A1={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function S1(t){for(var e=t,n=1;n<e.length-1;){var r=rr(e[n-1],2),i=r[0],o=r[1],s=rr(e[n],2),l=s[0],a=s[1],u=rr(e[n+1],2),c=u[0],d=u[1];i===l&&l===c||o===a&&a===d?e.splice(n,1):n++}return e}function N1(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return e==="tr"?(i[1]+=r,o[0]+=r):e==="lb"&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return e==="tl"?(i[1]+=r,o[0]-=r):e==="rb"&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return e==="br"?(i[1]-=r,o[0]+=r):e==="lt"&&(i[0]+=r,o[1]-=r),[i,o];case"br":return e==="bl"?(i[1]-=r,o[0]-=r):e==="rt"&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}function T1(t,e,n,r){var i,o=1,s="",l="";Math.abs(t[0]-e[0])<=o?s=t[1]>e[1]?"t":"b":Math.abs(t[1]-e[1])<=o&&(s=t[0]>e[0]?"l":"r"),Math.abs(e[0]-n[0])<=o?l=e[1]>n[1]?"t":"b":Math.abs(e[1]-n[1])<=o&&(l=e[0]>n[0]?"l":"r");var a=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||1/5*r,u="".concat(s).concat(l),c=A1[u]||"-",d="L ".concat(t[0]," ").concat(t[1]);if(c==="-")d+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var h=rr(N1(e,u,c,a),2),f=h[0],v=h[1];f&&v&&(d+="L ".concat(f[0]," ").concat(f[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(v[0]," ").concat(v[1]),i=rr(v,2),e[0]=i[0],e[1]=i[1])}return d}function R1(t,e){var n=0,r="";if(t.length===2)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){var i=t[n-1],o=t[n],s=t[n+++1];r+=T1(i,o,s,e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}(function(t){wu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.points,i=n.isAnimation,o=n.arrowConfig,s=n.radius,l=s===void 0?5:s,a=n.getEdgeStyle(),u=n.getEdgeAnimationStyle(),c=S1(r.split(" ").map(function(f){return f.split(",").map(function(v){return+v})})),d=R1(c,l),h=Mn(Mn(Mn({style:i?u:{}},a),o),{fill:"none"});return ie("path",Mn({d},h))},e})(Vi);(function(t){wu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Yi);var xu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zr=function(){return zr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zr.apply(this,arguments)},es=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},ts=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},O1=(function(t){xu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.id,i=n.x,o=n.y,s=n.width,l=n.height,a=n.properties,u=this.props.model.getNodeStyle();return ie("svg",{x:i-s/2,y:o-l/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[a.labelText?ie("text",{x:0,y:-5,fontSize:"16px",fill:u.stroke},a.labelText):"",a.disabledDelete?"":ie("text",{x:a.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:u.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,r)},"x")])},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=n.id,a=this.props.model.getNodeStyle();return ie("g",{},[ie("rect",zr(zr({},a),{x:r-o/2,y:i-s/2,width:o,height:s,id:l})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(n){var r=this.props.graphModel;r.deleteNode(n)},e})(us),k1=(function(t){xu(e,t);function e(){var n=t.apply(this,ts([],es(arguments),!1))||this;return n.d=10,n.isResize=!1,n}return e.prototype.initNodeData=function(n){n.text={value:"",x:n.x,y:n.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,n),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var n=this,r;this.points=[],((r=this.properties)===null||r===void 0?void 0:r.node_selection_ids).length>1&&setTimeout(function(){var i;n.updatePointsByNodes(((i=n.properties)===null||i===void 0?void 0:i.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var r=n.x,i=n.y;this.x=r,this.y=i},e.prototype.updatePointsByNodes=function(n){var r=this,i=[],o=1/0,s=1/0,l=-1/0,a=-1/0;n.forEach(function(u){var c=r.graphModel.getNodeModelById(u);if(c){var d=c.width,h=c.height,f=c.x,v=c.y;o=Math.min(o,f-d/2-r.d),s=Math.min(s,v-h/2-r.d),l=Math.max(l,f+d/2+r.d),a=Math.max(a,v+h/2+r.d)}}),i.push([o,s],[l,s],[l,a],[o,a]),![o,s,l,a].some(function(u){return Math.abs(u)===1/0})&&(this.updatePoints(i),this.updateCoordinate({x:(l+o)/2,y:(a+s)/2}))},e.prototype.resize=function(n){var r;this.isResize=!0;for(var i=n.width,o=n.height,s={x:i/this.width,y:o/this.height},l=(this.properties.node_selection_ids||[]).slice(),a=[],u=new Set;l.length;){var c=l.shift(),d=(r=this.graphModel.nodesMap[c])===null||r===void 0?void 0:r.model;if(d){if(!_r(d)){a.push(d);continue}u.has(d.id)||(u.add(d.id),l.push.apply(l,ts([],es(d.properties.node_selection_ids||[]),!1)))}}var h={x:this.x-this.width/2,y:this.y-this.height/2},f=t.prototype.resize.call(this,n),v={x:this.x-this.width/2,y:this.y-this.height/2};return a.forEach(function(b){b.width=b.width*s.x,b.height=b.height*s.y;var w=(b.x-h.x)*s.x+v.x-b.x,T=(b.y-h.y)*s.y+v.y-b.y;b.move(w,T,!0)}),this.isResize=!1,f},e})(ls),Ui="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:Ui,view:O1,model:k1})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,r=this.lf.getGraphRawData(),i=n.filter(function(o){return o!==e.currentClickNode.id});return r.nodes.find(function(o){if(o.type==="node-selection"){var s=Ji(o,"properties.node_selection_ids",[]);return i.every(function(l){return s.includes(l)})}return!1})},t.prototype.onNodeChange=function(e,n){var r=e.graphModel.nodes.filter(function(i){if(!_r(i))return!1;var o=i.properties.node_selection_ids||[];return o.includes(n.id)});Promise.resolve().then(function(){r.forEach(function(i){i.updatePointsByNodes(i.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(r){var i;if(!(!r.e.shiftKey||r.data.type===Ui)){n.currentClickNode=r.data;var o=!1;n.selectNodesIds.includes(r.data.id)&&((i=n.lf.getNodeModelById(r.data.id))===null||i===void 0||i.setSelected(!1),o=!0);var s=e.getSelectElements(!0).nodes;n.selectNodes=s,n.selectNodes.length===1?o?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(r,i,o){if(n.onNodeChange(e,r),_r(r)&&!r.isResize){var s=r.properties.node_selection_ids||[];return e.graphModel.moveNodes(s,i,o,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(r){return _r(r)||n.onNodeChange(e,r),!0})},t.pluginName="node-selection",t})();var _r=function(t){return!!(t&&t.type===Ui)},M1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Gr=function(){return Gr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gr.apply(this,arguments)};(function(t){M1(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=n.properties;return ie("text",{x:r-o/2+5,y:i-s/2+16,fontSize:12,fill:"blue"},l.moreText)},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,s=n.height,l=this.props.model.getNodeStyle();return ie("g",{},[ie("rect",Gr(Gr({},l),{fill:"#FFFFFF",x:r-o/2,y:i-s/2})),this.getLabelShape()])},e})(ar);const Eu="2 2 20 20",Cu=`
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="${Eu}">
|
||
<path fill="currentColor" d="M17 13h-4v4h-2v-4H7v-2h4V7h2v4h4m-5-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"/>
|
||
</svg>
|
||
`,P1=`
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="${Eu}">
|
||
<path fill="currentColor" d="M12 20a8 8 0 0 1-8-8a8 8 0 0 1 8-8a8 8 0 0 1 8 8a8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2" />
|
||
</svg>
|
||
`,qi=18,L1=qi/2;class D1 extends Gu{constructor(e){super(e)}setHtml(e){const n=document.createElement("div");n.className=`${Oi}-content`,n.dataset.nodeId=this.props.model.id,this.root=n,e.appendChild(n),super.renderVueComponent()}confirmUpdate(e){}getAnchorShape(e){const{x:n,y:r,type:i,allowAdd:o}=e,s=i==="top",l=i==="left",a=typeof o=="boolean"?o:i==="right",u=(()=>{const d=l?"targetAnchorId":"sourceAnchorId";return this.props.graphModel.edges.some(h=>h[d]===e.id)})(),c=a?d=>{d.preventDefault(),d.stopPropagation(),this.props.graphModel.$J.doAction("toggle-add-node-drawer",{event:d,node:this.props.model,anchor:e})}:void 0;return ie("foreignObject",Ro(To({},e),{width:qi,height:qi,x:l||s?n-10:n-8,y:r-L1,style:{"pointer-events":a?void 0:"none"}}),[ie("div",{className:[`${Oi}-anchor`,`${l?"left":"right"}`,`${u?"has-edge":""}`,`${a?"has-add":""}`].join(" "),onClick:c,dangerouslySetInnerHTML:{__html:`${P1}${a?Cu:""}`}})])}}function I1(t){const e={getActionRender:r.bind(t),getActionShape:n.bind(t)};function n(){if(this.props.model.isDisabled)return ie("g",{});const{startPoint:i,endPoint:o,pointsList:s}=this.props.model;let l,a;if(s&&s.length===4){const[u,c,d,h]=s;l=.125*u.x+.375*c.x+.375*d.x+.125*h.x,a=.125*u.y+.375*c.y+.375*d.y+.125*h.y}else l=(i.x+o.x)/2,a=(i.y+o.y)/2;return ie("foreignObject",{style:{},x:l-pr/2,y:a-pr/2,width:pr,height:pr},e.getActionRender())}function r(){const{isSilentMode:i}=this.props.graphModel.editConfigModel,o=i?!1:this.props.model.isHovered;return ie("div",{className:`${Oi}-edge-action ${o?"hover":""}`,onClick:s=>{s.preventDefault(),s.stopPropagation(),this.props.graphModel.deleteEdgeById(this.props.model.id),this.props.graphModel.$J.repaintGraph()},dangerouslySetInnerHTML:{__html:Cu}})}return e}class B1 extends zu{constructor(){super(),this.$hook=I1(this)}getEdge(){const e=super.getEdge(),n=this.props.model.isHovered,{isSilentMode:r}=this.props.graphModel.editConfigModel;return!r&&n&&(e.props.stroke="#1890ff"),e}getAppendWidth(){const e=this.$hook;return ie("g",{},super.getAppendWidth(),e.getActionShape())}getStartArrow(){return ie("g",{})}getEndArrow(){return ie("g",{})}toFront(){}}class F1 extends $u{get isDisabled(){var e,n;return(n=(e=this.properties)==null?void 0:e.disabled)!=null?n:!1}initEdgeData(e){e.id||(e.id=is()),super.initEdgeData(e)}getData(){return{id:this.id,type:this.type,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,pointsList:this.pointsList,properties:this.properties}}getEdgeStyle(){const e=super.getEdgeStyle();return e.stroke="#afafaf",e.strokeWidth=2,e}getOutlineStyle(){const e=super.getOutlineStyle();return e.stroke="none",e.hover&&(e.hover.stroke="none"),e}getEdgeAnimationStyle(){var e;const n=super.getEdgeAnimationStyle(),r=(e=this.properties)==null?void 0:e.runStatus;return r==="running"?n.stroke="#67b7ff":r==="success"?n.stroke="#52c41a":r==="fail"&&(n.stroke="#f5222d"),n}}const j1={type:"base-line-edge",view:B1,model:F1};class H1 extends ko.view{constructor(e){super(e),this.$super=new D1(e)}getOperateIcon(){return ie("g",{})}get ref(){return this.$super.ref}set ref(e){this.$super.ref=e}get currentProperties(){return this.$super.currentProperties}set currentProperties(e){this.$super.currentProperties=e}get preProperties(){return this.$super.preProperties}set preProperties(e){this.$super.preProperties=e}get rootEl(){return this.$super.rootEl}setHtml(e){this.$super.setHtml.call(this,e)}shouldUpdate(){return this.$super.shouldUpdate.call(this)}componentDidMount(){this.$super.componentDidMount.call(this)}componentDidUpdate(){this.$super.componentDidUpdate.call(this)}componentWillUnmount(){this.$super.componentWillUnmount.call(this)}getShape(){return ie("g",{},[this.getAppendAreaShape(),this.$super.getShape.call(this),this.getOperateIcon()])}confirmUpdate(e){this.$super.confirmUpdate.call(this,e)}getAnchorShape(e){return this.$super.getAnchorShape.call(this,e)}get root(){return this.$super.root}set root(e){this.$super.root=e}get vm(){return this.$super.vm}set vm(e){this.$super.vm=e}getComponentContainer(){return this.$super.getComponentContainer.call(this)}targetId(){return this.$super.targetId.call(this)}renderVueComponent(){this.$super.renderVueComponent.call(this)}unmountVueComponent(){this.$super.unmountVueComponent.call(this)}unmount(){this.$super.unmount.call(this)}}const Ki=new Map;function Jn(t){let e=Ki.get(t);return e||(e={},Ki.set(t,e)),e}function W1(t){var e;return t.id||(t.id=is()),t.properties=Ro(To({},t.properties),{collapsible:!1,autoToFront:!1,transformWithContainer:!1,isRestrict:!0,autoResize:!0,children:(e=t.properties.children)!=null?e:[]}),t}class $1 extends ko.model{constructor(e,n){super(W1(e),n),this.$super=new qu(e,n),this.sourceRules.push(...this.$super.sourceRules),this.targetRules.push(...this.$super.targetRules),this.setTempData()}get $children(){var e,n,r;return(r=(n=(e=this.$super)==null?void 0:e.properties)==null?void 0:n.children)!=null?r:[]}isAllowAppendIn(e){return this.$children.includes(e.id)}getOutlineStyle(){const e=super.getOutlineStyle();return e.stroke="none",e.hover&&(e.hover.stroke="none"),e}addChild(e){super.addChild(e);const n=[...this.$children];n.push(e),this.$super.properties.children=n,this.graphModel.$J.$groupUtils.recalcGroupSize(this.id)}removeChild(e){super.removeChild(e);const n=[...this.$children];this.$super.properties.children=n.filter(r=>r!==e),this.graphModel.$J.$groupUtils.recalcGroupSize(this.id)}getAddableOutlineStyle(){return{stroke:"none",fill:"transparent"}}get width(){var e,n;const r=Jn(this);return(n=(e=this.$super)==null?void 0:e.width)!=null?n:r.width}set width(e){if(!this.$super){const n=Jn(this);n.width=e;return}this.$super.width=e}get height(){var e,n;const r=Jn(this);return(n=(e=this.$super)==null?void 0:e.height)!=null?n:r.height}set height(e){if(!this.$super){const n=Jn(this);n.height=e;return}this.$super.height=e}get nodeConfig(){var e;return(e=this.$super)==null?void 0:e.nodeConfig}getDefaultAnchor(){return this.$super.getDefaultAnchor.call(this)}getAnchorLineStyle(...e){return this.$super.getAnchorLineStyle.call(this,...e)}setAttributes(){var e,n;return((n=(e=this.$super)==null?void 0:e.setAttributes)!=null?n:super.setAttributes).call(this)}getNodeStyle(){var e,n;return((n=(e=this.$super)==null?void 0:e.getNodeStyle)!=null?n:super.getNodeStyle).call(this)}setTempData(){const e=Jn(this);Object.keys(e).forEach(n=>{this[n]=e[n]}),Ki.delete(this)}}const Ti=320,Ri=240,_u=ud({__name:"LoopBodyNode",props:{node:{},graph:{}},setup(t){const e=t,n=yi(),r=cc(),i=yi(Ti),o=yi(Ri),{containerRef:s,containerProps:l,$node:a,runStatus:u}=uc(e,{hideAction:!0,addNodeDialogConfig:{addPayload:{edgeType:j1.type},offset:{showTop:0,showRight:300}},updateHeightImmediate:!1,disableResizeListener:!0,listenForeignObjectResize:!0,onParentResize(h){i.value=h.width,i.value<Ti&&(i.value=Ti),o.value=h.height,o.value<Ri&&(o.value=Ri),e.node.setProperties({width:i.value,height:o.value})},addNodeIsShow:h=>q1(h)}),c=yd(()=>{var h;return Su((h=a.value)==null?void 0:h.id)});function d(){return r.nodeSteps.find(h=>h.node.id===c.value)}return dd(()=>{const{graph:h,node:f}=e,v=h.getNodeEdges(f.id),b=u.value[0];for(const w of v)b&&b!=="waiting"?w.openEdgeAnimation():w.closeEdgeAnimation()}),hd(()=>{}),(h,f)=>(fd(),cd(jo(Tu),vd({ref_key:"containerRef",ref:s,class:"loop-body-node",width:i.value,runGetStepFn:d},jo(l)),{default:pd(()=>[gd("div",{ref_key:"contentRef",ref:n,style:md({width:"100%",height:o.value-50-16+"px",backgroundColor:"transparent",position:"relative",borderRadius:"8px",pointerEvents:"none"})},null,4)]),_:1},16,["width"]))}});class z1 extends H1{}class G1 extends $1{}const ns={type:mn.LOOP_BODY,label:"循环体",components:{icon:lc,setting:Ru},lfNode:{type:mn.LOOP_BODY,view:z1,model:G1,component:_u},params:{width:320,height:240},methods:{createNode:Au,getDefaultAnchor(t){const e=t.find(r=>r.type==="left"),n=t.find(r=>r.type==="right");return[{id:`${this.id}_${gn.LINK_LOOP}`,type:gn.LINK_LOOP,x:this.x,y:this.y-this.height/2},{id:`${this.id}_${gn.LOOP_START}`,type:gn.LOOP_START,allowAdd:!0,x:e.x+30,y:this.y+25},{id:`${this.id}_${gn.LOOP_END}`,type:gn.LOOP_END,allowAdd:!1,x:n.x-30,y:this.y+25}]}},hooks:{beforeRemoveNode(){return!1}}};function Au(t){var e;const{loopNodeId:n}=t;return{id:n+os,type:ns.type,x:t.x,y:t.y,properties:{text:(e=t.text)!=null?e:ns.label,options:{},inputParams:[],outputParams:[]}}}const U1=ku();function q1(t){return t===mn.LOOP||t===mn.END?!1:t===mn.LOOP_CONTINUE||t===mn.LOOP_BREAK||t===mn.SET_LOOP_VAR?!0:Ou.isShow(t)}function uw(t){const e=U1.nodeGroupMap.get(t);return Su(e)}function Su(t){if(t)return t.slice(0,-os.length)}const K1=320;function cw(t,e){if(!t||!e)return;const n=t.id,r={x:t.x,y:t.y+t.height+K1},i=Au(Ro(To({},r),{loopNodeId:n})),o=e.addNode(i),s=`${n}_${Uu.LINK_BODY}`,l=`${o.id}_${gn.LINK_LOOP}`;setTimeout(()=>{e.addEdge({sourceNodeId:n,sourceAnchorId:s,targetNodeId:o.id,targetAnchorId:l,properties:{disabled:!0}})},50)}const dw=Object.freeze(Object.defineProperty({__proto__:null,default:_u},Symbol.toStringTag,{value:"Module"}));export{lw as B,q1 as E,cw as F,uw as H,dw as L,I1 as c,D1 as d,ns as n,j1 as p,m0 as u};
|